Project Files

๐Ÿ“ .bolt
๐Ÿ“„ config.json
{ "template": "bolt-vite-react-ts" }
๐Ÿ“„ prompt
For all designs I ask you to make, have them be beautiful, not cookie cutter. Make webpages that are fully featured and worthy for production. By default, this template supports JSX syntax with Tailwind CSS classes, React hooks, and Lucide React for icons. Do not install other packages for UI themes, icons, etc unless absolutely necessary or I request them. Use icons from lucide-react for logos.
๐Ÿ“ .netlify
๐Ÿ“ blobs-serve
๐Ÿ“ functions-internal
๐Ÿ“ functions-serve
๐Ÿ“ lightx-proxy
๐Ÿ“„ ___netlify-telemetry.mjs
var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from"module";const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=>{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lz(e))!uz.call(r,s)&&s!==t&&xu(r,s,{get:()=>e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=>(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,"default",{value:r,enumerable:!0}):t,r)),ee=r=>NR(xu({},"__esModule",{value:!0}),r);var CR,PR=p(()=>{CR=typeof globalThis=="object"?globalThis:global});var IR=p(()=>{PR()});var bR=p(()=>{IR()});var cn,hm=p(()=>{cn="1.9.0"});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&&s.patch<=u.patch?i(l):a(l):s.minor<=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=>{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&&(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&&s!==void 0?s:{version:cn};if(!o&&a[r]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+r+" does not match previously registered API v"+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug("@opentelemetry/api: Registered a global for "+r+" v"+cn+"."),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug("@opentelemetry/api: Unregistering a global for "+r+" v"+cn+".");var t=Fa[Va];t&&delete t[r]}var pz,Va,Fa,Ei=p(()=>{bR();hm();MR();pz=cn.split(".")[0],Va=Symbol.for("opentelemetry.js.api."+pz),Fa=CR});function Ga(r,e,t){var o=xt("diag");if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=>{Ei();dz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||"DiagComponentLogger"}return r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("debug",this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("error",this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("info",this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("warn",this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("verbose",this._namespace,e)},r})()});var H,Mu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(H||(H={}))});function UR(r,e){r<H.NONE?r=H.NONE:r>H.ALL&&(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a=="function"&&r>=s?a.bind(e):function(){}}return{error:t("error",H.ERROR),warn:t("warn",H.WARN),info:t("info",H.INFO),debug:t("debug",H.DEBUG),verbose:t("verbose",H.VERBOSE)}}var kR=p(()=>{Mu()});var _z,Ez,mz,ft,mi=p(()=>{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz="diag",ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var n=xt("diag");if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&&(a={logLevel:H.INFO}),s===t){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((i=c.stack)!==null&&i!==void 0?i:c.message),!1}typeof a=="number"&&(a={logLevel:a});var u=xt("diag"),f=UR((n=a.logLevel)!==null&&n!==void 0?n:H.INFO,s);if(u&&!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+_),f.warn("Current logger will overwrite one already registered from "+_)}return Ir("diag",f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=>{Tz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=>{FR=Symbol("BaggageEntryMetadata")});function HR(r){return r===void 0&&(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!="string"&&(gz.error("Cannot create baggage metadata from unknown type: "+typeof r),r=""),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=>{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=>{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=>{Em=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!="function"&&(i=console.log),typeof i=="function")return i.apply(console,s)}}}for(var t=0;t<Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=>{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=>{(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=>{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&&(r[e]=t)}}});var kz,Bz,YR,zR=p(()=>{Ha();kz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=>{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm="context",Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=>{ym();ja="0000000000000000",Ya="00000000000000000000000000000000",Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=>{Fu();Pn=(function(){function r(e){e===void 0&&(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=>{Ha();Gu();qa();Om=De("OpenTelemetry Context Key SPAN")});function Mt(r){return Hz.test(r)&&r!==Ya}function Si(r){return qz.test(r)&&r!==ja}function xe(r){return Mt(r.traceId)&&Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=>{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r=="object"&&typeof r.spanId=="string"&&typeof r.traceId=="string"&&typeof r.traceFlags=="number"}var Rm,Yu,Nm=p(()=>{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&&(o=Rm.active());var s=!!(t!=null&&t.root);if(s)return new Pn;var a=o&&qu(o);return jz(a)&&xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length<2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=>{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=>{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=>{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&&s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(ke||(ke={}))});var qt,eN=p(()=>{(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(qt||(qt={}))});var jt,tN=p(()=>{(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&&!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=>{Im="[_0-9a-z-*/]",Kz="[a-z]"+Im+"{0,255}",$z="[a-z0-9]"+Im+"{0,240}@[a-z]"+Im+"{0,13}",Xz=new RegExp("^(?:"+Kz+"|"+$z+")$"),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=>{iN();oN=32,Qz=512,sN=",",aN="=",lN=(function(){function r(e){this._internalState=new Map,e&&this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length>Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&&nN(n)&&t.set(i,n)}return t},new Map),this._internalState.size>oN&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=>{cN()});var he,pN=p(()=>{qa();he=Cn.getInstance()});var S,dN=p(()=>{mi();S=ft.instance()});var Zz,hN,_N=p(()=>{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=>{_N();Ei();mi();bm="metrics",EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=>{mN();gi=EN.getInstance()});var SN,gN=p(()=>{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=>{qa();Ha();Lm=De("OpenTelemetry Baggage Key")});var Mm,eK,RN,NN=p(()=>{Ei();gN();gm();AN();_m();mi();Mm="propagation",eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&&(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&&(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=>{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=>{Ei();Pm();ju();Am();mi();wm="trace",PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=>{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=>Du,DiagLogLevel:()=>H,INVALID_SPANID:()=>ja,INVALID_SPAN_CONTEXT:()=>Uo,INVALID_TRACEID:()=>Ya,ProxyTracer:()=>zu,ProxyTracerProvider:()=>Ka,ROOT_CONTEXT:()=>wu,SamplingDecision:()=>ke,SpanKind:()=>qt,SpanStatusCode:()=>jt,TraceFlags:()=>se,ValueType:()=>Ot,baggageEntryMetadataFromString:()=>Lr,context:()=>he,createContextKey:()=>De,createNoopMeter:()=>ku,createTraceState:()=>uN,default:()=>tK,defaultTextMapGetter:()=>Bu,defaultTextMapSetter:()=>Vu,diag:()=>S,isSpanContextValid:()=>xe,isValidSpanId:()=>Si,isValidTraceId:()=>Mt,metrics:()=>gi,propagation:()=>Ue,trace:()=>ie});var tK,P=p(()=>{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o<t;o++){var s=r[o];s&&(e[String(s).toUpperCase().replace(/[-.]/g,"_")]=s)}return e}var Dm=p(()=>{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=>{Dm();MN="aws.lambda.invoked_arn",wN="db.system",DN="db.connection_string",UN="db.user",kN="db.jdbc.driver_classname",BN="db.name",VN="db.statement",FN="db.operation",GN="db.mssql.instance_name",HN="db.cassandra.keyspace",qN="db.cassandra.page_size",jN="db.cassandra.consistency_level",YN="db.cassandra.table",zN="db.cassandra.idempotence",KN="db.cassandra.speculative_execution_count",$N="db.cassandra.coordinator.id",XN="db.cassandra.coordinator.dc",WN="db.hbase.namespace",JN="db.redis.database_index",QN="db.mongodb.collection",ZN="db.sql.table",eC="exception.type",tC="exception.message",rC="exception.stacktrace",nC="exception.escaped",iC="faas.trigger",oC="faas.execution",sC="faas.document.collection",aC="faas.document.operation",lC="faas.document.time",cC="faas.document.name",uC="faas.time",fC="faas.cron",pC="faas.coldstart",dC="faas.invoked_name",hC="faas.invoked_provider",_C="faas.invoked_region",EC="net.transport",mC="net.peer.ip",TC="net.peer.port",SC="net.peer.name",gC="net.host.ip",vC="net.host.port",yC="net.host.name",OC="net.host.connection.type",AC="net.host.connection.subtype",RC="net.host.carrier.name",NC="net.host.carrier.mcc",CC="net.host.carrier.mnc",PC="net.host.carrier.icc",IC="peer.service",bC="enduser.id",LC="enduser.role",xC="enduser.scope",MC="thread.id",wC="thread.name",DC="code.function",UC="code.namespace",kC="code.filepath",BC="code.lineno",VC="http.method",FC="http.url",GC="http.target",HC="http.host",qC="http.scheme",jC="http.status_code",YC="http.flavor",zC="http.user_agent",KC="http.request_content_length",$C="http.request_content_length_uncompressed",XC="http.response_content_length",WC="http.response_content_length_uncompressed",JC="http.server_name",QC="http.route",ZC="http.client_ip",eP="aws.dynamodb.table_names",tP="aws.dynamodb.consumed_capacity",rP="aws.dynamodb.item_collection_metrics",nP="aws.dynamodb.provisioned_read_capacity",iP="aws.dynamodb.provisioned_write_capacity",oP="aws.dynamodb.consistent_read",sP="aws.dynamodb.projection",aP="aws.dynamodb.limit",lP="aws.dynamodb.attributes_to_get",cP="aws.dynamodb.index_name",uP="aws.dynamodb.select",fP="aws.dynamodb.global_secondary_indexes",pP="aws.dynamodb.local_secondary_indexes",dP="aws.dynamodb.exclusive_start_table",hP="aws.dynamodb.table_count",_P="aws.dynamodb.scan_forward",EP="aws.dynamodb.segment",mP="aws.dynamodb.total_segments",TP="aws.dynamodb.count",SP="aws.dynamodb.scanned_count",gP="aws.dynamodb.attribute_definitions",vP="aws.dynamodb.global_secondary_index_updates",yP="messaging.system",OP="messaging.destination",AP="messaging.destination_kind",RP="messaging.temp_destination",NP="messaging.protocol",CP="messaging.protocol_version",PP="messaging.url",IP="messaging.message_id",bP="messaging.conversation_id",LP="messaging.message_payload_size_bytes",xP="messaging.message_payload_compressed_size_bytes",MP="messaging.operation",wP="messaging.consumer_id",DP="messaging.rabbitmq.routing_key",UP="messaging.kafka.message_key",kP="messaging.kafka.consumer_group",BP="messaging.kafka.client_id",VP="messaging.kafka.partition",FP="messaging.kafka.tombstone",GP="rpc.system",HP="rpc.service",qP="rpc.method",jP="rpc.grpc.status_code",YP="rpc.jsonrpc.version",zP="rpc.jsonrpc.request_id",KP="rpc.jsonrpc.error_code",$P="rpc.jsonrpc.error_message",XP="message.type",WP="message.id",JP="message.compressed_size",QP="message.uncompressed_size",rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP="other_sql",eI="mssql",tI="mysql",rI="oracle",nI="db2",iI="postgresql",oI="redshift",sI="hive",aI="cloudscape",lI="hsqldb",cI="progress",uI="maxdb",fI="hanadb",pI="ingres",dI="firstsql",hI="edb",_I="cache",EI="adabas",mI="firebird",TI="derby",SI="filemaker",gI="informix",vI="instantdb",yI="interbase",OI="mariadb",AI="netezza",RI="pervasive",NI="pointbase",CI="sqlite",PI="sybase",II="teradata",bI="vertica",LI="h2",xI="coldfusion",MI="cassandra",wI="hbase",DI="mongodb",UI="redis",kI="couchbase",BI="couchdb",VI="cosmosdb",FI="dynamodb",GI="neo4j",HI="geode",qI="elasticsearch",jI="memcached",YI="cockroachdb",gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI="all",KI="each_quorum",$I="quorum",XI="local_quorum",WI="one",JI="two",QI="three",ZI="local_one",eb="any",tb="serial",rb="local_serial",hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb="datasource",ib="http",ob="pubsub",sb="timer",ab="other",NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb="insert",cb="edit",ub="delete",xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb="alibaba_cloud",pb="aws",db="azure",hb="gcp",UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b="ip_tcp",Eb="ip_udp",mb="ip",Tb="unix",Sb="pipe",gb="inproc",vb="other",GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb="wifi",Ob="wired",Ab="cell",Rb="unavailable",Nb="unknown",XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb="gprs",Pb="edge",Ib="umts",bb="cdma",Lb="evdo_0",xb="evdo_a",Mb="cdma2000_1xrtt",wb="hsdpa",Db="hsupa",Ub="hspa",kb="iden",Bb="evdo_b",Vb="lte",Fb="ehrpd",Gb="hspap",Hb="gsm",qb="td_scdma",jb="iwlan",Yb="nr",zb="nrnsa",Kb="lte_ca",t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b="1.0",Xb="1.1",Wb="2.0",Jb="SPDY",Qb="QUIC",O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb="queue",eL="topic",I8=Zb,b8=eL,L8=Be([Zb,eL]),tL="receive",rL="process",x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL="SENT",vL="RECEIVED",Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=>{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=>{Dm();AL="cloud.provider",RL="cloud.account.id",NL="cloud.region",CL="cloud.availability_zone",PL="cloud.platform",IL="aws.ecs.container.arn",bL="aws.ecs.cluster.arn",LL="aws.ecs.launchtype",xL="aws.ecs.task.arn",ML="aws.ecs.task.family",wL="aws.ecs.task.revision",DL="aws.eks.cluster.arn",UL="aws.log.group.names",kL="aws.log.group.arns",BL="aws.log.stream.names",VL="aws.log.stream.arns",FL="container.name",GL="container.id",HL="container.runtime",qL="container.image.name",jL="container.image.tag",YL="deployment.environment",zL="device.id",KL="device.model.identifier",$L="device.model.name",XL="faas.name",WL="faas.id",JL="faas.version",QL="faas.instance",ZL="faas.max_memory",e0="host.id",t0="host.name",r0="host.type",n0="host.arch",i0="host.image.name",o0="host.image.id",s0="host.image.version",a0="k8s.cluster.name",l0="k8s.node.name",c0="k8s.node.uid",u0="k8s.namespace.name",f0="k8s.pod.uid",p0="k8s.pod.name",d0="k8s.container.name",h0="k8s.replicaset.uid",_0="k8s.replicaset.name",E0="k8s.deployment.uid",m0="k8s.deployment.name",T0="k8s.statefulset.uid",S0="k8s.statefulset.name",g0="k8s.daemonset.uid",v0="k8s.daemonset.name",y0="k8s.job.uid",O0="k8s.job.name",A0="k8s.cronjob.uid",R0="k8s.cronjob.name",N0="os.type",C0="os.description",P0="os.name",I0="os.version",b0="process.pid",L0="process.executable.name",x0="process.executable.path",M0="process.command",w0="process.command_line",D0="process.command_args",U0="process.owner",k0="process.runtime.name",B0="process.runtime.version",V0="process.runtime.description",F0="service.name",G0="service.namespace",H0="service.instance.id",q0="service.version",j0="telemetry.sdk.name",Y0="telemetry.sdk.language",z0="telemetry.sdk.version",K0="telemetry.auto.version",$0="webengine.name",X0="webengine.version",W0="webengine.description",r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0="alibaba_cloud",Q0="aws",Z0="azure",ex="gcp",f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx="alibaba_cloud_ecs",rx="alibaba_cloud_fc",nx="aws_ec2",ix="aws_ecs",ox="aws_eks",sx="aws_lambda",ax="aws_elastic_beanstalk",lx="azure_vm",cx="azure_container_instances",ux="azure_aks",fx="azure_functions",px="azure_app_service",dx="gcp_compute_engine",hx="gcp_cloud_run",_x="gcp_kubernetes_engine",Ex="gcp_cloud_functions",mx="gcp_app_engine",E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx="ec2",Sx="fargate",w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx="amd64",vx="arm32",yx="arm64",Ox="ia64",Ax="ppc32",Rx="ppc64",Nx="x86",k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx="windows",Px="linux",Ix="darwin",bx="freebsd",Lx="netbsd",xx="openbsd",Mx="dragonflybsd",wx="hpux",Dx="aix",Ux="solaris",kx="z_os",Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx="cpp",Vx="dotnet",Fx="erlang",Gx="go",Hx="java",qx="nodejs",jx="php",Yx="python",zx="ruby",Kx="webjs",n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=>{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=>{d9="aspnetcore.rate_limiting.result",h9="acquired",_9="endpoint_limiter",E9="global_limiter",m9="request_canceled",T9="telemetry.sdk.language",S9="cpp",g9="dotnet",v9="erlang",y9="go",O9="java",A9="nodejs",R9="php",N9="python",C9="ruby",P9="rust",I9="swift",b9="webjs",L9="telemetry.sdk.name",x9="telemetry.sdk.version",M9="aspnetcore.diagnostics.handler.type",w9="aspnetcore.diagnostics.exception.result",D9="aborted",U9="handled",k9="skipped",B9="unhandled",V9="aspnetcore.rate_limiting.policy",F9="aspnetcore.request.is_unhandled",G9="aspnetcore.routing.is_fallback",H9="aspnetcore.routing.match_status",q9="failure",j9="success",Y9="client.address",z9="client.port",K9="error.type",$9="_OTHER",X9="exception.escaped",W9="exception.message",J9="exception.stacktrace",Q9="exception.type",Z9=function(r){return"http.request.header."+r},eJ="http.request.method",tJ="_OTHER",rJ="CONNECT",nJ="DELETE",iJ="GET",oJ="HEAD",sJ="OPTIONS",aJ="PATCH",lJ="POST",cJ="PUT",uJ="TRACE",fJ="http.request.method_original",pJ="http.request.resend_count",dJ=function(r){return"http.response.header."+r},hJ="http.response.status_code",_J="http.route",EJ="jvm.gc.action",mJ="jvm.gc.name",TJ="jvm.memory.pool.name",SJ="jvm.memory.type",gJ="heap",vJ="non_heap",yJ="jvm.thread.daemon",OJ="jvm.thread.state",AJ="blocked",RJ="new",NJ="runnable",CJ="terminated",PJ="timed_waiting",IJ="waiting",bJ="network.local.address",LJ="network.local.port",xJ="network.peer.address",MJ="network.peer.port",wJ="network.protocol.name",DJ="network.protocol.version",UJ="network.transport",kJ="pipe",BJ="quic",VJ="tcp",FJ="udp",GJ="unix",HJ="network.type",qJ="ipv4",jJ="ipv6",YJ="otel.scope.name",zJ="otel.scope.version",KJ="otel.status_code",$J="ERROR",XJ="OK",WJ="otel.status_description",JJ="server.address",QJ="server.port",ZJ="service.name",eQ="service.version",tQ="signalr.connection.status",rQ="app_shutdown",nQ="normal_closure",iQ="timeout",oQ="signalr.transport",sQ="long_polling",aQ="server_sent_events",lQ="web_sockets",cQ="url.fragment",uQ="url.full",fQ="url.path",pQ="url.query",dQ="url.scheme",hQ="user_agent.original"});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=>{_Q="aspnetcore.diagnostics.exceptions",EQ="aspnetcore.rate_limiting.active_request_leases",mQ="aspnetcore.rate_limiting.queued_requests",TQ="aspnetcore.rate_limiting.request.time_in_queue",SQ="aspnetcore.rate_limiting.request_lease.duration",gQ="aspnetcore.rate_limiting.requests",vQ="aspnetcore.routing.match_attempts",yQ="http.client.request.duration",OQ="http.server.request.duration",AQ="jvm.class.count",RQ="jvm.class.loaded",NQ="jvm.class.unloaded",CQ="jvm.cpu.count",PQ="jvm.cpu.recent_utilization",IQ="jvm.cpu.time",bQ="jvm.gc.duration",LQ="jvm.memory.committed",xQ="jvm.memory.limit",MQ="jvm.memory.used",wQ="jvm.memory.used_after_last_gc",DQ="jvm.thread.count",UQ="kestrel.active_connections",kQ="kestrel.active_tls_handshakes",BQ="kestrel.connection.duration",VQ="kestrel.queued_connections",FQ="kestrel.queued_requests",GQ="kestrel.rejected_connections",HQ="kestrel.tls_handshake.duration",qQ="kestrel.upgraded_connections",jQ="signalr.server.active_connections",YQ="signalr.server.connection.duration"});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>H9,ATTR_CLIENT_ADDRESS:()=>Y9,ATTR_CLIENT_PORT:()=>z9,ATTR_ERROR_TYPE:()=>K9,ATTR_EXCEPTION_ESCAPED:()=>X9,ATTR_EXCEPTION_MESSAGE:()=>W9,ATTR_EXCEPTION_STACKTRACE:()=>J9,ATTR_EXCEPTION_TYPE:()=>Q9,ATTR_HTTP_REQUEST_HEADER:()=>Z9,ATTR_HTTP_REQUEST_METHOD:()=>eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>pJ,ATTR_HTTP_RESPONSE_HEADER:()=>dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>hJ,ATTR_HTTP_ROUTE:()=>_J,ATTR_JVM_GC_ACTION:()=>EJ,ATTR_JVM_GC_NAME:()=>mJ,ATTR_JVM_MEMORY_POOL_NAME:()=>TJ,ATTR_JVM_MEMORY_TYPE:()=>SJ,ATTR_JVM_THREAD_DAEMON:()=>yJ,ATTR_JVM_THREAD_STATE:()=>OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=>bJ,ATTR_NETWORK_LOCAL_PORT:()=>LJ,ATTR_NETWORK_PEER_ADDRESS:()=>xJ,ATTR_NETWORK_PEER_PORT:()=>MJ,ATTR_NETWORK_PROTOCOL_NAME:()=>wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=>DJ,ATTR_NETWORK_TRANSPORT:()=>UJ,ATTR_NETWORK_TYPE:()=>HJ,ATTR_OTEL_SCOPE_NAME:()=>YJ,ATTR_OTEL_SCOPE_VERSION:()=>zJ,ATTR_OTEL_STATUS_CODE:()=>KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=>WJ,ATTR_SERVER_ADDRESS:()=>JJ,ATTR_SERVER_PORT:()=>QJ,ATTR_SERVICE_NAME:()=>ZJ,ATTR_SERVICE_VERSION:()=>eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=>tQ,ATTR_SIGNALR_TRANSPORT:()=>oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=>T9,ATTR_TELEMETRY_SDK_NAME:()=>L9,ATTR_TELEMETRY_SDK_VERSION:()=>x9,ATTR_URL_FRAGMENT:()=>cQ,ATTR_URL_FULL:()=>uQ,ATTR_URL_PATH:()=>fQ,ATTR_URL_QUERY:()=>pQ,ATTR_URL_SCHEME:()=>dQ,ATTR_USER_AGENT_ORIGINAL:()=>hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=>w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>D7,AwsEcsLaunchtypeValues:()=>U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>m7,CLOUDPLATFORMVALUES_AWS_EC2:()=>T7,CLOUDPLATFORMVALUES_AWS_ECS:()=>S7,CLOUDPLATFORMVALUES_AWS_EKS:()=>g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=>R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>N7,CLOUDPLATFORMVALUES_AZURE_VM:()=>O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>f7,CLOUDPROVIDERVALUES_AWS:()=>p7,CLOUDPROVIDERVALUES_AZURE:()=>d7,CLOUDPROVIDERVALUES_GCP:()=>h7,CloudPlatformValues:()=>M7,CloudProviderValues:()=>_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>SW,DBSYSTEMVALUES_ADABAS:()=>kX,DBSYSTEMVALUES_CACHE:()=>UX,DBSYSTEMVALUES_CASSANDRA:()=>eW,DBSYSTEMVALUES_CLOUDSCAPE:()=>PX,DBSYSTEMVALUES_COCKROACHDB:()=>pW,DBSYSTEMVALUES_COLDFUSION:()=>ZX,DBSYSTEMVALUES_COSMOSDB:()=>sW,DBSYSTEMVALUES_COUCHBASE:()=>iW,DBSYSTEMVALUES_COUCHDB:()=>oW,DBSYSTEMVALUES_DB2:()=>AX,DBSYSTEMVALUES_DERBY:()=>VX,DBSYSTEMVALUES_DYNAMODB:()=>aW,DBSYSTEMVALUES_EDB:()=>DX,DBSYSTEMVALUES_ELASTICSEARCH:()=>uW,DBSYSTEMVALUES_FILEMAKER:()=>FX,DBSYSTEMVALUES_FIREBIRD:()=>BX,DBSYSTEMVALUES_FIRSTSQL:()=>wX,DBSYSTEMVALUES_GEODE:()=>cW,DBSYSTEMVALUES_H2:()=>QX,DBSYSTEMVALUES_HANADB:()=>xX,DBSYSTEMVALUES_HBASE:()=>tW,DBSYSTEMVALUES_HIVE:()=>CX,DBSYSTEMVALUES_HSQLDB:()=>IX,DBSYSTEMVALUES_INFORMIX:()=>GX,DBSYSTEMVALUES_INGRES:()=>MX,DBSYSTEMVALUES_INSTANTDB:()=>HX,DBSYSTEMVALUES_INTERBASE:()=>qX,DBSYSTEMVALUES_MARIADB:()=>jX,DBSYSTEMVALUES_MAXDB:()=>LX,DBSYSTEMVALUES_MEMCACHED:()=>fW,DBSYSTEMVALUES_MONGODB:()=>rW,DBSYSTEMVALUES_MSSQL:()=>vX,DBSYSTEMVALUES_MYSQL:()=>yX,DBSYSTEMVALUES_NEO4J:()=>lW,DBSYSTEMVALUES_NETEZZA:()=>YX,DBSYSTEMVALUES_ORACLE:()=>OX,DBSYSTEMVALUES_OTHER_SQL:()=>gX,DBSYSTEMVALUES_PERVASIVE:()=>zX,DBSYSTEMVALUES_POINTBASE:()=>KX,DBSYSTEMVALUES_POSTGRESQL:()=>RX,DBSYSTEMVALUES_PROGRESS:()=>bX,DBSYSTEMVALUES_REDIS:()=>nW,DBSYSTEMVALUES_REDSHIFT:()=>NX,DBSYSTEMVALUES_SQLITE:()=>$X,DBSYSTEMVALUES_SYBASE:()=>XX,DBSYSTEMVALUES_TERADATA:()=>WX,DBSYSTEMVALUES_VERTICA:()=>JX,DbCassandraConsistencyLevelValues:()=>RW,DbSystemValues:()=>dW,ERROR_TYPE_VALUE_OTHER:()=>$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>UW,FAASINVOKEDPROVIDERVALUES_AWS:()=>kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=>BW,FAASINVOKEDPROVIDERVALUES_GCP:()=>VW,FAASTRIGGERVALUES_DATASOURCE:()=>NW,FAASTRIGGERVALUES_HTTP:()=>CW,FAASTRIGGERVALUES_OTHER:()=>bW,FAASTRIGGERVALUES_PUBSUB:()=>PW,FAASTRIGGERVALUES_TIMER:()=>IW,FaasDocumentOperationValues:()=>DW,FaasInvokedProviderValues:()=>FW,FaasTriggerValues:()=>LW,HOSTARCHVALUES_AMD64:()=>k7,HOSTARCHVALUES_ARM32:()=>B7,HOSTARCHVALUES_ARM64:()=>V7,HOSTARCHVALUES_IA64:()=>F7,HOSTARCHVALUES_PPC32:()=>G7,HOSTARCHVALUES_PPC64:()=>H7,HOSTARCHVALUES_X86:()=>q7,HTTPFLAVORVALUES_HTTP_1_0:()=>O8,HTTPFLAVORVALUES_HTTP_1_1:()=>A8,HTTPFLAVORVALUES_HTTP_2_0:()=>R8,HTTPFLAVORVALUES_QUIC:()=>C8,HTTPFLAVORVALUES_SPDY:()=>N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=>iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=>lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=>cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>uJ,HostArchValues:()=>j7,HttpFlavorValues:()=>P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=>gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=>AJ,JVM_THREAD_STATE_VALUE_NEW:()=>RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=>CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>PJ,JVM_THREAD_STATE_VALUE_WAITING:()=>IJ,MESSAGETYPEVALUES_RECEIVED:()=>e5,MESSAGETYPEVALUES_SENT:()=>Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>b8,MESSAGINGOPERATIONVALUES_PROCESS:()=>M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=>x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>OQ,METRIC_JVM_CLASS_COUNT:()=>AQ,METRIC_JVM_CLASS_LOADED:()=>RQ,METRIC_JVM_CLASS_UNLOADED:()=>NQ,METRIC_JVM_CPU_COUNT:()=>CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>PQ,METRIC_JVM_CPU_TIME:()=>IQ,METRIC_JVM_GC_DURATION:()=>bQ,METRIC_JVM_MEMORY_COMMITTED:()=>LQ,METRIC_JVM_MEMORY_LIMIT:()=>xQ,METRIC_JVM_MEMORY_USED:()=>MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>wQ,METRIC_JVM_THREAD_COUNT:()=>DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>kQ,METRIC_KESTREL_CONNECTION_DURATION:()=>BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=>FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>YQ,MessageTypeValues:()=>t5,MessagingDestinationKindValues:()=>L8,MessagingOperationValues:()=>w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>WW,NETTRANSPORTVALUES_INPROC:()=>zW,NETTRANSPORTVALUES_IP:()=>qW,NETTRANSPORTVALUES_IP_TCP:()=>GW,NETTRANSPORTVALUES_IP_UDP:()=>HW,NETTRANSPORTVALUES_OTHER:()=>KW,NETTRANSPORTVALUES_PIPE:()=>YW,NETTRANSPORTVALUES_UNIX:()=>jW,NETWORK_TRANSPORT_VALUE_PIPE:()=>kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=>BJ,NETWORK_TRANSPORT_VALUE_TCP:()=>VJ,NETWORK_TRANSPORT_VALUE_UDP:()=>FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=>GJ,NETWORK_TYPE_VALUE_IPV4:()=>qJ,NETWORK_TYPE_VALUE_IPV6:()=>jJ,NetHostConnectionSubtypeValues:()=>y8,NetHostConnectionTypeValues:()=>e8,NetTransportValues:()=>$W,OSTYPEVALUES_AIX:()=>Z7,OSTYPEVALUES_DARWIN:()=>K7,OSTYPEVALUES_DRAGONFLYBSD:()=>J7,OSTYPEVALUES_FREEBSD:()=>$7,OSTYPEVALUES_HPUX:()=>Q7,OSTYPEVALUES_LINUX:()=>z7,OSTYPEVALUES_NETBSD:()=>X7,OSTYPEVALUES_OPENBSD:()=>W7,OSTYPEVALUES_SOLARIS:()=>e9,OSTYPEVALUES_WINDOWS:()=>Y7,OSTYPEVALUES_Z_OS:()=>t9,OTEL_STATUS_CODE_VALUE_ERROR:()=>$J,OTEL_STATUS_CODE_VALUE_OK:()=>XJ,OsTypeValues:()=>r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>F8,RPCGRPCSTATUSCODEVALUES_OK:()=>D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>k8,RpcGrpcStatusCodeValues:()=>Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=>B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=>b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>rK,SEMATTRS_CODE_FILEPATH:()=>n$,SEMATTRS_CODE_FUNCTION:()=>t$,SEMATTRS_CODE_LINENO:()=>i$,SEMATTRS_CODE_NAMESPACE:()=>r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>EK,SEMATTRS_DB_CASSANDRA_TABLE:()=>hK,SEMATTRS_DB_CONNECTION_STRING:()=>iK,SEMATTRS_DB_HBASE_NAMESPACE:()=>SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>sK,SEMATTRS_DB_MONGODB_COLLECTION:()=>vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>uK,SEMATTRS_DB_NAME:()=>aK,SEMATTRS_DB_OPERATION:()=>cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>gK,SEMATTRS_DB_SQL_TABLE:()=>yK,SEMATTRS_DB_STATEMENT:()=>lK,SEMATTRS_DB_SYSTEM:()=>nK,SEMATTRS_DB_USER:()=>oK,SEMATTRS_ENDUSER_ID:()=>WK,SEMATTRS_ENDUSER_ROLE:()=>JK,SEMATTRS_ENDUSER_SCOPE:()=>QK,SEMATTRS_EXCEPTION_ESCAPED:()=>OK,SEMATTRS_EXCEPTION_MESSAGE:()=>Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=>Um,SEMATTRS_EXCEPTION_TYPE:()=>Xa,SEMATTRS_FAAS_COLDSTART:()=>xK,SEMATTRS_FAAS_CRON:()=>LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=>IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=>PK,SEMATTRS_FAAS_EXECUTION:()=>RK,SEMATTRS_FAAS_INVOKED_NAME:()=>MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>wK,SEMATTRS_FAAS_INVOKED_REGION:()=>DK,SEMATTRS_FAAS_TIME:()=>bK,SEMATTRS_FAAS_TRIGGER:()=>AK,SEMATTRS_HTTP_CLIENT_IP:()=>S$,SEMATTRS_HTTP_FLAVOR:()=>f$,SEMATTRS_HTTP_HOST:()=>l$,SEMATTRS_HTTP_METHOD:()=>o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>E$,SEMATTRS_HTTP_ROUTE:()=>T$,SEMATTRS_HTTP_SCHEME:()=>c$,SEMATTRS_HTTP_SERVER_NAME:()=>m$,SEMATTRS_HTTP_STATUS_CODE:()=>u$,SEMATTRS_HTTP_TARGET:()=>a$,SEMATTRS_HTTP_URL:()=>s$,SEMATTRS_HTTP_USER_AGENT:()=>p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>mX,SEMATTRS_MESSAGE_ID:()=>EX,SEMATTRS_MESSAGE_TYPE:()=>_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=>eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>W$,SEMATTRS_MESSAGING_DESTINATION:()=>q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=>X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>J$,SEMATTRS_MESSAGING_OPERATION:()=>Z$,SEMATTRS_MESSAGING_PROTOCOL:()=>z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>tX,SEMATTRS_MESSAGING_SYSTEM:()=>H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Y$,SEMATTRS_MESSAGING_URL:()=>$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=>$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=>zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=>KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=>YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>qK,SEMATTRS_NET_HOST_IP:()=>FK,SEMATTRS_NET_HOST_NAME:()=>HK,SEMATTRS_NET_HOST_PORT:()=>GK,SEMATTRS_NET_PEER_IP:()=>kK,SEMATTRS_NET_PEER_NAME:()=>VK,SEMATTRS_NET_PEER_PORT:()=>BK,SEMATTRS_NET_TRANSPORT:()=>UK,SEMATTRS_PEER_SERVICE:()=>XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pX,SEMATTRS_RPC_JSONRPC_VERSION:()=>fX,SEMATTRS_RPC_METHOD:()=>cX,SEMATTRS_RPC_SERVICE:()=>lX,SEMATTRS_RPC_SYSTEM:()=>aX,SEMATTRS_THREAD_ID:()=>ZK,SEMATTRS_THREAD_NAME:()=>e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>o5,SEMRESATTRS_CLOUD_PLATFORM:()=>s5,SEMRESATTRS_CLOUD_PROVIDER:()=>r5,SEMRESATTRS_CLOUD_REGION:()=>i5,SEMRESATTRS_CONTAINER_ID:()=>S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>y5,SEMRESATTRS_CONTAINER_NAME:()=>T5,SEMRESATTRS_CONTAINER_RUNTIME:()=>g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>O5,SEMRESATTRS_DEVICE_ID:()=>A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=>N5,SEMRESATTRS_FAAS_ID:()=>P5,SEMRESATTRS_FAAS_INSTANCE:()=>b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=>L5,SEMRESATTRS_FAAS_NAME:()=>C5,SEMRESATTRS_FAAS_VERSION:()=>I5,SEMRESATTRS_HOST_ARCH:()=>Vm,SEMRESATTRS_HOST_ID:()=>km,SEMRESATTRS_HOST_IMAGE_ID:()=>w5,SEMRESATTRS_HOST_IMAGE_NAME:()=>M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=>D5,SEMRESATTRS_HOST_NAME:()=>Bm,SEMRESATTRS_HOST_TYPE:()=>x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=>U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=>H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=>e7,SEMRESATTRS_K8S_CRONJOB_UID:()=>Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=>X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Y5,SEMRESATTRS_K8S_JOB_NAME:()=>Q5,SEMRESATTRS_K8S_JOB_UID:()=>J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>V5,SEMRESATTRS_K8S_NODE_NAME:()=>k5,SEMRESATTRS_K8S_NODE_UID:()=>B5,SEMRESATTRS_K8S_POD_NAME:()=>G5,SEMRESATTRS_K8S_POD_UID:()=>F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=>j5,SEMRESATTRS_K8S_REPLICASET_UID:()=>q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=>K5,SEMRESATTRS_OS_DESCRIPTION:()=>t7,SEMRESATTRS_OS_NAME:()=>r7,SEMRESATTRS_OS_TYPE:()=>Fm,SEMRESATTRS_OS_VERSION:()=>Gm,SEMRESATTRS_PROCESS_COMMAND:()=>Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>jm,SEMRESATTRS_PROCESS_OWNER:()=>Km,SEMRESATTRS_PROCESS_PID:()=>Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>$m,SEMRESATTRS_SERVICE_NAME:()=>at,SEMRESATTRS_SERVICE_NAMESPACE:()=>i7,SEMRESATTRS_SERVICE_VERSION:()=>o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>c7,SEMRESATTRS_WEBENGINE_NAME:()=>a7,SEMRESATTRS_WEBENGINE_VERSION:()=>l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>lQ,SemanticAttributes:()=>SX,SemanticResourceAttributes:()=>u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=>s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>b9,TelemetrySdkLanguageValues:()=>p9});var Ve=p(()=>{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=>{P();Zm=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Zu,SM=p(()=>{Zu="baggage"});function tf(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function rf(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function il(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>il(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var eT=p(()=>{P()});var nf,yM=p(()=>{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=>n.length<=4096).slice(0,180),i=tf(a);i.length>0&&o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=il(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=>{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r=="string"&&r.length>0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var NM=p(()=>{P()});function sf(){return r=>{S.error(EZ(r))}}function EZ(r){return typeof r=="string"?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=>{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=>{nT();CM=sf()});var Vo,oT=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)>-1}function yZ(r){return vZ.indexOf(r)>-1}function AZ(r){return OZ.indexOf(r)>-1}function RZ(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o=="string"){let s=PZ[o.toUpperCase()];s!=null&&(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case"OTEL_LOG_LEVEL":IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=>{P();oT();TZ=",",SZ=["OTEL_SDK_DISABLED"];vZ=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];OZ=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=>{lT()});var cf,bM=p(()=>{cf=typeof globalThis=="object"?globalThis:global});function LM(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var cT=p(()=>{});function ff(r){return Buffer.from(uf(r)).toString("base64")}var xM=p(()=>{cT()});function MM(r){return function(){for(let t=0;t<r/4;t++)pf.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(pf[t]>0);t++)t===r-1&&(pf[r-1]=1);return pf.toString("hex",0,r)}}var Go,pf,wM=p(()=>{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from"perf_hooks";var In,DM=p(()=>{In=bZ});var df,uT=p(()=>{df="1.29.0"});var bn,UM=p(()=>{uT();Ve();bn={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=>{});var BM=p(()=>{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=>{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!="number"){let e=In;r=e.timing&&e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r=="number"?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r=="number")return r<Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError("Invalid input type")}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function zM(r){return mf(r)||typeof r=="number"||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=_f&&(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=>{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Tf||(Tf={}))});var Sf,XM=p(()=>{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&&!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=>{hT="[_0-9a-z-*/]",MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=>{QM();ZM=32,BZ=512,ew=",",tw="=",qo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length>BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&&JM(n)&&t.set(i,n)}return t},new Map),this._internalState.size>ZM&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=>{P();nl();_T();cl="traceparent",ul="tracestate",VZ="00",FZ="(?!ff)[\\da-f]{2}",GZ="(?![0]{32})[\\da-f]{32}",HZ="(?![0]{16})[\\da-f]{16}",qZ="[\\da-f]{2}",jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&&o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new qo(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=>{P();mT=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(vf||(vf={}))});var Ai,TT=p(()=>{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Ln,ST=p(()=>{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var yf,aw=p(()=>{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=>{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&cw.call(t)===XZ}function QZ(r){return r!=null&&typeof r=="object"}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&&Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&&(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=>{YZ="[object Object]",zZ="[object Null]",KZ="[object Undefined]",$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t>ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a<i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Af(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&&fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r=="function"}function fl(r){return!Af(r)&&!Rf(r)&&!mw(r)&&typeof r=="object"}function Af(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=>{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var pl,gw=p(()=>{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e=="string"?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=>{});function Ow(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Aw=p(()=>{});var Nf,Rw=p(()=>{Nf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=>{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=>{he.with(Qu(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Pw=p(()=>{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=>Ai,AlwaysOnSampler:()=>Ln,AnchoredClock:()=>of,BindOnceFuture:()=>Cf,CompositePropagator:()=>Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>ol,DEFAULT_ENVIRONMENT:()=>al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>aT,ExportResultCode:()=>Tf,ParentBasedSampler:()=>yf,RPCType:()=>vf,RandomIdGenerator:()=>Go,SDK_INFO:()=>bn,TRACE_PARENT_HEADER:()=>cl,TRACE_STATE_HEADER:()=>ul,TimeoutError:()=>pl,TraceIdRatioBasedSampler:()=>Of,TraceState:()=>qo,TracesSamplerValues:()=>Vo,VERSION:()=>df,W3CBaggagePropagator:()=>nf,W3CTraceContextPropagator:()=>gf,_globalThis:()=>cf,addHrTimes:()=>dT,baggageUtils:()=>iee,callWithTimeout:()=>Sw,deleteRPCMetadata:()=>iw,getEnv:()=>Fo,getEnvWithoutDefaults:()=>lf,getRPCMetadata:()=>ow,getTimeOrigin:()=>Ef,globalErrorHandler:()=>af,hexToBase64:()=>ff,hexToBinary:()=>uf,hrTime:()=>pT,hrTimeDuration:()=>GM,hrTimeToMicroseconds:()=>YM,hrTimeToMilliseconds:()=>jM,hrTimeToNanoseconds:()=>qM,hrTimeToTimeStamp:()=>HM,internal:()=>oee,isAttributeKey:()=>tT,isAttributeValue:()=>rT,isTimeInput:()=>zM,isTimeInputHrTime:()=>mf,isTracingSuppressed:()=>At,isUrlIgnored:()=>vw,isWrapped:()=>Ow,loggingErrorHandler:()=>sf,merge:()=>_w,millisToHrTime:()=>Ho,otperformance:()=>In,parseEnvironment:()=>ll,parseTraceParent:()=>ET,sanitizeAttributes:()=>AM,setGlobalErrorHandler:()=>PM,setRPCMetadata:()=>nw,suppressTracing:()=>Qu,timeInputToHrTime:()=>FM,unrefTimer:()=>hf,unsuppressTracing:()=>TM,urlMatches:()=>yT});var iee,oee,xr=p(()=>{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=>{(function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.TRACE=1]="TRACE",r[r.TRACE2=2]="TRACE2",r[r.TRACE3=3]="TRACE3",r[r.TRACE4=4]="TRACE4",r[r.DEBUG=5]="DEBUG",r[r.DEBUG2=6]="DEBUG2",r[r.DEBUG3=7]="DEBUG3",r[r.DEBUG4=8]="DEBUG4",r[r.INFO=9]="INFO",r[r.INFO2=10]="INFO2",r[r.INFO3=11]="INFO3",r[r.INFO4=12]="INFO4",r[r.WARN=13]="WARN",r[r.WARN2=14]="WARN2",r[r.WARN3=15]="WARN3",r[r.WARN4=16]="WARN4",r[r.ERROR=17]="ERROR",r[r.ERROR2=18]="ERROR2",r[r.ERROR3=19]="ERROR3",r[r.ERROR4=20]="ERROR4",r[r.FATAL=21]="FATAL",r[r.FATAL2=22]="FATAL2",r[r.FATAL3=23]="FATAL3",r[r.FATAL4=24]="FATAL4"})(If||(If={}))});var Ni,jo,bf=p(()=>{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=>{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=>{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=>{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&&s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=>{xf=typeof globalThis=="object"?globalThis:global});var Lw=p(()=>{bw()});var xw=p(()=>{Lw()});function Mw(r,e,t){return o=>o===r?e:t}var hl,Ko,RT,ww=p(()=>{xw();hl=Symbol.for("io.opentelemetry.js.api.logs"),Ko=xf;RT=1});var Mf,Dw=p(()=>{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&&t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=>jo,NOOP_LOGGER_PROVIDER:()=>Yo,NoopLogger:()=>Ni,NoopLoggerProvider:()=>dl,ProxyLogger:()=>zo,ProxyLoggerProvider:()=>Ci,SeverityNumber:()=>If,logs:()=>_l});var _l,El=p(()=>{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=>{P();see=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var Fw=p(()=>{});function Gw(){return r=>{S.error(lee(r))}}function lee(r){return typeof r=="string"?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=>{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=>{Hw();uee=Gw()});var Df,jw=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Df||(Df={}))});function dee(r){return pee.indexOf(r)>-1}function _ee(r){return hee.indexOf(r)>-1}function mee(r){return Eee.indexOf(r)>-1}function Tee(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o=="string"){let s=vee[o.toUpperCase()];s!=null&&(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case"OTEL_LOG_LEVEL":yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=>{P();jw();fee=",",pee=["OTEL_SDK_DISABLED"];hee=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];Eee=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=>{NT()});import{performance as Oee}from"perf_hooks";var Pi,$w=p(()=>{Pi=Oee});var Xw,Ww=p(()=>{Xw="1.29.0"});var Ii,Jw=p(()=>{Ww();Ve();Ii={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=>{});var Zw=p(()=>{Kw();$w();Jw();Qw()});var CT=p(()=>{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!="number"){let e=Pi;r=e.timing&&e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r=="number"?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r=="number")return r<PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError("Invalid input type")}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=e1&&(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=>{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&s1.call(t)===wee}function kee(r){return r!=null&&typeof r=="object"}function Bee(r){return r==null?r===void 0?xee:Lee:bi&&bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&&(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=>{bee="[object Object]",Lee="[object Null]",xee="[object Undefined]",Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t>Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a<i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&&gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r=="function"}function gl(r){return!Vf(r)&&!Ff(r)&&!d1(r)&&typeof r=="object"}function Vf(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=>{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Gf,_1=p(()=>{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=>{Hf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=>{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=>{he.with(kw(he.active()),()=>{r.export(e,o=>{t(o)})})})}var S1=p(()=>{P();Bw()});var qf,cr=p(()=>{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=>{});var v1=p(()=>{g1()});var y1=p(()=>{v1()});var Mn,O1=p(()=>{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=>{O1()});var Wo,MT=p(()=>{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&&xe(_)&&(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&&S.warn("Dropping extra attributes."),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&S.warn("Can not execute the operation on emitted log record"),this._isReadonly}}});var Yf,R1=p(()=>{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&&s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&i!==void 0?i:$o}}var P1=p(()=>{cr()});var zf,I1=p(()=>{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=>o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}}});var Jo,wT=p(()=>{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=>{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=>{P();El();A1();cr();R1();P1();I1();b1();qee="unknown";$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn("A shutdown LoggerProvider cannot provide a Logger"),jo;e||S.warn("Logger requested without instrumentation scope name.");let s=e||qee,a=`${s}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=>{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=>{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=>qf._export(this._exporter,[e]).then(a=>{var i;a.code!==Yt.SUCCESS&&Mr((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(this._unresolvedExports.delete(a),s()),Mr);a!=null&&this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=>{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=>{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&&o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&&s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&&a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&&i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a<s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=>qf._export(this._exporter,e).then(s=>{var a;s.code!==Yt.SUCCESS&&Mr((a=s.error)!==null&&a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=>s.resource).filter(s=>s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=>{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=>{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=>{U1()});var B1=p(()=>{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=>Qo,ConsoleLogRecordExporter:()=>Xf,InMemoryLogRecordExporter:()=>Jf,LogRecord:()=>Wo,LoggerProvider:()=>$f,NoopLogRecordProcessor:()=>Jo,SimpleLogRecordProcessor:()=>Wf});var UT=p(()=>{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=>{(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(ur||(ur={}))});var lt,Zo=p(()=>{(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}function H1(r){return r.status==="rejected"}function kT(r,e){let t=[];return r.forEach(o=>{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o>=t;){let a=t+Math.trunc((o-t)/2);r[a]<e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=>{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=>{(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(zt||(zt={}))});var yl,z1=p(()=>{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&&o!==void 0?o:"",unit:(s=t==null?void 0:t.unit)!==null&&s!==void 0?s:"",valueType:(a=t==null?void 0:t.valueType)!==null&&a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&&i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(o=r.description)!==null&&o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=>{P();fr();(function(r){r.COUNTER="COUNTER",r.GAUGE="GAUGE",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=>{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u<a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&&(o.hasMinMax&&s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&&(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&&(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l<a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=>{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1<<e,s=0,a=0;for(let i=this.indexStart;i<=this.indexEnd;){let n=i%o;n<0&&(n+=o);for(let l=n;l<o&&s<t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s<o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&2146435072)>>20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&1048575)*Math.pow(2,32)+o}var Al,VT=p(()=>{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}var np=p(()=>{});var Dr,ip=p(()=>{Dr=class extends Error{}});var op,eD=p(()=>{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new Dr(`underflow: ${e} is < minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e>o)throw new Dr(`overflow: ${e} is > maximum lower boundary: ${o}`);return Rl(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=>{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e<=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t>=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is > maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e<=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is < minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function HT(r){if(r>nD||r<rD)throw new Dr(`expected scale >= ${rD} && <= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=>{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=>e>10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=>{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize<qT&&(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s<e.indexStart&&e.indexEnd-s>=this._maxSize?(a=!0,n=s,i=e.indexEnd):s>e.indexEnd&&s-e.indexStart>=this._maxSize&&(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let a=e.indexEnd-t;a>=e.backing.length&&this._grow(e,a+1),e.indexStart=t}else if(t>e.indexEnd){let a=t-e.indexStart;a>=e.backing.length&&this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s<0&&(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i>this._maxSize&&(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,o++;return o}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart>>s,e.indexEnd>>s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++)this._incrementIndexBy(e,a+n>>i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++){let c=(a+n>>i)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=>{P();Qee=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function lD(){return r=>{S.error(Zee(r))}}function Zee(r){return typeof r=="string"?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=>{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=>{cD();tte=lD()});var fD,pD=p(()=>{fD="1.29.0"});var xi,dD=p(()=>{pD();Ve();xi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=>{});var _D=p(()=>{dD();hD()});var ED=p(()=>{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=>{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(pr||(pr={}))});function SD(r,e){return new Promise(t=>{he.with(sD(he.active()),()=>{r.export(e,o=>{t(o)})})})}var gD=p(()=>{P();aD()});var vD,Dn=p(()=>{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=>{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=>{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&&o>s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=>{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=>{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");e=e.concat(),e=e.sort((a,i)=>a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=>{cp();Zf();ID=r=>mt.Default(),up=r=>ur.CUMULATIVE});var us,YT=p(()=>{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&&t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&&o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&&s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=>n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=>n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=>n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error("Cannot call shutdown twice.");return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn("Cannot forceFlush on already shutdown MetricReader.");return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=>{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(s=e.exportIntervalMillis)!==null&&s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&&a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length>0&&S.error("PeriodicExportingMetricReader: metrics collection errors",...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug("Error while resolving async portion of resource: ",i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=>{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=>{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&&t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=>{});var wD=p(()=>{MD()});var DD=p(()=>{wD()});var kn,UD=p(()=>{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=>{UD()});var _p,BD=p(()=>{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,e)&&this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=>{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e<0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e<0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=>{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=>{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=>{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=>{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={"otel.metric.overflow":!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=>{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=>{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=>{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&&(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=>{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=>{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}' `),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}' `),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}' `),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}' `),t}function hte(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}function _te(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}'`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}' - OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):""}var GD=p(()=>{});var Np,HD=p(()=>{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&&(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&&(e.description.length>a.description.length&&s.updateDescription(e.description),S.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=>{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=>{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=>{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&&(s=new Dt,this._buffer.set(e,s)),typeof t!="number"){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&&!Number.isInteger(t)&&(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=>{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o<0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,o)>=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s<0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=>n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=>{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s._metricStorages.forEach(n=>{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=>{let a=new Ip,i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s.forEach(n=>{let l=a._buffer.get(n);l!=null&&n._metricStorages.forEach(c=>{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=>o.callback===e&&o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=>o.callback===e&&q1(o.instruments,t))}}});var Lp,zD=p(()=>{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=>{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=>this._allowedAttributeNames.includes(s)).forEach(s=>o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=>{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=>n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=>{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=>{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&&(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=>{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=>{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&&o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&&s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&&s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=>{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&&t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&&e.views.length>0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&&e.readers.length>0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t="",o={}){return this._shutdown?(S.warn("A shutdown MeterProvider cannot provide a Meter"),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=>{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=>{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&&t!==void 0?t:"*"),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=>{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Fp,ZD=p(()=>{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=>mt,AggregationTemporality:()=>ur,ConsoleMetricExporter:()=>dp,DataPointType:()=>lt,DefaultAggregation:()=>Ll,DropAggregation:()=>as,ExplicitBucketHistogramAggregation:()=>Il,ExponentialHistogramAggregation:()=>bl,HistogramAggregation:()=>cs,InMemoryMetricExporter:()=>pp,InstrumentType:()=>_e,LastValueAggregation:()=>ls,MeterProvider:()=>Up,MetricReader:()=>us,PeriodicExportingMetricReader:()=>fp,SumAggregation:()=>wi,TimeoutError:()=>Li,View:()=>Fp});var Gp=p(()=>{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V("events"),Ote=["addListener","on","once","prependListener","prependOnceListener"],tS=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=>t.apply(this,a))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=>{t[s]!==void 0&&(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&&(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&&delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&&(n=s._createPatchMap(e));let l=n[a];l===void 0&&(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V("async_hooks"),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t==="TIMERWRAP")return;let o=this._stack[this._stack.length-1];o!==void 0&&this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&&this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V("async_hooks"),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,"AsyncHooksContextManager",{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=>{P();Ts=De("OpenTelemetry Context Key B3 Debug Flag")});var Ss,gs,vs,ys,Yp,Os,sS=p(()=>{Ss="b3",gs="x-b3-traceid",vs="x-b3-spanid",ys="x-b3-sampled",Yp="x-b3-parentspanid",Os="x-b3-flags"});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t=="string"?t.padStart(32,"0"):""}function kte(r,e){let t=Kp(r,e,vs);return typeof t=="string"?t:""}function nU(r,e){return Kp(r,e,Os)==="1"?"1":void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)==="1"||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=>{P();xr();oS();sS();xte=new Set([!0,"true","True","1",1]),Mte=new Set([!1,"false","False","0",0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a==="1"?o.set(t,Os,a):s.traceFlags!==void 0&&o.set(t,ys,(se.SAMPLED&s.traceFlags)===se.SAMPLED?"1":"0")}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&&Si(a)&&wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&&Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=>{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte="0".repeat(16),Gte=new Set(["d","1"]),Hte="d";$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,"b3",i)}extract(e,t,o){let s=o.get(t,"b3"),a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&&(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return["b3"]}}});var As,aS=p(()=>{(function(r){r[r.SINGLE_HEADER=0]="SINGLE_HEADER",r[r.MULTI_HEADER=1]="MULTI_HEADER"})(As||(As={}))});var Xp,sU=p(()=>{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,"b3");return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=>As,B3Propagator:()=>Xp,B3_CONTEXT_HEADER:()=>Ss,X_B3_FLAGS:()=>Os,X_B3_PARENT_SPAN_ID:()=>Yp,X_B3_SAMPLED:()=>ys,X_B3_SPAN_ID:()=>vs,X_B3_TRACE_ID:()=>gs});var lU=p(()=>{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=>{P();cU=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Wp,uU=p(()=>{Wp="baggage"});function pU(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function dU(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function hU(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}var _U=p(()=>{P()});var Ul,EU=p(()=>{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=>n.length<=4096).slice(0,180),i=pU(a);i.length>0&&o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=hU(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r=="string"&&r.length>0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var SU=p(()=>{P()});function gU(){return r=>{S.error($te(r))}}function $te(r){return typeof r=="string"?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=>{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=>{vU();Wte=gU()});var Ut,cS=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)>-1}function tre(r){return ere.indexOf(r)>-1}function nre(r){return rre.indexOf(r)>-1}function ire(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o=="string"){let s=are[o.toUpperCase()];s!=null&&(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case"OTEL_LOG_LEVEL":lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=>{P();cS();Jte=",",Qte=["OTEL_SDK_DISABLED"];ere=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rre=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=>{uS()});import{performance as cre}from"perf_hooks";var dr,NU=p(()=>{dr=cre});var CU,PU=p(()=>{CU="1.29.0"});var ki,IU=p(()=>{PU();Ve();ki={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=>{});var LU=p(()=>{RU();NU();IU();bU()});var fS=p(()=>{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!="number"){let e=dr;r=e.timing&&e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r=="number"?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function nd(r){return rd(r)||typeof r=="number"||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=pS&&(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=>{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Xt||(Xt={}))});var Vl,wU=p(()=>{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&&!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=>{_S="[_0-9a-z-*/]",Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=>{kU();BU=32,vre=512,VU=",",FU="=",od=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length>vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&&UU(n)&&t.set(i,n)}return t},new Map),this._internalState.size>BU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=>{P();Dl();GU();sd="traceparent",ad="tracestate",yre="00",Ore="(?!ff)[\\da-f]{2}",Are="(?![0]{32})[\\da-f]{32}",Rre="(?![0]{16})[\\da-f]{16}",Nre="[\\da-f]{2}",Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&&o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new od(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&jU.call(t)===xre}function Dre(r){return r!=null&&typeof r=="object"}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&&Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&&(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=>{Pre="[object Object]",Ire="[object Null]",bre="[object Undefined]",Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t>Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a<i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(ld(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&&Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r=="function"}function Gl(r){return!ld(r)&&!cd(r)&&!JU(r)&&typeof r=="object"}function ld(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=>{$U();Vre=20});var ud,ZU=p(()=>{ud=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=>{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=>{he.with(wl(he.active()),()=>{r.export(e,o=>{t(o)})})})}var rk=p(()=>{P();Dl()});var nk,kt=p(()=>{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=>{ik="exception"});var Cs,SS=p(()=>{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&&this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&S.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),nd(t)&&(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&&typeof e.message!="string"&&(S.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]<0&&(S.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=dr.now())return dS(e+this._performanceOffset);if(typeof e=="number")return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e=="string"?o[Wa]=e:e&&(e.code?o[Xa]=e.code.toString():e.name&&(o[Xa]=e.name),e.message&&(o[Wa]=e.message),e.stack&&(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(hr||(hr={}))});var Ur,fd=p(()=>{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Wt,pd=p(()=>{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var Gn,gS=p(()=>{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=>{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}".`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e<0||e>1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=>{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&&s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&&l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=>{OS();kt()});var hd,ck=p(()=>{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)=="number"?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)=="number"?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)=="number"?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)=="number"?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&S.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a<i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let o=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);he.with(wl(he.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=>this._exporter.export(s,n=>{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&&l!==void 0?l:new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let n=0,l=s.length;n<l;n++){let c=s[n];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=>{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=>{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t<r/4;t++)_d.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(_d[t]>0);t++)t===r-1&&(_d[r-1]=1);return _d.toString("hex",0,r)}}var qn,_d,pk=p(()=>{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=>{uk();pk()});var Ed=p(()=>{dk()});var Is,hk=p(()=>{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&&(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug("Instrumentation suppressed, returning Noop Span"),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&&s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&&a!==void 0?a:[]).map(z=>({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&&i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug("Recording is off, propagating context in a non-recording span"),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length<2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=>{});var Ek=p(()=>{_k()});var mk=p(()=>{Ek()});var jn,Tk=p(()=>{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=>{Tk()});var ql,gk=p(()=>{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(o=>{Kt(o||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=>{Promise.all(e).then(()=>{t()},o)})}}});var bs,RS=p(()=>{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=>{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&&t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&&(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&&o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&he.setGlobalContextManager(e.contextManager),e.propagator&&Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=>new Promise(s=>{let a,i=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=>{clearTimeout(i),a!==pn.timeout&&(a=pn.resolved,s(a))}).catch(n=>{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=>{Promise.all(t).then(a=>{let i=a.filter(n=>n!==pn.resolved);i.length>0?s(i):o()}).catch(a=>s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=>{let a=this._getPropagator(s);return a||S.warn(`Propagator "${s}" requested through environment variable is unavailable.`),a}).reduce((s,a)=>(a&&s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||S.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([["tracecontext",()=>new Fl],["baggage",()=>new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=>{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=>{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=>{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)===0)return;let s=()=>nk._export(this._exporter,[e]).then(a=>{var i;a.code!==Xt.SUCCESS&&Kt((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=>{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(a!=null&&this._unresolvedExports.delete(a),s()),i=>Kt(i));a!=null&&this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=>Ur,AlwaysOnSampler:()=>Wt,BasicTracerProvider:()=>Ls,BatchSpanProcessor:()=>Hn,ConsoleSpanExporter:()=>Td,ForceFlushState:()=>pn,InMemorySpanExporter:()=>Sd,NoopSpanProcessor:()=>bs,ParentBasedSampler:()=>Gn,RandomIdGenerator:()=>qn,SamplingDecision:()=>hr,SimpleSpanProcessor:()=>gd,Span:()=>Cs,TraceIdRatioBasedSampler:()=>Fi,Tracer:()=>Is});var Gi=p(()=>{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=>{"use strict";var qre="2.0.0",jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=>{"use strict";var $re=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Nk.exports=$re});var Ms=T((kr,Ck)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS="[a-zA-Z0-9-]",rne=[["\\s",1],["\\d",Wre],[CS,Xre]],nne=r=>{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=>{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?"g":void 0),Zre[s]=new RegExp(o,t?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CS}*`);re("MAINVERSION",`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASE",`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${CS}+`);re("BUILD",`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re("FULL",`^${D[U.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re("LOOSE",`^${D[U.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re("XRANGE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re("COERCE",`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",D[U.COERCE],!0);re("COERCERTLFULL",D[U.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace="$1~";re("TILDE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace="$1^";re("CARET",`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var vd=T((c1e,Pk)=>{"use strict";var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=>r?typeof r!="object"?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=>{"use strict";var Ik=/^[0-9]+$/,bk=(r,e)=>{let t=Ik.test(r),o=Ik.test(e);return t&&o&&(r=+r,e=+e),r===e?0:t&&!o?-1:o&&!t?1:r<e?-1:1},ane=(r,e)=>bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=>{"use strict";var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>xk)throw new TypeError(`version is longer than ${xk} characters`);yd("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Od||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Od||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Od||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let a=+s;if(a>=0&&a<Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(yd("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd("prerelease compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd("build compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith("pre")){if(!t&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,o),this.inc("pre",t,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,o),this.inc("pre",t,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&&(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=>{"use strict";var wk=pt(),cne=(r,e,t=!1)=>{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=>{"use strict";var une=Hi(),fne=(r,e)=>{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=>{"use strict";var pne=Hi(),dne=(r,e)=>{let t=pne(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=>{"use strict";var Fk=pt(),hne=(r,e,t,o,s)=>{typeof t=="string"&&(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=>{"use strict";var qk=Hi(),_ne=(r,e)=>{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s>0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&&!l){if(!n.patch&&!n.minor)return"major";if(n.compareMain(i)===0)return n.minor&&!n.patch?"minor":"patch"}let u=l?"pre":"";return t.major!==o.major?u+"major":t.minor!==o.minor?u+"minor":t.patch!==o.patch?u+"patch":"prerelease"};jk.exports=_ne});var Kk=T((m1e,zk)=>{"use strict";var Ene=pt(),mne=(r,e)=>new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=>{"use strict";var Tne=pt(),Sne=(r,e)=>new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=>{"use strict";var gne=pt(),vne=(r,e)=>new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=>{"use strict";var yne=Hi(),One=(r,e)=>{let t=yne(r,e);return t&&t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=>{"use strict";var eB=pt(),Ane=(r,e,t)=>new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=>{"use strict";var Rne=Jt(),Nne=(r,e,t)=>Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=>{"use strict";var Cne=Jt(),Pne=(r,e)=>Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=>{"use strict";var sB=pt(),Ine=(r,e,t)=>{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=>{"use strict";var bne=Nd(),Lne=(r,e)=>r.sort((t,o)=>bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=>{"use strict";var xne=Nd(),Mne=(r,e)=>r.sort((t,o)=>xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=>{"use strict";var wne=Jt(),Dne=(r,e,t)=>wne(r,e,t)>0;pB.exports=Dne});var Cd=T((P1e,dB)=>{"use strict";var Une=Jt(),kne=(r,e,t)=>Une(r,e,t)<0;dB.exports=kne});var bS=T((I1e,hB)=>{"use strict";var Bne=Jt(),Vne=(r,e,t)=>Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=>{"use strict";var Fne=Jt(),Gne=(r,e,t)=>Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=>{"use strict";var Hne=Jt(),qne=(r,e,t)=>Hne(r,e,t)>=0;EB.exports=qne});var Id=T((x1e,mB)=>{"use strict";var jne=Jt(),Yne=(r,e,t)=>jne(r,e,t)<=0;mB.exports=Yne});var xS=T((M1e,TB)=>{"use strict";var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return zne(r,t,o);case"!=":return Kne(r,t,o);case">":return $ne(r,t,o);case">=":return Xne(r,t,o);case"<":return Wne(r,t,o);case"<=":return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=>{"use strict";var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=>{if(r instanceof Zne)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||"0",a=t[4]||"0",i=e.includePrerelease&&t[5]?`-${t[5]}`:"",n=e.includePrerelease&&t[6]?`+${t[6]}`:"";return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=>{"use strict";var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=>{"use strict";var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(s=>!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let o=0;o<t.length;o++)o>0&&(this.formatted+=" "),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&&cie)|(this.options.loose&&uie))+":"+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be("hyphen replace",e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be("comparator trim",e),e=e.replace(Rt[Tt.TILDETRIM],aie),be("tilde trim",e),e=e.replace(Rt[Tt.CARETTRIM],lie),be("caret trim",e);let n=e.split(" ").map(f=>pie(f,this.options)).join(" ").split(/\s+/).map(f=>gie(f,this.options));a&&(n=n.filter(f=>(be("loose invalid filter",f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be("range list",n);let l=new Map,c=n.map(f=>new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>RB(o,t)&&e.set.some(s=>RB(s,t)&&o.every(a=>s.every(i=>a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=>r.value==="<0.0.0-0",fie=r=>r.value==="",RB=(r,e)=>{let t=!0,o=r.slice(),s=o.pop();for(;t&&o.length;)t=o.every(a=>s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=>(be("comp",r,e),r=_ie(r,e),be("caret",r),r=die(r,e),be("tildes",r),r=mie(r,e),be("xrange",r),r=Sie(r,e),be("stars",r),r),St=r=>!r||r.toLowerCase()==="x"||r==="*",die=(r,e)=>r.trim().split(/\s+/).map(t=>hie(t,e)).join(" "),hie=(r,e)=>{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=>{be("tilde",r,o,s,a,i,n);let l;return St(s)?l="":St(a)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:St(i)?l=`>=${s}.${a}.0 <${s}.${+a+1}.0-0`:n?(be("replaceTilde pr",n),l=`>=${s}.${a}.${i}-${n} <${s}.${+a+1}.0-0`):l=`>=${s}.${a}.${i} <${s}.${+a+1}.0-0`,be("tilde return",l),l})},_ie=(r,e)=>r.trim().split(/\s+/).map(t=>Eie(t,e)).join(" "),Eie=(r,e)=>{be("caret",r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?"-0":"";return r.replace(t,(s,a,i,n,l)=>{be("caret",r,s,a,i,n,l);let c;return St(a)?c="":St(i)?c=`>=${a}.0.0${o} <${+a+1}.0.0-0`:St(n)?a==="0"?c=`>=${a}.${i}.0${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.0${o} <${+a+1}.0.0-0`:l?(be("replaceCaret pr",l),a==="0"?i==="0"?c=`>=${a}.${i}.${n}-${l} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}-${l} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n}-${l} <${+a+1}.0.0-0`):(be("no pr"),a==="0"?i==="0"?c=`>=${a}.${i}.${n}${o} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n} <${+a+1}.0.0-0`),be("caret return",c),c})},mie=(r,e)=>(be("replaceXRanges",r,e),r.split(/\s+/).map(t=>Tie(t,e)).join(" ")),Tie=(r,e)=>{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=>{be("xRange",r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s==="="&&_&&(s=""),l=e.includePrerelease?"-0":"",c?s===">"||s==="<"?o="<0.0.0-0":o="*":s&&_?(u&&(i=0),n=0,s===">"?(s=">=",u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s==="<="&&(s="<",u?a=+a+1:i=+i+1),s==="<"&&(l="-0"),o=`${s+a}.${i}.${n}${l}`):u?o=`>=${a}.0.0${l} <${+a+1}.0.0-0`:f&&(o=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),be("xRange return",o),o})},Sie=(r,e)=>(be("replaceStars",r,e),r.trim().replace(Rt[Tt.STAR],"")),gie=(r,e)=>(be("replaceGTE0",r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],"")),vie=r=>(e,t,o,s,a,i,n,l,c,u,f,_)=>(St(o)?t="":St(s)?t=`>=${o}.0.0${r?"-0":""}`:St(a)?t=`>=${o}.${s}.0${r?"-0":""}`:i?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,St(c)?l="":St(u)?l=`<${+c+1}.0.0-0`:St(f)?l=`<${c}.${+u+1}.0-0`:_?l=`<=${c}.${u}.${f}-${_}`:r?l=`<${c}.${u}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=>{for(let o=0;o<r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let o=0;o<r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&&r[o].semver.prerelease.length>0){let s=r[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=>{"use strict";var $l=Symbol("SemVer ANY"),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),kS("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value="":this.value=this.operator+this.semver.version,kS("comp",this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS("Comparator.test",e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e=="string")try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new LB(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||US(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||US(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=>{"use strict";var Oie=Qt(),Aie=(r,e,t)=>{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=>{"use strict";var Rie=Qt(),Nie=(r,e)=>new Rie(r,e).set.map(t=>t.map(o=>o.value).join(" ").trim().split(" "));wB.exports=Nie});var kB=T((F1e,UB)=>{"use strict";var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===-1)&&(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=>{"use strict";var bie=pt(),Lie=Qt(),xie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===1)&&(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=>{"use strict";var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=>{r=new Mie(r,e);let t=new VS("0.0.0");if(r.test(t)||(t=new VS("0.0.0-0"),r.test(t)))return t;t=null;for(let o=0;o<r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=>{let n=new VS(i.semver.version);switch(i.operator){case">":n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":(!a||FB(n,a))&&(a=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&&(!t||FB(t,a))&&(t=a)}return t&&r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=>{"use strict";var Die=Qt(),Uie=(r,e)=>{try{return new Die(r,e).range||"*"}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=>{"use strict";var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=>{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case">":s=YB,a=Gie,i=zB,n=">",l=">=";break;case"<":s=zB,a=Hie,i=YB,n="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fie(r,e,o))return!1;for(let c=0;c<e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=>{m.semver===Bie&&(m=new KB(">=0.0.0")),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&&(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&&a(r,_.semver))return!1;if(_.operator===l&&i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=>{"use strict";var jie=xd(),Yie=(r,e,t)=>jie(r,e,">",t);XB.exports=Yie});var QB=T((z1e,JB)=>{"use strict";var zie=xd(),Kie=(r,e,t)=>zie(r,e,"<",t);JB.exports=Kie});var tV=T((K1e,eV)=>{"use strict";var ZB=Qt(),$ie=(r,e,t)=>(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=>{"use strict";var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=>{let o=[],s=null,a=null,i=r.sort((u,f)=>Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&&u===i[0]?n.push("*"):f?u===i[0]?n.push(`<=${f}`):n.push(`${u} - ${f}`):n.push(`>=${u}`);let l=n.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var cV=T((X1e,lV)=>{"use strict";var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=>{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(">=0.0.0-0")],oV=[new GS(">=0.0.0")],Zie=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===FS){if(e.length===1&&e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&&e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===">"||m.operator===">="?s=sV(s,m,t):m.operator==="<"||m.operator==="<="?a=aV(a,m,t):o.add(m.semver);if(o.size>1)return null;let i;if(s&&a){if(i=HS(s.semver,a.semver,t),i>0)return null;if(i===0&&(s.operator!==">="||a.operator!=="<="))return null}for(let m of o){if(s&&!Wl(m,String(s),t)||a&&!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&&!t.includePrerelease&&a.semver.prerelease.length?a.semver:!1,_=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&a.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let m of e){if(u=u||m.operator===">"||m.operator===">=",c=c||m.operator==="<"||m.operator==="<=",s){if(_&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===_.major&&m.semver.minor===_.minor&&m.semver.patch===_.patch&&(_=!1),m.operator===">"||m.operator===">="){if(n=sV(s,m,t),n===m&&n!==s)return!1}else if(s.operator===">="&&!Wl(s.semver,String(m),t))return!1}if(a){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(l=aV(a,m,t),l===m&&l!==a)return!1}else if(a.operator==="<="&&!Wl(a.semver,String(m),t))return!1}if(!m.operator&&(a||s)&&i!==0)return!1}return!(s&&c&&!a&&i!==0||a&&u&&!s&&i!==0||_||f)},sV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o>0?r:o<0||e.operator===">"&&r.operator===">="?e:r},aV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o<0?r:o>0||e.operator==="<"&&r.operator==="<="?e:r};lV.exports=Jie});var jS=T((W1e,pV)=>{"use strict";var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(":");if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,"0"),n=s.padStart(16,"0"),l=Boe.test(a)?parseInt(a,16)&1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=>{P();xr();dV=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hV=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},YS="uber-trace-id",Md="uberctx",_V=(function(){function r(e){typeof e=="string"?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&&At(e)===!1){var l="0"+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+":"+i.spanId+":0:"+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+"-"+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+"-")}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c=="string"){var _=Voe(c);_&&(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&&n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&&(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&&!y.done&&(a=O.return)&&a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=>_V,UBER_BAGGAGE_HEADER_PREFIX:()=>Md,UBER_TRACE_ID_HEADER:()=>YS});var TV=p(()=>{EV()});var vV=T(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,"14.8.0")?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,["b3",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],["b3multi",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],["jaeger",()=>new Goe.JaegerPropagator]])});var zS=T(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,"NodeTracerProvider",{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,"AlwaysOffSampler",{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,"AlwaysOnSampler",{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,"BasicTracerProvider",{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,"BatchSpanProcessor",{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,"ConsoleSpanExporter",{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,"ForceFlushState",{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,"InMemorySpanExporter",{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,"NoopSpanProcessor",{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,"ParentBasedSampler",{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,"RandomIdGenerator",{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,"SamplingDecision",{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,"SimpleSpanProcessor",{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,"Span",{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,"Tracer",{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=>{});var OV=p(()=>{yV()});var KS=p(()=>{OV()});var Ce,dn=p(()=>{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=>{AV=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}},RV=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}}});import*as NV from"child_process";import*as CV from"util";var Us,kd=p(()=>{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=>qoe});async function qoe(){try{let e=(await Us('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(` `).find(o=>o.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var IV=p(()=>{kd();P()});var bV={};Ae(bV,{getMachineId:()=>Yoe});import{promises as joe}from"fs";async function Yoe(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await joe.readFile(e,{encoding:"utf8"})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var LV=p(()=>{P()});var xV={};Ae(xV,{getMachineId:()=>Koe});import{promises as zoe}from"fs";async function Koe(){try{return(await zoe.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var MV=p(()=>{kd();P()});var wV={};Ae(wV,{getMachineId:()=>$oe});import*as Bd from"process";async function $oe(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Bd.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Bd.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await Us(`${e} ${r}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var DV=p(()=>{kd();P()});var UV={};Ae(UV,{getMachineId:()=>Xoe});async function Xoe(){return S.debug("could not read machine-id: unsupported platform"),""}var kV=p(()=>{P()});import*as BV from"process";var qi,VV=p(()=>{switch(BV.platform){case"darwin":({getMachineId:qi}=(IV(),ee(PV)));break;case"linux":({getMachineId:qi}=(LV(),ee(bV)));break;case"freebsd":({getMachineId:qi}=(MV(),ee(xV)));break;case"win32":({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from"os";var XS,ji,WS=p(()=>{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=>{let t={};return e&&(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=>{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from"os";var QS,Yi,ZS=p(()=>{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=>{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from"os";var tg,zi,rg=p(()=>{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:"nodejs",[Ja]:"Node.js"};process.argv.length>1&&(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=>{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from"crypto";var ig,ec,jV=p(()=>{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=>{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=>{YV()});var og,tc,sg=p(()=>{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator<"u"&&((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&&((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:"browser",[Ja]:"Web Browser",[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===""?(S.debug("BrowserDetector failed: Unable to find required browser resources. "),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=>{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=>{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&&(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=>{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=>{zV();KV();$V();sg();ug()});var WV,JV=p(()=>{WV=r=>r!==null&&typeof r=="object"&&typeof r.then=="function"});var QV,ZV,e2,t2=p(()=>{dn();P();JV();QV=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=>t.merge(o),Ce.empty())},ZV=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(s=>{try{let a=s.detect(r),i;if(WV(a)){let n=async()=>{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=>S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=>s.merge(a),Ce.empty());return o.waitForAsyncAttributes&&o.waitForAsyncAttributes().then(()=>{e2(t)}),o},e2=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=>Ce,browserDetector:()=>lg,browserDetectorSync:()=>tc,defaultServiceName:()=>Ds,detectResources:()=>QV,detectResourcesSync:()=>ZV,envDetector:()=>pg,envDetectorSync:()=>rc,hostDetector:()=>Jl,hostDetectorSync:()=>ji,osDetector:()=>Ql,osDetectorSync:()=>Yi,processDetector:()=>Zl,processDetectorSync:()=>zi,serviceInstanceIdDetectorSync:()=>ec});var Fd=p(()=>{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s<a;s++){let i=r[s];e&&i.setTracerProvider(e),t&&i.setMeterProvider(t),o&&i.setLoggerProvider&&i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=>e.disable())}var i2=p(()=>{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&t!==void 0?t:[];return r2(i,o,s,a),()=>{n2(i)}}var s2=p(()=>{P();El();i2()});var hg=T((FUe,c2)=>{"use strict";function dg(r){return typeof r=="function"}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&&r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&&r.logger&&(dg(r.logger)?vt=r.logger:vt("new logger isn't a function, not replacing"))}function a2(r,e,t){if(!r||!r[e]){vt("no original function "+e+" to wrap");return}if(!t){vt("no wrapper function"),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt("original object and wrapper must be functions");return}var o=r[e],s=t(o,e);return nc(s,"__original",o),nc(s,"__unwrap",function(){r[e]===s&&nc(r,e,o)}),nc(s,"__wrapped",!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to wrap on modules");return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt("no function to unwrap."),vt(new Error().stack);return}if(!r[e].__unwrap)vt("no original to unwrap to -- has "+e+" already been unwrapped?");else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to unwrap on modules");return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=>{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},a)}}}});var p2=T((jUe,f2)=>{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return ose(r);if(t==="number"&&isFinite(r))return e.long?ase(r):sse(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return t*ise;case"weeks":case"week":case"w":return t*nse;case"days":case"day":case"d":return t*Ki;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return t*Bs;case"seconds":case"second":case"secs":case"sec":case"s":return t*ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function sse(r){var e=Math.abs(r);return e>=Ki?Math.round(r/Ki)+"d":e>=Vs?Math.round(r/Vs)+"h":e>=Bs?Math.round(r/Bs)+"m":e>=ks?Math.round(r/ks)+"s":r+"ms"}function ase(r){var e=Math.abs(r);return e>=Ki?Hd(r,e,Ki,"day"):e>=Vs?Hd(r,e,Vs,"hour"):e>=Bs?Hd(r,e,Bs,"minute"):e>=ks?Hd(r,e,ks,"second"):r+" ms"}function Hd(r,e,t,o){var s=e>=t*1.5;return Math.round(r/t)+" "+o+(s?"s":"")}});var _g=T((YUe,d2)=>{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_<u.length;_++)f=(f<<5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=>{if(B==="%%")return"%";N++;let te=t.formatters[G];if(typeof te=="function"){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(m!==t.namespaces&&(m=t.namespaces,O=t.enabled(u)),O),set:A=>{_=A}}),typeof t.init=="function"&&t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f>"u"?":":f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of f)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_<u.length;)if(m<f.length&&(f[m]===u[_]||f[m]==="*"))f[m]==="*"?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m<f.length&&f[m]==="*";)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=>{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Nt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cse(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+qd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=>{});function fse(r){try{r?Nt.storage.setItem("debug",r):Nt.storage.removeItem("debug")}catch{}}function pse(){let r;try{r=Nt.storage.getItem("debug")||Nt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var E2=T((zUe,_2)=>{"use strict";_2.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),s=e.indexOf("--");return o!==-1&&(s===-1||o<s)}});var S2=T((KUe,T2)=>{"use strict";var _se=V("os"),m2=V("tty"),Zt=E2(),{env:Ze}=process,zn;Zt("no-color")||Zt("no-colors")||Zt("color=false")||Zt("color=never")?zn=0:(Zt("color")||Zt("colors")||Zt("color=true")||Zt("color=always"))&&(zn=1);"FORCE_COLOR"in Ze&&(Ze.FORCE_COLOR==="true"?zn=1:Ze.FORCE_COLOR==="false"?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function mg(r,e){if(zn===0)return 0;if(Zt("color=16m")||Zt("color=full")||Zt("color=truecolor"))return 3;if(Zt("color=256"))return 2;if(r&&!e&&zn===void 0)return 0;let t=zn||0;if(Ze.TERM==="dumb")return t;if(process.platform==="win32"){let o=_se.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in Ze)||Ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:t}function Ese(r){let e=mg(r,r&&r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=>{var mse=V("tty"),jd=V("util");et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");et.colors=[6,2,3,4,5,1];try{let r=S2();r&&(r.stderr||r).level>=2&&(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return"colors"in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s="\x1B[3"+(o<8?o:"8;5;"+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+"m+"+Yd.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=gse()+e+" "+r[0]}function gse(){return et.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=>e.trim()).join(" ")};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=>{"use strict";var Sg=V("path").sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf("node_modules");if(t!==-1&&e[t+1]){for(var o=e[t+1][0]==="@",s=o?e[t+1]+"/"+e[t+2]:e[t+1],a=o?3:2,i="",n=t+a-1,l=0;l<=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c="",u=e.length-1,f=t+a;f<=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=>{"use strict";var Rse=V("os");A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(t?"/Users/"+t:null):process.platform==="linux"?e||(process.getuid()===0?"/root":t?"/home/"+t:null):e||null}});var yg=T((JUe,R2)=>{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=>{"use strict";var Nse=process.platform==="win32",Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=>{var I2=V("path"),C2=I2.parse||N2(),P2=function(e,t){var o="/";/^([A-Za-z]:)/.test(e)?o="":/^\\\\/.test(e)&&(o="\\\\");for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&typeof t.paths=="function")return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&&t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=>{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=>{"use strict";var Lse="Function.prototype.bind called on incompatible ",xse=Object.prototype.toString,Mse=Math.max,wse="[object Function]",x2=function(e,t){for(var o=[],s=0;s<e.length;s+=1)o[s]=e[s];for(var a=0;a<t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s<e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t="",o=0;o<r.length;o+=1)t+=r[o],o+1<r.length&&(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!="function"||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l<i;l++)n[l]="$"+l;if(s=Function("binder","return function ("+Use(n,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=>{"use strict";var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=>{"use strict";var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=>{Gse.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var sc=T((oke,H2)=>{"use strict";var Hse=B2();function qse(r,e){for(var t=r.split("."),o=e.split(" "),s=o.length>1?o[0]:"=",a=(o.length>1?o[1]:o[0]).split("."),i=0;i<3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s==="<"?n<l:s===">="?n>=l:!1}return s===">="}function F2(r,e){var t=e.split(/ ?&& ?/);if(t.length===0)return!1;for(var o=0;o<t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e=="boolean")return e;var t=typeof r>"u"?process.versions&&process.versions.node:r;if(typeof t!="string")throw new TypeError(typeof r>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var o=0;o<e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&&jse(t,G2[e])}});var Y2=T((ske,j2)=>{var $i=V("fs"),Yse=vg(),ze=V("path"),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!=="win32"&&$i.realpath&&typeof $i.realpath.native=="function"?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,".node_modules"),ze.join(q2,".node_libraries")]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&&o.code!=="ENOENT"?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&&o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a<s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t=="function"&&(s=a,a={}),typeof e!="string"){var i=new TypeError("Path must be a string.");return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&&a.readPackage){var _=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[".js"],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e==="."||e===".."||e.slice(-1)==="/")&&(F+="/"),/\/$/.test(e)&&F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&&Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error("Cannot find module '"+e+"' from '"+I+"'");C.code="MODULE_NOT_FOUND",s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error("Cannot find module '"+e+"' from '"+I+"'");Y.code="MODULE_NOT_FOUND",s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E=="function"&&(C=E,E=void 0);var Q=[""].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&&Te&&a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([""].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===""||v==="/"||process.platform==="win32"&&/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,"package.json");n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&&W(J);var Ne=ce;Ne&&a.packageFilter&&(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C=="function"&&(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,"package.json");n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,"index"),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&&a.packageFilter&&(Z=a.packageFilter(Z,J)),Z&&Z.main){if(typeof Z.main!="string"){var je=new TypeError("package \u201C"+Z.name+"\u201D `main` must be a string");return je.code="INVALID_PACKAGE_MAIN",E(je)}(Z.main==="."||Z.main==="./")&&(Z.main="index"),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,"index"),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,"index"),Ye,E)})});return}B(ze.join(v,"/index"),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=>{nae.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var W2=T((lke,X2)=>{"use strict";var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&&($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=>{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=>{var sae=sc(),Xi=V("fs"),dt=V("path"),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!=="win32"&&Xi.realpathSync&&typeof Xi.realpathSync.native=="function"?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,".node_modules"),dt.join(Z2,".node_libraries")]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!=="ENOENT")throw t}return e},lc=function(e,t,o){return o&&o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a<s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!="string")throw new TypeError("Path must be a string.");var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&&o.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var c=o.packageIterator,u=o.extensions||[".js"],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e==="."||e===".."||e.slice(-1)==="/")&&(y+="/");var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&&sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error("Cannot find module '"+e+"' from '"+m+"'");throw M.code="MODULE_NOT_FOUND",M;function F(G){var te=N(dt.dirname(G));if(te&&te.dir&&te.pkg&&o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&&(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v<u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===""||G==="/")&&!(process.platform==="win32"&&/^\w:[/\\]*$/.test(G))&&!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),"package.json");if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&&o.packageFilter&&($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),"/package.json");if(s(te)){try{var $=l(a,te)}catch{}if($&&o.packageFilter&&($=o.packageFilter($,G)),$&&$.main){if(typeof $.main!="string"){var le=new TypeError("package \u201C"+$.name+"\u201D `main` must be a string");throw le.code="INVALID_PACKAGE_MAIN",le}($.main==="."||$.main==="./")&&($.main="index");try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,"/index"))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v<le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=>{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=>{Tae.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Lg=T((dke,bg)=>{"use strict";var Gs=V("path"),_r=V("module"),Fe=y2()("require-in-the-middle"),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=>r.startsWith("node:")?!0:(Pg===void 0&&(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(".").map(Number);e===8&&t<8?Fs=o=>o==="http2"?!0:!!r.core[o]:Fs=o=>!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&&V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&&this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&&s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),typeof _r._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof _r._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe("registering require hook"),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe("ignoring require call - module is soft-unhooked"),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe("ignoring process.getBuiltinModule call - module is soft-unhooked"),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith("node:")){let M=u.slice(5);Fs(M)&&(_=M)}}else{if(c)return Fe("call to process.getBuiltinModule with unknown built-in id"),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe('Module._resolveFilename("%s") threw %j, calling original Module.require',u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe("processing %s module require('%s'): %s",f===!0?"core":"non-core",u,_),o._cache.has(_,f)===!0)return Fe("returning already patched cached module: %s",_),o._cache.get(_,f);let y=s.has(_);y===!1&&s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe("module is in the process of being patched already - ignoring: %s",_),A;if(s.delete(_),f===!0){if(i===!0&&r.includes(_)===!1)return Fe("ignoring core module not on whitelist: %s",_),A;m=_}else if(i===!0&&r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe("could not parse filename: %s",_),A;m=M.name,O=M.basedir;let F=yae(M);Fe("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",m,u,F,O);let N=!1;if(i){if(!u.startsWith(".")&&r.includes(u)&&(m=u,N=!0),!r.includes(m)&&!r.includes(F))return A;r.includes(F)&&F!==m&&(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe("could not resolve module: %s",m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe("preparing to process require of internal file: %s",m);else return Fe("ignoring require of non-main module file: %s",z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe("calling require hook: %s",m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe("returning module: %s",m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe("require unhook successful")):Fe("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe("process.getBuiltinModule unhook successful")):Fe("process.getBuiltinModule unhook unsuccessful"))};function yae(r){let e=Gs.sep!=="/"?r.path.split(Gs.sep).join("/"):r.path;return Gs.posix.join(r.name,e).replace(vae,"")}});var Xd,Wd,iF=p(()=>{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split("/")){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split("/")){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&&i&&a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&&a.sort((n,l)=>n.insertedId-l.insertedId),a.map(({hook:n})=>n))}}});import*as xg from"path";function Aae(r){return xg.sep!=="/"?r.split(xg.sep).join("/"):r}var sF,Oae,Jd,aF=p(()=>{sF=Nn(Lg());iF();Oae=["afterEach","after","beforeEach","before","describe","it"].every(r=>typeof global[r]=="function"),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=>{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&&e!==void 0?e:new r}}});var dF=T(Wi=>{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return"Module";let t=cF.get(r)[e];if(typeof t=="function")return t()},defineProperty(r,e,t){if(!("value"in t))throw new Error("Getters/setters are not supported for exports property descriptors.");return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=>i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=>{var hF=V("path"),Iae=gg(),{fileURLToPath:_F}=V("url"),{MessageChannel:bae}=V("worker_threads"),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=>r(e,t))}function TF(r){let e=wg.indexOf(r);e>-1&&wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&&s!==e&&(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=>{t++,r.postMessage(n)},r.on("message",()=>{t--,o&&t<=0&&o()}).unref();function s(){let n=setInterval(()=>{},1e3),l=new Promise(c=>{o=c}).then(()=>{clearInterval(n)});return t===0&&o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null);let o=e?e.internals===!0:!1;Dg&&Array.isArray(r)&&Dg(r),this._iitmHook=(s,a)=>{let i=s,n=s.startsWith("node:"),l;if(n)s=s.replace(/^node:/,"");else{if(s.startsWith("file://"))try{s=_F(s)}catch{}let c=Iae(s);c&&(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&&!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}function Qd(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Ug=p(()=>{});import*as hn from"path";import{types as yF}from"util";import{readFileSync as Dae}from"fs";function OF(r,e,t){return typeof e>"u"?r.includes("*"):r.some(o=>(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=>{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=>{if(Qd(a[i])&&this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=>yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(l=>{i.forEach(c=>{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(n=>{i.forEach(l=>{this._unwrap(n,l)})})};let s=this.init();s&&!Array.isArray(s)&&(s=[s]),this._modules=s||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,"package.json"),{encoding:"utf8"}),o=JSON.parse(t).version;return typeof o=="string"?o:void 0}catch{S.warn("Failed extracting version",e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&&a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=>u.name===l).filter(u=>OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=>(f.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=>{if(!l&&hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=>this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from"path";var PF=p(()=>{});var IF=p(()=>{CF();PF()});var kg=p(()=>{IF()});var eh,bF=p(()=>{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=>{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=>qs,InstrumentationNodeModuleDefinition:()=>eh,InstrumentationNodeModuleFile:()=>th,isWrapped:()=>Qd,registerInstrumentations:()=>o2,safeExecuteInTheMiddle:()=>gF,safeExecuteInTheMiddleAsync:()=>vF});var MF=p(()=>{s2();kg();bF();LF();Ug()});var Br,wF=p(()=>{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=>{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name="OTLPExporterError",a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&&Number.isFinite(r)&&r>0)return r;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+r+"')")}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&&o!==void 0?o:e.timeoutMillis)!==null&&s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&&a!==void 0?a:e.concurrencyLimit)!==null&&i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&&n!==void 0?n:e.compression)!==null&&l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var pc=p(()=>{});var sh,DF=p(()=>{(function(r){r.NONE="none",r.GZIP="gzip"})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=>{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length>=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function BF(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Vg(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Vg(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var FF=p(()=>{P()});var Er,GF=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Er||(Er={}))});var dc,Fg=p(()=>{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,"partialSuccess")}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn("Received Partial Success response:",JSON.stringify(r.partialSuccess))}}}var qF=p(()=>{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=>{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:"OTLPExportDelegate"})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error("Concurrent export limit reached")});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status==="success"){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,a.data)}t({code:Er.SUCCESS});return}else if(a.status==="failure"&&a.error){t({code:Er.FAILED,error:a.error});return}else a.status==="retryable"?t({code:Er.FAILED,error:new Ji("Export failed with retryable status")}):t({code:Er.FAILED,error:new Ji("Export failed with unknown error")})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug("shutdown started"),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=>{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=>sh,OTLPExporterBase:()=>Br,OTLPExporterError:()=>Ji,createOtlpNetworkExportDelegate:()=>jF,getSharedConfigurationDefaults:()=>oh,mergeOtlpSharedConfigurationWithDefaults:()=>ih});var _n=p(()=>{wF();rh();pc();DF();YF()});function zF(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var KF=p(()=>{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=>{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=>{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=>{XF();Xae=typeof BigInt<"u"?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=>{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=>ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>ph(t,o))}}:{}}var Ys=p(()=>{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=>{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=>{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=>{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=>({scope:js(t.scope),metrics:t.metrics.map(o=>rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=>nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=>{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=>rG(t,e))}}var Eh=p(()=>{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a="",schemaUrl:i=""}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=>({resource:zs(o),scopeLogs:Array.from(s,([,a])=>({scope:js(a[0].instrumentationScope),logRecords:a.map(i=>cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=>ph(e,r[e]))}var mh=p(()=>{Ec();Ys();hh()});var Yg=T((sVe,iG)=>{"use strict";iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s<arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&&(a=!1,l(c))}})}});var lG=T(aG=>{"use strict";var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&e.charAt(t)==="=";)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr<64;)sG[Ws[mr]=mr<26?mr+65:mr<52?mr+71:mr<62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t<o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c>>2],l=(c&3)<<4,n=1;break;case 1:a[i++]=Ws[l|c>>4],l=(c&15)<<2,n=2;break;case 2:a[i++]=Ws[l|c>>6],a[i++]=Ws[c&63],n=0;break}i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&&(a[i++]=Ws[l],a[i++]=61,n===1&&(a[i++]=61)),s?(i&&s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join("")):String.fromCharCode.apply(String,a.slice(0,i))};var oG="invalid encoding";Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n<e.length;){var l=e.charCodeAt(n++);if(l===61&&a>1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i<<2|(l&48)>>4,i=l,a=2;break;case 2:t[o++]=(i&15)<<4|(l&60)>>2,i=l,a=3;break;case 3:t[o++]=(i&3)<<6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=>{"use strict";cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=>{"use strict";EG.exports=fG(fG);function fG(r){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s<0?1:0;if(n&&(s=-s),s===0)o(1/s>0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s>34028234663852886e22)o((n<<31|2139095040)>>>0,a,i);else if(s<11754943508222875e-54)o((n<<31|Math.round(s/1401298464324817e-60))>>>0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&8388607;o((n<<31|l+127<<23|c)>>>0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i>>31)*2+1,l=i>>>23&255,c=i&8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i<0?1:0;if(c&&(i=-i),i===0)o(0,n,l+s),o(1/i>0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i>17976931348623157e292)o(0,n,l+s),o((c<<31|2146435072)>>>0,n,l+a);else{var u;if(i<22250738585072014e-324)u=i/5e-324,o(u>>>0,n,l+s),o((c<<31|u/4294967296)>>>0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&&(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496>>>0,n,l+s),o((c<<31|f+1023<<20|u*1048576&1048575)>>>0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c>>31)*2+1,f=c>>>20&2047,_=4294967296*(c&1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function dG(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function hG(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function _G(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var zg=T((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=>{"use strict";var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s<e.length;++s)o=e.charCodeAt(s),o<128?t+=1:o<2048?t+=2:(o&64512)===55296&&(e.charCodeAt(s+1)&64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s<1)return"";for(var a=null,i=[],n=0,l;t<o;)l=e[t++],l<128?i[n++]=l:l>191&&l<224?i[n++]=(l&31)<<6|e[t++]&63:l>239&&l<365?(l=((l&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,i[n++]=55296+(l>>10),i[n++]=56320+(l&1023)):i[n++]=(l&15)<<12|(e[t++]&63)<<6|e[t++]&63,n>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&&a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join("")):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n<e.length;++n)a=e.charCodeAt(n),a<128?t[o++]=a:a<2048?(t[o++]=a>>6|192,t[o++]=a&63|128):(a&64512)===55296&&((i=e.charCodeAt(n+1))&64512)===56320?(a=65536+((a&1023)<<10)+(i&1023),++n,t[o++]=a>>18|240,t[o++]=a>>12&63|128,t[o++]=a>>6&63|128,t[o++]=a&63|128):(t[o++]=a>>12|224,t[o++]=a>>6&63|128,t[o++]=a&63|128);return o-s}});var vG=T((fVe,gG)=>{"use strict";gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o>>>1,a=null,i=o;return function(l){if(l<1||l>s)return r(l);i+l>o&&(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&7&&(i=(i|7)+1),c}}});var OG=T((pVe,yG)=>{"use strict";yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r>>>0,this.hi=e>>>0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash="\0\0\0\0\0\0\0\0";tt.fromNumber=function(e){if(e===0)return Qi;var t=e<0;t&&(e=-e);var o=e>>>0,s=(e-o)/4294967296>>>0;return t&&(s=~s>>>0,o=~o>>>0,++o>4294967295&&(o=0,++s>4294967295&&(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e=="number")return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low>>>0,e.high>>>0):Qi};tt.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)<<8|$n.call(e,2)<<16|$n.call(e,3)<<24)>>>0,($n.call(e,4)|$n.call(e,5)<<8|$n.call(e,6)<<16|$n.call(e,7)<<24)>>>0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};tt.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}});var Fr=T($g=>{"use strict";var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);K.global=K.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};K.isString=function(e){return typeof e=="string"||e instanceof String};K.isObject=function(e){return e&&typeof e=="object"};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&&e.hasOwnProperty(t)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};K.Buffer=(function(){try{var r=K.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e=="number"?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};K.Array=typeof Uint8Array<"u"?Uint8Array:Array;K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long");K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s<o.length;++s)(r[o[s]]===void 0||!t)&&(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG("ProtocolError");K.oneOfGetter=function(e){for(var t={},o=0;o<e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a>-1;--a)if(t[s[a]]===1&&this[s[a]]!==void 0&&this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o<e.length;++o)e[o]!==t&&delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=>{"use strict";IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&&(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&255}function _le(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e<0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e>>>0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s<e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=>{"use strict";LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&&Xn.Buffer.prototype instanceof Uint8Array&&Xn.Buffer.prototype.set.name==="set"?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s<e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&&(e=Xn._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length<40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&&this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=>{"use strict";kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Ge(e);throw Error("illegal buffer")},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}Ge.prototype.fixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8>this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4>this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8>this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Sr(this);while(this.buf[this.pos++]&128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?"toLong":"toNumber";Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=>{"use strict";FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&&(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=>{"use strict";HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError("request must be specified");var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(l,c){if(l)return i.emit("error",l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?"decodeDelimited":"decode"](c)}catch(u){return i.emit("error",u,e),a(u)}return i.emit("data",c,e),a(null,c)})}catch(n){i.emit("error",n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var iv=T(jG=>{"use strict";var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=>{"use strict";YG.exports={}});var sv=T(KG=>{"use strict";var Ct=KG;Ct.build="minimal";Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=>{"use strict";$G.exports=sv()});var JG=T((OVe,WG)=>{"use strict";var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&&Object.hasOwnProperty.call(n,"stringValue")&&l.uint32(10).string(n.stringValue),n.boolValue!=null&&Object.hasOwnProperty.call(n,"boolValue")&&l.uint32(16).bool(n.boolValue),n.intValue!=null&&Object.hasOwnProperty.call(n,"intValue")&&l.uint32(24).int64(n.intValue),n.doubleValue!=null&&Object.hasOwnProperty.call(n,"doubleValue")&&l.uint32(33).double(n.doubleValue),n.arrayValue!=null&&Object.hasOwnProperty.call(n,"arrayValue")&&d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&&Object.hasOwnProperty.call(n,"kvlistValue")&&d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&&Object.hasOwnProperty.call(n,"bytesValue")&&l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(l.value=1,!h.isString(n.stringValue)))return"stringValue: string expected";if(n.boolValue!=null&&n.hasOwnProperty("boolValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.boolValue!="boolean")return"boolValue: boolean expected"}if(n.intValue!=null&&n.hasOwnProperty("intValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.intValue)&&!(n.intValue&&h.isInteger(n.intValue.low)&&h.isInteger(n.intValue.high)))return"intValue: integer|Long expected"}if(n.doubleValue!=null&&n.hasOwnProperty("doubleValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.doubleValue!="number")return"doubleValue: number expected"}if(n.arrayValue!=null&&n.hasOwnProperty("arrayValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return"arrayValue."+c}}if(n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return"kvlistValue."+c}}if(n.bytesValue!=null&&n.hasOwnProperty("bytesValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!(n.bytesValue&&typeof n.bytesValue.length=="number"||h.isString(n.bytesValue)))return"bytesValue: buffer expected"}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&&(l.stringValue=String(n.stringValue)),n.boolValue!=null&&(l.boolValue=!!n.boolValue),n.intValue!=null&&(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue=="string"?l.intValue=parseInt(n.intValue,10):typeof n.intValue=="number"?l.intValue=n.intValue:typeof n.intValue=="object"&&(l.intValue=new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber())),n.doubleValue!=null&&(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&&(typeof n.bytesValue=="string"?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length>=0&&(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(c.stringValue=n.stringValue,l.oneofs&&(c.value="stringValue")),n.boolValue!=null&&n.hasOwnProperty("boolValue")&&(c.boolValue=n.boolValue,l.oneofs&&(c.value="boolValue")),n.intValue!=null&&n.hasOwnProperty("intValue")&&(typeof n.intValue=="number"?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber():n.intValue,l.oneofs&&(c.value="intValue")),n.doubleValue!=null&&n.hasOwnProperty("doubleValue")&&(c.doubleValue=l.json&&!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&&(c.value="doubleValue")),n.arrayValue!=null&&n.hasOwnProperty("arrayValue")&&(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&&(c.value="arrayValue")),n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")&&(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&&(c.value="kvlistValue")),n.bytesValue!=null&&n.hasOwnProperty("bytesValue")&&(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&&(c.value="bytesValue")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.common.v1.AnyValue"},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.ArrayValue"},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValueList"},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&&Object.hasOwnProperty.call(i,"key")&&n.uint32(10).string(i.key),i.value!=null&&Object.hasOwnProperty.call(i,"value")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.key!=null&&i.hasOwnProperty("key")&&!h.isString(i.key))return"key: string expected";if(i.value!=null&&i.hasOwnProperty("value")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return"value."+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&&(n.key=String(i.key)),i.value!=null){if(typeof i.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.key="",l.value=null),i.key!=null&&i.hasOwnProperty("key")&&(l.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValue"},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(10).string(i.name),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&n.uint32(18).string(i.version),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.version!=null&&i.hasOwnProperty("version")&&!h.isString(i.version))return"version: string expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&&(n.name=String(i.name)),i.version!=null&&(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.name="",l.version="",l.droppedAttributesCount=0),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.version!=null&&i.hasOwnProperty("version")&&(l.version=i.version),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.InstrumentationScope"},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.droppedAttributesCount=0),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.resource.v1.Resource"},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&&i.resourceSpans.length)for(var l=0;l<i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceSpans&&c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceSpans!=null&&i.hasOwnProperty("resourceSpans")){if(!Array.isArray(i.resourceSpans))return"resourceSpans: array expected";for(var n=0;n<i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return"resourceSpans."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");n.resourceSpans=[];for(var l=0;l<i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceSpans=[]),i.resourceSpans&&i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c<i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.TracesData"},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&&i.scopeSpans.length)for(var l=0;l<i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&&c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeSpans!=null&&i.hasOwnProperty("scopeSpans")){if(!Array.isArray(i.scopeSpans))return"scopeSpans: array expected";for(var l=0;l<i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return"scopeSpans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");n.scopeSpans=[];for(var l=0;l<i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeSpans=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&&i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c<i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ResourceSpans"},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&&i.spans.length)for(var l=0;l<i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&&c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.spans!=null&&i.hasOwnProperty("spans")){if(!Array.isArray(i.spans))return"spans: array expected";for(var l=0;l<i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return"spans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");n.spans=[];for(var l=0;l<i.spans.length;++l){if(typeof i.spans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.spans=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&&i.spans.length){l.spans=[];for(var c=0;c<i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ScopeSpans"},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(10).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(18).bytes(i.spanId),i.traceState!=null&&Object.hasOwnProperty.call(i,"traceState")&&n.uint32(26).string(i.traceState),i.parentSpanId!=null&&Object.hasOwnProperty.call(i,"parentSpanId")&&n.uint32(34).bytes(i.parentSpanId),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(42).string(i.name),i.kind!=null&&Object.hasOwnProperty.call(i,"kind")&&n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"endTimeUnixNano")&&n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&&i.events.length)for(var l=0;l<i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&&Object.hasOwnProperty.call(i,"droppedEventsCount")&&n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&&i.links.length)for(var l=0;l<i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&&Object.hasOwnProperty.call(i,"droppedLinksCount")&&n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&&Object.hasOwnProperty.call(i,"status")&&d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&&c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&&c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId)))return"traceId: buffer expected";if(i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId)))return"spanId: buffer expected";if(i.traceState!=null&&i.hasOwnProperty("traceState")&&!h.isString(i.traceState))return"traceState: string expected";if(i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&!(i.parentSpanId&&typeof i.parentSpanId.length=="number"||h.isString(i.parentSpanId)))return"parentSpanId: buffer expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.kind!=null&&i.hasOwnProperty("kind"))switch(i.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&!h.isInteger(i.endTimeUnixNano)&&!(i.endTimeUnixNano&&h.isInteger(i.endTimeUnixNano.low)&&h.isInteger(i.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(i.events!=null&&i.hasOwnProperty("events")){if(!Array.isArray(i.events))return"events: array expected";for(var n=0;n<i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return"events."+l}}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&!h.isInteger(i.droppedEventsCount))return"droppedEventsCount: integer expected";if(i.links!=null&&i.hasOwnProperty("links")){if(!Array.isArray(i.links))return"links: array expected";for(var n=0;n<i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return"links."+l}}if(i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&!h.isInteger(i.droppedLinksCount))return"droppedLinksCount: integer expected";if(i.status!=null&&i.hasOwnProperty("status")){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return"status."+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),i.traceState!=null&&(n.traceState=String(i.traceState)),i.parentSpanId!=null&&(typeof i.parentSpanId=="string"?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length>=0&&(n.parentSpanId=i.parentSpanId)),i.name!=null&&(n.name=String(i.name)),i.kind){default:if(typeof i.kind=="number"){n.kind=i.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:n.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:n.kind=1;break;case"SPAN_KIND_SERVER":case 2:n.kind=2;break;case"SPAN_KIND_CLIENT":case 3:n.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:n.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.endTimeUnixNano!=null&&(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano=="string"?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano=="number"?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano=="object"&&(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.events){if(!Array.isArray(i.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");n.events=[];for(var l=0;l<i.events.length;++l){if(typeof i.events[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&&(n.droppedEventsCount=i.droppedEventsCount>>>0),i.links){if(!Array.isArray(i.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");n.links=[];for(var l=0;l<i.links.length;++l){if(typeof i.links[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&&(n.droppedLinksCount=i.droppedLinksCount>>>0),i.status!=null){if(typeof i.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),l.traceState="",n.bytes===String?l.parentSpanId="":(l.parentSpanId=[],n.bytes!==Array&&(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name="",l.kind=n.enums===String?"SPAN_KIND_UNSPECIFIED":0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?"0":0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&&i.hasOwnProperty("traceState")&&(l.traceState=i.traceState),i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.kind!=null&&i.hasOwnProperty("kind")&&(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&(typeof i.endTimeUnixNano=="number"?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber():i.endTimeUnixNano),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.events&&i.events.length){l.events=[];for(var u=0;u<i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&(l.droppedEventsCount=i.droppedEventsCount),i.links&&i.links.length){l.links=[];for(var u=0;u<i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&&i.hasOwnProperty("status")&&(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Span"},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]="SPAN_KIND_UNSPECIFIED"]=0,i[a[1]="SPAN_KIND_INTERNAL"]=1,i[a[2]="SPAN_KIND_SERVER"]=2,i[a[3]="SPAN_KIND_CLIENT"]=3,i[a[4]="SPAN_KIND_PRODUCER"]=4,i[a[5]="SPAN_KIND_CONSUMER"]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(18).string(n.name),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.name!=null&&(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.name="",c.droppedAttributesCount=0}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Event"},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(10).bytes(n.traceId),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(18).bytes(n.spanId),n.traceState!=null&&Object.hasOwnProperty.call(n,"traceState")&&l.uint32(26).string(n.traceState),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId)))return"traceId: buffer expected";if(n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId)))return"spanId: buffer expected";if(n.traceState!=null&&n.hasOwnProperty("traceState")&&!h.isString(n.traceState))return"traceState: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceState!=null&&(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults&&(l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),c.traceState="",c.droppedAttributesCount=0),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&&n.hasOwnProperty("traceState")&&(c.traceState=n.traceState),n.attributes&&n.attributes.length){c.attributes=[];for(var u=0;u<n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Link"},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&&Object.hasOwnProperty.call(i,"message")&&n.uint32(18).string(i.message),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos<l;){var u=i.uint32();switch(u>>>3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.message!=null&&i.hasOwnProperty("message")&&!h.isString(i.message))return"message: string expected";if(i.code!=null&&i.hasOwnProperty("code"))switch(i.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&&(n.message=String(i.message)),i.code){default:if(typeof i.code=="number"){n.code=i.code;break}break;case"STATUS_CODE_UNSET":case 0:n.code=0;break;case"STATUS_CODE_OK":case 1:n.code=1;break;case"STATUS_CODE_ERROR":case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.message="",l.code=n.enums===String?"STATUS_CODE_UNSET":0),i.message!=null&&i.hasOwnProperty("message")&&(l.message=i.message),i.code!=null&&i.hasOwnProperty("code")&&(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Status"},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]="STATUS_CODE_UNSET"]=0,i[a[1]="STATUS_CODE_OK"]=1,i[a[2]="STATUS_CODE_ERROR"]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&&n.resourceSpans.length)for(var c=0;c<n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceSpans&&u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceSpans!=null&&n.hasOwnProperty("resourceSpans")){if(!Array.isArray(n.resourceSpans))return"resourceSpans: array expected";for(var l=0;l<n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return"resourceSpans."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");l.resourceSpans=[];for(var c=0;c<n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceSpans=[]),n.resourceSpans&&n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u<n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&&Object.hasOwnProperty.call(n,"rejectedSpans")&&l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&!h.isInteger(n.rejectedSpans)&&!(n.rejectedSpans&&h.isInteger(n.rejectedSpans.low)&&h.isInteger(n.rejectedSpans.high))?"rejectedSpans: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&&(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans=="string"?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans=="number"?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans=="object"&&(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&(typeof n.rejectedSpans=="number"?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber():n.rejectedSpans),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&&n.resourceMetrics.length)for(var c=0;c<n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceMetrics&&u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceMetrics!=null&&n.hasOwnProperty("resourceMetrics")){if(!Array.isArray(n.resourceMetrics))return"resourceMetrics: array expected";for(var l=0;l<n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return"resourceMetrics."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");l.resourceMetrics=[];for(var c=0;c<n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceMetrics=[]),n.resourceMetrics&&n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u<n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&&Object.hasOwnProperty.call(n,"rejectedDataPoints")&&l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&!h.isInteger(n.rejectedDataPoints)&&!(n.rejectedDataPoints&&h.isInteger(n.rejectedDataPoints.low)&&h.isInteger(n.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&&(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints=="string"?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints=="number"?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints=="object"&&(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&(typeof n.rejectedDataPoints=="number"?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&&n.resourceLogs.length)for(var c=0;c<n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceLogs&&u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceLogs!=null&&n.hasOwnProperty("resourceLogs")){if(!Array.isArray(n.resourceLogs))return"resourceLogs: array expected";for(var l=0;l<n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return"resourceLogs."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");l.resourceLogs=[];for(var c=0;c<n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceLogs=[]),n.resourceLogs&&n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u<n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&&Object.hasOwnProperty.call(n,"rejectedLogRecords")&&l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&!h.isInteger(n.rejectedLogRecords)&&!(n.rejectedLogRecords&&h.isInteger(n.rejectedLogRecords.low)&&h.isInteger(n.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&&(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords=="string"?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords=="number"?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords=="object"&&(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&(typeof n.rejectedLogRecords=="number"?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&&i.resourceMetrics.length)for(var l=0;l<i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceMetrics&&c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceMetrics!=null&&i.hasOwnProperty("resourceMetrics")){if(!Array.isArray(i.resourceMetrics))return"resourceMetrics: array expected";for(var n=0;n<i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return"resourceMetrics."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");n.resourceMetrics=[];for(var l=0;l<i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceMetrics=[]),i.resourceMetrics&&i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c<i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.MetricsData"},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&&i.scopeMetrics.length)for(var l=0;l<i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&&c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeMetrics!=null&&i.hasOwnProperty("scopeMetrics")){if(!Array.isArray(i.scopeMetrics))return"scopeMetrics: array expected";for(var l=0;l<i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return"scopeMetrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");n.scopeMetrics=[];for(var l=0;l<i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeMetrics=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&&i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c<i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&&i.metrics.length)for(var l=0;l<i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&&c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.metrics!=null&&i.hasOwnProperty("metrics")){if(!Array.isArray(i.metrics))return"metrics: array expected";for(var l=0;l<i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return"metrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");n.metrics=[];for(var l=0;l<i.metrics.length;++l){if(typeof i.metrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.metrics=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&&i.metrics.length){l.metrics=[];for(var c=0;c<i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,"data",{get:h.oneOfGetter(a=["gauge","sum","histogram","exponentialHistogram","summary"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(10).string(n.name),n.description!=null&&Object.hasOwnProperty.call(n,"description")&&l.uint32(18).string(n.description),n.unit!=null&&Object.hasOwnProperty.call(n,"unit")&&l.uint32(26).string(n.unit),n.gauge!=null&&Object.hasOwnProperty.call(n,"gauge")&&d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&&Object.hasOwnProperty.call(n,"histogram")&&d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&&Object.hasOwnProperty.call(n,"exponentialHistogram")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&&Object.hasOwnProperty.call(n,"summary")&&d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.description!=null&&n.hasOwnProperty("description")&&!h.isString(n.description))return"description: string expected";if(n.unit!=null&&n.hasOwnProperty("unit")&&!h.isString(n.unit))return"unit: string expected";if(n.gauge!=null&&n.hasOwnProperty("gauge")){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return"gauge."+c}}if(n.sum!=null&&n.hasOwnProperty("sum")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return"sum."+c}}if(n.histogram!=null&&n.hasOwnProperty("histogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return"histogram."+c}}if(n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return"exponentialHistogram."+c}}if(n.summary!=null&&n.hasOwnProperty("summary")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return"summary."+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&&(l.name=String(n.name)),n.description!=null&&(l.description=String(n.description)),n.unit!=null&&(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.name="",c.description="",c.unit=""),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.description!=null&&n.hasOwnProperty("description")&&(c.description=n.description),n.unit!=null&&n.hasOwnProperty("unit")&&(c.unit=n.unit),n.gauge!=null&&n.hasOwnProperty("gauge")&&(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&&(c.data="gauge")),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&&(c.data="sum")),n.histogram!=null&&n.hasOwnProperty("histogram")&&(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&&(c.data="histogram")),n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")&&(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&&(c.data="exponentialHistogram")),n.summary!=null&&n.hasOwnProperty("summary")&&(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&&(c.data="summary")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Metric"},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Gauge"},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&&Object.hasOwnProperty.call(i,"isMonotonic")&&n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&typeof i.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&&(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,l.isMonotonic=!1),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Sum"},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Histogram"},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Summary"},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,a[s[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,a[s[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,a[s[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(33).double(n.asDouble),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.bucketCounts!=null&&n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c<n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&&n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c<n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(89).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 9:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&&u.bucketCounts.length||(u.bucketCounts=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&&u.explicitBounds.length||(u.explicitBounds=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.bucketCounts!=null&&n.hasOwnProperty("bucketCounts")){if(!Array.isArray(n.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&&!(n.bucketCounts[c]&&h.isInteger(n.bucketCounts[c].low)&&h.isInteger(n.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}if(n.explicitBounds!=null&&n.hasOwnProperty("explicitBounds")){if(!Array.isArray(n.explicitBounds))return"explicitBounds: array expected";for(var c=0;c<n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!="number")return"explicitBounds: number[] expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");l.bucketCounts=[];for(var c=0;c<n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]=="string"?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]=="number"?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]=="object"&&(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low>>>0,n.bucketCounts[c].high>>>0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");l.explicitBounds=[];for(var c=0;c<n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.bucketCounts&&n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f<n.bucketCounts.length;++f)typeof n.bucketCounts[f]=="number"?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low>>>0,n.bucketCounts[f].high>>>0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&&n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f<n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&&!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.scale!=null&&Object.hasOwnProperty.call(n,"scale")&&l.uint32(48).sint32(n.scale),n.zeroCount!=null&&Object.hasOwnProperty.call(n,"zeroCount")&&l.uint32(57).fixed64(n.zeroCount),n.positive!=null&&Object.hasOwnProperty.call(n,"positive")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&&Object.hasOwnProperty.call(n,"negative")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(97).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(105).double(n.max),n.zeroThreshold!=null&&Object.hasOwnProperty.call(n,"zeroThreshold")&&l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.scale!=null&&n.hasOwnProperty("scale")&&!h.isInteger(n.scale))return"scale: integer expected";if(n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&!h.isInteger(n.zeroCount)&&!(n.zeroCount&&h.isInteger(n.zeroCount.low)&&h.isInteger(n.zeroCount.high)))return"zeroCount: integer|Long expected";if(n.positive!=null&&n.hasOwnProperty("positive")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return"positive."+u}if(n.negative!=null&&n.hasOwnProperty("negative")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return"negative."+u}if(n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags))return"flags: integer expected";if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&typeof n.zeroThreshold!="number"?"zeroThreshold: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.scale!=null&&(l.scale=n.scale|0),n.zeroCount!=null&&(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount=="string"?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount=="number"?l.zeroCount=n.zeroCount:typeof n.zeroCount=="object"&&(l.zeroCount=new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber())),n.positive!=null){if(typeof n.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&&(l.flags=n.flags>>>0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),n.zeroThreshold!=null&&(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?"0":0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.scale!=null&&n.hasOwnProperty("scale")&&(c.scale=n.scale),n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&(typeof n.zeroCount=="number"?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber():n.zeroCount),n.positive!=null&&n.hasOwnProperty("positive")&&(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&&n.hasOwnProperty("negative")&&(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&(c.zeroThreshold=l.json&&!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c<l.length;++c)n[l[c]]!=null&&(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&&Object.hasOwnProperty.call(l,"offset")&&c.uint32(8).sint32(l.offset),l.bucketCounts!=null&&l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u<l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos<u;){var _=l.uint32();switch(_>>>3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&&f.bucketCounts.length||(f.bucketCounts=[]),(_&7)===2)for(var m=l.uint32()+l.pos;l.pos<m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!="object"||l===null)return"object expected";if(l.offset!=null&&l.hasOwnProperty("offset")&&!h.isInteger(l.offset))return"offset: integer expected";if(l.bucketCounts!=null&&l.hasOwnProperty("bucketCounts")){if(!Array.isArray(l.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&&!(l.bucketCounts[c]&&h.isInteger(l.bucketCounts[c].low)&&h.isInteger(l.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&&(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");c.bucketCounts=[];for(var u=0;u<l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]=="string"?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]=="number"?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]=="object"&&(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low>>>0,l.bucketCounts[u].high>>>0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.bucketCounts=[]),c.defaults&&(u.offset=0),l.offset!=null&&l.hasOwnProperty("offset")&&(u.offset=l.offset),l.bucketCounts&&l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f<l.bucketCounts.length;++f)typeof l.bucketCounts[f]=="number"?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low>>>0,l.bucketCounts[f].high>>>0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&&(l="type.googleapis.com"),l+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&&Object.hasOwnProperty.call(i,"count")&&n.uint32(33).fixed64(i.count),i.sum!=null&&Object.hasOwnProperty.call(i,"sum")&&n.uint32(41).double(i.sum),i.quantileValues!=null&&i.quantileValues.length)for(var l=0;l<i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos<l;){var u=i.uint32();switch(u>>>3){case 7:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&&c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.count!=null&&i.hasOwnProperty("count")&&!h.isInteger(i.count)&&!(i.count&&h.isInteger(i.count.low)&&h.isInteger(i.count.high)))return"count: integer|Long expected";if(i.sum!=null&&i.hasOwnProperty("sum")&&typeof i.sum!="number")return"sum: number expected";if(i.quantileValues!=null&&i.hasOwnProperty("quantileValues")){if(!Array.isArray(i.quantileValues))return"quantileValues: array expected";for(var n=0;n<i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return"quantileValues."+l}}return i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.count!=null&&(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count=="string"?n.count=parseInt(i.count,10):typeof i.count=="number"?n.count=i.count:typeof i.count=="object"&&(n.count=new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber())),i.sum!=null&&(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");n.quantileValues=[];for(var l=0;l<i.quantileValues.length;++l){if(typeof i.quantileValues[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&&(n.flags=i.flags>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?"0":0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.count!=null&&i.hasOwnProperty("count")&&(typeof i.count=="number"?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber():i.count),i.sum!=null&&i.hasOwnProperty("sum")&&(l.sum=n.json&&!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&&i.quantileValues.length){l.quantileValues=[];for(var u=0;u<i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&&Object.hasOwnProperty.call(n,"quantile")&&l.uint32(9).double(n.quantile),n.value!=null&&Object.hasOwnProperty.call(n,"value")&&l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.quantile!=null&&n.hasOwnProperty("quantile")&&typeof n.quantile!="number"?"quantile: number expected":n.value!=null&&n.hasOwnProperty("value")&&typeof n.value!="number"?"value: number expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&&(l.quantile=Number(n.quantile)),n.value!=null&&(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.quantile=0,c.value=0),n.quantile!=null&&n.hasOwnProperty("quantile")&&(c.quantile=l.json&&!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&&n.hasOwnProperty("value")&&(c.value=l.json&&!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(25).double(n.asDouble),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(34).bytes(n.spanId),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(42).bytes(n.traceId),n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&&n.filteredAttributes.length)for(var c=0;c<n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.filteredAttributes&&u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.filteredAttributes!=null&&n.hasOwnProperty("filteredAttributes")){if(!Array.isArray(n.filteredAttributes))return"filteredAttributes: array expected";for(var c=0;c<n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return"filteredAttributes."+u}}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}return n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId))?"spanId: buffer expected":n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId))?"traceId: buffer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");l.filteredAttributes=[];for(var c=0;c<n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.filteredAttributes&&n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f<n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Exemplar"},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&&i.resourceLogs.length)for(var l=0;l<i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceLogs&&c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceLogs!=null&&i.hasOwnProperty("resourceLogs")){if(!Array.isArray(i.resourceLogs))return"resourceLogs: array expected";for(var n=0;n<i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return"resourceLogs."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");n.resourceLogs=[];for(var l=0;l<i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceLogs=[]),i.resourceLogs&&i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c<i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogsData"},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&&i.scopeLogs.length)for(var l=0;l<i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&&c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeLogs!=null&&i.hasOwnProperty("scopeLogs")){if(!Array.isArray(i.scopeLogs))return"scopeLogs: array expected";for(var l=0;l<i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return"scopeLogs."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");n.scopeLogs=[];for(var l=0;l<i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeLogs=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&&i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c<i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ResourceLogs"},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&&i.logRecords.length)for(var l=0;l<i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&&c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.logRecords!=null&&i.hasOwnProperty("logRecords")){if(!Array.isArray(i.logRecords))return"logRecords: array expected";for(var l=0;l<i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return"logRecords."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");n.logRecords=[];for(var l=0;l<i.logRecords.length;++l){if(typeof i.logRecords[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.logRecords=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&&i.logRecords.length){l.logRecords=[];for(var c=0;c<i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ScopeLogs"},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,a[s[1]="SEVERITY_NUMBER_TRACE"]=1,a[s[2]="SEVERITY_NUMBER_TRACE2"]=2,a[s[3]="SEVERITY_NUMBER_TRACE3"]=3,a[s[4]="SEVERITY_NUMBER_TRACE4"]=4,a[s[5]="SEVERITY_NUMBER_DEBUG"]=5,a[s[6]="SEVERITY_NUMBER_DEBUG2"]=6,a[s[7]="SEVERITY_NUMBER_DEBUG3"]=7,a[s[8]="SEVERITY_NUMBER_DEBUG4"]=8,a[s[9]="SEVERITY_NUMBER_INFO"]=9,a[s[10]="SEVERITY_NUMBER_INFO2"]=10,a[s[11]="SEVERITY_NUMBER_INFO3"]=11,a[s[12]="SEVERITY_NUMBER_INFO4"]=12,a[s[13]="SEVERITY_NUMBER_WARN"]=13,a[s[14]="SEVERITY_NUMBER_WARN2"]=14,a[s[15]="SEVERITY_NUMBER_WARN3"]=15,a[s[16]="SEVERITY_NUMBER_WARN4"]=16,a[s[17]="SEVERITY_NUMBER_ERROR"]=17,a[s[18]="SEVERITY_NUMBER_ERROR2"]=18,a[s[19]="SEVERITY_NUMBER_ERROR3"]=19,a[s[20]="SEVERITY_NUMBER_ERROR4"]=20,a[s[21]="SEVERITY_NUMBER_FATAL"]=21,a[s[22]="SEVERITY_NUMBER_FATAL2"]=22,a[s[23]="SEVERITY_NUMBER_FATAL3"]=23,a[s[24]="SEVERITY_NUMBER_FATAL4"]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,a[s[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&&Object.hasOwnProperty.call(i,"severityNumber")&&n.uint32(16).int32(i.severityNumber),i.severityText!=null&&Object.hasOwnProperty.call(i,"severityText")&&n.uint32(26).string(i.severityText),i.body!=null&&Object.hasOwnProperty.call(i,"body")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(69).fixed32(i.flags),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(74).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"observedTimeUnixNano")&&n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&!h.isInteger(i.observedTimeUnixNano)&&!(i.observedTimeUnixNano&&h.isInteger(i.observedTimeUnixNano.low)&&h.isInteger(i.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(i.severityNumber!=null&&i.hasOwnProperty("severityNumber"))switch(i.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&&i.hasOwnProperty("severityText")&&!h.isString(i.severityText))return"severityText: string expected";if(i.body!=null&&i.hasOwnProperty("body")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return"body."+n}if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var l=0;l<i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return"attributes."+n}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId))?"traceId: buffer expected":i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId))?"spanId: buffer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.observedTimeUnixNano!=null&&(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano=="string"?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano=="number"?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano=="object"&&(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber=="number"){n.severityNumber=i.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:n.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:n.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:n.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:n.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:n.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:n.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:n.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:n.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:n.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:n.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:n.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:n.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:n.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:n.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:n.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:n.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:n.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:n.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:n.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:n.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:n.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:n.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:n.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:n.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:n.severityNumber=24;break}if(i.severityText!=null&&(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.flags!=null&&(n.flags=i.flags>>>0),i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(l.severityNumber=n.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,l.severityText="",l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?"0":0}if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.severityNumber!=null&&i.hasOwnProperty("severityNumber")&&(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&&i.hasOwnProperty("severityText")&&(l.severityText=i.severityText),i.body!=null&&i.hasOwnProperty("body")&&(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&(typeof i.observedTimeUnixNano=="number"?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogRecord"},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=>{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=>{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=>gle.decode(r)},QG={serializeRequest:r=>{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=>yle.decode(r)},Rh={serializeRequest:r=>{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=>Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=>{_h();Eh();mh();Nh={serializeRequest:r=>{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=>{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=>{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=>fh,JsonLogsSerializer:()=>Ch,JsonMetricsSerializer:()=>e3,JsonTraceSerializer:()=>Nh,ProtobufLogsSerializer:()=>Ah,ProtobufMetricsSerializer:()=>QG,ProtobufTraceSerializer:()=>Rh,createExportLogsServiceRequest:()=>Xs,createExportMetricsServiceRequest:()=>$s,createExportTraceServiceRequest:()=>Ks,encodeAsLongBits:()=>uh,encodeAsString:()=>jg,getOtlpEncoder:()=>Kn,hrTimeToNanos:()=>ch,toLongBits:()=>qg});var to=p(()=>{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=>{r3="0.56.0"});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t>=0?t:0}}var s3=p(()=>{});var c3={};Ae(c3,{compressAndSend:()=>l3,createHttpAgent:()=>Ile,sendWithHttp:()=>Cle});import*as Ph from"http";import*as Ih from"https";import*as a3 from"zlib";import{Readable as Nle}from"stream";function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(".")[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:"POST",headers:lv({},r.headers()),agent:e},l=a.protocol==="http:"?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on("data",function(m){return _.push(m)}),f.on("end",function(){if(f.statusCode&&f.statusCode<299)o({status:"success",data:Buffer.concat(_)});else if(f.statusCode&&i3(f.statusCode))o({status:"retryable",retryInMillis:o3(f.headers["retry-after"])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:"failure",error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:"failure",error:new Error("Request Timeout")})}),c.on("error",function(f){o({status:"failure",error:f})});var u=i>=14?"close":"abort";c.on(u,function(){o({status:"failure",error:new Error("Request timed out")})}),l3(c,r.compression,t,function(f){o({status:"failure",error:f})})}function l3(r,e,t,o){var s=Ple(t);e==="gzip"&&(r.setHeader("Content-Encoding","gzip"),s=s.on("error",o).pipe(a3.createGzip()).on("error",o)),s.pipe(r).on("error",o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol==="http:"?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=>{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=>{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&&(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=>{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status==="retryable"&&i>0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&&o!==void 0?o:l,u=s-Date.now(),c>u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=>{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&&t!==""){var o=Number(t);if(!Number.isNaN(o)&&Number.isFinite(o)&&o>0)return o;S.warn("Configuration: "+r+" is invalid, expected number greater than 0 (actual: "+t+")")}}function Gle(r){var e=m3("OTEL_EXPORTER_OTLP_"+r+"_TIMEOUT"),t=m3("OTEL_EXPORTER_OTLP_TIMEOUT");return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==""){if(t==null||t==="none"||t==="gzip")return t;S.warn("Configuration: "+r+" is invalid, expected 'none' or 'gzip' (actual: '"+t+"')")}}function Hle(r){var e=T3("OTEL_EXPORTER_OTLP_"+r+"_COMPRESSION"),t=T3("OTEL_EXPORTER_OTLP_COMPRESSION");return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=>{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&&e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i<"u"?t[a]=String(i):S.warn('Header "'+a+'" has invalid value ('+i+") and will be ignored")}),t}}var qle,g3=p(()=>{P();qle=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&&Object.assign(s,e()),r!=null&&Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error("Configuration: Could not parse user-provided export URL: '"+r+"'")}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&&a!==void 0?a:e.agentOptions)!==null&&i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=>{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_HEADERS"])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&&Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}}function $le(r,e){try{new URL(r)}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}r.endsWith("/")||(r=r+"/"),r+=e;try{new URL(r)}catch{S.warn("Configuration: Provided URL appended with '"+e+"' is not a valid URL, using 'undefined' instead of '"+r+"'");return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return $le(t,r)}function Wle(r){var e,t=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_ENDPOINT"])===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&&t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=>{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&&(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&&(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&&S.warn("Metadata cannot be set when using http"),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=>{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=>qr,createOtlpHttpExportDelegate:()=>Hr,getSharedConfigurationFromEnvironment:()=>bh});var Js=p(()=>{E3();cv();N3()});var Qs,P3=p(()=>{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${r3}`,"Content-Type":"application/json"}),Ch))}}});var I3=p(()=>{P3()});var b3=p(()=>{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=>Qs});var x3=p(()=>{b3()});var ue=T(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.NONE=3]="NONE"})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]="DEADLINE",r[r.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",r[r.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",r[r.CANCELLATION=8]="CANCELLATION",r[r.DEFAULTS=65535]="DEFAULTS"})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=>{Qle.exports={name:"@grpc/grpc-js",version:"1.13.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var Pe=T(Bt=>{"use strict";var fv,pv,dv,hv;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V("process"),ece=uv().version,tce={error:(r,...e)=>{console.error("E "+r,...e)},info:(r,...e)=>{console.error("I "+r,...e)},debug:(r,...e)=>{console.error("D "+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&&fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&&pv!==void 0?pv:"";switch(rce.toUpperCase()){case"DEBUG":Zs=Wn.LogVerbosity.DEBUG;break;case"INFO":Zs=Wn.LogVerbosity.INFO;break;case"ERROR":Zs=Wn.LogVerbosity.ERROR;break;case"NONE":Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=>no;Bt.getLogger=nce;var ice=r=>{no=r};Bt.setLogger=ice;var oce=r=>{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=>{let t;if(r>=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&&t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&&dv!==void 0?dv:process.env.GRPC_TRACE)!==null&&hv!==void 0?hv:"",_v=new Set,U3=new Set;for(let r of ace.split(","))r.startsWith("-")?U3.add(r.substring(1)):_v.add(r);var lce=_v.has("all");function cce(r,e,t){k3(e)&&(0,Bt.log)(r,new Date().toISOString()+" | v"+ece+" "+Zle.pid+" | "+e+" | "+t)}function k3(r){return!U3.has(r)&&(lce||_v.has(r))}});var Mh=T(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r=="object"&&r!==null&&"code"in r&&typeof r.code=="number"?r.code:null}});var ht=T(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith("-bin")}function Sce(r){return!r.startsWith("grpc-")}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error('Metadata key "'+r+'" contains illegal characters');if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Tce(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length>0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=>Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===":")continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=>{t.add(o,Buffer.from(a,"base64"))}):s!==void 0&&(Sce(o)?s.split(",").forEach(a=>{t.add(o,Buffer.from(a.trim(),"base64"))}):t.add(o,Buffer.from(s,"base64"))):Array.isArray(s)?s.forEach(a=>{t.add(o,a)}):s!==void 0&&t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=>Buffer.isBuffer(r)?r.toString("base64"):r});var kh=T(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return"getRequestHeaders"in r&&typeof r.getRequestHeaders=="function"}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=>{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=>{e.getRequestMetadata(t.service_url,(n,l)=>{if(n){i(n);return}if(!l){i(new Error("Headers not set by metadata plugin"));return}a(l)})}),s.then(a=>{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=>{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=>s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=>t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=>{this.metadataGenerator(e,(s,a)=>{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V("fs");gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&&(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith("[")){let e=r.indexOf("]");if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(":")===-1)return null;if(r.length>e+1)if(r[e+1]===":"){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(":");return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(":")?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e="";return r.scheme!==void 0&&(e+=r.scheme+":"),r.authority!==void 0&&(e+="//"+r.authority+"/"),e+=r.path,e}});var jr=T(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&&r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&&r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V("tls"),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&&!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,"Root certificate"),Rv(t,"Private key"),Rv(o,"Certificate chain"),t&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&o)throw new Error("Certificate chain must be given with accompanying private key");let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&&a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if("grpc.http_connect_target"in o){let f=(0,H3.parseUri)(o["grpc.http_connect_target"]);f&&(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&&s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&&(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=["h2"],o["grpc.ssl_target_name_override"]){let f=o["grpc.ssl_target_name_override"],_=(a=i.checkServerIdentity)!==null&&a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=>_(f,O),i.servername=f}else i.servername=u;return o["grpc-node.tls_enable_trace"]&&(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=>{let a=(0,vc.connect)(t,()=>{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&&i!==void 0)||i)&&!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on("error",i=>{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,"Failed to createSecureContext with error "+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=>{let o=this.parent.getLatestSecureContext();if(!o){t(new Error("Failed to load credentials"));return}r.closed&&t(new Error("Socket closed while loading credentials"));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=>{t(new Error("Socket closed"))},n=c=>{t(c)},l=(0,vc.connect)(a,()=>{var c;if(l.removeListener("close",i),l.removeListener("error",n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&&c!==void 0)||c)&&!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once("close",i),l.once("error",n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&&a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&&n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error("No default load balancer type registered");return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,"Config parsing failed with error",o.message);continue}return e&&Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V("os"),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce="node";function Xce(r){if("service"in r&&r.service!==""){if(typeof r.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if("method"in r&&r.method!==""){if(typeof r.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if("method"in r&&r.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function Wce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in r)||typeof r.initialBackoff!="string"||!Hh.test(r.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in r)||typeof r.maxBackoff!="string"||!Hh.test(r.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in r)||typeof r.backoffMultiplier!="number"||r.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in r&&Array.isArray(r.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(r.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of r.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Gh.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in r&&(typeof r.hedgingDelay!="string"||!Hh.test(r.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in r&&Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Gh.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&&(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&&(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!("name"in r)||!Array.isArray(r.name))throw new Error("Invalid method config: invalid name array");for(let o of r.name)t.name.push(Xce(o));if("waitForReady"in r){if(typeof r.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=r.waitForReady}if("timeout"in r)if(typeof r.timeout=="object"){if(!("seconds"in r.timeout)||typeof r.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in r.timeout)||typeof r.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=r.timeout}else if(typeof r.timeout=="string"&&Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(".");t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in r){if(typeof r.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=r.maxRequestBytes}if("maxResponseBytes"in r){if(typeof r.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=r.maxResponseBytes}if("retryPolicy"in r){if("hedgingPolicy"in r)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=Wce(r.retryPolicy)}else"hedgingPolicy"in r&&(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!("maxTokens"in r)||typeof r.maxTokens!="number"||r.maxTokens<=0||r.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in r)||typeof r.tokenRatio!="number"||r.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r=="object"&&r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in r)if(typeof r.loadBalancingPolicy=="string")e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in r&&Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));"retryThrottling"in r&&(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&&s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!("serviceConfig"in r))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:z3(r.serviceConfig)};if("clientLanguage"in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o=="string")e.clientLanguage.push(o);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o=="string")e.clientHostname.push(o);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in r)if(typeof r.percentage=="number"&&0<=r.percentage&&r.percentage<=100)e.percentage=r.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error("Invalid service config list");for(let t of r){let o=eue(t);if(!(typeof o.percentage=="number"&&e>o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&&(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&&(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error("No matching service config found")}function rue(r,e){for(let t of r)if(t.length>0&&t[0].startsWith("grpc_config=")){let o=t.join("").substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]="IDLE",r[r.CONNECTING=1]="CONNECTING",r[r.READY=2]="READY",r[r.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",r[r.SHUTDOWN=4]="SHUTDOWN"})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]="COMPLETE",r[r.QUEUE=1]="QUEUE",r[r.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",r[r.DROP=3]="DROP"})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:"No connection established",metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue="backoff",lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,"{"+this.id+"} "+e)}runTimer(e){var t,o;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue="child_load_balancer_helper",Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===o&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue="resolving_load_balancer";function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Cue(r,e,t,o){for(let s of t.name)switch(o){case"EMPTY":if(!s.service&&!s.method)return!0;break;case"SERVICE":if(s.service===r&&!s.method)return!0;break;case"SERVICE_AND_METHOD":if(s.service===r&&s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split("/").filter(l=>l.length>0),i=(o=a[0])!==null&&o!==void 0?o:"",n=(s=a[1])!==null&&s!==void 0?s:"";if(r&&r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?($3("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=>{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=>{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&&_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=>{this.handleResolutionFailure(n)}},o);let i={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Sue.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&&this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+" "+It.ConnectivityState[this.currentState]+" -> "+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&&(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&&(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V("net");function bc(r){return"port"in r}function Wh(r,e){return!r&&!e?!0:!r||!e?!1:bc(r)?bc(e)&&r.host===e.host&&r.port===e.port:!bc(e)&&r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t<r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return"["+r.addresses.map(Q3).join(", ")+"]"}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&&(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=>Hue});function na(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(t=0)),t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError("Iterator access denied!")}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=>{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&&(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&&(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&&(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&&(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&&(t=function(a,i){return a<i?-1:a>i?1:0}),o===void 0&&(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)t=t.i;else if(a>0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)s=t,t=t.i;else if(a>0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&&s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&&s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&&s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&&s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&&(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t=="number"?t:void 0,s=typeof t=="function"?t:void 0,a=typeof t>"u"?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&&a.push(n),s&&s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&&(t.t.h=o),t.i&&(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&&(t.t.h=s),t.i&&(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&&(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n>0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c<0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f>0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m<0&&(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O>0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O<0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s<0)t=t.i;else if(s>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&&ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)>0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)<0?(s.u=o,!0):!1:this.g(i,o)>=0||this.g(a,o)<=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&&ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&&t.next():(!s||o.t===void 0)&&t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&&ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&&ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&&(s+=t.t.O);t!==o;){var a=t.h;t===a.i&&(s+=1,a.t&&(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&ao();var t=this;return new Proxy([],{get:function(o,s){return s==="0"?t.C.u:s==="1"?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!=="1")throw new TypeError("prop must be 1");return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&&(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s<t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V("events"),Hv=V("stream"),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveStatus:(r,e)=>{e(r)}},Mc={start:(r,e,t)=>{t(r,e)},sendMessage:(r,e)=>{e(r)},halfClose:r=>{r()},cancel:r=>{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&&o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&&s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&&a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&&i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(u=>{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&&i!==void 0?i:(u=>{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&&l!==void 0?l:(u=>{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=>{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&&_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&&m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&&O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&&o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&&s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&&u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=>{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=>{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=>{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(n=>{}),onReceiveMessage:n=>{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=>{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length>0&&r.clientInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(r.callInterceptors.length>0&&r.callInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];r.callInterceptors.length>0||r.callInterceptorProviders.length>0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=>n(e))).filter(n=>n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=>n(e))).filter(n=>n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=>c=>l(c,n),n=>Wue(o,n,e))(a)}});var Zv=T(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r=="function"}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||"no stack trace available"}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&&s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&&a!==void 0?a:[],delete o.interceptor_providers,this[oa].length>0&&this[sa].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=>{if(s){t(new Error("Failed to connect before the deadline"));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error("The channel has been closed"));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error("The channel has been closed"))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&&t instanceof Object&&Jv(o)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&&(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&&l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=>{m.emit("metadata",F)},onReceiveMessage(F){A!==null&&y.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit("status",F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=>{_.emit("metadata",M)},onReceiveMessage(M){y!==null&&O.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit("status",M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit("metadata",I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit("error",(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit("status",I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&&(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&&i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&&n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit("metadata",A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit("error",(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit("status",A)}}}),f}};t_.Client=Qv});var ry=T(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return["__proto__","prototype","constructor"].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=>{if(ty(s))return;let a=r[s],i;if(typeof s=="string"&&s.charAt(0)==="$")throw new Error("Method names cannot start with $");a.requestStream?a.responseStream?i="bidi":i="client_stream":a.responseStream?i="server_stream":i="unary";let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&&!ty(a.originalName)&&(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return"format"in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(".");if(s.some(n=>ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=>{var ife=1/0,ofe="[object Symbol]",sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_="\\ud800-\\udfff",mH="\\u0300-\\u036f\\ufe20-\\ufe23",TH="\\u20d0-\\u20f0",SH="\\u2700-\\u27bf",gH="a-z\\xdf-\\xf6\\xf8-\\xff",lfe="\\xac\\xb1\\xd7\\xf7",cfe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ufe="\\u2000-\\u206f",ffe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vH="A-Z\\xc0-\\xd6\\xd8-\\xde",yH="\\ufe0e\\ufe0f",OH=lfe+cfe+ufe+ffe,iy="['\u2019]",pfe="["+i_+"]",uH="["+OH+"]",n_="["+mH+TH+"]",AH="\\d+",dfe="["+SH+"]",RH="["+gH+"]",NH="[^"+i_+OH+AH+SH+gH+vH+"]",ny="\\ud83c[\\udffb-\\udfff]",hfe="(?:"+n_+"|"+ny+")",CH="[^"+i_+"]",oy="(?:\\ud83c[\\udde6-\\uddff]){2}",sy="[\\ud800-\\udbff][\\udc00-\\udfff]",la="["+vH+"]",PH="\\u200d",fH="(?:"+RH+"|"+NH+")",_fe="(?:"+la+"|"+NH+")",pH="(?:"+iy+"(?:d|ll|m|re|s|t|ve))?",dH="(?:"+iy+"(?:D|LL|M|RE|S|T|VE))?",IH=hfe+"?",bH="["+yH+"]?",Efe="(?:"+PH+"(?:"+[CH,oy,sy].join("|")+")"+bH+IH+")*",LH=bH+IH+Efe,mfe="(?:"+[dfe,oy,sy].join("|")+")"+LH,Tfe="(?:"+[CH+n_+"?",n_,oy,sy,pfe].join("|")+")",Sfe=RegExp(iy,"g"),gfe=RegExp(n_,"g"),vfe=RegExp(ny+"(?="+ny+")|"+Tfe+LH,"g"),yfe=RegExp([la+"?"+RH+"+"+pH+"(?="+[uH,la,"$"].join("|")+")",_fe+"+"+dH+"(?="+[uH,la+fH,"$"].join("|")+")",la+"?"+fH+"+"+pH,la+"+"+dH,AH,mfe].join("|"),"g"),Ofe=RegExp("["+PH+i_+mH+TH+yH+"]"),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Nfe=typeof global=="object"&&global&&global.Object===Object&&global,Cfe=typeof self=="object"&&self&&self.Object===Object&&self,Pfe=Nfe||Cfe||Function("return this")();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&&a&&(t=r[++s]);++s<a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split("")}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e<0&&(e=-e>s?0:s+e),t=t>s?s:t,t<0&&(t+=s),s=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(s);++o<s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r=="string")return r;if(zfe(r))return EH?EH.call(r):"";var e=r+"";return e=="0"&&1/r==-ife?"-0":e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&&t>=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(""):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,"")),r,"")}}function Yfe(r){return!!r&&typeof r=="object"}function zfe(r){return typeof r=="symbol"||Yfe(r)&&Vfe.call(r)==ofe}function o_(r){return r==null?"":Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&&r.replace(afe,Mfe).replace(gfe,"")}var Wfe=qfe("toUpperCase");function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=>{"use strict";DH.exports=ay;function ay(r,e){typeof r=="string"&&(e=r,r=void 0);var t=[];function o(a){if(typeof a!="string"){var i=s();if(ay.verbose&&console.log("codegen: "+i),i="return "+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u<n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case"d":case"f":return String(Number(A));case"i":return String(Math.floor(A));case"j":return JSON.stringify(A);case"s":return String(A)}return"%"}),_!==f.length)throw Error("parameter count mismatch");return t.push(a),o}function s(a){return"function "+(a||e||"")+"("+(r&&r.join(",")||"")+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=>{"use strict";kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe("fs");function Uc(r,e,t){return typeof e=="function"?(t=e,e={}):e||(e={}),t?!e.xhr&&ly&&ly.readFile?ly.readFile(r,function(s,a){return s&&typeof XMLHttpRequest<"u"?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString("utf8"))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&&s.status!==200)return o(Error("status "+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n<s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&255)}return o(null,typeof Uint8Array<"u"?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&&("overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.responseType="arraybuffer"),s.open("GET",e),s.send()}});var GH=T(FH=>{"use strict";var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),o=VH(e),s="";o&&(s=t.shift()+"/");for(var a=0;a<t.length;)t[a]===".."?a>0&&t[a-1]!==".."?t.splice(--a,2):o?t.splice(a,1):++a:t[a]==="."?t.splice(a,1):++a;return s+t.join("/")};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?cy(e+"/"+t):t)}});var ua=T((iFe,jH)=>{"use strict";jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className="Namespace";var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&&r.length){for(var t={},o=0;o<r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o<e.length;++o)if(typeof e[o]!="string"&&e[o][0]<=t&&e[o][1]>t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o<e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject(["options",this.options,"nested",HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s<o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&&this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof co)return this.nested[e].values;throw Error("no such enum: "+e)};pe.prototype.add=function(e){if(!(e instanceof fy&&e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&&e instanceof pe&&!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s<o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");for(var o=this;e.length>0;){var s=e.shift();if(o.nested&&o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error("path conflicts with non-namespace objects")}else o.add(o=new pe(s))}return t&&o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t=="boolean"?(o=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),a_.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var s=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+s];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&&(e=e.slice(1),s=o._lookupImpl(e,e.join(".")));else for(var a=0;a<this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&&(o=this._nestedArray[a]._lookupImpl(e,t))&&(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error("no such type: "+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=>{"use strict";YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className="MapField";var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError("keyType must be a string");this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o=="function"?o=kc.decorateType(o).name:o&&typeof o=="object"&&(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=>{"use strict";zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className="Method";var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&&(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError("type must be a string");if(!fa.isString(t))throw TypeError("requestType must be a string");if(!fa.isString(o))throw TypeError("responseType must be a string");dy.call(this,r,i),this.type=e||"rpc",this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=>{"use strict";$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className="Service";var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a<s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&&o.addJSON(t.nested),t.edition&&(o._edition=t.edition),o.comment=t.comment,o._defaultEdition="proto3",o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",Sn.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Object.defineProperty(Vt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a<this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[n]=Bc.codegen(["r","c"],Bc.isReserved(n)?n+"_":n)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=>{"use strict";XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=>{"use strict";JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return"missing required '"+r.name+"'"}function spe(r){for(var e=WH.codegen(["r","l","e"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(n){return n.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),t=0;t<r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?"int32":o.type,a="m"+WH.safeProp(o.name);e("case %i: {",o.id),o.map?(e("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),gn.defaults[o.keyType]!==void 0?e("k=%j",gn.defaults[o.keyType]):e("k=null"),gn.defaults[s]!==void 0?e("value=%j",gn.defaults[s]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),gn.basic[s]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",s),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),gn.long[o.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',a):e("%s[k]=value",a)):o.repeated?(e("if(!(%s&&%s.length))",a,a)("%s=[]",a),gn.packed[s]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,s)("}else"),gn.basic[s]===void 0?e(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",a,t):e("%s.push(r.%s())",a,s)):gn.basic[s]===void 0?e(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",a,t):e("%s=r.%s()",a,s),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&&e("if(!m.hasOwnProperty(%j))",i.name)("throw util.ProtocolError(%j,{instance:m})",ope(i))}return e("return m")}});var Ty=T((uFe,QH)=>{"use strict";QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+": "+e+(r.repeated&&e!=="array"?"[]":r.map&&e!=="object"?"{k:"+r.keyType+"}":"")+" expected"}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r("switch(%s){",o)("default:")("return%j",ir(e,"enum value"));for(var s=Object.keys(e.resolvedType.values),a=0;a<s.length;++a)r("case %i:",e.resolvedType.values[s[a]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",t,o)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",o)("return%j",ir(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",ir(e,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',o)("return%j",ir(e,"number"));break;case"bool":r('if(typeof %s!=="boolean")',o)("return%j",ir(e,"boolean"));break;case"string":r("if(!util.isString(%s))",o)("return%j",ir(e,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",ir(e,"buffer"));break}return r}function lpe(r,e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",t)("return%j",ir(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",t)("return%j",ir(e,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",t)("return%j",ir(e,"boolean key"));break}return r}function cpe(r){var e=Ey.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=r.oneofsArray,o={};t.length&&e("var p={}");for(var s=0;s<r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i="m"+Ey.safeProp(a.name);if(a.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",i,a.name),a.map)e("if(!util.isObject(%s))",i)("return%j",ir(a,"object"))("var k=Object.keys(%s)",i)("for(var i=0;i<k.length;++i){"),lpe(e,a,"k[i]"),my(e,a,s,i+"[k[i]]")("}");else if(a.repeated)e("if(!Array.isArray(%s))",i)("return%j",ir(a,"array"))("for(var i=0;i<%s.length;++i){",i),my(e,a,s,i+"[i]")("}");else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&&e("if(p%s===1)",n)("return%j",a.partOf.name+": multiple values"),o[a.partOf.name]=1,e("p%s=1",n)}my(e,a,s,i)}a.optional&&e("}")}return e("return null")}});var vy=T(eq=>{"use strict";var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r("switch(d%s){",o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]===e.typeDefault&&!s&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),e.repeated||r("break"),s=!0),r("case%j:",i[n])("case %i:",a[i[n]])("m%s=%j",o,a[i[n]])("break");r("}")}else r('if(typeof d%s!=="object")',o)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,t,o);else{var l=!1;switch(e.type){case"double":case"float":r("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",o,o);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,l)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,l?"true":"");break;case"bytes":r('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":r("m%s=String(d%s)",o,o);break;case"bool":r("m%s=Boolean(d%s)",o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return o("return new this.ctor");o("var m=new this.ctor");for(var s=0;s<t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o("if(d%s){",i)('if(typeof d%s!=="object")',i)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",i)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",i),Sy(o,a,s,i+"[ks[i]]")("}")("}")):a.repeated?(o("if(d%s){",i)("if(!Array.isArray(d%s))",i)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",i)("for(var i=0;i<d%s.length;++i){",i),Sy(o,a,s,i+"[i]")("}")("}")):(a.resolvedType instanceof Vc||o("if(d%s!=null){",i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o("}"))}return o("return m")};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,t,o,o,t,o,o):r("d%s=types[%i].toObject(m%s,o)",o,t,o);else{var s=!1;switch(e.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,s?"true":"",o);break;case"bytes":r("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:r("d%s=m%s",o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()("return {}");for(var o=$r.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),s=[],a=[],i=[],n=0;n<t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o("if(o.arrays||o.defaults){"),n=0;n<s.length;++n)o("d%s=[]",$r.safeProp(s[n].name));o("}")}if(a.length){for(o("if(o.objects||o.defaults){"),n=0;n<a.length;++n)o("d%s={}",$r.safeProp(a[n].name));o("}")}if(i.length){for(o("if(o.defaults){"),n=0;n<i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o("d%s=o.enums===String?%j:%j",c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",c,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else o("d%s=%j",c,l.typeDefault)}o("}")}var f=!1;for(n=0;n<t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),gy(o,l,_,c+"[ks2[j]]")("}")):l.repeated?(o("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),gy(o,l,_,c+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",c,l.name),gy(o,l,_,c),l.partOf&&o("if(o.oneofs)")("d%s=%j",$r.safeProp(l.partOf.name),l.name)),o("}")}return o("return d")}});var yy=T(tq=>{"use strict";var upe=tq,fpe=f_();upe[".google.protobuf.Any"]={fromObject:function(r){if(r&&r["@type"]){var e=r["@type"].substring(r["@type"].lastIndexOf("/")+1),t=this.lookup(e);if(t){var o=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return o.indexOf("/")===-1&&(o="/"+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t="type.googleapis.com/",o="",s="";if(e&&e.json&&r.type_url&&r.value){s=r.type_url.substring(r.type_url.lastIndexOf("/")+1),o=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var a=this.lookup(s);a&&(r=a.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return o===""&&(o=t),s=o+n,i["@type"]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=>{"use strict";nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className="Type";var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e<r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t<this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t<this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&&Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen(["p"],e.name),o=0,s;o<e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t("this%s={}",_t.safeProp(s.name)):s.repeated&&t("this%s=[]",_t.safeProp(s.name));return t("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a<s.length;++a)o.add((typeof t.fields[s[a]].keyType<"u"?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a<s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a<s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&&t.extensions.length&&(o.extensions=t.extensions),t.reserved&&t.reserved.length&&(o.reserved=t.reserved),t.group&&(o.group=!0),t.comment&&(o.comment=t.comment),t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",or.arrayToJSON(this.oneofsArray,e),"fields",or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o<e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o<t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof p_&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o<this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=>{"use strict";sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className="Root";var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,"",r),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t=="function"&&(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&&O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf("google/protobuf/");if(O>-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&&O.charAt(0)==="{"&&(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I<y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&&c(A);if(y.weakImports)for(I=0;I<y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&&c(A,!0)}}catch(M){i(M)}!a&&!u&&i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)>-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString("utf8")}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&&(e=[e]);for(var f=0,_;f<e.length;++f)(_=s.resolvePath("",e[f]))&&c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error("not supported");return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&&!e.extensionField&&(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t<this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o<e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&&(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&&(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&&delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o<e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=>{"use strict";var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire("fs");He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s<t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o<e.length;){var s=e[o++],a=e[o++];a!==void 0&&(t[s]=a)}return t};var vpe=/\\/g,ype=/"/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?'["'+e.replace(vpe,"\\\\").replace(ype,'\\"')+'"]':"."+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly("Enum"+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c==="__proto__"||c==="prototype")return i;if(n.length>0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&&s)return i;u&&(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!="object")throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),a(e,t,o)};Object.defineProperty(He,"decorateRoot",{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=>{"use strict";var Gc=cq,Rpe=rt(),Npe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Hc(r,e){var t=0,o={};for(e|=0;t<r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=>{"use strict";fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className="Field";var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&&(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Ke.isString(t))throw TypeError("type must be a string");if(o!==void 0&&!Cpe.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==void 0&&!Ke.isString(s))throw TypeError("extend must be a string");o==="proto3_optional"&&(o="optional"),this.rule=o&&o!=="optional"?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(nt.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(nt.prototype,"delimited",{get:function(){return this.resolvedType instanceof qc&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(nt.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(nt.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof uq&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof uq)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&&(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var t={};if(this.rule==="required"&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof qc&&o.group&&(t.message_encoding="DELIMITED")}return this.getOption("packed")===!0?t.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(t.repeated_field_encoding="EXPANDED"),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t=="function"?t=Ke.decorateType(t).name:t&&typeof t=="object"&&(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=>{"use strict";hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className="OneOf";var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e<r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o<this.oneof.length;++o){var s=e.get(this.oneof[o]);s&&!s.partOf&&(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t<this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&&o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&&r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=>{"use strict";_q.exports=ct;ct.className="ReflectionObject";var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},bpe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},Lpe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function ct(r,e){if(!Yc.isString(r))throw TypeError("name must be a string");if(e&&!Yc.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(".")}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&&t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&&t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&&(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")t=Object.assign({},bpe);else if(e==="proto3")t=Object.assign({},Lpe);else if(e==="2023")t=Object.assign({},Ipe);else throw new Error("Unknown edition: "+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s<o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=>{"use strict";mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className="Enum";var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n<i.length;++n)typeof e[i[n]]=="number"&&(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=>{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&&this.valuesOptions[t]&&this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError("name must be a string");if(!y_.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(t==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=>{"use strict";Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,o,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,o,(e.id<<3|2)>>>0)}function Mpe(r){for(var e=Dy.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t<s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?"int32":a.type,l=wy.basic[n];o="m"+Dy.safeProp(a.name),a.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",o,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",i,o):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,n,o),e("}")("}")):a.repeated?(e("if(%s!=null&&%s.length){",o,o),a.packed&&wy.packed[n]!==void 0?e("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",o)("w.%s(%s[i])",n,o)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",o),l===void 0?Tq(e,a,i,o+"[i]"):e("w.uint32(%i).%s(%s[i])",(a.id<<3|l)>>>0,n,o)),e("}")):(a.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",o,a.name),l===void 0?Tq(e,a,i,o):e("w.uint32(%i).%s(%s)",(a.id<<3|l)>>>0,n,o))}return e("return w")}});var vq=T((yFe,gq)=>{"use strict";var de=gq.exports=sv();de.build="light";function wpe(r,e,t){return typeof e=="function"?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=>{"use strict";Aq.exports=Oq;var Uy=/[\s{}=;:[\],'"()<>]/g,Upe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,kpe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:"\0",r:"\r",n:` `,t:" "};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case"\\":case"":return t;default:return qpe[t]||""}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error("illegal "+N+" (line "+s+")")}function u(){var N=l==="'"?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c("string");return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$<0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===" "||le===" ");for(var v=r.substring(N,z).split(Fpe),W=0;W<v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,"").trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z<o&&f(z)!==` `;)z++;return z}function y(){if(n.length>0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&&($=!0,++s),++t===o)return null;if(f(t)==="/"){if(++t===o)throw c("comment");if(f(t)==="/")if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&&(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)==="/";f(++t)!==` `;)if(t===o)return null;++t,te&&(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))==="*"){G=t+1,te=e||f(G)==="*";do{if(B===` `&&++s,++t===o)throw c("comment");z=B,B=f(t)}while(z!=="*"||B!=="/");++t,te&&(_(G,t-2,$),$=!0),N=!0}else return"/"}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le<o&&!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W==='"'||W==="'")&&(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c("token '"+B+"', '"+N+"' expected");return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&&(e||B.type==="*"||B.lineEmpty)&&(z=B.leading?B.text:null)):(a<N&&I(),B=i[N],delete i[N],B&&!B.lineEmpty&&(e||B.type==="/")&&(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},"line",{get:function(){return s}})}});var bq=T((AFe,Iq)=>{"use strict";Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O="proto2",y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=>{L._edition=O,Object.keys(I).forEach(b=>{L.getOption(b)===void 0&&L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error("illegal "+(b||"token")+" '"+L+"' ("+(j?j+", ":"")+"line "+s.line+")")}function z(){var L=[],b;do{if((b=a())!=='"'&&b!=="'")throw N(b);L.push(a()),l(b),b=n()}while(b==='"'||b==="'");return L.join("")}function B(L){var b=a();switch(b){case"'":case'"':return i(b),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return te(b,!0)}catch{if(L&&Wr.test(b))return b;throw N(b,"value")}}function G(L,b){var x,j;do if(b&&((x=n())==='"'||x==="'")){var q=z();if(L.push(q),O>=2023)throw N(q,"id")}else try{L.push([j=$(a()),l("to",!0)?$(a()):j])}catch(Le){if(b&&Wr.test(x)&&O>=2023)L.push(x);else throw Le}while(l(",",!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&&(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut==="option")Z(ne,ut),l(";");else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)==="-"&&(x=-1,L=L.substring(1)),L){case"inf":case"INF":case"Inf":return x*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,"number",b)}function $(L,b){switch(L){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!b&&L.charAt(0)==="-")throw N(L,"id");if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,"id")}function le(){if(f!==void 0)throw N("package");if(f=a(),!Wr.test(f))throw N(f,"name");y=y.define(f),l(";")}function v(){var L=n(),b;switch(L){case"weak":b=m||(m=[]),a();break;case"public":a();default:b=_||(_=[]);break}L=z(),l(";"),b.push(L)}function W(){if(l("="),O=z(),O<2023)throw N(O,"syntax");l(";")}function R(){if(l("="),O=z(),!["2023"].includes(O))throw N(O,"edition");l(";")}function E(L,b){switch(b){case"option":return Z(L,b),l(";"),!0;case"message":return Q(L,b),!0;case"enum":return Me(L,b),!0;case"service":return wo(L,b),!0;case"extend":return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&&(typeof L.comment!="string"&&(L.comment=c()),L.filename=vn.filename),l("{",!0)){for(var q;(q=a())!=="}";)b(q);l(";",!0)}else x&&x(),l(";"),L&&(typeof L.comment!="string"||o)&&(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,"type name");var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case"map":ce(x,q);break;case"required":if(O!=="proto2")throw N(q);case"repeated":Y(x,q);break;case"optional":if(O==="proto3")Y(x,"proto3_optional");else{if(O!=="proto2")throw N(q);Y(x,"optional")}break;case"oneof":Ne(x,q);break;case"extensions":G(x.extensions||(x.extensions=[]));break;case"reserved":G(x.reserved||(x.reserved=[]),!0);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(x,"optional");break}}),L.add(x),L===y&&A.push(x)}function Y(L,b,x){var j=a();if(j==="group"){J(L,b);return}for(;j.endsWith(".")||n().startsWith(".");)j+=a();if(!Wr.test(j))throw N(j,"type");var q=a();if(!Xr.test(q))throw N(q,"name");q=M(q),l("=");var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et==="option")Z(ne,Et),l(";");else throw N(Et)},function(){We(ne)}),b==="proto3_optional"){var Le=new Pq("_"+q);ne.setOption("proto3_optional",!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&&A.push(ne)}function J(L,b){if(O>=2023)throw N("group");var x=a();if(!Xr.test(x))throw N(x,"name");var j=By.lcFirst(x);x===j&&(x=By.ucFirst(x)),l("=");var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case"option":Z(ne,Et),l(";");break;case"required":case"repeated":Y(ne,Et);break;case"optional":O==="proto3"?Y(ne,"proto3_optional"):Y(ne,"optional");break;case"message":Q(ne,Et);break;case"enum":Me(ne,Et);break;case"reserved":G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l("<");var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,"type");l(",");var x=a();if(!Wr.test(x))throw N(x,"type");l(">");var j=a();if(!Xr.test(j))throw N(j,"name");l("=");var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le==="option")Z(q,Le),l(";");else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new Pq(M(b));C(x,function(q){q==="option"?(Z(x,q),l(";")):(i(q),Y(x,"optional"))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new zpe(b);C(x,function(q){switch(q){case"option":Z(x,q),l(";");break;case"reserved":G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&&(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&&A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,"name");l("=");var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne==="option")Z(j,ne),l(";");else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b==="option"&&(b=a());b!=="=";){if(b==="("){var ne=a();l(")"),b="("+ne+")"}if(q){if(q=!1,b.includes(".")&&!b.includes("(")){var Le=b.split(".");x=Le[0]+".",b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&&j[0]==="."?j.slice(1):j,x=x&&x[x.length-1]==="."?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l("{",!0)){for(var x={};!l("}",!0);){if(!Xr.test(Ye=a()))throw N(Ye,"name");if(Ye===null)throw N(Ye,"end of input");var j,q=Ye;if(l(":",!0),n()==="{")j=je(L,b+"."+Ye);else if(n()==="["){j=[];var ne;if(l("[",!0)){do ne=B(!0),j.push(ne);while(l(",",!0));l("]"),typeof ne<"u"&&me(L,b+"."+Ye,ne)}}else j=B(!0),me(L,b+"."+Ye,j);var Le=x[q];Le&&(j=[].concat(Le).concat(j)),x[q]=j,l(",",!0),l(";",!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&&/^features\./.test(b)){I[b]=x;return}L.setOption&&L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&&L.setParsedOption(b,x,j)}function We(L){if(l("[",!0)){do Z(L,"option");while(l(",",!0));l("]")}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,"service name");var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q==="rpc")Do(x,q);else throw N(q)}),L.add(x),L===y&&A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,"name");var q=b,ne,Le,ut,Et;if(l("("),l("stream",!0)&&(Le=!0),!Wr.test(b=a())||(ne=b,l(")"),l("returns"),l("("),l("stream",!0)&&(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(")");var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm==="option")Z(Lu,dm),l(";");else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,"reference");var x=b;C(null,function(q){switch(q){case"required":case"repeated":Y(L,q,x);break;case"optional":O==="proto3"?Y(L,"proto3_optional",x):Y(L,"optional",x);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(L,"optional",x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case"package":if(!u)throw N(Ye);le();break;case"import":if(!u)throw N(Ye);v();break;case"syntax":if(!u)throw N(Ye);W();break;case"edition":if(!u)throw N(Ye);R();break;case"option":Z(y,Ye),l(";",!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=>{"use strict";xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r="google/protobuf/"+r+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Lq;Nr("duration",{Duration:Lq={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Nr("timestamp",{Timestamp:Lq});Nr("empty",{Empty:{fields:{}}});Nr("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});Nr("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});Nr("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=>{"use strict";var ii=wq.exports=vq();ii.build="full";ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=>{"use strict";Uq.exports=Dq()});var Vy=T((PFe,ode)=>{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],"php_generic_services",[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=>{"use strict";var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(".google.protobuf");var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length=="number"&&(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a<e.file.length;++a){s=t,(o=e.file[a]).package&&o.package.length&&(s=t.define(o.package));var n=Ede(o);if(o.name&&o.name.length&&t.files.push(s.filename=o.name),o.messageType)for(i=0;i<o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i<o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i<o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i<o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i<c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s<r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&&Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&&e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:"Type"+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a<e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a<e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty("oneofIndex")&&s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a<e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a<e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&&e.nestedType[a].options.mapEntry&&s.setOption("map_entry",!0);if(e.enumType)for(a=0;a<e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&&e.extensionRange.length)for(s.extensions=[],a=0;a<e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a<e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a<e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o<this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&&Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:"key",number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:"value",number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o<this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&&t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o<this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o<this.reserved.length;++o)typeof this.reserved[o]=="string"?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var s;e.typeName&&e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a="required";break;case 3:a="repeated";break;default:throw Error("illegal label: "+e.label)}var i=e.extendee;e.extendee!==void 0&&(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:"field"+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&&(n.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var c=lde.exec(l);c&&(l=parseInt(l));break}n.setOption("default",l)}return hde(e.type)&&(t==="proto3"?e.options&&!e.options.packed&&n.setOption("packed",!1):(!t||t==="proto2")&&e.options&&e.options.packed&&n.setOption("packed",!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?t.label=3:this.required&&e==="proto2"?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&&(t.defaultValue=String(this.options.default)),this.options.proto3_optional&&(t.proto3_optional=!0)),e==="proto3"?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a<e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&&i.length?i:"NAME"+n]=n}var l=new yn(e.name&&e.name.length?e.name:"Enum"+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t<o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&&e.name.length?e.name:"oneof"+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&&e.name.length?e.name:"Service"+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a<e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t<this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&&e.name.length?e.name:"Method"+pde++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error("illegal type: "+r)}function Vq(r,e){for(var t={},o=0,s,a;o<e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&&!Array.isArray(t[i])&&(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split("."),o=e.fullName.split("."),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&&e instanceof kq)for(;s<t.length&&a<i&&t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&&n!==e)break;++a}else for(;s<t.length&&a<i&&t[s]===o[a];++s,++a);return o.slice(a).join(".")}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function Ede(r){if(r.syntax==="editions")switch(r.edition){case ae.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+r.edition)}return r.syntax==="proto3"?"proto3":"proto2"}function mde(r,e){if(r)if(r==="proto2"||r==="proto3")e.syntax=r;else switch(e.syntax="editions",r){case"2023":e.edition=ae.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+r)}}});var jq=T((IFe,Tde)=>{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=>{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zq=T((LFe,gde)=>{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Wq=T(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V("fs"),$q=V("path"),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=>{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common("api",r.nested.google.nested.protobuf.nested),ha.common("descriptor",e.nested.google.nested.protobuf.nested),ha.common("source_context",t.nested.google.nested.protobuf.nested),ha.common("type",o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=>{(function(r,e){function t(o){return o.default||o}typeof define=="function"&&define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c=="object"?(e($c),typeof Gy=="object"&&(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:$c,function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function o(R){return(R&&R.__isLong__)===!0}function s(R){var E=Math.clz32(R&-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R>>>=0,(Y=0<=R&&R<256)&&(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&&(i[R]=C),C)):(R|=0,(Y=-128<=R&&R<128)&&(Q=a[R],Q)?Q:(C=c(R,R<0?-1:0,!1),Y&&(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R<0)return N;if(R>=A)return $}else{if(R<=-I)return le;if(R+1>=I)return te}return R<0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error("empty string");if(typeof E=="number"?(C=E,E=!1):E=!!E,R==="NaN"||R==="Infinity"||R==="+Infinity"||R==="-Infinity")return E?N:F;if(C=C||10,C<2||36<C)throw RangeError("radix");var Q;if((Q=R.indexOf("-"))>0)throw Error("interior hyphen");if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce<R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne<8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R=="number"?l(R,E):typeof R=="string"?f(R,E):c(R.low,R.high,typeof E=="boolean"?E:R.unsigned)}t.fromValue=_;var m=65536,O=1<<24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},v.toString=function(E){if(E=E||10,E<2||36<E)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return"-"+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne="";;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()>>>0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length<6;)Z="0"+Z;Ne=""+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C>0&&(E&1<<C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high>>21;return E?this.unsigned?!1:E===-1&&!(this.low===0&&this.high===-2097152):!0},v.isZero=function(){return this.high===0&&this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(this.low&1)===1},v.isEven=function(){return(this.low&1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&&this.high>>>31===1&&E.high>>>31===1?!1:this.high===E.high&&this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&&!Q?-1:!C&&Q?1:this.unsigned?E.high>>>0>this.high>>>0||E.high===this.high&&E.low>>>0>this.low>>>0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high>>>16,Q=this.high&65535,Y=this.low>>>16,J=this.low&65535,ce=E.high>>>16,Ne=E.high&65535,Me=E.low>>>16,Te=E.low&65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we>>>16,we&=65535,me+=Y+Me,je+=me>>>16,me&=65535,je+=Q+Ne,Z+=je>>>16,je&=65535,Z+=C+ce,Z&=65535,c(me<<16|we,Z<<16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&&E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high>>>16,Y=this.high&65535,J=this.low>>>16,ce=this.low&65535,Ne=E.high>>>16,Me=E.high&65535,Te=E.low>>>16,Z=E.low&65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We>>>16,We&=65535,we+=J*Z,me+=we>>>16,we&=65535,we+=ce*Te,me+=we>>>16,we&=65535,me+=Y*Z,je+=me>>>16,me&=65535,me+=J*Te,je+=me>>>16,me&=65535,me+=ce*Me,je+=me>>>16,me&=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&=65535,c(we<<16|We,je<<16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&E.low===-1&&E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne<=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&&(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&E.low,this.high&E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low<<E,this.high<<E|this.low>>>32-E,this.unsigned):c(0,this.low<<E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>E,this.unsigned):c(this.high>>E-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>>E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high>>>E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.low<<E|this.high>>>C,this.high<<E|this.low>>>C,this.unsigned)):(E-=32,C=32-E,c(this.high<<E|this.low>>>C,this.low<<E|this.high>>>C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.high<<C|this.low>>>E,this.low<<C|this.high>>>E,this.unsigned)):(E-=32,C=32-E,c(this.low<<C|this.high>>>E,this.high<<C|this.low>>>E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&255,C>>>8&255,C>>>16&255,C>>>24,E&255,E>>>8&255,E>>>16&255,E>>>24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E>>>24,E>>>16&255,E>>>8&255,E&255,C>>>24,C>>>16&255,C>>>8&255,C&255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]<<8|E[2]<<16|E[3]<<24,E[4]|E[5]<<8|E[6]<<16|E[7]<<24,C)},t.fromBytesBE=function(E,C){return new t(E[4]<<24|E[5]<<16|E[6]<<8|E[7],E[0]<<24|E[1]<<16|E[2]<<8|E[3],C)},typeof BigInt=="function"&&(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E>>BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E=="bigint"?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low>>>0),C=BigInt(this.unsigned?this.high>>>0:this.high);return C<<BigInt(32)|E});var W=r.default=t})});var ij=T(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return"@type"in r&&typeof r["@type"]=="string"}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",r.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",r.IDEMPOTENT="IDEMPOTENT"})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===""?e:r+"."+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&&typeof r.nested<"u"?Object.keys(r.nested).map(o=>rj(r.nested[o],t)).reduce((o,s)=>o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=>{for(let[o,s]of Object.entries(t))switch(o){case"uninterpreted_option":e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:"/"+e+"/"+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error("Type mismatch in reflection object handling")}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor("proto3").file.map(a=>Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,""))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=>N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V("net"),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)==="channel"?o:void 0,childSubchannel:(o==null?void 0:o.kind)==="subchannel"?o:void 0}),this.events.length>=oj*2&&(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&&(o.count-=1,o.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=>{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=>{let n=t(),l={id:n,name:s,kind:r};return i&&o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_("channel");Ie.registerChannelzSubchannel=x_("subchannel");Ie.registerChannelzServer=x_("server");Ie.registerChannelzSocket=x_("socket");function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r==="")return[];let e=r.split(":").map(o=>Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&&r.toLowerCase().startsWith("::ffff:")&&(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(".").map(e=>Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf("::");o===-1?(e=r,t=""):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Xc.ConnectivityState.IDLE:return{state:"IDLE"};case Xc.ConnectivityState.READY:return{state:"READY"};case Xc.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=>{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=>{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No channel data found for id "+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&&o.length<t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=>{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&&a.length<t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No subchannel data found for id "+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=>{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:"tcpip_address",tcpip_address:{ip_address:(e=Kde(r.host))!==null&&e!==void 0?e:void 0,port:r.port}}:{address:"uds_address",uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:"No socket data found for id "+n});return}let c=l.getInfo(),u=c.security?{model:"tls",tls:{cipher_suite:c.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(t=c.security.cipherSuiteStandardName)!==null&&t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&&o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&&s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&&a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&&i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&&l.length<a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe="subchannel",she=~(1<<31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new rhe.BackoffTimeout(()=>{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o["grpc.keepalive_time_ms"])!==null&&i!==void 0?i:-1,o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=>{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&&this.keepaliveTime>0&&(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]+' with error "'+o+'"'):this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=>{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=>{"use strict";var eO;Object.defineProperty(D_,"__esModule",{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&eO!==void 0?eO:"false")==="true"});var oO=T(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V("dns"),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V("net"),uhe=Nc(),Tj=_j(),fhe="dns_resolver";function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn("Resolver constructed for target "+(0,ai.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&&s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&&a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoff=new uhe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o["grpc.dns_min_time_between_resolutions_ms"])!==null&&i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn("Returning IP address for target "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn("Failed to parse DNS address "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=>({addresses:[s]}));let o="["+t.map(s=>s.host+":"+s.port).join(",")+"]";if(tn("Resolved addresses for target "+(0,ai.uriToString)(this.target)+": "+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=>{this.pendingLookupPromise!==null&&(tn("Resolution error for target "+(0,ai.uriToString)(this.target)+": "+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=>{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn("Using alternative DNS resolver.");let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=>s.status==="rejected"))throw new Error(o[0].reason);return o.reduce((s,a)=>a.status==="fulfilled"?[...s,...a.value]:s,[]).map(s=>({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=>({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn('resolution update delayed by "min time between resolutions" rate limit'):tn("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)("dns",iO),(0,Ej.registerDefaultScheme)("dns")}});var sO=T(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V("net"),hhe=V("http"),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V("url"),mhe=oO(),The="proxy";function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r="",e="";if(process.env.grpc_proxy)e="grpc_proxy",r=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",r=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(t.protocol!=="http:")return(0,Jc.log)(_a.LogVerbosity.ERROR,`"${t.protocol}" scheme not supported in proxy URI`),{};let o=null;t.username&&(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,"userinfo found in proxy URI"),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===""&&(a="80");let i={address:`${s}:${a}`};return o&&(i.creds=o),Ea("Proxy server "+i.address+" set by environment variable "+e),i}function ghe(){let r=process.env.no_grpc_proxy,e="no_grpc_proxy";return r||(r=process.env.no_proxy,e="no_proxy"),r?(Ea("No proxy server list set by environment variable "+e),r.split(",")):[]}function vj(r){let e=r.split("/");if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t<0||t>32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1<<32-r.prefixLength;return(yj(e)&o)===(t&o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&&t&&vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e["grpc.enable_http_proxy"])!==null&&t!==void 0?t:1)===0||r.scheme==="unix")return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea("Not using proxy for target in no_proxy list: "+(0,Qc.uriToString)(r)),o;let n={"grpc.http_connect_target":(0,Qc.uriToString)(r)};return s.creds&&(n["grpc.http_connect_creds"]=s.creds),{target:{scheme:"dns",path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let o=e["grpc.http_connect_target"],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&&t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:"CONNECT",path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,"grpc.http_connect_creds"in e&&(l["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea("Using proxy "+c+" to connect to "+n.path),new Promise((u,f)=>{let _=hhe.request(n);_.once("connect",(m,O,y)=>{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea("Successfully connected to "+n.path+" through proxy "+c),y.length>0&&O.unshift(y),Ea("Successfully established a plaintext connection to "+n.path+" through proxy "+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to "+n.path+" through proxy "+c+" with status "+m.statusCode),f())}),_.once("error",m=>{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to proxy "+c+" with error "+m.message),f()}),_.end()})}});var lO=T(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]="NO_DATA",r[r.READING_SIZE=1]="READING_SIZE",r[r.READING_MESSAGE=2]="READING_MESSAGE"})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t<e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error("Unexpected read state")}return s}};U_.StreamDecoder=aO});var Oj=T(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});k_.Http2SubchannelCall=void 0;var An=V("http2"),Rhe=V("os"),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe="subchannel_call";function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return"Unknown system error "+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()["grpc.max_receive_message_length"])!==null&&i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on("response",(l,c)=>{let u="";for(let f of Object.keys(l))u+=" "+f+": "+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[":status"],c&An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on("trailers",l=>{this.handleTrailers(l)}),e.on("data",l=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var l;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u="";switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u="Stream refused by server";break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u="Connection dropped"):(c=Oe.Status.CANCELLED,u="Call cancelled");break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on("error",l=>{l.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+l.message+" code="+l.code+" errno="+bhe(l.errno)+" syscall="+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:Oe.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t="";for(let i of Object.keys(e))t+=" "+i+": "+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s["grpc-status"]=="string"){let i=Number(s["grpc-status"]);this.trace("received status code "+i+" from server"),o.remove("grpc-status");let n="";if(typeof s["grpc-message"]=="string"){try{n=decodeURI(s["grpc-message"])}catch{n=s["grpc-message"]}o.remove("grpc-message"),this.trace('received status details string "'+n+'" from server')}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:"No status information received",metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);let o=s=>{process.nextTick(()=>{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)==="ERR_STREAM_WRITE_AFTER_END"&&(i=Oe.Status.INTERNAL),s&&this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=>{"use strict";Object.defineProperty(fO,"__esModule",{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V("http2"),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V("net"),Uhe=Oj(),khe=pO(),hO="transport",Bhe="transport_flowctrl",Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from("too_many_pings","ascii"),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o["grpc.primary_user_agent"],`grpc-node-js/${Vhe}`,o["grpc.secondary_user_agent"]].filter(a=>a).join(" "),"grpc.keepalive_time_ms"in o?this.keepaliveTimeMs=o["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in o?this.keepaliveTimeoutMs=o["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=zhe,"grpc.keepalive_permit_without_calls"in o?this.keepaliveWithoutCalls=o["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(a,i,n)=>{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(Khe)&&(l=!0),this.trace("connection closed by GOAWAY with code "+a+" and data "+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once("error",a=>{this.trace("connection closed with error "+a.message),this.handleDisconnect()}),e.socket.once("close",a=>{this.trace("connection closed. hadError="+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&&(e.on("remoteSettings",a=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))}),e.on("localSettings",a=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&&"raw"in f?f.raw:null,remoteCertificate:_&&"raw"in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&&t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&&o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o="";try{this.session.ping((a,i,n)=>{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace("Ping failed with error "+a.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(o="Ping returned false")}catch(s){o=(s instanceof Error?s.message:"")||"Unknown error"}o&&(this.keepaliveTrace("Ping send failed: "+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]="application/grpc",i[Hhe]="POST",i[qhe]=o,i[jhe]="trailers";let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=>{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+" "+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((s,a)=>{let i=null,n=this.channelTarget;if("grpc.http_connect_target"in o){let A=(0,dO.parseUri)(o["grpc.http_connect_target"]);A&&(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?"https":"http",c=(0,whe.getDefaultAuthority)(n),u=()=>{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=>{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace("connection failed with error "+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=>e.socket};o["grpc-node.flow_control_window"]!==void 0&&(_.settings={initialWindowSize:o["grpc-node.flow_control_window"]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O="Failed to connect",y=!1;m.unref(),m.once("remoteSettings",()=>{m.removeAllListeners(),e.socket.removeListener("close",u),e.socket.removeListener("error",f),s(new _O(m,t,o,i)),this.session=null}),m.once("close",u),m.once("error",f),e.socket.once("close",u),e.socket.once("error",f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=>o||new Promise((s,a)=>{let i=()=>{a(new Error("Socket closed"))},n=c=>{a(c)},l=Dhe.connect(e,()=>{l.removeListener("close",i),l.removeListener("error",n),s(l)});l.once("close",i),l.once("error",n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+" Waiting for secureConnector to be ready"),await t.waitForReady(),this.trace(i+" secureConnector is ready"),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+" Established TCP connection"),a=await t.connect(s),this.trace(i+" Established secure connection"),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=>!a.subchannel.unrefIfOneRef());s.length>0&&(e=!1),this.pool[t]=s}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&&(0,$he.channelOptionsEqual)(o,l.channelArguments)&&s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=>e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]="identity",r[r.deflate=1]="deflate",r[r.gzip=2]="gzip"})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V("zlib"),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=>typeof r=="number"&&typeof Pj.CompressionAlgorithms[r]=="string",ga=class{async writeMessage(e,t){let o=e;t&&(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&&(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.deflate(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createInflate();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.gzip(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createGunzip();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case"identity":return new mo;case"deflate":return new OO(e);case"gzip":return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm="identity";let i=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(o=e["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e["grpc.max_send_message_length"])!==null&&s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(",");(!l||l.includes(n))&&(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get("grpc-encoding");if(t.length>0){let s=t[0];typeof s=="string"&&(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let o=e.get("grpc-accept-encoding")[0];return o&&(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&&o.message.length>this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&&t!==void 0?t:0)&2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o<e&&(e=o)}return e}var s_e=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&&(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a<1e8)return String(Math.ceil(a))+o}throw new Error("Deadline is too far in the future")}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o<0?0:o>l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?""+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+"s"}});var z_=T(CO=>{"use strict";Object.defineProperty(CO,"__esModule",{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V("http2"),m_e="load_balancing_call",IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split("/"),f="";u.length>=2&&(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&&c!==void 0?c:"localhost";this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&o.push("wait_for_ready"),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&o.push("wait_for_ready"),o.push("Waiting for LB pick"),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,"["+this.callNumber+"] "+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?"("+s.subchannel.getChannelzRef().id+") "+s.subchannel.getAddress():""+s.subchannel;switch(this.trace("Pick result: "+iu.PickResultType[s.pickResultType]+" subchannel: "+a+" status: "+((e=s.status)===null||e===void 0?void 0:e.code)+" "+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(o.merge(c),o.get("authorization").length>1&&this.outputStatus({code:K_.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new $_.Metadata},"PROCESSED"),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace("Picked subchannel "+a+" has state "+bj.ConnectivityState[s.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&o.set("grpc-timeout",(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=>{this.trace("Received message"),this.listener.onReceiveMessage(f)},onReceiveStatus:f=>{this.trace("Received status"),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,"REFUSED"):this.outputStatus(f,"PROCESSED")}}),this.childStartTime=new Date}catch(f){this.trace("Failed to start call on picked subchannel "+a+" with error "+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+f.message,metadata:new $_.Metadata},"NOT_STARTED");return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},c=>{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code=="number"?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},"PROCESSED")});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:n,details:l,metadata:s.status.metadata},"DROP")});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:c,details:u,metadata:s.status.metadata},"PROCESSED")})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},"PROCESSED")}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e="resolving_call",bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&&(o.flags&So.Propagate.CANCELLATION&&o.parentCall.on("cancelled",()=>{this.cancelWithStatus(So.Status.CANCELLED,"Cancelled by parent call")}),o.flags&So.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push("waiting for metadata filters")):o.push("waiting for name resolution"),this.child&&o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(","))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(o=>o(t)),process.nextTick(()=>{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=>{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&&o.halfClose()},s=>{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,"Failed to route call to method "+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},a=>{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},o=>{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e="retrying_call",xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;return this.limitPerCall-s<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;if(s<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&&t!==void 0?t:0;if(this.totalAllocated<o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} > total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO="grpc-previous-rpc-attempts",N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:N_e;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state="RETRY";let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&&t!==void 0?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let o=this.getBufferEntry(t);o.allocated&&this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s<this.underlyingCalls.length;s++)s!==e&&this.underlyingCalls[s].state!=="COMPLETED"&&(this.underlyingCalls[s].state="COMPLETED",this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state==="ACTIVE"&&s.nextMessageToSend>e&&(e=s.nextMessageToSend,t=o);t===-1?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=>{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!=="RETRY"){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var s,a;if(this.state!=="RETRY"){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&&a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o<0){this.state="TRANSPARENT_ONLY",this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get("grpc-retry-pushback-ms");if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[t].call.getCallNumber()+"] in state "+this.underlyingCalls[t].state),this.underlyingCalls[t].state="COMPLETED",e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(t),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(t),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&&e!==void 0?e:"0s",i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o>0&&s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),a=!0,o>0&&i.set(LO,`${o}`),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMetadata(i)},onReceiveMessage:i=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMessage(i)},onReceiveStatus:i=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!a&&o>0&&i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace("start called"),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!=="COMPLETED"&&this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:s=>{this.handleChildWriteCompleted(e)}},o.message.message);break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,t){var o;this.trace("write() called with message of length "+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:"MESSAGE",message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state==="ACTIVE"&&l.nextMessageToSend===a&&l.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state==="ACTIVE"&&n.nextMessageToSend===a&&n.call.sendMessageWithContext({callback:l=>{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&t.nextMessageToSend===e&&(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1<<24,q_e=1<<20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof C_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options["grpc.use_local_subchannel_pool"])!==null&&s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options["grpc.retry_buffer_size"])!==null&&a!==void 0?a:H_e,(i=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&i!==void 0?i:q_e),this.keepaliveTime=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options["grpc.client_idle_timeout_ms"])!==null&&l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=>{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=>{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length>0&&this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=>{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=>{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length>0&&this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+y.code+' and details "'+y.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length>0&&this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)("channel_stacktrace")&&(0,eE.trace)(ci.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&&t.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=>o===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+sr.ConnectivityState[this.connectivityState]+" -> "+sr.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&&(o.timer&&clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+i+'] method="'+t+'"'),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createRetryingCall ["+i+'] method="'+t+'"'),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace("createResolvingCall ["+i+'] method="'+e+'", deadline='+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=>{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i<=n){process.nextTick(o,new Error("Deadline passed without connectivity state change"));return}s=setTimeout(()=>{this.removeConnectivityStateWatcher(a),o(new Error("Deadline passed without connectivity state change"))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof j_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V("events"),XO=V("stream"),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:"message"in r?r.message:"Unknown Error",metadata:(t=e??r.metadata)!==null&&t!==void 0?t:null};return"code"in r&&typeof r.code=="number"&&Number.isInteger(r.code)&&(o.code=r.code,"details"in r&&typeof r.details=="string"&&(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",a=>{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",s=>{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(t))throw new TypeError("keyCertPairs must be an array");if(typeof o!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let a=[],i=[];for(let n=0;n<t.length;n++){let l=t[n];if(l===null||typeof l!="object")throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t<this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t<this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t<this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V("http2"),Vj=Mh(),Fj=V("zlib"),X_e=lO(),jj=Pe(),Yj="server_call";function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveHalfClose:r=>{r()},onCancel:()=>{}},sE={start:r=>{r()},sendMetadata:(r,e)=>{e(r)},sendMessage:(r,e)=>{e(r)},sendStatus:(r,e)=>{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&&o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&&s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&&a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&&i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&&o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&&s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&&a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&&i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=>{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj="grpc-accept-encoding",cA="grpc-encoding",Gj="grpc-message",Hj="grpc-status",nA="grpc-timeout",J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:"identity,deflate,gzip",[cA]:"identity"},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once("error",u=>{}),this.stream.once("close",()=>{var u;Oo("Request to method "+((u=this.handler)===null||u===void 0?void 0:u.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",u=>{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in a&&(this.maxSendMessageSize=a["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in a&&(this.maxReceiveMessageSize=a["grpc.max_receive_message_length"]),this.host=(i=t[":authority"])!==null&&i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&&Oo("Request to "+this.handler.path+" received headers "+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length>0&&this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length>0&&(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=>{let a={code:bt.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t==="identity")return o;if(t==="deflate"||t==="gzip"){let s;return t==="deflate"?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=>{let n=0,l=[];s.on("data",c=>{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&&n>this.maxReceiveMessageSize&&(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on("end",()=>{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo("Request to "+this.handler.path+" received data frame of size "+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:"COMPRESSED",compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&o.length-5>this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo("Request to "+this.handler.path+" sent data frame of size "+o.length),this.stream.write(o,s=>{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo("Request to method "+((t=this.handler)===null||t===void 0?void 0:t.path)+" ended with status code: "+bt.Status[e.code]+" details: "+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var s;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&&t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type==="clientStream"||s.type==="bidi",responseStream:s.type==="serverStream"||s.type==="bidi",requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=>c(i,l),n)}});var Zj=T(fi=>{"use strict";var rEe=fi&&fi.__runInitializers||function(r,e,t){for(var o=arguments.length>2,s=0;s<e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&&fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var n=o.kind,l=n==="getter"?"get":n==="setter"?"set":"value",c=!e&&r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m>=0;m--){var O={};for(var y in o)O[y]=y==="access"?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(I||null))};var A=(0,t[m])(n==="accessor"?{get:u.get,set:u.set}:u[l],O);if(n==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(f=i(A.get))&&(u.get=f),(f=i(A.set))&&(u.set=f),(f=i(A.init))&&s.unshift(f)}else(f=i(A))&&(n==="field"?s.unshift(f):u[l]=f)}c&&Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,"__esModule",{value:!0});fi.Server=void 0;var Lt=V("http2"),iEe=V("util"),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1<<31),pA=~(1<<31),oEe=2e4,Xj=~(1<<31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe="server",Jj=Buffer.from("max_age");function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,"server_call",r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case"unary":return(o,s)=>{s(t,null)};case"clientStream":return(o,s)=>{s(t,null)};case"serverStream":return o=>{o.emit("error",t)};case"bidi":return o=>{o.emit("error",t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=>{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=s??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(a=this.options["grpc.max_connection_age_ms"])!==null&&a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options["grpc.max_connection_age_grace_ms"])!==null&&i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options["grpc.keepalive_timeout_ms"])!==null&&l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options["grpc.max_connection_idle_ms"])!==null&&c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&&a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:I&&"raw"in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&&i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,"("+this.channelzRef.id+") "+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+s)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(s,a){if(s===null||typeof s!="object"||a===null||typeof a!="object")throw new Error("addService() requires two objects as arguments");let i=Object.keys(s);if(i.length===0)throw new Error("Cannot add an empty service to a server");i.forEach(n=>{let l=s[n],c;l.requestStream?l.responseStream?c="bidi":c="clientStream":l.responseStream?c="serverStream":c="unary";let u=a[n],f;if(u===void 0&&typeof l.originalName=="string"&&(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!="object")throw new Error("removeService() requires object as argument");Object.keys(s).forEach(i=>{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=>({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),c=n!==null;this.trace("Initial credentials valid: "+c),a=Lt.createSecureServer(l),a.prependListener("connection",f=>{c||(this.trace("Dropped connection from "+JSON.stringify(f.address())+" due to unloaded credentials"),f.destroy())}),a.on("secureConnection",f=>{f.on("error",_=>{this.trace("An incoming TLS connection closed with error: "+_.message)})});let u=f=>{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,"Failed to set secure context with error "+m.message),f=null}}c=f!==null,this.trace("Post-update credentials valid: "+c)};s._addWatcher(u),a.on("close",()=>{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace("Attempting to bind "+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=>{let c=u=>{this.trace("Failed to bind "+(0,ui.subchannelAddressToString)(s)+" with error "+u.message),n({port:"port"in s?s.port:1,error:u.message})};i.once("error",c),i.listen(s,()=>{let u=i.address(),f;typeof u=="string"?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace("Successfully bound "+(0,ui.subchannelAddressToString)(f)),n({port:"port"in f?f.port:1}),i.removeListener("error",c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&&s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=>(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=>this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=>u.error===void 0).length,port:i.port,errors:c.filter(u=>u.error).map(u=>u.error)}}}else{let i=await Promise.all(s.map(n=>this.bindOneAddress(n,a)));return{count:i.filter(n=>n.error===void 0).length,port:i[0].port,errors:i.filter(n=>n.error).map(n=>n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count>0)return i.count<s.length&&Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(",")}]`)}}resolvePort(s){return new Promise((a,i)=>{let n={onSuccessfulResolution:(c,u,f)=>{n.onSuccessfulResolution=()=>{};let _=[].concat(...c.map(m=>m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=>{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port "${s}"`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port "${s}"`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof s!="string")throw new TypeError("port must be a string");if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof i!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+s);let n=this.normalizePort(s),l=(_,m)=>{process.nextTick(()=>i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=>i(null,_),_=>i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=>{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=>{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=>{c.completionPromise=null,c.portNumber=_,i(null,_)},_=>{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=>{n.emit("connection",c)},drain:c=>{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=>{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=>{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace("Closing server with address "+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=>{i&&i.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace("Closing session initiated by "+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=>{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace("unbind port="+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error("Cannot unbind port 0");let n=this.boundPorts.get((0,Pr.uriToString)(a));n&&(this.trace("unbinding "+n.mapKey+" originally bound as "+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace("drain port="+s+" graceTimeMs="+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=>{f.delete(O)})}(n=(i=setTimeout(()=>{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=>{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=>!s.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(s){var a;let i=c=>{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&&i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace("Waiting for server "+f+" to close"),this.closeServer(c,()=>{this.trace("Server "+f+" finished closing"),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace("Waiting for session "+m+" to close"),this.closeSession(_,()=>{this.trace("Session "+m+" finished closing"),l()})}}n===0&&i()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!="string"||!i.startsWith("application/grpc")?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj("Received call to method "+s+" at address "+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj("No handler registered for method "+s+". Sending UNIMPLEMENTED status."),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({"grpc-status":(n=s.code)!==null&&n!==void 0?n:qe.Status.INTERNAL,"grpc-message":s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=>{n&&(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{n&&(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=>{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=>{n&&(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i==="unary")fEe(s,a);else if(i==="clientStream")pEe(s,a);else if(i==="serverStream")dEe(s,a);else if(i==="bidi")hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n="null";i&&(typeof i=="string"?n=i:n=i.address+":"+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on("stream",l.bind(this,a)),s.on("session",c)}_sessionHandler(s){return a=>{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=>{var F,N;f=!0,this.trace("Connection dropped by max connection age: "+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(c=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=>{u&&(clearTimeout(u),u=null)},O=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,y,A=()=>{var I;O()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=>{var I;if(!O())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let M="";try{a.ping((N,z,B)=>{m(),N?(this.keepaliveTrace("Ping failed with error: "+N.message),f=!0,a.close()):(this.keepaliveTrace("Received ping response"),A())})||(M="Ping returned false")}catch(F){M=(F instanceof Error?F.message:"")||"Unknown error"}if(M){this.keepaliveTrace("Ping send failed: "+M),this.trace("Connection dropped due to ping send error: "+M),f=!0,a.close();return}u=setTimeout(()=>{m(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on("close",()=>{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&&clearTimeout(l),c&&clearTimeout(c),m(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=>{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&&n!==void 0?n:"unknown",this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+_),this.trace("Connection established by client "+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=>{var te;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(O=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=>{y&&(clearTimeout(y),y=null)},F=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,N,z=()=>{var B;F()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),y=setTimeout(()=>{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=>{var B;if(!F())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let G="";try{a.ping(($,le,v)=>{M(),$?(this.keepaliveTrace("Ping failed with error: "+$.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+$.message+" return in "+le),A=!0,a.close()):(this.keepaliveTrace("Received ping response"),z())})||(G="Ping returned false")}catch(te){G=(te instanceof Error?te.message:"")||"Unknown error"}if(G){this.keepaliveTrace("Ping send failed: "+G),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=>{M(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on("close",()=>{var B;A||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&&clearTimeout(m),O&&clearTimeout(O),M(),I!==null&&(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout>=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace("Enable idle timeout for "+l.remoteAddress+":"+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&&n.activeStreams===0&&(Date.now()-n.lastIdle>=s.sessionIdleTimeout?(s.trace("Session idle timeout triggered for "+(i==null?void 0:i.remoteAddress)+":"+(i==null?void 0:i.remotePort)+" last idle at "+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&&(i.activeStreams+=1,s.once("close",i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&&(n.activeStreams-=1,n.activeStreams===0&&(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace("Session onStreamClose"+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+":"+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+" at "+n.lastIdle)))}},(()=>{let o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[lEe("Calling start() is no longer necessary. It can be safely omitted.")],nEe(r,null,t,{kind:"method",name:"start",static:!1,private:!1,access:{has:s=>"start"in s,get:s=>s.start},metadata:o},null,e),o&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}});var e4=T(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}});var cE=T(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V("net"),yEe="pick_first";function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au="pick_first",OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t>1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&&(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&&(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n<Math.max(a.length,i.length);n++)n<a.length&&e.push(a[n]),n<i.length&&e.push(i[n]);return e}var o4="grpc-node.internal.pick-first.report_health_status",lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=>{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&&a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&&this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&&(n.hasReportedTransientFailure=!0,s&&(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t>=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&&(su("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+" -> "+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su("connectToAddressList(["+e.map(s=>(0,t4.subchannelAddressToString)(s))+"])");let o=e.map(s=>({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&&(e=i4(e));let s=[].concat(...e.map(i=>i.addresses));su("updateAddressList(["+s.map(i=>(0,t4.subchannelAddressToString)(i))+"])"),s.length===0&&(this.lastError="No addresses resolved");let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=>{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V("fs"),PEe=Pe(),IEe=ue(),bEe=V("util"),LEe="certificate_provider";function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");uE("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=>{if(this.refreshTimer){uE("File watcher read certificates certificate "+e.status+", privateKey "+t.status+", CA certificate "+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&t.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status==="fulfilled"?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),uE("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,"trace",{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,"log",{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,"registerResolver",{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,"createResolver",{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,"uriToString",{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,"splitHostPort",{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,"durationToMs",{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,"parseDuration",{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,"BackoffTimeout",{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,"createChildChannelControlHelper",{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,"registerLoadBalancerType",{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,"selectLbConfigFromList",{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,"LeafLoadBalancer",{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,"subchannelAddressToString",{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,"endpointToString",{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,"endpointHasAddress",{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,"EndpointMap",{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,"UnavailablePicker",{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,"QueuePicker",{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,"PickResultType",{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,"BaseFilter",{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,"FilterStackFactory",{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,"registerAdminService",{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===""?s="/"+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function qEe(){(0,HEe.registerResolver)("unix",OA)}});var m4=T(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.setup=KEe;var d4=V("net"),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe="ip_resolver";function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA="ipv4",CA="ipv6",zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4("Resolver constructed for target "+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(",");for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&&!(0,d4.isIPv4)(l.host)||e.scheme===CA&&!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&&s!==void 0?s:zEe})}this.endpoints=a.map(n=>({addresses:[n]})),E4("Parsed "+e.scheme+" address list "+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe="round_robin";function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E="round_robin",bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=>{this.currentState===yt.ConnectivityState.READY&&t!==yt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),s&&(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)>0){let e=this.children.filter(o=>o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=>(0,T4.endpointEqual)(s.getEndpoint(),o)),t<0&&(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=>({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)>0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+" -> "+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4("Connect to endpoint list "+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=>new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=>{"use strict";var xA;Object.defineProperty(No,"__esModule",{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome="outlier_detection";function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA="outlier_detection",sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&xA!==void 0?xA:"true")==="true",ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&&r[e]!==void 0&&typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&&r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds>=0&&r[e].seconds<=315576e6&&r[e].nanos>=0&&r[e].nanos<=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,"number",t),e in r&&r[e]!==void 0&&!(r[e]>=0&&r[e]<=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&&t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,"interval"),wA(e,"base_ejection_time"),wA(e,"max_ejection_time"),mE(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Ia(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),mE(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Ia(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Ia(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");mE(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),mE(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&&t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&&(a=i=>{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=>{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&&i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=>{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it("Running success rate check");let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it("Stats for "+(0,MA.endpointToString)(f)+": successes="+m+" failures="+O+" targetRequestVolume="+o),m+O>=o&&(s+=1,a.push(m/(m+O)))}if(it("Found "+s+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+a+"]"),s<t.minimum_hosts)return;let i=a.reduce((f,_)=>f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it("stdev="+c+" ejectionThreshold="+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O<o)continue;let y=m/(m+O);if(it("Checking candidate "+f+" successRate="+y),y<u){let A=Math.random()*100;it("Candidate "+f+" randomNumber="+A+" enforcement_percentage="+t.enforcement_percentage),A<t.enforcement_percentage&&(it("Ejecting candidate "+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i>=t.request_volume&&(o+=1)}if(!(o<t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it("Candidate successes="+i+" failures="+n),i+n<t.request_volume)continue;if(n*100/(n+i)>t.threshold){let c=Math.random()*100;it("Candidate "+s+" randomNumber="+c+" enforcement_percentage="+t.enforcement_percentage),c<t.enforcement_percentage&&(it("Ejecting candidate "+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier>0&&(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i<new Date&&(it("Unejecting "+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it("Received update with config: "+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it("Adding map entry for "+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&&(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,"CallCredentials",{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,"Channel",{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,"compressionAlgorithms",{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,"connectivityState",{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,"ChannelCredentials",{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,"Client",{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,"logVerbosity",{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,"status",{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,"propagate",{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,"loadPackageDefinition",{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,"makeClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,"makeGenericClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,"Metadata",{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,"Server",{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,"ServerCredentials",{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,"StatusBuilder",{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),combineCallCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=>r.close();w.closeClient=mme;var Tme=(r,e,t)=>r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.loadObject=Sme;var gme=(r,e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.load=gme;var vme=r=>{N4.setLogger(r)};w.setLogger=vme;var yme=r=>{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=>R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,"ListenerBuilder",{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,"RequesterBuilder",{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,"InterceptingCall",{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,"InterceptorConfigurationError",{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,"getChannelzHandlers",{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,"addAdminServicesToServer",{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,"ServerListenerBuilder",{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,"ResponderBuilder",{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,"ServerInterceptingCall",{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=>o,requestDeserialize:o=>o,responseSerialize:o=>o,responseDeserialize:o=>o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r==="gzip"?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:"failure",error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:"failure",error:i})}}return new Promise(s=>{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error("metadata was null"),status:"failure"});this._client.export(o,this._metadata,{deadline:a},(i,n)=>{s(i?{status:"failure",error:i}:{data:n,status:"success"})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.VERSION=void 0;AE.VERSION="0.56.0"});var w4=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V("url"),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol==="unix:"?r:(o.pathname&&o.pathname!=="/"&&b4.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),o.protocol!==""&&!(!((e=o.protocol)===null||e===void 0)&&e.match(/^(http)s?:$/))&&b4.diag.warn("URL protocol should be http(s)://. Using http://."),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length<1&&r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=>{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&&u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&&_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&&a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&&n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=>{let r=(0,hu.createEmptyMetadata)();return r.set("User-Agent",`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:"http://localhost:4317",credentials:r=>r.startsWith("http://")?()=>(0,hu.createInsecureCredentials)():()=>(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=>{P();qA=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var NE,U4=p(()=>{NE="baggage"});function PE(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function IE(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Eu(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Eu(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var jA=p(()=>{P()});var bE,V4=p(()=>{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=>n.length<=4096).slice(0,180),i=PE(a);i.length>0&&o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=Eu(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=>{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r=="string"&&r.length>0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var q4=p(()=>{P()});function xE(){return r=>{S.error(Xme(r))}}function Xme(r){return typeof r=="string"?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=>{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=>{KA();j4=xE()});var La,XA=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(La||(La={}))});function Zme(r){return Qme.indexOf(r)>-1}function tTe(r){return eTe.indexOf(r)>-1}function nTe(r){return rTe.indexOf(r)>-1}function iTe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o=="string"){let s=aTe[o.toUpperCase()];s!=null&&(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case"OTEL_LOG_LEVEL":lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=>{P();XA();Jme=",",Qme=["OTEL_SDK_DISABLED"];eTe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rTe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=>{QA()});var UE,K4=p(()=>{UE=typeof globalThis=="object"?globalThis:global});function $4(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var ZA=p(()=>{});function BE(r){return Buffer.from(kE(r)).toString("base64")}var X4=p(()=>{ZA()});function W4(r){return function(){for(let t=0;t<r/4;t++)VE.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(VE[t]>0);t++)t===r-1&&(VE[r-1]=1);return VE.toString("hex",0,r)}}var xa,VE,J4=p(()=>{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from"perf_hooks";var di,Q4=p(()=>{di=cTe});var FE,eR=p(()=>{FE="1.29.0"});var GE,Z4=p(()=>{eR();Ve();GE={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=>{});var t6=p(()=>{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=>{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!="number"){let e=di;r=e.timing&&e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r=="number"?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r=="number")return r<jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError("Invalid input type")}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function c6(r){return YE(r)||typeof r=="number"||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=qE&&(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=>{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(zE||(zE={}))});var KE,p6=p(()=>{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&&!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=>{iR="[_0-9a-z-*/]",pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=>{_6();E6=32,mTe=512,m6=",",T6="=",wa=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length>mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&&h6(n)&&t.set(i,n)}return t},new Map),this._internalState.size>E6&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=>{P();_u();oR();vu="traceparent",yu="tracestate",TTe="00",STe="(?!ff)[\\da-f]{2}",gTe="(?![0]{32})[\\da-f]{32}",vTe="(?![0]{16})[\\da-f]{16}",yTe="[\\da-f]{2}",OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&&o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new wa(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=>{P();aR=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(XE||(XE={}))});var Co,lR=p(()=>{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var hi,cR=p(()=>{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var WE,A6=p(()=>{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=>{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&N6.call(t)===PTe}function LTe(r){return r!=null&&typeof r=="object"}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&&Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&&(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=>{ATe="[object Object]",RTe="[object Null]",NTe="[object Undefined]",CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t>DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a<i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(QE(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&&Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r=="function"}function Ou(r){return!QE(r)&&!ZE(r)&&!w6(r)&&typeof r=="object"}function QE(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=>{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Au,k6=p(()=>{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e=="string"?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=>{});function F6(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var G6=p(()=>{});var em,H6=p(()=>{em=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=>{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=>{he.with(RE(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Y6=p(()=>{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=>Co,AlwaysOnSampler:()=>hi,AnchoredClock:()=>LE,BindOnceFuture:()=>tm,CompositePropagator:()=>KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>mu,DEFAULT_ENVIRONMENT:()=>Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>JA,ExportResultCode:()=>zE,ParentBasedSampler:()=>WE,RPCType:()=>XE,RandomIdGenerator:()=>xa,SDK_INFO:()=>GE,TRACE_PARENT_HEADER:()=>vu,TRACE_STATE_HEADER:()=>yu,TimeoutError:()=>Au,TraceIdRatioBasedSampler:()=>JE,TraceState:()=>wa,TracesSamplerValues:()=>La,VERSION:()=>FE,W3CBaggagePropagator:()=>bE,W3CTraceContextPropagator:()=>$E,_globalThis:()=>UE,addHrTimes:()=>nR,baggageUtils:()=>kTe,callWithTimeout:()=>U6,deleteRPCMetadata:()=>v6,getEnv:()=>wE,getEnvWithoutDefaults:()=>DE,getRPCMetadata:()=>y6,getTimeOrigin:()=>jE,globalErrorHandler:()=>ME,hexToBase64:()=>BE,hexToBinary:()=>kE,hrTime:()=>rR,hrTimeDuration:()=>i6,hrTimeToMicroseconds:()=>l6,hrTimeToMilliseconds:()=>a6,hrTimeToNanoseconds:()=>s6,hrTimeToTimeStamp:()=>o6,internal:()=>BTe,isAttributeKey:()=>YA,isAttributeValue:()=>zA,isTimeInput:()=>c6,isTimeInputHrTime:()=>YE,isTracingSuppressed:()=>ba,isUrlIgnored:()=>B6,isWrapped:()=>F6,loggingErrorHandler:()=>xE,merge:()=>x6,millisToHrTime:()=>Ma,otperformance:()=>di,parseEnvironment:()=>gu,parseTraceParent:()=>sR,sanitizeAttributes:()=>G4,setGlobalErrorHandler:()=>Y4,setRPCMetadata:()=>g6,suppressTracing:()=>RE,timeInputToHrTime:()=>n6,unrefTimer:()=>HE,unsuppressTracing:()=>D4,urlMatches:()=>pR});var kTe,BTe,K6=p(()=>{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V("fs"),GTe=V("path"),W6=(P(),ee(ot));function dR(r,e){if(r!=null&&r!=="")return r;if(e!=null&&e!=="")return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&&Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=>e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)==="true"}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&&t!=null;return o!=null&&!s?(W6.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=>e.startsWith("http://")?()=>(0,Ru.createInsecureCredentials)():e.startsWith("https://")?()=>J6(r):()=>$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&&WTe.diag.warn("Headers cannot be set when using grpc");let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=>{var o;return(o=r.metadata)!==null&&o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=>t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,"LOGS"),oSe.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}};om.OTLPLogExporter=ER});var iY=T(Io=>{"use strict";var aSe=Io&&Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),lSe=Io&&Io.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aSe(e,r,t)};Object.defineProperty(Io,"__esModule",{value:!0});lSe(nY(),Io)});var oY,sY=p(()=>{oY="0.56.0"});var Ua,aY=p(()=>{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${oY}`,"Content-Type":"application/x-protobuf"}),Ah))}}});var lY=p(()=>{aY()});var cY=p(()=>{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=>Ua});var fY=p(()=>{cY()});var pY,dY=p(()=>{pY="0.56.0"});var ka,hY=p(()=>{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${pY}`,"Content-Type":"application/x-protobuf"}),Rh))}}});var _Y=p(()=>{hY()});var EY=p(()=>{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=>ka});var TY=p(()=>{EY()});var SY,gY=p(()=>{SY="0.56.0"});var mR,vY=p(()=>{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${SY}`,"Content-Type":"application/json"}),Nh))}}});var yY=p(()=>{vY()});var OY=p(()=>{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=>mR});var RY=p(()=>{OY()});var CY=T(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,"TRACES"),cSe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};sm.OTLPTraceExporter=TR});var PY=T(bo=>{"use strict";var fSe=bo&&bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),pSe=bo&&bo.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fSe(e,r,t)};Object.defineProperty(bo,"__esModule",{value:!0});pSe(CY(),bo)});var am,IY=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(am||(am={}))});function _Se(r){return hSe.indexOf(r)>-1}function mSe(r){return ESe.indexOf(r)>-1}function SSe(r){return TSe.indexOf(r)>-1}function ySe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o=="string"){let s=RSe[o.toUpperCase()];s!=null&&(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case"OTEL_LOG_LEVEL":NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=>{P();IY();dSe=",",hSe=["OTEL_SDK_DISABLED"];ESe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];TSe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=>{LY()});var wY=p(()=>{xY()});var DY=p(()=>{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=>{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(sn||(sn={}))});var lm=p(()=>{UY();kY();DY()});import*as DSe from"http";import*as USe from"https";import*as BY from"url";function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:"POST",headers:Object.assign({"Content-Type":"application/json"},e)},t);return function(a,i){if(a.length===0)return S.debug("Zipkin send with empty spans"),i({code:sn.SUCCESS});let{request:n}=o.protocol==="http:"?DSe:USe,l=n(o,u=>{let f="";u.on("data",_=>{f+=_}),u.on("end",()=>{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_<400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on("error",u=>i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,"utf8"),l.end()}}var VY=p(()=>{P();lm()});var FY=p(()=>{VY()});var yR=p(()=>{FY()});var xo,GY=p(()=>{(function(r){r.CLIENT="CLIENT",r.SERVER="SERVER",r.CONSUMER="CONSUMER",r.PRODUCER="PRODUCER"})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&&(l[i]=String(jt[t.code])),t.code===jt.ERROR&&t.message&&(l[n]=t.message),o&&(l["otel.dropped_attributes_count"]=String(o)),s&&(l["otel.dropped_events_count"]=String(s)),a&&(l["otel.dropped_links_count"]=String(a)),Object.keys(e.attributes).forEach(c=>l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=>({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=>{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY="otel.status_code",qY="error"});function zY(r){return function(){return r()}}var KY=p(()=>{});var cm,$Y=p(()=>{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME="OpenTelemetry Service",this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders=="function"?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug("Zipkin exporter export"),this._isShutdown){setTimeout(()=>t({code:sn.FAILED,error:new Error("Exporter has been shutdown")}));return}let s=new Promise(i=>{this._sendSpans(e,o,n=>{i(),t(n)})});this._sendingPromises.push(s);let a=()=>{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug("Zipkin exporter shutdown"),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=>{Promise.all(this._sendingPromises).then(()=>{e()},t)})}_beforeSend(){this._getHeaders&&(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=>jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=>{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=>cm,prepareSend:()=>Lo});var WY=p(()=>{yR();$Y()});var ez=T(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe="env",YSe="host",zSe="os",KSe="process",$Se="serviceinstance";function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(","))!==null&&e!==void 0?e:["all"];return o.includes("all")?[...t.values()].flat():o.includes("none")?[]:o.flatMap(s=>{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector "${s}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=>e.trim()).filter(e=>e!=="null"&&e!=="")}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&&e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case"grpc":return new HSe.OTLPTraceExporter;case"http/json":return new GSe.OTLPTraceExporter;case"http/protobuf":return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V("@opentelemetry/exporter-jaeger");return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([["otlp",()=>WSe()],["zipkin",()=>new qSe.ZipkinExporter],["console",()=>new um.ConsoleSpanExporter],["jaeger",()=>JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(","))));if(s[0]==="none")return Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.'),[];s.length===0?(Mo.diag.warn("OTEL_TRACES_EXPORTER is empty. Using default otlp exporter."),s=["otlp"]):s.length>1&&s.includes("none")&&(Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.'),s=["otlp"]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&&Mo.diag.warn("Unable to set up trace exporter(s) due to invalid exporter and/or protocol values."),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&&(this._disabled=!0),u.OTEL_LOG_LEVEL&&ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&&t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&&o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&&s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&&(f.sampler=e.sampler),e.spanLimits&&(f.spanLimits=e.spanLimits),e.idGenerator&&(f.idGenerator=e.idGenerator),e.spanProcessor&&ln.diag.warn("The 'spanProcessor' option is deprecated. Please use 'spanProcessors' instead.");let _=(a=e.spanProcessor)!==null&&a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&&i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn("The 'logRecordProcessor' option is deprecated. Please use 'logRecordProcessors' instead.")):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&&(f.reader=e.metricReader),e.views&&(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&&l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length>0&&this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&&t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&&l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&&i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=>{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&&e!==void 0?e:"",o=(0,AR.filterBlanksAndNulls)(t.split(","));if(o.length===0&&(ln.diag.info("OTEL_LOGS_EXPORTER is empty. Using default otlp exporter."),o.push("otlp")),o.includes("none")){ln.diag.info('OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.');return}let s=[];o.forEach(a=>{var i,n;if(a==="otlp"){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&&i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case"grpc":s.push(new rge.OTLPLogExporter);break;case"http/json":s.push(new tge.OTLPLogExporter);break;case"http/protobuf":s.push(new OR.OTLPLogExporter);break;case void 0:case"":s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: "${l}". Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a==="console"?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: "${a}". Supported values are: otlp, console, none.`)}),s.length>0&&(this._loggerProviderConfig={logRecordProcessors:s.map(a=>a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,"NodeSDK",{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from"process";P();var vi=typeof globalThis=="object"?globalThis:global;function LN(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var xN="1.30.1";Ve();var yi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt<"u"?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=>sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=>{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=>{throw TypeError(r)},Jm=(r,e,t)=>e.has(r)||uM("Cannot "+t),el=(r,e,t)=>(Jm(r,e,"read from private field"),t?t.call(r):e.get(r)),Wu=(r,e,t)=>e.has(r)?uM("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=>(Jm(r,e,"write to private field"),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=>(Jm(r,e,"access private method"),t),fZ="__nfOTLPTrace",tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:"netlify-span-exporter"}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error("Exporter has been shutdown")});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug("Shutting down"),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&&!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&&o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)=="function"?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName="@netlify/otel/instrumentation-fetch",this.instrumentationVersion="1.0.0",this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,"http.request.method":e.method,"url.full":o.href,"url.host":o.host,"url.scheme":o.protocol.slice(0,-1),"server.address":o.hostname,"server.port":o.port,...this.prepareHeaders("request",e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,"http.response.status_code":e.status,...this.prepareHeaders("response",e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=["*","/.*/"],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=>t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=>typeof f=="string"?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=>typeof f=="string"?f==l:f.test(l))?i[u]="REDACTED":i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=>{var a;let o=typeof e=="string"?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&&a.some(i=>typeof i=="string"?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan("fetch",async i=>{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&&(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&&S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({"service.name":SERVICE_NAME??"lambda-function","service.version":SERVICE_VERSION,"process.runtime.name":"nodejs","process.runtime.version":lge.slice(1),"deployment.environment":(iz=bu.URL)!=null&&iz.includes("netlifystg.com")?"staging":"production","http.url":bu.URL,"netlify.site.id":bu.SITE_ID,"netlify.site.name":bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */
๐Ÿ“„ lightx-proxy.js
module.exports = require('./netlify/functions/lightx-proxy.js')
๐Ÿ“ netlify
๐Ÿ“ functions
๐Ÿ“„ lightx-proxy.js
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // node_modules/data-uri-to-buffer/dist/index.js function dataUriToBuffer(uri) { if (!/^data:/i.test(uri)) { throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")'); } uri = uri.replace(/\r?\n/g, ""); const firstComma = uri.indexOf(","); if (firstComma === -1 || firstComma <= 4) { throw new TypeError("malformed data: URI"); } const meta = uri.substring(5, firstComma).split(";"); let charset = ""; let base64 = false; const type = meta[0] || "text/plain"; let typeFull = type; for (let i2 = 1; i2 < meta.length; i2++) { if (meta[i2] === "base64") { base64 = true; } else if (meta[i2]) { typeFull += `;${meta[i2]}`; if (meta[i2].indexOf("charset=") === 0) { charset = meta[i2].substring(8); } } } if (!meta[0] && !charset.length) { typeFull += ";charset=US-ASCII"; charset = "US-ASCII"; } const encoding = base64 ? "base64" : "ascii"; const data = unescape(uri.substring(firstComma + 1)); const buffer = Buffer.from(data, encoding); buffer.type = type; buffer.typeFull = typeFull; buffer.charset = charset; return buffer; } var dist_default; var init_dist = __esm({ "node_modules/data-uri-to-buffer/dist/index.js"() { dist_default = dataUriToBuffer; } }); // node_modules/web-streams-polyfill/dist/ponyfill.es2018.js var require_ponyfill_es2018 = __commonJS({ "node_modules/web-streams-polyfill/dist/ponyfill.es2018.js"(exports2, module2) { (function(global2, factory) { typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {})); })(exports2, (function(exports3) { "use strict"; function noop2() { return void 0; } function typeIsObject(x2) { return typeof x2 === "object" && x2 !== null || typeof x2 === "function"; } const rethrowAssertionErrorRejection = noop2; function setFunctionName(fn, name) { try { Object.defineProperty(fn, "name", { value: name, configurable: true }); } catch (_a2) { } } const originalPromise = Promise; const originalPromiseThen = Promise.prototype.then; const originalPromiseReject = Promise.reject.bind(originalPromise); function newPromise(executor) { return new originalPromise(executor); } function promiseResolvedWith(value) { return newPromise((resolve) => resolve(value)); } function promiseRejectedWith(reason) { return originalPromiseReject(reason); } function PerformPromiseThen(promise, onFulfilled, onRejected) { return originalPromiseThen.call(promise, onFulfilled, onRejected); } function uponPromise(promise, onFulfilled, onRejected) { PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), void 0, rethrowAssertionErrorRejection); } function uponFulfillment(promise, onFulfilled) { uponPromise(promise, onFulfilled); } function uponRejection(promise, onRejected) { uponPromise(promise, void 0, onRejected); } function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) { return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler); } function setPromiseIsHandledToTrue(promise) { PerformPromiseThen(promise, void 0, rethrowAssertionErrorRejection); } let _queueMicrotask = (callback) => { if (typeof queueMicrotask === "function") { _queueMicrotask = queueMicrotask; } else { const resolvedPromise = promiseResolvedWith(void 0); _queueMicrotask = (cb) => PerformPromiseThen(resolvedPromise, cb); } return _queueMicrotask(callback); }; function reflectCall(F2, V, args) { if (typeof F2 !== "function") { throw new TypeError("Argument is not a function"); } return Function.prototype.apply.call(F2, V, args); } function promiseCall(F2, V, args) { try { return promiseResolvedWith(reflectCall(F2, V, args)); } catch (value) { return promiseRejectedWith(value); } } const QUEUE_MAX_ARRAY_SIZE = 16384; class SimpleQueue { constructor() { this._cursor = 0; this._size = 0; this._front = { _elements: [], _next: void 0 }; this._back = this._front; this._cursor = 0; this._size = 0; } get length() { return this._size; } // For exception safety, this method is structured in order: // 1. Read state // 2. Calculate required state mutations // 3. Perform state mutations push(element) { const oldBack = this._back; let newBack = oldBack; if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) { newBack = { _elements: [], _next: void 0 }; } oldBack._elements.push(element); if (newBack !== oldBack) { this._back = newBack; oldBack._next = newBack; } ++this._size; } // Like push(), shift() follows the read -> calculate -> mutate pattern for // exception safety. shift() { const oldFront = this._front; let newFront = oldFront; const oldCursor = this._cursor; let newCursor = oldCursor + 1; const elements = oldFront._elements; const element = elements[oldCursor]; if (newCursor === QUEUE_MAX_ARRAY_SIZE) { newFront = oldFront._next; newCursor = 0; } --this._size; this._cursor = newCursor; if (oldFront !== newFront) { this._front = newFront; } elements[oldCursor] = void 0; return element; } // The tricky thing about forEach() is that it can be called // re-entrantly. The queue may be mutated inside the callback. It is easy to // see that push() within the callback has no negative effects since the end // of the queue is checked for on every iteration. If shift() is called // repeatedly within the callback then the next iteration may return an // element that has been removed. In this case the callback will be called // with undefined values until we either "catch up" with elements that still // exist or reach the back of the queue. forEach(callback) { let i2 = this._cursor; let node = this._front; let elements = node._elements; while (i2 !== elements.length || node._next !== void 0) { if (i2 === elements.length) { node = node._next; elements = node._elements; i2 = 0; if (elements.length === 0) { break; } } callback(elements[i2]); ++i2; } } // Return the element that would be returned if shift() was called now, // without modifying the queue. peek() { const front = this._front; const cursor = this._cursor; return front._elements[cursor]; } } const AbortSteps = Symbol("[[AbortSteps]]"); const ErrorSteps = Symbol("[[ErrorSteps]]"); const CancelSteps = Symbol("[[CancelSteps]]"); const PullSteps = Symbol("[[PullSteps]]"); const ReleaseSteps = Symbol("[[ReleaseSteps]]"); function ReadableStreamReaderGenericInitialize(reader, stream) { reader._ownerReadableStream = stream; stream._reader = reader; if (stream._state === "readable") { defaultReaderClosedPromiseInitialize(reader); } else if (stream._state === "closed") { defaultReaderClosedPromiseInitializeAsResolved(reader); } else { defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); } } function ReadableStreamReaderGenericCancel(reader, reason) { const stream = reader._ownerReadableStream; return ReadableStreamCancel(stream, reason); } function ReadableStreamReaderGenericRelease(reader) { const stream = reader._ownerReadableStream; if (stream._state === "readable") { defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)); } else { defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)); } stream._readableStreamController[ReleaseSteps](); stream._reader = void 0; reader._ownerReadableStream = void 0; } function readerLockException(name) { return new TypeError("Cannot " + name + " a stream using a released reader"); } function defaultReaderClosedPromiseInitialize(reader) { reader._closedPromise = newPromise((resolve, reject) => { reader._closedPromise_resolve = resolve; reader._closedPromise_reject = reject; }); } function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseReject(reader, reason); } function defaultReaderClosedPromiseInitializeAsResolved(reader) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseResolve(reader); } function defaultReaderClosedPromiseReject(reader, reason) { if (reader._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(reader._closedPromise); reader._closedPromise_reject(reason); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } function defaultReaderClosedPromiseResetToRejected(reader, reason) { defaultReaderClosedPromiseInitializeAsRejected(reader, reason); } function defaultReaderClosedPromiseResolve(reader) { if (reader._closedPromise_resolve === void 0) { return; } reader._closedPromise_resolve(void 0); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } const NumberIsFinite = Number.isFinite || function(x2) { return typeof x2 === "number" && isFinite(x2); }; const MathTrunc = Math.trunc || function(v) { return v < 0 ? Math.ceil(v) : Math.floor(v); }; function isDictionary(x2) { return typeof x2 === "object" || typeof x2 === "function"; } function assertDictionary(obj, context) { if (obj !== void 0 && !isDictionary(obj)) { throw new TypeError(`${context} is not an object.`); } } function assertFunction(x2, context) { if (typeof x2 !== "function") { throw new TypeError(`${context} is not a function.`); } } function isObject(x2) { return typeof x2 === "object" && x2 !== null || typeof x2 === "function"; } function assertObject(x2, context) { if (!isObject(x2)) { throw new TypeError(`${context} is not an object.`); } } function assertRequiredArgument(x2, position, context) { if (x2 === void 0) { throw new TypeError(`Parameter ${position} is required in '${context}'.`); } } function assertRequiredField(x2, field, context) { if (x2 === void 0) { throw new TypeError(`${field} is required in '${context}'.`); } } function convertUnrestrictedDouble(value) { return Number(value); } function censorNegativeZero(x2) { return x2 === 0 ? 0 : x2; } function integerPart(x2) { return censorNegativeZero(MathTrunc(x2)); } function convertUnsignedLongLongWithEnforceRange(value, context) { const lowerBound = 0; const upperBound = Number.MAX_SAFE_INTEGER; let x2 = Number(value); x2 = censorNegativeZero(x2); if (!NumberIsFinite(x2)) { throw new TypeError(`${context} is not a finite number`); } x2 = integerPart(x2); if (x2 < lowerBound || x2 > upperBound) { throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`); } if (!NumberIsFinite(x2) || x2 === 0) { return 0; } return x2; } function assertReadableStream(x2, context) { if (!IsReadableStream(x2)) { throw new TypeError(`${context} is not a ReadableStream.`); } } function AcquireReadableStreamDefaultReader(stream) { return new ReadableStreamDefaultReader(stream); } function ReadableStreamAddReadRequest(stream, readRequest) { stream._reader._readRequests.push(readRequest); } function ReadableStreamFulfillReadRequest(stream, chunk, done) { const reader = stream._reader; const readRequest = reader._readRequests.shift(); if (done) { readRequest._closeSteps(); } else { readRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadRequests(stream) { return stream._reader._readRequests.length; } function ReadableStreamHasDefaultReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamDefaultReader(reader)) { return false; } return true; } class ReadableStreamDefaultReader { constructor(stream) { assertRequiredArgument(stream, 1, "ReadableStreamDefaultReader"); assertReadableStream(stream, "First parameter"); if (IsReadableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive reading by another reader"); } ReadableStreamReaderGenericInitialize(this, stream); this._readRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("closed")); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("cancel")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("cancel")); } return ReadableStreamReaderGenericCancel(this, reason); } /** * Returns a promise that allows access to the next chunk from the stream's internal queue, if available. * * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. */ read() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException("read")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("read from")); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) => resolvePromise({ value: chunk, done: false }), _closeSteps: () => resolvePromise({ value: void 0, done: true }), _errorSteps: (e2) => rejectPromise(e2) }; ReadableStreamDefaultReaderRead(this, readRequest); return promise; } /** * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamDefaultReader(this)) { throw defaultReaderBrandCheckException("releaseLock"); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamDefaultReaderRelease(this); } } Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamDefaultReader.prototype.cancel, "cancel"); setFunctionName(ReadableStreamDefaultReader.prototype.read, "read"); setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); } function IsReadableStreamDefaultReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readRequests")) { return false; } return x2 instanceof ReadableStreamDefaultReader; } function ReadableStreamDefaultReaderRead(reader, readRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === "closed") { readRequest._closeSteps(); } else if (stream._state === "errored") { readRequest._errorSteps(stream._storedError); } else { stream._readableStreamController[PullSteps](readRequest); } } function ReadableStreamDefaultReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError("Reader was released"); ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } function ReadableStreamDefaultReaderErrorReadRequests(reader, e2) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) => { readRequest._errorSteps(e2); }); } function defaultReaderBrandCheckException(name) { return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`); } const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { }).prototype); class ReadableStreamAsyncIteratorImpl { constructor(reader, preventCancel) { this._ongoingPromise = void 0; this._isFinished = false; this._reader = reader; this._preventCancel = preventCancel; } next() { const nextSteps = () => this._nextSteps(); this._ongoingPromise = this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) : nextSteps(); return this._ongoingPromise; } return(value) { const returnSteps = () => this._returnSteps(value); return this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) : returnSteps(); } _nextSteps() { if (this._isFinished) { return Promise.resolve({ value: void 0, done: true }); } const reader = this._reader; let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) => { this._ongoingPromise = void 0; _queueMicrotask(() => resolvePromise({ value: chunk, done: false })); }, _closeSteps: () => { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); resolvePromise({ value: void 0, done: true }); }, _errorSteps: (reason) => { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); rejectPromise(reason); } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promise; } _returnSteps(value) { if (this._isFinished) { return Promise.resolve({ value, done: true }); } this._isFinished = true; const reader = this._reader; if (!this._preventCancel) { const result = ReadableStreamReaderGenericCancel(reader, value); ReadableStreamReaderGenericRelease(reader); return transformPromiseWith(result, () => ({ value, done: true })); } ReadableStreamReaderGenericRelease(reader); return promiseResolvedWith({ value, done: true }); } } const ReadableStreamAsyncIteratorPrototype = { next() { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException("next")); } return this._asyncIteratorImpl.next(); }, return(value) { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException("return")); } return this._asyncIteratorImpl.return(value); } }; Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype); function AcquireReadableStreamAsyncIterator(stream, preventCancel) { const reader = AcquireReadableStreamDefaultReader(stream); const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel); const iterator = Object.create(ReadableStreamAsyncIteratorPrototype); iterator._asyncIteratorImpl = impl; return iterator; } function IsReadableStreamAsyncIterator(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_asyncIteratorImpl")) { return false; } try { return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl; } catch (_a2) { return false; } } function streamAsyncIteratorBrandCheckException(name) { return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`); } const NumberIsNaN = Number.isNaN || function(x2) { return x2 !== x2; }; var _a, _b, _c; function CreateArrayFromList(elements) { return elements.slice(); } function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) { new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); } let TransferArrayBuffer = (O) => { if (typeof O.transfer === "function") { TransferArrayBuffer = (buffer) => buffer.transfer(); } else if (typeof structuredClone === "function") { TransferArrayBuffer = (buffer) => structuredClone(buffer, { transfer: [buffer] }); } else { TransferArrayBuffer = (buffer) => buffer; } return TransferArrayBuffer(O); }; let IsDetachedBuffer = (O) => { if (typeof O.detached === "boolean") { IsDetachedBuffer = (buffer) => buffer.detached; } else { IsDetachedBuffer = (buffer) => buffer.byteLength === 0; } return IsDetachedBuffer(O); }; function ArrayBufferSlice(buffer, begin, end) { if (buffer.slice) { return buffer.slice(begin, end); } const length = end - begin; const slice = new ArrayBuffer(length); CopyDataBlockBytes(slice, 0, buffer, begin, length); return slice; } function GetMethod(receiver, prop) { const func = receiver[prop]; if (func === void 0 || func === null) { return void 0; } if (typeof func !== "function") { throw new TypeError(`${String(prop)} is not a function`); } return func; } function CreateAsyncFromSyncIterator(syncIteratorRecord) { const syncIterable = { [Symbol.iterator]: () => syncIteratorRecord.iterator }; const asyncIterator = (async function* () { return yield* syncIterable; })(); const nextMethod = asyncIterator.next; return { iterator: asyncIterator, nextMethod, done: false }; } const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null && _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, "Symbol.asyncIterator")) !== null && _c !== void 0 ? _c : "@@asyncIterator"; function GetIterator(obj, hint = "sync", method) { if (method === void 0) { if (hint === "async") { method = GetMethod(obj, SymbolAsyncIterator); if (method === void 0) { const syncMethod = GetMethod(obj, Symbol.iterator); const syncIteratorRecord = GetIterator(obj, "sync", syncMethod); return CreateAsyncFromSyncIterator(syncIteratorRecord); } } else { method = GetMethod(obj, Symbol.iterator); } } if (method === void 0) { throw new TypeError("The object is not iterable"); } const iterator = reflectCall(method, obj, []); if (!typeIsObject(iterator)) { throw new TypeError("The iterator method must return an object"); } const nextMethod = iterator.next; return { iterator, nextMethod, done: false }; } function IteratorNext(iteratorRecord) { const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []); if (!typeIsObject(result)) { throw new TypeError("The iterator.next() method must return an object"); } return result; } function IteratorComplete(iterResult) { return Boolean(iterResult.done); } function IteratorValue(iterResult) { return iterResult.value; } function IsNonNegativeNumber(v) { if (typeof v !== "number") { return false; } if (NumberIsNaN(v)) { return false; } if (v < 0) { return false; } return true; } function CloneAsUint8Array(O) { const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength); return new Uint8Array(buffer); } function DequeueValue(container) { const pair = container._queue.shift(); container._queueTotalSize -= pair.size; if (container._queueTotalSize < 0) { container._queueTotalSize = 0; } return pair.value; } function EnqueueValueWithSize(container, value, size) { if (!IsNonNegativeNumber(size) || size === Infinity) { throw new RangeError("Size must be a finite, non-NaN, non-negative number."); } container._queue.push({ value, size }); container._queueTotalSize += size; } function PeekQueueValue(container) { const pair = container._queue.peek(); return pair.value; } function ResetQueue(container) { container._queue = new SimpleQueue(); container._queueTotalSize = 0; } function isDataViewConstructor(ctor) { return ctor === DataView; } function isDataView(view) { return isDataViewConstructor(view.constructor); } function arrayBufferViewElementSize(ctor) { if (isDataViewConstructor(ctor)) { return 1; } return ctor.BYTES_PER_ELEMENT; } class ReadableStreamBYOBRequest { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the view for writing in to, or `null` if the BYOB request has already been responded to. */ get view() { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("view"); } return this._view; } respond(bytesWritten) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("respond"); } assertRequiredArgument(bytesWritten, 1, "respond"); bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, "First parameter"); if (this._associatedReadableByteStreamController === void 0) { throw new TypeError("This BYOB request has been invalidated"); } if (IsDetachedBuffer(this._view.buffer)) { throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`); } ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); } respondWithNewView(view) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException("respondWithNewView"); } assertRequiredArgument(view, 1, "respondWithNewView"); if (!ArrayBuffer.isView(view)) { throw new TypeError("You can only respond with array buffer views"); } if (this._associatedReadableByteStreamController === void 0) { throw new TypeError("This BYOB request has been invalidated"); } if (IsDetachedBuffer(view.buffer)) { throw new TypeError("The given view's buffer has been detached and so cannot be used as a response"); } ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); } } Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }); setFunctionName(ReadableStreamBYOBRequest.prototype.respond, "respond"); setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); } class ReadableByteStreamController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the current BYOB pull request, or `null` if there isn't one. */ get byobRequest() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("byobRequest"); } return ReadableByteStreamControllerGetBYOBRequest(this); } /** * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("desiredSize"); } return ReadableByteStreamControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("close"); } if (this._closeRequested) { throw new TypeError("The stream has already been closed; do not close it again!"); } const state = this._controlledReadableByteStream._state; if (state !== "readable") { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`); } ReadableByteStreamControllerClose(this); } enqueue(chunk) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("enqueue"); } assertRequiredArgument(chunk, 1, "enqueue"); if (!ArrayBuffer.isView(chunk)) { throw new TypeError("chunk must be an array buffer view"); } if (chunk.byteLength === 0) { throw new TypeError("chunk must have non-zero byteLength"); } if (chunk.buffer.byteLength === 0) { throw new TypeError(`chunk's buffer must have non-zero byteLength`); } if (this._closeRequested) { throw new TypeError("stream is closed or draining"); } const state = this._controlledReadableByteStream._state; if (state !== "readable") { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`); } ReadableByteStreamControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException("error"); } ReadableByteStreamControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ReadableByteStreamControllerClearPendingPullIntos(this); ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableByteStreamControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableByteStream; if (this._queueTotalSize > 0) { ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest); return; } const autoAllocateChunkSize = this._autoAllocateChunkSize; if (autoAllocateChunkSize !== void 0) { let buffer; try { buffer = new ArrayBuffer(autoAllocateChunkSize); } catch (bufferE) { readRequest._errorSteps(bufferE); return; } const pullIntoDescriptor = { buffer, bufferByteLength: autoAllocateChunkSize, byteOffset: 0, byteLength: autoAllocateChunkSize, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; this._pendingPullIntos.push(pullIntoDescriptor); } ReadableStreamAddReadRequest(stream, readRequest); ReadableByteStreamControllerCallPullIfNeeded(this); } /** @internal */ [ReleaseSteps]() { if (this._pendingPullIntos.length > 0) { const firstPullInto = this._pendingPullIntos.peek(); firstPullInto.readerType = "none"; this._pendingPullIntos = new SimpleQueue(); this._pendingPullIntos.push(firstPullInto); } } } Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableByteStreamController.prototype.close, "close"); setFunctionName(ReadableByteStreamController.prototype.enqueue, "enqueue"); setFunctionName(ReadableByteStreamController.prototype.error, "error"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true }); } function IsReadableByteStreamController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableByteStream")) { return false; } return x2 instanceof ReadableByteStreamController; } function IsReadableStreamBYOBRequest(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_associatedReadableByteStreamController")) { return false; } return x2 instanceof ReadableStreamBYOBRequest; } function ReadableByteStreamControllerCallPullIfNeeded(controller) { const shouldPull = ReadableByteStreamControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () => { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableByteStreamControllerCallPullIfNeeded(controller); } return null; }, (e2) => { ReadableByteStreamControllerError(controller, e2); return null; }); } function ReadableByteStreamControllerClearPendingPullIntos(controller) { ReadableByteStreamControllerInvalidateBYOBRequest(controller); controller._pendingPullIntos = new SimpleQueue(); } function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { let done = false; if (stream._state === "closed") { done = true; } const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); if (pullIntoDescriptor.readerType === "default") { ReadableStreamFulfillReadRequest(stream, filledView, done); } else { ReadableStreamFulfillReadIntoRequest(stream, filledView, done); } } function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { const bytesFilled = pullIntoDescriptor.bytesFilled; const elementSize = pullIntoDescriptor.elementSize; return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); } function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { controller._queue.push({ buffer, byteOffset, byteLength }); controller._queueTotalSize += byteLength; } function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) { let clonedChunk; try { clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength); } catch (cloneE) { ReadableByteStreamControllerError(controller, cloneE); throw cloneE; } ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength); } function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) { if (firstDescriptor.bytesFilled > 0) { ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled); } ReadableByteStreamControllerShiftPendingPullInto(controller); } function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; let totalBytesToCopyRemaining = maxBytesToCopy; let ready = false; const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize; const maxAlignedBytes = maxBytesFilled - remainderBytes; if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) { totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; ready = true; } const queue = controller._queue; while (totalBytesToCopyRemaining > 0) { const headOfQueue = queue.peek(); const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); if (headOfQueue.byteLength === bytesToCopy) { queue.shift(); } else { headOfQueue.byteOffset += bytesToCopy; headOfQueue.byteLength -= bytesToCopy; } controller._queueTotalSize -= bytesToCopy; ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); totalBytesToCopyRemaining -= bytesToCopy; } return ready; } function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { pullIntoDescriptor.bytesFilled += size; } function ReadableByteStreamControllerHandleQueueDrain(controller) { if (controller._queueTotalSize === 0 && controller._closeRequested) { ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(controller._controlledReadableByteStream); } else { ReadableByteStreamControllerCallPullIfNeeded(controller); } } function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { if (controller._byobRequest === null) { return; } controller._byobRequest._associatedReadableByteStreamController = void 0; controller._byobRequest._view = null; controller._byobRequest = null; } function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { while (controller._pendingPullIntos.length > 0) { if (controller._queueTotalSize === 0) { return; } const pullIntoDescriptor = controller._pendingPullIntos.peek(); if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); } } } function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) { const reader = controller._controlledReadableByteStream._reader; while (reader._readRequests.length > 0) { if (controller._queueTotalSize === 0) { return; } const readRequest = reader._readRequests.shift(); ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest); } } function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) { const stream = controller._controlledReadableByteStream; const ctor = view.constructor; const elementSize = arrayBufferViewElementSize(ctor); const { byteOffset, byteLength } = view; const minimumFill = min * elementSize; let buffer; try { buffer = TransferArrayBuffer(view.buffer); } catch (e2) { readIntoRequest._errorSteps(e2); return; } const pullIntoDescriptor = { buffer, bufferByteLength: buffer.byteLength, byteOffset, byteLength, bytesFilled: 0, minimumFill, elementSize, viewConstructor: ctor, readerType: "byob" }; if (controller._pendingPullIntos.length > 0) { controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); return; } if (stream._state === "closed") { const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); readIntoRequest._closeSteps(emptyView); return; } if (controller._queueTotalSize > 0) { if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); ReadableByteStreamControllerHandleQueueDrain(controller); readIntoRequest._chunkSteps(filledView); return; } if (controller._closeRequested) { const e2 = new TypeError("Insufficient bytes to fill elements in the given buffer"); ReadableByteStreamControllerError(controller, e2); readIntoRequest._errorSteps(e2); return; } } controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { if (firstDescriptor.readerType === "none") { ReadableByteStreamControllerShiftPendingPullInto(controller); } const stream = controller._controlledReadableByteStream; if (ReadableStreamHasBYOBReader(stream)) { while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); } } } function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); if (pullIntoDescriptor.readerType === "none") { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); return; } if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) { return; } ReadableByteStreamControllerShiftPendingPullInto(controller); const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; if (remainderSize > 0) { const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize); } pullIntoDescriptor.bytesFilled -= remainderSize; ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); ReadableByteStreamControllerInvalidateBYOBRequest(controller); const state = controller._controlledReadableByteStream._state; if (state === "closed") { ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); } else { ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerShiftPendingPullInto(controller) { const descriptor = controller._pendingPullIntos.shift(); return descriptor; } function ReadableByteStreamControllerShouldCallPull(controller) { const stream = controller._controlledReadableByteStream; if (stream._state !== "readable") { return false; } if (controller._closeRequested) { return false; } if (!controller._started) { return false; } if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { return true; } if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) { return true; } const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller); if (desiredSize > 0) { return true; } return false; } function ReadableByteStreamControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function ReadableByteStreamControllerClose(controller) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== "readable") { return; } if (controller._queueTotalSize > 0) { controller._closeRequested = true; return; } if (controller._pendingPullIntos.length > 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) { const e2 = new TypeError("Insufficient bytes to fill elements in the given buffer"); ReadableByteStreamControllerError(controller, e2); throw e2; } } ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(stream); } function ReadableByteStreamControllerEnqueue(controller, chunk) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== "readable") { return; } const { buffer, byteOffset, byteLength } = chunk; if (IsDetachedBuffer(buffer)) { throw new TypeError("chunk's buffer is detached and so cannot be enqueued"); } const transferredBuffer = TransferArrayBuffer(buffer); if (controller._pendingPullIntos.length > 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (IsDetachedBuffer(firstPendingPullInto.buffer)) { throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk"); } ReadableByteStreamControllerInvalidateBYOBRequest(controller); firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer); if (firstPendingPullInto.readerType === "none") { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto); } } if (ReadableStreamHasDefaultReader(stream)) { ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller); if (ReadableStreamGetNumReadRequests(stream) === 0) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } else { if (controller._pendingPullIntos.length > 0) { ReadableByteStreamControllerShiftPendingPullInto(controller); } const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); ReadableStreamFulfillReadRequest(stream, transferredView, false); } } else if (ReadableStreamHasBYOBReader(stream)) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } else { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerError(controller, e2) { const stream = controller._controlledReadableByteStream; if (stream._state !== "readable") { return; } ReadableByteStreamControllerClearPendingPullIntos(controller); ResetQueue(controller); ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) { const entry = controller._queue.shift(); controller._queueTotalSize -= entry.byteLength; ReadableByteStreamControllerHandleQueueDrain(controller); const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); readRequest._chunkSteps(view); } function ReadableByteStreamControllerGetBYOBRequest(controller) { if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) { const firstDescriptor = controller._pendingPullIntos.peek(); const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype); SetUpReadableStreamBYOBRequest(byobRequest, controller, view); controller._byobRequest = byobRequest; } return controller._byobRequest; } function ReadableByteStreamControllerGetDesiredSize(controller) { const state = controller._controlledReadableByteStream._state; if (state === "errored") { return null; } if (state === "closed") { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableByteStreamControllerRespond(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === "closed") { if (bytesWritten !== 0) { throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream"); } } else { if (bytesWritten === 0) { throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream"); } if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) { throw new RangeError("bytesWritten out of range"); } } firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); ReadableByteStreamControllerRespondInternal(controller, bytesWritten); } function ReadableByteStreamControllerRespondWithNewView(controller, view) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === "closed") { if (view.byteLength !== 0) { throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream"); } } else { if (view.byteLength === 0) { throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream"); } } if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { throw new RangeError("The region specified by view does not match byobRequest"); } if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) { throw new RangeError("The buffer of view has different capacity than byobRequest"); } if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) { throw new RangeError("The region specified by view is larger than byobRequest"); } const viewByteLength = view.byteLength; firstDescriptor.buffer = TransferArrayBuffer(view.buffer); ReadableByteStreamControllerRespondInternal(controller, viewByteLength); } function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) { controller._controlledReadableByteStream = stream; controller._pullAgain = false; controller._pulling = false; controller._byobRequest = null; controller._queue = controller._queueTotalSize = void 0; ResetQueue(controller); controller._closeRequested = false; controller._started = false; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._autoAllocateChunkSize = autoAllocateChunkSize; controller._pendingPullIntos = new SimpleQueue(); stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () => { controller._started = true; ReadableByteStreamControllerCallPullIfNeeded(controller); return null; }, (r2) => { ReadableByteStreamControllerError(controller, r2); return null; }); } function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) { const controller = Object.create(ReadableByteStreamController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingByteSource.start !== void 0) { startAlgorithm = () => underlyingByteSource.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingByteSource.pull !== void 0) { pullAlgorithm = () => underlyingByteSource.pull(controller); } else { pullAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingByteSource.cancel !== void 0) { cancelAlgorithm = (reason) => underlyingByteSource.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; if (autoAllocateChunkSize === 0) { throw new TypeError("autoAllocateChunkSize must be greater than 0"); } SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize); } function SetUpReadableStreamBYOBRequest(request, controller, view) { request._associatedReadableByteStreamController = controller; request._view = view; } function byobRequestBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`); } function byteStreamControllerBrandCheckException(name) { return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`); } function convertReaderOptions(options, context) { assertDictionary(options, context); const mode = options === null || options === void 0 ? void 0 : options.mode; return { mode: mode === void 0 ? void 0 : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`) }; } function convertReadableStreamReaderMode(mode, context) { mode = `${mode}`; if (mode !== "byob") { throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`); } return mode; } function convertByobReadOptions(options, context) { var _a2; assertDictionary(options, context); const min = (_a2 = options === null || options === void 0 ? void 0 : options.min) !== null && _a2 !== void 0 ? _a2 : 1; return { min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`) }; } function AcquireReadableStreamBYOBReader(stream) { return new ReadableStreamBYOBReader(stream); } function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) { stream._reader._readIntoRequests.push(readIntoRequest); } function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { const reader = stream._reader; const readIntoRequest = reader._readIntoRequests.shift(); if (done) { readIntoRequest._closeSteps(chunk); } else { readIntoRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadIntoRequests(stream) { return stream._reader._readIntoRequests.length; } function ReadableStreamHasBYOBReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamBYOBReader(reader)) { return false; } return true; } class ReadableStreamBYOBReader { constructor(stream) { assertRequiredArgument(stream, 1, "ReadableStreamBYOBReader"); assertReadableStream(stream, "First parameter"); if (IsReadableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive reading by another reader"); } if (!IsReadableByteStreamController(stream._readableStreamController)) { throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source"); } ReadableStreamReaderGenericInitialize(this, stream); this._readIntoRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the reader's lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("closed")); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("cancel")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("cancel")); } return ReadableStreamReaderGenericCancel(this, reason); } read(view, rawOptions = {}) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException("read")); } if (!ArrayBuffer.isView(view)) { return promiseRejectedWith(new TypeError("view must be an array buffer view")); } if (view.byteLength === 0) { return promiseRejectedWith(new TypeError("view must have non-zero byteLength")); } if (view.buffer.byteLength === 0) { return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`)); } if (IsDetachedBuffer(view.buffer)) { return promiseRejectedWith(new TypeError("view's buffer has been detached")); } let options; try { options = convertByobReadOptions(rawOptions, "options"); } catch (e2) { return promiseRejectedWith(e2); } const min = options.min; if (min === 0) { return promiseRejectedWith(new TypeError("options.min must be greater than 0")); } if (!isDataView(view)) { if (min > view.length) { return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's length")); } } else if (min > view.byteLength) { return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's byteLength")); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException("read from")); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); const readIntoRequest = { _chunkSteps: (chunk) => resolvePromise({ value: chunk, done: false }), _closeSteps: (chunk) => resolvePromise({ value: chunk, done: true }), _errorSteps: (e2) => rejectPromise(e2) }; ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest); return promise; } /** * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamBYOBReader(this)) { throw byobReaderBrandCheckException("releaseLock"); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamBYOBReaderRelease(this); } } Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamBYOBReader.prototype.cancel, "cancel"); setFunctionName(ReadableStreamBYOBReader.prototype.read, "read"); setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); } function IsReadableStreamBYOBReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readIntoRequests")) { return false; } return x2 instanceof ReadableStreamBYOBReader; } function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === "errored") { readIntoRequest._errorSteps(stream._storedError); } else { ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest); } } function ReadableStreamBYOBReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError("Reader was released"); ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) => { readIntoRequest._errorSteps(e2); }); } function byobReaderBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`); } function ExtractHighWaterMark(strategy, defaultHWM) { const { highWaterMark } = strategy; if (highWaterMark === void 0) { return defaultHWM; } if (NumberIsNaN(highWaterMark) || highWaterMark < 0) { throw new RangeError("Invalid highWaterMark"); } return highWaterMark; } function ExtractSizeAlgorithm(strategy) { const { size } = strategy; if (!size) { return () => 1; } return size; } function convertQueuingStrategy(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; const size = init === null || init === void 0 ? void 0 : init.size; return { highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark), size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`) }; } function convertQueuingStrategySize(fn, context) { assertFunction(fn, context); return (chunk) => convertUnrestrictedDouble(fn(chunk)); } function convertUnderlyingSink(original, context) { assertDictionary(original, context); const abort = original === null || original === void 0 ? void 0 : original.abort; const close = original === null || original === void 0 ? void 0 : original.close; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; const write = original === null || original === void 0 ? void 0 : original.write; return { abort: abort === void 0 ? void 0 : convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`), close: close === void 0 ? void 0 : convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`), start: start === void 0 ? void 0 : convertUnderlyingSinkStartCallback(start, original, `${context} has member 'start' that`), write: write === void 0 ? void 0 : convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`), type }; } function convertUnderlyingSinkAbortCallback(fn, original, context) { assertFunction(fn, context); return (reason) => promiseCall(fn, original, [reason]); } function convertUnderlyingSinkCloseCallback(fn, original, context) { assertFunction(fn, context); return () => promiseCall(fn, original, []); } function convertUnderlyingSinkStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) => reflectCall(fn, original, [controller]); } function convertUnderlyingSinkWriteCallback(fn, original, context) { assertFunction(fn, context); return (chunk, controller) => promiseCall(fn, original, [chunk, controller]); } function assertWritableStream(x2, context) { if (!IsWritableStream(x2)) { throw new TypeError(`${context} is not a WritableStream.`); } } function isAbortSignal2(value) { if (typeof value !== "object" || value === null) { return false; } try { return typeof value.aborted === "boolean"; } catch (_a2) { return false; } } const supportsAbortController = typeof AbortController === "function"; function createAbortController() { if (supportsAbortController) { return new AbortController(); } return void 0; } class WritableStream { constructor(rawUnderlyingSink = {}, rawStrategy = {}) { if (rawUnderlyingSink === void 0) { rawUnderlyingSink = null; } else { assertObject(rawUnderlyingSink, "First parameter"); } const strategy = convertQueuingStrategy(rawStrategy, "Second parameter"); const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, "First parameter"); InitializeWritableStream(this); const type = underlyingSink.type; if (type !== void 0) { throw new RangeError("Invalid type is specified"); } const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm); } /** * Returns whether or not the writable stream is locked to a writer. */ get locked() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2("locked"); } return IsWritableStreamLocked(this); } /** * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort * mechanism of the underlying sink. * * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel * the stream) if the stream is currently locked. */ abort(reason = void 0) { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2("abort")); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot abort a stream that already has a writer")); } return WritableStreamAbort(this, reason); } /** * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its * close behavior. During this time any further attempts to write will fail (without erroring the stream). * * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked. */ close() { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2("close")); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer")); } if (WritableStreamCloseQueuedOrInFlight(this)) { return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); } return WritableStreamClose(this); } /** * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream * is locked, no other writer can be acquired until this one is released. * * This functionality is especially useful for creating abstractions that desire the ability to write to a stream * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at * the same time, which would cause the resulting written data to be unpredictable and probably useless. */ getWriter() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2("getWriter"); } return AcquireWritableStreamDefaultWriter(this); } } Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(WritableStream.prototype.abort, "abort"); setFunctionName(WritableStream.prototype.close, "close"); setFunctionName(WritableStream.prototype.getWriter, "getWriter"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true }); } function AcquireWritableStreamDefaultWriter(stream) { return new WritableStreamDefaultWriter(stream); } function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) { const stream = Object.create(WritableStream.prototype); InitializeWritableStream(stream); const controller = Object.create(WritableStreamDefaultController.prototype); SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function InitializeWritableStream(stream) { stream._state = "writable"; stream._storedError = void 0; stream._writer = void 0; stream._writableStreamController = void 0; stream._writeRequests = new SimpleQueue(); stream._inFlightWriteRequest = void 0; stream._closeRequest = void 0; stream._inFlightCloseRequest = void 0; stream._pendingAbortRequest = void 0; stream._backpressure = false; } function IsWritableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_writableStreamController")) { return false; } return x2 instanceof WritableStream; } function IsWritableStreamLocked(stream) { if (stream._writer === void 0) { return false; } return true; } function WritableStreamAbort(stream, reason) { var _a2; if (stream._state === "closed" || stream._state === "errored") { return promiseResolvedWith(void 0); } stream._writableStreamController._abortReason = reason; (_a2 = stream._writableStreamController._abortController) === null || _a2 === void 0 ? void 0 : _a2.abort(reason); const state = stream._state; if (state === "closed" || state === "errored") { return promiseResolvedWith(void 0); } if (stream._pendingAbortRequest !== void 0) { return stream._pendingAbortRequest._promise; } let wasAlreadyErroring = false; if (state === "erroring") { wasAlreadyErroring = true; reason = void 0; } const promise = newPromise((resolve, reject) => { stream._pendingAbortRequest = { _promise: void 0, _resolve: resolve, _reject: reject, _reason: reason, _wasAlreadyErroring: wasAlreadyErroring }; }); stream._pendingAbortRequest._promise = promise; if (!wasAlreadyErroring) { WritableStreamStartErroring(stream, reason); } return promise; } function WritableStreamClose(stream) { const state = stream._state; if (state === "closed" || state === "errored") { return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`)); } const promise = newPromise((resolve, reject) => { const closeRequest = { _resolve: resolve, _reject: reject }; stream._closeRequest = closeRequest; }); const writer = stream._writer; if (writer !== void 0 && stream._backpressure && state === "writable") { defaultWriterReadyPromiseResolve(writer); } WritableStreamDefaultControllerClose(stream._writableStreamController); return promise; } function WritableStreamAddWriteRequest(stream) { const promise = newPromise((resolve, reject) => { const writeRequest = { _resolve: resolve, _reject: reject }; stream._writeRequests.push(writeRequest); }); return promise; } function WritableStreamDealWithRejection(stream, error) { const state = stream._state; if (state === "writable") { WritableStreamStartErroring(stream, error); return; } WritableStreamFinishErroring(stream); } function WritableStreamStartErroring(stream, reason) { const controller = stream._writableStreamController; stream._state = "erroring"; stream._storedError = reason; const writer = stream._writer; if (writer !== void 0) { WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); } if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) { WritableStreamFinishErroring(stream); } } function WritableStreamFinishErroring(stream) { stream._state = "errored"; stream._writableStreamController[ErrorSteps](); const storedError = stream._storedError; stream._writeRequests.forEach((writeRequest) => { writeRequest._reject(storedError); }); stream._writeRequests = new SimpleQueue(); if (stream._pendingAbortRequest === void 0) { WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const abortRequest = stream._pendingAbortRequest; stream._pendingAbortRequest = void 0; if (abortRequest._wasAlreadyErroring) { abortRequest._reject(storedError); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const promise = stream._writableStreamController[AbortSteps](abortRequest._reason); uponPromise(promise, () => { abortRequest._resolve(); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }, (reason) => { abortRequest._reject(reason); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }); } function WritableStreamFinishInFlightWrite(stream) { stream._inFlightWriteRequest._resolve(void 0); stream._inFlightWriteRequest = void 0; } function WritableStreamFinishInFlightWriteWithError(stream, error) { stream._inFlightWriteRequest._reject(error); stream._inFlightWriteRequest = void 0; WritableStreamDealWithRejection(stream, error); } function WritableStreamFinishInFlightClose(stream) { stream._inFlightCloseRequest._resolve(void 0); stream._inFlightCloseRequest = void 0; const state = stream._state; if (state === "erroring") { stream._storedError = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._resolve(); stream._pendingAbortRequest = void 0; } } stream._state = "closed"; const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseResolve(writer); } } function WritableStreamFinishInFlightCloseWithError(stream, error) { stream._inFlightCloseRequest._reject(error); stream._inFlightCloseRequest = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._reject(error); stream._pendingAbortRequest = void 0; } WritableStreamDealWithRejection(stream, error); } function WritableStreamCloseQueuedOrInFlight(stream) { if (stream._closeRequest === void 0 && stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamHasOperationMarkedInFlight(stream) { if (stream._inFlightWriteRequest === void 0 && stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamMarkCloseRequestInFlight(stream) { stream._inFlightCloseRequest = stream._closeRequest; stream._closeRequest = void 0; } function WritableStreamMarkFirstWriteRequestInFlight(stream) { stream._inFlightWriteRequest = stream._writeRequests.shift(); } function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { if (stream._closeRequest !== void 0) { stream._closeRequest._reject(stream._storedError); stream._closeRequest = void 0; } const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseReject(writer, stream._storedError); } } function WritableStreamUpdateBackpressure(stream, backpressure) { const writer = stream._writer; if (writer !== void 0 && backpressure !== stream._backpressure) { if (backpressure) { defaultWriterReadyPromiseReset(writer); } else { defaultWriterReadyPromiseResolve(writer); } } stream._backpressure = backpressure; } class WritableStreamDefaultWriter { constructor(stream) { assertRequiredArgument(stream, 1, "WritableStreamDefaultWriter"); assertWritableStream(stream, "First parameter"); if (IsWritableStreamLocked(stream)) { throw new TypeError("This stream has already been locked for exclusive writing by another writer"); } this._ownerWritableStream = stream; stream._writer = this; const state = stream._state; if (state === "writable") { if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) { defaultWriterReadyPromiseInitialize(this); } else { defaultWriterReadyPromiseInitializeAsResolved(this); } defaultWriterClosedPromiseInitialize(this); } else if (state === "erroring") { defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); defaultWriterClosedPromiseInitialize(this); } else if (state === "closed") { defaultWriterReadyPromiseInitializeAsResolved(this); defaultWriterClosedPromiseInitializeAsResolved(this); } else { const storedError = stream._storedError; defaultWriterReadyPromiseInitializeAsRejected(this, storedError); defaultWriterClosedPromiseInitializeAsRejected(this, storedError); } } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the writerโ€™s lock is released before the stream finishes closing. */ get closed() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("closed")); } return this._closedPromise; } /** * Returns the desired size to fill the streamโ€™s internal queue. It can be negative, if the queue is over-full. * A producer can use this information to determine the right amount of data to write. * * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when * the writerโ€™s lock is released. */ get desiredSize() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException("desiredSize"); } if (this._ownerWritableStream === void 0) { throw defaultWriterLockException("desiredSize"); } return WritableStreamDefaultWriterGetDesiredSize(this); } /** * Returns a promise that will be fulfilled when the desired size to fill the streamโ€™s internal queue transitions * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips * back to zero or below, the getter will return a new promise that stays pending until the next transition. * * If the stream becomes errored or aborted, or the writerโ€™s lock is released, the returned promise will become * rejected. */ get ready() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("ready")); } return this._readyPromise; } /** * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}. */ abort(reason = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("abort")); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException("abort")); } return WritableStreamDefaultWriterAbort(this, reason); } /** * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}. */ close() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("close")); } const stream = this._ownerWritableStream; if (stream === void 0) { return promiseRejectedWith(defaultWriterLockException("close")); } if (WritableStreamCloseQueuedOrInFlight(stream)) { return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); } return WritableStreamDefaultWriterClose(this); } /** * Releases the writerโ€™s lock on the corresponding stream. After the lock is released, the writer is no longer active. * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from * now on; otherwise, the writer will appear closed. * * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled). * Itโ€™s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents * other producers from writing in an interleaved manner. */ releaseLock() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException("releaseLock"); } const stream = this._ownerWritableStream; if (stream === void 0) { return; } WritableStreamDefaultWriterRelease(this); } write(chunk = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException("write")); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException("write to")); } return WritableStreamDefaultWriterWrite(this, chunk); } } Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }); setFunctionName(WritableStreamDefaultWriter.prototype.abort, "abort"); setFunctionName(WritableStreamDefaultWriter.prototype.close, "close"); setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"); setFunctionName(WritableStreamDefaultWriter.prototype.write, "write"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); } function IsWritableStreamDefaultWriter(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_ownerWritableStream")) { return false; } return x2 instanceof WritableStreamDefaultWriter; } function WritableStreamDefaultWriterAbort(writer, reason) { const stream = writer._ownerWritableStream; return WritableStreamAbort(stream, reason); } function WritableStreamDefaultWriterClose(writer) { const stream = writer._ownerWritableStream; return WritableStreamClose(stream); } function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (WritableStreamCloseQueuedOrInFlight(stream) || state === "closed") { return promiseResolvedWith(void 0); } if (state === "errored") { return promiseRejectedWith(stream._storedError); } return WritableStreamDefaultWriterClose(writer); } function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { if (writer._closedPromiseState === "pending") { defaultWriterClosedPromiseReject(writer, error); } else { defaultWriterClosedPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { if (writer._readyPromiseState === "pending") { defaultWriterReadyPromiseReject(writer, error); } else { defaultWriterReadyPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterGetDesiredSize(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (state === "errored" || state === "erroring") { return null; } if (state === "closed") { return 0; } return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); } function WritableStreamDefaultWriterRelease(writer) { const stream = writer._ownerWritableStream; const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`); WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); stream._writer = void 0; writer._ownerWritableStream = void 0; } function WritableStreamDefaultWriterWrite(writer, chunk) { const stream = writer._ownerWritableStream; const controller = stream._writableStreamController; const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); if (stream !== writer._ownerWritableStream) { return promiseRejectedWith(defaultWriterLockException("write to")); } const state = stream._state; if (state === "errored") { return promiseRejectedWith(stream._storedError); } if (WritableStreamCloseQueuedOrInFlight(stream) || state === "closed") { return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to")); } if (state === "erroring") { return promiseRejectedWith(stream._storedError); } const promise = WritableStreamAddWriteRequest(stream); WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); return promise; } const closeSentinel = {}; class WritableStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted. * * @deprecated * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177. * Use {@link WritableStreamDefaultController.signal}'s `reason` instead. */ get abortReason() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("abortReason"); } return this._abortReason; } /** * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted. */ get signal() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("signal"); } if (this._abortController === void 0) { throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported"); } return this._abortController.signal; } /** * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`. * * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the * normal lifecycle of interactions with the underlying sink. */ error(e2 = void 0) { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2("error"); } const state = this._controlledWritableStream._state; if (state !== "writable") { return; } WritableStreamDefaultControllerError(this, e2); } /** @internal */ [AbortSteps](reason) { const result = this._abortAlgorithm(reason); WritableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [ErrorSteps]() { ResetQueue(this); } } Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true }); } function IsWritableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledWritableStream")) { return false; } return x2 instanceof WritableStreamDefaultController; } function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledWritableStream = stream; stream._writableStreamController = controller; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._abortReason = void 0; controller._abortController = createAbortController(); controller._started = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._writeAlgorithm = writeAlgorithm; controller._closeAlgorithm = closeAlgorithm; controller._abortAlgorithm = abortAlgorithm; const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); const startResult = startAlgorithm(); const startPromise = promiseResolvedWith(startResult); uponPromise(startPromise, () => { controller._started = true; WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (r2) => { controller._started = true; WritableStreamDealWithRejection(stream, r2); return null; }); } function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) { const controller = Object.create(WritableStreamDefaultController.prototype); let startAlgorithm; let writeAlgorithm; let closeAlgorithm; let abortAlgorithm; if (underlyingSink.start !== void 0) { startAlgorithm = () => underlyingSink.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingSink.write !== void 0) { writeAlgorithm = (chunk) => underlyingSink.write(chunk, controller); } else { writeAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSink.close !== void 0) { closeAlgorithm = () => underlyingSink.close(); } else { closeAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSink.abort !== void 0) { abortAlgorithm = (reason) => underlyingSink.abort(reason); } else { abortAlgorithm = () => promiseResolvedWith(void 0); } SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); } function WritableStreamDefaultControllerClearAlgorithms(controller) { controller._writeAlgorithm = void 0; controller._closeAlgorithm = void 0; controller._abortAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function WritableStreamDefaultControllerClose(controller) { EnqueueValueWithSize(controller, closeSentinel, 0); WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { try { return controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); return 1; } } function WritableStreamDefaultControllerGetDesiredSize(controller) { return controller._strategyHWM - controller._queueTotalSize; } function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); return; } const stream = controller._controlledWritableStream; if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === "writable") { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { const stream = controller._controlledWritableStream; if (!controller._started) { return; } if (stream._inFlightWriteRequest !== void 0) { return; } const state = stream._state; if (state === "erroring") { WritableStreamFinishErroring(stream); return; } if (controller._queue.length === 0) { return; } const value = PeekQueueValue(controller); if (value === closeSentinel) { WritableStreamDefaultControllerProcessClose(controller); } else { WritableStreamDefaultControllerProcessWrite(controller, value); } } function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { if (controller._controlledWritableStream._state === "writable") { WritableStreamDefaultControllerError(controller, error); } } function WritableStreamDefaultControllerProcessClose(controller) { const stream = controller._controlledWritableStream; WritableStreamMarkCloseRequestInFlight(stream); DequeueValue(controller); const sinkClosePromise = controller._closeAlgorithm(); WritableStreamDefaultControllerClearAlgorithms(controller); uponPromise(sinkClosePromise, () => { WritableStreamFinishInFlightClose(stream); return null; }, (reason) => { WritableStreamFinishInFlightCloseWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerProcessWrite(controller, chunk) { const stream = controller._controlledWritableStream; WritableStreamMarkFirstWriteRequestInFlight(stream); const sinkWritePromise = controller._writeAlgorithm(chunk); uponPromise(sinkWritePromise, () => { WritableStreamFinishInFlightWrite(stream); const state = stream._state; DequeueValue(controller); if (!WritableStreamCloseQueuedOrInFlight(stream) && state === "writable") { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (reason) => { if (stream._state === "writable") { WritableStreamDefaultControllerClearAlgorithms(controller); } WritableStreamFinishInFlightWriteWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerGetBackpressure(controller) { const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); return desiredSize <= 0; } function WritableStreamDefaultControllerError(controller, error) { const stream = controller._controlledWritableStream; WritableStreamDefaultControllerClearAlgorithms(controller); WritableStreamStartErroring(stream, error); } function streamBrandCheckException$2(name) { return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`); } function defaultControllerBrandCheckException$2(name) { return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`); } function defaultWriterBrandCheckException(name) { return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`); } function defaultWriterLockException(name) { return new TypeError("Cannot " + name + " a stream using a released writer"); } function defaultWriterClosedPromiseInitialize(writer) { writer._closedPromise = newPromise((resolve, reject) => { writer._closedPromise_resolve = resolve; writer._closedPromise_reject = reject; writer._closedPromiseState = "pending"; }); } function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseReject(writer, reason); } function defaultWriterClosedPromiseInitializeAsResolved(writer) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseResolve(writer); } function defaultWriterClosedPromiseReject(writer, reason) { if (writer._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._closedPromise); writer._closedPromise_reject(reason); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = "rejected"; } function defaultWriterClosedPromiseResetToRejected(writer, reason) { defaultWriterClosedPromiseInitializeAsRejected(writer, reason); } function defaultWriterClosedPromiseResolve(writer) { if (writer._closedPromise_resolve === void 0) { return; } writer._closedPromise_resolve(void 0); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = "resolved"; } function defaultWriterReadyPromiseInitialize(writer) { writer._readyPromise = newPromise((resolve, reject) => { writer._readyPromise_resolve = resolve; writer._readyPromise_reject = reject; }); writer._readyPromiseState = "pending"; } function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseReject(writer, reason); } function defaultWriterReadyPromiseInitializeAsResolved(writer) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseResolve(writer); } function defaultWriterReadyPromiseReject(writer, reason) { if (writer._readyPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._readyPromise); writer._readyPromise_reject(reason); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = "rejected"; } function defaultWriterReadyPromiseReset(writer) { defaultWriterReadyPromiseInitialize(writer); } function defaultWriterReadyPromiseResetToRejected(writer, reason) { defaultWriterReadyPromiseInitializeAsRejected(writer, reason); } function defaultWriterReadyPromiseResolve(writer) { if (writer._readyPromise_resolve === void 0) { return; } writer._readyPromise_resolve(void 0); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = "fulfilled"; } function getGlobals() { if (typeof globalThis !== "undefined") { return globalThis; } else if (typeof self !== "undefined") { return self; } else if (typeof global !== "undefined") { return global; } return void 0; } const globals = getGlobals(); function isDOMExceptionConstructor(ctor) { if (!(typeof ctor === "function" || typeof ctor === "object")) { return false; } if (ctor.name !== "DOMException") { return false; } try { new ctor(); return true; } catch (_a2) { return false; } } function getFromGlobal() { const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException; return isDOMExceptionConstructor(ctor) ? ctor : void 0; } function createPolyfill() { const ctor = function DOMException3(message, name) { this.message = message || ""; this.name = name || "Error"; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } }; setFunctionName(ctor, "DOMException"); ctor.prototype = Object.create(Error.prototype); Object.defineProperty(ctor.prototype, "constructor", { value: ctor, writable: true, configurable: true }); return ctor; } const DOMException2 = getFromGlobal() || createPolyfill(); function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) { const reader = AcquireReadableStreamDefaultReader(source); const writer = AcquireWritableStreamDefaultWriter(dest); source._disturbed = true; let shuttingDown = false; let currentWrite = promiseResolvedWith(void 0); return newPromise((resolve, reject) => { let abortAlgorithm; if (signal !== void 0) { abortAlgorithm = () => { const error = signal.reason !== void 0 ? signal.reason : new DOMException2("Aborted", "AbortError"); const actions = []; if (!preventAbort) { actions.push(() => { if (dest._state === "writable") { return WritableStreamAbort(dest, error); } return promiseResolvedWith(void 0); }); } if (!preventCancel) { actions.push(() => { if (source._state === "readable") { return ReadableStreamCancel(source, error); } return promiseResolvedWith(void 0); }); } shutdownWithAction(() => Promise.all(actions.map((action) => action())), true, error); }; if (signal.aborted) { abortAlgorithm(); return; } signal.addEventListener("abort", abortAlgorithm); } function pipeLoop() { return newPromise((resolveLoop, rejectLoop) => { function next(done) { if (done) { resolveLoop(); } else { PerformPromiseThen(pipeStep(), next, rejectLoop); } } next(false); }); } function pipeStep() { if (shuttingDown) { return promiseResolvedWith(true); } return PerformPromiseThen(writer._readyPromise, () => { return newPromise((resolveRead, rejectRead) => { ReadableStreamDefaultReaderRead(reader, { _chunkSteps: (chunk) => { currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop2); resolveRead(false); }, _closeSteps: () => resolveRead(true), _errorSteps: rejectRead }); }); }); } isOrBecomesErrored(source, reader._closedPromise, (storedError) => { if (!preventAbort) { shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesErrored(dest, writer._closedPromise, (storedError) => { if (!preventCancel) { shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesClosed(source, reader._closedPromise, () => { if (!preventClose) { shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer)); } else { shutdown(); } return null; }); if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === "closed") { const destClosed = new TypeError("the destination writable stream closed before all data could be piped to it"); if (!preventCancel) { shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed); } else { shutdown(true, destClosed); } } setPromiseIsHandledToTrue(pipeLoop()); function waitForWritesToFinish() { const oldCurrentWrite = currentWrite; return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : void 0); } function isOrBecomesErrored(stream, promise, action) { if (stream._state === "errored") { action(stream._storedError); } else { uponRejection(promise, action); } } function isOrBecomesClosed(stream, promise, action) { if (stream._state === "closed") { action(); } else { uponFulfillment(promise, action); } } function shutdownWithAction(action, originalIsError, originalError) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === "writable" && !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), doTheRest); } else { doTheRest(); } function doTheRest() { uponPromise(action(), () => finalize(originalIsError, originalError), (newError) => finalize(true, newError)); return null; } } function shutdown(isError, error) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === "writable" && !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error)); } else { finalize(isError, error); } } function finalize(isError, error) { WritableStreamDefaultWriterRelease(writer); ReadableStreamReaderGenericRelease(reader); if (signal !== void 0) { signal.removeEventListener("abort", abortAlgorithm); } if (isError) { reject(error); } else { resolve(void 0); } return null; } }); } class ReadableStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is * over-full. An underlying source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("desiredSize"); } return ReadableStreamDefaultControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("close"); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError("The stream is not in a state that permits close"); } ReadableStreamDefaultControllerClose(this); } enqueue(chunk = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("enqueue"); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError("The stream is not in a state that permits enqueue"); } return ReadableStreamDefaultControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1("error"); } ReadableStreamDefaultControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableStream; if (this._queue.length > 0) { const chunk = DequeueValue(this); if (this._closeRequested && this._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(this); ReadableStreamClose(stream); } else { ReadableStreamDefaultControllerCallPullIfNeeded(this); } readRequest._chunkSteps(chunk); } else { ReadableStreamAddReadRequest(stream, readRequest); ReadableStreamDefaultControllerCallPullIfNeeded(this); } } /** @internal */ [ReleaseSteps]() { } } Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableStreamDefaultController.prototype.close, "close"); setFunctionName(ReadableStreamDefaultController.prototype.enqueue, "enqueue"); setFunctionName(ReadableStreamDefaultController.prototype.error, "error"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); } function IsReadableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableStream")) { return false; } return x2 instanceof ReadableStreamDefaultController; } function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () => { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableStreamDefaultControllerCallPullIfNeeded(controller); } return null; }, (e2) => { ReadableStreamDefaultControllerError(controller, e2); return null; }); } function ReadableStreamDefaultControllerShouldCallPull(controller) { const stream = controller._controlledReadableStream; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return false; } if (!controller._started) { return false; } if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { return true; } const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); if (desiredSize > 0) { return true; } return false; } function ReadableStreamDefaultControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function ReadableStreamDefaultControllerClose(controller) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; controller._closeRequested = true; if (controller._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamClose(stream); } } function ReadableStreamDefaultControllerEnqueue(controller, chunk) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { ReadableStreamFulfillReadRequest(stream, chunk, false); } else { let chunkSize; try { chunkSize = controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { ReadableStreamDefaultControllerError(controller, chunkSizeE); throw chunkSizeE; } try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { ReadableStreamDefaultControllerError(controller, enqueueE); throw enqueueE; } } ReadableStreamDefaultControllerCallPullIfNeeded(controller); } function ReadableStreamDefaultControllerError(controller, e2) { const stream = controller._controlledReadableStream; if (stream._state !== "readable") { return; } ResetQueue(controller); ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableStreamDefaultControllerGetDesiredSize(controller) { const state = controller._controlledReadableStream._state; if (state === "errored") { return null; } if (state === "closed") { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableStreamDefaultControllerHasBackpressure(controller) { if (ReadableStreamDefaultControllerShouldCallPull(controller)) { return false; } return true; } function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) { const state = controller._controlledReadableStream._state; if (!controller._closeRequested && state === "readable") { return true; } return false; } function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledReadableStream = stream; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._started = false; controller._closeRequested = false; controller._pullAgain = false; controller._pulling = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () => { controller._started = true; ReadableStreamDefaultControllerCallPullIfNeeded(controller); return null; }, (r2) => { ReadableStreamDefaultControllerError(controller, r2); return null; }); } function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) { const controller = Object.create(ReadableStreamDefaultController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingSource.start !== void 0) { startAlgorithm = () => underlyingSource.start(controller); } else { startAlgorithm = () => void 0; } if (underlyingSource.pull !== void 0) { pullAlgorithm = () => underlyingSource.pull(controller); } else { pullAlgorithm = () => promiseResolvedWith(void 0); } if (underlyingSource.cancel !== void 0) { cancelAlgorithm = (reason) => underlyingSource.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); } function defaultControllerBrandCheckException$1(name) { return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`); } function ReadableStreamTee(stream, cloneForBranch2) { if (IsReadableByteStreamController(stream._readableStreamController)) { return ReadableByteStreamTee(stream); } return ReadableStreamDefaultTee(stream); } function ReadableStreamDefaultTee(stream, cloneForBranch2) { const reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgain = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) => { resolveCancelPromise = resolve; }); function pullAlgorithm() { if (reading) { readAgain = true; return promiseResolvedWith(void 0); } reading = true; const readRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgain = false; const chunk1 = chunk; const chunk2 = chunk; if (!canceled1) { ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgain) { pullAlgorithm(); } }); }, _closeSteps: () => { reading = false; if (!canceled1) { ReadableStreamDefaultControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableStreamDefaultControllerClose(branch2._readableStreamController); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { } branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm); branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm); uponRejection(reader._closedPromise, (r2) => { ReadableStreamDefaultControllerError(branch1._readableStreamController, r2); ReadableStreamDefaultControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); return [branch1, branch2]; } function ReadableByteStreamTee(stream) { let reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgainForBranch1 = false; let readAgainForBranch2 = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) => { resolveCancelPromise = resolve; }); function forwardReaderError(thisReader) { uponRejection(thisReader._closedPromise, (r2) => { if (thisReader !== reader) { return null; } ReadableByteStreamControllerError(branch1._readableStreamController, r2); ReadableByteStreamControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); } function pullWithDefaultReader() { if (IsReadableStreamBYOBReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamDefaultReader(stream); forwardReaderError(reader); } const readRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgainForBranch1 = false; readAgainForBranch2 = false; const chunk1 = chunk; let chunk2 = chunk; if (!canceled1 && !canceled2) { try { chunk2 = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(branch1._readableStreamController, cloneE); ReadableByteStreamControllerError(branch2._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } } if (!canceled1) { ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: () => { reading = false; if (!canceled1) { ReadableByteStreamControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableByteStreamControllerClose(branch2._readableStreamController); } if (branch1._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(branch1._readableStreamController, 0); } if (branch2._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(branch2._readableStreamController, 0); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); } function pullWithBYOBReader(view, forBranch2) { if (IsReadableStreamDefaultReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamBYOBReader(stream); forwardReaderError(reader); } const byobBranch = forBranch2 ? branch2 : branch1; const otherBranch = forBranch2 ? branch1 : branch2; const readIntoRequest = { _chunkSteps: (chunk) => { _queueMicrotask(() => { readAgainForBranch1 = false; readAgainForBranch2 = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!otherCanceled) { let clonedChunk; try { clonedChunk = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE); ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk); } else if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: (chunk) => { reading = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!byobCanceled) { ReadableByteStreamControllerClose(byobBranch._readableStreamController); } if (!otherCanceled) { ReadableByteStreamControllerClose(otherBranch._readableStreamController); } if (chunk !== void 0) { if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) { ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0); } } if (!byobCanceled || !otherCanceled) { resolveCancelPromise(void 0); } }, _errorSteps: () => { reading = false; } }; ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest); } function pull1Algorithm() { if (reading) { readAgainForBranch1 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, false); } return promiseResolvedWith(void 0); } function pull2Algorithm() { if (reading) { readAgainForBranch2 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, true); } return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { return; } branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm); branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm); forwardReaderError(reader); return [branch1, branch2]; } function isReadableStreamLike(stream) { return typeIsObject(stream) && typeof stream.getReader !== "undefined"; } function ReadableStreamFrom(source) { if (isReadableStreamLike(source)) { return ReadableStreamFromDefaultReader(source.getReader()); } return ReadableStreamFromIterable(source); } function ReadableStreamFromIterable(asyncIterable) { let stream; const iteratorRecord = GetIterator(asyncIterable, "async"); const startAlgorithm = noop2; function pullAlgorithm() { let nextResult; try { nextResult = IteratorNext(iteratorRecord); } catch (e2) { return promiseRejectedWith(e2); } const nextPromise = promiseResolvedWith(nextResult); return transformPromiseWith(nextPromise, (iterResult) => { if (!typeIsObject(iterResult)) { throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object"); } const done = IteratorComplete(iterResult); if (done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = IteratorValue(iterResult); ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { const iterator = iteratorRecord.iterator; let returnMethod; try { returnMethod = GetMethod(iterator, "return"); } catch (e2) { return promiseRejectedWith(e2); } if (returnMethod === void 0) { return promiseResolvedWith(void 0); } let returnResult; try { returnResult = reflectCall(returnMethod, iterator, [reason]); } catch (e2) { return promiseRejectedWith(e2); } const returnPromise = promiseResolvedWith(returnResult); return transformPromiseWith(returnPromise, (iterResult) => { if (!typeIsObject(iterResult)) { throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object"); } return void 0; }); } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function ReadableStreamFromDefaultReader(reader) { let stream; const startAlgorithm = noop2; function pullAlgorithm() { let readPromise; try { readPromise = reader.read(); } catch (e2) { return promiseRejectedWith(e2); } return transformPromiseWith(readPromise, (readResult) => { if (!typeIsObject(readResult)) { throw new TypeError("The promise returned by the reader.read() method must fulfill with an object"); } if (readResult.done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = readResult.value; ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { try { return promiseResolvedWith(reader.cancel(reason)); } catch (e2) { return promiseRejectedWith(e2); } } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function convertUnderlyingDefaultOrByteSource(source, context) { assertDictionary(source, context); const original = source; const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize; const cancel = original === null || original === void 0 ? void 0 : original.cancel; const pull = original === null || original === void 0 ? void 0 : original.pull; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; return { autoAllocateChunkSize: autoAllocateChunkSize === void 0 ? void 0 : convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`), cancel: cancel === void 0 ? void 0 : convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`), pull: pull === void 0 ? void 0 : convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`), start: start === void 0 ? void 0 : convertUnderlyingSourceStartCallback(start, original, `${context} has member 'start' that`), type: type === void 0 ? void 0 : convertReadableStreamType(type, `${context} has member 'type' that`) }; } function convertUnderlyingSourceCancelCallback(fn, original, context) { assertFunction(fn, context); return (reason) => promiseCall(fn, original, [reason]); } function convertUnderlyingSourcePullCallback(fn, original, context) { assertFunction(fn, context); return (controller) => promiseCall(fn, original, [controller]); } function convertUnderlyingSourceStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) => reflectCall(fn, original, [controller]); } function convertReadableStreamType(type, context) { type = `${type}`; if (type !== "bytes") { throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`); } return type; } function convertIteratorOptions(options, context) { assertDictionary(options, context); const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; return { preventCancel: Boolean(preventCancel) }; } function convertPipeOptions(options, context) { assertDictionary(options, context); const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort; const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; const preventClose = options === null || options === void 0 ? void 0 : options.preventClose; const signal = options === null || options === void 0 ? void 0 : options.signal; if (signal !== void 0) { assertAbortSignal(signal, `${context} has member 'signal' that`); } return { preventAbort: Boolean(preventAbort), preventCancel: Boolean(preventCancel), preventClose: Boolean(preventClose), signal }; } function assertAbortSignal(signal, context) { if (!isAbortSignal2(signal)) { throw new TypeError(`${context} is not an AbortSignal.`); } } function convertReadableWritablePair(pair, context) { assertDictionary(pair, context); const readable = pair === null || pair === void 0 ? void 0 : pair.readable; assertRequiredField(readable, "readable", "ReadableWritablePair"); assertReadableStream(readable, `${context} has member 'readable' that`); const writable = pair === null || pair === void 0 ? void 0 : pair.writable; assertRequiredField(writable, "writable", "ReadableWritablePair"); assertWritableStream(writable, `${context} has member 'writable' that`); return { readable, writable }; } class ReadableStream2 { constructor(rawUnderlyingSource = {}, rawStrategy = {}) { if (rawUnderlyingSource === void 0) { rawUnderlyingSource = null; } else { assertObject(rawUnderlyingSource, "First parameter"); } const strategy = convertQueuingStrategy(rawStrategy, "Second parameter"); const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, "First parameter"); InitializeReadableStream(this); if (underlyingSource.type === "bytes") { if (strategy.size !== void 0) { throw new RangeError("The strategy for a byte stream cannot have a size function"); } const highWaterMark = ExtractHighWaterMark(strategy, 0); SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark); } else { const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm); } } /** * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}. */ get locked() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("locked"); } return IsReadableStreamLocked(this); } /** * Cancels the stream, signaling a loss of interest in the stream by a consumer. * * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()} * method, which might or might not use it. */ cancel(reason = void 0) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1("cancel")); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError("Cannot cancel a stream that already has a reader")); } return ReadableStreamCancel(this, reason); } getReader(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("getReader"); } const options = convertReaderOptions(rawOptions, "First parameter"); if (options.mode === void 0) { return AcquireReadableStreamDefaultReader(this); } return AcquireReadableStreamBYOBReader(this); } pipeThrough(rawTransform, rawOptions = {}) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("pipeThrough"); } assertRequiredArgument(rawTransform, 1, "pipeThrough"); const transform = convertReadableWritablePair(rawTransform, "First parameter"); const options = convertPipeOptions(rawOptions, "Second parameter"); if (IsReadableStreamLocked(this)) { throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); } if (IsWritableStreamLocked(transform.writable)) { throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); } const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal); setPromiseIsHandledToTrue(promise); return transform.readable; } pipeTo(destination, rawOptions = {}) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1("pipeTo")); } if (destination === void 0) { return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`); } if (!IsWritableStream(destination)) { return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`)); } let options; try { options = convertPipeOptions(rawOptions, "Second parameter"); } catch (e2) { return promiseRejectedWith(e2); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")); } if (IsWritableStreamLocked(destination)) { return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")); } return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal); } /** * Tees this readable stream, returning a two-element array containing the two resulting branches as * new {@link ReadableStream} instances. * * Teeing a stream will lock it, preventing any other consumer from acquiring a reader. * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be * propagated to the stream's underlying source. * * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, * this could allow interference between the two branches. */ tee() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("tee"); } const branches = ReadableStreamTee(this); return CreateArrayFromList(branches); } values(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1("values"); } const options = convertIteratorOptions(rawOptions, "First parameter"); return AcquireReadableStreamAsyncIterator(this, options.preventCancel); } [SymbolAsyncIterator](options) { return this.values(options); } /** * Creates a new ReadableStream wrapping the provided iterable or async iterable. * * This can be used to adapt various kinds of objects into a readable stream, * such as an array, an async generator, or a Node.js readable stream. */ static from(asyncIterable) { return ReadableStreamFrom(asyncIterable); } } Object.defineProperties(ReadableStream2, { from: { enumerable: true } }); Object.defineProperties(ReadableStream2.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(ReadableStream2.from, "from"); setFunctionName(ReadableStream2.prototype.cancel, "cancel"); setFunctionName(ReadableStream2.prototype.getReader, "getReader"); setFunctionName(ReadableStream2.prototype.pipeThrough, "pipeThrough"); setFunctionName(ReadableStream2.prototype.pipeTo, "pipeTo"); setFunctionName(ReadableStream2.prototype.tee, "tee"); setFunctionName(ReadableStream2.prototype.values, "values"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ReadableStream2.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }); } Object.defineProperty(ReadableStream2.prototype, SymbolAsyncIterator, { value: ReadableStream2.prototype.values, writable: true, configurable: true }); function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableStreamDefaultController.prototype); SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableByteStreamController.prototype); SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, void 0); return stream; } function InitializeReadableStream(stream) { stream._state = "readable"; stream._reader = void 0; stream._storedError = void 0; stream._disturbed = false; } function IsReadableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_readableStreamController")) { return false; } return x2 instanceof ReadableStream2; } function IsReadableStreamLocked(stream) { if (stream._reader === void 0) { return false; } return true; } function ReadableStreamCancel(stream, reason) { stream._disturbed = true; if (stream._state === "closed") { return promiseResolvedWith(void 0); } if (stream._state === "errored") { return promiseRejectedWith(stream._storedError); } ReadableStreamClose(stream); const reader = stream._reader; if (reader !== void 0 && IsReadableStreamBYOBReader(reader)) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) => { readIntoRequest._closeSteps(void 0); }); } const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason); return transformPromiseWith(sourceCancelPromise, noop2); } function ReadableStreamClose(stream) { stream._state = "closed"; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseResolve(reader); if (IsReadableStreamDefaultReader(reader)) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) => { readRequest._closeSteps(); }); } } function ReadableStreamError(stream, e2) { stream._state = "errored"; stream._storedError = e2; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseReject(reader, e2); if (IsReadableStreamDefaultReader(reader)) { ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } else { ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } } function streamBrandCheckException$1(name) { return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`); } function convertQueuingStrategyInit(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit"); return { highWaterMark: convertUnrestrictedDouble(highWaterMark) }; } const byteLengthSizeFunction = (chunk) => { return chunk.byteLength; }; setFunctionName(byteLengthSizeFunction, "size"); class ByteLengthQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, "ByteLengthQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException("highWaterMark"); } return this._byteLengthQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by returning the value of its `byteLength` property. */ get size() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException("size"); } return byteLengthSizeFunction; } } Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); } function byteLengthBrandCheckException(name) { return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`); } function IsByteLengthQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_byteLengthQueuingStrategyHighWaterMark")) { return false; } return x2 instanceof ByteLengthQueuingStrategy; } const countSizeFunction = () => { return 1; }; setFunctionName(countSizeFunction, "size"); class CountQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, "CountQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); this._countQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException("highWaterMark"); } return this._countQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by always returning 1. * This ensures that the total queue size is a count of the number of chunks in the queue. */ get size() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException("size"); } return countSizeFunction; } } Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true }); } function countBrandCheckException(name) { return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`); } function IsCountQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_countQueuingStrategyHighWaterMark")) { return false; } return x2 instanceof CountQueuingStrategy; } function convertTransformer(original, context) { assertDictionary(original, context); const cancel = original === null || original === void 0 ? void 0 : original.cancel; const flush = original === null || original === void 0 ? void 0 : original.flush; const readableType = original === null || original === void 0 ? void 0 : original.readableType; const start = original === null || original === void 0 ? void 0 : original.start; const transform = original === null || original === void 0 ? void 0 : original.transform; const writableType = original === null || original === void 0 ? void 0 : original.writableType; return { cancel: cancel === void 0 ? void 0 : convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`), flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`), readableType, start: start === void 0 ? void 0 : convertTransformerStartCallback(start, original, `${context} has member 'start' that`), transform: transform === void 0 ? void 0 : convertTransformerTransformCallback(transform, original, `${context} has member 'transform' that`), writableType }; } function convertTransformerFlushCallback(fn, original, context) { assertFunction(fn, context); return (controller) => promiseCall(fn, original, [controller]); } function convertTransformerStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) => reflectCall(fn, original, [controller]); } function convertTransformerTransformCallback(fn, original, context) { assertFunction(fn, context); return (chunk, controller) => promiseCall(fn, original, [chunk, controller]); } function convertTransformerCancelCallback(fn, original, context) { assertFunction(fn, context); return (reason) => promiseCall(fn, original, [reason]); } class TransformStream { constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) { if (rawTransformer === void 0) { rawTransformer = null; } const writableStrategy = convertQueuingStrategy(rawWritableStrategy, "Second parameter"); const readableStrategy = convertQueuingStrategy(rawReadableStrategy, "Third parameter"); const transformer = convertTransformer(rawTransformer, "First parameter"); if (transformer.readableType !== void 0) { throw new RangeError("Invalid readableType specified"); } if (transformer.writableType !== void 0) { throw new RangeError("Invalid writableType specified"); } const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0); const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy); const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1); const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy); let startPromise_resolve; const startPromise = newPromise((resolve) => { startPromise_resolve = resolve; }); InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm); SetUpTransformStreamDefaultControllerFromTransformer(this, transformer); if (transformer.start !== void 0) { startPromise_resolve(transformer.start(this._transformStreamController)); } else { startPromise_resolve(void 0); } } /** * The readable side of the transform stream. */ get readable() { if (!IsTransformStream(this)) { throw streamBrandCheckException("readable"); } return this._readable; } /** * The writable side of the transform stream. */ get writable() { if (!IsTransformStream(this)) { throw streamBrandCheckException("writable"); } return this._writable; } } Object.defineProperties(TransformStream.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true }); } function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) { function startAlgorithm() { return startPromise; } function writeAlgorithm(chunk) { return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk); } function abortAlgorithm(reason) { return TransformStreamDefaultSinkAbortAlgorithm(stream, reason); } function closeAlgorithm() { return TransformStreamDefaultSinkCloseAlgorithm(stream); } stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm); function pullAlgorithm() { return TransformStreamDefaultSourcePullAlgorithm(stream); } function cancelAlgorithm(reason) { return TransformStreamDefaultSourceCancelAlgorithm(stream, reason); } stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm); stream._backpressure = void 0; stream._backpressureChangePromise = void 0; stream._backpressureChangePromise_resolve = void 0; TransformStreamSetBackpressure(stream, true); stream._transformStreamController = void 0; } function IsTransformStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_transformStreamController")) { return false; } return x2 instanceof TransformStream; } function TransformStreamError(stream, e2) { ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e2); TransformStreamErrorWritableAndUnblockWrite(stream, e2); } function TransformStreamErrorWritableAndUnblockWrite(stream, e2) { TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController); WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e2); TransformStreamUnblockWrite(stream); } function TransformStreamUnblockWrite(stream) { if (stream._backpressure) { TransformStreamSetBackpressure(stream, false); } } function TransformStreamSetBackpressure(stream, backpressure) { if (stream._backpressureChangePromise !== void 0) { stream._backpressureChangePromise_resolve(); } stream._backpressureChangePromise = newPromise((resolve) => { stream._backpressureChangePromise_resolve = resolve; }); stream._backpressure = backpressure; } class TransformStreamDefaultController { constructor() { throw new TypeError("Illegal constructor"); } /** * Returns the desired size to fill the readable sideโ€™s internal queue. It can be negative, if the queue is over-full. */ get desiredSize() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("desiredSize"); } const readableController = this._controlledTransformStream._readable._readableStreamController; return ReadableStreamDefaultControllerGetDesiredSize(readableController); } enqueue(chunk = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("enqueue"); } TransformStreamDefaultControllerEnqueue(this, chunk); } /** * Errors both the readable side and the writable side of the controlled transform stream, making all future * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded. */ error(reason = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("error"); } TransformStreamDefaultControllerError(this, reason); } /** * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the * transformer only needs to consume a portion of the chunks written to the writable side. */ terminate() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException("terminate"); } TransformStreamDefaultControllerTerminate(this); } } Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(TransformStreamDefaultController.prototype.enqueue, "enqueue"); setFunctionName(TransformStreamDefaultController.prototype.error, "error"); setFunctionName(TransformStreamDefaultController.prototype.terminate, "terminate"); if (typeof Symbol.toStringTag === "symbol") { Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); } function IsTransformStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, "_controlledTransformStream")) { return false; } return x2 instanceof TransformStreamDefaultController; } function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) { controller._controlledTransformStream = stream; stream._transformStreamController = controller; controller._transformAlgorithm = transformAlgorithm; controller._flushAlgorithm = flushAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._finishPromise = void 0; controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) { const controller = Object.create(TransformStreamDefaultController.prototype); let transformAlgorithm; let flushAlgorithm; let cancelAlgorithm; if (transformer.transform !== void 0) { transformAlgorithm = (chunk) => transformer.transform(chunk, controller); } else { transformAlgorithm = (chunk) => { try { TransformStreamDefaultControllerEnqueue(controller, chunk); return promiseResolvedWith(void 0); } catch (transformResultE) { return promiseRejectedWith(transformResultE); } }; } if (transformer.flush !== void 0) { flushAlgorithm = () => transformer.flush(controller); } else { flushAlgorithm = () => promiseResolvedWith(void 0); } if (transformer.cancel !== void 0) { cancelAlgorithm = (reason) => transformer.cancel(reason); } else { cancelAlgorithm = () => promiseResolvedWith(void 0); } SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm); } function TransformStreamDefaultControllerClearAlgorithms(controller) { controller._transformAlgorithm = void 0; controller._flushAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function TransformStreamDefaultControllerEnqueue(controller, chunk) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) { throw new TypeError("Readable side is not in a state that permits enqueue"); } try { ReadableStreamDefaultControllerEnqueue(readableController, chunk); } catch (e2) { TransformStreamErrorWritableAndUnblockWrite(stream, e2); throw stream._readable._storedError; } const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController); if (backpressure !== stream._backpressure) { TransformStreamSetBackpressure(stream, true); } } function TransformStreamDefaultControllerError(controller, e2) { TransformStreamError(controller._controlledTransformStream, e2); } function TransformStreamDefaultControllerPerformTransform(controller, chunk) { const transformPromise = controller._transformAlgorithm(chunk); return transformPromiseWith(transformPromise, void 0, (r2) => { TransformStreamError(controller._controlledTransformStream, r2); throw r2; }); } function TransformStreamDefaultControllerTerminate(controller) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; ReadableStreamDefaultControllerClose(readableController); const error = new TypeError("TransformStream terminated"); TransformStreamErrorWritableAndUnblockWrite(stream, error); } function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) { const controller = stream._transformStreamController; if (stream._backpressure) { const backpressureChangePromise = stream._backpressureChangePromise; return transformPromiseWith(backpressureChangePromise, () => { const writable = stream._writable; const state = writable._state; if (state === "erroring") { throw writable._storedError; } return TransformStreamDefaultControllerPerformTransform(controller, chunk); }); } return TransformStreamDefaultControllerPerformTransform(controller, chunk); } function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { if (readable._state === "errored") { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerError(readable._readableStreamController, reason); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSinkCloseAlgorithm(stream) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const flushPromise = controller._flushAlgorithm(); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(flushPromise, () => { if (readable._state === "errored") { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerClose(readable._readableStreamController); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSourcePullAlgorithm(stream) { TransformStreamSetBackpressure(stream, false); return stream._backpressureChangePromise; } function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const writable = stream._writable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { if (writable._state === "errored") { defaultControllerFinishPromiseReject(controller, writable._storedError); } else { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) => { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r2); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function defaultControllerBrandCheckException(name) { return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`); } function defaultControllerFinishPromiseResolve(controller) { if (controller._finishPromise_resolve === void 0) { return; } controller._finishPromise_resolve(); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function defaultControllerFinishPromiseReject(controller, reason) { if (controller._finishPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(controller._finishPromise); controller._finishPromise_reject(reason); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function streamBrandCheckException(name) { return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`); } exports3.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy; exports3.CountQueuingStrategy = CountQueuingStrategy; exports3.ReadableByteStreamController = ReadableByteStreamController; exports3.ReadableStream = ReadableStream2; exports3.ReadableStreamBYOBReader = ReadableStreamBYOBReader; exports3.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest; exports3.ReadableStreamDefaultController = ReadableStreamDefaultController; exports3.ReadableStreamDefaultReader = ReadableStreamDefaultReader; exports3.TransformStream = TransformStream; exports3.TransformStreamDefaultController = TransformStreamDefaultController; exports3.WritableStream = WritableStream; exports3.WritableStreamDefaultController = WritableStreamDefaultController; exports3.WritableStreamDefaultWriter = WritableStreamDefaultWriter; })); } }); // node_modules/fetch-blob/streams.cjs var require_streams = __commonJS({ "node_modules/fetch-blob/streams.cjs"() { var POOL_SIZE2 = 65536; if (!globalThis.ReadableStream) { try { const process2 = require("process"); const { emitWarning } = process2; try { process2.emitWarning = () => { }; Object.assign(globalThis, require("stream/web")); process2.emitWarning = emitWarning; } catch (error) { process2.emitWarning = emitWarning; throw error; } } catch (error) { Object.assign(globalThis, require_ponyfill_es2018()); } } try { const { Blob: Blob3 } = require("buffer"); if (Blob3 && !Blob3.prototype.stream) { Blob3.prototype.stream = function name(params) { let position = 0; const blob = this; return new ReadableStream({ type: "bytes", async pull(ctrl) { const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE2)); const buffer = await chunk.arrayBuffer(); position += buffer.byteLength; ctrl.enqueue(new Uint8Array(buffer)); if (position === blob.size) { ctrl.close(); } } }); }; } } catch (error) { } } }); // node_modules/fetch-blob/index.js async function* toIterator(parts, clone2 = true) { for (const part of parts) { if ("stream" in part) { yield* ( /** @type {AsyncIterableIterator<Uint8Array>} */ part.stream() ); } else if (ArrayBuffer.isView(part)) { if (clone2) { let position = part.byteOffset; const end = part.byteOffset + part.byteLength; while (position !== end) { const size = Math.min(end - position, POOL_SIZE); const chunk = part.buffer.slice(position, position + size); position += chunk.byteLength; yield new Uint8Array(chunk); } } else { yield part; } } else { let position = 0, b = ( /** @type {Blob} */ part ); while (position !== b.size) { const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE)); const buffer = await chunk.arrayBuffer(); position += buffer.byteLength; yield new Uint8Array(buffer); } } } } var import_streams, POOL_SIZE, _Blob, Blob2, fetch_blob_default; var init_fetch_blob = __esm({ "node_modules/fetch-blob/index.js"() { import_streams = __toESM(require_streams(), 1); POOL_SIZE = 65536; _Blob = class Blob { /** @type {Array.<(Blob|Uint8Array)>} */ #parts = []; #type = ""; #size = 0; #endings = "transparent"; /** * The Blob() constructor returns a new Blob object. The content * of the blob consists of the concatenation of the values given * in the parameter array. * * @param {*} blobParts * @param {{ type?: string, endings?: string }} [options] */ constructor(blobParts = [], options = {}) { if (typeof blobParts !== "object" || blobParts === null) { throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence."); } if (typeof blobParts[Symbol.iterator] !== "function") { throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property."); } if (typeof options !== "object" && typeof options !== "function") { throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary."); } if (options === null) options = {}; const encoder = new TextEncoder(); for (const element of blobParts) { let part; if (ArrayBuffer.isView(element)) { part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength)); } else if (element instanceof ArrayBuffer) { part = new Uint8Array(element.slice(0)); } else if (element instanceof Blob) { part = element; } else { part = encoder.encode(`${element}`); } this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size; this.#parts.push(part); } this.#endings = `${options.endings === void 0 ? "transparent" : options.endings}`; const type = options.type === void 0 ? "" : String(options.type); this.#type = /^[\x20-\x7E]*$/.test(type) ? type : ""; } /** * The Blob interface's size property returns the * size of the Blob in bytes. */ get size() { return this.#size; } /** * The type property of a Blob object returns the MIME type of the file. */ get type() { return this.#type; } /** * The text() method in the Blob interface returns a Promise * that resolves with a string containing the contents of * the blob, interpreted as UTF-8. * * @return {Promise<string>} */ async text() { const decoder = new TextDecoder(); let str = ""; for await (const part of toIterator(this.#parts, false)) { str += decoder.decode(part, { stream: true }); } str += decoder.decode(); return str; } /** * The arrayBuffer() method in the Blob interface returns a * Promise that resolves with the contents of the blob as * binary data contained in an ArrayBuffer. * * @return {Promise<ArrayBuffer>} */ async arrayBuffer() { const data = new Uint8Array(this.size); let offset = 0; for await (const chunk of toIterator(this.#parts, false)) { data.set(chunk, offset); offset += chunk.length; } return data.buffer; } stream() { const it = toIterator(this.#parts, true); return new globalThis.ReadableStream({ // @ts-ignore type: "bytes", async pull(ctrl) { const chunk = await it.next(); chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value); }, async cancel() { await it.return(); } }); } /** * The Blob interface's slice() method creates and returns a * new Blob object which contains data from a subset of the * blob on which it's called. * * @param {number} [start] * @param {number} [end] * @param {string} [type] */ slice(start = 0, end = this.size, type = "") { const { size } = this; let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size); let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size); const span = Math.max(relativeEnd - relativeStart, 0); const parts = this.#parts; const blobParts = []; let added = 0; for (const part of parts) { if (added >= span) { break; } const size2 = ArrayBuffer.isView(part) ? part.byteLength : part.size; if (relativeStart && size2 <= relativeStart) { relativeStart -= size2; relativeEnd -= size2; } else { let chunk; if (ArrayBuffer.isView(part)) { chunk = part.subarray(relativeStart, Math.min(size2, relativeEnd)); added += chunk.byteLength; } else { chunk = part.slice(relativeStart, Math.min(size2, relativeEnd)); added += chunk.size; } relativeEnd -= size2; blobParts.push(chunk); relativeStart = 0; } } const blob = new Blob([], { type: String(type).toLowerCase() }); blob.#size = span; blob.#parts = blobParts; return blob; } get [Symbol.toStringTag]() { return "Blob"; } static [Symbol.hasInstance](object) { return object && typeof object === "object" && typeof object.constructor === "function" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); } }; Object.defineProperties(_Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Blob2 = _Blob; fetch_blob_default = Blob2; } }); // node_modules/fetch-blob/file.js var _File, File2, file_default; var init_file = __esm({ "node_modules/fetch-blob/file.js"() { init_fetch_blob(); _File = class File extends fetch_blob_default { #lastModified = 0; #name = ""; /** * @param {*[]} fileBits * @param {string} fileName * @param {{lastModified?: number, type?: string}} options */ // @ts-ignore constructor(fileBits, fileName, options = {}) { if (arguments.length < 2) { throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`); } super(fileBits, options); if (options === null) options = {}; const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified); if (!Number.isNaN(lastModified)) { this.#lastModified = lastModified; } this.#name = String(fileName); } get name() { return this.#name; } get lastModified() { return this.#lastModified; } get [Symbol.toStringTag]() { return "File"; } static [Symbol.hasInstance](object) { return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]); } }; File2 = _File; file_default = File2; } }); // node_modules/formdata-polyfill/esm.min.js function formDataToBlob(F2, B = fetch_blob_default) { var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c = [], p = `--${b}\r Content-Disposition: form-data; name="`; F2.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r \r ${v.replace(/\r(?!\n)|(?<!\r)\n/g, "\r\n")}\r `) : c.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r Content-Type: ${v.type || "application/octet-stream"}\r \r `, v, "\r\n")); c.push(`--${b}--`); return new B(c, { type: "multipart/form-data; boundary=" + b }); } var t, i, h, r, m, f, e, x, FormData; var init_esm_min = __esm({ "node_modules/formdata-polyfill/esm.min.js"() { init_fetch_blob(); init_file(); ({ toStringTag: t, iterator: i, hasInstance: h } = Symbol); r = Math.random; m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","); f = (a, b, c) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== void 0 ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new file_default([b], c, b) : b] : [a, b + ""]); e = (c, f3) => (f3 ? c : c.replace(/\r?\n|\r/g, "\r\n")).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); x = (n, a, e2) => { if (a.length < e2) { throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`); } }; FormData = class FormData2 { #d = []; constructor(...a) { if (a.length) throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`); } get [t]() { return "FormData"; } [i]() { return this.entries(); } static [h](o) { return o && typeof o === "object" && o[t] === "FormData" && !m.some((m2) => typeof o[m2] != "function"); } append(...a) { x("append", arguments, 2); this.#d.push(f(...a)); } delete(a) { x("delete", arguments, 1); a += ""; this.#d = this.#d.filter(([b]) => b !== a); } get(a) { x("get", arguments, 1); a += ""; for (var b = this.#d, l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1]; return null; } getAll(a, b) { x("getAll", arguments, 1); b = []; a += ""; this.#d.forEach((c) => c[0] === a && b.push(c[1])); return b; } has(a) { x("has", arguments, 1); a += ""; return this.#d.some((b) => b[0] === a); } forEach(a, b) { x("forEach", arguments, 1); for (var [c, d] of this) a.call(b, d, c, this); } set(...a) { x("set", arguments, 2); var b = [], c = true; a = f(...a); this.#d.forEach((d) => { d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d); }); c && b.push(a); this.#d = b; } *entries() { yield* this.#d; } *keys() { for (var [a] of this) yield a; } *values() { for (var [, a] of this) yield a; } }; } }); // node_modules/node-fetch/src/errors/base.js var FetchBaseError; var init_base = __esm({ "node_modules/node-fetch/src/errors/base.js"() { FetchBaseError = class extends Error { constructor(message, type) { super(message); Error.captureStackTrace(this, this.constructor); this.type = type; } get name() { return this.constructor.name; } get [Symbol.toStringTag]() { return this.constructor.name; } }; } }); // node_modules/node-fetch/src/errors/fetch-error.js var FetchError; var init_fetch_error = __esm({ "node_modules/node-fetch/src/errors/fetch-error.js"() { init_base(); FetchError = class extends FetchBaseError { /** * @param {string} message - Error message for human * @param {string} [type] - Error type for machine * @param {SystemError} [systemError] - For Node.js system error */ constructor(message, type, systemError) { super(message, type); if (systemError) { this.code = this.errno = systemError.code; this.erroredSysCall = systemError.syscall; } } }; } }); // node_modules/node-fetch/src/utils/is.js var NAME, isURLSearchParameters, isBlob, isAbortSignal, isDomainOrSubdomain, isSameProtocol; var init_is = __esm({ "node_modules/node-fetch/src/utils/is.js"() { NAME = Symbol.toStringTag; isURLSearchParameters = (object) => { return typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && typeof object.sort === "function" && object[NAME] === "URLSearchParams"; }; isBlob = (object) => { return object && typeof object === "object" && typeof object.arrayBuffer === "function" && typeof object.type === "string" && typeof object.stream === "function" && typeof object.constructor === "function" && /^(Blob|File)$/.test(object[NAME]); }; isAbortSignal = (object) => { return typeof object === "object" && (object[NAME] === "AbortSignal" || object[NAME] === "EventTarget"); }; isDomainOrSubdomain = (destination, original) => { const orig = new URL(original).hostname; const dest = new URL(destination).hostname; return orig === dest || orig.endsWith(`.${dest}`); }; isSameProtocol = (destination, original) => { const orig = new URL(original).protocol; const dest = new URL(destination).protocol; return orig === dest; }; } }); // node_modules/node-domexception/index.js var require_node_domexception = __commonJS({ "node_modules/node-domexception/index.js"(exports2, module2) { if (!globalThis.DOMException) { try { const { MessageChannel } = require("worker_threads"), port = new MessageChannel().port1, ab = new ArrayBuffer(); port.postMessage(ab, [ab, ab]); } catch (err) { err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor); } } module2.exports = globalThis.DOMException; } }); // node_modules/fetch-blob/from.js var import_node_fs, import_node_path, import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem; var init_from = __esm({ "node_modules/fetch-blob/from.js"() { import_node_fs = require("fs"); import_node_path = require("path"); import_node_domexception = __toESM(require_node_domexception(), 1); init_file(); init_fetch_blob(); ({ stat } = import_node_fs.promises); blobFromSync = (path, type) => fromBlob((0, import_node_fs.statSync)(path), path, type); blobFrom = (path, type) => stat(path).then((stat2) => fromBlob(stat2, path, type)); fileFrom = (path, type) => stat(path).then((stat2) => fromFile(stat2, path, type)); fileFromSync = (path, type) => fromFile((0, import_node_fs.statSync)(path), path, type); fromBlob = (stat2, path, type = "") => new fetch_blob_default([new BlobDataItem({ path, size: stat2.size, lastModified: stat2.mtimeMs, start: 0 })], { type }); fromFile = (stat2, path, type = "") => new file_default([new BlobDataItem({ path, size: stat2.size, lastModified: stat2.mtimeMs, start: 0 })], (0, import_node_path.basename)(path), { type, lastModified: stat2.mtimeMs }); BlobDataItem = class _BlobDataItem { #path; #start; constructor(options) { this.#path = options.path; this.#start = options.start; this.size = options.size; this.lastModified = options.lastModified; } /** * Slicing arguments is first validated and formatted * to not be out of range by Blob.prototype.slice */ slice(start, end) { return new _BlobDataItem({ path: this.#path, lastModified: this.lastModified, size: end - start, start: this.#start + start }); } async *stream() { const { mtimeMs } = await stat(this.#path); if (mtimeMs > this.lastModified) { throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError"); } yield* (0, import_node_fs.createReadStream)(this.#path, { start: this.#start, end: this.#start + this.size - 1 }); } get [Symbol.toStringTag]() { return "Blob"; } }; } }); // node_modules/node-fetch/src/utils/multipart-parser.js var multipart_parser_exports = {}; __export(multipart_parser_exports, { toFormData: () => toFormData }); function _fileName(headerValue) { const m2 = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i); if (!m2) { return; } const match = m2[2] || m2[3] || ""; let filename = match.slice(match.lastIndexOf("\\") + 1); filename = filename.replace(/%22/g, '"'); filename = filename.replace(/&#(\d{4});/g, (m3, code) => { return String.fromCharCode(code); }); return filename; } async function toFormData(Body2, ct) { if (!/multipart/i.test(ct)) { throw new TypeError("Failed to fetch"); } const m2 = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i); if (!m2) { throw new TypeError("no or bad content-type header, no multipart boundary"); } const parser = new MultipartParser(m2[1] || m2[2]); let headerField; let headerValue; let entryValue; let entryName; let contentType; let filename; const entryChunks = []; const formData = new FormData(); const onPartData = (ui8a) => { entryValue += decoder.decode(ui8a, { stream: true }); }; const appendToFile = (ui8a) => { entryChunks.push(ui8a); }; const appendFileToFormData = () => { const file = new file_default(entryChunks, filename, { type: contentType }); formData.append(entryName, file); }; const appendEntryToFormData = () => { formData.append(entryName, entryValue); }; const decoder = new TextDecoder("utf-8"); decoder.decode(); parser.onPartBegin = function() { parser.onPartData = onPartData; parser.onPartEnd = appendEntryToFormData; headerField = ""; headerValue = ""; entryValue = ""; entryName = ""; contentType = ""; filename = null; entryChunks.length = 0; }; parser.onHeaderField = function(ui8a) { headerField += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderValue = function(ui8a) { headerValue += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderEnd = function() { headerValue += decoder.decode(); headerField = headerField.toLowerCase(); if (headerField === "content-disposition") { const m3 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i); if (m3) { entryName = m3[2] || m3[3] || ""; } filename = _fileName(headerValue); if (filename) { parser.onPartData = appendToFile; parser.onPartEnd = appendFileToFormData; } } else if (headerField === "content-type") { contentType = headerValue; } headerValue = ""; headerField = ""; }; for await (const chunk of Body2) { parser.write(chunk); } parser.end(); return formData; } var s, S, f2, F, LF, CR, SPACE, HYPHEN, COLON, A, Z, lower, noop, MultipartParser; var init_multipart_parser = __esm({ "node_modules/node-fetch/src/utils/multipart-parser.js"() { init_from(); init_esm_min(); s = 0; S = { START_BOUNDARY: s++, HEADER_FIELD_START: s++, HEADER_FIELD: s++, HEADER_VALUE_START: s++, HEADER_VALUE: s++, HEADER_VALUE_ALMOST_DONE: s++, HEADERS_ALMOST_DONE: s++, PART_DATA_START: s++, PART_DATA: s++, END: s++ }; f2 = 1; F = { PART_BOUNDARY: f2, LAST_BOUNDARY: f2 *= 2 }; LF = 10; CR = 13; SPACE = 32; HYPHEN = 45; COLON = 58; A = 97; Z = 122; lower = (c) => c | 32; noop = () => { }; MultipartParser = class { /** * @param {string} boundary */ constructor(boundary) { this.index = 0; this.flags = 0; this.onHeaderEnd = noop; this.onHeaderField = noop; this.onHeadersEnd = noop; this.onHeaderValue = noop; this.onPartBegin = noop; this.onPartData = noop; this.onPartEnd = noop; this.boundaryChars = {}; boundary = "\r\n--" + boundary; const ui8a = new Uint8Array(boundary.length); for (let i2 = 0; i2 < boundary.length; i2++) { ui8a[i2] = boundary.charCodeAt(i2); this.boundaryChars[ui8a[i2]] = true; } this.boundary = ui8a; this.lookbehind = new Uint8Array(this.boundary.length + 8); this.state = S.START_BOUNDARY; } /** * @param {Uint8Array} data */ write(data) { let i2 = 0; const length_ = data.length; let previousIndex = this.index; let { lookbehind, boundary, boundaryChars, index, state, flags } = this; const boundaryLength = this.boundary.length; const boundaryEnd = boundaryLength - 1; const bufferLength = data.length; let c; let cl; const mark = (name) => { this[name + "Mark"] = i2; }; const clear = (name) => { delete this[name + "Mark"]; }; const callback = (callbackSymbol, start, end, ui8a) => { if (start === void 0 || start !== end) { this[callbackSymbol](ui8a && ui8a.subarray(start, end)); } }; const dataCallback = (name, clear2) => { const markSymbol = name + "Mark"; if (!(markSymbol in this)) { return; } if (clear2) { callback(name, this[markSymbol], i2, data); delete this[markSymbol]; } else { callback(name, this[markSymbol], data.length, data); this[markSymbol] = 0; } }; for (i2 = 0; i2 < length_; i2++) { c = data[i2]; switch (state) { case S.START_BOUNDARY: if (index === boundary.length - 2) { if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else if (c !== CR) { return; } index++; break; } else if (index - 1 === boundary.length - 2) { if (flags & F.LAST_BOUNDARY && c === HYPHEN) { state = S.END; flags = 0; } else if (!(flags & F.LAST_BOUNDARY) && c === LF) { index = 0; callback("onPartBegin"); state = S.HEADER_FIELD_START; } else { return; } break; } if (c !== boundary[index + 2]) { index = -2; } if (c === boundary[index + 2]) { index++; } break; case S.HEADER_FIELD_START: state = S.HEADER_FIELD; mark("onHeaderField"); index = 0; // falls through case S.HEADER_FIELD: if (c === CR) { clear("onHeaderField"); state = S.HEADERS_ALMOST_DONE; break; } index++; if (c === HYPHEN) { break; } if (c === COLON) { if (index === 1) { return; } dataCallback("onHeaderField", true); state = S.HEADER_VALUE_START; break; } cl = lower(c); if (cl < A || cl > Z) { return; } break; case S.HEADER_VALUE_START: if (c === SPACE) { break; } mark("onHeaderValue"); state = S.HEADER_VALUE; // falls through case S.HEADER_VALUE: if (c === CR) { dataCallback("onHeaderValue", true); callback("onHeaderEnd"); state = S.HEADER_VALUE_ALMOST_DONE; } break; case S.HEADER_VALUE_ALMOST_DONE: if (c !== LF) { return; } state = S.HEADER_FIELD_START; break; case S.HEADERS_ALMOST_DONE: if (c !== LF) { return; } callback("onHeadersEnd"); state = S.PART_DATA_START; break; case S.PART_DATA_START: state = S.PART_DATA; mark("onPartData"); // falls through case S.PART_DATA: previousIndex = index; if (index === 0) { i2 += boundaryEnd; while (i2 < bufferLength && !(data[i2] in boundaryChars)) { i2 += boundaryLength; } i2 -= boundaryEnd; c = data[i2]; } if (index < boundary.length) { if (boundary[index] === c) { if (index === 0) { dataCallback("onPartData", true); } index++; } else { index = 0; } } else if (index === boundary.length) { index++; if (c === CR) { flags |= F.PART_BOUNDARY; } else if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else { index = 0; } } else if (index - 1 === boundary.length) { if (flags & F.PART_BOUNDARY) { index = 0; if (c === LF) { flags &= ~F.PART_BOUNDARY; callback("onPartEnd"); callback("onPartBegin"); state = S.HEADER_FIELD_START; break; } } else if (flags & F.LAST_BOUNDARY) { if (c === HYPHEN) { callback("onPartEnd"); state = S.END; flags = 0; } else { index = 0; } } else { index = 0; } } if (index > 0) { lookbehind[index - 1] = c; } else if (previousIndex > 0) { const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength); callback("onPartData", 0, previousIndex, _lookbehind); previousIndex = 0; mark("onPartData"); i2--; } break; case S.END: break; default: throw new Error(`Unexpected state entered: ${state}`); } } dataCallback("onHeaderField"); dataCallback("onHeaderValue"); dataCallback("onPartData"); this.index = index; this.state = state; this.flags = flags; } end() { if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length) { this.onPartEnd(); } else if (this.state !== S.END) { throw new Error("MultipartParser.end(): stream ended unexpectedly"); } } }; } }); // node_modules/node-fetch/src/body.js async function consumeBody(data) { if (data[INTERNALS].disturbed) { throw new TypeError(`body used already for: ${data.url}`); } data[INTERNALS].disturbed = true; if (data[INTERNALS].error) { throw data[INTERNALS].error; } const { body } = data; if (body === null) { return import_node_buffer.Buffer.alloc(0); } if (!(body instanceof import_node_stream.default)) { return import_node_buffer.Buffer.alloc(0); } const accum = []; let accumBytes = 0; try { for await (const chunk of body) { if (data.size > 0 && accumBytes + chunk.length > data.size) { const error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, "max-size"); body.destroy(error); throw error; } accumBytes += chunk.length; accum.push(chunk); } } catch (error) { const error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, "system", error); throw error_; } if (body.readableEnded === true || body._readableState.ended === true) { try { if (accum.every((c) => typeof c === "string")) { return import_node_buffer.Buffer.from(accum.join("")); } return import_node_buffer.Buffer.concat(accum, accumBytes); } catch (error) { throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, "system", error); } } else { throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`); } } var import_node_stream, import_node_util, import_node_buffer, pipeline, INTERNALS, Body, clone, getNonSpecFormDataBoundary, extractContentType, getTotalBytes, writeToStream; var init_body = __esm({ "node_modules/node-fetch/src/body.js"() { import_node_stream = __toESM(require("stream"), 1); import_node_util = require("util"); import_node_buffer = require("buffer"); init_fetch_blob(); init_esm_min(); init_fetch_error(); init_base(); init_is(); pipeline = (0, import_node_util.promisify)(import_node_stream.default.pipeline); INTERNALS = Symbol("Body internals"); Body = class { constructor(body, { size = 0 } = {}) { let boundary = null; if (body === null) { body = null; } else if (isURLSearchParameters(body)) { body = import_node_buffer.Buffer.from(body.toString()); } else if (isBlob(body)) { } else if (import_node_buffer.Buffer.isBuffer(body)) { } else if (import_node_util.types.isAnyArrayBuffer(body)) { body = import_node_buffer.Buffer.from(body); } else if (ArrayBuffer.isView(body)) { body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof import_node_stream.default) { } else if (body instanceof FormData) { body = formDataToBlob(body); boundary = body.type.split("=")[1]; } else { body = import_node_buffer.Buffer.from(String(body)); } let stream = body; if (import_node_buffer.Buffer.isBuffer(body)) { stream = import_node_stream.default.Readable.from(body); } else if (isBlob(body)) { stream = import_node_stream.default.Readable.from(body.stream()); } this[INTERNALS] = { body, stream, boundary, disturbed: false, error: null }; this.size = size; if (body instanceof import_node_stream.default) { body.on("error", (error_) => { const error = error_ instanceof FetchBaseError ? error_ : new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, "system", error_); this[INTERNALS].error = error; }); } } get body() { return this[INTERNALS].stream; } get bodyUsed() { return this[INTERNALS].disturbed; } /** * Decode response as ArrayBuffer * * @return Promise */ async arrayBuffer() { const { buffer, byteOffset, byteLength } = await consumeBody(this); return buffer.slice(byteOffset, byteOffset + byteLength); } async formData() { const ct = this.headers.get("content-type"); if (ct.startsWith("application/x-www-form-urlencoded")) { const formData = new FormData(); const parameters = new URLSearchParams(await this.text()); for (const [name, value] of parameters) { formData.append(name, value); } return formData; } const { toFormData: toFormData2 } = await Promise.resolve().then(() => (init_multipart_parser(), multipart_parser_exports)); return toFormData2(this.body, ct); } /** * Return raw response as Blob * * @return Promise */ async blob() { const ct = this.headers && this.headers.get("content-type") || this[INTERNALS].body && this[INTERNALS].body.type || ""; const buf = await this.arrayBuffer(); return new fetch_blob_default([buf], { type: ct }); } /** * Decode response as json * * @return Promise */ async json() { const text = await this.text(); return JSON.parse(text); } /** * Decode response as text * * @return Promise */ async text() { const buffer = await consumeBody(this); return new TextDecoder().decode(buffer); } /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody(this); } }; Body.prototype.buffer = (0, import_node_util.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"); Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: (0, import_node_util.deprecate)( () => { }, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)" ) } }); clone = (instance, highWaterMark) => { let p1; let p2; let { body } = instance[INTERNALS]; if (instance.bodyUsed) { throw new Error("cannot clone body after it is used"); } if (body instanceof import_node_stream.default && typeof body.getBoundary !== "function") { p1 = new import_node_stream.PassThrough({ highWaterMark }); p2 = new import_node_stream.PassThrough({ highWaterMark }); body.pipe(p1); body.pipe(p2); instance[INTERNALS].stream = p1; body = p2; } return body; }; getNonSpecFormDataBoundary = (0, import_node_util.deprecate)( (body) => body.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167" ); extractContentType = (body, request) => { if (body === null) { return null; } if (typeof body === "string") { return "text/plain;charset=UTF-8"; } if (isURLSearchParameters(body)) { return "application/x-www-form-urlencoded;charset=UTF-8"; } if (isBlob(body)) { return body.type || null; } if (import_node_buffer.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) { return null; } if (body instanceof FormData) { return `multipart/form-data; boundary=${request[INTERNALS].boundary}`; } if (body && typeof body.getBoundary === "function") { return `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`; } if (body instanceof import_node_stream.default) { return null; } return "text/plain;charset=UTF-8"; }; getTotalBytes = (request) => { const { body } = request[INTERNALS]; if (body === null) { return 0; } if (isBlob(body)) { return body.size; } if (import_node_buffer.Buffer.isBuffer(body)) { return body.length; } if (body && typeof body.getLengthSync === "function") { return body.hasKnownLength && body.hasKnownLength() ? body.getLengthSync() : null; } return null; }; writeToStream = async (dest, { body }) => { if (body === null) { dest.end(); } else { await pipeline(body, dest); } }; } }); // node_modules/node-fetch/src/headers.js function fromRawHeaders(headers = []) { return new Headers( headers.reduce((result, value, index, array) => { if (index % 2 === 0) { result.push(array.slice(index, index + 2)); } return result; }, []).filter(([name, value]) => { try { validateHeaderName(name); validateHeaderValue(name, String(value)); return true; } catch { return false; } }) ); } var import_node_util2, import_node_http, validateHeaderName, validateHeaderValue, Headers; var init_headers = __esm({ "node_modules/node-fetch/src/headers.js"() { import_node_util2 = require("util"); import_node_http = __toESM(require("http"), 1); validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => { if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) { const error = new TypeError(`Header name must be a valid HTTP token [${name}]`); Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" }); throw error; } }; validateHeaderValue = typeof import_node_http.default.validateHeaderValue === "function" ? import_node_http.default.validateHeaderValue : (name, value) => { if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) { const error = new TypeError(`Invalid character in header content ["${name}"]`); Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" }); throw error; } }; Headers = class _Headers extends URLSearchParams { /** * Headers class * * @constructor * @param {HeadersInit} [init] - Response headers */ constructor(init) { let result = []; if (init instanceof _Headers) { const raw = init.raw(); for (const [name, values] of Object.entries(raw)) { result.push(...values.map((value) => [name, value])); } } else if (init == null) { } else if (typeof init === "object" && !import_node_util2.types.isBoxedPrimitive(init)) { const method = init[Symbol.iterator]; if (method == null) { result.push(...Object.entries(init)); } else { if (typeof method !== "function") { throw new TypeError("Header pairs must be iterable"); } result = [...init].map((pair) => { if (typeof pair !== "object" || import_node_util2.types.isBoxedPrimitive(pair)) { throw new TypeError("Each header pair must be an iterable object"); } return [...pair]; }).map((pair) => { if (pair.length !== 2) { throw new TypeError("Each header pair must be a name/value tuple"); } return [...pair]; }); } } else { throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)"); } result = result.length > 0 ? result.map(([name, value]) => { validateHeaderName(name); validateHeaderValue(name, String(value)); return [String(name).toLowerCase(), String(value)]; }) : void 0; super(result); return new Proxy(this, { get(target, p, receiver) { switch (p) { case "append": case "set": return (name, value) => { validateHeaderName(name); validateHeaderValue(name, String(value)); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase(), String(value) ); }; case "delete": case "has": case "getAll": return (name) => { validateHeaderName(name); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase() ); }; case "keys": return () => { target.sort(); return new Set(URLSearchParams.prototype.keys.call(target)).keys(); }; default: return Reflect.get(target, p, receiver); } } }); } get [Symbol.toStringTag]() { return this.constructor.name; } toString() { return Object.prototype.toString.call(this); } get(name) { const values = this.getAll(name); if (values.length === 0) { return null; } let value = values.join(", "); if (/^content-encoding$/i.test(name)) { value = value.toLowerCase(); } return value; } forEach(callback, thisArg = void 0) { for (const name of this.keys()) { Reflect.apply(callback, thisArg, [this.get(name), name, this]); } } *values() { for (const name of this.keys()) { yield this.get(name); } } /** * @type {() => IterableIterator<[string, string]>} */ *entries() { for (const name of this.keys()) { yield [name, this.get(name)]; } } [Symbol.iterator]() { return this.entries(); } /** * Node-fetch non-spec method * returning all headers and their values as array * @returns {Record<string, string[]>} */ raw() { return [...this.keys()].reduce((result, key) => { result[key] = this.getAll(key); return result; }, {}); } /** * For better console.log(headers) and also to convert Headers into Node.js Request compatible format */ [Symbol.for("nodejs.util.inspect.custom")]() { return [...this.keys()].reduce((result, key) => { const values = this.getAll(key); if (key === "host") { result[key] = values[0]; } else { result[key] = values.length > 1 ? values : values[0]; } return result; }, {}); } }; Object.defineProperties( Headers.prototype, ["get", "entries", "forEach", "values"].reduce((result, property) => { result[property] = { enumerable: true }; return result; }, {}) ); } }); // node_modules/node-fetch/src/utils/is-redirect.js var redirectStatus, isRedirect; var init_is_redirect = __esm({ "node_modules/node-fetch/src/utils/is-redirect.js"() { redirectStatus = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); isRedirect = (code) => { return redirectStatus.has(code); }; } }); // node_modules/node-fetch/src/response.js var INTERNALS2, Response; var init_response = __esm({ "node_modules/node-fetch/src/response.js"() { init_headers(); init_body(); init_is_redirect(); INTERNALS2 = Symbol("Response internals"); Response = class _Response extends Body { constructor(body = null, options = {}) { super(body, options); const status = options.status != null ? options.status : 200; const headers = new Headers(options.headers); if (body !== null && !headers.has("Content-Type")) { const contentType = extractContentType(body, this); if (contentType) { headers.append("Content-Type", contentType); } } this[INTERNALS2] = { type: "default", url: options.url, status, statusText: options.statusText || "", headers, counter: options.counter, highWaterMark: options.highWaterMark }; } get type() { return this[INTERNALS2].type; } get url() { return this[INTERNALS2].url || ""; } get status() { return this[INTERNALS2].status; } /** * Convenience property representing if the request ended normally */ get ok() { return this[INTERNALS2].status >= 200 && this[INTERNALS2].status < 300; } get redirected() { return this[INTERNALS2].counter > 0; } get statusText() { return this[INTERNALS2].statusText; } get headers() { return this[INTERNALS2].headers; } get highWaterMark() { return this[INTERNALS2].highWaterMark; } /** * Clone this response * * @return Response */ clone() { return new _Response(clone(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark }); } /** * @param {string} url The URL that the new response is to originate from. * @param {number} status An optional status code for the response (e.g., 302.) * @returns {Response} A Response object. */ static redirect(url, status = 302) { if (!isRedirect(status)) { throw new RangeError('Failed to execute "redirect" on "response": Invalid status code'); } return new _Response(null, { headers: { location: new URL(url).toString() }, status }); } static error() { const response = new _Response(null, { status: 0, statusText: "" }); response[INTERNALS2].type = "error"; return response; } static json(data = void 0, init = {}) { const body = JSON.stringify(data); if (body === void 0) { throw new TypeError("data is not JSON serializable"); } const headers = new Headers(init && init.headers); if (!headers.has("content-type")) { headers.set("content-type", "application/json"); } return new _Response(body, { ...init, headers }); } get [Symbol.toStringTag]() { return "Response"; } }; Object.defineProperties(Response.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); } }); // node_modules/node-fetch/src/utils/get-search.js var getSearch; var init_get_search = __esm({ "node_modules/node-fetch/src/utils/get-search.js"() { getSearch = (parsedURL) => { if (parsedURL.search) { return parsedURL.search; } const lastOffset = parsedURL.href.length - 1; const hash = parsedURL.hash || (parsedURL.href[lastOffset] === "#" ? "#" : ""); return parsedURL.href[lastOffset - hash.length] === "?" ? "?" : ""; }; } }); // node_modules/node-fetch/src/utils/referrer.js function stripURLForUseAsAReferrer(url, originOnly = false) { if (url == null) { return "no-referrer"; } url = new URL(url); if (/^(about|blob|data):$/.test(url.protocol)) { return "no-referrer"; } url.username = ""; url.password = ""; url.hash = ""; if (originOnly) { url.pathname = ""; url.search = ""; } return url; } function validateReferrerPolicy(referrerPolicy) { if (!ReferrerPolicy.has(referrerPolicy)) { throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`); } return referrerPolicy; } function isOriginPotentiallyTrustworthy(url) { if (/^(http|ws)s:$/.test(url.protocol)) { return true; } const hostIp = url.host.replace(/(^\[)|(]$)/g, ""); const hostIPVersion = (0, import_node_net.isIP)(hostIp); if (hostIPVersion === 4 && /^127\./.test(hostIp)) { return true; } if (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) { return true; } if (url.host === "localhost" || url.host.endsWith(".localhost")) { return false; } if (url.protocol === "file:") { return true; } return false; } function isUrlPotentiallyTrustworthy(url) { if (/^about:(blank|srcdoc)$/.test(url)) { return true; } if (url.protocol === "data:") { return true; } if (/^(blob|filesystem):$/.test(url.protocol)) { return true; } return isOriginPotentiallyTrustworthy(url); } function determineRequestsReferrer(request, { referrerURLCallback, referrerOriginCallback } = {}) { if (request.referrer === "no-referrer" || request.referrerPolicy === "") { return null; } const policy = request.referrerPolicy; if (request.referrer === "about:client") { return "no-referrer"; } const referrerSource = request.referrer; let referrerURL = stripURLForUseAsAReferrer(referrerSource); let referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true); if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin; } if (referrerURLCallback) { referrerURL = referrerURLCallback(referrerURL); } if (referrerOriginCallback) { referrerOrigin = referrerOriginCallback(referrerOrigin); } const currentURL = new URL(request.url); switch (policy) { case "no-referrer": return "no-referrer"; case "origin": return referrerOrigin; case "unsafe-url": return referrerURL; case "strict-origin": if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin.toString(); case "strict-origin-when-cross-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin; case "same-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } return "no-referrer"; case "origin-when-cross-origin": if (referrerURL.origin === currentURL.origin) { return referrerURL; } return referrerOrigin; case "no-referrer-when-downgrade": if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerURL; default: throw new TypeError(`Invalid referrerPolicy: ${policy}`); } } function parseReferrerPolicyFromHeader(headers) { const policyTokens = (headers.get("referrer-policy") || "").split(/[,\s]+/); let policy = ""; for (const token of policyTokens) { if (token && ReferrerPolicy.has(token)) { policy = token; } } return policy; } var import_node_net, ReferrerPolicy, DEFAULT_REFERRER_POLICY; var init_referrer = __esm({ "node_modules/node-fetch/src/utils/referrer.js"() { import_node_net = require("net"); ReferrerPolicy = /* @__PURE__ */ new Set([ "", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url" ]); DEFAULT_REFERRER_POLICY = "strict-origin-when-cross-origin"; } }); // node_modules/node-fetch/src/request.js var import_node_url, import_node_util3, INTERNALS3, isRequest, doBadDataWarn, Request, getNodeRequestOptions; var init_request = __esm({ "node_modules/node-fetch/src/request.js"() { import_node_url = require("url"); import_node_util3 = require("util"); init_headers(); init_body(); init_is(); init_get_search(); init_referrer(); INTERNALS3 = Symbol("Request internals"); isRequest = (object) => { return typeof object === "object" && typeof object[INTERNALS3] === "object"; }; doBadDataWarn = (0, import_node_util3.deprecate)( () => { }, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)" ); Request = class _Request extends Body { constructor(input, init = {}) { let parsedURL; if (isRequest(input)) { parsedURL = new URL(input.url); } else { parsedURL = new URL(input); input = {}; } if (parsedURL.username !== "" || parsedURL.password !== "") { throw new TypeError(`${parsedURL} is an url with embedded credentials.`); } let method = init.method || input.method || "GET"; if (/^(delete|get|head|options|post|put)$/i.test(method)) { method = method.toUpperCase(); } if (!isRequest(init) && "data" in init) { doBadDataWarn(); } if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body"); } const inputBody = init.body ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; super(inputBody, { size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody !== null && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody, this); if (contentType) { headers.set("Content-Type", contentType); } } let signal = isRequest(input) ? input.signal : null; if ("signal" in init) { signal = init.signal; } if (signal != null && !isAbortSignal(signal)) { throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget"); } let referrer = init.referrer == null ? input.referrer : init.referrer; if (referrer === "") { referrer = "no-referrer"; } else if (referrer) { const parsedReferrer = new URL(referrer); referrer = /^about:(\/\/)?client$/.test(parsedReferrer) ? "client" : parsedReferrer; } else { referrer = void 0; } this[INTERNALS3] = { method, redirect: init.redirect || input.redirect || "follow", headers, parsedURL, signal, referrer }; this.follow = init.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init.follow; this.compress = init.compress === void 0 ? input.compress === void 0 ? true : input.compress : init.compress; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; this.highWaterMark = init.highWaterMark || input.highWaterMark || 16384; this.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false; this.referrerPolicy = init.referrerPolicy || input.referrerPolicy || ""; } /** @returns {string} */ get method() { return this[INTERNALS3].method; } /** @returns {string} */ get url() { return (0, import_node_url.format)(this[INTERNALS3].parsedURL); } /** @returns {Headers} */ get headers() { return this[INTERNALS3].headers; } get redirect() { return this[INTERNALS3].redirect; } /** @returns {AbortSignal} */ get signal() { return this[INTERNALS3].signal; } // https://fetch.spec.whatwg.org/#dom-request-referrer get referrer() { if (this[INTERNALS3].referrer === "no-referrer") { return ""; } if (this[INTERNALS3].referrer === "client") { return "about:client"; } if (this[INTERNALS3].referrer) { return this[INTERNALS3].referrer.toString(); } return void 0; } get referrerPolicy() { return this[INTERNALS3].referrerPolicy; } set referrerPolicy(referrerPolicy) { this[INTERNALS3].referrerPolicy = validateReferrerPolicy(referrerPolicy); } /** * Clone this request * * @return Request */ clone() { return new _Request(this); } get [Symbol.toStringTag]() { return "Request"; } }; Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } }); getNodeRequestOptions = (request) => { const { parsedURL } = request[INTERNALS3]; const headers = new Headers(request[INTERNALS3].headers); if (!headers.has("Accept")) { headers.set("Accept", "*/*"); } let contentLengthValue = null; if (request.body === null && /^(post|put)$/i.test(request.method)) { contentLengthValue = "0"; } if (request.body !== null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === "number" && !Number.isNaN(totalBytes)) { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set("Content-Length", contentLengthValue); } if (request.referrerPolicy === "") { request.referrerPolicy = DEFAULT_REFERRER_POLICY; } if (request.referrer && request.referrer !== "no-referrer") { request[INTERNALS3].referrer = determineRequestsReferrer(request); } else { request[INTERNALS3].referrer = "no-referrer"; } if (request[INTERNALS3].referrer instanceof URL) { headers.set("Referer", request.referrer); } if (!headers.has("User-Agent")) { headers.set("User-Agent", "node-fetch"); } if (request.compress && !headers.has("Accept-Encoding")) { headers.set("Accept-Encoding", "gzip, deflate, br"); } let { agent } = request; if (typeof agent === "function") { agent = agent(parsedURL); } const search = getSearch(parsedURL); const options = { // Overwrite search to retain trailing ? (issue #776) path: parsedURL.pathname + search, // The following options are not expressed in the URL method: request.method, headers: headers[Symbol.for("nodejs.util.inspect.custom")](), insecureHTTPParser: request.insecureHTTPParser, agent }; return { /** @type {URL} */ parsedURL, options }; }; } }); // node_modules/node-fetch/src/errors/abort-error.js var AbortError; var init_abort_error = __esm({ "node_modules/node-fetch/src/errors/abort-error.js"() { init_base(); AbortError = class extends FetchBaseError { constructor(message, type = "aborted") { super(message, type); } }; } }); // node_modules/node-fetch/src/index.js var src_exports = {}; __export(src_exports, { AbortError: () => AbortError, Blob: () => fetch_blob_default, FetchError: () => FetchError, File: () => file_default, FormData: () => FormData, Headers: () => Headers, Request: () => Request, Response: () => Response, blobFrom: () => blobFrom, blobFromSync: () => blobFromSync, default: () => fetch, fileFrom: () => fileFrom, fileFromSync: () => fileFromSync, isRedirect: () => isRedirect }); async function fetch(url, options_) { return new Promise((resolve, reject) => { const request = new Request(url, options_); const { parsedURL, options } = getNodeRequestOptions(request); if (!supportedSchemas.has(parsedURL.protocol)) { throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`); } if (parsedURL.protocol === "data:") { const data = dist_default(request.url); const response2 = new Response(data, { headers: { "Content-Type": data.typeFull } }); resolve(response2); return; } const send = (parsedURL.protocol === "https:" ? import_node_https.default : import_node_http2.default).request; const { signal } = request; let response = null; const abort = () => { const error = new AbortError("The operation was aborted."); reject(error); if (request.body && request.body instanceof import_node_stream2.default.Readable) { request.body.destroy(error); } if (!response || !response.body) { return; } response.body.emit("error", error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = () => { abort(); finalize(); }; const request_ = send(parsedURL.toString(), options); if (signal) { signal.addEventListener("abort", abortAndFinalize); } const finalize = () => { request_.abort(); if (signal) { signal.removeEventListener("abort", abortAndFinalize); } }; request_.on("error", (error) => { reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, "system", error)); finalize(); }); fixResponseChunkedTransferBadEnding(request_, (error) => { if (response && response.body) { response.body.destroy(error); } }); if (process.version < "v14") { request_.on("socket", (s2) => { let endedWithEventsCount; s2.prependListener("end", () => { endedWithEventsCount = s2._eventsCount; }); s2.prependListener("close", (hadError) => { if (response && endedWithEventsCount < s2._eventsCount && !hadError) { const error = new Error("Premature close"); error.code = "ERR_STREAM_PREMATURE_CLOSE"; response.body.emit("error", error); } }); }); } request_.on("response", (response_) => { request_.setTimeout(0); const headers = fromRawHeaders(response_.rawHeaders); if (isRedirect(response_.statusCode)) { const location = headers.get("Location"); let locationURL = null; try { locationURL = location === null ? null : new URL(location, request.url); } catch { if (request.redirect !== "manual") { reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); finalize(); return; } } switch (request.redirect) { case "error": reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); finalize(); return; case "manual": break; case "follow": { if (locationURL === null) { break; } if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); finalize(); return; } const requestOptions = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: clone(request), signal: request.signal, size: request.size, referrer: request.referrer, referrerPolicy: request.referrerPolicy }; if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { requestOptions.headers.delete(name); } } if (response_.statusCode !== 303 && request.body && options_.body instanceof import_node_stream2.default.Readable) { reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); finalize(); return; } if (response_.statusCode === 303 || (response_.statusCode === 301 || response_.statusCode === 302) && request.method === "POST") { requestOptions.method = "GET"; requestOptions.body = void 0; requestOptions.headers.delete("content-length"); } const responseReferrerPolicy = parseReferrerPolicyFromHeader(headers); if (responseReferrerPolicy) { requestOptions.referrerPolicy = responseReferrerPolicy; } resolve(fetch(new Request(locationURL, requestOptions))); finalize(); return; } default: return reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`)); } } if (signal) { response_.once("end", () => { signal.removeEventListener("abort", abortAndFinalize); }); } let body = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) => { if (error) { reject(error); } }); if (process.version < "v12.10") { response_.on("aborted", abortAndFinalize); } const responseOptions = { url: request.url, status: response_.statusCode, statusText: response_.statusMessage, headers, size: request.size, counter: request.counter, highWaterMark: request.highWaterMark }; const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) { response = new Response(body, responseOptions); resolve(response); return; } const zlibOptions = { flush: import_node_zlib.default.Z_SYNC_FLUSH, finishFlush: import_node_zlib.default.Z_SYNC_FLUSH }; if (codings === "gzip" || codings === "x-gzip") { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createGunzip(zlibOptions), (error) => { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } if (codings === "deflate" || codings === "x-deflate") { const raw = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) => { if (error) { reject(error); } }); raw.once("data", (chunk) => { if ((chunk[0] & 15) === 8) { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflate(), (error) => { if (error) { reject(error); } }); } else { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflateRaw(), (error) => { if (error) { reject(error); } }); } response = new Response(body, responseOptions); resolve(response); }); raw.once("end", () => { if (!response) { response = new Response(body, responseOptions); resolve(response); } }); return; } if (codings === "br") { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createBrotliDecompress(), (error) => { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } response = new Response(body, responseOptions); resolve(response); }); writeToStream(request_, request).catch(reject); }); } function fixResponseChunkedTransferBadEnding(request, errorCallback) { const LAST_CHUNK = import_node_buffer2.Buffer.from("0\r\n\r\n"); let isChunkedTransfer = false; let properLastChunkReceived = false; let previousChunk; request.on("response", (response) => { const { headers } = response; isChunkedTransfer = headers["transfer-encoding"] === "chunked" && !headers["content-length"]; }); request.on("socket", (socket) => { const onSocketClose = () => { if (isChunkedTransfer && !properLastChunkReceived) { const error = new Error("Premature close"); error.code = "ERR_STREAM_PREMATURE_CLOSE"; errorCallback(error); } }; const onData = (buf) => { properLastChunkReceived = import_node_buffer2.Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0; if (!properLastChunkReceived && previousChunk) { properLastChunkReceived = import_node_buffer2.Buffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 && import_node_buffer2.Buffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0; } previousChunk = buf; }; socket.prependListener("close", onSocketClose); socket.on("data", onData); request.on("close", () => { socket.removeListener("close", onSocketClose); socket.removeListener("data", onData); }); }); } var import_node_http2, import_node_https, import_node_zlib, import_node_stream2, import_node_buffer2, supportedSchemas; var init_src = __esm({ "node_modules/node-fetch/src/index.js"() { import_node_http2 = __toESM(require("http"), 1); import_node_https = __toESM(require("https"), 1); import_node_zlib = __toESM(require("zlib"), 1); import_node_stream2 = __toESM(require("stream"), 1); import_node_buffer2 = require("buffer"); init_dist(); init_body(); init_response(); init_headers(); init_request(); init_fetch_error(); init_abort_error(); init_is_redirect(); init_esm_min(); init_is(); init_referrer(); init_from(); supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]); } }); // netlify/functions/lightx-proxy.js function getSecureEnvVar(key, required = true) { const value = process.env[key]; if (!value || value.trim() === "") { if (required) { console.error(`Required environment variable ${key} is missing or empty`); return null; } console.warn(`Optional environment variable ${key} is not set`); return null; } if (key.includes("API_KEY") && value.length < 10) { console.error(`Environment variable ${key} appears to be invalid (too short)`); return null; } return value.trim(); } function createErrorResponse(statusCode, message, details = null) { const response = { statusCode, headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "POST, OPTIONS" }, body: JSON.stringify({ error: message, ...details && { details } }) }; console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : ""}`); return response; } exports.handler = async function(event, context) { const { default: fetch2 } = await Promise.resolve().then(() => (init_src(), src_exports)); if (event.httpMethod === "OPTIONS") { return { statusCode: 200, headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "POST, OPTIONS" }, body: "" }; } if (event.httpMethod !== "POST") { return createErrorResponse(405, "Method Not Allowed"); } try { let requestBody; try { requestBody = JSON.parse(event.body); } catch (parseError) { return createErrorResponse(400, "Invalid JSON in request body", parseError.message); } const { endpoint, body } = requestBody; if (!endpoint) { return createErrorResponse(400, "Missing endpoint parameter"); } if (typeof endpoint !== "string" || endpoint.trim() === "") { return createErrorResponse(400, "Invalid endpoint parameter"); } let lightxUrl; if (endpoint.startsWith("v1/")) { lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } else { lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } const apiKey = getSecureEnvVar("LIGHTX_API_KEY", true); if (!apiKey) { return createErrorResponse(500, "API key not configured or invalid"); } const isDevelopment = getSecureEnvVar("NODE_ENV", false) !== "production"; if (isDevelopment) { console.log(`Making request to: ${lightxUrl}`); console.log(`Request body keys: ${Object.keys(body || {}).join(", ")}`); console.log(`API key present: Yes`); } if (body && typeof body !== "object") { return createErrorResponse(400, "Request body must be an object"); } const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 3e4); let response; try { response = await fetch2(lightxUrl, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": apiKey, "User-Agent": "ModernPhotoTools/1.0" }, body: JSON.stringify(body || {}), signal: controller.signal }); } catch (fetchError) { clearTimeout(timeoutId); if (fetchError.name === "AbortError") { return createErrorResponse(408, "Request timeout"); } return createErrorResponse(502, "Failed to connect to LightX API", fetchError.message); } finally { clearTimeout(timeoutId); } if (isDevelopment) { console.log(`Response status: ${response.status}`); console.log(`Response status text: ${response.statusText}`); } let data; try { data = await response.json(); } catch (jsonError) { return createErrorResponse(502, "Invalid JSON response from LightX API", jsonError.message); } return { statusCode: response.status, headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "POST, OPTIONS", "Cache-Control": "no-cache, no-store, must-revalidate" }, body: JSON.stringify(data) }; } catch (error) { console.error("Function error:", { message: error.message, stack: error.stack, name: error.name }); return createErrorResponse(500, "Internal server error", error.message); } }; /*! Bundled license information: web-streams-polyfill/dist/ponyfill.es2018.js: (** * @license * web-streams-polyfill v3.3.3 * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors. * This code is released under the MIT license. * SPDX-License-Identifier: MIT *) fetch-blob/index.js: (*! fetch-blob. MIT License. Jimmy Wรคrting <https://jimmy.warting.se/opensource> *) formdata-polyfill/esm.min.js: (*! formdata-polyfill. MIT License. Jimmy Wรคrting <https://jimmy.warting.se/opensource> *) node-domexception/index.js: (*! node-domexception. MIT License. Jimmy Wรคrting <https://jimmy.warting.se/opensource> *) */ //# sourceMappingURL=lightx-proxy.js.map
๐Ÿ“„ lightx-proxy.js.map
{ "version": 3, "sources": ["../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/data-uri-to-buffer/src/index.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/utils.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/miscellaneous.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/webidl.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/simple-queue.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/internal-methods.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/generic-reader.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/number-isfinite.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/math-trunc.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/basic.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/readable-stream.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/default-reader.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/target/es2018/stub/async-iterator-prototype.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/async-iterator.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/number-isnan.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/ecmascript.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/miscellaneous.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/queue-with-sizes.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/array-buffer-view.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/byte-stream-controller.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/reader-options.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/byob-reader.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/queuing-strategy.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/queuing-strategy.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/underlying-sink.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/writable-stream.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abort-signal.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/writable-stream.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/globals.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/dom-exception.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/pipe.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/default-controller.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/tee.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/readable-stream-like.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/from.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/underlying-source.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/iterator-options.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/pipe-options.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/readable-writable-pair.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/queuing-strategy-init.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/byte-length-queuing-strategy.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/count-queuing-strategy.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/transformer.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/transform-stream.ts", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/streams.cjs", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/index.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/file.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/formdata-polyfill/esm.min.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/base.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/fetch-error.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/is.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-domexception/index.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/from.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/multipart-parser.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/body.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/headers.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/is-redirect.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/response.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/get-search.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/referrer.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/request.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/abort-error.js", "../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/index.js", "../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/lightx-proxy.js"], "sourceRoot": "C:/Users/6732~1/AppData/Local/Temp/tmp-13180-I7XYTRQAtEV7", "sourcesContent": ["export interface MimeBuffer extends Buffer {\n\ttype: string;\n\ttypeFull: string;\n\tcharset: string;\n}\n\n/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @returns {Buffer} Buffer instance from Data URI\n * @api public\n */\nexport function dataUriToBuffer(uri: string): MimeBuffer {\n\tif (!/^data:/i.test(uri)) {\n\t\tthrow new TypeError(\n\t\t\t'`uri` does not appear to be a Data URI (must begin with \"data:\")'\n\t\t);\n\t}\n\n\t// strip newlines\n\turi = uri.replace(/\\r?\\n/g, '');\n\n\t// split the URI up into the \"metadata\" and the \"data\" portions\n\tconst firstComma = uri.indexOf(',');\n\tif (firstComma === -1 || firstComma <= 4) {\n\t\tthrow new TypeError('malformed data: URI');\n\t}\n\n\t// remove the \"data:\" scheme and parse the metadata\n\tconst meta = uri.substring(5, firstComma).split(';');\n\n\tlet charset = '';\n\tlet base64 = false;\n\tconst type = meta[0] || 'text/plain';\n\tlet typeFull = type;\n\tfor (let i = 1; i < meta.length; i++) {\n\t\tif (meta[i] === 'base64') {\n\t\t\tbase64 = true;\n\t\t} else if(meta[i]) {\n\t\t\ttypeFull += `;${ meta[i]}`;\n\t\t\tif (meta[i].indexOf('charset=') === 0) {\n\t\t\t\tcharset = meta[i].substring(8);\n\t\t\t}\n\t\t}\n\t}\n\t// defaults to US-ASCII only if type is not provided\n\tif (!meta[0] && !charset.length) {\n\t\ttypeFull += ';charset=US-ASCII';\n\t\tcharset = 'US-ASCII';\n\t}\n\n\t// get the encoded data portion and decode URI-encoded chars\n\tconst encoding = base64 ? 'base64' : 'ascii';\n\tconst data = unescape(uri.substring(firstComma + 1));\n\tconst buffer = Buffer.from(data, encoding) as MimeBuffer;\n\n\t// set `.type` and `.typeFull` properties to MIME type\n\tbuffer.type = type;\n\tbuffer.typeFull = typeFull;\n\n\t// set the `.charset` property\n\tbuffer.charset = charset;\n\n\treturn buffer;\n}\n\nexport default dataUriToBuffer;\n", "export function noop(): undefined {\n return undefined;\n}\n", "import { noop } from '../../utils';\nimport { AssertionError } from '../../stub/assert';\n\nexport function typeIsObject(x: any): x is object {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n}\n\nexport const rethrowAssertionErrorRejection: (e: any) => void =\n DEBUG ? e => {\n // Used throughout the reference implementation, as `.catch(rethrowAssertionErrorRejection)`, to ensure any errors\n // get shown. There are places in the spec where we do promise transformations and purposefully ignore or don't\n // expect any errors, but assertion errors are always problematic.\n if (e && e instanceof AssertionError) {\n setTimeout(() => {\n throw e;\n }, 0);\n }\n } : noop;\n\nexport function setFunctionName(fn: Function, name: string): void {\n try {\n Object.defineProperty(fn, 'name', {\n value: name,\n configurable: true\n });\n } catch {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n}\n", "import { rethrowAssertionErrorRejection } from './miscellaneous';\nimport assert from '../../stub/assert';\n\nconst originalPromise = Promise;\nconst originalPromiseThen = Promise.prototype.then;\nconst originalPromiseReject = Promise.reject.bind(originalPromise);\n\n// https://webidl.spec.whatwg.org/#a-new-promise\nexport function newPromise<T>(executor: (\n resolve: (value: T | PromiseLike<T>) => void,\n reject: (reason?: any) => void\n) => void): Promise<T> {\n return new originalPromise(executor);\n}\n\n// https://webidl.spec.whatwg.org/#a-promise-resolved-with\nexport function promiseResolvedWith<T>(value: T | PromiseLike<T>): Promise<T> {\n return newPromise(resolve => resolve(value));\n}\n\n// https://webidl.spec.whatwg.org/#a-promise-rejected-with\nexport function promiseRejectedWith<T = never>(reason: any): Promise<T> {\n return originalPromiseReject(reason);\n}\n\nexport function PerformPromiseThen<T, TResult1 = T, TResult2 = never>(\n promise: Promise<T>,\n onFulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>,\n onRejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2> {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected) as Promise<TResult1 | TResult2>;\n}\n\n// Bluebird logs a warning when a promise is created within a fulfillment handler, but then isn't returned\n// from that handler. To prevent this, return null instead of void from all handlers.\n// http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it\nexport function uponPromise<T>(\n promise: Promise<T>,\n onFulfilled?: (value: T) => null | PromiseLike<null>,\n onRejected?: (reason: any) => null | PromiseLike<null>): void {\n PerformPromiseThen(\n PerformPromiseThen(promise, onFulfilled, onRejected),\n undefined,\n rethrowAssertionErrorRejection\n );\n}\n\nexport function uponFulfillment<T>(promise: Promise<T>, onFulfilled: (value: T) => null | PromiseLike<null>): void {\n uponPromise(promise, onFulfilled);\n}\n\nexport function uponRejection(promise: Promise<unknown>, onRejected: (reason: any) => null | PromiseLike<null>): void {\n uponPromise(promise, undefined, onRejected);\n}\n\nexport function transformPromiseWith<T, TResult1 = T, TResult2 = never>(\n promise: Promise<T>,\n fulfillmentHandler?: (value: T) => TResult1 | PromiseLike<TResult1>,\n rejectionHandler?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2> {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n}\n\nexport function setPromiseIsHandledToTrue(promise: Promise<unknown>): void {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n}\n\nlet _queueMicrotask: (callback: () => void) => void = callback => {\n if (typeof queueMicrotask === 'function') {\n _queueMicrotask = queueMicrotask;\n } else {\n const resolvedPromise = promiseResolvedWith(undefined);\n _queueMicrotask = cb => PerformPromiseThen(resolvedPromise, cb);\n }\n return _queueMicrotask(callback);\n};\n\nexport { _queueMicrotask as queueMicrotask };\n\nexport function reflectCall<T, A extends any[], R>(F: (this: T, ...fnArgs: A) => R, V: T, args: A): R {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n}\n\nexport function promiseCall<T, A extends any[], R>(F: (this: T, ...fnArgs: A) => R | PromiseLike<R>,\n V: T,\n args: A): Promise<R> {\n assert(typeof F === 'function');\n assert(V !== undefined);\n assert(Array.isArray(args));\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n } catch (value) {\n return promiseRejectedWith(value);\n }\n}\n", "import assert from '../stub/assert';\n\n// Original from Chromium\n// https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n\nconst QUEUE_MAX_ARRAY_SIZE = 16384;\n\ninterface Node<T> {\n _elements: T[];\n _next: Node<T> | undefined;\n}\n\n/**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\nexport class SimpleQueue<T> {\n private _front: Node<T>;\n private _back: Node<T>;\n private _cursor = 0;\n private _size = 0;\n\n constructor() {\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n\n get length(): number {\n return this._size;\n }\n\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n push(element: T): void {\n const oldBack = this._back;\n let newBack = oldBack;\n assert(oldBack._next === undefined);\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }\n\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n shift(): T {\n assert(this._size > 0); // must not be called on an empty queue\n\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n assert(elements.length === QUEUE_MAX_ARRAY_SIZE);\n assert(oldFront._next !== undefined);\n newFront = oldFront._next!;\n newCursor = 0;\n }\n\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined!;\n\n return element;\n }\n\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n forEach(callback: (element: T) => void): void {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n assert(node._next !== undefined);\n assert(i === QUEUE_MAX_ARRAY_SIZE);\n node = node._next!;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }\n\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n peek(): T {\n assert(this._size > 0); // must not be called on an empty queue\n\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }\n}\n", "export const AbortSteps = Symbol('[[AbortSteps]]');\nexport const ErrorSteps = Symbol('[[ErrorSteps]]');\nexport const CancelSteps = Symbol('[[CancelSteps]]');\nexport const PullSteps = Symbol('[[PullSteps]]');\nexport const ReleaseSteps = Symbol('[[ReleaseSteps]]');\n", "import assert from '../../stub/assert';\nimport { ReadableStream, ReadableStreamCancel, type ReadableStreamReader } from '../readable-stream';\nimport { newPromise, setPromiseIsHandledToTrue } from '../helpers/webidl';\nimport { ReleaseSteps } from '../abstract-ops/internal-methods';\n\nexport function ReadableStreamReaderGenericInitialize<R>(reader: ReadableStreamReader<R>, stream: ReadableStream<R>) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n } else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n } else {\n assert(stream._state === 'errored');\n\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n}\n\n// A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n// check.\n\nexport function ReadableStreamReaderGenericCancel(reader: ReadableStreamReader<any>, reason: any): Promise<undefined> {\n const stream = reader._ownerReadableStream;\n assert(stream !== undefined);\n return ReadableStreamCancel(stream, reason);\n}\n\nexport function ReadableStreamReaderGenericRelease(reader: ReadableStreamReader<any>) {\n const stream = reader._ownerReadableStream;\n assert(stream !== undefined);\n assert(stream._reader === reader);\n\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseReject(\n reader,\n new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n } else {\n defaultReaderClosedPromiseResetToRejected(\n reader,\n new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));\n }\n\n stream._readableStreamController[ReleaseSteps]();\n\n stream._reader = undefined;\n reader._ownerReadableStream = undefined!;\n}\n\n// Helper functions for the readers.\n\nexport function readerLockException(name: string): TypeError {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n}\n\n// Helper functions for the ReadableStreamDefaultReader.\n\nexport function defaultReaderClosedPromiseInitialize(reader: ReadableStreamReader<any>) {\n reader._closedPromise = newPromise((resolve, reject) => {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n}\n\nexport function defaultReaderClosedPromiseInitializeAsRejected(reader: ReadableStreamReader<any>, reason: any) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n}\n\nexport function defaultReaderClosedPromiseInitializeAsResolved(reader: ReadableStreamReader<any>) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n}\n\nexport function defaultReaderClosedPromiseReject(reader: ReadableStreamReader<any>, reason: any) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\n\nexport function defaultReaderClosedPromiseResetToRejected(reader: ReadableStreamReader<any>, reason: any) {\n assert(reader._closedPromise_resolve === undefined);\n assert(reader._closedPromise_reject === undefined);\n\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n}\n\nexport function defaultReaderClosedPromiseResolve(reader: ReadableStreamReader<any>) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\n", "/// <reference lib=\"es2015.core\" />\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\nconst NumberIsFinite: typeof Number.isFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n};\n\nexport default NumberIsFinite;\n", "/// <reference lib=\"es2015.core\" />\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\nconst MathTrunc: typeof Math.trunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n};\n\nexport default MathTrunc;\n", "import NumberIsFinite from '../../stub/number-isfinite';\nimport MathTrunc from '../../stub/math-trunc';\n\n// https://heycam.github.io/webidl/#idl-dictionaries\nexport function isDictionary(x: any): x is object | null {\n return typeof x === 'object' || typeof x === 'function';\n}\n\nexport function assertDictionary(obj: unknown,\n context: string): asserts obj is object | null | undefined {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\n\nexport type AnyFunction = (...args: any[]) => any;\n\n// https://heycam.github.io/webidl/#idl-callback-functions\nexport function assertFunction(x: unknown, context: string): asserts x is AnyFunction {\n if (typeof x !== 'function') {\n throw new TypeError(`${context} is not a function.`);\n }\n}\n\n// https://heycam.github.io/webidl/#idl-object\nexport function isObject(x: any): x is object {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n}\n\nexport function assertObject(x: unknown,\n context: string): asserts x is object {\n if (!isObject(x)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\n\nexport function assertRequiredArgument<T>(x: T | undefined,\n position: number,\n context: string): asserts x is T {\n if (x === undefined) {\n throw new TypeError(`Parameter ${position} is required in '${context}'.`);\n }\n}\n\nexport function assertRequiredField<T>(x: T | undefined,\n field: string,\n context: string): asserts x is T {\n if (x === undefined) {\n throw new TypeError(`${field} is required in '${context}'.`);\n }\n}\n\n// https://heycam.github.io/webidl/#idl-unrestricted-double\nexport function convertUnrestrictedDouble(value: unknown): number {\n return Number(value);\n}\n\nfunction censorNegativeZero(x: number): number {\n return x === 0 ? 0 : x;\n}\n\nfunction integerPart(x: number): number {\n return censorNegativeZero(MathTrunc(x));\n}\n\n// https://heycam.github.io/webidl/#idl-unsigned-long-long\nexport function convertUnsignedLongLongWithEnforceRange(value: unknown, context: string): number {\n const lowerBound = 0;\n const upperBound = Number.MAX_SAFE_INTEGER;\n\n let x = Number(value);\n x = censorNegativeZero(x);\n\n if (!NumberIsFinite(x)) {\n throw new TypeError(`${context} is not a finite number`);\n }\n\n x = integerPart(x);\n\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);\n }\n\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n\n return x;\n}\n", "import { IsReadableStream, ReadableStream } from '../readable-stream';\n\nexport function assertReadableStream(x: unknown, context: string): asserts x is ReadableStream {\n if (!IsReadableStream(x)) {\n throw new TypeError(`${context} is not a ReadableStream.`);\n }\n}\n", "import assert from '../../stub/assert';\nimport { SimpleQueue } from '../simple-queue';\nimport {\n ReadableStreamReaderGenericCancel,\n ReadableStreamReaderGenericInitialize,\n ReadableStreamReaderGenericRelease,\n readerLockException\n} from './generic-reader';\nimport { IsReadableStreamLocked, ReadableStream } from '../readable-stream';\nimport { setFunctionName, typeIsObject } from '../helpers/miscellaneous';\nimport { PullSteps } from '../abstract-ops/internal-methods';\nimport { newPromise, promiseRejectedWith } from '../helpers/webidl';\nimport { assertRequiredArgument } from '../validators/basic';\nimport { assertReadableStream } from '../validators/readable-stream';\n\n/**\n * A result returned by {@link ReadableStreamDefaultReader.read}.\n *\n * @public\n */\nexport type ReadableStreamDefaultReadResult<T> = {\n done: false;\n value: T;\n} | {\n done: true;\n value?: undefined;\n}\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamDefaultReader<R>(stream: ReadableStream): ReadableStreamDefaultReader<R> {\n return new ReadableStreamDefaultReader(stream);\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamAddReadRequest<R>(stream: ReadableStream<R>,\n readRequest: ReadRequest<R>): void {\n assert(IsReadableStreamDefaultReader(stream._reader));\n assert(stream._state === 'readable');\n\n (stream._reader! as ReadableStreamDefaultReader<R>)._readRequests.push(readRequest);\n}\n\nexport function ReadableStreamFulfillReadRequest<R>(stream: ReadableStream<R>, chunk: R | undefined, done: boolean) {\n const reader = stream._reader as ReadableStreamDefaultReader<R>;\n\n assert(reader._readRequests.length > 0);\n\n const readRequest = reader._readRequests.shift()!;\n if (done) {\n readRequest._closeSteps();\n } else {\n readRequest._chunkSteps(chunk!);\n }\n}\n\nexport function ReadableStreamGetNumReadRequests<R>(stream: ReadableStream<R>): number {\n return (stream._reader as ReadableStreamDefaultReader<R>)._readRequests.length;\n}\n\nexport function ReadableStreamHasDefaultReader(stream: ReadableStream): boolean {\n const reader = stream._reader;\n\n if (reader === undefined) {\n return false;\n }\n\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n\n return true;\n}\n\n// Readers\n\nexport interface ReadRequest<R> {\n _chunkSteps(chunk: R): void;\n\n _closeSteps(): void;\n\n _errorSteps(e: any): void;\n}\n\n/**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nexport class ReadableStreamDefaultReader<R = any> {\n /** @internal */\n _ownerReadableStream!: ReadableStream<R>;\n /** @internal */\n _closedPromise!: Promise<undefined>;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) => void;\n /** @internal */\n _closedPromise_reject?: (reason: any) => void;\n /** @internal */\n _readRequests: SimpleQueue<ReadRequest<R>>;\n\n constructor(stream: ReadableStream<R>) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n\n ReadableStreamReaderGenericInitialize(this, stream);\n\n this._readRequests = new SimpleQueue();\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get closed(): Promise<undefined> {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n\n return this._closedPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason: any = undefined): Promise<void> {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read(): Promise<ReadableStreamDefaultReadResult<R>> {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n\n let resolvePromise!: (result: ReadableStreamDefaultReadResult<R>) => void;\n let rejectPromise!: (reason: any) => void;\n const promise = newPromise<ReadableStreamDefaultReadResult<R>>((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest: ReadRequest<R> = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: () => resolvePromise({ value: undefined, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }\n\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock(): void {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n\n if (this._ownerReadableStream === undefined) {\n return;\n }\n\n ReadableStreamDefaultReaderRelease(this);\n }\n}\n\nObject.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nsetFunctionName(ReadableStreamDefaultReader.prototype.cancel, 'cancel');\nsetFunctionName(ReadableStreamDefaultReader.prototype.read, 'read');\nsetFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, 'releaseLock');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n}\n\n// Abstract operations for the readers.\n\nexport function IsReadableStreamDefaultReader<R = any>(x: any): x is ReadableStreamDefaultReader<R> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n\n return x instanceof ReadableStreamDefaultReader;\n}\n\nexport function ReadableStreamDefaultReaderRead<R>(reader: ReadableStreamDefaultReader<R>,\n readRequest: ReadRequest<R>): void {\n const stream = reader._ownerReadableStream;\n\n assert(stream !== undefined);\n\n stream._disturbed = true;\n\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n } else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n } else {\n assert(stream._state === 'readable');\n stream._readableStreamController[PullSteps](readRequest as ReadRequest<any>);\n }\n}\n\nexport function ReadableStreamDefaultReaderRelease(reader: ReadableStreamDefaultReader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n}\n\nexport function ReadableStreamDefaultReaderErrorReadRequests(reader: ReadableStreamDefaultReader, e: any) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._errorSteps(e);\n });\n}\n\n// Helper functions for the ReadableStreamDefaultReader.\n\nfunction defaultReaderBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);\n}\n", "/// <reference lib=\"es2018.asynciterable\" />\n\n/* eslint-disable @typescript-eslint/no-empty-function */\nexport const AsyncIteratorPrototype: AsyncIterable<any> =\n Object.getPrototypeOf(Object.getPrototypeOf(async function* (): AsyncIterableIterator<any> {}).prototype);\n", "/// <reference lib=\"es2018.asynciterable\" />\n\nimport { ReadableStream } from '../readable-stream';\nimport {\n AcquireReadableStreamDefaultReader,\n ReadableStreamDefaultReader,\n ReadableStreamDefaultReaderRead,\n type ReadableStreamDefaultReadResult,\n type ReadRequest\n} from './default-reader';\nimport { ReadableStreamReaderGenericCancel, ReadableStreamReaderGenericRelease } from './generic-reader';\nimport assert from '../../stub/assert';\nimport { AsyncIteratorPrototype } from '@@target/stub/async-iterator-prototype';\nimport { typeIsObject } from '../helpers/miscellaneous';\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n queueMicrotask,\n transformPromiseWith\n} from '../helpers/webidl';\n\n/**\n * An async iterator returned by {@link ReadableStream.values}.\n *\n * @public\n */\nexport interface ReadableStreamAsyncIterator<R> extends AsyncIterableIterator<R> {\n next(): Promise<IteratorResult<R, undefined>>;\n\n return(value?: any): Promise<IteratorResult<any>>;\n}\n\nexport class ReadableStreamAsyncIteratorImpl<R> {\n private readonly _reader: ReadableStreamDefaultReader<R>;\n private readonly _preventCancel: boolean;\n private _ongoingPromise: Promise<ReadableStreamDefaultReadResult<R>> | undefined = undefined;\n private _isFinished = false;\n\n constructor(reader: ReadableStreamDefaultReader<R>, preventCancel: boolean) {\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n\n next(): Promise<ReadableStreamDefaultReadResult<R>> {\n const nextSteps = () => this._nextSteps();\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n }\n\n return(value: any): Promise<ReadableStreamDefaultReadResult<any>> {\n const returnSteps = () => this._returnSteps(value);\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n }\n\n private _nextSteps(): Promise<ReadableStreamDefaultReadResult<R>> {\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n\n const reader = this._reader;\n assert(reader._ownerReadableStream !== undefined);\n\n let resolvePromise!: (result: ReadableStreamDefaultReadResult<R>) => void;\n let rejectPromise!: (reason: any) => void;\n const promise = newPromise<ReadableStreamDefaultReadResult<R>>((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest: ReadRequest<R> = {\n _chunkSteps: chunk => {\n this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n queueMicrotask(() => resolvePromise({ value: chunk, done: false }));\n },\n _closeSteps: () => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: reason => {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n }\n\n private _returnSteps(value: any): Promise<ReadableStreamDefaultReadResult<any>> {\n if (this._isFinished) {\n return Promise.resolve({ value, done: true });\n }\n this._isFinished = true;\n\n const reader = this._reader;\n assert(reader._ownerReadableStream !== undefined);\n assert(reader._readRequests.length === 0);\n\n if (!this._preventCancel) {\n const result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, () => ({ value, done: true }));\n }\n\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value, done: true });\n }\n}\n\ninterface ReadableStreamAsyncIteratorInstance<R> extends ReadableStreamAsyncIterator<R> {\n /** @interal */\n _asyncIteratorImpl: ReadableStreamAsyncIteratorImpl<R>;\n\n next(): Promise<IteratorResult<R, undefined>>;\n\n return(value?: any): Promise<IteratorResult<any>>;\n}\n\nconst ReadableStreamAsyncIteratorPrototype: ReadableStreamAsyncIteratorInstance<any> = {\n next(this: ReadableStreamAsyncIteratorInstance<any>): Promise<ReadableStreamDefaultReadResult<any>> {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n\n return(this: ReadableStreamAsyncIteratorInstance<any>, value: any): Promise<ReadableStreamDefaultReadResult<any>> {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n} as any;\nObject.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamAsyncIterator<R>(stream: ReadableStream<R>,\n preventCancel: boolean): ReadableStreamAsyncIterator<R> {\n const reader = AcquireReadableStreamDefaultReader<R>(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator: ReadableStreamAsyncIteratorInstance<R> = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n}\n\nfunction IsReadableStreamAsyncIterator<R = any>(x: any): x is ReadableStreamAsyncIterator<R> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n\n try {\n // noinspection SuspiciousTypeOfGuard\n return (x as ReadableStreamAsyncIteratorInstance<any>)._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n } catch {\n return false;\n }\n}\n\n// Helper functions for the ReadableStream.\n\nfunction streamAsyncIteratorBrandCheckException(name: string): TypeError {\n return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);\n}\n", "/// <reference lib=\"es2015.core\" />\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\nconst NumberIsNaN: typeof Number.isNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n};\n\nexport default NumberIsNaN;\n", "import { reflectCall } from 'lib/helpers/webidl';\nimport { typeIsObject } from '../helpers/miscellaneous';\nimport assert from '../../stub/assert';\n\ndeclare global {\n interface ArrayBuffer {\n readonly detached: boolean;\n\n transfer(): ArrayBuffer;\n }\n\n function structuredClone<T>(value: T, options: { transfer: ArrayBuffer[] }): T;\n}\n\nexport function CreateArrayFromList<T extends any[]>(elements: T): T {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice() as T;\n}\n\nexport function CopyDataBlockBytes(dest: ArrayBuffer,\n destOffset: number,\n src: ArrayBuffer,\n srcOffset: number,\n n: number) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n}\n\nexport let TransferArrayBuffer = (O: ArrayBuffer): ArrayBuffer => {\n if (typeof O.transfer === 'function') {\n TransferArrayBuffer = buffer => buffer.transfer();\n } else if (typeof structuredClone === 'function') {\n TransferArrayBuffer = buffer => structuredClone(buffer, { transfer: [buffer] });\n } else {\n // Not implemented correctly\n TransferArrayBuffer = buffer => buffer;\n }\n return TransferArrayBuffer(O);\n};\n\nexport function CanTransferArrayBuffer(O: ArrayBuffer): boolean {\n return !IsDetachedBuffer(O);\n}\n\nexport let IsDetachedBuffer = (O: ArrayBuffer): boolean => {\n if (typeof O.detached === 'boolean') {\n IsDetachedBuffer = buffer => buffer.detached;\n } else {\n // Not implemented correctly\n IsDetachedBuffer = buffer => buffer.byteLength === 0;\n }\n return IsDetachedBuffer(O);\n};\n\nexport function ArrayBufferSlice(buffer: ArrayBuffer, begin: number, end: number): ArrayBuffer {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n const length = end - begin;\n const slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n}\n\nexport type MethodName<T> = {\n [P in keyof T]: T[P] extends Function | undefined ? P : never;\n}[keyof T];\n\nexport function GetMethod<T, K extends MethodName<T>>(receiver: T, prop: K): T[K] | undefined {\n const func = receiver[prop];\n if (func === undefined || func === null) {\n return undefined;\n }\n if (typeof func !== 'function') {\n throw new TypeError(`${String(prop)} is not a function`);\n }\n return func;\n}\n\nexport interface SyncIteratorRecord<T> {\n iterator: Iterator<T>,\n nextMethod: Iterator<T>['next'],\n done: boolean;\n}\n\nexport interface AsyncIteratorRecord<T> {\n iterator: AsyncIterator<T>,\n nextMethod: AsyncIterator<T>['next'],\n done: boolean;\n}\n\nexport type SyncOrAsyncIteratorRecord<T> = SyncIteratorRecord<T> | AsyncIteratorRecord<T>;\n\nexport function CreateAsyncFromSyncIterator<T>(syncIteratorRecord: SyncIteratorRecord<T>): AsyncIteratorRecord<T> {\n // Instead of re-implementing CreateAsyncFromSyncIterator and %AsyncFromSyncIteratorPrototype%,\n // we use yield* inside an async generator function to achieve the same result.\n\n // Wrap the sync iterator inside a sync iterable, so we can use it with yield*.\n const syncIterable = {\n [Symbol.iterator]: () => syncIteratorRecord.iterator\n };\n // Create an async generator function and immediately invoke it.\n const asyncIterator = (async function* () {\n return yield* syncIterable;\n }());\n // Return as an async iterator record.\n const nextMethod = asyncIterator.next;\n return { iterator: asyncIterator, nextMethod, done: false };\n}\n\n// Aligns with core-js/modules/es.symbol.async-iterator.js\nexport const SymbolAsyncIterator: (typeof Symbol)['asyncIterator'] =\n Symbol.asyncIterator ??\n Symbol.for?.('Symbol.asyncIterator') ??\n '@@asyncIterator';\n\nexport type SyncOrAsyncIterable<T> = Iterable<T> | AsyncIterable<T>;\nexport type SyncOrAsyncIteratorMethod<T> = () => (Iterator<T> | AsyncIterator<T>);\n\nfunction GetIterator<T>(\n obj: SyncOrAsyncIterable<T>,\n hint: 'async',\n method?: SyncOrAsyncIteratorMethod<T>\n): AsyncIteratorRecord<T>;\nfunction GetIterator<T>(\n obj: Iterable<T>,\n hint: 'sync',\n method?: SyncOrAsyncIteratorMethod<T>\n): SyncIteratorRecord<T>;\nfunction GetIterator<T>(\n obj: SyncOrAsyncIterable<T>,\n hint = 'sync',\n method?: SyncOrAsyncIteratorMethod<T>\n): SyncOrAsyncIteratorRecord<T> {\n assert(hint === 'sync' || hint === 'async');\n if (method === undefined) {\n if (hint === 'async') {\n method = GetMethod(obj as AsyncIterable<T>, SymbolAsyncIterator);\n if (method === undefined) {\n const syncMethod = GetMethod(obj as Iterable<T>, Symbol.iterator);\n const syncIteratorRecord = GetIterator(obj as Iterable<T>, 'sync', syncMethod);\n return CreateAsyncFromSyncIterator(syncIteratorRecord);\n }\n } else {\n method = GetMethod(obj as Iterable<T>, Symbol.iterator);\n }\n }\n if (method === undefined) {\n throw new TypeError('The object is not iterable');\n }\n const iterator = reflectCall(method, obj, []);\n if (!typeIsObject(iterator)) {\n throw new TypeError('The iterator method must return an object');\n }\n const nextMethod = iterator.next;\n return { iterator, nextMethod, done: false } as SyncOrAsyncIteratorRecord<T>;\n}\n\nexport { GetIterator };\n\nexport function IteratorNext<T>(iteratorRecord: AsyncIteratorRecord<T>): Promise<IteratorResult<T>> {\n const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);\n if (!typeIsObject(result)) {\n throw new TypeError('The iterator.next() method must return an object');\n }\n return result;\n}\n\nexport function IteratorComplete<TReturn>(\n iterResult: IteratorResult<unknown, TReturn>\n): iterResult is IteratorReturnResult<TReturn> {\n assert(typeIsObject(iterResult));\n return Boolean(iterResult.done);\n}\n\nexport function IteratorValue<T>(iterResult: IteratorYieldResult<T>): T {\n assert(typeIsObject(iterResult));\n return iterResult.value;\n}\n", "import NumberIsNaN from '../../stub/number-isnan';\nimport { ArrayBufferSlice } from './ecmascript';\nimport type { NonShared } from '../helpers/array-buffer-view';\n\nexport function IsNonNegativeNumber(v: number): boolean {\n if (typeof v !== 'number') {\n return false;\n }\n\n if (NumberIsNaN(v)) {\n return false;\n }\n\n if (v < 0) {\n return false;\n }\n\n return true;\n}\n\nexport function CloneAsUint8Array(O: NonShared<ArrayBufferView>): NonShared<Uint8Array> {\n const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer) as NonShared<Uint8Array>;\n}\n", "import assert from '../../stub/assert';\nimport { SimpleQueue } from '../simple-queue';\nimport { IsNonNegativeNumber } from './miscellaneous';\n\nexport interface QueueContainer<T> {\n _queue: SimpleQueue<T>;\n _queueTotalSize: number;\n}\n\nexport interface QueuePair<T> {\n value: T;\n size: number;\n}\n\nexport function DequeueValue<T>(container: QueueContainer<QueuePair<T>>): T {\n assert('_queue' in container && '_queueTotalSize' in container);\n assert(container._queue.length > 0);\n\n const pair = container._queue.shift()!;\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n\n return pair.value;\n}\n\nexport function EnqueueValueWithSize<T>(container: QueueContainer<QueuePair<T>>, value: T, size: number) {\n assert('_queue' in container && '_queueTotalSize' in container);\n\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n\n container._queue.push({ value, size });\n container._queueTotalSize += size;\n}\n\nexport function PeekQueueValue<T>(container: QueueContainer<QueuePair<T>>): T {\n assert('_queue' in container && '_queueTotalSize' in container);\n assert(container._queue.length > 0);\n\n const pair = container._queue.peek();\n return pair.value;\n}\n\nexport function ResetQueue<T>(container: QueueContainer<T>) {\n assert('_queue' in container && '_queueTotalSize' in container);\n\n container._queue = new SimpleQueue<T>();\n container._queueTotalSize = 0;\n}\n", "export type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport type NonShared<T extends ArrayBufferView> = T & {\n buffer: ArrayBuffer;\n}\n\nexport interface ArrayBufferViewConstructor<T extends ArrayBufferView = ArrayBufferView> {\n new(buffer: ArrayBuffer, byteOffset: number, length?: number): T;\n\n readonly prototype: T;\n}\n\nexport interface TypedArrayConstructor<T extends TypedArray = TypedArray> extends ArrayBufferViewConstructor<T> {\n readonly BYTES_PER_ELEMENT: number;\n}\n\nexport type DataViewConstructor = ArrayBufferViewConstructor<DataView>;\n\nfunction isDataViewConstructor(ctor: Function): ctor is DataViewConstructor {\n return ctor === DataView;\n}\n\nexport function isDataView(view: ArrayBufferView): view is DataView {\n return isDataViewConstructor(view.constructor);\n}\n\nexport function arrayBufferViewElementSize<T extends ArrayBufferView>(ctor: ArrayBufferViewConstructor<T>): number {\n if (isDataViewConstructor(ctor)) {\n return 1;\n }\n return (ctor as unknown as TypedArrayConstructor).BYTES_PER_ELEMENT;\n}\n", "import assert from '../../stub/assert';\nimport { SimpleQueue } from '../simple-queue';\nimport { ResetQueue } from '../abstract-ops/queue-with-sizes';\nimport {\n IsReadableStreamDefaultReader,\n ReadableStreamAddReadRequest,\n ReadableStreamFulfillReadRequest,\n ReadableStreamGetNumReadRequests,\n ReadableStreamHasDefaultReader,\n type ReadRequest\n} from './default-reader';\nimport {\n ReadableStreamAddReadIntoRequest,\n ReadableStreamFulfillReadIntoRequest,\n ReadableStreamGetNumReadIntoRequests,\n ReadableStreamHasBYOBReader,\n type ReadIntoRequest\n} from './byob-reader';\nimport NumberIsInteger from '../../stub/number-isinteger';\nimport {\n IsReadableStreamLocked,\n type ReadableByteStream,\n ReadableStreamClose,\n ReadableStreamError\n} from '../readable-stream';\nimport type { ValidatedUnderlyingByteSource } from './underlying-source';\nimport { setFunctionName, typeIsObject } from '../helpers/miscellaneous';\nimport {\n ArrayBufferSlice,\n CanTransferArrayBuffer,\n CopyDataBlockBytes,\n IsDetachedBuffer,\n TransferArrayBuffer\n} from '../abstract-ops/ecmascript';\nimport { CancelSteps, PullSteps, ReleaseSteps } from '../abstract-ops/internal-methods';\nimport { promiseResolvedWith, uponPromise } from '../helpers/webidl';\nimport { assertRequiredArgument, convertUnsignedLongLongWithEnforceRange } from '../validators/basic';\nimport {\n type ArrayBufferViewConstructor,\n arrayBufferViewElementSize,\n type NonShared,\n type TypedArrayConstructor\n} from '../helpers/array-buffer-view';\n\n/**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\nexport class ReadableStreamBYOBRequest {\n /** @internal */\n _associatedReadableByteStreamController!: ReadableByteStreamController;\n /** @internal */\n _view!: NonShared<ArrayBufferView> | null;\n\n private constructor() {\n throw new TypeError('Illegal constructor');\n }\n\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get view(): ArrayBufferView | null {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n\n return this._view;\n }\n\n /**\n * Indicates to the associated readable byte stream that `bytesWritten` bytes were written into\n * {@link ReadableStreamBYOBRequest.view | view}, causing the result be surfaced to the consumer.\n *\n * After this method is called, {@link ReadableStreamBYOBRequest.view | view} will be transferred and no longer\n * modifiable.\n */\n respond(bytesWritten: number): void;\n respond(bytesWritten: number | undefined): void {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n\n if (IsDetachedBuffer(this._view!.buffer)) {\n throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);\n }\n\n assert(this._view!.byteLength > 0);\n assert(this._view!.buffer.byteLength > 0);\n\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n }\n\n /**\n * Indicates to the associated readable byte stream that instead of writing into\n * {@link ReadableStreamBYOBRequest.view | view}, the underlying byte source is providing a new `ArrayBufferView`,\n * which will be given to the consumer of the readable byte stream.\n *\n * After this method is called, `view` will be transferred and no longer modifiable.\n */\n respondWithNewView(view: ArrayBufferView): void;\n respondWithNewView(view: NonShared<ArrayBufferView>): void {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n\n if (IsDetachedBuffer(view.buffer)) {\n throw new TypeError('The given view\\'s buffer has been detached and so cannot be used as a response');\n }\n\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n }\n}\n\nObject.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n});\nsetFunctionName(ReadableStreamBYOBRequest.prototype.respond, 'respond');\nsetFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, 'respondWithNewView');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n}\n\ninterface ByteQueueElement {\n buffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n}\n\ntype PullIntoDescriptor<T extends NonShared<ArrayBufferView> = NonShared<ArrayBufferView>> =\n DefaultPullIntoDescriptor\n | BYOBPullIntoDescriptor<T>;\n\ninterface DefaultPullIntoDescriptor {\n buffer: ArrayBuffer;\n bufferByteLength: number;\n byteOffset: number;\n byteLength: number;\n bytesFilled: number;\n minimumFill: number;\n elementSize: number;\n viewConstructor: TypedArrayConstructor<Uint8Array>;\n readerType: 'default' | 'none';\n}\n\ninterface BYOBPullIntoDescriptor<T extends NonShared<ArrayBufferView> = NonShared<ArrayBufferView>> {\n buffer: ArrayBuffer;\n bufferByteLength: number;\n byteOffset: number;\n byteLength: number;\n bytesFilled: number;\n minimumFill: number;\n elementSize: number;\n viewConstructor: ArrayBufferViewConstructor<T>;\n readerType: 'byob' | 'none';\n}\n\n/**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\nexport class ReadableByteStreamController {\n /** @internal */\n _controlledReadableByteStream!: ReadableByteStream;\n /** @internal */\n _queue!: SimpleQueue<ByteQueueElement>;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _closeRequested!: boolean;\n /** @internal */\n _pullAgain!: boolean;\n /** @internal */\n _pulling !: boolean;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _pullAlgorithm!: () => Promise<void>;\n /** @internal */\n _cancelAlgorithm!: (reason: any) => Promise<void>;\n /** @internal */\n _autoAllocateChunkSize: number | undefined;\n /** @internal */\n _byobRequest: ReadableStreamBYOBRequest | null;\n /** @internal */\n _pendingPullIntos!: SimpleQueue<PullIntoDescriptor>;\n\n private constructor() {\n throw new TypeError('Illegal constructor');\n }\n\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get byobRequest(): ReadableStreamBYOBRequest | null {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n\n return ReadableByteStreamControllerGetBYOBRequest(this);\n }\n\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize(): number | null {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n\n return ReadableByteStreamControllerGetDesiredSize(this);\n }\n\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close(): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);\n }\n\n ReadableByteStreamControllerClose(this);\n }\n\n /**\n * Enqueues the given chunk chunk in the controlled readable stream.\n * The chunk has to be an `ArrayBufferView` instance, or else a `TypeError` will be thrown.\n */\n enqueue(chunk: ArrayBufferView): void;\n enqueue(chunk: NonShared<ArrayBufferView>): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(`chunk's buffer must have non-zero byteLength`);\n }\n\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n\n const state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);\n }\n\n ReadableByteStreamControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e: any = undefined): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n\n ReadableByteStreamControllerError(this, e);\n }\n\n /** @internal */\n [CancelSteps](reason: any): Promise<void> {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n\n ResetQueue(this);\n\n const result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [PullSteps](readRequest: ReadRequest<NonShared<Uint8Array>>): void {\n const stream = this._controlledReadableByteStream;\n assert(ReadableStreamHasDefaultReader(stream));\n\n if (this._queueTotalSize > 0) {\n assert(ReadableStreamGetNumReadRequests(stream) === 0);\n\n ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);\n return;\n }\n\n const autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n let buffer: ArrayBuffer;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n } catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n\n const pullIntoDescriptor: DefaultPullIntoDescriptor = {\n buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n minimumFill: 1,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n }\n\n /** @internal */\n [ReleaseSteps](): void {\n if (this._pendingPullIntos.length > 0) {\n const firstPullInto = this._pendingPullIntos.peek();\n firstPullInto.readerType = 'none';\n\n this._pendingPullIntos = new SimpleQueue();\n this._pendingPullIntos.push(firstPullInto);\n }\n }\n}\n\nObject.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(ReadableByteStreamController.prototype.close, 'close');\nsetFunctionName(ReadableByteStreamController.prototype.enqueue, 'enqueue');\nsetFunctionName(ReadableByteStreamController.prototype.error, 'error');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n}\n\n// Abstract operations for the ReadableByteStreamController.\n\nexport function IsReadableByteStreamController(x: any): x is ReadableByteStreamController {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n\n return x instanceof ReadableByteStreamController;\n}\n\nfunction IsReadableStreamBYOBRequest(x: any): x is ReadableStreamBYOBRequest {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n\n return x instanceof ReadableStreamBYOBRequest;\n}\n\nfunction ReadableByteStreamControllerCallPullIfNeeded(controller: ReadableByteStreamController): void {\n const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n\n assert(!controller._pullAgain);\n\n controller._pulling = true;\n\n // TODO: Test controller argument\n const pullPromise = controller._pullAlgorithm();\n uponPromise(\n pullPromise,\n () => {\n controller._pulling = false;\n\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n\n return null;\n },\n e => {\n ReadableByteStreamControllerError(controller, e);\n return null;\n }\n );\n}\n\nfunction ReadableByteStreamControllerClearPendingPullIntos(controller: ReadableByteStreamController) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n}\n\nfunction ReadableByteStreamControllerCommitPullIntoDescriptor<T extends NonShared<ArrayBufferView>>(\n stream: ReadableByteStream,\n pullIntoDescriptor: PullIntoDescriptor<T>\n) {\n assert(stream._state !== 'errored');\n assert(pullIntoDescriptor.readerType !== 'none');\n\n let done = false;\n if (stream._state === 'closed') {\n assert(pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize === 0);\n done = true;\n }\n\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor<T>(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView as unknown as NonShared<Uint8Array>, done);\n } else {\n assert(pullIntoDescriptor.readerType === 'byob');\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n}\n\nfunction ReadableByteStreamControllerConvertPullIntoDescriptor<T extends NonShared<ArrayBufferView>>(\n pullIntoDescriptor: PullIntoDescriptor<T>\n): T {\n const bytesFilled = pullIntoDescriptor.bytesFilled;\n const elementSize = pullIntoDescriptor.elementSize;\n\n assert(bytesFilled <= pullIntoDescriptor.byteLength);\n assert(bytesFilled % elementSize === 0);\n\n return new pullIntoDescriptor.viewConstructor(\n pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize) as T;\n}\n\nfunction ReadableByteStreamControllerEnqueueChunkToQueue(controller: ReadableByteStreamController,\n buffer: ArrayBuffer,\n byteOffset: number,\n byteLength: number) {\n controller._queue.push({ buffer, byteOffset, byteLength });\n controller._queueTotalSize += byteLength;\n}\n\nfunction ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller: ReadableByteStreamController,\n buffer: ArrayBuffer,\n byteOffset: number,\n byteLength: number) {\n let clonedChunk;\n try {\n clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);\n } catch (cloneE) {\n ReadableByteStreamControllerError(controller, cloneE);\n throw cloneE;\n }\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);\n}\n\nfunction ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller: ReadableByteStreamController,\n firstDescriptor: PullIntoDescriptor) {\n assert(firstDescriptor.readerType === 'none');\n if (firstDescriptor.bytesFilled > 0) {\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(\n controller,\n firstDescriptor.buffer,\n firstDescriptor.byteOffset,\n firstDescriptor.bytesFilled\n );\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n}\n\nfunction ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller: ReadableByteStreamController,\n pullIntoDescriptor: PullIntoDescriptor) {\n const maxBytesToCopy = Math.min(controller._queueTotalSize,\n pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n\n let totalBytesToCopyRemaining = maxBytesToCopy;\n let ready = false;\n assert(pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill);\n const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;\n const maxAlignedBytes = maxBytesFilled - remainderBytes;\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n\n const queue = controller._queue;\n\n while (totalBytesToCopyRemaining > 0) {\n const headOfQueue = queue.peek();\n\n const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n\n const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n } else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n\n if (!ready) {\n assert(controller._queueTotalSize === 0);\n assert(pullIntoDescriptor.bytesFilled > 0);\n assert(pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill);\n }\n\n return ready;\n}\n\nfunction ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller: ReadableByteStreamController,\n size: number,\n pullIntoDescriptor: PullIntoDescriptor) {\n assert(controller._pendingPullIntos.length === 0 || controller._pendingPullIntos.peek() === pullIntoDescriptor);\n assert(controller._byobRequest === null);\n pullIntoDescriptor.bytesFilled += size;\n}\n\nfunction ReadableByteStreamControllerHandleQueueDrain(controller: ReadableByteStreamController) {\n assert(controller._controlledReadableByteStream._state === 'readable');\n\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n } else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n}\n\nfunction ReadableByteStreamControllerInvalidateBYOBRequest(controller: ReadableByteStreamController) {\n if (controller._byobRequest === null) {\n return;\n }\n\n controller._byobRequest._associatedReadableByteStreamController = undefined!;\n controller._byobRequest._view = null!;\n controller._byobRequest = null;\n}\n\nfunction ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller: ReadableByteStreamController) {\n assert(!controller._closeRequested);\n\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n\n const pullIntoDescriptor = controller._pendingPullIntos.peek();\n assert(pullIntoDescriptor.readerType !== 'none');\n\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n\n ReadableByteStreamControllerCommitPullIntoDescriptor(\n controller._controlledReadableByteStream,\n pullIntoDescriptor\n );\n }\n }\n}\n\nfunction ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller: ReadableByteStreamController) {\n const reader = controller._controlledReadableByteStream._reader;\n assert(IsReadableStreamDefaultReader(reader));\n while (reader._readRequests.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const readRequest = reader._readRequests.shift();\n ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);\n }\n}\n\nexport function ReadableByteStreamControllerPullInto<T extends NonShared<ArrayBufferView>>(\n controller: ReadableByteStreamController,\n view: T,\n min: number,\n readIntoRequest: ReadIntoRequest<T>\n): void {\n const stream = controller._controlledReadableByteStream;\n\n const ctor = view.constructor as ArrayBufferViewConstructor<T>;\n const elementSize = arrayBufferViewElementSize(ctor);\n\n const { byteOffset, byteLength } = view;\n\n const minimumFill = min * elementSize;\n assert(minimumFill >= elementSize && minimumFill <= byteLength);\n assert(minimumFill % elementSize === 0);\n\n let buffer: ArrayBuffer;\n try {\n buffer = TransferArrayBuffer(view.buffer);\n } catch (e) {\n readIntoRequest._errorSteps(e);\n return;\n }\n\n const pullIntoDescriptor: BYOBPullIntoDescriptor<T> = {\n buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset,\n byteLength,\n bytesFilled: 0,\n minimumFill,\n elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n\n if (stream._state === 'closed') {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor<T>(pullIntoDescriptor);\n\n ReadableByteStreamControllerHandleQueueDrain(controller);\n\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n\n if (controller._closeRequested) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n\n controller._pendingPullIntos.push(pullIntoDescriptor);\n\n ReadableStreamAddReadIntoRequest<T>(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nfunction ReadableByteStreamControllerRespondInClosedState(controller: ReadableByteStreamController,\n firstDescriptor: PullIntoDescriptor) {\n assert(firstDescriptor.bytesFilled % firstDescriptor.elementSize === 0);\n\n if (firstDescriptor.readerType === 'none') {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n\n const stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n}\n\nfunction ReadableByteStreamControllerRespondInReadableState(controller: ReadableByteStreamController,\n bytesWritten: number,\n pullIntoDescriptor: PullIntoDescriptor) {\n assert(pullIntoDescriptor.bytesFilled + bytesWritten <= pullIntoDescriptor.byteLength);\n\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n\n if (pullIntoDescriptor.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n return;\n }\n\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n return;\n }\n\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(\n controller,\n pullIntoDescriptor.buffer,\n end - remainderSize,\n remainderSize\n );\n }\n\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n}\n\nfunction ReadableByteStreamControllerRespondInternal(controller: ReadableByteStreamController, bytesWritten: number) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n assert(CanTransferArrayBuffer(firstDescriptor.buffer));\n\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n\n const state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n assert(bytesWritten === 0);\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n } else {\n assert(state === 'readable');\n assert(bytesWritten > 0);\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nfunction ReadableByteStreamControllerShiftPendingPullInto(\n controller: ReadableByteStreamController\n): PullIntoDescriptor {\n assert(controller._byobRequest === null);\n const descriptor = controller._pendingPullIntos.shift()!;\n return descriptor;\n}\n\nfunction ReadableByteStreamControllerShouldCallPull(controller: ReadableByteStreamController): boolean {\n const stream = controller._controlledReadableByteStream;\n\n if (stream._state !== 'readable') {\n return false;\n }\n\n if (controller._closeRequested) {\n return false;\n }\n\n if (!controller._started) {\n return false;\n }\n\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n\n const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n assert(desiredSize !== null);\n if (desiredSize! > 0) {\n return true;\n }\n\n return false;\n}\n\nfunction ReadableByteStreamControllerClearAlgorithms(controller: ReadableByteStreamController) {\n controller._pullAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n}\n\n// A client of ReadableByteStreamController may use these functions directly to bypass state check.\n\nexport function ReadableByteStreamControllerClose(controller: ReadableByteStreamController) {\n const stream = controller._controlledReadableByteStream;\n\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n\n return;\n }\n\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {\n const e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n\n throw e;\n }\n }\n\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n}\n\nexport function ReadableByteStreamControllerEnqueue(\n controller: ReadableByteStreamController,\n chunk: NonShared<ArrayBufferView>\n) {\n const stream = controller._controlledReadableByteStream;\n\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n\n const { buffer, byteOffset, byteLength } = chunk;\n if (IsDetachedBuffer(buffer)) {\n throw new TypeError('chunk\\'s buffer is detached and so cannot be enqueued');\n }\n const transferredBuffer = TransferArrayBuffer(buffer);\n\n if (controller._pendingPullIntos.length > 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) {\n throw new TypeError(\n 'The BYOB request\\'s buffer has been detached and so cannot be filled with an enqueued chunk'\n );\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n if (firstPendingPullInto.readerType === 'none') {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);\n }\n }\n\n if (ReadableStreamHasDefaultReader(stream)) {\n ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n assert(controller._pendingPullIntos.length === 0);\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n } else {\n assert(controller._queue.length === 0);\n if (controller._pendingPullIntos.length > 0) {\n assert(controller._pendingPullIntos.peek().readerType === 'default');\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView as NonShared<Uint8Array>, false);\n }\n } else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n } else {\n assert(!IsReadableStreamLocked(stream));\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nexport function ReadableByteStreamControllerError(controller: ReadableByteStreamController, e: any) {\n const stream = controller._controlledReadableByteStream;\n\n if (stream._state !== 'readable') {\n return;\n }\n\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\n\nexport function ReadableByteStreamControllerFillReadRequestFromQueue(\n controller: ReadableByteStreamController,\n readRequest: ReadRequest<NonShared<Uint8Array>>\n) {\n assert(controller._queueTotalSize > 0);\n\n const entry = controller._queue.shift();\n controller._queueTotalSize -= entry.byteLength;\n\n ReadableByteStreamControllerHandleQueueDrain(controller);\n\n const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view as NonShared<Uint8Array>);\n}\n\nexport function ReadableByteStreamControllerGetBYOBRequest(\n controller: ReadableByteStreamController\n): ReadableStreamBYOBRequest | null {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const view = new Uint8Array(firstDescriptor.buffer,\n firstDescriptor.byteOffset + firstDescriptor.bytesFilled,\n firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n\n const byobRequest: ReadableStreamBYOBRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view as NonShared<Uint8Array>);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n}\n\nfunction ReadableByteStreamControllerGetDesiredSize(controller: ReadableByteStreamController): number | null {\n const state = controller._controlledReadableByteStream._state;\n\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\nexport function ReadableByteStreamControllerRespond(controller: ReadableByteStreamController, bytesWritten: number) {\n assert(controller._pendingPullIntos.length > 0);\n\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n } else {\n assert(state === 'readable');\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n}\n\nexport function ReadableByteStreamControllerRespondWithNewView(controller: ReadableByteStreamController,\n view: NonShared<ArrayBufferView>) {\n assert(controller._pendingPullIntos.length > 0);\n assert(!IsDetachedBuffer(view.buffer));\n\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n } else {\n assert(state === 'readable');\n if (view.byteLength === 0) {\n throw new TypeError(\n 'The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream'\n );\n }\n }\n\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n\n const viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n}\n\nexport function SetUpReadableByteStreamController(stream: ReadableByteStream,\n controller: ReadableByteStreamController,\n startAlgorithm: () => void | PromiseLike<void>,\n pullAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>,\n highWaterMark: number,\n autoAllocateChunkSize: number | undefined) {\n assert(stream._readableStreamController === undefined);\n if (autoAllocateChunkSize !== undefined) {\n assert(NumberIsInteger(autoAllocateChunkSize));\n assert(autoAllocateChunkSize > 0);\n }\n\n controller._controlledReadableByteStream = stream;\n\n controller._pullAgain = false;\n controller._pulling = false;\n\n controller._byobRequest = null;\n\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._closeRequested = false;\n controller._started = false;\n\n controller._strategyHWM = highWaterMark;\n\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n\n controller._pendingPullIntos = new SimpleQueue();\n\n stream._readableStreamController = controller;\n\n const startResult = startAlgorithm();\n uponPromise(\n promiseResolvedWith(startResult),\n () => {\n controller._started = true;\n\n assert(!controller._pulling);\n assert(!controller._pullAgain);\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n return null;\n },\n r => {\n ReadableByteStreamControllerError(controller, r);\n return null;\n }\n );\n}\n\nexport function SetUpReadableByteStreamControllerFromUnderlyingSource(\n stream: ReadableByteStream,\n underlyingByteSource: ValidatedUnderlyingByteSource,\n highWaterMark: number\n) {\n const controller: ReadableByteStreamController = Object.create(ReadableByteStreamController.prototype);\n\n let startAlgorithm: () => void | PromiseLike<void>;\n let pullAlgorithm: () => Promise<void>;\n let cancelAlgorithm: (reason: any) => Promise<void>;\n\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = () => underlyingByteSource.start!(controller);\n } else {\n startAlgorithm = () => undefined;\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = () => underlyingByteSource.pull!(controller);\n } else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingByteSource.cancel!(reason);\n } else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n\n const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n\n SetUpReadableByteStreamController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize\n );\n}\n\nfunction SetUpReadableStreamBYOBRequest(request: ReadableStreamBYOBRequest,\n controller: ReadableByteStreamController,\n view: NonShared<ArrayBufferView>) {\n assert(IsReadableByteStreamController(controller));\n assert(typeof view === 'object');\n assert(ArrayBuffer.isView(view));\n assert(!IsDetachedBuffer(view.buffer));\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n}\n\n// Helper functions for the ReadableStreamBYOBRequest.\n\nfunction byobRequestBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);\n}\n\n// Helper functions for the ReadableByteStreamController.\n\nfunction byteStreamControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);\n}\n", "import { assertDictionary, convertUnsignedLongLongWithEnforceRange } from './basic';\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ReadableStreamGetReaderOptions,\n ValidatedReadableStreamBYOBReaderReadOptions\n} from '../readable-stream/reader-options';\n\nexport function convertReaderOptions(options: ReadableStreamGetReaderOptions | null | undefined,\n context: string): ReadableStreamGetReaderOptions {\n assertDictionary(options, context);\n const mode = options?.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)\n };\n}\n\nfunction convertReadableStreamReaderMode(mode: string, context: string): 'byob' {\n mode = `${mode}`;\n if (mode !== 'byob') {\n throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);\n }\n return mode;\n}\n\nexport function convertByobReadOptions(\n options: ReadableStreamBYOBReaderReadOptions | null | undefined,\n context: string\n): ValidatedReadableStreamBYOBReaderReadOptions {\n assertDictionary(options, context);\n const min = options?.min ?? 1;\n return {\n min: convertUnsignedLongLongWithEnforceRange(\n min,\n `${context} has member 'min' that`\n )\n };\n}\n", "import assert from '../../stub/assert';\nimport { SimpleQueue } from '../simple-queue';\nimport {\n ReadableStreamReaderGenericCancel,\n ReadableStreamReaderGenericInitialize,\n ReadableStreamReaderGenericRelease,\n readerLockException\n} from './generic-reader';\nimport { IsReadableStreamLocked, type ReadableByteStream, type ReadableStream } from '../readable-stream';\nimport {\n IsReadableByteStreamController,\n ReadableByteStreamController,\n ReadableByteStreamControllerPullInto\n} from './byte-stream-controller';\nimport { setFunctionName, typeIsObject } from '../helpers/miscellaneous';\nimport { newPromise, promiseRejectedWith } from '../helpers/webidl';\nimport { assertRequiredArgument } from '../validators/basic';\nimport { assertReadableStream } from '../validators/readable-stream';\nimport { IsDetachedBuffer } from '../abstract-ops/ecmascript';\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ValidatedReadableStreamBYOBReaderReadOptions\n} from './reader-options';\nimport { convertByobReadOptions } from '../validators/reader-options';\nimport { isDataView, type NonShared, type TypedArray } from '../helpers/array-buffer-view';\n\n/**\n * A result returned by {@link ReadableStreamBYOBReader.read}.\n *\n * @public\n */\nexport type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {\n done: false;\n value: T;\n} | {\n done: true;\n value: T | undefined;\n};\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamBYOBReader(stream: ReadableByteStream): ReadableStreamBYOBReader {\n return new ReadableStreamBYOBReader(stream as ReadableStream<Uint8Array>);\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamAddReadIntoRequest<T extends NonShared<ArrayBufferView>>(\n stream: ReadableByteStream,\n readIntoRequest: ReadIntoRequest<T>\n): void {\n assert(IsReadableStreamBYOBReader(stream._reader));\n assert(stream._state === 'readable' || stream._state === 'closed');\n\n (stream._reader! as ReadableStreamBYOBReader)._readIntoRequests.push(readIntoRequest);\n}\n\nexport function ReadableStreamFulfillReadIntoRequest(stream: ReadableByteStream,\n chunk: ArrayBufferView,\n done: boolean) {\n const reader = stream._reader as ReadableStreamBYOBReader;\n\n assert(reader._readIntoRequests.length > 0);\n\n const readIntoRequest = reader._readIntoRequests.shift()!;\n if (done) {\n readIntoRequest._closeSteps(chunk);\n } else {\n readIntoRequest._chunkSteps(chunk);\n }\n}\n\nexport function ReadableStreamGetNumReadIntoRequests(stream: ReadableByteStream): number {\n return (stream._reader as ReadableStreamBYOBReader)._readIntoRequests.length;\n}\n\nexport function ReadableStreamHasBYOBReader(stream: ReadableByteStream): boolean {\n const reader = stream._reader;\n\n if (reader === undefined) {\n return false;\n }\n\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n\n return true;\n}\n\n// Readers\n\nexport interface ReadIntoRequest<T extends NonShared<ArrayBufferView>> {\n _chunkSteps(chunk: T): void;\n\n _closeSteps(chunk: T | undefined): void;\n\n _errorSteps(e: any): void;\n}\n\n/**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nexport class ReadableStreamBYOBReader {\n /** @internal */\n _ownerReadableStream!: ReadableByteStream;\n /** @internal */\n _closedPromise!: Promise<undefined>;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) => void;\n /** @internal */\n _closedPromise_reject?: (reason: any) => void;\n /** @internal */\n _readIntoRequests: SimpleQueue<ReadIntoRequest<any>>;\n\n constructor(stream: ReadableStream<Uint8Array>) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n\n ReadableStreamReaderGenericInitialize(this, stream);\n\n this._readIntoRequests = new SimpleQueue();\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get closed(): Promise<undefined> {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n\n return this._closedPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason: any = undefined): Promise<void> {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n\n /**\n * Attempts to reads bytes into view, and returns a promise resolved with the result.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read<T extends ArrayBufferView>(\n view: T,\n options?: ReadableStreamBYOBReaderReadOptions\n ): Promise<ReadableStreamBYOBReadResult<T>>;\n read<T extends NonShared<ArrayBufferView>>(\n view: T,\n rawOptions: ReadableStreamBYOBReaderReadOptions | null | undefined = {}\n ): Promise<ReadableStreamBYOBReadResult<T>> {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`));\n }\n if (IsDetachedBuffer(view.buffer)) {\n return promiseRejectedWith(new TypeError('view\\'s buffer has been detached'));\n }\n\n let options: ValidatedReadableStreamBYOBReaderReadOptions;\n try {\n options = convertByobReadOptions(rawOptions, 'options');\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const min = options.min;\n if (min === 0) {\n return promiseRejectedWith(new TypeError('options.min must be greater than 0'));\n }\n if (!isDataView(view)) {\n if (min > (view as unknown as TypedArray).length) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s length'));\n }\n } else if (min > view.byteLength) {\n return promiseRejectedWith(new RangeError('options.min must be less than or equal to view\\'s byteLength'));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n\n let resolvePromise!: (result: ReadableStreamBYOBReadResult<T>) => void;\n let rejectPromise!: (reason: any) => void;\n const promise = newPromise<ReadableStreamBYOBReadResult<T>>((resolve, reject) => {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readIntoRequest: ReadIntoRequest<T> = {\n _chunkSteps: chunk => resolvePromise({ value: chunk, done: false }),\n _closeSteps: chunk => resolvePromise({ value: chunk, done: true }),\n _errorSteps: e => rejectPromise(e)\n };\n ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);\n return promise;\n }\n\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock(): void {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n\n if (this._ownerReadableStream === undefined) {\n return;\n }\n\n ReadableStreamBYOBReaderRelease(this);\n }\n}\n\nObject.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nsetFunctionName(ReadableStreamBYOBReader.prototype.cancel, 'cancel');\nsetFunctionName(ReadableStreamBYOBReader.prototype.read, 'read');\nsetFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, 'releaseLock');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n}\n\n// Abstract operations for the readers.\n\nexport function IsReadableStreamBYOBReader(x: any): x is ReadableStreamBYOBReader {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n\n return x instanceof ReadableStreamBYOBReader;\n}\n\nexport function ReadableStreamBYOBReaderRead<T extends NonShared<ArrayBufferView>>(\n reader: ReadableStreamBYOBReader,\n view: T,\n min: number,\n readIntoRequest: ReadIntoRequest<T>\n): void {\n const stream = reader._ownerReadableStream;\n\n assert(stream !== undefined);\n\n stream._disturbed = true;\n\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n } else {\n ReadableByteStreamControllerPullInto(\n stream._readableStreamController as ReadableByteStreamController,\n view,\n min,\n readIntoRequest\n );\n }\n}\n\nexport function ReadableStreamBYOBReaderRelease(reader: ReadableStreamBYOBReader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError('Reader was released');\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n}\n\nexport function ReadableStreamBYOBReaderErrorReadIntoRequests(reader: ReadableStreamBYOBReader, e: any) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._errorSteps(e);\n });\n}\n\n// Helper functions for the ReadableStreamBYOBReader.\n\nfunction byobReaderBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);\n}\n", "import type { QueuingStrategy, QueuingStrategySizeCallback } from '../queuing-strategy';\nimport NumberIsNaN from '../../stub/number-isnan';\n\nexport function ExtractHighWaterMark(strategy: QueuingStrategy, defaultHWM: number): number {\n const { highWaterMark } = strategy;\n\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n\n return highWaterMark;\n}\n\nexport function ExtractSizeAlgorithm<T>(strategy: QueuingStrategy<T>): QueuingStrategySizeCallback<T> {\n const { size } = strategy;\n\n if (!size) {\n return () => 1;\n }\n\n return size;\n}\n", "import type { QueuingStrategy, QueuingStrategySizeCallback } from '../queuing-strategy';\nimport { assertDictionary, assertFunction, convertUnrestrictedDouble } from './basic';\n\nexport function convertQueuingStrategy<T>(init: QueuingStrategy<T> | null | undefined,\n context: string): QueuingStrategy<T> {\n assertDictionary(init, context);\n const highWaterMark = init?.highWaterMark;\n const size = init?.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, `${context} has member 'size' that`)\n };\n}\n\nfunction convertQueuingStrategySize<T>(fn: QueuingStrategySizeCallback<T>,\n context: string): QueuingStrategySizeCallback<T> {\n assertFunction(fn, context);\n return chunk => convertUnrestrictedDouble(fn(chunk));\n}\n", "import { assertDictionary, assertFunction } from './basic';\nimport { promiseCall, reflectCall } from '../helpers/webidl';\nimport type {\n UnderlyingSink,\n UnderlyingSinkAbortCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n ValidatedUnderlyingSink\n} from '../writable-stream/underlying-sink';\nimport { WritableStreamDefaultController } from '../writable-stream';\n\nexport function convertUnderlyingSink<W>(original: UnderlyingSink<W> | null,\n context: string): ValidatedUnderlyingSink<W> {\n assertDictionary(original, context);\n const abort = original?.abort;\n const close = original?.close;\n const start = original?.start;\n const type = original?.type;\n const write = original?.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original!, `${context} has member 'abort' that`),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original!, `${context} has member 'close' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original!, `${context} has member 'start' that`),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original!, `${context} has member 'write' that`),\n type\n };\n}\n\nfunction convertUnderlyingSinkAbortCallback(\n fn: UnderlyingSinkAbortCallback,\n original: UnderlyingSink,\n context: string\n): (reason: any) => Promise<void> {\n assertFunction(fn, context);\n return (reason: any) => promiseCall(fn, original, [reason]);\n}\n\nfunction convertUnderlyingSinkCloseCallback(\n fn: UnderlyingSinkCloseCallback,\n original: UnderlyingSink,\n context: string\n): () => Promise<void> {\n assertFunction(fn, context);\n return () => promiseCall(fn, original, []);\n}\n\nfunction convertUnderlyingSinkStartCallback(\n fn: UnderlyingSinkStartCallback,\n original: UnderlyingSink,\n context: string\n): UnderlyingSinkStartCallback {\n assertFunction(fn, context);\n return (controller: WritableStreamDefaultController) => reflectCall(fn, original, [controller]);\n}\n\nfunction convertUnderlyingSinkWriteCallback<W>(\n fn: UnderlyingSinkWriteCallback<W>,\n original: UnderlyingSink<W>,\n context: string\n): (chunk: W, controller: WritableStreamDefaultController) => Promise<void> {\n assertFunction(fn, context);\n return (chunk: W, controller: WritableStreamDefaultController) => promiseCall(fn, original, [chunk, controller]);\n}\n", "import { IsWritableStream, WritableStream } from '../writable-stream';\n\nexport function assertWritableStream(x: unknown, context: string): asserts x is WritableStream {\n if (!IsWritableStream(x)) {\n throw new TypeError(`${context} is not a WritableStream.`);\n }\n}\n", "/**\n * A signal object that allows you to communicate with a request and abort it if required\n * via its associated `AbortController` object.\n *\n * @remarks\n * This interface is compatible with the `AbortSignal` interface defined in TypeScript's DOM types.\n * It is redefined here, so it can be polyfilled without a DOM, for example with\n * {@link https://www.npmjs.com/package/abortcontroller-polyfill | abortcontroller-polyfill} in a Node environment.\n *\n * @public\n */\nexport interface AbortSignal {\n /**\n * Whether the request is aborted.\n */\n readonly aborted: boolean;\n\n /**\n * If aborted, returns the reason for aborting.\n */\n readonly reason?: any;\n\n /**\n * Add an event listener to be triggered when this signal becomes aborted.\n */\n addEventListener(type: 'abort', listener: () => void): void;\n\n /**\n * Remove an event listener that was previously added with {@link AbortSignal.addEventListener}.\n */\n removeEventListener(type: 'abort', listener: () => void): void;\n}\n\nexport function isAbortSignal(value: unknown): value is AbortSignal {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof (value as AbortSignal).aborted === 'boolean';\n } catch {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n}\n\n/**\n * A controller object that allows you to abort an `AbortSignal` when desired.\n *\n * @remarks\n * This interface is compatible with the `AbortController` interface defined in TypeScript's DOM types.\n * It is redefined here, so it can be polyfilled without a DOM, for example with\n * {@link https://www.npmjs.com/package/abortcontroller-polyfill | abortcontroller-polyfill} in a Node environment.\n *\n * @internal\n */\nexport interface AbortController {\n readonly signal: AbortSignal;\n\n abort(reason?: any): void;\n}\n\ninterface AbortControllerConstructor {\n new(): AbortController;\n}\n\nconst supportsAbortController = typeof (AbortController as any) === 'function';\n\n/**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\nexport function createAbortController(): AbortController | undefined {\n if (supportsAbortController) {\n return new (AbortController as AbortControllerConstructor)();\n }\n return undefined;\n}\n", "import assert from '../stub/assert';\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n uponPromise\n} from './helpers/webidl';\nimport {\n DequeueValue,\n EnqueueValueWithSize,\n PeekQueueValue,\n type QueuePair,\n ResetQueue\n} from './abstract-ops/queue-with-sizes';\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from './queuing-strategy';\nimport { SimpleQueue } from './simple-queue';\nimport { setFunctionName, typeIsObject } from './helpers/miscellaneous';\nimport { AbortSteps, ErrorSteps } from './abstract-ops/internal-methods';\nimport { IsNonNegativeNumber } from './abstract-ops/miscellaneous';\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from './abstract-ops/queuing-strategy';\nimport { convertQueuingStrategy } from './validators/queuing-strategy';\nimport type {\n UnderlyingSink,\n UnderlyingSinkAbortCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n ValidatedUnderlyingSink\n} from './writable-stream/underlying-sink';\nimport { assertObject, assertRequiredArgument } from './validators/basic';\nimport { convertUnderlyingSink } from './validators/underlying-sink';\nimport { assertWritableStream } from './validators/writable-stream';\nimport { type AbortController, type AbortSignal, createAbortController } from './abort-signal';\n\ntype WritableStreamState = 'writable' | 'closed' | 'erroring' | 'errored';\n\ninterface WriteOrCloseRequest {\n _resolve: (value?: undefined) => void;\n _reject: (reason: any) => void;\n}\n\ntype WriteRequest = WriteOrCloseRequest;\ntype CloseRequest = WriteOrCloseRequest;\n\ninterface PendingAbortRequest {\n _promise: Promise<undefined>;\n _resolve: (value?: undefined) => void;\n _reject: (reason: any) => void;\n _reason: any;\n _wasAlreadyErroring: boolean;\n}\n\n/**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\nclass WritableStream<W = any> {\n /** @internal */\n _state!: WritableStreamState;\n /** @internal */\n _storedError: any;\n /** @internal */\n _writer: WritableStreamDefaultWriter<W> | undefined;\n /** @internal */\n _writableStreamController!: WritableStreamDefaultController<W>;\n /** @internal */\n _writeRequests!: SimpleQueue<WriteRequest>;\n /** @internal */\n _inFlightWriteRequest: WriteRequest | undefined;\n /** @internal */\n _closeRequest: CloseRequest | undefined;\n /** @internal */\n _inFlightCloseRequest: CloseRequest | undefined;\n /** @internal */\n _pendingAbortRequest: PendingAbortRequest | undefined;\n /** @internal */\n _backpressure!: boolean;\n\n constructor(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>);\n constructor(rawUnderlyingSink: UnderlyingSink<W> | null | undefined = {},\n rawStrategy: QueuingStrategy<W> | null | undefined = {}) {\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n } else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n\n InitializeWritableStream(this);\n\n const type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get locked(): boolean {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException('locked');\n }\n\n return IsWritableStreamLocked(this);\n }\n\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n abort(reason: any = undefined): Promise<void> {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException('abort'));\n }\n\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n\n return WritableStreamAbort(this, reason);\n }\n\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n close() {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException('close'));\n }\n\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n\n return WritableStreamClose(this);\n }\n\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n getWriter(): WritableStreamDefaultWriter<W> {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException('getWriter');\n }\n\n return AcquireWritableStreamDefaultWriter(this);\n }\n}\n\nObject.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n});\nsetFunctionName(WritableStream.prototype.abort, 'abort');\nsetFunctionName(WritableStream.prototype.close, 'close');\nsetFunctionName(WritableStream.prototype.getWriter, 'getWriter');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n}\n\nexport {\n AcquireWritableStreamDefaultWriter,\n CreateWritableStream,\n IsWritableStream,\n IsWritableStreamLocked,\n WritableStream,\n WritableStreamAbort,\n WritableStreamDefaultControllerErrorIfNeeded,\n WritableStreamDefaultWriterCloseWithErrorPropagation,\n WritableStreamDefaultWriterRelease,\n WritableStreamDefaultWriterWrite,\n WritableStreamCloseQueuedOrInFlight\n};\n\nexport type {\n UnderlyingSink,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkAbortCallback\n};\n\n// Abstract operations for the WritableStream.\n\nfunction AcquireWritableStreamDefaultWriter<W>(stream: WritableStream<W>): WritableStreamDefaultWriter<W> {\n return new WritableStreamDefaultWriter(stream);\n}\n\n// Throws if and only if startAlgorithm throws.\nfunction CreateWritableStream<W>(startAlgorithm: () => void | PromiseLike<void>,\n writeAlgorithm: (chunk: W) => Promise<void>,\n closeAlgorithm: () => Promise<void>,\n abortAlgorithm: (reason: any) => Promise<void>,\n highWaterMark = 1,\n sizeAlgorithm: QueuingStrategySizeCallback<W> = () => 1) {\n assert(IsNonNegativeNumber(highWaterMark));\n\n const stream: WritableStream<W> = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n\n const controller: WritableStreamDefaultController<W> = Object.create(WritableStreamDefaultController.prototype);\n\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm,\n abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n}\n\nfunction InitializeWritableStream<W>(stream: WritableStream<W>) {\n stream._state = 'writable';\n\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n\n stream._writer = undefined;\n\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined!;\n\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n}\n\nfunction IsWritableStream(x: unknown): x is WritableStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n\n return x instanceof WritableStream;\n}\n\nfunction IsWritableStreamLocked(stream: WritableStream): boolean {\n assert(IsWritableStream(stream));\n\n if (stream._writer === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamAbort(stream: WritableStream, reason: any): Promise<undefined> {\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n stream._writableStreamController._abortController?.abort(reason);\n\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n const state = stream._state as WritableStreamState;\n\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n\n assert(state === 'writable' || state === 'erroring');\n\n let wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n\n const promise = newPromise<undefined>((resolve, reject) => {\n stream._pendingAbortRequest = {\n _promise: undefined!,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest!._promise = promise;\n\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n\n return promise;\n}\n\nfunction WritableStreamClose(stream: WritableStream<any>): Promise<undefined> {\n const state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(\n `The stream (in ${state} state) is not in the writable state and cannot be closed`));\n }\n\n assert(state === 'writable' || state === 'erroring');\n assert(!WritableStreamCloseQueuedOrInFlight(stream));\n\n const promise = newPromise<undefined>((resolve, reject) => {\n const closeRequest: CloseRequest = {\n _resolve: resolve,\n _reject: reject\n };\n\n stream._closeRequest = closeRequest;\n });\n\n const writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n\n return promise;\n}\n\n// WritableStream API exposed for controllers.\n\nfunction WritableStreamAddWriteRequest(stream: WritableStream): Promise<undefined> {\n assert(IsWritableStreamLocked(stream));\n assert(stream._state === 'writable');\n\n const promise = newPromise<undefined>((resolve, reject) => {\n const writeRequest: WriteRequest = {\n _resolve: resolve,\n _reject: reject\n };\n\n stream._writeRequests.push(writeRequest);\n });\n\n return promise;\n}\n\nfunction WritableStreamDealWithRejection(stream: WritableStream, error: any) {\n const state = stream._state;\n\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n\n assert(state === 'erroring');\n WritableStreamFinishErroring(stream);\n}\n\nfunction WritableStreamStartErroring(stream: WritableStream, reason: any) {\n assert(stream._storedError === undefined);\n assert(stream._state === 'writable');\n\n const controller = stream._writableStreamController;\n assert(controller !== undefined);\n\n stream._state = 'erroring';\n stream._storedError = reason;\n const writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n}\n\nfunction WritableStreamFinishErroring(stream: WritableStream) {\n assert(stream._state === 'erroring');\n assert(!WritableStreamHasOperationMarkedInFlight(stream));\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n\n const storedError = stream._storedError;\n stream._writeRequests.forEach(writeRequest => {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n\n const abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n\n const promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(\n promise,\n () => {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n },\n (reason: any) => {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n });\n}\n\nfunction WritableStreamFinishInFlightWrite(stream: WritableStream) {\n assert(stream._inFlightWriteRequest !== undefined);\n stream._inFlightWriteRequest!._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n}\n\nfunction WritableStreamFinishInFlightWriteWithError(stream: WritableStream, error: any) {\n assert(stream._inFlightWriteRequest !== undefined);\n stream._inFlightWriteRequest!._reject(error);\n stream._inFlightWriteRequest = undefined;\n\n assert(stream._state === 'writable' || stream._state === 'erroring');\n\n WritableStreamDealWithRejection(stream, error);\n}\n\nfunction WritableStreamFinishInFlightClose(stream: WritableStream) {\n assert(stream._inFlightCloseRequest !== undefined);\n stream._inFlightCloseRequest!._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n\n const state = stream._state;\n\n assert(state === 'writable' || state === 'erroring');\n\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n\n stream._state = 'closed';\n\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n\n assert(stream._pendingAbortRequest === undefined);\n assert(stream._storedError === undefined);\n}\n\nfunction WritableStreamFinishInFlightCloseWithError(stream: WritableStream, error: any) {\n assert(stream._inFlightCloseRequest !== undefined);\n stream._inFlightCloseRequest!._reject(error);\n stream._inFlightCloseRequest = undefined;\n\n assert(stream._state === 'writable' || stream._state === 'erroring');\n\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n}\n\n// TODO(ricea): Fix alphabetical order.\nfunction WritableStreamCloseQueuedOrInFlight(stream: WritableStream): boolean {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamHasOperationMarkedInFlight(stream: WritableStream): boolean {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamMarkCloseRequestInFlight(stream: WritableStream) {\n assert(stream._inFlightCloseRequest === undefined);\n assert(stream._closeRequest !== undefined);\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n}\n\nfunction WritableStreamMarkFirstWriteRequestInFlight(stream: WritableStream) {\n assert(stream._inFlightWriteRequest === undefined);\n assert(stream._writeRequests.length !== 0);\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n}\n\nfunction WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream: WritableStream) {\n assert(stream._state === 'errored');\n if (stream._closeRequest !== undefined) {\n assert(stream._inFlightCloseRequest === undefined);\n\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n}\n\nfunction WritableStreamUpdateBackpressure(stream: WritableStream, backpressure: boolean) {\n assert(stream._state === 'writable');\n assert(!WritableStreamCloseQueuedOrInFlight(stream));\n\n const writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n } else {\n assert(!backpressure);\n\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n\n stream._backpressure = backpressure;\n}\n\n/**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\nexport class WritableStreamDefaultWriter<W = any> {\n /** @internal */\n _ownerWritableStream: WritableStream<W>;\n /** @internal */\n _closedPromise!: Promise<undefined>;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) => void;\n /** @internal */\n _closedPromise_reject?: (reason: any) => void;\n /** @internal */\n _closedPromiseState!: 'pending' | 'resolved' | 'rejected';\n /** @internal */\n _readyPromise!: Promise<undefined>;\n /** @internal */\n _readyPromise_resolve?: (value?: undefined) => void;\n /** @internal */\n _readyPromise_reject?: (reason: any) => void;\n /** @internal */\n _readyPromiseState!: 'pending' | 'fulfilled' | 'rejected';\n\n constructor(stream: WritableStream<W>) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n\n this._ownerWritableStream = stream;\n stream._writer = this;\n\n const state = stream._state;\n\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n } else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n\n defaultWriterClosedPromiseInitialize(this);\n } else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n } else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n } else {\n assert(state === 'errored');\n\n const storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writerโ€™s lock is released before the stream finishes closing.\n */\n get closed(): Promise<undefined> {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n\n return this._closedPromise;\n }\n\n /**\n * Returns the desired size to fill the streamโ€™s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writerโ€™s lock is released.\n */\n get desiredSize(): number | null {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n\n return WritableStreamDefaultWriterGetDesiredSize(this);\n }\n\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the streamโ€™s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writerโ€™s lock is released, the returned promise will become\n * rejected.\n */\n get ready(): Promise<undefined> {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n\n return this._readyPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n abort(reason: any = undefined): Promise<void> {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n\n return WritableStreamDefaultWriterAbort(this, reason);\n }\n\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n close(): Promise<void> {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n\n const stream = this._ownerWritableStream;\n\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n\n return WritableStreamDefaultWriterClose(this);\n }\n\n /**\n * Releases the writerโ€™s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * Itโ€™s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n releaseLock(): void {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n\n const stream = this._ownerWritableStream;\n\n if (stream === undefined) {\n return;\n }\n\n assert(stream._writer !== undefined);\n\n WritableStreamDefaultWriterRelease(this);\n }\n\n /**\n * Writes the given chunk to the writable stream, by waiting until any previous writes have finished successfully,\n * and then sending the chunk to the underlying sink's {@link UnderlyingSink.write | write()} method. It will return\n * a promise that fulfills with undefined upon a successful write, or rejects if the write fails or stream becomes\n * errored before the writing process is initiated.\n *\n * Note that what \"success\" means is up to the underlying sink; it might indicate simply that the chunk has been\n * accepted, and not necessarily that it is safely saved to its ultimate destination.\n */\n write(chunk: W): Promise<void>;\n write(chunk: W = undefined!): Promise<void> {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n\n return WritableStreamDefaultWriterWrite(this, chunk);\n }\n}\n\nObject.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n});\nsetFunctionName(WritableStreamDefaultWriter.prototype.abort, 'abort');\nsetFunctionName(WritableStreamDefaultWriter.prototype.close, 'close');\nsetFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, 'releaseLock');\nsetFunctionName(WritableStreamDefaultWriter.prototype.write, 'write');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n}\n\n// Abstract operations for the WritableStreamDefaultWriter.\n\nfunction IsWritableStreamDefaultWriter<W = any>(x: any): x is WritableStreamDefaultWriter<W> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n\n return x instanceof WritableStreamDefaultWriter;\n}\n\n// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n\nfunction WritableStreamDefaultWriterAbort(writer: WritableStreamDefaultWriter, reason: any) {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n return WritableStreamAbort(stream, reason);\n}\n\nfunction WritableStreamDefaultWriterClose(writer: WritableStreamDefaultWriter): Promise<undefined> {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n return WritableStreamClose(stream);\n}\n\nfunction WritableStreamDefaultWriterCloseWithErrorPropagation(writer: WritableStreamDefaultWriter): Promise<undefined> {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n const state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n\n assert(state === 'writable' || state === 'erroring');\n\n return WritableStreamDefaultWriterClose(writer);\n}\n\nfunction WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer: WritableStreamDefaultWriter, error: any) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n } else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n}\n\nfunction WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer: WritableStreamDefaultWriter, error: any) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n } else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n}\n\nfunction WritableStreamDefaultWriterGetDesiredSize(writer: WritableStreamDefaultWriter): number | null {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n\n if (state === 'closed') {\n return 0;\n }\n\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n}\n\nfunction WritableStreamDefaultWriterRelease(writer: WritableStreamDefaultWriter) {\n const stream = writer._ownerWritableStream;\n assert(stream !== undefined);\n assert(stream._writer === writer);\n\n const releasedError = new TypeError(\n `Writer was released and can no longer be used to monitor the stream's closedness`);\n\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n\n stream._writer = undefined;\n writer._ownerWritableStream = undefined!;\n}\n\nfunction WritableStreamDefaultWriterWrite<W>(writer: WritableStreamDefaultWriter<W>, chunk: W): Promise<undefined> {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n const controller = stream._writableStreamController;\n\n const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n\n const state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n\n assert(state === 'writable');\n\n const promise = WritableStreamAddWriteRequest(stream);\n\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n\n return promise;\n}\n\nconst closeSentinel: unique symbol = {} as any;\n\ntype QueueRecord<W> = W | typeof closeSentinel;\n\n/**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\nexport class WritableStreamDefaultController<W = any> {\n /** @internal */\n _controlledWritableStream!: WritableStream<W>;\n /** @internal */\n _queue!: SimpleQueue<QueuePair<QueueRecord<W>>>;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _abortReason: any;\n /** @internal */\n _abortController: AbortController | undefined;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _strategySizeAlgorithm!: QueuingStrategySizeCallback<W>;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _writeAlgorithm!: (chunk: W) => Promise<void>;\n /** @internal */\n _closeAlgorithm!: () => Promise<void>;\n /** @internal */\n _abortAlgorithm!: (reason: any) => Promise<void>;\n\n private constructor() {\n throw new TypeError('Illegal constructor');\n }\n\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get abortReason(): any {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('abortReason');\n }\n return this._abortReason;\n }\n\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get signal(): AbortSignal {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n }\n\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n error(e: any = undefined): void {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n const state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n\n WritableStreamDefaultControllerError(this, e);\n }\n\n /** @internal */\n [AbortSteps](reason: any): Promise<void> {\n const result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [ErrorSteps]() {\n ResetQueue(this);\n }\n}\n\nObject.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n}\n\n// Abstract operations implementing interface required by the WritableStream.\n\nfunction IsWritableStreamDefaultController(x: any): x is WritableStreamDefaultController<any> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n\n return x instanceof WritableStreamDefaultController;\n}\n\nfunction SetUpWritableStreamDefaultController<W>(stream: WritableStream<W>,\n controller: WritableStreamDefaultController<W>,\n startAlgorithm: () => void | PromiseLike<void>,\n writeAlgorithm: (chunk: W) => Promise<void>,\n closeAlgorithm: () => Promise<void>,\n abortAlgorithm: (reason: any) => Promise<void>,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback<W>) {\n assert(IsWritableStream(stream));\n assert(stream._writableStreamController === undefined);\n\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined!;\n controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n\n const startResult = startAlgorithm();\n const startPromise = promiseResolvedWith(startResult);\n uponPromise(\n startPromise,\n () => {\n assert(stream._state === 'writable' || stream._state === 'erroring');\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n },\n r => {\n assert(stream._state === 'writable' || stream._state === 'erroring');\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n return null;\n }\n );\n}\n\nfunction SetUpWritableStreamDefaultControllerFromUnderlyingSink<W>(stream: WritableStream<W>,\n underlyingSink: ValidatedUnderlyingSink<W>,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback<W>) {\n const controller = Object.create(WritableStreamDefaultController.prototype);\n\n let startAlgorithm: () => void | PromiseLike<void>;\n let writeAlgorithm: (chunk: W) => Promise<void>;\n let closeAlgorithm: () => Promise<void>;\n let abortAlgorithm: (reason: any) => Promise<void>;\n\n if (underlyingSink.start !== undefined) {\n startAlgorithm = () => underlyingSink.start!(controller);\n } else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = chunk => underlyingSink.write!(chunk, controller);\n } else {\n writeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = () => underlyingSink.close!();\n } else {\n closeAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = reason => underlyingSink.abort!(reason);\n } else {\n abortAlgorithm = () => promiseResolvedWith(undefined);\n }\n\n SetUpWritableStreamDefaultController(\n stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm\n );\n}\n\n// ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\nfunction WritableStreamDefaultControllerClearAlgorithms(controller: WritableStreamDefaultController<any>) {\n controller._writeAlgorithm = undefined!;\n controller._closeAlgorithm = undefined!;\n controller._abortAlgorithm = undefined!;\n controller._strategySizeAlgorithm = undefined!;\n}\n\nfunction WritableStreamDefaultControllerClose<W>(controller: WritableStreamDefaultController<W>) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\n\nfunction WritableStreamDefaultControllerGetChunkSize<W>(controller: WritableStreamDefaultController<W>,\n chunk: W): number {\n try {\n return controller._strategySizeAlgorithm(chunk);\n } catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n}\n\nfunction WritableStreamDefaultControllerGetDesiredSize(controller: WritableStreamDefaultController<any>): number {\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\nfunction WritableStreamDefaultControllerWrite<W>(controller: WritableStreamDefaultController<W>,\n chunk: W,\n chunkSize: number) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n } catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n\n const stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\n\n// Abstract operations for the WritableStreamDefaultController.\n\nfunction WritableStreamDefaultControllerAdvanceQueueIfNeeded<W>(controller: WritableStreamDefaultController<W>) {\n const stream = controller._controlledWritableStream;\n\n if (!controller._started) {\n return;\n }\n\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n\n const state = stream._state;\n assert(state !== 'closed' && state !== 'errored');\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n\n if (controller._queue.length === 0) {\n return;\n }\n\n const value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n } else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n}\n\nfunction WritableStreamDefaultControllerErrorIfNeeded(controller: WritableStreamDefaultController<any>, error: any) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n}\n\nfunction WritableStreamDefaultControllerProcessClose(controller: WritableStreamDefaultController<any>) {\n const stream = controller._controlledWritableStream;\n\n WritableStreamMarkCloseRequestInFlight(stream);\n\n DequeueValue(controller);\n assert(controller._queue.length === 0);\n\n const sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(\n sinkClosePromise,\n () => {\n WritableStreamFinishInFlightClose(stream);\n return null;\n },\n reason => {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n return null;\n }\n );\n}\n\nfunction WritableStreamDefaultControllerProcessWrite<W>(controller: WritableStreamDefaultController<W>, chunk: W) {\n const stream = controller._controlledWritableStream;\n\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n\n const sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(\n sinkWritePromise,\n () => {\n WritableStreamFinishInFlightWrite(stream);\n\n const state = stream._state;\n assert(state === 'writable' || state === 'erroring');\n\n DequeueValue(controller);\n\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n },\n reason => {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n return null;\n }\n );\n}\n\nfunction WritableStreamDefaultControllerGetBackpressure(controller: WritableStreamDefaultController<any>): boolean {\n const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n}\n\n// A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n\nfunction WritableStreamDefaultControllerError(controller: WritableStreamDefaultController<any>, error: any) {\n const stream = controller._controlledWritableStream;\n\n assert(stream._state === 'writable');\n\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n}\n\n// Helper functions for the WritableStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);\n}\n\n// Helper functions for the WritableStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);\n}\n\n\n// Helper functions for the WritableStreamDefaultWriter.\n\nfunction defaultWriterBrandCheckException(name: string): TypeError {\n return new TypeError(\n `WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);\n}\n\nfunction defaultWriterLockException(name: string): TypeError {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n}\n\nfunction defaultWriterClosedPromiseInitialize(writer: WritableStreamDefaultWriter) {\n writer._closedPromise = newPromise((resolve, reject) => {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n}\n\nfunction defaultWriterClosedPromiseInitializeAsRejected(writer: WritableStreamDefaultWriter, reason: any) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n}\n\nfunction defaultWriterClosedPromiseInitializeAsResolved(writer: WritableStreamDefaultWriter) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n}\n\nfunction defaultWriterClosedPromiseReject(writer: WritableStreamDefaultWriter, reason: any) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n assert(writer._closedPromiseState === 'pending');\n\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n}\n\nfunction defaultWriterClosedPromiseResetToRejected(writer: WritableStreamDefaultWriter, reason: any) {\n assert(writer._closedPromise_resolve === undefined);\n assert(writer._closedPromise_reject === undefined);\n assert(writer._closedPromiseState !== 'pending');\n\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n}\n\nfunction defaultWriterClosedPromiseResolve(writer: WritableStreamDefaultWriter) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n assert(writer._closedPromiseState === 'pending');\n\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n}\n\nfunction defaultWriterReadyPromiseInitialize(writer: WritableStreamDefaultWriter) {\n writer._readyPromise = newPromise((resolve, reject) => {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n}\n\nfunction defaultWriterReadyPromiseInitializeAsRejected(writer: WritableStreamDefaultWriter, reason: any) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n}\n\nfunction defaultWriterReadyPromiseInitializeAsResolved(writer: WritableStreamDefaultWriter) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n}\n\nfunction defaultWriterReadyPromiseReject(writer: WritableStreamDefaultWriter, reason: any) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n}\n\nfunction defaultWriterReadyPromiseReset(writer: WritableStreamDefaultWriter) {\n assert(writer._readyPromise_resolve === undefined);\n assert(writer._readyPromise_reject === undefined);\n\n defaultWriterReadyPromiseInitialize(writer);\n}\n\nfunction defaultWriterReadyPromiseResetToRejected(writer: WritableStreamDefaultWriter, reason: any) {\n assert(writer._readyPromise_resolve === undefined);\n assert(writer._readyPromise_reject === undefined);\n\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n}\n\nfunction defaultWriterReadyPromiseResolve(writer: WritableStreamDefaultWriter) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n}\n", "/// <reference lib=\"dom\" />\n\nfunction getGlobals(): typeof globalThis | undefined {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n } else if (typeof self !== 'undefined') {\n return self;\n } else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n}\n\nexport const globals = getGlobals();\n", "/// <reference types=\"node\" />\nimport { globals } from '../globals';\nimport { setFunctionName } from '../lib/helpers/miscellaneous';\n\ninterface DOMException extends Error {\n name: string;\n message: string;\n}\n\ntype DOMExceptionConstructor = new (message?: string, name?: string) => DOMException;\n\nfunction isDOMExceptionConstructor(ctor: unknown): ctor is DOMExceptionConstructor {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n if ((ctor as DOMExceptionConstructor).name !== 'DOMException') {\n return false;\n }\n try {\n new (ctor as DOMExceptionConstructor)();\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Support:\n * - Web browsers\n * - Node 18 and higher (https://github.com/nodejs/node/commit/e4b1fb5e6422c1ff151234bb9de792d45dd88d87)\n */\nfunction getFromGlobal(): DOMExceptionConstructor | undefined {\n const ctor = globals?.DOMException;\n return isDOMExceptionConstructor(ctor) ? ctor : undefined;\n}\n\n/**\n * Support:\n * - All platforms\n */\nfunction createPolyfill(): DOMExceptionConstructor {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const ctor = function DOMException(this: DOMException, message?: string, name?: string) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n } as any;\n setFunctionName(ctor, 'DOMException');\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nconst DOMException: DOMExceptionConstructor = getFromGlobal() || createPolyfill();\n\nexport { DOMException };\n", "import { IsReadableStream, IsReadableStreamLocked, ReadableStream, ReadableStreamCancel } from '../readable-stream';\nimport { AcquireReadableStreamDefaultReader, ReadableStreamDefaultReaderRead } from './default-reader';\nimport { ReadableStreamReaderGenericRelease } from './generic-reader';\nimport {\n AcquireWritableStreamDefaultWriter,\n IsWritableStream,\n IsWritableStreamLocked,\n WritableStream,\n WritableStreamAbort,\n WritableStreamCloseQueuedOrInFlight,\n WritableStreamDefaultWriterCloseWithErrorPropagation,\n WritableStreamDefaultWriterRelease,\n WritableStreamDefaultWriterWrite\n} from '../writable-stream';\nimport assert from '../../stub/assert';\nimport {\n newPromise,\n PerformPromiseThen,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n uponFulfillment,\n uponPromise,\n uponRejection\n} from '../helpers/webidl';\nimport { noop } from '../../utils';\nimport { type AbortSignal, isAbortSignal } from '../abort-signal';\nimport { DOMException } from '../../stub/dom-exception';\n\nexport function ReadableStreamPipeTo<T>(source: ReadableStream<T>,\n dest: WritableStream<T>,\n preventClose: boolean,\n preventAbort: boolean,\n preventCancel: boolean,\n signal: AbortSignal | undefined): Promise<undefined> {\n assert(IsReadableStream(source));\n assert(IsWritableStream(dest));\n assert(typeof preventClose === 'boolean');\n assert(typeof preventAbort === 'boolean');\n assert(typeof preventCancel === 'boolean');\n assert(signal === undefined || isAbortSignal(signal));\n assert(!IsReadableStreamLocked(source));\n assert(!IsWritableStreamLocked(dest));\n\n const reader = AcquireReadableStreamDefaultReader<T>(source);\n const writer = AcquireWritableStreamDefaultWriter<T>(dest);\n\n source._disturbed = true;\n\n let shuttingDown = false;\n\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n let currentWrite = promiseResolvedWith<void>(undefined);\n\n return newPromise((resolve, reject) => {\n let abortAlgorithm: () => void;\n if (signal !== undefined) {\n abortAlgorithm = () => {\n const error = signal.reason !== undefined ? signal.reason : new DOMException('Aborted', 'AbortError');\n const actions: Array<() => Promise<void>> = [];\n if (!preventAbort) {\n actions.push(() => {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(() => {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(() => Promise.all(actions.map(action => action())), true, error);\n };\n\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n\n signal.addEventListener('abort', abortAlgorithm);\n }\n\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise<void>((resolveLoop, rejectLoop) => {\n function next(done: boolean) {\n if (done) {\n resolveLoop();\n } else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n\n next(false);\n });\n }\n\n function pipeStep(): Promise<boolean> {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n\n return PerformPromiseThen(writer._readyPromise, () => {\n return newPromise<boolean>((resolveRead, rejectRead) => {\n ReadableStreamDefaultReaderRead(\n reader,\n {\n _chunkSteps: chunk => {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: () => resolveRead(true),\n _errorSteps: rejectRead\n }\n );\n });\n });\n }\n\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, storedError => {\n if (!preventAbort) {\n shutdownWithAction(() => WritableStreamAbort(dest, storedError), true, storedError);\n } else {\n shutdown(true, storedError);\n }\n return null;\n });\n\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, storedError => {\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, storedError), true, storedError);\n } else {\n shutdown(true, storedError);\n }\n return null;\n });\n\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, () => {\n if (!preventClose) {\n shutdownWithAction(() => WritableStreamDefaultWriterCloseWithErrorPropagation(writer));\n } else {\n shutdown();\n }\n return null;\n });\n\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n const destClosed = new TypeError('the destination writable stream closed before all data could be piped to it');\n\n if (!preventCancel) {\n shutdownWithAction(() => ReadableStreamCancel(source, destClosed), true, destClosed);\n } else {\n shutdown(true, destClosed);\n }\n }\n\n setPromiseIsHandledToTrue(pipeLoop());\n\n function waitForWritesToFinish(): Promise<void> {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n const oldCurrentWrite = currentWrite;\n return PerformPromiseThen(\n currentWrite,\n () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined\n );\n }\n\n function isOrBecomesErrored(stream: ReadableStream | WritableStream,\n promise: Promise<void>,\n action: (reason: any) => null) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n } else {\n uponRejection(promise, action);\n }\n }\n\n function isOrBecomesClosed(stream: ReadableStream | WritableStream, promise: Promise<void>, action: () => null) {\n if (stream._state === 'closed') {\n action();\n } else {\n uponFulfillment(promise, action);\n }\n }\n\n function shutdownWithAction(action: () => Promise<unknown>, originalIsError?: boolean, originalError?: any) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n } else {\n doTheRest();\n }\n\n function doTheRest(): null {\n uponPromise(\n action(),\n () => finalize(originalIsError, originalError),\n newError => finalize(true, newError)\n );\n return null;\n }\n }\n\n function shutdown(isError?: boolean, error?: any) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), () => finalize(isError, error));\n } else {\n finalize(isError, error);\n }\n }\n\n function finalize(isError?: boolean, error?: any): null {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n } else {\n resolve(undefined);\n }\n\n return null;\n }\n });\n}\n", "import type { QueuingStrategySizeCallback } from '../queuing-strategy';\nimport assert from '../../stub/assert';\nimport { DequeueValue, EnqueueValueWithSize, type QueuePair, ResetQueue } from '../abstract-ops/queue-with-sizes';\nimport {\n ReadableStreamAddReadRequest,\n ReadableStreamFulfillReadRequest,\n ReadableStreamGetNumReadRequests,\n type ReadRequest\n} from './default-reader';\nimport { SimpleQueue } from '../simple-queue';\nimport { IsReadableStreamLocked, ReadableStream, ReadableStreamClose, ReadableStreamError } from '../readable-stream';\nimport type { ValidatedUnderlyingSource } from './underlying-source';\nimport { setFunctionName, typeIsObject } from '../helpers/miscellaneous';\nimport { CancelSteps, PullSteps, ReleaseSteps } from '../abstract-ops/internal-methods';\nimport { promiseResolvedWith, uponPromise } from '../helpers/webidl';\n\n/**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\nexport class ReadableStreamDefaultController<R> {\n /** @internal */\n _controlledReadableStream!: ReadableStream<R>;\n /** @internal */\n _queue!: SimpleQueue<QueuePair<R>>;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _closeRequested!: boolean;\n /** @internal */\n _pullAgain!: boolean;\n /** @internal */\n _pulling !: boolean;\n /** @internal */\n _strategySizeAlgorithm!: QueuingStrategySizeCallback<R>;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _pullAlgorithm!: () => Promise<void>;\n /** @internal */\n _cancelAlgorithm!: (reason: any) => Promise<void>;\n\n private constructor() {\n throw new TypeError('Illegal constructor');\n }\n\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize(): number | null {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n }\n\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close(): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('close');\n }\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n\n ReadableStreamDefaultControllerClose(this);\n }\n\n /**\n * Enqueues the given chunk `chunk` in the controlled readable stream.\n */\n enqueue(chunk: R): void;\n enqueue(chunk: R = undefined!): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e: any = undefined): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n\n ReadableStreamDefaultControllerError(this, e);\n }\n\n /** @internal */\n [CancelSteps](reason: any): Promise<void> {\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [PullSteps](readRequest: ReadRequest<R>): void {\n const stream = this._controlledReadableStream;\n\n if (this._queue.length > 0) {\n const chunk = DequeueValue(this);\n\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n } else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n\n readRequest._chunkSteps(chunk);\n } else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n }\n\n /** @internal */\n [ReleaseSteps](): void {\n // Do nothing.\n }\n}\n\nObject.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(ReadableStreamDefaultController.prototype.close, 'close');\nsetFunctionName(ReadableStreamDefaultController.prototype.enqueue, 'enqueue');\nsetFunctionName(ReadableStreamDefaultController.prototype.error, 'error');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n}\n\n// Abstract operations for the ReadableStreamDefaultController.\n\nfunction IsReadableStreamDefaultController<R = any>(x: any): x is ReadableStreamDefaultController<R> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n\n return x instanceof ReadableStreamDefaultController;\n}\n\nfunction ReadableStreamDefaultControllerCallPullIfNeeded(controller: ReadableStreamDefaultController<any>): void {\n const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n\n assert(!controller._pullAgain);\n\n controller._pulling = true;\n\n const pullPromise = controller._pullAlgorithm();\n uponPromise(\n pullPromise,\n () => {\n controller._pulling = false;\n\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n\n return null;\n },\n e => {\n ReadableStreamDefaultControllerError(controller, e);\n return null;\n }\n );\n}\n\nfunction ReadableStreamDefaultControllerShouldCallPull(controller: ReadableStreamDefaultController<any>): boolean {\n const stream = controller._controlledReadableStream;\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n\n if (!controller._started) {\n return false;\n }\n\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n\n const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n assert(desiredSize !== null);\n if (desiredSize! > 0) {\n return true;\n }\n\n return false;\n}\n\nfunction ReadableStreamDefaultControllerClearAlgorithms(controller: ReadableStreamDefaultController<any>) {\n controller._pullAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n controller._strategySizeAlgorithm = undefined!;\n}\n\n// A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n\nexport function ReadableStreamDefaultControllerClose(controller: ReadableStreamDefaultController<any>) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n\n const stream = controller._controlledReadableStream;\n\n controller._closeRequested = true;\n\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n}\n\nexport function ReadableStreamDefaultControllerEnqueue<R>(\n controller: ReadableStreamDefaultController<R>,\n chunk: R\n): void {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n\n const stream = controller._controlledReadableStream;\n\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n } else {\n let chunkSize;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n } catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n } catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n}\n\nexport function ReadableStreamDefaultControllerError(controller: ReadableStreamDefaultController<any>, e: any) {\n const stream = controller._controlledReadableStream;\n\n if (stream._state !== 'readable') {\n return;\n }\n\n ResetQueue(controller);\n\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\n\nexport function ReadableStreamDefaultControllerGetDesiredSize(\n controller: ReadableStreamDefaultController<any>\n): number | null {\n const state = controller._controlledReadableStream._state;\n\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\n// This is used in the implementation of TransformStream.\nexport function ReadableStreamDefaultControllerHasBackpressure(\n controller: ReadableStreamDefaultController<any>\n): boolean {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n\n return true;\n}\n\nexport function ReadableStreamDefaultControllerCanCloseOrEnqueue(\n controller: ReadableStreamDefaultController<any>\n): boolean {\n const state = controller._controlledReadableStream._state;\n\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n\n return false;\n}\n\nexport function SetUpReadableStreamDefaultController<R>(stream: ReadableStream<R>,\n controller: ReadableStreamDefaultController<R>,\n startAlgorithm: () => void | PromiseLike<void>,\n pullAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback<R>) {\n assert(stream._readableStreamController === undefined);\n\n controller._controlledReadableStream = stream;\n\n controller._queue = undefined!;\n controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n stream._readableStreamController = controller;\n\n const startResult = startAlgorithm();\n uponPromise(\n promiseResolvedWith(startResult),\n () => {\n controller._started = true;\n\n assert(!controller._pulling);\n assert(!controller._pullAgain);\n\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n return null;\n },\n r => {\n ReadableStreamDefaultControllerError(controller, r);\n return null;\n }\n );\n}\n\nexport function SetUpReadableStreamDefaultControllerFromUnderlyingSource<R>(\n stream: ReadableStream<R>,\n underlyingSource: ValidatedUnderlyingSource<R>,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback<R>\n) {\n const controller: ReadableStreamDefaultController<R> = Object.create(ReadableStreamDefaultController.prototype);\n\n let startAlgorithm: () => void | PromiseLike<void>;\n let pullAlgorithm: () => Promise<void>;\n let cancelAlgorithm: (reason: any) => Promise<void>;\n\n if (underlyingSource.start !== undefined) {\n startAlgorithm = () => underlyingSource.start!(controller);\n } else {\n startAlgorithm = () => undefined;\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = () => underlyingSource.pull!(controller);\n } else {\n pullAlgorithm = () => promiseResolvedWith(undefined);\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = reason => underlyingSource.cancel!(reason);\n } else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n\n SetUpReadableStreamDefaultController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm\n );\n}\n\n// Helper functions for the ReadableStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);\n}\n", "import {\n CreateReadableByteStream,\n CreateReadableStream,\n type DefaultReadableStream,\n IsReadableStream,\n type ReadableByteStream,\n ReadableStream,\n ReadableStreamCancel,\n type ReadableStreamReader\n} from '../readable-stream';\nimport { ReadableStreamReaderGenericRelease } from './generic-reader';\nimport {\n AcquireReadableStreamDefaultReader,\n IsReadableStreamDefaultReader,\n ReadableStreamDefaultReaderRead,\n type ReadRequest\n} from './default-reader';\nimport {\n AcquireReadableStreamBYOBReader,\n IsReadableStreamBYOBReader,\n ReadableStreamBYOBReaderRead,\n type ReadIntoRequest\n} from './byob-reader';\nimport assert from '../../stub/assert';\nimport { newPromise, promiseResolvedWith, queueMicrotask, uponRejection } from '../helpers/webidl';\nimport {\n ReadableStreamDefaultControllerClose,\n ReadableStreamDefaultControllerEnqueue,\n ReadableStreamDefaultControllerError\n} from './default-controller';\nimport {\n IsReadableByteStreamController,\n ReadableByteStreamControllerClose,\n ReadableByteStreamControllerEnqueue,\n ReadableByteStreamControllerError,\n ReadableByteStreamControllerGetBYOBRequest,\n ReadableByteStreamControllerRespond,\n ReadableByteStreamControllerRespondWithNewView\n} from './byte-stream-controller';\nimport { CreateArrayFromList } from '../abstract-ops/ecmascript';\nimport { CloneAsUint8Array } from '../abstract-ops/miscellaneous';\nimport type { NonShared } from '../helpers/array-buffer-view';\n\nexport function ReadableStreamTee<R>(stream: ReadableStream<R>,\n cloneForBranch2: boolean): [ReadableStream<R>, ReadableStream<R>] {\n assert(IsReadableStream(stream));\n assert(typeof cloneForBranch2 === 'boolean');\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream as unknown as ReadableByteStream) as\n unknown as [ReadableStream<R>, ReadableStream<R>];\n }\n return ReadableStreamDefaultTee(stream, cloneForBranch2);\n}\n\nexport function ReadableStreamDefaultTee<R>(\n stream: ReadableStream<R>,\n cloneForBranch2: boolean\n): [DefaultReadableStream<R>, DefaultReadableStream<R>] {\n assert(IsReadableStream(stream));\n assert(typeof cloneForBranch2 === 'boolean');\n\n const reader = AcquireReadableStreamDefaultReader<R>(stream);\n\n let reading = false;\n let readAgain = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1: any;\n let reason2: any;\n let branch1: DefaultReadableStream<R>;\n let branch2: DefaultReadableStream<R>;\n\n let resolveCancelPromise: (value: undefined | Promise<undefined>) => void;\n const cancelPromise = newPromise<undefined>(resolve => {\n resolveCancelPromise = resolve;\n });\n\n function pullAlgorithm(): Promise<void> {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const readRequest: ReadRequest<R> = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() => {\n readAgain = false;\n const chunk1 = chunk;\n const chunk2 = chunk;\n\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n\n return promiseResolvedWith(undefined);\n }\n\n function cancel1Algorithm(reason: any): Promise<void> {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function cancel2Algorithm(reason: any): Promise<void> {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function startAlgorithm() {\n // do nothing\n }\n\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n\n uponRejection(reader._closedPromise, (r: any) => {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n\n return [branch1, branch2];\n}\n\nexport function ReadableByteStreamTee(stream: ReadableByteStream): [ReadableByteStream, ReadableByteStream] {\n assert(IsReadableStream(stream));\n assert(IsReadableByteStreamController(stream._readableStreamController));\n\n let reader: ReadableStreamReader<NonShared<Uint8Array>> = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgainForBranch1 = false;\n let readAgainForBranch2 = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1: any;\n let reason2: any;\n let branch1: ReadableByteStream;\n let branch2: ReadableByteStream;\n\n let resolveCancelPromise: (value: undefined | Promise<undefined>) => void;\n const cancelPromise = newPromise<void>(resolve => {\n resolveCancelPromise = resolve;\n });\n\n function forwardReaderError(thisReader: ReadableStreamReader<NonShared<Uint8Array>>) {\n uponRejection(thisReader._closedPromise, r => {\n if (thisReader !== reader) {\n return null;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n }\n\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n assert(reader._readIntoRequests.length === 0);\n ReadableStreamReaderGenericRelease(reader);\n\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n\n const readRequest: ReadRequest<NonShared<Uint8Array>> = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n\n const chunk1 = chunk;\n let chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n } catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n } else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: () => {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n\n function pullWithBYOBReader(view: NonShared<ArrayBufferView>, forBranch2: boolean) {\n if (IsReadableStreamDefaultReader<NonShared<Uint8Array>>(reader)) {\n assert(reader._readRequests.length === 0);\n ReadableStreamReaderGenericRelease(reader);\n\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n\n const byobBranch = forBranch2 ? branch2 : branch1;\n const otherBranch = forBranch2 ? branch1 : branch2;\n\n const readIntoRequest: ReadIntoRequest<NonShared<ArrayBufferView>> = {\n _chunkSteps: chunk => {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() => {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n\n if (!otherCanceled) {\n let clonedChunk;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n } catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n } else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n } else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: chunk => {\n reading = false;\n\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n\n if (chunk !== undefined) {\n assert(chunk.byteLength === 0);\n\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () => {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);\n }\n\n function pull1Algorithm(): Promise<void> {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n } else {\n pullWithBYOBReader(byobRequest._view!, false);\n }\n\n return promiseResolvedWith(undefined);\n }\n\n function pull2Algorithm(): Promise<void> {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n } else {\n pullWithBYOBReader(byobRequest._view!, true);\n }\n\n return promiseResolvedWith(undefined);\n }\n\n function cancel1Algorithm(reason: any): Promise<void> {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function cancel2Algorithm(reason: any): Promise<void> {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function startAlgorithm(): void {\n return;\n }\n\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n\n forwardReaderError(reader);\n\n return [branch1, branch2];\n}\n", "import { typeIsObject } from '../helpers/miscellaneous';\nimport type { ReadableStreamDefaultReadResult } from './default-reader';\n\n/**\n * A common interface for a `ReadadableStream` implementation.\n *\n * @public\n */\nexport interface ReadableStreamLike<R = any> {\n readonly locked: boolean;\n\n getReader(): ReadableStreamDefaultReaderLike<R>;\n}\n\n/**\n * A common interface for a `ReadableStreamDefaultReader` implementation.\n *\n * @public\n */\nexport interface ReadableStreamDefaultReaderLike<R = any> {\n readonly closed: Promise<undefined>;\n\n cancel(reason?: any): Promise<void>;\n\n read(): Promise<ReadableStreamDefaultReadResult<R>>;\n\n releaseLock(): void;\n}\n\nexport function isReadableStreamLike<R>(stream: unknown): stream is ReadableStreamLike<R> {\n return typeIsObject(stream) && typeof (stream as ReadableStreamLike<R>).getReader !== 'undefined';\n}\n", "import { CreateReadableStream, type DefaultReadableStream } from '../readable-stream';\nimport {\n isReadableStreamLike,\n type ReadableStreamDefaultReaderLike,\n type ReadableStreamLike\n} from './readable-stream-like';\nimport { ReadableStreamDefaultControllerClose, ReadableStreamDefaultControllerEnqueue } from './default-controller';\nimport { GetIterator, GetMethod, IteratorComplete, IteratorNext, IteratorValue } from '../abstract-ops/ecmascript';\nimport { promiseRejectedWith, promiseResolvedWith, reflectCall, transformPromiseWith } from '../helpers/webidl';\nimport { typeIsObject } from '../helpers/miscellaneous';\nimport { noop } from '../../utils';\n\nexport function ReadableStreamFrom<R>(\n source: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>\n): DefaultReadableStream<R> {\n if (isReadableStreamLike(source)) {\n return ReadableStreamFromDefaultReader(source.getReader());\n }\n return ReadableStreamFromIterable(source);\n}\n\nexport function ReadableStreamFromIterable<R>(asyncIterable: Iterable<R> | AsyncIterable<R>): DefaultReadableStream<R> {\n let stream: DefaultReadableStream<R>;\n const iteratorRecord = GetIterator(asyncIterable, 'async');\n\n const startAlgorithm = noop;\n\n function pullAlgorithm(): Promise<void> {\n let nextResult;\n try {\n nextResult = IteratorNext(iteratorRecord);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const nextPromise = promiseResolvedWith(nextResult);\n return transformPromiseWith(nextPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.next() method must fulfill with an object');\n }\n const done = IteratorComplete(iterResult);\n if (done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n } else {\n const value = IteratorValue(iterResult);\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n\n function cancelAlgorithm(reason: any): Promise<void> {\n const iterator = iteratorRecord.iterator;\n let returnMethod: (typeof iterator)['return'] | undefined;\n try {\n returnMethod = GetMethod(iterator, 'return');\n } catch (e) {\n return promiseRejectedWith(e);\n }\n if (returnMethod === undefined) {\n return promiseResolvedWith(undefined);\n }\n let returnResult: IteratorResult<R> | Promise<IteratorResult<R>>;\n try {\n returnResult = reflectCall(returnMethod, iterator, [reason]);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const returnPromise = promiseResolvedWith(returnResult);\n return transformPromiseWith(returnPromise, iterResult => {\n if (!typeIsObject(iterResult)) {\n throw new TypeError('The promise returned by the iterator.return() method must fulfill with an object');\n }\n return undefined;\n });\n }\n\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n}\n\nexport function ReadableStreamFromDefaultReader<R>(\n reader: ReadableStreamDefaultReaderLike<R>\n): DefaultReadableStream<R> {\n let stream: DefaultReadableStream<R>;\n\n const startAlgorithm = noop;\n\n function pullAlgorithm(): Promise<void> {\n let readPromise;\n try {\n readPromise = reader.read();\n } catch (e) {\n return promiseRejectedWith(e);\n }\n return transformPromiseWith(readPromise, readResult => {\n if (!typeIsObject(readResult)) {\n throw new TypeError('The promise returned by the reader.read() method must fulfill with an object');\n }\n if (readResult.done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n } else {\n const value = readResult.value;\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n\n function cancelAlgorithm(reason: any): Promise<void> {\n try {\n return promiseResolvedWith(reader.cancel(reason));\n } catch (e) {\n return promiseRejectedWith(e);\n }\n }\n\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n}\n", "import { assertDictionary, assertFunction, convertUnsignedLongLongWithEnforceRange } from './basic';\nimport type {\n ReadableStreamController,\n UnderlyingByteSource,\n UnderlyingDefaultOrByteSource,\n UnderlyingDefaultOrByteSourcePullCallback,\n UnderlyingDefaultOrByteSourceStartCallback,\n UnderlyingSource,\n UnderlyingSourceCancelCallback,\n ValidatedUnderlyingDefaultOrByteSource\n} from '../readable-stream/underlying-source';\nimport { promiseCall, reflectCall } from '../helpers/webidl';\n\nexport function convertUnderlyingDefaultOrByteSource<R>(\n source: UnderlyingSource<R> | UnderlyingByteSource | null,\n context: string\n): ValidatedUnderlyingDefaultOrByteSource<R> {\n assertDictionary(source, context);\n const original = source as (UnderlyingDefaultOrByteSource<R> | null);\n const autoAllocateChunkSize = original?.autoAllocateChunkSize;\n const cancel = original?.cancel;\n const pull = original?.pull;\n const start = original?.start;\n const type = original?.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(\n autoAllocateChunkSize,\n `${context} has member 'autoAllocateChunkSize' that`\n ),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original!, `${context} has member 'cancel' that`),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original!, `${context} has member 'pull' that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original!, `${context} has member 'start' that`),\n type: type === undefined ? undefined : convertReadableStreamType(type, `${context} has member 'type' that`)\n };\n}\n\nfunction convertUnderlyingSourceCancelCallback(\n fn: UnderlyingSourceCancelCallback,\n original: UnderlyingDefaultOrByteSource,\n context: string\n): (reason: any) => Promise<void> {\n assertFunction(fn, context);\n return (reason: any) => promiseCall(fn, original, [reason]);\n}\n\nfunction convertUnderlyingSourcePullCallback<R>(\n fn: UnderlyingDefaultOrByteSourcePullCallback<R>,\n original: UnderlyingDefaultOrByteSource<R>,\n context: string\n): (controller: ReadableStreamController<R>) => Promise<void> {\n assertFunction(fn, context);\n return (controller: ReadableStreamController<R>) => promiseCall(fn, original, [controller]);\n}\n\nfunction convertUnderlyingSourceStartCallback<R>(\n fn: UnderlyingDefaultOrByteSourceStartCallback<R>,\n original: UnderlyingDefaultOrByteSource<R>,\n context: string\n): UnderlyingDefaultOrByteSourceStartCallback<R> {\n assertFunction(fn, context);\n return (controller: ReadableStreamController<R>) => reflectCall(fn, original, [controller]);\n}\n\nfunction convertReadableStreamType(type: string, context: string): 'bytes' {\n type = `${type}`;\n if (type !== 'bytes') {\n throw new TypeError(`${context} '${type}' is not a valid enumeration value for ReadableStreamType`);\n }\n return type;\n}\n", "import { assertDictionary } from './basic';\nimport type {\n ReadableStreamIteratorOptions,\n ValidatedReadableStreamIteratorOptions\n} from '../readable-stream/iterator-options';\n\nexport function convertIteratorOptions(options: ReadableStreamIteratorOptions | null | undefined,\n context: string): ValidatedReadableStreamIteratorOptions {\n assertDictionary(options, context);\n const preventCancel = options?.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n}\n", "import { assertDictionary } from './basic';\nimport type { StreamPipeOptions, ValidatedStreamPipeOptions } from '../readable-stream/pipe-options';\nimport { type AbortSignal, isAbortSignal } from '../abort-signal';\n\nexport function convertPipeOptions(options: StreamPipeOptions | null | undefined,\n context: string): ValidatedStreamPipeOptions {\n assertDictionary(options, context);\n const preventAbort = options?.preventAbort;\n const preventCancel = options?.preventCancel;\n const preventClose = options?.preventClose;\n const signal = options?.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, `${context} has member 'signal' that`);\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal\n };\n}\n\nfunction assertAbortSignal(signal: unknown, context: string): asserts signal is AbortSignal {\n if (!isAbortSignal(signal)) {\n throw new TypeError(`${context} is not an AbortSignal.`);\n }\n}\n", "import { assertDictionary, assertRequiredField } from './basic';\nimport { ReadableStream } from '../readable-stream';\nimport { WritableStream } from '../writable-stream';\nimport { assertReadableStream } from './readable-stream';\nimport { assertWritableStream } from './writable-stream';\n\nexport function convertReadableWritablePair<RS extends ReadableStream, WS extends WritableStream>(\n pair: { readable: RS; writable: WS } | null | undefined,\n context: string\n): { readable: RS; writable: WS } {\n assertDictionary(pair, context);\n\n const readable = pair?.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, `${context} has member 'readable' that`);\n\n const writable = pair?.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, `${context} has member 'writable' that`);\n\n return { readable, writable };\n}\n", "import assert from '../stub/assert';\nimport {\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n transformPromiseWith\n} from './helpers/webidl';\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from './queuing-strategy';\nimport { AcquireReadableStreamAsyncIterator, type ReadableStreamAsyncIterator } from './readable-stream/async-iterator';\nimport { defaultReaderClosedPromiseReject, defaultReaderClosedPromiseResolve } from './readable-stream/generic-reader';\nimport {\n AcquireReadableStreamDefaultReader,\n IsReadableStreamDefaultReader,\n ReadableStreamDefaultReader,\n ReadableStreamDefaultReaderErrorReadRequests,\n type ReadableStreamDefaultReadResult\n} from './readable-stream/default-reader';\nimport {\n AcquireReadableStreamBYOBReader,\n IsReadableStreamBYOBReader,\n ReadableStreamBYOBReader,\n ReadableStreamBYOBReaderErrorReadIntoRequests,\n type ReadableStreamBYOBReadResult\n} from './readable-stream/byob-reader';\nimport { ReadableStreamPipeTo } from './readable-stream/pipe';\nimport { ReadableStreamTee } from './readable-stream/tee';\nimport { ReadableStreamFrom } from './readable-stream/from';\nimport { IsWritableStream, IsWritableStreamLocked, WritableStream } from './writable-stream';\nimport { SimpleQueue } from './simple-queue';\nimport {\n ReadableByteStreamController,\n ReadableStreamBYOBRequest,\n SetUpReadableByteStreamController,\n SetUpReadableByteStreamControllerFromUnderlyingSource\n} from './readable-stream/byte-stream-controller';\nimport {\n ReadableStreamDefaultController,\n SetUpReadableStreamDefaultController,\n SetUpReadableStreamDefaultControllerFromUnderlyingSource\n} from './readable-stream/default-controller';\nimport type {\n UnderlyingByteSource,\n UnderlyingByteSourcePullCallback,\n UnderlyingByteSourceStartCallback,\n UnderlyingSource,\n UnderlyingSourceCancelCallback,\n UnderlyingSourcePullCallback,\n UnderlyingSourceStartCallback\n} from './readable-stream/underlying-source';\nimport { noop } from '../utils';\nimport { setFunctionName, typeIsObject } from './helpers/miscellaneous';\nimport { CreateArrayFromList, SymbolAsyncIterator } from './abstract-ops/ecmascript';\nimport { CancelSteps } from './abstract-ops/internal-methods';\nimport { IsNonNegativeNumber } from './abstract-ops/miscellaneous';\nimport { assertObject, assertRequiredArgument } from './validators/basic';\nimport { convertQueuingStrategy } from './validators/queuing-strategy';\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from './abstract-ops/queuing-strategy';\nimport { convertUnderlyingDefaultOrByteSource } from './validators/underlying-source';\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ReadableStreamGetReaderOptions\n} from './readable-stream/reader-options';\nimport { convertReaderOptions } from './validators/reader-options';\nimport type { StreamPipeOptions, ValidatedStreamPipeOptions } from './readable-stream/pipe-options';\nimport type { ReadableStreamIteratorOptions } from './readable-stream/iterator-options';\nimport { convertIteratorOptions } from './validators/iterator-options';\nimport { convertPipeOptions } from './validators/pipe-options';\nimport type { ReadableWritablePair } from './readable-stream/readable-writable-pair';\nimport { convertReadableWritablePair } from './validators/readable-writable-pair';\nimport type { ReadableStreamDefaultReaderLike, ReadableStreamLike } from './readable-stream/readable-stream-like';\nimport type { NonShared } from './helpers/array-buffer-view';\n\nexport type DefaultReadableStream<R = any> = ReadableStream<R> & {\n _readableStreamController: ReadableStreamDefaultController<R>\n};\n\nexport type ReadableByteStream = ReadableStream<NonShared<Uint8Array>> & {\n _readableStreamController: ReadableByteStreamController\n};\n\ntype ReadableStreamState = 'readable' | 'closed' | 'errored';\n\n/**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\nexport class ReadableStream<R = any> implements AsyncIterable<R> {\n /** @internal */\n _state!: ReadableStreamState;\n /** @internal */\n _reader: ReadableStreamReader<R> | undefined;\n /** @internal */\n _storedError: any;\n /** @internal */\n _disturbed!: boolean;\n /** @internal */\n _readableStreamController!: ReadableStreamDefaultController<R> | ReadableByteStreamController;\n\n constructor(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number; size?: undefined });\n constructor(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);\n constructor(rawUnderlyingSource: UnderlyingSource<R> | UnderlyingByteSource | null | undefined = {},\n rawStrategy: QueuingStrategy<R> | null | undefined = {}) {\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n } else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n\n const strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n\n InitializeReadableStream(this);\n\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n const highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(\n this as unknown as ReadableByteStream,\n underlyingSource,\n highWaterMark\n );\n } else {\n assert(underlyingSource.type === undefined);\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(\n this,\n underlyingSource,\n highWaterMark,\n sizeAlgorithm\n );\n }\n }\n\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get locked(): boolean {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException('locked');\n }\n\n return IsReadableStreamLocked(this);\n }\n\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n cancel(reason: any = undefined): Promise<void> {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException('cancel'));\n }\n\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n\n return ReadableStreamCancel(this, reason);\n }\n\n /**\n * Creates a {@link ReadableStreamBYOBReader} and locks the stream to the new reader.\n *\n * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams,\n * i.e. streams which were constructed specifically with the ability to handle \"bring your own buffer\" reading.\n * The returned BYOB reader provides the ability to directly read individual chunks from the stream via its\n * {@link ReadableStreamBYOBReader.read | read()} method, into developer-supplied buffers, allowing more precise\n * control over allocation.\n */\n getReader({ mode }: { mode: 'byob' }): ReadableStreamBYOBReader;\n /**\n * Creates a {@link ReadableStreamDefaultReader} and locks the stream to the new reader.\n * While the stream is locked, no other reader can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to consume a stream\n * in its entirety. By getting a reader for the stream, you can ensure nobody else can interleave reads with yours\n * or cancel the stream, which would interfere with your abstraction.\n */\n getReader(): ReadableStreamDefaultReader<R>;\n getReader(\n rawOptions: ReadableStreamGetReaderOptions | null | undefined = undefined\n ): ReadableStreamDefaultReader<R> | ReadableStreamBYOBReader {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException('getReader');\n }\n\n const options = convertReaderOptions(rawOptions, 'First parameter');\n\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n\n assert(options.mode === 'byob');\n return AcquireReadableStreamBYOBReader(this as unknown as ReadableByteStream);\n }\n\n /**\n * Provides a convenient, chainable way of piping this readable stream through a transform stream\n * (or any other `{ writable, readable }` pair). It simply {@link ReadableStream.pipeTo | pipes} the stream\n * into the writable side of the supplied pair, and returns the readable side for further use.\n *\n * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\n */\n pipeThrough<RS extends ReadableStream>(\n transform: { readable: RS; writable: WritableStream<R> },\n options?: StreamPipeOptions\n ): RS;\n pipeThrough<RS extends ReadableStream>(\n rawTransform: { readable: RS; writable: WritableStream<R> } | null | undefined,\n rawOptions: StreamPipeOptions | null | undefined = {}\n ): RS {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n\n const transform = convertReadableWritablePair(rawTransform, 'First parameter');\n const options = convertPipeOptions(rawOptions, 'Second parameter');\n\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n\n const promise = ReadableStreamPipeTo(\n this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal\n );\n\n setPromiseIsHandledToTrue(promise);\n\n return transform.readable;\n }\n\n /**\n * Pipes this readable stream to a given writable stream. The way in which the piping process behaves under\n * various error conditions can be customized with a number of passed options. It returns a promise that fulfills\n * when the piping process completes successfully, or rejects if any errors were encountered.\n *\n * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\n */\n pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;\n pipeTo(destination: WritableStream<R> | null | undefined,\n rawOptions: StreamPipeOptions | null | undefined = {}): Promise<void> {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException('pipeTo'));\n }\n\n if (destination === undefined) {\n return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`);\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(\n new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`)\n );\n }\n\n let options: ValidatedStreamPipeOptions;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n } catch (e) {\n return promiseRejectedWith(e);\n }\n\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(\n new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream')\n );\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(\n new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream')\n );\n }\n\n return ReadableStreamPipeTo<R>(\n this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal\n );\n }\n\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n tee(): [ReadableStream<R>, ReadableStream<R>] {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException('tee');\n }\n\n const branches = ReadableStreamTee(this, false);\n return CreateArrayFromList(branches);\n }\n\n /**\n * Asynchronously iterates over the chunks in the stream's internal queue.\n *\n * Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader.\n * The lock will be released if the async iterator's {@link ReadableStreamAsyncIterator.return | return()} method\n * is called, e.g. by breaking out of the loop.\n *\n * By default, calling the async iterator's {@link ReadableStreamAsyncIterator.return | return()} method will also\n * cancel the stream. To prevent this, use the stream's {@link ReadableStream.values | values()} method, passing\n * `true` for the `preventCancel` option.\n */\n values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;\n values(rawOptions: ReadableStreamIteratorOptions | null | undefined = undefined): ReadableStreamAsyncIterator<R> {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException('values');\n }\n\n const options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator<R>(this, options.preventCancel);\n }\n\n /**\n * {@inheritDoc ReadableStream.values}\n */\n [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;\n\n [SymbolAsyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R> {\n // Stub implementation, overridden below\n return this.values(options);\n }\n\n /**\n * Creates a new ReadableStream wrapping the provided iterable or async iterable.\n *\n * This can be used to adapt various kinds of objects into a readable stream,\n * such as an array, an async generator, or a Node.js readable stream.\n */\n static from<R>(asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>): ReadableStream<R> {\n return ReadableStreamFrom(asyncIterable);\n }\n}\n\nObject.defineProperties(ReadableStream, {\n from: { enumerable: true }\n});\nObject.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n});\nsetFunctionName(ReadableStream.from, 'from');\nsetFunctionName(ReadableStream.prototype.cancel, 'cancel');\nsetFunctionName(ReadableStream.prototype.getReader, 'getReader');\nsetFunctionName(ReadableStream.prototype.pipeThrough, 'pipeThrough');\nsetFunctionName(ReadableStream.prototype.pipeTo, 'pipeTo');\nsetFunctionName(ReadableStream.prototype.tee, 'tee');\nsetFunctionName(ReadableStream.prototype.values, 'values');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n}\nObject.defineProperty(ReadableStream.prototype, SymbolAsyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n});\n\nexport type {\n ReadableStreamAsyncIterator,\n ReadableStreamDefaultReadResult,\n ReadableStreamBYOBReadResult,\n ReadableStreamBYOBReaderReadOptions,\n UnderlyingByteSource,\n UnderlyingSource,\n UnderlyingSourceStartCallback,\n UnderlyingSourcePullCallback,\n UnderlyingSourceCancelCallback,\n UnderlyingByteSourceStartCallback,\n UnderlyingByteSourcePullCallback,\n StreamPipeOptions,\n ReadableWritablePair,\n ReadableStreamIteratorOptions,\n ReadableStreamLike,\n ReadableStreamDefaultReaderLike\n};\n\n// Abstract operations for the ReadableStream.\n\n// Throws if and only if startAlgorithm throws.\nexport function CreateReadableStream<R>(\n startAlgorithm: () => void | PromiseLike<void>,\n pullAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>,\n highWaterMark = 1,\n sizeAlgorithm: QueuingStrategySizeCallback<R> = () => 1\n): DefaultReadableStream<R> {\n assert(IsNonNegativeNumber(highWaterMark));\n\n const stream: DefaultReadableStream<R> = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n\n const controller: ReadableStreamDefaultController<R> = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm\n );\n\n return stream;\n}\n\n// Throws if and only if startAlgorithm throws.\nexport function CreateReadableByteStream(\n startAlgorithm: () => void | PromiseLike<void>,\n pullAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>\n): ReadableByteStream {\n const stream: ReadableByteStream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n\n const controller: ReadableByteStreamController = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n\n return stream;\n}\n\nfunction InitializeReadableStream(stream: ReadableStream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n}\n\nexport function IsReadableStream(x: unknown): x is ReadableStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n\n return x instanceof ReadableStream;\n}\n\nexport function IsReadableStreamDisturbed(stream: ReadableStream): boolean {\n assert(IsReadableStream(stream));\n\n return stream._disturbed;\n}\n\nexport function IsReadableStreamLocked(stream: ReadableStream): boolean {\n assert(IsReadableStream(stream));\n\n if (stream._reader === undefined) {\n return false;\n }\n\n return true;\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamCancel<R>(stream: ReadableStream<R>, reason: any): Promise<undefined> {\n stream._disturbed = true;\n\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n\n ReadableStreamClose(stream);\n\n const reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest => {\n readIntoRequest._closeSteps(undefined);\n });\n }\n\n const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n}\n\nexport function ReadableStreamClose<R>(stream: ReadableStream<R>): void {\n assert(stream._state === 'readable');\n\n stream._state = 'closed';\n\n const reader = stream._reader;\n\n if (reader === undefined) {\n return;\n }\n\n defaultReaderClosedPromiseResolve(reader);\n\n if (IsReadableStreamDefaultReader<R>(reader)) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest => {\n readRequest._closeSteps();\n });\n }\n}\n\nexport function ReadableStreamError<R>(stream: ReadableStream<R>, e: any): void {\n assert(IsReadableStream(stream));\n assert(stream._state === 'readable');\n\n stream._state = 'errored';\n stream._storedError = e;\n\n const reader = stream._reader;\n\n if (reader === undefined) {\n return;\n }\n\n defaultReaderClosedPromiseReject(reader, e);\n\n if (IsReadableStreamDefaultReader<R>(reader)) {\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n } else {\n assert(IsReadableStreamBYOBReader(reader));\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n}\n\n// Readers\n\nexport type ReadableStreamReader<R> = ReadableStreamDefaultReader<R> | ReadableStreamBYOBReader;\n\nexport {\n ReadableStreamDefaultReader,\n ReadableStreamBYOBReader\n};\n\n// Controllers\n\nexport {\n ReadableStreamDefaultController,\n ReadableStreamBYOBRequest,\n ReadableByteStreamController\n};\n\n// Helper functions for the ReadableStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);\n}\n", "import type { QueuingStrategyInit } from '../queuing-strategy';\nimport { assertDictionary, assertRequiredField, convertUnrestrictedDouble } from './basic';\n\nexport function convertQueuingStrategyInit(init: QueuingStrategyInit | null | undefined,\n context: string): QueuingStrategyInit {\n assertDictionary(init, context);\n const highWaterMark = init?.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n}\n", "import type { QueuingStrategy, QueuingStrategyInit } from './queuing-strategy';\nimport { setFunctionName, typeIsObject } from './helpers/miscellaneous';\nimport { assertRequiredArgument } from './validators/basic';\nimport { convertQueuingStrategyInit } from './validators/queuing-strategy-init';\n\n// The size function must not have a prototype property nor be a constructor\nconst byteLengthSizeFunction = (chunk: ArrayBufferView): number => {\n return chunk.byteLength;\n};\nsetFunctionName(byteLengthSizeFunction, 'size');\n\n/**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\nexport default class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {\n /** @internal */\n readonly _byteLengthQueuingStrategyHighWaterMark: number;\n\n constructor(options: QueuingStrategyInit) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark(): number {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get size(): (chunk: ArrayBufferView) => number {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n }\n}\n\nObject.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n}\n\n// Helper functions for the ByteLengthQueuingStrategy.\n\nfunction byteLengthBrandCheckException(name: string): TypeError {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);\n}\n\nexport function IsByteLengthQueuingStrategy(x: any): x is ByteLengthQueuingStrategy {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n\n return x instanceof ByteLengthQueuingStrategy;\n}\n", "import type { QueuingStrategy, QueuingStrategyInit } from './queuing-strategy';\nimport { setFunctionName, typeIsObject } from './helpers/miscellaneous';\nimport { assertRequiredArgument } from './validators/basic';\nimport { convertQueuingStrategyInit } from './validators/queuing-strategy-init';\n\n// The size function must not have a prototype property nor be a constructor\nconst countSizeFunction = (): 1 => {\n return 1;\n};\nsetFunctionName(countSizeFunction, 'size');\n\n/**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\nexport default class CountQueuingStrategy implements QueuingStrategy<any> {\n /** @internal */\n readonly _countQueuingStrategyHighWaterMark!: number;\n\n constructor(options: QueuingStrategyInit) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark(): number {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n }\n\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get size(): (chunk: any) => 1 {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n }\n}\n\nObject.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n}\n\n// Helper functions for the CountQueuingStrategy.\n\nfunction countBrandCheckException(name: string): TypeError {\n return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);\n}\n\nexport function IsCountQueuingStrategy(x: any): x is CountQueuingStrategy {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n\n return x instanceof CountQueuingStrategy;\n}\n", "import { assertDictionary, assertFunction } from './basic';\nimport { promiseCall, reflectCall } from '../helpers/webidl';\nimport type {\n Transformer,\n TransformerCancelCallback,\n TransformerFlushCallback,\n TransformerStartCallback,\n TransformerTransformCallback,\n ValidatedTransformer\n} from '../transform-stream/transformer';\nimport { TransformStreamDefaultController } from '../transform-stream';\n\nexport function convertTransformer<I, O>(original: Transformer<I, O> | null,\n context: string): ValidatedTransformer<I, O> {\n assertDictionary(original, context);\n const cancel = original?.cancel;\n const flush = original?.flush;\n const readableType = original?.readableType;\n const start = original?.start;\n const transform = original?.transform;\n const writableType = original?.writableType;\n return {\n cancel: cancel === undefined ?\n undefined :\n convertTransformerCancelCallback(cancel, original!, `${context} has member 'cancel' that`),\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original!, `${context} has member 'flush' that`),\n readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original!, `${context} has member 'start' that`),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original!, `${context} has member 'transform' that`),\n writableType\n };\n}\n\nfunction convertTransformerFlushCallback<I, O>(\n fn: TransformerFlushCallback<O>,\n original: Transformer<I, O>,\n context: string\n): (controller: TransformStreamDefaultController<O>) => Promise<void> {\n assertFunction(fn, context);\n return (controller: TransformStreamDefaultController<O>) => promiseCall(fn, original, [controller]);\n}\n\nfunction convertTransformerStartCallback<I, O>(\n fn: TransformerStartCallback<O>,\n original: Transformer<I, O>,\n context: string\n): TransformerStartCallback<O> {\n assertFunction(fn, context);\n return (controller: TransformStreamDefaultController<O>) => reflectCall(fn, original, [controller]);\n}\n\nfunction convertTransformerTransformCallback<I, O>(\n fn: TransformerTransformCallback<I, O>,\n original: Transformer<I, O>,\n context: string\n): (chunk: I, controller: TransformStreamDefaultController<O>) => Promise<void> {\n assertFunction(fn, context);\n return (chunk: I, controller: TransformStreamDefaultController<O>) => promiseCall(fn, original, [chunk, controller]);\n}\n\nfunction convertTransformerCancelCallback<I, O>(\n fn: TransformerCancelCallback,\n original: Transformer<I, O>,\n context: string\n): (reason: any) => Promise<void> {\n assertFunction(fn, context);\n return (reason: any) => promiseCall(fn, original, [reason]);\n}\n", "import assert from '../stub/assert';\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n transformPromiseWith,\n uponPromise\n} from './helpers/webidl';\nimport { CreateReadableStream, type DefaultReadableStream, ReadableStream } from './readable-stream';\nimport {\n ReadableStreamDefaultControllerCanCloseOrEnqueue,\n ReadableStreamDefaultControllerClose,\n ReadableStreamDefaultControllerEnqueue,\n ReadableStreamDefaultControllerError,\n ReadableStreamDefaultControllerGetDesiredSize,\n ReadableStreamDefaultControllerHasBackpressure\n} from './readable-stream/default-controller';\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from './queuing-strategy';\nimport { CreateWritableStream, WritableStream, WritableStreamDefaultControllerErrorIfNeeded } from './writable-stream';\nimport { setFunctionName, typeIsObject } from './helpers/miscellaneous';\nimport { IsNonNegativeNumber } from './abstract-ops/miscellaneous';\nimport { convertQueuingStrategy } from './validators/queuing-strategy';\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from './abstract-ops/queuing-strategy';\nimport type {\n Transformer,\n TransformerCancelCallback,\n TransformerFlushCallback,\n TransformerStartCallback,\n TransformerTransformCallback,\n ValidatedTransformer\n} from './transform-stream/transformer';\nimport { convertTransformer } from './validators/transformer';\n\n// Class TransformStream\n\n/**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\nexport class TransformStream<I = any, O = any> {\n /** @internal */\n _writable!: WritableStream<I>;\n /** @internal */\n _readable!: DefaultReadableStream<O>;\n /** @internal */\n _backpressure!: boolean;\n /** @internal */\n _backpressureChangePromise!: Promise<void>;\n /** @internal */\n _backpressureChangePromise_resolve!: () => void;\n /** @internal */\n _transformStreamController!: TransformStreamDefaultController<O>;\n\n constructor(\n transformer?: Transformer<I, O>,\n writableStrategy?: QueuingStrategy<I>,\n readableStrategy?: QueuingStrategy<O>\n );\n constructor(rawTransformer: Transformer<I, O> | null | undefined = {},\n rawWritableStrategy: QueuingStrategy<I> | null | undefined = {},\n rawReadableStrategy: QueuingStrategy<O> | null | undefined = {}) {\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n\n const writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n const readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n\n const transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n\n const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n\n let startPromise_resolve!: (value: void | PromiseLike<void>) => void;\n const startPromise = newPromise<void>(resolve => {\n startPromise_resolve = resolve;\n });\n\n InitializeTransformStream(\n this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm\n );\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n } else {\n startPromise_resolve(undefined);\n }\n }\n\n /**\n * The readable side of the transform stream.\n */\n get readable(): ReadableStream<O> {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n\n return this._readable;\n }\n\n /**\n * The writable side of the transform stream.\n */\n get writable(): WritableStream<I> {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n\n return this._writable;\n }\n}\n\nObject.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n}\n\nexport type {\n Transformer,\n TransformerCancelCallback,\n TransformerStartCallback,\n TransformerFlushCallback,\n TransformerTransformCallback\n};\n\n// Transform Stream Abstract Operations\n\nexport function CreateTransformStream<I, O>(startAlgorithm: () => void | PromiseLike<void>,\n transformAlgorithm: (chunk: I) => Promise<void>,\n flushAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>,\n writableHighWaterMark = 1,\n writableSizeAlgorithm: QueuingStrategySizeCallback<I> = () => 1,\n readableHighWaterMark = 0,\n readableSizeAlgorithm: QueuingStrategySizeCallback<O> = () => 1) {\n assert(IsNonNegativeNumber(writableHighWaterMark));\n assert(IsNonNegativeNumber(readableHighWaterMark));\n\n const stream: TransformStream<I, O> = Object.create(TransformStream.prototype);\n\n let startPromise_resolve!: (value: void | PromiseLike<void>) => void;\n const startPromise = newPromise<void>(resolve => {\n startPromise_resolve = resolve;\n });\n\n InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark,\n readableSizeAlgorithm);\n\n const controller: TransformStreamDefaultController<O> = Object.create(TransformStreamDefaultController.prototype);\n\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n\n const startResult = startAlgorithm();\n startPromise_resolve(startResult);\n return stream;\n}\n\nfunction InitializeTransformStream<I, O>(stream: TransformStream<I, O>,\n startPromise: Promise<void>,\n writableHighWaterMark: number,\n writableSizeAlgorithm: QueuingStrategySizeCallback<I>,\n readableHighWaterMark: number,\n readableSizeAlgorithm: QueuingStrategySizeCallback<O>) {\n function startAlgorithm(): Promise<void> {\n return startPromise;\n }\n\n function writeAlgorithm(chunk: I): Promise<void> {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n\n function abortAlgorithm(reason: any): Promise<void> {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n\n function closeAlgorithm(): Promise<void> {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm,\n writableHighWaterMark, writableSizeAlgorithm);\n\n function pullAlgorithm(): Promise<void> {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n\n function cancelAlgorithm(reason: any): Promise<void> {\n return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);\n }\n\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark,\n readableSizeAlgorithm);\n\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined!;\n stream._backpressureChangePromise = undefined!;\n stream._backpressureChangePromise_resolve = undefined!;\n TransformStreamSetBackpressure(stream, true);\n\n stream._transformStreamController = undefined!;\n}\n\nfunction IsTransformStream(x: unknown): x is TransformStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n\n return x instanceof TransformStream;\n}\n\n// This is a no-op if both sides are already errored.\nfunction TransformStreamError(stream: TransformStream, e: any) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n}\n\nfunction TransformStreamErrorWritableAndUnblockWrite(stream: TransformStream, e: any) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n TransformStreamUnblockWrite(stream);\n}\n\nfunction TransformStreamUnblockWrite(stream: TransformStream) {\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n}\n\nfunction TransformStreamSetBackpressure(stream: TransformStream, backpressure: boolean) {\n // Passes also when called during construction.\n assert(stream._backpressure !== backpressure);\n\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n\n stream._backpressureChangePromise = newPromise(resolve => {\n stream._backpressureChangePromise_resolve = resolve;\n });\n\n stream._backpressure = backpressure;\n}\n\n// Class TransformStreamDefaultController\n\n/**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\nexport class TransformStreamDefaultController<O> {\n /** @internal */\n _controlledTransformStream: TransformStream<any, O>;\n /** @internal */\n _finishPromise: Promise<undefined> | undefined;\n /** @internal */\n _finishPromise_resolve?: (value?: undefined) => void;\n /** @internal */\n _finishPromise_reject?: (reason: any) => void;\n /** @internal */\n _transformAlgorithm: (chunk: any) => Promise<void>;\n /** @internal */\n _flushAlgorithm: () => Promise<void>;\n /** @internal */\n _cancelAlgorithm: (reason: any) => Promise<void>;\n\n private constructor() {\n throw new TypeError('Illegal constructor');\n }\n\n /**\n * Returns the desired size to fill the readable sideโ€™s internal queue. It can be negative, if the queue is over-full.\n */\n get desiredSize(): number | null {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n\n const readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n }\n\n /**\n * Enqueues the given chunk `chunk` in the readable side of the controlled transform stream.\n */\n enqueue(chunk: O): void;\n enqueue(chunk: O = undefined!): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n\n TransformStreamDefaultControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n error(reason: any = undefined): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n\n TransformStreamDefaultControllerError(this, reason);\n }\n\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n terminate(): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n\n TransformStreamDefaultControllerTerminate(this);\n }\n}\n\nObject.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(TransformStreamDefaultController.prototype.enqueue, 'enqueue');\nsetFunctionName(TransformStreamDefaultController.prototype.error, 'error');\nsetFunctionName(TransformStreamDefaultController.prototype.terminate, 'terminate');\nif (typeof Symbol.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n}\n\n// Transform Stream Default Controller Abstract Operations\n\nfunction IsTransformStreamDefaultController<O = any>(x: any): x is TransformStreamDefaultController<O> {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n\n return x instanceof TransformStreamDefaultController;\n}\n\nfunction SetUpTransformStreamDefaultController<I, O>(stream: TransformStream<I, O>,\n controller: TransformStreamDefaultController<O>,\n transformAlgorithm: (chunk: I) => Promise<void>,\n flushAlgorithm: () => Promise<void>,\n cancelAlgorithm: (reason: any) => Promise<void>) {\n assert(IsTransformStream(stream));\n assert(stream._transformStreamController === undefined);\n\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n controller._finishPromise = undefined;\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\nfunction SetUpTransformStreamDefaultControllerFromTransformer<I, O>(stream: TransformStream<I, O>,\n transformer: ValidatedTransformer<I, O>) {\n const controller: TransformStreamDefaultController<O> = Object.create(TransformStreamDefaultController.prototype);\n\n let transformAlgorithm: (chunk: I) => Promise<void>;\n let flushAlgorithm: () => Promise<void>;\n let cancelAlgorithm: (reason: any) => Promise<void>;\n\n if (transformer.transform !== undefined) {\n transformAlgorithm = chunk => transformer.transform!(chunk, controller);\n } else {\n transformAlgorithm = chunk => {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk as unknown as O);\n return promiseResolvedWith(undefined);\n } catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n }\n\n if (transformer.flush !== undefined) {\n flushAlgorithm = () => transformer.flush!(controller);\n } else {\n flushAlgorithm = () => promiseResolvedWith(undefined);\n }\n\n if (transformer.cancel !== undefined) {\n cancelAlgorithm = reason => transformer.cancel!(reason);\n } else {\n cancelAlgorithm = () => promiseResolvedWith(undefined);\n }\n\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n}\n\nfunction TransformStreamDefaultControllerClearAlgorithms(controller: TransformStreamDefaultController<any>) {\n controller._transformAlgorithm = undefined!;\n controller._flushAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n}\n\nfunction TransformStreamDefaultControllerEnqueue<O>(controller: TransformStreamDefaultController<O>, chunk: O) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n } catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n\n throw stream._readable._storedError;\n }\n\n const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n assert(backpressure);\n TransformStreamSetBackpressure(stream, true);\n }\n}\n\nfunction TransformStreamDefaultControllerError(controller: TransformStreamDefaultController<any>, e: any) {\n TransformStreamError(controller._controlledTransformStream, e);\n}\n\nfunction TransformStreamDefaultControllerPerformTransform<I, O>(controller: TransformStreamDefaultController<O>,\n chunk: I) {\n const transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, r => {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n}\n\nfunction TransformStreamDefaultControllerTerminate<O>(controller: TransformStreamDefaultController<O>) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n\n ReadableStreamDefaultControllerClose(readableController);\n\n const error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n}\n\n// TransformStreamDefaultSink Algorithms\n\nfunction TransformStreamDefaultSinkWriteAlgorithm<I, O>(stream: TransformStream<I, O>, chunk: I): Promise<void> {\n assert(stream._writable._state === 'writable');\n\n const controller = stream._transformStreamController;\n\n if (stream._backpressure) {\n const backpressureChangePromise = stream._backpressureChangePromise;\n assert(backpressureChangePromise !== undefined);\n return transformPromiseWith(backpressureChangePromise, () => {\n const writable = stream._writable;\n const state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n assert(state === 'writable');\n return TransformStreamDefaultControllerPerformTransform<I, O>(controller, chunk);\n });\n }\n\n return TransformStreamDefaultControllerPerformTransform<I, O>(controller, chunk);\n}\n\nfunction TransformStreamDefaultSinkAbortAlgorithm<I, O>(stream: TransformStream<I, O>, reason: any): Promise<void> {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n\n // Assign the _finishPromise now so that if _cancelAlgorithm calls readable.cancel() internally,\n // we don't run the _cancelAlgorithm again.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(cancelPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n } else {\n ReadableStreamDefaultControllerError(readable._readableStreamController, reason);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\nfunction TransformStreamDefaultSinkCloseAlgorithm<I, O>(stream: TransformStream<I, O>): Promise<void> {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n\n // Assign the _finishPromise now so that if _flushAlgorithm calls readable.cancel() internally,\n // we don't also run the _cancelAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(flushPromise, () => {\n if (readable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n } else {\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\n// TransformStreamDefaultSource Algorithms\n\nfunction TransformStreamDefaultSourcePullAlgorithm(stream: TransformStream): Promise<void> {\n // Invariant. Enforced by the promises returned by start() and pull().\n assert(stream._backpressure);\n\n assert(stream._backpressureChangePromise !== undefined);\n\n TransformStreamSetBackpressure(stream, false);\n\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n}\n\nfunction TransformStreamDefaultSourceCancelAlgorithm<I, O>(stream: TransformStream<I, O>, reason: any): Promise<void> {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._writable cannot change after construction, so caching it across a call to user code is safe.\n const writable = stream._writable;\n\n // Assign the _finishPromise now so that if _flushAlgorithm calls writable.abort() or\n // writable.cancel() internally, we don't run the _cancelAlgorithm again, or also run the\n // _flushAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) => {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(cancelPromise, () => {\n if (writable._state === 'errored') {\n defaultControllerFinishPromiseReject(controller, writable._storedError);\n } else {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r => {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\n// Helper functions for the TransformStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);\n}\n\nexport function defaultControllerFinishPromiseResolve(controller: TransformStreamDefaultController<any>) {\n if (controller._finishPromise_resolve === undefined) {\n return;\n }\n\n controller._finishPromise_resolve();\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\nexport function defaultControllerFinishPromiseReject(controller: TransformStreamDefaultController<any>, reason: any) {\n if (controller._finishPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(controller._finishPromise!);\n controller._finishPromise_reject(reason);\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\n// Helper functions for the TransformStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(\n `TransformStream.prototype.${name} can only be used on a TransformStream`);\n}\n", "/* c8 ignore start */\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\nif (!globalThis.ReadableStream) {\n // `node:stream/web` got introduced in v16.5.0 as experimental\n // and it's preferred over the polyfilled version. So we also\n // suppress the warning that gets emitted by NodeJS for using it.\n try {\n const process = require('node:process')\n const { emitWarning } = process\n try {\n process.emitWarning = () => {}\n Object.assign(globalThis, require('node:stream/web'))\n process.emitWarning = emitWarning\n } catch (error) {\n process.emitWarning = emitWarning\n throw error\n }\n } catch (error) {\n // fallback to polyfill implementation\n Object.assign(globalThis, require('web-streams-polyfill/dist/ponyfill.es2018.js'))\n }\n}\n\ntry {\n // Don't use node: prefix for this, require+node: is not supported until node v14.14\n // Only `import()` can use prefix in 12.20 and later\n const { Blob } = require('buffer')\n if (Blob && !Blob.prototype.stream) {\n Blob.prototype.stream = function name (params) {\n let position = 0\n const blob = this\n\n return new ReadableStream({\n type: 'bytes',\n async pull (ctrl) {\n const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n ctrl.enqueue(new Uint8Array(buffer))\n\n if (position === blob.size) {\n ctrl.close()\n }\n }\n })\n }\n }\n} catch (error) {}\n/* c8 ignore end */\n", "/*! fetch-blob. MIT License. Jimmy W\u00E4rting <https://jimmy.warting.se/opensource> */\n\n// TODO (jimmywarting): in the feature use conditional loading with top level await (requires 14.x)\n// Node has recently added whatwg stream into core\n\nimport './streams.cjs'\n\n// 64 KiB (same size chrome slice theirs blob into Uint8array's)\nconst POOL_SIZE = 65536\n\n/** @param {(Blob | Uint8Array)[]} parts */\nasync function * toIterator (parts, clone = true) {\n for (const part of parts) {\n if ('stream' in part) {\n yield * (/** @type {AsyncIterableIterator<Uint8Array>} */ (part.stream()))\n } else if (ArrayBuffer.isView(part)) {\n if (clone) {\n let position = part.byteOffset\n const end = part.byteOffset + part.byteLength\n while (position !== end) {\n const size = Math.min(end - position, POOL_SIZE)\n const chunk = part.buffer.slice(position, position + size)\n position += chunk.byteLength\n yield new Uint8Array(chunk)\n }\n } else {\n yield part\n }\n /* c8 ignore next 10 */\n } else {\n // For blobs that have arrayBuffer but no stream method (nodes buffer.Blob)\n let position = 0, b = (/** @type {Blob} */ (part))\n while (position !== b.size) {\n const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n yield new Uint8Array(buffer)\n }\n }\n }\n}\n\nconst _Blob = class Blob {\n /** @type {Array.<(Blob|Uint8Array)>} */\n #parts = []\n #type = ''\n #size = 0\n #endings = 'transparent'\n\n /**\n * The Blob() constructor returns a new Blob object. The content\n * of the blob consists of the concatenation of the values given\n * in the parameter array.\n *\n * @param {*} blobParts\n * @param {{ type?: string, endings?: string }} [options]\n */\n constructor (blobParts = [], options = {}) {\n if (typeof blobParts !== 'object' || blobParts === null) {\n throw new TypeError('Failed to construct \\'Blob\\': The provided value cannot be converted to a sequence.')\n }\n\n if (typeof blobParts[Symbol.iterator] !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': The object must have a callable @@iterator property.')\n }\n\n if (typeof options !== 'object' && typeof options !== 'function') {\n throw new TypeError('Failed to construct \\'Blob\\': parameter 2 cannot convert to dictionary.')\n }\n\n if (options === null) options = {}\n\n const encoder = new TextEncoder()\n for (const element of blobParts) {\n let part\n if (ArrayBuffer.isView(element)) {\n part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength))\n } else if (element instanceof ArrayBuffer) {\n part = new Uint8Array(element.slice(0))\n } else if (element instanceof Blob) {\n part = element\n } else {\n part = encoder.encode(`${element}`)\n }\n\n this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size\n this.#parts.push(part)\n }\n\n this.#endings = `${options.endings === undefined ? 'transparent' : options.endings}`\n const type = options.type === undefined ? '' : String(options.type)\n this.#type = /^[\\x20-\\x7E]*$/.test(type) ? type : ''\n }\n\n /**\n * The Blob interface's size property returns the\n * size of the Blob in bytes.\n */\n get size () {\n return this.#size\n }\n\n /**\n * The type property of a Blob object returns the MIME type of the file.\n */\n get type () {\n return this.#type\n }\n\n /**\n * The text() method in the Blob interface returns a Promise\n * that resolves with a string containing the contents of\n * the blob, interpreted as UTF-8.\n *\n * @return {Promise<string>}\n */\n async text () {\n // More optimized than using this.arrayBuffer()\n // that requires twice as much ram\n const decoder = new TextDecoder()\n let str = ''\n for await (const part of toIterator(this.#parts, false)) {\n str += decoder.decode(part, { stream: true })\n }\n // Remaining\n str += decoder.decode()\n return str\n }\n\n /**\n * The arrayBuffer() method in the Blob interface returns a\n * Promise that resolves with the contents of the blob as\n * binary data contained in an ArrayBuffer.\n *\n * @return {Promise<ArrayBuffer>}\n */\n async arrayBuffer () {\n // Easier way... Just a unnecessary overhead\n // const view = new Uint8Array(this.size);\n // await this.stream().getReader({mode: 'byob'}).read(view);\n // return view.buffer;\n\n const data = new Uint8Array(this.size)\n let offset = 0\n for await (const chunk of toIterator(this.#parts, false)) {\n data.set(chunk, offset)\n offset += chunk.length\n }\n\n return data.buffer\n }\n\n stream () {\n const it = toIterator(this.#parts, true)\n\n return new globalThis.ReadableStream({\n // @ts-ignore\n type: 'bytes',\n async pull (ctrl) {\n const chunk = await it.next()\n chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value)\n },\n\n async cancel () {\n await it.return()\n }\n })\n }\n\n /**\n * The Blob interface's slice() method creates and returns a\n * new Blob object which contains data from a subset of the\n * blob on which it's called.\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [type]\n */\n slice (start = 0, end = this.size, type = '') {\n const { size } = this\n\n let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size)\n let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size)\n\n const span = Math.max(relativeEnd - relativeStart, 0)\n const parts = this.#parts\n const blobParts = []\n let added = 0\n\n for (const part of parts) {\n // don't add the overflow to new blobParts\n if (added >= span) {\n break\n }\n\n const size = ArrayBuffer.isView(part) ? part.byteLength : part.size\n if (relativeStart && size <= relativeStart) {\n // Skip the beginning and change the relative\n // start & end position as we skip the unwanted parts\n relativeStart -= size\n relativeEnd -= size\n } else {\n let chunk\n if (ArrayBuffer.isView(part)) {\n chunk = part.subarray(relativeStart, Math.min(size, relativeEnd))\n added += chunk.byteLength\n } else {\n chunk = part.slice(relativeStart, Math.min(size, relativeEnd))\n added += chunk.size\n }\n relativeEnd -= size\n blobParts.push(chunk)\n relativeStart = 0 // All next sequential parts should start at 0\n }\n }\n\n const blob = new Blob([], { type: String(type).toLowerCase() })\n blob.#size = span\n blob.#parts = blobParts\n\n return blob\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n\n static [Symbol.hasInstance] (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.constructor === 'function' &&\n (\n typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function'\n ) &&\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n }\n}\n\nObject.defineProperties(_Blob.prototype, {\n size: { enumerable: true },\n type: { enumerable: true },\n slice: { enumerable: true }\n})\n\n/** @type {typeof globalThis.Blob} */\nexport const Blob = _Blob\nexport default Blob\n", "import Blob from './index.js'\n\nconst _File = class File extends Blob {\n #lastModified = 0\n #name = ''\n\n /**\n * @param {*[]} fileBits\n * @param {string} fileName\n * @param {{lastModified?: number, type?: string}} options\n */// @ts-ignore\n constructor (fileBits, fileName, options = {}) {\n if (arguments.length < 2) {\n throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)\n }\n super(fileBits, options)\n\n if (options === null) options = {}\n\n // Simulate WebIDL type casting for NaN value in lastModified option.\n const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified)\n if (!Number.isNaN(lastModified)) {\n this.#lastModified = lastModified\n }\n\n this.#name = String(fileName)\n }\n\n get name () {\n return this.#name\n }\n\n get lastModified () {\n return this.#lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n\n static [Symbol.hasInstance] (object) {\n return !!object && object instanceof Blob &&\n /^(File)$/.test(object[Symbol.toStringTag])\n }\n}\n\n/** @type {typeof globalThis.File} */// @ts-ignore\nexport const File = _File\nexport default File\n", "/*! formdata-polyfill. MIT License. Jimmy W\u00E4rting <https://jimmy.warting.se/opensource> */\n\nimport C from 'fetch-blob'\nimport F from 'fetch-blob/file.js'\n\nvar {toStringTag:t,iterator:i,hasInstance:h}=Symbol,\nr=Math.random,\nm='append,set,get,getAll,delete,keys,values,entries,forEach,constructor'.split(','),\nf=(a,b,c)=>(a+='',/^(Blob|File)$/.test(b && b[t])?[(c=c!==void 0?c+'':b[t]=='File'?b.name:'blob',a),b.name!==c||b[t]=='blob'?new F([b],c,b):b]:[a,b+'']),\ne=(c,f)=>(f?c:c.replace(/\\r?\\n|\\r/g,'\\r\\n')).replace(/\\n/g,'%0A').replace(/\\r/g,'%0D').replace(/\"/g,'%22'),\nx=(n, a, e)=>{if(a.length<e){throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e} arguments required, but only ${a.length} present.`)}}\n\nexport const File = F\n\n/** @type {typeof globalThis.FormData} */\nexport const FormData = class FormData {\n#d=[];\nconstructor(...a){if(a.length)throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`)}\nget [t]() {return 'FormData'}\n[i](){return this.entries()}\nstatic [h](o) {return o&&typeof o==='object'&&o[t]==='FormData'&&!m.some(m=>typeof o[m]!='function')}\nappend(...a){x('append',arguments,2);this.#d.push(f(...a))}\ndelete(a){x('delete',arguments,1);a+='';this.#d=this.#d.filter(([b])=>b!==a)}\nget(a){x('get',arguments,1);a+='';for(var b=this.#d,l=b.length,c=0;c<l;c++)if(b[c][0]===a)return b[c][1];return null}\ngetAll(a,b){x('getAll',arguments,1);b=[];a+='';this.#d.forEach(c=>c[0]===a&&b.push(c[1]));return b}\nhas(a){x('has',arguments,1);a+='';return this.#d.some(b=>b[0]===a)}\nforEach(a,b){x('forEach',arguments,1);for(var [c,d]of this)a.call(b,d,c,this)}\nset(...a){x('set',arguments,2);var b=[],c=!0;a=f(...a);this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)});c&&b.push(a);this.#d=b}\n*entries(){yield*this.#d}\n*keys(){for(var[a]of this)yield a}\n*values(){for(var[,a]of this)yield a}}\n\n/** @param {FormData} F */\nexport function formDataToBlob (F,B=C){\nvar b=`${r()}${r()}`.replace(/\\./g, '').slice(-28).padStart(32, '-'),c=[],p=`--${b}\\r\\nContent-Disposition: form-data; name=\"`\nF.forEach((v,n)=>typeof v=='string'\n?c.push(p+e(n)+`\"\\r\\n\\r\\n${v.replace(/\\r(?!\\n)|(?<!\\r)\\n/g, '\\r\\n')}\\r\\n`)\n:c.push(p+e(n)+`\"; filename=\"${e(v.name, 1)}\"\\r\\nContent-Type: ${v.type||\"application/octet-stream\"}\\r\\n\\r\\n`, v, '\\r\\n'))\nc.push(`--${b}--`)\nreturn new B(c,{type:\"multipart/form-data; boundary=\"+b})}\n", "export class FetchBaseError extends Error {\n\tconstructor(message, type) {\n\t\tsuper(message);\n\t\t// Hide custom error implementation details from end-users\n\t\tError.captureStackTrace(this, this.constructor);\n\n\t\tthis.type = type;\n\t}\n\n\tget name() {\n\t\treturn this.constructor.name;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n}\n", "\nimport {FetchBaseError} from './base.js';\n\n/**\n * @typedef {{ address?: string, code: string, dest?: string, errno: number, info?: object, message: string, path?: string, port?: number, syscall: string}} SystemError\n*/\n\n/**\n * FetchError interface for operational errors\n */\nexport class FetchError extends FetchBaseError {\n\t/**\n\t * @param {string} message - Error message for human\n\t * @param {string} [type] - Error type for machine\n\t * @param {SystemError} [systemError] - For Node.js system error\n\t */\n\tconstructor(message, type, systemError) {\n\t\tsuper(message, type);\n\t\t// When err.type is `system`, err.erroredSysCall contains system error and err.code contains system error code\n\t\tif (systemError) {\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tthis.code = this.errno = systemError.code;\n\t\t\tthis.erroredSysCall = systemError.syscall;\n\t\t}\n\t}\n}\n", "/**\n * Is.js\n *\n * Object type checks.\n */\n\nconst NAME = Symbol.toStringTag;\n\n/**\n * Check if `obj` is a URLSearchParams object\n * ref: https://github.com/node-fetch/node-fetch/issues/296#issuecomment-307598143\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isURLSearchParameters = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.append === 'function' &&\n\t\ttypeof object.delete === 'function' &&\n\t\ttypeof object.get === 'function' &&\n\t\ttypeof object.getAll === 'function' &&\n\t\ttypeof object.has === 'function' &&\n\t\ttypeof object.set === 'function' &&\n\t\ttypeof object.sort === 'function' &&\n\t\tobject[NAME] === 'URLSearchParams'\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isBlob = object => {\n\treturn (\n\t\tobject &&\n\t\ttypeof object === 'object' &&\n\t\ttypeof object.arrayBuffer === 'function' &&\n\t\ttypeof object.type === 'string' &&\n\t\ttypeof object.stream === 'function' &&\n\t\ttypeof object.constructor === 'function' &&\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isAbortSignal = object => {\n\treturn (\n\t\ttypeof object === 'object' && (\n\t\t\tobject[NAME] === 'AbortSignal' ||\n\t\t\tobject[NAME] === 'EventTarget'\n\t\t)\n\t);\n};\n\n/**\n * isDomainOrSubdomain reports whether sub is a subdomain (or exact match) of\n * the parent domain.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isDomainOrSubdomain = (destination, original) => {\n\tconst orig = new URL(original).hostname;\n\tconst dest = new URL(destination).hostname;\n\n\treturn orig === dest || orig.endsWith(`.${dest}`);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isSameProtocol = (destination, original) => {\n\tconst orig = new URL(original).protocol;\n\tconst dest = new URL(destination).protocol;\n\n\treturn orig === dest;\n};\n", "/*! node-domexception. MIT License. Jimmy W\u00E4rting <https://jimmy.warting.se/opensource> */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require('worker_threads'),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === 'DOMException' && (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n", "import { statSync, createReadStream, promises as fs } from 'node:fs'\nimport { basename } from 'node:path'\nimport DOMException from 'node-domexception'\n\nimport File from './file.js'\nimport Blob from './index.js'\n\nconst { stat } = fs\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst blobFromSync = (path, type) => fromBlob(statSync(path), path, type)\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise<Blob>}\n */\nconst blobFrom = (path, type) => stat(path).then(stat => fromBlob(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise<File>}\n */\nconst fileFrom = (path, type) => stat(path).then(stat => fromFile(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst fileFromSync = (path, type) => fromFile(statSync(path), path, type)\n\n// @ts-ignore\nconst fromBlob = (stat, path, type = '') => new Blob([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], { type })\n\n// @ts-ignore\nconst fromFile = (stat, path, type = '') => new File([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], basename(path), { type, lastModified: stat.mtimeMs })\n\n/**\n * This is a blob backed up by a file on the disk\n * with minium requirement. Its wrapped around a Blob as a blobPart\n * so you have no direct access to this.\n *\n * @private\n */\nclass BlobDataItem {\n #path\n #start\n\n constructor (options) {\n this.#path = options.path\n this.#start = options.start\n this.size = options.size\n this.lastModified = options.lastModified\n }\n\n /**\n * Slicing arguments is first validated and formatted\n * to not be out of range by Blob.prototype.slice\n */\n slice (start, end) {\n return new BlobDataItem({\n path: this.#path,\n lastModified: this.lastModified,\n size: end - start,\n start: this.#start + start\n })\n }\n\n async * stream () {\n const { mtimeMs } = await stat(this.#path)\n if (mtimeMs > this.lastModified) {\n throw new DOMException('The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.', 'NotReadableError')\n }\n yield * createReadStream(this.#path, {\n start: this.#start,\n end: this.#start + this.size - 1\n })\n }\n\n get [Symbol.toStringTag] () {\n return 'Blob'\n }\n}\n\nexport default blobFromSync\nexport { File, Blob, blobFrom, blobFromSync, fileFrom, fileFromSync }\n", "import {File} from 'fetch-blob/from.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\n\nlet s = 0;\nconst S = {\n\tSTART_BOUNDARY: s++,\n\tHEADER_FIELD_START: s++,\n\tHEADER_FIELD: s++,\n\tHEADER_VALUE_START: s++,\n\tHEADER_VALUE: s++,\n\tHEADER_VALUE_ALMOST_DONE: s++,\n\tHEADERS_ALMOST_DONE: s++,\n\tPART_DATA_START: s++,\n\tPART_DATA: s++,\n\tEND: s++\n};\n\nlet f = 1;\nconst F = {\n\tPART_BOUNDARY: f,\n\tLAST_BOUNDARY: f *= 2\n};\n\nconst LF = 10;\nconst CR = 13;\nconst SPACE = 32;\nconst HYPHEN = 45;\nconst COLON = 58;\nconst A = 97;\nconst Z = 122;\n\nconst lower = c => c | 0x20;\n\nconst noop = () => {};\n\nclass MultipartParser {\n\t/**\n\t * @param {string} boundary\n\t */\n\tconstructor(boundary) {\n\t\tthis.index = 0;\n\t\tthis.flags = 0;\n\n\t\tthis.onHeaderEnd = noop;\n\t\tthis.onHeaderField = noop;\n\t\tthis.onHeadersEnd = noop;\n\t\tthis.onHeaderValue = noop;\n\t\tthis.onPartBegin = noop;\n\t\tthis.onPartData = noop;\n\t\tthis.onPartEnd = noop;\n\n\t\tthis.boundaryChars = {};\n\n\t\tboundary = '\\r\\n--' + boundary;\n\t\tconst ui8a = new Uint8Array(boundary.length);\n\t\tfor (let i = 0; i < boundary.length; i++) {\n\t\t\tui8a[i] = boundary.charCodeAt(i);\n\t\t\tthis.boundaryChars[ui8a[i]] = true;\n\t\t}\n\n\t\tthis.boundary = ui8a;\n\t\tthis.lookbehind = new Uint8Array(this.boundary.length + 8);\n\t\tthis.state = S.START_BOUNDARY;\n\t}\n\n\t/**\n\t * @param {Uint8Array} data\n\t */\n\twrite(data) {\n\t\tlet i = 0;\n\t\tconst length_ = data.length;\n\t\tlet previousIndex = this.index;\n\t\tlet {lookbehind, boundary, boundaryChars, index, state, flags} = this;\n\t\tconst boundaryLength = this.boundary.length;\n\t\tconst boundaryEnd = boundaryLength - 1;\n\t\tconst bufferLength = data.length;\n\t\tlet c;\n\t\tlet cl;\n\n\t\tconst mark = name => {\n\t\t\tthis[name + 'Mark'] = i;\n\t\t};\n\n\t\tconst clear = name => {\n\t\t\tdelete this[name + 'Mark'];\n\t\t};\n\n\t\tconst callback = (callbackSymbol, start, end, ui8a) => {\n\t\t\tif (start === undefined || start !== end) {\n\t\t\t\tthis[callbackSymbol](ui8a && ui8a.subarray(start, end));\n\t\t\t}\n\t\t};\n\n\t\tconst dataCallback = (name, clear) => {\n\t\t\tconst markSymbol = name + 'Mark';\n\t\t\tif (!(markSymbol in this)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (clear) {\n\t\t\t\tcallback(name, this[markSymbol], i, data);\n\t\t\t\tdelete this[markSymbol];\n\t\t\t} else {\n\t\t\t\tcallback(name, this[markSymbol], data.length, data);\n\t\t\t\tthis[markSymbol] = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (i = 0; i < length_; i++) {\n\t\t\tc = data[i];\n\n\t\t\tswitch (state) {\n\t\t\t\tcase S.START_BOUNDARY:\n\t\t\t\t\tif (index === boundary.length - 2) {\n\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else if (c !== CR) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (index - 1 === boundary.length - 2) {\n\t\t\t\t\t\tif (flags & F.LAST_BOUNDARY && c === HYPHEN) {\n\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c !== boundary[index + 2]) {\n\t\t\t\t\t\tindex = -2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === boundary[index + 2]) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_FIELD_START:\n\t\t\t\t\tstate = S.HEADER_FIELD;\n\t\t\t\t\tmark('onHeaderField');\n\t\t\t\t\tindex = 0;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_FIELD:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tclear('onHeaderField');\n\t\t\t\t\t\tstate = S.HEADERS_ALMOST_DONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === COLON) {\n\t\t\t\t\t\tif (index === 1) {\n\t\t\t\t\t\t\t// empty header field\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdataCallback('onHeaderField', true);\n\t\t\t\t\t\tstate = S.HEADER_VALUE_START;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcl = lower(c);\n\t\t\t\t\tif (cl < A || cl > Z) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_START:\n\t\t\t\t\tif (c === SPACE) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tmark('onHeaderValue');\n\t\t\t\t\tstate = S.HEADER_VALUE;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_VALUE:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tdataCallback('onHeaderValue', true);\n\t\t\t\t\t\tcallback('onHeaderEnd');\n\t\t\t\t\t\tstate = S.HEADER_VALUE_ALMOST_DONE;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADERS_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback('onHeadersEnd');\n\t\t\t\t\tstate = S.PART_DATA_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.PART_DATA_START:\n\t\t\t\t\tstate = S.PART_DATA;\n\t\t\t\t\tmark('onPartData');\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.PART_DATA:\n\t\t\t\t\tpreviousIndex = index;\n\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t// boyer-moore derrived algorithm to safely skip non-boundary data\n\t\t\t\t\t\ti += boundaryEnd;\n\t\t\t\t\t\twhile (i < bufferLength && !(data[i] in boundaryChars)) {\n\t\t\t\t\t\t\ti += boundaryLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti -= boundaryEnd;\n\t\t\t\t\t\tc = data[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < boundary.length) {\n\t\t\t\t\t\tif (boundary[index] === c) {\n\t\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\t\tdataCallback('onPartData', true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === boundary.length) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\t\t// CR = part boundary\n\t\t\t\t\t\t\tflags |= F.PART_BOUNDARY;\n\t\t\t\t\t\t} else if (c === HYPHEN) {\n\t\t\t\t\t\t\t// HYPHEN = end boundary\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index - 1 === boundary.length) {\n\t\t\t\t\t\tif (flags & F.PART_BOUNDARY) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tif (c === LF) {\n\t\t\t\t\t\t\t\t// unset the PART_BOUNDARY flag\n\t\t\t\t\t\t\t\tflags &= ~F.PART_BOUNDARY;\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (flags & F.LAST_BOUNDARY) {\n\t\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t// when matching a possible boundary, keep a lookbehind reference\n\t\t\t\t\t\t// in case it turns out to be a false lead\n\t\t\t\t\t\tlookbehind[index - 1] = c;\n\t\t\t\t\t} else if (previousIndex > 0) {\n\t\t\t\t\t\t// if our boundary turned out to be rubbish, the captured lookbehind\n\t\t\t\t\t\t// belongs to partData\n\t\t\t\t\t\tconst _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);\n\t\t\t\t\t\tcallback('onPartData', 0, previousIndex, _lookbehind);\n\t\t\t\t\t\tpreviousIndex = 0;\n\t\t\t\t\t\tmark('onPartData');\n\n\t\t\t\t\t\t// reconsider the current character even so it interrupted the sequence\n\t\t\t\t\t\t// it could be the beginning of a new sequence\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.END:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Unexpected state entered: ${state}`);\n\t\t\t}\n\t\t}\n\n\t\tdataCallback('onHeaderField');\n\t\tdataCallback('onHeaderValue');\n\t\tdataCallback('onPartData');\n\n\t\t// Update properties for the next call\n\t\tthis.index = index;\n\t\tthis.state = state;\n\t\tthis.flags = flags;\n\t}\n\n\tend() {\n\t\tif ((this.state === S.HEADER_FIELD_START && this.index === 0) ||\n\t\t\t(this.state === S.PART_DATA && this.index === this.boundary.length)) {\n\t\t\tthis.onPartEnd();\n\t\t} else if (this.state !== S.END) {\n\t\t\tthrow new Error('MultipartParser.end(): stream ended unexpectedly');\n\t\t}\n\t}\n}\n\nfunction _fileName(headerValue) {\n\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\tconst m = headerValue.match(/\\bfilename=(\"(.*?)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))($|;\\s)/i);\n\tif (!m) {\n\t\treturn;\n\t}\n\n\tconst match = m[2] || m[3] || '';\n\tlet filename = match.slice(match.lastIndexOf('\\\\') + 1);\n\tfilename = filename.replace(/%22/g, '\"');\n\tfilename = filename.replace(/&#(\\d{4});/g, (m, code) => {\n\t\treturn String.fromCharCode(code);\n\t});\n\treturn filename;\n}\n\nexport async function toFormData(Body, ct) {\n\tif (!/multipart/i.test(ct)) {\n\t\tthrow new TypeError('Failed to fetch');\n\t}\n\n\tconst m = ct.match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\n\n\tif (!m) {\n\t\tthrow new TypeError('no or bad content-type header, no multipart boundary');\n\t}\n\n\tconst parser = new MultipartParser(m[1] || m[2]);\n\n\tlet headerField;\n\tlet headerValue;\n\tlet entryValue;\n\tlet entryName;\n\tlet contentType;\n\tlet filename;\n\tconst entryChunks = [];\n\tconst formData = new FormData();\n\n\tconst onPartData = ui8a => {\n\t\tentryValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tconst appendToFile = ui8a => {\n\t\tentryChunks.push(ui8a);\n\t};\n\n\tconst appendFileToFormData = () => {\n\t\tconst file = new File(entryChunks, filename, {type: contentType});\n\t\tformData.append(entryName, file);\n\t};\n\n\tconst appendEntryToFormData = () => {\n\t\tformData.append(entryName, entryValue);\n\t};\n\n\tconst decoder = new TextDecoder('utf-8');\n\tdecoder.decode();\n\n\tparser.onPartBegin = function () {\n\t\tparser.onPartData = onPartData;\n\t\tparser.onPartEnd = appendEntryToFormData;\n\n\t\theaderField = '';\n\t\theaderValue = '';\n\t\tentryValue = '';\n\t\tentryName = '';\n\t\tcontentType = '';\n\t\tfilename = null;\n\t\tentryChunks.length = 0;\n\t};\n\n\tparser.onHeaderField = function (ui8a) {\n\t\theaderField += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderValue = function (ui8a) {\n\t\theaderValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderEnd = function () {\n\t\theaderValue += decoder.decode();\n\t\theaderField = headerField.toLowerCase();\n\n\t\tif (headerField === 'content-disposition') {\n\t\t\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\t\t\tconst m = headerValue.match(/\\bname=(\"([^\"]*)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))/i);\n\n\t\t\tif (m) {\n\t\t\t\tentryName = m[2] || m[3] || '';\n\t\t\t}\n\n\t\t\tfilename = _fileName(headerValue);\n\n\t\t\tif (filename) {\n\t\t\t\tparser.onPartData = appendToFile;\n\t\t\t\tparser.onPartEnd = appendFileToFormData;\n\t\t\t}\n\t\t} else if (headerField === 'content-type') {\n\t\t\tcontentType = headerValue;\n\t\t}\n\n\t\theaderValue = '';\n\t\theaderField = '';\n\t};\n\n\tfor await (const chunk of Body) {\n\t\tparser.write(chunk);\n\t}\n\n\tparser.end();\n\n\treturn formData;\n}\n", "\n/**\n * Body.js\n *\n * Body interface provides common methods for Request and Response\n */\n\nimport Stream, {PassThrough} from 'node:stream';\nimport {types, deprecate, promisify} from 'node:util';\nimport {Buffer} from 'node:buffer';\n\nimport Blob from 'fetch-blob';\nimport {FormData, formDataToBlob} from 'formdata-polyfill/esm.min.js';\n\nimport {FetchError} from './errors/fetch-error.js';\nimport {FetchBaseError} from './errors/base.js';\nimport {isBlob, isURLSearchParameters} from './utils/is.js';\n\nconst pipeline = promisify(Stream.pipeline);\nconst INTERNALS = Symbol('Body internals');\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Body {\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tlet boundary = null;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tbody = null;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t\t// Body is a URLSearchParams\n\t\t\tbody = Buffer.from(body.toString());\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t} else if (Buffer.isBuffer(body)) {\n\t\t\t// Body is Buffer\n\t\t} else if (types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tbody = Buffer.from(body);\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t\t} else if (body instanceof Stream) {\n\t\t\t// Body is stream\n\t\t} else if (body instanceof FormData) {\n\t\t\t// Body is FormData\n\t\t\tbody = formDataToBlob(body);\n\t\t\tboundary = body.type.split('=')[1];\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tbody = Buffer.from(String(body));\n\t\t}\n\n\t\tlet stream = body;\n\n\t\tif (Buffer.isBuffer(body)) {\n\t\t\tstream = Stream.Readable.from(body);\n\t\t} else if (isBlob(body)) {\n\t\t\tstream = Stream.Readable.from(body.stream());\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tbody,\n\t\t\tstream,\n\t\t\tboundary,\n\t\t\tdisturbed: false,\n\t\t\terror: null\n\t\t};\n\t\tthis.size = size;\n\n\t\tif (body instanceof Stream) {\n\t\t\tbody.on('error', error_ => {\n\t\t\t\tconst error = error_ instanceof FetchBaseError ?\n\t\t\t\t\terror_ :\n\t\t\t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, 'system', error_);\n\t\t\t\tthis[INTERNALS].error = error;\n\t\t\t});\n\t\t}\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS].stream;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return Promise\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\tasync formData() {\n\t\tconst ct = this.headers.get('content-type');\n\n\t\tif (ct.startsWith('application/x-www-form-urlencoded')) {\n\t\t\tconst formData = new FormData();\n\t\t\tconst parameters = new URLSearchParams(await this.text());\n\n\t\t\tfor (const [name, value] of parameters) {\n\t\t\t\tformData.append(name, value);\n\t\t\t}\n\n\t\t\treturn formData;\n\t\t}\n\n\t\tconst {toFormData} = await import('./utils/multipart-parser.js');\n\t\treturn toFormData(this.body, ct);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS].body && this[INTERNALS].body.type) || '';\n\t\tconst buf = await this.arrayBuffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\tconst text = await this.text();\n\t\treturn JSON.parse(text);\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn new TextDecoder().decode(buffer);\n\t}\n\n\t/**\n\t * Decode response as buffer (non-spec api)\n\t *\n\t * @return Promise\n\t */\n\tbuffer() {\n\t\treturn consumeBody(this);\n\t}\n}\n\nBody.prototype.buffer = deprecate(Body.prototype.buffer, 'Please use \\'response.arrayBuffer()\\' instead of \\'response.buffer()\\'', 'node-fetch#buffer');\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tdata: {get: deprecate(() => {},\n\t\t'data doesn\\'t exist, use json(), text(), arrayBuffer(), or body instead',\n\t\t'https://github.com/node-fetch/node-fetch/issues/1000 (response)')}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nasync function consumeBody(data) {\n\tif (data[INTERNALS].disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tdata[INTERNALS].disturbed = true;\n\n\tif (data[INTERNALS].error) {\n\t\tthrow data[INTERNALS].error;\n\t}\n\n\tconst {body} = data;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t/* c8 ignore next 3 */\n\tif (!(body instanceof Stream)) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\tconst accum = [];\n\tlet accumBytes = 0;\n\n\ttry {\n\t\tfor await (const chunk of body) {\n\t\t\tif (data.size > 0 && accumBytes + chunk.length > data.size) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, 'max-size');\n\t\t\t\tbody.destroy(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t}\n\t} catch (error) {\n\t\tconst error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, 'system', error);\n\t\tthrow error_;\n\t}\n\n\tif (body.readableEnded === true || body._readableState.ended === true) {\n\t\ttry {\n\t\t\tif (accum.every(c => typeof c === 'string')) {\n\t\t\t\treturn Buffer.from(accum.join(''));\n\t\t\t}\n\n\t\t\treturn Buffer.concat(accum, accumBytes);\n\t\t} catch (error) {\n\t\t\tthrow new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, 'system', error);\n\t\t}\n\t} else {\n\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`);\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @param String highWaterMark highWaterMark for both PassThrough body streams\n * @return Mixed\n */\nexport const clone = (instance, highWaterMark) => {\n\tlet p1;\n\tlet p2;\n\tlet {body} = instance[INTERNALS];\n\n\t// Don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// Check that body is a stream and not form-data object\n\t// note: we can't clone the form-data object without having it as a dependency\n\tif ((body instanceof Stream) && (typeof body.getBoundary !== 'function')) {\n\t\t// Tee instance body\n\t\tp1 = new PassThrough({highWaterMark});\n\t\tp2 = new PassThrough({highWaterMark});\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// Set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].stream = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n};\n\nconst getNonSpecFormDataBoundary = deprecate(\n\tbody => body.getBoundary(),\n\t'form-data doesn\\'t follow the spec and requires special treatment. Use alternative package',\n\t'https://github.com/node-fetch/node-fetch/issues/1167'\n);\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {any} body Any options.body input\n * @returns {string | null}\n */\nexport const extractContentType = (body, request) => {\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn null;\n\t}\n\n\t// Body is string\n\tif (typeof body === 'string') {\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n\n\t// Body is a URLSearchParams\n\tif (isURLSearchParameters(body)) {\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t}\n\n\t// Body is blob\n\tif (isBlob(body)) {\n\t\treturn body.type || null;\n\t}\n\n\t// Body is a Buffer (Buffer, ArrayBuffer or ArrayBufferView)\n\tif (Buffer.isBuffer(body) || types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {\n\t\treturn null;\n\t}\n\n\tif (body instanceof FormData) {\n\t\treturn `multipart/form-data; boundary=${request[INTERNALS].boundary}`;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getBoundary === 'function') {\n\t\treturn `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`;\n\t}\n\n\t// Body is stream - can't really do much about this\n\tif (body instanceof Stream) {\n\t\treturn null;\n\t}\n\n\t// Body constructor defaults other things to string\n\treturn 'text/plain;charset=UTF-8';\n};\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {any} obj.body Body object from the Body instance.\n * @returns {number | null}\n */\nexport const getTotalBytes = request => {\n\tconst {body} = request[INTERNALS];\n\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn 0;\n\t}\n\n\t// Body is Blob\n\tif (isBlob(body)) {\n\t\treturn body.size;\n\t}\n\n\t// Body is Buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn body.length;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body && typeof body.getLengthSync === 'function') {\n\t\treturn body.hasKnownLength && body.hasKnownLength() ? body.getLengthSync() : null;\n\t}\n\n\t// Body is stream\n\treturn null;\n};\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest The stream to write to.\n * @param obj.body Body object from the Body instance.\n * @returns {Promise<void>}\n */\nexport const writeToStream = async (dest, {body}) => {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\t// Body is stream\n\t\tawait pipeline(body, dest);\n\t}\n};\n", "/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nimport {types} from 'node:util';\nimport http from 'node:http';\n\n/* c8 ignore next 9 */\nconst validateHeaderName = typeof http.validateHeaderName === 'function' ?\n\thttp.validateHeaderName :\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst error = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/* c8 ignore next 9 */\nconst validateHeaderValue = typeof http.validateHeaderValue === 'function' ?\n\thttp.validateHeaderValue :\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst error = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record<string, string> | Iterable<readonly [string, string]> | Iterable<Iterable<string>>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n */\nexport default class Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\t\t// No op\n\t\t} else if (typeof init === 'object' && !types.isBoxedPrimitive(init)) {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\t\tif (method == null) {\n\t\t\t\t// Record<ByteString, ByteString>\n\t\t\t\tresult.push(...Object.entries(init));\n\t\t\t} else {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// Sequence<sequence<ByteString>>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tresult = [...init]\n\t\t\t\t\t.map(pair => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof pair !== 'object' || types.isBoxedPrimitive(pair)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t}).map(pair => {\n\t\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence<sequence<ByteString>> or record<ByteString, ByteString>)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\tundefined;\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t/* c8 ignore next */\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield this.get(name);\n\t\t}\n\t}\n\n\t/**\n\t * @type {() => IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, this.get(name)];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record<string, string[]>}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, {});\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, {})\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nexport function fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n", "const redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nexport const isRedirect = code => {\n\treturn redirectStatus.has(code);\n};\n", "/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType} from './body.js';\nimport {isRedirect} from './utils/is-redirect.js';\n\nconst INTERNALS = Symbol('Response internals');\n\n/**\n * Response class\n *\n * Ref: https://fetch.spec.whatwg.org/#response-class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Response extends Body {\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq, no-negated-condition\n\t\tconst status = options.status != null ? options.status : 200;\n\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\ttype: 'default',\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || '',\n\t\t\theaders,\n\t\t\tcounter: options.counter,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\tget type() {\n\t\treturn this[INTERNALS].type;\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS].status >= 200 && this[INTERNALS].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @return Response\n\t */\n\tclone() {\n\t\treturn new Response(clone(this, this.highWaterMark), {\n\t\t\ttype: this.type,\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected,\n\t\t\tsize: this.size,\n\t\t\thighWaterMark: this.highWaterMark\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tstatic error() {\n\t\tconst response = new Response(null, {status: 0, statusText: ''});\n\t\tresponse[INTERNALS].type = 'error';\n\t\treturn response;\n\t}\n\n\tstatic json(data = undefined, init = {}) {\n\t\tconst body = JSON.stringify(data);\n\n\t\tif (body === undefined) {\n\t\t\tthrow new TypeError('data is not JSON serializable');\n\t\t}\n\n\t\tconst headers = new Headers(init && init.headers);\n\n\t\tif (!headers.has('content-type')) {\n\t\t\theaders.set('content-type', 'application/json');\n\t\t}\n\n\t\treturn new Response(body, {\n\t\t\t...init,\n\t\t\theaders\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Response';\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\ttype: {enumerable: true},\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n", "export const getSearch = parsedURL => {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');\n\treturn parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';\n};\n", "import {isIP} from 'node:net';\n\n/**\n * @external URL\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL}\n */\n\n/**\n * @module utils/referrer\n * @private\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy \u00A78.4. Strip url for use as a referrer}\n * @param {string} URL\n * @param {boolean} [originOnly=false]\n */\nexport function stripURLForUseAsAReferrer(url, originOnly = false) {\n\t// 1. If url is null, return no referrer.\n\tif (url == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\treturn 'no-referrer';\n\t}\n\n\turl = new URL(url);\n\n\t// 2. If url's scheme is a local scheme, then return no referrer.\n\tif (/^(about|blob|data):$/.test(url.protocol)) {\n\t\treturn 'no-referrer';\n\t}\n\n\t// 3. Set url's username to the empty string.\n\turl.username = '';\n\n\t// 4. Set url's password to null.\n\t// Note: `null` appears to be a mistake as this actually results in the password being `\"null\"`.\n\turl.password = '';\n\n\t// 5. Set url's fragment to null.\n\t// Note: `null` appears to be a mistake as this actually results in the fragment being `\"#null\"`.\n\turl.hash = '';\n\n\t// 6. If the origin-only flag is true, then:\n\tif (originOnly) {\n\t\t// 6.1. Set url's path to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the path being `\"/null\"`.\n\t\turl.pathname = '';\n\n\t\t// 6.2. Set url's query to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the query being `\"?null\"`.\n\t\turl.search = '';\n\t}\n\n\t// 7. Return url.\n\treturn url;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy|enum ReferrerPolicy}\n */\nexport const ReferrerPolicy = new Set([\n\t'',\n\t'no-referrer',\n\t'no-referrer-when-downgrade',\n\t'same-origin',\n\t'origin',\n\t'strict-origin',\n\t'origin-when-cross-origin',\n\t'strict-origin-when-cross-origin',\n\t'unsafe-url'\n]);\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#default-referrer-policy|default referrer policy}\n */\nexport const DEFAULT_REFERRER_POLICY = 'strict-origin-when-cross-origin';\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#referrer-policies|Referrer Policy \u00A73. Referrer Policies}\n * @param {string} referrerPolicy\n * @returns {string} referrerPolicy\n */\nexport function validateReferrerPolicy(referrerPolicy) {\n\tif (!ReferrerPolicy.has(referrerPolicy)) {\n\t\tthrow new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);\n\t}\n\n\treturn referrerPolicy;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy|Referrer Policy \u00A73.2. Is origin potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isOriginPotentiallyTrustworthy(url) {\n\t// 1. If origin is an opaque origin, return \"Not Trustworthy\".\n\t// Not applicable\n\n\t// 2. Assert: origin is a tuple origin.\n\t// Not for implementations\n\n\t// 3. If origin's scheme is either \"https\" or \"wss\", return \"Potentially Trustworthy\".\n\tif (/^(http|ws)s:$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 4. If origin's host component matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return \"Potentially Trustworthy\".\n\tconst hostIp = url.host.replace(/(^\\[)|(]$)/g, '');\n\tconst hostIPVersion = isIP(hostIp);\n\n\tif (hostIPVersion === 4 && /^127\\./.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\tif (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\t// 5. If origin's host component is \"localhost\" or falls within \".localhost\", and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return \"Potentially Trustworthy\".\n\t// We are returning FALSE here because we cannot ensure conformance to\n\t// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)\n\tif (url.host === 'localhost' || url.host.endsWith('.localhost')) {\n\t\treturn false;\n\t}\n\n\t// 6. If origin's scheme component is file, return \"Potentially Trustworthy\".\n\tif (url.protocol === 'file:') {\n\t\treturn true;\n\t}\n\n\t// 7. If origin's scheme component is one which the user agent considers to be authenticated, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 8. If origin has been configured as a trustworthy origin, return \"Potentially Trustworthy\".\n\t// Not supported\n\n\t// 9. Return \"Not Trustworthy\".\n\treturn false;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy|Referrer Policy \u00A73.3. Is url potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \"Potentially Trustworthy\", `false`: \"Not Trustworthy\"\n */\nexport function isUrlPotentiallyTrustworthy(url) {\n\t// 1. If url is \"about:blank\" or \"about:srcdoc\", return \"Potentially Trustworthy\".\n\tif (/^about:(blank|srcdoc)$/.test(url)) {\n\t\treturn true;\n\t}\n\n\t// 2. If url's scheme is \"data\", return \"Potentially Trustworthy\".\n\tif (url.protocol === 'data:') {\n\t\treturn true;\n\t}\n\n\t// Note: The origin of blob: and filesystem: URLs is the origin of the context in which they were\n\t// created. Therefore, blobs created in a trustworthy origin will themselves be potentially\n\t// trustworthy.\n\tif (/^(blob|filesystem):$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 3. Return the result of executing \u00A73.2 Is origin potentially trustworthy? on url's origin.\n\treturn isOriginPotentiallyTrustworthy(url);\n}\n\n/**\n * Modifies the referrerURL to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerURLCallback\n * @param {external:URL} referrerURL\n * @returns {external:URL} modified referrerURL\n */\n\n/**\n * Modifies the referrerOrigin to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request's Referrer}, step 7\n * @callback module:utils/referrer~referrerOriginCallback\n * @param {external:URL} referrerOrigin\n * @returns {external:URL} modified referrerOrigin\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request's Referrer}\n * @param {Request} request\n * @param {object} o\n * @param {module:utils/referrer~referrerURLCallback} o.referrerURLCallback\n * @param {module:utils/referrer~referrerOriginCallback} o.referrerOriginCallback\n * @returns {external:URL} Request's referrer\n */\nexport function determineRequestsReferrer(request, {referrerURLCallback, referrerOriginCallback} = {}) {\n\t// There are 2 notes in the specification about invalid pre-conditions. We return null, here, for\n\t// these cases:\n\t// > Note: If request's referrer is \"no-referrer\", Fetch will not call into this algorithm.\n\t// > Note: If request's referrer policy is the empty string, Fetch will not call into this\n\t// > algorithm.\n\tif (request.referrer === 'no-referrer' || request.referrerPolicy === '') {\n\t\treturn null;\n\t}\n\n\t// 1. Let policy be request's associated referrer policy.\n\tconst policy = request.referrerPolicy;\n\n\t// 2. Let environment be request's client.\n\t// not applicable to node.js\n\n\t// 3. Switch on request's referrer:\n\tif (request.referrer === 'about:client') {\n\t\treturn 'no-referrer';\n\t}\n\n\t// \"a URL\": Let referrerSource be request's referrer.\n\tconst referrerSource = request.referrer;\n\n\t// 4. Let request's referrerURL be the result of stripping referrerSource for use as a referrer.\n\tlet referrerURL = stripURLForUseAsAReferrer(referrerSource);\n\n\t// 5. Let referrerOrigin be the result of stripping referrerSource for use as a referrer, with the\n\t// origin-only flag set to true.\n\tlet referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true);\n\n\t// 6. If the result of serializing referrerURL is a string whose length is greater than 4096, set\n\t// referrerURL to referrerOrigin.\n\tif (referrerURL.toString().length > 4096) {\n\t\treferrerURL = referrerOrigin;\n\t}\n\n\t// 7. The user agent MAY alter referrerURL or referrerOrigin at this point to enforce arbitrary\n\t// policy considerations in the interests of minimizing data leakage. For example, the user\n\t// agent could strip the URL down to an origin, modify its host, replace it with an empty\n\t// string, etc.\n\tif (referrerURLCallback) {\n\t\treferrerURL = referrerURLCallback(referrerURL);\n\t}\n\n\tif (referrerOriginCallback) {\n\t\treferrerOrigin = referrerOriginCallback(referrerOrigin);\n\t}\n\n\t// 8.Execute the statements corresponding to the value of policy:\n\tconst currentURL = new URL(request.url);\n\n\tswitch (policy) {\n\t\tcase 'no-referrer':\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin':\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'unsafe-url':\n\t\t\treturn referrerURL;\n\n\t\tcase 'strict-origin':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerOrigin.\n\t\t\treturn referrerOrigin.toString();\n\n\t\tcase 'strict-origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 3. Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'same-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. Return no referrer.\n\t\t\treturn 'no-referrer';\n\n\t\tcase 'origin-when-cross-origin':\n\t\t\t// 1. If the origin of referrerURL and the origin of request's current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase 'no-referrer-when-downgrade':\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn 'no-referrer';\n\t\t\t}\n\n\t\t\t// 2. Return referrerURL.\n\t\t\treturn referrerURL;\n\n\t\tdefault:\n\t\t\tthrow new TypeError(`Invalid referrerPolicy: ${policy}`);\n\t}\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header|Referrer Policy \u00A78.1. Parse a referrer policy from a Referrer-Policy header}\n * @param {Headers} headers Response headers\n * @returns {string} policy\n */\nexport function parseReferrerPolicyFromHeader(headers) {\n\t// 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy`\n\t// and response\u2019s header list.\n\tconst policyTokens = (headers.get('referrer-policy') || '').split(/[,\\s]+/);\n\n\t// 2. Let policy be the empty string.\n\tlet policy = '';\n\n\t// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty\n\t// string, then set policy to token.\n\t// Note: This algorithm loops over multiple policy values to allow deployment of new policy\n\t// values with fallbacks for older user agents, as described in \u00A7 11.1 Unknown Policy Values.\n\tfor (const token of policyTokens) {\n\t\tif (token && ReferrerPolicy.has(token)) {\n\t\t\tpolicy = token;\n\t\t}\n\t}\n\n\t// 4. Return policy.\n\treturn policy;\n}\n", "/**\n * Request.js\n *\n * Request class contains server only options\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport {format as formatUrl} from 'node:url';\nimport {deprecate} from 'node:util';\nimport Headers from './headers.js';\nimport Body, {clone, extractContentType, getTotalBytes} from './body.js';\nimport {isAbortSignal} from './utils/is.js';\nimport {getSearch} from './utils/get-search.js';\nimport {\n\tvalidateReferrerPolicy, determineRequestsReferrer, DEFAULT_REFERRER_POLICY\n} from './utils/referrer.js';\n\nconst INTERNALS = Symbol('Request internals');\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {*} object\n * @return {boolean}\n */\nconst isRequest = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object[INTERNALS] === 'object'\n\t);\n};\n\nconst doBadDataWarn = deprecate(() => {},\n\t'.data is not a valid RequestInit property, use .body instead',\n\t'https://github.com/node-fetch/node-fetch/issues/1000 (request)');\n\n/**\n * Request class\n *\n * Ref: https://fetch.spec.whatwg.org/#request-class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nexport default class Request extends Body {\n\tconstructor(input, init = {}) {\n\t\tlet parsedURL;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(input)) {\n\t\t\tparsedURL = new URL(input.url);\n\t\t} else {\n\t\t\tparsedURL = new URL(input);\n\t\t\tinput = {};\n\t\t}\n\n\t\tif (parsedURL.username !== '' || parsedURL.password !== '') {\n\t\t\tthrow new TypeError(`${parsedURL} is an url with embedded credentials.`);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tif (/^(delete|get|head|options|post|put)$/i.test(method)) {\n\t\t\tmethod = method.toUpperCase();\n\t\t}\n\n\t\tif (!isRequest(init) && 'data' in init) {\n\t\t\tdoBadDataWarn();\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif ((init.body != null || (isRequest(input) && input.body !== null)) &&\n\t\t\t(method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tconst inputBody = init.body ?\n\t\t\tinit.body :\n\t\t\t(isRequest(input) && input.body !== null ?\n\t\t\t\tclone(input) :\n\t\t\t\tnull);\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.set('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ?\n\t\t\tinput.signal :\n\t\t\tnull;\n\t\tif ('signal' in init) {\n\t\t\tsignal = init.signal;\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');\n\t\t}\n\n\t\t// \u00A75.4, Request constructor steps, step 15.1\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tlet referrer = init.referrer == null ? input.referrer : init.referrer;\n\t\tif (referrer === '') {\n\t\t\t// \u00A75.4, Request constructor steps, step 15.2\n\t\t\treferrer = 'no-referrer';\n\t\t} else if (referrer) {\n\t\t\t// \u00A75.4, Request constructor steps, step 15.3.1, 15.3.2\n\t\t\tconst parsedReferrer = new URL(referrer);\n\t\t\t// \u00A75.4, Request constructor steps, step 15.3.3, 15.3.4\n\t\t\treferrer = /^about:(\\/\\/)?client$/.test(parsedReferrer) ? 'client' : parsedReferrer;\n\t\t} else {\n\t\t\treferrer = undefined;\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal,\n\t\t\treferrer\n\t\t};\n\n\t\t// Node-fetch-only options\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\n\t\t// \u00A75.4, Request constructor steps, step 16.\n\t\t// Default is empty string per https://fetch.spec.whatwg.org/#concept-request-referrer-policy\n\t\tthis.referrerPolicy = init.referrerPolicy || input.referrerPolicy || '';\n\t}\n\n\t/** @returns {string} */\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/** @returns {string} */\n\tget url() {\n\t\treturn formatUrl(this[INTERNALS].parsedURL);\n\t}\n\n\t/** @returns {Headers} */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/** @returns {AbortSignal} */\n\tget signal() {\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t// https://fetch.spec.whatwg.org/#dom-request-referrer\n\tget referrer() {\n\t\tif (this[INTERNALS].referrer === 'no-referrer') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer === 'client') {\n\t\t\treturn 'about:client';\n\t\t}\n\n\t\tif (this[INTERNALS].referrer) {\n\t\t\treturn this[INTERNALS].referrer.toString();\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget referrerPolicy() {\n\t\treturn this[INTERNALS].referrerPolicy;\n\t}\n\n\tset referrerPolicy(referrerPolicy) {\n\t\tthis[INTERNALS].referrerPolicy = validateReferrerPolicy(referrerPolicy);\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return Request\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Request';\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true},\n\treferrer: {enumerable: true},\n\treferrerPolicy: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param {Request} request - A Request instance\n * @return The options object to be passed to http.request\n */\nexport const getNodeRequestOptions = request => {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null && /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// 4.1. Main fetch, step 2.6\n\t// > If request's referrer policy is the empty string, then set request's referrer policy to the\n\t// > default referrer policy.\n\tif (request.referrerPolicy === '') {\n\t\trequest.referrerPolicy = DEFAULT_REFERRER_POLICY;\n\t}\n\n\t// 4.1. Main fetch, step 2.7\n\t// > If request's referrer is not \"no-referrer\", set request's referrer to the result of invoking\n\t// > determine request's referrer.\n\tif (request.referrer && request.referrer !== 'no-referrer') {\n\t\trequest[INTERNALS].referrer = determineRequestsReferrer(request);\n\t} else {\n\t\trequest[INTERNALS].referrer = 'no-referrer';\n\t}\n\n\t// 4.5. HTTP-network-or-cache fetch, step 6.9\n\t// > If httpRequest's referrer is a URL, then append `Referer`/httpRequest's referrer, serialized\n\t// > and isomorphic encoded, to httpRequest's header list.\n\tif (request[INTERNALS].referrer instanceof URL) {\n\t\theaders.set('Referer', request.referrer);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip, deflate, br');\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Pass the full URL directly to request(), but overwrite the following\n\t// options:\n\tconst options = {\n\t\t// Overwrite search to retain trailing ? (issue #776)\n\t\tpath: parsedURL.pathname + search,\n\t\t// The following options are not expressed in the URL\n\t\tmethod: request.method,\n\t\theaders: headers[Symbol.for('nodejs.util.inspect.custom')](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn {\n\t\t/** @type {URL} */\n\t\tparsedURL,\n\t\toptions\n\t};\n};\n", "import {FetchBaseError} from './base.js';\n\n/**\n * AbortError interface for cancelled requests\n */\nexport class AbortError extends FetchBaseError {\n\tconstructor(message, type = 'aborted') {\n\t\tsuper(message, type);\n\t}\n}\n", "/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport http from 'node:http';\nimport https from 'node:https';\nimport zlib from 'node:zlib';\nimport Stream, {PassThrough, pipeline as pump} from 'node:stream';\nimport {Buffer} from 'node:buffer';\n\nimport dataUriToBuffer from 'data-uri-to-buffer';\n\nimport {writeToStream, clone} from './body.js';\nimport Response from './response.js';\nimport Headers, {fromRawHeaders} from './headers.js';\nimport Request, {getNodeRequestOptions} from './request.js';\nimport {FetchError} from './errors/fetch-error.js';\nimport {AbortError} from './errors/abort-error.js';\nimport {isRedirect} from './utils/is-redirect.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\nimport {isDomainOrSubdomain, isSameProtocol} from './utils/is.js';\nimport {parseReferrerPolicyFromHeader} from './utils/referrer.js';\nimport {\n\tBlob,\n\tFile,\n\tfileFromSync,\n\tfileFrom,\n\tblobFromSync,\n\tblobFrom\n} from 'fetch-blob/from.js';\n\nexport {FormData, Headers, Request, Response, FetchError, AbortError, isRedirect};\nexport {Blob, File, fileFromSync, fileFrom, blobFromSync, blobFrom};\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {*} [options_] - Fetch options\n * @return {Promise<import('./response').default>}\n */\nexport default async function fetch(url, options_) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst {parsedURL, options} = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(parsedURL.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${parsedURL.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (parsedURL.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url);\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (parsedURL.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\tlet response = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\n\t\t\tif (!response || !response.body) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(parsedURL.toString(), options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', error => {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, error => {\n\t\t\tif (response && response.body) {\n\t\t\t\tresponse.body.destroy(error);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (process.version < 'v14') {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\tlet endedWithEventsCount;\n\t\t\t\ts.prependListener('end', () => {\n\t\t\t\t\tendedWithEventsCount = s._eventsCount;\n\t\t\t\t});\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && endedWithEventsCount < s._eventsCount && !hadError) {\n\t\t\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', response_ => {\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(response_.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL(location, request.url);\n\t\t\t\t} catch {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Nothing to do\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: clone(request),\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size,\n\t\t\t\t\t\t\treferrer: request.referrer,\n\t\t\t\t\t\t\treferrerPolicy: request.referrerPolicy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// when forwarding sensitive headers like \"Authorization\",\n\t\t\t\t\t\t// \"WWW-Authenticate\", and \"Cookie\" to untrusted targets,\n\t\t\t\t\t\t// headers will be ignored when following a redirect to a domain\n\t\t\t\t\t\t// that is not a subdomain match or exact match of the initial domain.\n\t\t\t\t\t\t// For example, a redirect from \"foo.com\" to either \"foo.com\" or \"sub.foo.com\"\n\t\t\t\t\t\t// will forward the sensitive headers, but a redirect to \"bar.com\" will not.\n\t\t\t\t\t\t// headers will also be ignored when following a redirect to a domain using\n\t\t\t\t\t\t// a different protocol. For example, a redirect from \"https://foo.com\" to \"http://foo.com\"\n\t\t\t\t\t\t// will not forward the sensitive headers\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOptions.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 14\n\t\t\t\t\t\tconst responseReferrerPolicy = parseReferrerPolicyFromHeader(headers);\n\t\t\t\t\t\tif (responseReferrerPolicy) {\n\t\t\t\t\t\t\trequestOptions.referrerPolicy = responseReferrerPolicy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOptions)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = pump(response_, new PassThrough(), error => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = pump(body, zlib.createGunzip(zlibOptions), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = pump(response_, new PassThrough(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflate(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflateRaw(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.once('end', () => {\n\t\t\t\t\t// Some old IIS servers return zero-length OK deflate responses, so\n\t\t\t\t\t// 'data' is never emitted. See https://github.com/node-fetch/node-fetch/pull/903\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = pump(body, zlib.createBrotliDecompress(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(body, responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\twriteToStream(request_, request).catch(reject);\n\t});\n}\n\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tconst LAST_CHUNK = Buffer.from('0\\r\\n\\r\\n');\n\n\tlet isChunkedTransfer = false;\n\tlet properLastChunkReceived = false;\n\tlet previousChunk;\n\n\trequest.on('response', response => {\n\t\tconst {headers} = response;\n\t\tisChunkedTransfer = headers['transfer-encoding'] === 'chunked' && !headers['content-length'];\n\t});\n\n\trequest.on('socket', socket => {\n\t\tconst onSocketClose = () => {\n\t\t\tif (isChunkedTransfer && !properLastChunkReceived) {\n\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\terrorCallback(error);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = buf => {\n\t\t\tproperLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;\n\n\t\t\t// Sometimes final 0-length chunk and end of message code are in separate packets\n\t\t\tif (!properLastChunkReceived && previousChunk) {\n\t\t\t\tproperLastChunkReceived = (\n\t\t\t\t\tBuffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &&\n\t\t\t\t\tBuffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpreviousChunk = buf;\n\t\t};\n\n\t\tsocket.prependListener('close', onSocketClose);\n\t\tsocket.on('data', onData);\n\n\t\trequest.on('close', () => {\n\t\t\tsocket.removeListener('close', onSocketClose);\n\t\t\tsocket.removeListener('data', onData);\n\t\t});\n\t});\n}\n", "// netlify/functions/lightx-proxy.js\r\n\r\n/**\r\n * Securely retrieves and validates environment variables at runtime\r\n * @param {string} key - Environment variable key\r\n * @param {boolean} required - Whether the variable is required\r\n * @returns {string|null} - The environment variable value or null if not found\r\n */\r\nfunction getSecureEnvVar(key, required = true) {\r\n const value = process.env[key];\r\n \r\n if (!value || value.trim() === '') {\r\n if (required) {\r\n console.error(`Required environment variable ${key} is missing or empty`);\r\n return null;\r\n }\r\n console.warn(`Optional environment variable ${key} is not set`);\r\n return null;\r\n }\r\n \r\n // Basic validation for API key format (should be non-empty string)\r\n if (key.includes('API_KEY') && value.length < 10) {\r\n console.error(`Environment variable ${key} appears to be invalid (too short)`);\r\n return null;\r\n }\r\n \r\n return value.trim();\r\n}\r\n\r\n/**\r\n * Creates standardized error response\r\n * @param {number} statusCode - HTTP status code\r\n * @param {string} message - Error message\r\n * @param {string} details - Optional error details\r\n * @returns {Object} - Netlify function response object\r\n */\r\nfunction createErrorResponse(statusCode, message, details = null) {\r\n const response = {\r\n statusCode,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Access-Control-Allow-Headers': 'Content-Type',\r\n 'Access-Control-Allow-Methods': 'POST, OPTIONS'\r\n },\r\n body: JSON.stringify({ \r\n error: message,\r\n ...(details && { details })\r\n })\r\n };\r\n \r\n // Log error for debugging (without sensitive info)\r\n console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : ''}`);\r\n \r\n return response;\r\n}\r\n\r\nexports.handler = async function(event, context) {\r\n // Dynamic import for node-fetch ES module\r\n const { default: fetch } = await import('node-fetch');\r\n \r\n // Handle preflight OPTIONS request\r\n if (event.httpMethod === 'OPTIONS') {\r\n return {\r\n statusCode: 200,\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Access-Control-Allow-Headers': 'Content-Type',\r\n 'Access-Control-Allow-Methods': 'POST, OPTIONS'\r\n },\r\n body: ''\r\n };\r\n }\r\n \r\n // Only allow POST requests\r\n if (event.httpMethod !== 'POST') {\r\n return createErrorResponse(405, 'Method Not Allowed');\r\n }\r\n\r\n try {\r\n // Parse the request body\r\n let requestBody;\r\n try {\r\n requestBody = JSON.parse(event.body);\r\n } catch (parseError) {\r\n return createErrorResponse(400, 'Invalid JSON in request body', parseError.message);\r\n }\r\n \r\n const { endpoint, body } = requestBody;\r\n \r\n if (!endpoint) {\r\n return createErrorResponse(400, 'Missing endpoint parameter');\r\n }\r\n \r\n // Validate endpoint format\r\n if (typeof endpoint !== 'string' || endpoint.trim() === '') {\r\n return createErrorResponse(400, 'Invalid endpoint parameter');\r\n }\r\n \r\n // Construct the LightX API URL based on version\r\n // For v1 endpoints, the URL structure is different than v2\r\n let lightxUrl;\r\n if (endpoint.startsWith('v1/')) {\r\n // v1 endpoints use a different URL structure\r\n lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`;\r\n } else {\r\n // v2 and other endpoints use the external/api path\r\n lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`;\r\n }\r\n \r\n // Securely retrieve API key at runtime\r\n const apiKey = getSecureEnvVar('LIGHTX_API_KEY', true);\r\n \r\n if (!apiKey) {\r\n return createErrorResponse(500, 'API key not configured or invalid');\r\n }\r\n \r\n // Log request details (excluding sensitive info) - only in development\r\n const isDevelopment = getSecureEnvVar('NODE_ENV', false) !== 'production';\r\n if (isDevelopment) {\r\n console.log(`Making request to: ${lightxUrl}`);\r\n console.log(`Request body keys: ${Object.keys(body || {}).join(', ')}`);\r\n console.log(`API key present: Yes`);\r\n }\r\n \r\n // Validate request body if present\r\n if (body && typeof body !== 'object') {\r\n return createErrorResponse(400, 'Request body must be an object');\r\n }\r\n \r\n // Make the request to the LightX API with timeout\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), 30000); // 30 second timeout\r\n \r\n let response;\r\n try {\r\n response = await fetch(lightxUrl, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': apiKey,\r\n 'User-Agent': 'ModernPhotoTools/1.0'\r\n },\r\n body: JSON.stringify(body || {}),\r\n signal: controller.signal\r\n });\r\n } catch (fetchError) {\r\n clearTimeout(timeoutId);\r\n if (fetchError.name === 'AbortError') {\r\n return createErrorResponse(408, 'Request timeout');\r\n }\r\n return createErrorResponse(502, 'Failed to connect to LightX API', fetchError.message);\r\n } finally {\r\n clearTimeout(timeoutId);\r\n }\r\n \r\n if (isDevelopment) {\r\n console.log(`Response status: ${response.status}`);\r\n console.log(`Response status text: ${response.statusText}`);\r\n }\r\n\r\n // Get the response data\r\n let data;\r\n try {\r\n data = await response.json();\r\n } catch (jsonError) {\r\n return createErrorResponse(502, 'Invalid JSON response from LightX API', jsonError.message);\r\n }\r\n \r\n // Return the response with proper headers\r\n return {\r\n statusCode: response.status,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Access-Control-Allow-Headers': 'Content-Type',\r\n 'Access-Control-Allow-Methods': 'POST, OPTIONS',\r\n 'Cache-Control': 'no-cache, no-store, must-revalidate'\r\n },\r\n body: JSON.stringify(data)\r\n };\r\n } catch (error) {\r\n // Log full error details for debugging\r\n console.error('Function error:', {\r\n message: error.message,\r\n stack: error.stack,\r\n name: error.name\r\n });\r\n \r\n return createErrorResponse(500, 'Internal server error', error.message);\r\n }\r\n};"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,gBAAgB,KAAW;AAC1C,MAAI,CAAC,UAAU,KAAK,GAAG,GAAG;AACzB,UAAM,IAAI,UACT,kEAAkE;;AAKpE,QAAM,IAAI,QAAQ,UAAU,EAAE;AAG9B,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,MAAI,eAAe,MAAM,cAAc,GAAG;AACzC,UAAM,IAAI,UAAU,qBAAqB;;AAI1C,QAAM,OAAO,IAAI,UAAU,GAAG,UAAU,EAAE,MAAM,GAAG;AAEnD,MAAI,UAAU;AACd,MAAI,SAAS;AACb,QAAM,OAAO,KAAK,CAAC,KAAK;AACxB,MAAI,WAAW;AACf,WAASA,KAAI,GAAGA,KAAI,KAAK,QAAQA,MAAK;AACrC,QAAI,KAAKA,EAAC,MAAM,UAAU;AACzB,eAAS;eACA,KAAKA,EAAC,GAAG;AAClB,kBAAY,IAAM,KAAKA,EAAC,CAAC;AACzB,UAAI,KAAKA,EAAC,EAAE,QAAQ,UAAU,MAAM,GAAG;AACtC,kBAAU,KAAKA,EAAC,EAAE,UAAU,CAAC;;;;AAKhC,MAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,QAAQ;AAChC,gBAAY;AACZ,cAAU;;AAIX,QAAM,WAAW,SAAS,WAAW;AACrC,QAAM,OAAO,SAAS,IAAI,UAAU,aAAa,CAAC,CAAC;AACnD,QAAM,SAAS,OAAO,KAAK,MAAM,QAAQ;AAGzC,SAAO,OAAO;AACd,SAAO,WAAW;AAGlB,SAAO,UAAU;AAEjB,SAAO;AACR;AA3DA,IA6DA;AA7DA;;AA6DA,IAAA,eAAe;;;;;;;;;;;eCnECC,QAAI;AAClB,eAAO;MACT;ACCM,eAAU,aAAaC,IAAM;AACjC,eAAQ,OAAOA,OAAM,YAAYA,OAAM,QAAS,OAAOA,OAAM;MAC/D;AAEO,YAAM,iCAUPD;AAEU,eAAA,gBAAgB,IAAc,MAAY;AACxD,YAAI;AACF,iBAAO,eAAe,IAAI,QAAQ;YAChC,OAAO;YACP,cAAc;UACf,CAAA;iBACDE,KAAM;;MAIV;AC1BA,YAAM,kBAAkB;AACxB,YAAM,sBAAsB,QAAQ,UAAU;AAC9C,YAAM,wBAAwB,QAAQ,OAAO,KAAK,eAAe;AAG3D,eAAU,WAAc,UAGrB;AACP,eAAO,IAAI,gBAAgB,QAAQ;MACrC;AAGM,eAAU,oBAAuB,OAAyB;AAC9D,eAAO,WAAW,aAAW,QAAQ,KAAK,CAAC;MAC7C;AAGM,eAAU,oBAA+B,QAAW;AACxD,eAAO,sBAAsB,MAAM;MACrC;eAEgB,mBACd,SACA,aACA,YAA8D;AAG9D,eAAO,oBAAoB,KAAK,SAAS,aAAa,UAAU;MAClE;eAKgB,YACd,SACA,aACA,YAAsD;AACtD,2BACE,mBAAmB,SAAS,aAAa,UAAU,GACnD,QACA,8BAA8B;MAElC;AAEgB,eAAA,gBAAmB,SAAqB,aAAmD;AACzG,oBAAY,SAAS,WAAW;MAClC;AAEgB,eAAA,cAAc,SAA2B,YAAqD;AAC5G,oBAAY,SAAS,QAAW,UAAU;MAC5C;eAEgB,qBACd,SACA,oBACA,kBAAoE;AACpE,eAAO,mBAAmB,SAAS,oBAAoB,gBAAgB;MACzE;AAEM,eAAU,0BAA0B,SAAyB;AACjE,2BAAmB,SAAS,QAAW,8BAA8B;MACvE;AAEA,UAAI,kBAAkD,cAAW;AAC/D,YAAI,OAAO,mBAAmB,YAAY;AACxC,4BAAkB;eACb;AACL,gBAAM,kBAAkB,oBAAoB,MAAS;AACrD,4BAAkB,QAAM,mBAAmB,iBAAiB,EAAE;;AAEhE,eAAO,gBAAgB,QAAQ;MACjC;eAIgB,YAAmCC,IAAiC,GAAM,MAAO;AAC/F,YAAI,OAAOA,OAAM,YAAY;AAC3B,gBAAM,IAAI,UAAU,4BAA4B;;AAElD,eAAO,SAAS,UAAU,MAAM,KAAKA,IAAG,GAAG,IAAI;MACjD;eAEgB,YAAmCA,IACA,GACA,MAAO;AAIxD,YAAI;AACF,iBAAO,oBAAoB,YAAYA,IAAG,GAAG,IAAI,CAAC;iBAC3C,OAAO;AACd,iBAAO,oBAAoB,KAAK;;MAEpC;AC5FA,YAAM,uBAAuB;YAahB,YAAW;QAMtB,cAAA;AAHQ,eAAO,UAAG;AACV,eAAK,QAAG;AAId,eAAK,SAAS;YACZ,WAAW,CAAA;YACX,OAAO;;AAET,eAAK,QAAQ,KAAK;AAIlB,eAAK,UAAU;AAEf,eAAK,QAAQ;;QAGf,IAAI,SAAM;AACR,iBAAO,KAAK;;;;;;QAOd,KAAK,SAAU;AACb,gBAAM,UAAU,KAAK;AACrB,cAAI,UAAU;AAEd,cAAI,QAAQ,UAAU,WAAW,uBAAuB,GAAG;AACzD,sBAAU;cACR,WAAW,CAAA;cACX,OAAO;;;AAMX,kBAAQ,UAAU,KAAK,OAAO;AAC9B,cAAI,YAAY,SAAS;AACvB,iBAAK,QAAQ;AACb,oBAAQ,QAAQ;;AAElB,YAAE,KAAK;;;;QAKT,QAAK;AAGH,gBAAM,WAAW,KAAK;AACtB,cAAI,WAAW;AACf,gBAAM,YAAY,KAAK;AACvB,cAAI,YAAY,YAAY;AAE5B,gBAAM,WAAW,SAAS;AAC1B,gBAAM,UAAU,SAAS,SAAS;AAElC,cAAI,cAAc,sBAAsB;AAGtC,uBAAW,SAAS;AACpB,wBAAY;;AAId,YAAE,KAAK;AACP,eAAK,UAAU;AACf,cAAI,aAAa,UAAU;AACzB,iBAAK,SAAS;;AAIhB,mBAAS,SAAS,IAAI;AAEtB,iBAAO;;;;;;;;;;QAWT,QAAQ,UAA8B;AACpC,cAAIC,KAAI,KAAK;AACb,cAAI,OAAO,KAAK;AAChB,cAAI,WAAW,KAAK;AACpB,iBAAOA,OAAM,SAAS,UAAU,KAAK,UAAU,QAAW;AACxD,gBAAIA,OAAM,SAAS,QAAQ;AAGzB,qBAAO,KAAK;AACZ,yBAAW,KAAK;AAChB,cAAAA,KAAI;AACJ,kBAAI,SAAS,WAAW,GAAG;AACzB;;;AAGJ,qBAAS,SAASA,EAAC,CAAC;AACpB,cAAEA;;;;;QAMN,OAAI;AAGF,gBAAM,QAAQ,KAAK;AACnB,gBAAM,SAAS,KAAK;AACpB,iBAAO,MAAM,UAAU,MAAM;;MAEhC;AC1IM,YAAM,aAAa,OAAO,gBAAgB;AAC1C,YAAM,aAAa,OAAO,gBAAgB;AAC1C,YAAM,cAAc,OAAO,iBAAiB;AAC5C,YAAM,YAAY,OAAO,eAAe;AACxC,YAAM,eAAe,OAAO,kBAAkB;ACCrC,eAAA,sCAAyC,QAAiC,QAAyB;AACjH,eAAO,uBAAuB;AAC9B,eAAO,UAAU;AAEjB,YAAI,OAAO,WAAW,YAAY;AAChC,+CAAqC,MAAM;mBAClC,OAAO,WAAW,UAAU;AACrC,yDAA+C,MAAM;eAChD;AAGL,yDAA+C,QAAQ,OAAO,YAAY;;MAE9E;AAKgB,eAAA,kCAAkC,QAAmC,QAAW;AAC9F,cAAM,SAAS,OAAO;AAEtB,eAAO,qBAAqB,QAAQ,MAAM;MAC5C;AAEM,eAAU,mCAAmC,QAAiC;AAClF,cAAM,SAAS,OAAO;AAItB,YAAI,OAAO,WAAW,YAAY;AAChC,2CACE,QACA,IAAI,UAAU,kFAAkF,CAAC;eAC9F;AACL,oDACE,QACA,IAAI,UAAU,kFAAkF,CAAC;;AAGrG,eAAO,0BAA0B,YAAY,EAAC;AAE9C,eAAO,UAAU;AACjB,eAAO,uBAAuB;MAChC;AAIM,eAAU,oBAAoB,MAAY;AAC9C,eAAO,IAAI,UAAU,YAAY,OAAO,mCAAmC;MAC7E;AAIM,eAAU,qCAAqC,QAAiC;AACpF,eAAO,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACrD,iBAAO,yBAAyB;AAChC,iBAAO,wBAAwB;QACjC,CAAC;MACH;AAEgB,eAAA,+CAA+C,QAAmC,QAAW;AAC3G,6CAAqC,MAAM;AAC3C,yCAAiC,QAAQ,MAAM;MACjD;AAEM,eAAU,+CAA+C,QAAiC;AAC9F,6CAAqC,MAAM;AAC3C,0CAAkC,MAAM;MAC1C;AAEgB,eAAA,iCAAiC,QAAmC,QAAW;AAC7F,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,kCAA0B,OAAO,cAAc;AAC/C,eAAO,sBAAsB,MAAM;AACnC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;MACjC;AAEgB,eAAA,0CAA0C,QAAmC,QAAW;AAItG,uDAA+C,QAAQ,MAAM;MAC/D;AAEM,eAAU,kCAAkC,QAAiC;AACjF,YAAI,OAAO,2BAA2B,QAAW;AAC/C;;AAGF,eAAO,uBAAuB,MAAS;AACvC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;MACjC;AClGA,YAAM,iBAAyC,OAAO,YAAY,SAAUH,IAAC;AAC3E,eAAO,OAAOA,OAAM,YAAY,SAASA,EAAC;MAC5C;ACFA,YAAM,YAA+B,KAAK,SAAS,SAAU,GAAC;AAC5D,eAAO,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;MAC5C;ACDM,eAAU,aAAaA,IAAM;AACjC,eAAO,OAAOA,OAAM,YAAY,OAAOA,OAAM;MAC/C;AAEgB,eAAA,iBAAiB,KACA,SAAe;AAC9C,YAAI,QAAQ,UAAa,CAAC,aAAa,GAAG,GAAG;AAC3C,gBAAM,IAAI,UAAU,GAAG,OAAO,oBAAoB;;MAEtD;AAKgB,eAAA,eAAeA,IAAY,SAAe;AACxD,YAAI,OAAOA,OAAM,YAAY;AAC3B,gBAAM,IAAI,UAAU,GAAG,OAAO,qBAAqB;;MAEvD;AAGM,eAAU,SAASA,IAAM;AAC7B,eAAQ,OAAOA,OAAM,YAAYA,OAAM,QAAS,OAAOA,OAAM;MAC/D;AAEgB,eAAA,aAAaA,IACA,SAAe;AAC1C,YAAI,CAAC,SAASA,EAAC,GAAG;AAChB,gBAAM,IAAI,UAAU,GAAG,OAAO,oBAAoB;;MAEtD;eAEgB,uBAA0BA,IACA,UACA,SAAe;AACvD,YAAIA,OAAM,QAAW;AACnB,gBAAM,IAAI,UAAU,aAAa,QAAQ,oBAAoB,OAAO,IAAI;;MAE5E;eAEgB,oBAAuBA,IACA,OACA,SAAe;AACpD,YAAIA,OAAM,QAAW;AACnB,gBAAM,IAAI,UAAU,GAAG,KAAK,oBAAoB,OAAO,IAAI;;MAE/D;AAGM,eAAU,0BAA0B,OAAc;AACtD,eAAO,OAAO,KAAK;MACrB;AAEA,eAAS,mBAAmBA,IAAS;AACnC,eAAOA,OAAM,IAAI,IAAIA;MACvB;AAEA,eAAS,YAAYA,IAAS;AAC5B,eAAO,mBAAmB,UAAUA,EAAC,CAAC;MACxC;AAGgB,eAAA,wCAAwC,OAAgB,SAAe;AACrF,cAAM,aAAa;AACnB,cAAM,aAAa,OAAO;AAE1B,YAAIA,KAAI,OAAO,KAAK;AACpB,QAAAA,KAAI,mBAAmBA,EAAC;AAExB,YAAI,CAAC,eAAeA,EAAC,GAAG;AACtB,gBAAM,IAAI,UAAU,GAAG,OAAO,yBAAyB;;AAGzD,QAAAA,KAAI,YAAYA,EAAC;AAEjB,YAAIA,KAAI,cAAcA,KAAI,YAAY;AACpC,gBAAM,IAAI,UAAU,GAAG,OAAO,qCAAqC,UAAU,OAAO,UAAU,aAAa;;AAG7G,YAAI,CAAC,eAAeA,EAAC,KAAKA,OAAM,GAAG;AACjC,iBAAO;;AAQT,eAAOA;MACT;AC3FgB,eAAA,qBAAqBA,IAAY,SAAe;AAC9D,YAAI,CAAC,iBAAiBA,EAAC,GAAG;AACxB,gBAAM,IAAI,UAAU,GAAG,OAAO,2BAA2B;;MAE7D;ACwBM,eAAU,mCAAsC,QAAsB;AAC1E,eAAO,IAAI,4BAA4B,MAAM;MAC/C;AAIgB,eAAA,6BAAgC,QACA,aAA2B;AAIxE,eAAO,QAA4C,cAAc,KAAK,WAAW;MACpF;eAEgB,iCAAoC,QAA2B,OAAsB,MAAa;AAChH,cAAM,SAAS,OAAO;AAItB,cAAM,cAAc,OAAO,cAAc,MAAK;AAC9C,YAAI,MAAM;AACR,sBAAY,YAAW;eAClB;AACL,sBAAY,YAAY,KAAM;;MAElC;AAEM,eAAU,iCAAoC,QAAyB;AAC3E,eAAQ,OAAO,QAA2C,cAAc;MAC1E;AAEM,eAAU,+BAA+B,QAAsB;AACnE,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB,iBAAO;;AAGT,YAAI,CAAC,8BAA8B,MAAM,GAAG;AAC1C,iBAAO;;AAGT,eAAO;MACT;YAiBa,4BAA2B;QAYtC,YAAY,QAAyB;AACnC,iCAAuB,QAAQ,GAAG,6BAA6B;AAC/D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,gDAAsC,MAAM,MAAM;AAElD,eAAK,gBAAgB,IAAI,YAAW;;;;;;QAOtC,IAAI,SAAM;AACR,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,iBAAO,KAAK;;;;;QAMd,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,QAAQ,CAAC;;AAG1D,iBAAO,kCAAkC,MAAM,MAAM;;;;;;;QAQvD,OAAI;AACF,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,MAAM,CAAC;;AAGrE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,WAAW,CAAC;;AAG7D,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA+C,CAAC,SAAS,WAAU;AACjF,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,cAA8B;YAClC,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE;YAClE,aAAa,MAAM,eAAe,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;YAClE,aAAa,CAAAI,OAAK,cAAcA,EAAC;;AAEnC,0CAAgC,MAAM,WAAW;AACjD,iBAAO;;;;;;;;;;;QAYT,cAAW;AACT,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,cAAI,KAAK,yBAAyB,QAAW;AAC3C;;AAGF,6CAAmC,IAAI;;MAE1C;AAED,aAAO,iBAAiB,4BAA4B,WAAW;QAC7D,QAAQ,EAAE,YAAY,KAAI;QAC1B,MAAM,EAAE,YAAY,KAAI;QACxB,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,4BAA4B,UAAU,QAAQ,QAAQ;AACtE,sBAAgB,4BAA4B,UAAU,MAAM,MAAM;AAClE,sBAAgB,4BAA4B,UAAU,aAAa,aAAa;AAChF,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,4BAA4B,WAAW,OAAO,aAAa;UAC/E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,8BAAuCJ,IAAM;AAC3D,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,eAAe,GAAG;AAC7D,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEgB,eAAA,gCAAmC,QACA,aAA2B;AAC5E,cAAM,SAAS,OAAO;AAItB,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,UAAU;AAC9B,sBAAY,YAAW;mBACd,OAAO,WAAW,WAAW;AACtC,sBAAY,YAAY,OAAO,YAAY;eACtC;AAEL,iBAAO,0BAA0B,SAAS,EAAE,WAA+B;;MAE/E;AAEM,eAAU,mCAAmC,QAAmC;AACpF,2CAAmC,MAAM;AACzC,cAAMI,KAAI,IAAI,UAAU,qBAAqB;AAC7C,qDAA6C,QAAQA,EAAC;MACxD;AAEgB,eAAA,6CAA6C,QAAqCA,IAAM;AACtG,cAAM,eAAe,OAAO;AAC5B,eAAO,gBAAgB,IAAI,YAAW;AACtC,qBAAa,QAAQ,iBAAc;AACjC,sBAAY,YAAYA,EAAC;QAC3B,CAAC;MACH;AAIA,eAAS,iCAAiC,MAAY;AACpD,eAAO,IAAI,UACT,yCAAyC,IAAI,oDAAoD;MACrG;ACjQO,YAAM,yBACX,OAAO,eAAe,OAAO,eAAe,mBAAe;MAAA,CAAkC,EAAE,SAAS;YC6B7F,gCAA+B;QAM1C,YAAY,QAAwC,eAAsB;AAHlE,eAAe,kBAA4D;AAC3E,eAAW,cAAG;AAGpB,eAAK,UAAU;AACf,eAAK,iBAAiB;;QAGxB,OAAI;AACF,gBAAM,YAAY,MAAM,KAAK,WAAU;AACvC,eAAK,kBAAkB,KAAK,kBAC1B,qBAAqB,KAAK,iBAAiB,WAAW,SAAS,IAC/D,UAAS;AACX,iBAAO,KAAK;;QAGd,OAAO,OAAU;AACf,gBAAM,cAAc,MAAM,KAAK,aAAa,KAAK;AACjD,iBAAO,KAAK,kBACV,qBAAqB,KAAK,iBAAiB,aAAa,WAAW,IACnE,YAAW;;QAGP,aAAU;AAChB,cAAI,KAAK,aAAa;AACpB,mBAAO,QAAQ,QAAQ,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;;AAGzD,gBAAM,SAAS,KAAK;AAGpB,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA+C,CAAC,SAAS,WAAU;AACjF,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,cAA8B;YAClC,aAAa,WAAQ;AACnB,mBAAK,kBAAkB;AAGvBC,8BAAe,MAAM,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE,CAAC;;YAEpE,aAAa,MAAK;AAChB,mBAAK,kBAAkB;AACvB,mBAAK,cAAc;AACnB,iDAAmC,MAAM;AACzC,6BAAe,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;;YAEjD,aAAa,YAAS;AACpB,mBAAK,kBAAkB;AACvB,mBAAK,cAAc;AACnB,iDAAmC,MAAM;AACzC,4BAAc,MAAM;;;AAGxB,0CAAgC,QAAQ,WAAW;AACnD,iBAAO;;QAGD,aAAa,OAAU;AAC7B,cAAI,KAAK,aAAa;AACpB,mBAAO,QAAQ,QAAQ,EAAE,OAAO,MAAM,KAAI,CAAE;;AAE9C,eAAK,cAAc;AAEnB,gBAAM,SAAS,KAAK;AAIpB,cAAI,CAAC,KAAK,gBAAgB;AACxB,kBAAM,SAAS,kCAAkC,QAAQ,KAAK;AAC9D,+CAAmC,MAAM;AACzC,mBAAO,qBAAqB,QAAQ,OAAO,EAAE,OAAO,MAAM,KAAI,EAAG;;AAGnE,6CAAmC,MAAM;AACzC,iBAAO,oBAAoB,EAAE,OAAO,MAAM,KAAI,CAAE;;MAEnD;AAWD,YAAM,uCAAiF;QACrF,OAAI;AACF,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,uCAAuC,MAAM,CAAC;;AAE3E,iBAAO,KAAK,mBAAmB,KAAI;;QAGrC,OAAuD,OAAU;AAC/D,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,uCAAuC,QAAQ,CAAC;;AAE7E,iBAAO,KAAK,mBAAmB,OAAO,KAAK;;;AAG/C,aAAO,eAAe,sCAAsC,sBAAsB;AAIlE,eAAA,mCAAsC,QACA,eAAsB;AAC1E,cAAM,SAAS,mCAAsC,MAAM;AAC3D,cAAM,OAAO,IAAI,gCAAgC,QAAQ,aAAa;AACtE,cAAM,WAAmD,OAAO,OAAO,oCAAoC;AAC3G,iBAAS,qBAAqB;AAC9B,eAAO;MACT;AAEA,eAAS,8BAAuCL,IAAM;AACpD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,oBAAoB,GAAG;AAClE,iBAAO;;AAGT,YAAI;AAEF,iBAAQA,GAA+C,8BACrD;iBACFC,KAAM;AACN,iBAAO;;MAEX;AAIA,eAAS,uCAAuC,MAAY;AAC1D,eAAO,IAAI,UAAU,+BAA+B,IAAI,mDAAmD;MAC7G;AC9KA,YAAM,cAAmC,OAAO,SAAS,SAAUD,IAAC;AAElE,eAAOA,OAAMA;MACf;;ACQM,eAAU,oBAAqC,UAAW;AAG9D,eAAO,SAAS,MAAK;MACvB;AAEM,eAAU,mBAAmB,MACA,YACA,KACA,WACA,GAAS;AAC1C,YAAI,WAAW,IAAI,EAAE,IAAI,IAAI,WAAW,KAAK,WAAW,CAAC,GAAG,UAAU;MACxE;AAEO,UAAI,sBAAsB,CAAC,MAA+B;AAC/D,YAAI,OAAO,EAAE,aAAa,YAAY;AACpC,gCAAsB,YAAU,OAAO,SAAQ;mBACtC,OAAO,oBAAoB,YAAY;AAChD,gCAAsB,YAAU,gBAAgB,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAC,CAAE;eACzE;AAEL,gCAAsB,YAAU;;AAElC,eAAO,oBAAoB,CAAC;MAC9B;AAMO,UAAI,mBAAmB,CAAC,MAA2B;AACxD,YAAI,OAAO,EAAE,aAAa,WAAW;AACnC,6BAAmB,YAAU,OAAO;eAC/B;AAEL,6BAAmB,YAAU,OAAO,eAAe;;AAErD,eAAO,iBAAiB,CAAC;MAC3B;eAEgB,iBAAiB,QAAqB,OAAe,KAAW;AAG9E,YAAI,OAAO,OAAO;AAChB,iBAAO,OAAO,MAAM,OAAO,GAAG;;AAEhC,cAAM,SAAS,MAAM;AACrB,cAAM,QAAQ,IAAI,YAAY,MAAM;AACpC,2BAAmB,OAAO,GAAG,QAAQ,OAAO,MAAM;AAClD,eAAO;MACT;AAMgB,eAAA,UAAsC,UAAa,MAAO;AACxE,cAAM,OAAO,SAAS,IAAI;AAC1B,YAAI,SAAS,UAAa,SAAS,MAAM;AACvC,iBAAO;;AAET,YAAI,OAAO,SAAS,YAAY;AAC9B,gBAAM,IAAI,UAAU,GAAG,OAAO,IAAI,CAAC,oBAAoB;;AAEzD,eAAO;MACT;AAgBM,eAAU,4BAA+B,oBAAyC;AAKtF,cAAM,eAAe;UACnB,CAAC,OAAO,QAAQ,GAAG,MAAM,mBAAmB;;AAG9C,cAAM,iBAAiB,mBAAe;AACpC,iBAAO,OAAO;WACf;AAED,cAAM,aAAa,cAAc;AACjC,eAAO,EAAE,UAAU,eAAe,YAAY,MAAM,MAAK;MAC3D;AAGO,YAAM,uBACX,MAAA,KAAA,OAAO,mBAAa,QAAA,OAAA,SAAA,MACpB,KAAA,OAAO,SAAG,QAAA,OAAA,SAAA,SAAA,GAAA,KAAA,QAAG,sBAAsB,OAAC,QAAA,OAAA,SAAA,KACpC;AAeF,eAAS,YACP,KACA,OAAO,QACP,QAAqC;AAGrC,YAAI,WAAW,QAAW;AACxB,cAAI,SAAS,SAAS;AACpB,qBAAS,UAAU,KAAyB,mBAAmB;AAC/D,gBAAI,WAAW,QAAW;AACxB,oBAAM,aAAa,UAAU,KAAoB,OAAO,QAAQ;AAChE,oBAAM,qBAAqB,YAAY,KAAoB,QAAQ,UAAU;AAC7E,qBAAO,4BAA4B,kBAAkB;;iBAElD;AACL,qBAAS,UAAU,KAAoB,OAAO,QAAQ;;;AAG1D,YAAI,WAAW,QAAW;AACxB,gBAAM,IAAI,UAAU,4BAA4B;;AAElD,cAAM,WAAW,YAAY,QAAQ,KAAK,CAAA,CAAE;AAC5C,YAAI,CAAC,aAAa,QAAQ,GAAG;AAC3B,gBAAM,IAAI,UAAU,2CAA2C;;AAEjE,cAAM,aAAa,SAAS;AAC5B,eAAO,EAAE,UAAU,YAAY,MAAM,MAAK;MAC5C;AAIM,eAAU,aAAgB,gBAAsC;AACpE,cAAM,SAAS,YAAY,eAAe,YAAY,eAAe,UAAU,CAAA,CAAE;AACjF,YAAI,CAAC,aAAa,MAAM,GAAG;AACzB,gBAAM,IAAI,UAAU,kDAAkD;;AAExE,eAAO;MACT;AAEM,eAAU,iBACd,YAA4C;AAG5C,eAAO,QAAQ,WAAW,IAAI;MAChC;AAEM,eAAU,cAAiB,YAAkC;AAEjE,eAAO,WAAW;MACpB;AChLM,eAAU,oBAAoB,GAAS;AAC3C,YAAI,OAAO,MAAM,UAAU;AACzB,iBAAO;;AAGT,YAAI,YAAY,CAAC,GAAG;AAClB,iBAAO;;AAGT,YAAI,IAAI,GAAG;AACT,iBAAO;;AAGT,eAAO;MACT;AAEM,eAAU,kBAAkB,GAA6B;AAC7D,cAAM,SAAS,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU;AACnF,eAAO,IAAI,WAAW,MAAM;MAC9B;ACTM,eAAU,aAAgB,WAAuC;AAIrE,cAAM,OAAO,UAAU,OAAO,MAAK;AACnC,kBAAU,mBAAmB,KAAK;AAClC,YAAI,UAAU,kBAAkB,GAAG;AACjC,oBAAU,kBAAkB;;AAG9B,eAAO,KAAK;MACd;eAEgB,qBAAwB,WAAyC,OAAU,MAAY;AAGrG,YAAI,CAAC,oBAAoB,IAAI,KAAK,SAAS,UAAU;AACnD,gBAAM,IAAI,WAAW,sDAAsD;;AAG7E,kBAAU,OAAO,KAAK,EAAE,OAAO,KAAI,CAAE;AACrC,kBAAU,mBAAmB;MAC/B;AAEM,eAAU,eAAkB,WAAuC;AAIvE,cAAM,OAAO,UAAU,OAAO,KAAI;AAClC,eAAO,KAAK;MACd;AAEM,eAAU,WAAc,WAA4B;AAGxD,kBAAU,SAAS,IAAI,YAAW;AAClC,kBAAU,kBAAkB;MAC9B;ACxBA,eAAS,sBAAsB,MAAc;AAC3C,eAAO,SAAS;MAClB;AAEM,eAAU,WAAW,MAAqB;AAC9C,eAAO,sBAAsB,KAAK,WAAW;MAC/C;AAEM,eAAU,2BAAsD,MAAmC;AACvG,YAAI,sBAAsB,IAAI,GAAG;AAC/B,iBAAO;;AAET,eAAQ,KAA0C;MACpD;YCSa,0BAAyB;QAMpC,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,OAAI;AACN,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,MAAM;;AAG7C,iBAAO,KAAK;;QAWd,QAAQ,cAAgC;AACtC,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,SAAS;;AAEhD,iCAAuB,cAAc,GAAG,SAAS;AACjD,yBAAe,wCAAwC,cAAc,iBAAiB;AAEtF,cAAI,KAAK,4CAA4C,QAAW;AAC9D,kBAAM,IAAI,UAAU,wCAAwC;;AAG9D,cAAI,iBAAiB,KAAK,MAAO,MAAM,GAAG;AACxC,kBAAM,IAAI,UAAU,iFAAiF;;AAMvG,8CAAoC,KAAK,yCAAyC,YAAY;;QAWhG,mBAAmB,MAAgC;AACjD,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,oBAAoB;;AAE3D,iCAAuB,MAAM,GAAG,oBAAoB;AAEpD,cAAI,CAAC,YAAY,OAAO,IAAI,GAAG;AAC7B,kBAAM,IAAI,UAAU,8CAA8C;;AAGpE,cAAI,KAAK,4CAA4C,QAAW;AAC9D,kBAAM,IAAI,UAAU,wCAAwC;;AAG9D,cAAI,iBAAiB,KAAK,MAAM,GAAG;AACjC,kBAAM,IAAI,UAAU,+EAAgF;;AAGtG,yDAA+C,KAAK,yCAAyC,IAAI;;MAEpG;AAED,aAAO,iBAAiB,0BAA0B,WAAW;QAC3D,SAAS,EAAE,YAAY,KAAI;QAC3B,oBAAoB,EAAE,YAAY,KAAI;QACtC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,sBAAgB,0BAA0B,UAAU,SAAS,SAAS;AACtE,sBAAgB,0BAA0B,UAAU,oBAAoB,oBAAoB;AAC5F,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,0BAA0B,WAAW,OAAO,aAAa;UAC7E,OAAO;UACP,cAAc;QACf,CAAA;MACH;YAyCa,6BAA4B;QA4BvC,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,cAAW;AACb,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,aAAa;;AAG7D,iBAAO,2CAA2C,IAAI;;;;;;QAOxD,IAAI,cAAW;AACb,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,aAAa;;AAG7D,iBAAO,2CAA2C,IAAI;;;;;;QAOxD,QAAK;AACH,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,OAAO;;AAGvD,cAAI,KAAK,iBAAiB;AACxB,kBAAM,IAAI,UAAU,4DAA4D;;AAGlF,gBAAM,QAAQ,KAAK,8BAA8B;AACjD,cAAI,UAAU,YAAY;AACxB,kBAAM,IAAI,UAAU,kBAAkB,KAAK,2DAA2D;;AAGxG,4CAAkC,IAAI;;QAQxC,QAAQ,OAAiC;AACvC,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,SAAS;;AAGzD,iCAAuB,OAAO,GAAG,SAAS;AAC1C,cAAI,CAAC,YAAY,OAAO,KAAK,GAAG;AAC9B,kBAAM,IAAI,UAAU,oCAAoC;;AAE1D,cAAI,MAAM,eAAe,GAAG;AAC1B,kBAAM,IAAI,UAAU,qCAAqC;;AAE3D,cAAI,MAAM,OAAO,eAAe,GAAG;AACjC,kBAAM,IAAI,UAAU,8CAA8C;;AAGpE,cAAI,KAAK,iBAAiB;AACxB,kBAAM,IAAI,UAAU,8BAA8B;;AAGpD,gBAAM,QAAQ,KAAK,8BAA8B;AACjD,cAAI,UAAU,YAAY;AACxB,kBAAM,IAAI,UAAU,kBAAkB,KAAK,gEAAgE;;AAG7G,8CAAoC,MAAM,KAAK;;;;;QAMjD,MAAMI,KAAS,QAAS;AACtB,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,OAAO;;AAGvD,4CAAkC,MAAMA,EAAC;;;QAI3C,CAAC,WAAW,EAAE,QAAW;AACvB,4DAAkD,IAAI;AAEtD,qBAAW,IAAI;AAEf,gBAAM,SAAS,KAAK,iBAAiB,MAAM;AAC3C,sDAA4C,IAAI;AAChD,iBAAO;;;QAIT,CAAC,SAAS,EAAE,aAA+C;AACzD,gBAAM,SAAS,KAAK;AAGpB,cAAI,KAAK,kBAAkB,GAAG;AAG5B,iEAAqD,MAAM,WAAW;AACtE;;AAGF,gBAAM,wBAAwB,KAAK;AACnC,cAAI,0BAA0B,QAAW;AACvC,gBAAI;AACJ,gBAAI;AACF,uBAAS,IAAI,YAAY,qBAAqB;qBACvC,SAAS;AAChB,0BAAY,YAAY,OAAO;AAC/B;;AAGF,kBAAM,qBAAgD;cACpD;cACA,kBAAkB;cAClB,YAAY;cACZ,YAAY;cACZ,aAAa;cACb,aAAa;cACb,aAAa;cACb,iBAAiB;cACjB,YAAY;;AAGd,iBAAK,kBAAkB,KAAK,kBAAkB;;AAGhD,uCAA6B,QAAQ,WAAW;AAChD,uDAA6C,IAAI;;;QAInD,CAAC,YAAY,IAAC;AACZ,cAAI,KAAK,kBAAkB,SAAS,GAAG;AACrC,kBAAM,gBAAgB,KAAK,kBAAkB,KAAI;AACjD,0BAAc,aAAa;AAE3B,iBAAK,oBAAoB,IAAI,YAAW;AACxC,iBAAK,kBAAkB,KAAK,aAAa;;;MAG9C;AAED,aAAO,iBAAiB,6BAA6B,WAAW;QAC9D,OAAO,EAAE,YAAY,KAAI;QACzB,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;QAC/B,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,6BAA6B,UAAU,OAAO,OAAO;AACrE,sBAAgB,6BAA6B,UAAU,SAAS,SAAS;AACzE,sBAAgB,6BAA6B,UAAU,OAAO,OAAO;AACrE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,6BAA6B,WAAW,OAAO,aAAa;UAChF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,+BAA+BJ,IAAM;AACnD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,+BAA+B,GAAG;AAC7E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,4BAA4BA,IAAM;AACzC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,yCAAyC,GAAG;AACvF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,6CAA6C,YAAwC;AAC5F,cAAM,aAAa,2CAA2C,UAAU;AACxE,YAAI,CAAC,YAAY;AACf;;AAGF,YAAI,WAAW,UAAU;AACvB,qBAAW,aAAa;AACxB;;AAKF,mBAAW,WAAW;AAGtB,cAAM,cAAc,WAAW,eAAc;AAC7C,oBACE,aACA,MAAK;AACH,qBAAW,WAAW;AAEtB,cAAI,WAAW,YAAY;AACzB,uBAAW,aAAa;AACxB,yDAA6C,UAAU;;AAGzD,iBAAO;WAET,CAAAI,OAAI;AACF,4CAAkC,YAAYA,EAAC;AAC/C,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,kDAAkD,YAAwC;AACjG,0DAAkD,UAAU;AAC5D,mBAAW,oBAAoB,IAAI,YAAW;MAChD;AAEA,eAAS,qDACP,QACA,oBAAyC;AAKzC,YAAI,OAAO;AACX,YAAI,OAAO,WAAW,UAAU;AAE9B,iBAAO;;AAGT,cAAM,aAAa,sDAAyD,kBAAkB;AAC9F,YAAI,mBAAmB,eAAe,WAAW;AAC/C,2CAAiC,QAAQ,YAAgD,IAAI;eACxF;AAEL,+CAAqC,QAAQ,YAAY,IAAI;;MAEjE;AAEA,eAAS,sDACP,oBAAyC;AAEzC,cAAM,cAAc,mBAAmB;AACvC,cAAM,cAAc,mBAAmB;AAKvC,eAAO,IAAI,mBAAmB,gBAC5B,mBAAmB,QAAQ,mBAAmB,YAAY,cAAc,WAAW;MACvF;AAEA,eAAS,gDAAgD,YACA,QACA,YACA,YAAkB;AACzE,mBAAW,OAAO,KAAK,EAAE,QAAQ,YAAY,WAAU,CAAE;AACzD,mBAAW,mBAAmB;MAChC;AAEA,eAAS,sDAAsD,YACA,QACA,YACA,YAAkB;AAC/E,YAAI;AACJ,YAAI;AACF,wBAAc,iBAAiB,QAAQ,YAAY,aAAa,UAAU;iBACnE,QAAQ;AACf,4CAAkC,YAAY,MAAM;AACpD,gBAAM;;AAER,wDAAgD,YAAY,aAAa,GAAG,UAAU;MACxF;AAEA,eAAS,2DAA2D,YACA,iBAAmC;AAErG,YAAI,gBAAgB,cAAc,GAAG;AACnC,gEACE,YACA,gBAAgB,QAChB,gBAAgB,YAChB,gBAAgB,WAAW;;AAG/B,yDAAiD,UAAU;MAC7D;AAEA,eAAS,4DAA4D,YACA,oBAAsC;AACzG,cAAM,iBAAiB,KAAK,IAAI,WAAW,iBACX,mBAAmB,aAAa,mBAAmB,WAAW;AAC9F,cAAM,iBAAiB,mBAAmB,cAAc;AAExD,YAAI,4BAA4B;AAChC,YAAI,QAAQ;AAEZ,cAAM,iBAAiB,iBAAiB,mBAAmB;AAC3D,cAAM,kBAAkB,iBAAiB;AAGzC,YAAI,mBAAmB,mBAAmB,aAAa;AACrD,sCAA4B,kBAAkB,mBAAmB;AACjE,kBAAQ;;AAGV,cAAM,QAAQ,WAAW;AAEzB,eAAO,4BAA4B,GAAG;AACpC,gBAAM,cAAc,MAAM,KAAI;AAE9B,gBAAM,cAAc,KAAK,IAAI,2BAA2B,YAAY,UAAU;AAE9E,gBAAM,YAAY,mBAAmB,aAAa,mBAAmB;AACrE,6BAAmB,mBAAmB,QAAQ,WAAW,YAAY,QAAQ,YAAY,YAAY,WAAW;AAEhH,cAAI,YAAY,eAAe,aAAa;AAC1C,kBAAM,MAAK;iBACN;AACL,wBAAY,cAAc;AAC1B,wBAAY,cAAc;;AAE5B,qBAAW,mBAAmB;AAE9B,iEAAuD,YAAY,aAAa,kBAAkB;AAElG,uCAA6B;;AAS/B,eAAO;MACT;AAEA,eAAS,uDAAuD,YACA,MACA,oBAAsC;AAGpG,2BAAmB,eAAe;MACpC;AAEA,eAAS,6CAA6C,YAAwC;AAG5F,YAAI,WAAW,oBAAoB,KAAK,WAAW,iBAAiB;AAClE,sDAA4C,UAAU;AACtD,8BAAoB,WAAW,6BAA6B;eACvD;AACL,uDAA6C,UAAU;;MAE3D;AAEA,eAAS,kDAAkD,YAAwC;AACjG,YAAI,WAAW,iBAAiB,MAAM;AACpC;;AAGF,mBAAW,aAAa,0CAA0C;AAClE,mBAAW,aAAa,QAAQ;AAChC,mBAAW,eAAe;MAC5B;AAEA,eAAS,iEAAiE,YAAwC;AAGhH,eAAO,WAAW,kBAAkB,SAAS,GAAG;AAC9C,cAAI,WAAW,oBAAoB,GAAG;AACpC;;AAGF,gBAAM,qBAAqB,WAAW,kBAAkB,KAAI;AAG5D,cAAI,4DAA4D,YAAY,kBAAkB,GAAG;AAC/F,6DAAiD,UAAU;AAE3D,iEACE,WAAW,+BACX,kBAAkB;;;MAI1B;AAEA,eAAS,0DAA0D,YAAwC;AACzG,cAAM,SAAS,WAAW,8BAA8B;AAExD,eAAO,OAAO,cAAc,SAAS,GAAG;AACtC,cAAI,WAAW,oBAAoB,GAAG;AACpC;;AAEF,gBAAM,cAAc,OAAO,cAAc,MAAK;AAC9C,+DAAqD,YAAY,WAAW;;MAEhF;AAEM,eAAU,qCACd,YACA,MACA,KACA,iBAAmC;AAEnC,cAAM,SAAS,WAAW;AAE1B,cAAM,OAAO,KAAK;AAClB,cAAM,cAAc,2BAA2B,IAAI;AAEnD,cAAM,EAAE,YAAY,WAAU,IAAK;AAEnC,cAAM,cAAc,MAAM;AAI1B,YAAI;AACJ,YAAI;AACF,mBAAS,oBAAoB,KAAK,MAAM;iBACjCA,IAAG;AACV,0BAAgB,YAAYA,EAAC;AAC7B;;AAGF,cAAM,qBAAgD;UACpD;UACA,kBAAkB,OAAO;UACzB;UACA;UACA,aAAa;UACb;UACA;UACA,iBAAiB;UACjB,YAAY;;AAGd,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,qBAAW,kBAAkB,KAAK,kBAAkB;AAMpD,2CAAiC,QAAQ,eAAe;AACxD;;AAGF,YAAI,OAAO,WAAW,UAAU;AAC9B,gBAAM,YAAY,IAAI,KAAK,mBAAmB,QAAQ,mBAAmB,YAAY,CAAC;AACtF,0BAAgB,YAAY,SAAS;AACrC;;AAGF,YAAI,WAAW,kBAAkB,GAAG;AAClC,cAAI,4DAA4D,YAAY,kBAAkB,GAAG;AAC/F,kBAAM,aAAa,sDAAyD,kBAAkB;AAE9F,yDAA6C,UAAU;AAEvD,4BAAgB,YAAY,UAAU;AACtC;;AAGF,cAAI,WAAW,iBAAiB;AAC9B,kBAAMA,KAAI,IAAI,UAAU,yDAAyD;AACjF,8CAAkC,YAAYA,EAAC;AAE/C,4BAAgB,YAAYA,EAAC;AAC7B;;;AAIJ,mBAAW,kBAAkB,KAAK,kBAAkB;AAEpD,yCAAoC,QAAQ,eAAe;AAC3D,qDAA6C,UAAU;MACzD;AAEA,eAAS,iDAAiD,YACA,iBAAmC;AAG3F,YAAI,gBAAgB,eAAe,QAAQ;AACzC,2DAAiD,UAAU;;AAG7D,cAAM,SAAS,WAAW;AAC1B,YAAI,4BAA4B,MAAM,GAAG;AACvC,iBAAO,qCAAqC,MAAM,IAAI,GAAG;AACvD,kBAAM,qBAAqB,iDAAiD,UAAU;AACtF,iEAAqD,QAAQ,kBAAkB;;;MAGrF;AAEA,eAAS,mDAAmD,YACA,cACA,oBAAsC;AAGhG,+DAAuD,YAAY,cAAc,kBAAkB;AAEnG,YAAI,mBAAmB,eAAe,QAAQ;AAC5C,qEAA2D,YAAY,kBAAkB;AACzF,2EAAiE,UAAU;AAC3E;;AAGF,YAAI,mBAAmB,cAAc,mBAAmB,aAAa;AAGnE;;AAGF,yDAAiD,UAAU;AAE3D,cAAM,gBAAgB,mBAAmB,cAAc,mBAAmB;AAC1E,YAAI,gBAAgB,GAAG;AACrB,gBAAM,MAAM,mBAAmB,aAAa,mBAAmB;AAC/D,gEACE,YACA,mBAAmB,QACnB,MAAM,eACN,aAAa;;AAIjB,2BAAmB,eAAe;AAClC,6DAAqD,WAAW,+BAA+B,kBAAkB;AAEjH,yEAAiE,UAAU;MAC7E;AAEA,eAAS,4CAA4C,YAA0C,cAAoB;AACjH,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AAGzD,0DAAkD,UAAU;AAE5D,cAAM,QAAQ,WAAW,8BAA8B;AACvD,YAAI,UAAU,UAAU;AAEtB,2DAAiD,YAAY,eAAe;eACvE;AAGL,6DAAmD,YAAY,cAAc,eAAe;;AAG9F,qDAA6C,UAAU;MACzD;AAEA,eAAS,iDACP,YAAwC;AAGxC,cAAM,aAAa,WAAW,kBAAkB,MAAK;AACrD,eAAO;MACT;AAEA,eAAS,2CAA2C,YAAwC;AAC1F,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC,iBAAO;;AAGT,YAAI,WAAW,iBAAiB;AAC9B,iBAAO;;AAGT,YAAI,CAAC,WAAW,UAAU;AACxB,iBAAO;;AAGT,YAAI,+BAA+B,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAC1F,iBAAO;;AAGT,YAAI,4BAA4B,MAAM,KAAK,qCAAqC,MAAM,IAAI,GAAG;AAC3F,iBAAO;;AAGT,cAAM,cAAc,2CAA2C,UAAU;AAEzE,YAAI,cAAe,GAAG;AACpB,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,4CAA4C,YAAwC;AAC3F,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;MAChC;AAIM,eAAU,kCAAkC,YAAwC;AACxF,cAAM,SAAS,WAAW;AAE1B,YAAI,WAAW,mBAAmB,OAAO,WAAW,YAAY;AAC9D;;AAGF,YAAI,WAAW,kBAAkB,GAAG;AAClC,qBAAW,kBAAkB;AAE7B;;AAGF,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,gBAAM,uBAAuB,WAAW,kBAAkB,KAAI;AAC9D,cAAI,qBAAqB,cAAc,qBAAqB,gBAAgB,GAAG;AAC7E,kBAAMA,KAAI,IAAI,UAAU,yDAAyD;AACjF,8CAAkC,YAAYA,EAAC;AAE/C,kBAAMA;;;AAIV,oDAA4C,UAAU;AACtD,4BAAoB,MAAM;MAC5B;AAEgB,eAAA,oCACd,YACA,OAAiC;AAEjC,cAAM,SAAS,WAAW;AAE1B,YAAI,WAAW,mBAAmB,OAAO,WAAW,YAAY;AAC9D;;AAGF,cAAM,EAAE,QAAQ,YAAY,WAAU,IAAK;AAC3C,YAAI,iBAAiB,MAAM,GAAG;AAC5B,gBAAM,IAAI,UAAU,sDAAuD;;AAE7E,cAAM,oBAAoB,oBAAoB,MAAM;AAEpD,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,gBAAM,uBAAuB,WAAW,kBAAkB,KAAI;AAC9D,cAAI,iBAAiB,qBAAqB,MAAM,GAAG;AACjD,kBAAM,IAAI,UACR,4FAA6F;;AAGjG,4DAAkD,UAAU;AAC5D,+BAAqB,SAAS,oBAAoB,qBAAqB,MAAM;AAC7E,cAAI,qBAAqB,eAAe,QAAQ;AAC9C,uEAA2D,YAAY,oBAAoB;;;AAI/F,YAAI,+BAA+B,MAAM,GAAG;AAC1C,oEAA0D,UAAU;AACpE,cAAI,iCAAiC,MAAM,MAAM,GAAG;AAElD,4DAAgD,YAAY,mBAAmB,YAAY,UAAU;iBAChG;AAEL,gBAAI,WAAW,kBAAkB,SAAS,GAAG;AAE3C,+DAAiD,UAAU;;AAE7D,kBAAM,kBAAkB,IAAI,WAAW,mBAAmB,YAAY,UAAU;AAChF,6CAAiC,QAAQ,iBAA0C,KAAK;;mBAEjF,4BAA4B,MAAM,GAAG;AAE9C,0DAAgD,YAAY,mBAAmB,YAAY,UAAU;AACrG,2EAAiE,UAAU;eACtE;AAEL,0DAAgD,YAAY,mBAAmB,YAAY,UAAU;;AAGvG,qDAA6C,UAAU;MACzD;AAEgB,eAAA,kCAAkC,YAA0CA,IAAM;AAChG,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC;;AAGF,0DAAkD,UAAU;AAE5D,mBAAW,UAAU;AACrB,oDAA4C,UAAU;AACtD,4BAAoB,QAAQA,EAAC;MAC/B;AAEgB,eAAA,qDACd,YACA,aAA+C;AAI/C,cAAM,QAAQ,WAAW,OAAO,MAAK;AACrC,mBAAW,mBAAmB,MAAM;AAEpC,qDAA6C,UAAU;AAEvD,cAAM,OAAO,IAAI,WAAW,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU;AAC5E,oBAAY,YAAY,IAA6B;MACvD;AAEM,eAAU,2CACd,YAAwC;AAExC,YAAI,WAAW,iBAAiB,QAAQ,WAAW,kBAAkB,SAAS,GAAG;AAC/E,gBAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,gBAAM,OAAO,IAAI,WAAW,gBAAgB,QAChB,gBAAgB,aAAa,gBAAgB,aAC7C,gBAAgB,aAAa,gBAAgB,WAAW;AAEpF,gBAAM,cAAyC,OAAO,OAAO,0BAA0B,SAAS;AAChG,yCAA+B,aAAa,YAAY,IAA6B;AACrF,qBAAW,eAAe;;AAE5B,eAAO,WAAW;MACpB;AAEA,eAAS,2CAA2C,YAAwC;AAC1F,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,WAAW;AACvB,iBAAO;;AAET,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,WAAW,eAAe,WAAW;MAC9C;AAEgB,eAAA,oCAAoC,YAA0C,cAAoB;AAGhH,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,UAAU;AACtB,cAAI,iBAAiB,GAAG;AACtB,kBAAM,IAAI,UAAU,kEAAkE;;eAEnF;AAEL,cAAI,iBAAiB,GAAG;AACtB,kBAAM,IAAI,UAAU,iFAAiF;;AAEvG,cAAI,gBAAgB,cAAc,eAAe,gBAAgB,YAAY;AAC3E,kBAAM,IAAI,WAAW,2BAA2B;;;AAIpD,wBAAgB,SAAS,oBAAoB,gBAAgB,MAAM;AAEnE,oDAA4C,YAAY,YAAY;MACtE;AAEgB,eAAA,+CAA+C,YACA,MAAgC;AAI7F,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,UAAU;AACtB,cAAI,KAAK,eAAe,GAAG;AACzB,kBAAM,IAAI,UAAU,kFAAmF;;eAEpG;AAEL,cAAI,KAAK,eAAe,GAAG;AACzB,kBAAM,IAAI,UACR,iGAAkG;;;AAKxG,YAAI,gBAAgB,aAAa,gBAAgB,gBAAgB,KAAK,YAAY;AAChF,gBAAM,IAAI,WAAW,yDAAyD;;AAEhF,YAAI,gBAAgB,qBAAqB,KAAK,OAAO,YAAY;AAC/D,gBAAM,IAAI,WAAW,4DAA4D;;AAEnF,YAAI,gBAAgB,cAAc,KAAK,aAAa,gBAAgB,YAAY;AAC9E,gBAAM,IAAI,WAAW,yDAAyD;;AAGhF,cAAM,iBAAiB,KAAK;AAC5B,wBAAgB,SAAS,oBAAoB,KAAK,MAAM;AACxD,oDAA4C,YAAY,cAAc;MACxE;AAEgB,eAAA,kCAAkC,QACA,YACA,gBACA,eACA,iBACA,eACA,uBAAyC;AAOzF,mBAAW,gCAAgC;AAE3C,mBAAW,aAAa;AACxB,mBAAW,WAAW;AAEtB,mBAAW,eAAe;AAG1B,mBAAW,SAAS,WAAW,kBAAkB;AACjD,mBAAW,UAAU;AAErB,mBAAW,kBAAkB;AAC7B,mBAAW,WAAW;AAEtB,mBAAW,eAAe;AAE1B,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAE9B,mBAAW,yBAAyB;AAEpC,mBAAW,oBAAoB,IAAI,YAAW;AAE9C,eAAO,4BAA4B;AAEnC,cAAM,cAAc,eAAc;AAClC,oBACE,oBAAoB,WAAW,GAC/B,MAAK;AACH,qBAAW,WAAW;AAKtB,uDAA6C,UAAU;AACvD,iBAAO;WAET,CAAAE,OAAI;AACF,4CAAkC,YAAYA,EAAC;AAC/C,iBAAO;QACT,CAAC;MAEL;eAEgB,sDACd,QACA,sBACA,eAAqB;AAErB,cAAM,aAA2C,OAAO,OAAO,6BAA6B,SAAS;AAErG,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,qBAAqB,UAAU,QAAW;AAC5C,2BAAiB,MAAM,qBAAqB,MAAO,UAAU;eACxD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,qBAAqB,SAAS,QAAW;AAC3C,0BAAgB,MAAM,qBAAqB,KAAM,UAAU;eACtD;AACL,0BAAgB,MAAM,oBAAoB,MAAS;;AAErD,YAAI,qBAAqB,WAAW,QAAW;AAC7C,4BAAkB,YAAU,qBAAqB,OAAQ,MAAM;eAC1D;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,cAAM,wBAAwB,qBAAqB;AACnD,YAAI,0BAA0B,GAAG;AAC/B,gBAAM,IAAI,UAAU,8CAA8C;;AAGpE,0CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,qBAAqB;MAE5G;AAEA,eAAS,+BAA+B,SACA,YACA,MAAgC;AAKtE,gBAAQ,0CAA0C;AAClD,gBAAQ,QAAQ;MAClB;AAIA,eAAS,+BAA+B,MAAY;AAClD,eAAO,IAAI,UACT,uCAAuC,IAAI,kDAAkD;MACjG;AAIA,eAAS,wCAAwC,MAAY;AAC3D,eAAO,IAAI,UACT,0CAA0C,IAAI,qDAAqD;MACvG;AC1nCgB,eAAA,qBAAqB,SACA,SAAe;AAClD,yBAAiB,SAAS,OAAO;AACjC,cAAM,OAAO,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACtB,eAAO;UACL,MAAM,SAAS,SAAY,SAAY,gCAAgC,MAAM,GAAG,OAAO,yBAAyB;;MAEpH;AAEA,eAAS,gCAAgC,MAAc,SAAe;AACpE,eAAO,GAAG,IAAI;AACd,YAAI,SAAS,QAAQ;AACnB,gBAAM,IAAI,UAAU,GAAG,OAAO,KAAK,IAAI,iEAAiE;;AAE1G,eAAO;MACT;AAEgB,eAAA,uBACd,SACA,SAAe;;AAEf,yBAAiB,SAAS,OAAO;AACjC,cAAM,OAAML,MAAA,YAAA,QAAA,YAAA,SAAA,SAAA,QAAS,SAAO,QAAAA,QAAA,SAAAA,MAAA;AAC5B,eAAO;UACL,KAAK,wCACH,KACA,GAAG,OAAO,wBAAwB;;MAGxC;ACKM,eAAU,gCAAgC,QAA0B;AACxE,eAAO,IAAI,yBAAyB,MAAoC;MAC1E;AAIgB,eAAA,iCACd,QACA,iBAAmC;AAKlC,eAAO,QAAsC,kBAAkB,KAAK,eAAe;MACtF;eAEgB,qCAAqC,QACA,OACA,MAAa;AAChE,cAAM,SAAS,OAAO;AAItB,cAAM,kBAAkB,OAAO,kBAAkB,MAAK;AACtD,YAAI,MAAM;AACR,0BAAgB,YAAY,KAAK;eAC5B;AACL,0BAAgB,YAAY,KAAK;;MAErC;AAEM,eAAU,qCAAqC,QAA0B;AAC7E,eAAQ,OAAO,QAAqC,kBAAkB;MACxE;AAEM,eAAU,4BAA4B,QAA0B;AACpE,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB,iBAAO;;AAGT,YAAI,CAAC,2BAA2B,MAAM,GAAG;AACvC,iBAAO;;AAGT,eAAO;MACT;YAiBa,yBAAwB;QAYnC,YAAY,QAAkC;AAC5C,iCAAuB,QAAQ,GAAG,0BAA0B;AAC5D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,cAAI,CAAC,+BAA+B,OAAO,yBAAyB,GAAG;AACrE,kBAAM,IAAI,UAAU,6FACV;;AAGZ,gDAAsC,MAAM,MAAM;AAElD,eAAK,oBAAoB,IAAI,YAAW;;;;;;QAO1C,IAAI,SAAM;AACR,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,QAAQ,CAAC;;AAGpE,iBAAO,KAAK;;;;;QAMd,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,QAAQ,CAAC;;AAGpE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,QAAQ,CAAC;;AAG1D,iBAAO,kCAAkC,MAAM,MAAM;;QAYvD,KACE,MACA,aAAqE,CAAA,GAAE;AAEvE,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,MAAM,CAAC;;AAGlE,cAAI,CAAC,YAAY,OAAO,IAAI,GAAG;AAC7B,mBAAO,oBAAoB,IAAI,UAAU,mCAAmC,CAAC;;AAE/E,cAAI,KAAK,eAAe,GAAG;AACzB,mBAAO,oBAAoB,IAAI,UAAU,oCAAoC,CAAC;;AAEhF,cAAI,KAAK,OAAO,eAAe,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,6CAA6C,CAAC;;AAEzF,cAAI,iBAAiB,KAAK,MAAM,GAAG;AACjC,mBAAO,oBAAoB,IAAI,UAAU,iCAAkC,CAAC;;AAG9E,cAAI;AACJ,cAAI;AACF,sBAAU,uBAAuB,YAAY,SAAS;mBAC/CG,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,MAAM,QAAQ;AACpB,cAAI,QAAQ,GAAG;AACb,mBAAO,oBAAoB,IAAI,UAAU,oCAAoC,CAAC;;AAEhF,cAAI,CAAC,WAAW,IAAI,GAAG;AACrB,gBAAI,MAAO,KAA+B,QAAQ;AAChD,qBAAO,oBAAoB,IAAI,WAAW,yDAA0D,CAAC;;qBAE9F,MAAM,KAAK,YAAY;AAChC,mBAAO,oBAAoB,IAAI,WAAW,6DAA8D,CAAC;;AAG3G,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,WAAW,CAAC;;AAG7D,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA4C,CAAC,SAAS,WAAU;AAC9E,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,kBAAsC;YAC1C,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE;YAClE,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,KAAI,CAAE;YACjE,aAAa,CAAAA,OAAK,cAAcA,EAAC;;AAEnC,uCAA6B,MAAM,MAAM,KAAK,eAAe;AAC7D,iBAAO;;;;;;;;;;;QAYT,cAAW;AACT,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,kBAAM,8BAA8B,aAAa;;AAGnD,cAAI,KAAK,yBAAyB,QAAW;AAC3C;;AAGF,0CAAgC,IAAI;;MAEvC;AAED,aAAO,iBAAiB,yBAAyB,WAAW;QAC1D,QAAQ,EAAE,YAAY,KAAI;QAC1B,MAAM,EAAE,YAAY,KAAI;QACxB,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,yBAAyB,UAAU,QAAQ,QAAQ;AACnE,sBAAgB,yBAAyB,UAAU,MAAM,MAAM;AAC/D,sBAAgB,yBAAyB,UAAU,aAAa,aAAa;AAC7E,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,yBAAyB,WAAW,OAAO,aAAa;UAC5E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,2BAA2BJ,IAAM;AAC/C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,mBAAmB,GAAG;AACjE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEM,eAAU,6BACd,QACA,MACA,KACA,iBAAmC;AAEnC,cAAM,SAAS,OAAO;AAItB,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,WAAW;AAC/B,0BAAgB,YAAY,OAAO,YAAY;eAC1C;AACL,+CACE,OAAO,2BACP,MACA,KACA,eAAe;;MAGrB;AAEM,eAAU,gCAAgC,QAAgC;AAC9E,2CAAmC,MAAM;AACzC,cAAMI,KAAI,IAAI,UAAU,qBAAqB;AAC7C,sDAA8C,QAAQA,EAAC;MACzD;AAEgB,eAAA,8CAA8C,QAAkCA,IAAM;AACpG,cAAM,mBAAmB,OAAO;AAChC,eAAO,oBAAoB,IAAI,YAAW;AAC1C,yBAAiB,QAAQ,qBAAkB;AACzC,0BAAgB,YAAYA,EAAC;QAC/B,CAAC;MACH;AAIA,eAAS,8BAA8B,MAAY;AACjD,eAAO,IAAI,UACT,sCAAsC,IAAI,iDAAiD;MAC/F;ACjUgB,eAAA,qBAAqB,UAA2B,YAAkB;AAChF,cAAM,EAAE,cAAa,IAAK;AAE1B,YAAI,kBAAkB,QAAW;AAC/B,iBAAO;;AAGT,YAAI,YAAY,aAAa,KAAK,gBAAgB,GAAG;AACnD,gBAAM,IAAI,WAAW,uBAAuB;;AAG9C,eAAO;MACT;AAEM,eAAU,qBAAwB,UAA4B;AAClE,cAAM,EAAE,KAAI,IAAK;AAEjB,YAAI,CAAC,MAAM;AACT,iBAAO,MAAM;;AAGf,eAAO;MACT;ACtBgB,eAAA,uBAA0B,MACA,SAAe;AACvD,yBAAiB,MAAM,OAAO;AAC9B,cAAM,gBAAgB,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AAC5B,cAAM,OAAO,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACnB,eAAO;UACL,eAAe,kBAAkB,SAAY,SAAY,0BAA0B,aAAa;UAChG,MAAM,SAAS,SAAY,SAAY,2BAA2B,MAAM,GAAG,OAAO,yBAAyB;;MAE/G;AAEA,eAAS,2BAA8B,IACA,SAAe;AACpD,uBAAe,IAAI,OAAO;AAC1B,eAAO,WAAS,0BAA0B,GAAG,KAAK,CAAC;MACrD;ACNgB,eAAA,sBAAyB,UACA,SAAe;AACtD,yBAAiB,UAAU,OAAO;AAClC,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,eAAO;UACL,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F;;MAEJ;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,MAAM,YAAY,IAAI,UAAU,CAAA,CAAE;MAC3C;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAgD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAChG;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,OAAU,eAAgD,YAAY,IAAI,UAAU,CAAC,OAAO,UAAU,CAAC;MACjH;ACrEgB,eAAA,qBAAqBJ,IAAY,SAAe;AAC9D,YAAI,CAAC,iBAAiBA,EAAC,GAAG;AACxB,gBAAM,IAAI,UAAU,GAAG,OAAO,2BAA2B;;MAE7D;AC2BM,eAAUO,eAAc,OAAc;AAC1C,YAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,iBAAO;;AAET,YAAI;AACF,iBAAO,OAAQ,MAAsB,YAAY;iBACjDN,KAAM;AAEN,iBAAO;;MAEX;AAsBA,YAAM,0BAA0B,OAAQ,oBAA4B;eAOpD,wBAAqB;AACnC,YAAI,yBAAyB;AAC3B,iBAAO,IAAK,gBAA8C;;AAE5D,eAAO;MACT;MCnBA,MAAM,eAAc;QAuBlB,YAAY,oBAA0D,CAAA,GAC1D,cAAqD,CAAA,GAAE;AACjE,cAAI,sBAAsB,QAAW;AACnC,gCAAoB;iBACf;AACL,yBAAa,mBAAmB,iBAAiB;;AAGnD,gBAAM,WAAW,uBAAuB,aAAa,kBAAkB;AACvE,gBAAM,iBAAiB,sBAAsB,mBAAmB,iBAAiB;AAEjF,mCAAyB,IAAI;AAE7B,gBAAM,OAAO,eAAe;AAC5B,cAAI,SAAS,QAAW;AACtB,kBAAM,IAAI,WAAW,2BAA2B;;AAGlD,gBAAM,gBAAgB,qBAAqB,QAAQ;AACnD,gBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AAEtD,iEAAuD,MAAM,gBAAgB,eAAe,aAAa;;;;;QAM3G,IAAI,SAAM;AACR,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMO,4BAA0B,QAAQ;;AAG1C,iBAAO,uBAAuB,IAAI;;;;;;;;;;;QAYpC,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,OAAO,CAAC;;AAG/D,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,iDAAiD,CAAC;;AAG7F,iBAAO,oBAAoB,MAAM,MAAM;;;;;;;;;;QAWzC,QAAK;AACH,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,OAAO,CAAC;;AAG/D,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,iDAAiD,CAAC;;AAG7F,cAAI,oCAAoC,IAAI,GAAG;AAC7C,mBAAO,oBAAoB,IAAI,UAAU,wCAAwC,CAAC;;AAGpF,iBAAO,oBAAoB,IAAI;;;;;;;;;;QAWjC,YAAS;AACP,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,WAAW;;AAG7C,iBAAO,mCAAmC,IAAI;;MAEjD;AAED,aAAO,iBAAiB,eAAe,WAAW;QAChD,OAAO,EAAE,YAAY,KAAI;QACzB,OAAO,EAAE,YAAY,KAAI;QACzB,WAAW,EAAE,YAAY,KAAI;QAC7B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,eAAe,UAAU,OAAO,OAAO;AACvD,sBAAgB,eAAe,UAAU,OAAO,OAAO;AACvD,sBAAgB,eAAe,UAAU,WAAW,WAAW;AAC/D,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,eAAe,WAAW,OAAO,aAAa;UAClE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AA0BA,eAAS,mCAAsC,QAAyB;AACtE,eAAO,IAAI,4BAA4B,MAAM;MAC/C;AAGA,eAAS,qBAAwB,gBACA,gBACA,gBACA,gBACA,gBAAgB,GAChB,gBAAgD,MAAM,GAAC;AAGtF,cAAM,SAA4B,OAAO,OAAO,eAAe,SAAS;AACxE,iCAAyB,MAAM;AAE/B,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAE9G,6CAAqC,QAAQ,YAAY,gBAAgB,gBAAgB,gBACpD,gBAAgB,eAAe,aAAa;AACjF,eAAO;MACT;AAEA,eAAS,yBAA4B,QAAyB;AAC5D,eAAO,SAAS;AAIhB,eAAO,eAAe;AAEtB,eAAO,UAAU;AAIjB,eAAO,4BAA4B;AAInC,eAAO,iBAAiB,IAAI,YAAW;AAIvC,eAAO,wBAAwB;AAI/B,eAAO,gBAAgB;AAIvB,eAAO,wBAAwB;AAG/B,eAAO,uBAAuB;AAG9B,eAAO,gBAAgB;MACzB;AAEA,eAAS,iBAAiBR,IAAU;AAClC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,uBAAuB,QAAsB;AAGpD,YAAI,OAAO,YAAY,QAAW;AAChC,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,oBAAoB,QAAwB,QAAW;;AAC9D,YAAI,OAAO,WAAW,YAAY,OAAO,WAAW,WAAW;AAC7D,iBAAO,oBAAoB,MAAS;;AAEtC,eAAO,0BAA0B,eAAe;AAChD,SAAAC,MAAA,OAAO,0BAA0B,sBAAgB,QAAAA,QAAA,SAAA,SAAAA,IAAE,MAAM,MAAM;AAK/D,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,iBAAO,oBAAoB,MAAS;;AAEtC,YAAI,OAAO,yBAAyB,QAAW;AAC7C,iBAAO,OAAO,qBAAqB;;AAKrC,YAAI,qBAAqB;AACzB,YAAI,UAAU,YAAY;AACxB,+BAAqB;AAErB,mBAAS;;AAGX,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,iBAAO,uBAAuB;YAC5B,UAAU;YACV,UAAU;YACV,SAAS;YACT,SAAS;YACT,qBAAqB;;QAEzB,CAAC;AACD,eAAO,qBAAsB,WAAW;AAExC,YAAI,CAAC,oBAAoB;AACvB,sCAA4B,QAAQ,MAAM;;AAG5C,eAAO;MACT;AAEA,eAAS,oBAAoB,QAA2B;AACtD,cAAM,QAAQ,OAAO;AACrB,YAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,iBAAO,oBAAoB,IAAI,UAC7B,kBAAkB,KAAK,2DAA2D,CAAC;;AAMvF,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,gBAAM,eAA6B;YACjC,UAAU;YACV,SAAS;;AAGX,iBAAO,gBAAgB;QACzB,CAAC;AAED,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,OAAO,iBAAiB,UAAU,YAAY;AACxE,2CAAiC,MAAM;;AAGzC,6CAAqC,OAAO,yBAAyB;AAErE,eAAO;MACT;AAIA,eAAS,8BAA8B,QAAsB;AAI3D,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,gBAAM,eAA6B;YACjC,UAAU;YACV,SAAS;;AAGX,iBAAO,eAAe,KAAK,YAAY;QACzC,CAAC;AAED,eAAO;MACT;AAEA,eAAS,gCAAgC,QAAwB,OAAU;AACzE,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY;AACxB,sCAA4B,QAAQ,KAAK;AACzC;;AAIF,qCAA6B,MAAM;MACrC;AAEA,eAAS,4BAA4B,QAAwB,QAAW;AAItE,cAAM,aAAa,OAAO;AAG1B,eAAO,SAAS;AAChB,eAAO,eAAe;AACtB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,gEAAsD,QAAQ,MAAM;;AAGtE,YAAI,CAAC,yCAAyC,MAAM,KAAK,WAAW,UAAU;AAC5E,uCAA6B,MAAM;;MAEvC;AAEA,eAAS,6BAA6B,QAAsB;AAG1D,eAAO,SAAS;AAChB,eAAO,0BAA0B,UAAU,EAAC;AAE5C,cAAM,cAAc,OAAO;AAC3B,eAAO,eAAe,QAAQ,kBAAe;AAC3C,uBAAa,QAAQ,WAAW;QAClC,CAAC;AACD,eAAO,iBAAiB,IAAI,YAAW;AAEvC,YAAI,OAAO,yBAAyB,QAAW;AAC7C,4DAAkD,MAAM;AACxD;;AAGF,cAAM,eAAe,OAAO;AAC5B,eAAO,uBAAuB;AAE9B,YAAI,aAAa,qBAAqB;AACpC,uBAAa,QAAQ,WAAW;AAChC,4DAAkD,MAAM;AACxD;;AAGF,cAAM,UAAU,OAAO,0BAA0B,UAAU,EAAE,aAAa,OAAO;AACjF,oBACE,SACA,MAAK;AACH,uBAAa,SAAQ;AACrB,4DAAkD,MAAM;AACxD,iBAAO;QACT,GACA,CAAC,WAAe;AACd,uBAAa,QAAQ,MAAM;AAC3B,4DAAkD,MAAM;AACxD,iBAAO;QACT,CAAC;MACL;AAEA,eAAS,kCAAkC,QAAsB;AAE/D,eAAO,sBAAuB,SAAS,MAAS;AAChD,eAAO,wBAAwB;MACjC;AAEA,eAAS,2CAA2C,QAAwB,OAAU;AAEpF,eAAO,sBAAuB,QAAQ,KAAK;AAC3C,eAAO,wBAAwB;AAI/B,wCAAgC,QAAQ,KAAK;MAC/C;AAEA,eAAS,kCAAkC,QAAsB;AAE/D,eAAO,sBAAuB,SAAS,MAAS;AAChD,eAAO,wBAAwB;AAE/B,cAAM,QAAQ,OAAO;AAIrB,YAAI,UAAU,YAAY;AAExB,iBAAO,eAAe;AACtB,cAAI,OAAO,yBAAyB,QAAW;AAC7C,mBAAO,qBAAqB,SAAQ;AACpC,mBAAO,uBAAuB;;;AAIlC,eAAO,SAAS;AAEhB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,4CAAkC,MAAM;;MAK5C;AAEA,eAAS,2CAA2C,QAAwB,OAAU;AAEpF,eAAO,sBAAuB,QAAQ,KAAK;AAC3C,eAAO,wBAAwB;AAK/B,YAAI,OAAO,yBAAyB,QAAW;AAC7C,iBAAO,qBAAqB,QAAQ,KAAK;AACzC,iBAAO,uBAAuB;;AAEhC,wCAAgC,QAAQ,KAAK;MAC/C;AAGA,eAAS,oCAAoC,QAAsB;AACjE,YAAI,OAAO,kBAAkB,UAAa,OAAO,0BAA0B,QAAW;AACpF,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,yCAAyC,QAAsB;AACtE,YAAI,OAAO,0BAA0B,UAAa,OAAO,0BAA0B,QAAW;AAC5F,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,uCAAuC,QAAsB;AAGpE,eAAO,wBAAwB,OAAO;AACtC,eAAO,gBAAgB;MACzB;AAEA,eAAS,4CAA4C,QAAsB;AAGzE,eAAO,wBAAwB,OAAO,eAAe,MAAK;MAC5D;AAEA,eAAS,kDAAkD,QAAsB;AAE/E,YAAI,OAAO,kBAAkB,QAAW;AAGtC,iBAAO,cAAc,QAAQ,OAAO,YAAY;AAChD,iBAAO,gBAAgB;;AAEzB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,2CAAiC,QAAQ,OAAO,YAAY;;MAEhE;AAEA,eAAS,iCAAiC,QAAwB,cAAqB;AAIrF,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,iBAAiB,OAAO,eAAe;AACjE,cAAI,cAAc;AAChB,2CAA+B,MAAM;iBAChC;AAGL,6CAAiC,MAAM;;;AAI3C,eAAO,gBAAgB;MACzB;YAOa,4BAA2B;QAoBtC,YAAY,QAAyB;AACnC,iCAAuB,QAAQ,GAAG,6BAA6B;AAC/D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,eAAK,uBAAuB;AAC5B,iBAAO,UAAU;AAEjB,gBAAM,QAAQ,OAAO;AAErB,cAAI,UAAU,YAAY;AACxB,gBAAI,CAAC,oCAAoC,MAAM,KAAK,OAAO,eAAe;AACxE,kDAAoC,IAAI;mBACnC;AACL,4DAA8C,IAAI;;AAGpD,iDAAqC,IAAI;qBAChC,UAAU,YAAY;AAC/B,0DAA8C,MAAM,OAAO,YAAY;AACvE,iDAAqC,IAAI;qBAChC,UAAU,UAAU;AAC7B,0DAA8C,IAAI;AAClD,2DAA+C,IAAI;iBAC9C;AAGL,kBAAM,cAAc,OAAO;AAC3B,0DAA8C,MAAM,WAAW;AAC/D,2DAA+C,MAAM,WAAW;;;;;;;QAQpE,IAAI,SAAM;AACR,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,iBAAO,KAAK;;;;;;;;;;QAWd,IAAI,cAAW;AACb,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,cAAI,KAAK,yBAAyB,QAAW;AAC3C,kBAAM,2BAA2B,aAAa;;AAGhD,iBAAO,0CAA0C,IAAI;;;;;;;;;;QAWvD,IAAI,QAAK;AACP,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,iBAAO,KAAK;;;;;QAMd,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,2BAA2B,OAAO,CAAC;;AAGhE,iBAAO,iCAAiC,MAAM,MAAM;;;;;QAMtD,QAAK;AACH,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,gBAAM,SAAS,KAAK;AAEpB,cAAI,WAAW,QAAW;AACxB,mBAAO,oBAAoB,2BAA2B,OAAO,CAAC;;AAGhE,cAAI,oCAAoC,MAAM,GAAG;AAC/C,mBAAO,oBAAoB,IAAI,UAAU,wCAAwC,CAAC;;AAGpF,iBAAO,iCAAiC,IAAI;;;;;;;;;;;;QAa9C,cAAW;AACT,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,gBAAM,SAAS,KAAK;AAEpB,cAAI,WAAW,QAAW;AACxB;;AAKF,6CAAmC,IAAI;;QAazC,MAAM,QAAW,QAAU;AACzB,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,2BAA2B,UAAU,CAAC;;AAGnE,iBAAO,iCAAiC,MAAM,KAAK;;MAEtD;AAED,aAAO,iBAAiB,4BAA4B,WAAW;QAC7D,OAAO,EAAE,YAAY,KAAI;QACzB,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;QAC/B,OAAO,EAAE,YAAY,KAAI;QACzB,QAAQ,EAAE,YAAY,KAAI;QAC1B,aAAa,EAAE,YAAY,KAAI;QAC/B,OAAO,EAAE,YAAY,KAAI;MAC1B,CAAA;AACD,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,sBAAgB,4BAA4B,UAAU,aAAa,aAAa;AAChF,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,4BAA4B,WAAW,OAAO,aAAa;UAC/E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,8BAAuCD,IAAM;AACpD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,sBAAsB,GAAG;AACpE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAIA,eAAS,iCAAiC,QAAqC,QAAW;AACxF,cAAM,SAAS,OAAO;AAItB,eAAO,oBAAoB,QAAQ,MAAM;MAC3C;AAEA,eAAS,iCAAiC,QAAmC;AAC3E,cAAM,SAAS,OAAO;AAItB,eAAO,oBAAoB,MAAM;MACnC;AAEA,eAAS,qDAAqD,QAAmC;AAC/F,cAAM,SAAS,OAAO;AAItB,cAAM,QAAQ,OAAO;AACrB,YAAI,oCAAoC,MAAM,KAAK,UAAU,UAAU;AACrE,iBAAO,oBAAoB,MAAS;;AAGtC,YAAI,UAAU,WAAW;AACvB,iBAAO,oBAAoB,OAAO,YAAY;;AAKhD,eAAO,iCAAiC,MAAM;MAChD;AAEA,eAAS,uDAAuD,QAAqC,OAAU;AAC7G,YAAI,OAAO,wBAAwB,WAAW;AAC5C,2CAAiC,QAAQ,KAAK;eACzC;AACL,oDAA0C,QAAQ,KAAK;;MAE3D;AAEA,eAAS,sDAAsD,QAAqC,OAAU;AAC5G,YAAI,OAAO,uBAAuB,WAAW;AAC3C,0CAAgC,QAAQ,KAAK;eACxC;AACL,mDAAyC,QAAQ,KAAK;;MAE1D;AAEA,eAAS,0CAA0C,QAAmC;AACpF,cAAM,SAAS,OAAO;AACtB,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,aAAa,UAAU,YAAY;AAC/C,iBAAO;;AAGT,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,8CAA8C,OAAO,yBAAyB;MACvF;AAEA,eAAS,mCAAmC,QAAmC;AAC7E,cAAM,SAAS,OAAO;AAItB,cAAM,gBAAgB,IAAI,UACxB,kFAAkF;AAEpF,8DAAsD,QAAQ,aAAa;AAI3E,+DAAuD,QAAQ,aAAa;AAE5E,eAAO,UAAU;AACjB,eAAO,uBAAuB;MAChC;AAEA,eAAS,iCAAoC,QAAwC,OAAQ;AAC3F,cAAM,SAAS,OAAO;AAItB,cAAM,aAAa,OAAO;AAE1B,cAAM,YAAY,4CAA4C,YAAY,KAAK;AAE/E,YAAI,WAAW,OAAO,sBAAsB;AAC1C,iBAAO,oBAAoB,2BAA2B,UAAU,CAAC;;AAGnE,cAAM,QAAQ,OAAO;AACrB,YAAI,UAAU,WAAW;AACvB,iBAAO,oBAAoB,OAAO,YAAY;;AAEhD,YAAI,oCAAoC,MAAM,KAAK,UAAU,UAAU;AACrE,iBAAO,oBAAoB,IAAI,UAAU,0DAA0D,CAAC;;AAEtG,YAAI,UAAU,YAAY;AACxB,iBAAO,oBAAoB,OAAO,YAAY;;AAKhD,cAAM,UAAU,8BAA8B,MAAM;AAEpD,6CAAqC,YAAY,OAAO,SAAS;AAEjE,eAAO;MACT;AAEA,YAAM,gBAA+B,CAAA;YASxB,gCAA+B;QAwB1C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;;;;;QAU3C,IAAI,cAAW;AACb,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMS,uCAAqC,aAAa;;AAE1D,iBAAO,KAAK;;;;;QAMd,IAAI,SAAM;AACR,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,QAAQ;;AAErD,cAAI,KAAK,qBAAqB,QAAW;AAIvC,kBAAM,IAAI,UAAU,mEAAmE;;AAEzF,iBAAO,KAAK,iBAAiB;;;;;;;;;QAU/B,MAAML,KAAS,QAAS;AACtB,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMK,uCAAqC,OAAO;;AAEpD,gBAAM,QAAQ,KAAK,0BAA0B;AAC7C,cAAI,UAAU,YAAY;AAGxB;;AAGF,+CAAqC,MAAML,EAAC;;;QAI9C,CAAC,UAAU,EAAE,QAAW;AACtB,gBAAM,SAAS,KAAK,gBAAgB,MAAM;AAC1C,yDAA+C,IAAI;AACnD,iBAAO;;;QAIT,CAAC,UAAU,IAAC;AACV,qBAAW,IAAI;;MAElB;AAED,aAAO,iBAAiB,gCAAgC,WAAW;QACjE,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;QAC1B,OAAO,EAAE,YAAY,KAAI;MAC1B,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gCAAgC,WAAW,OAAO,aAAa;UACnF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,kCAAkCJ,IAAM;AAC/C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,qCAAwC,QACA,YACA,gBACA,gBACA,gBACA,gBACA,eACA,eAA6C;AAI5F,mBAAW,4BAA4B;AACvC,eAAO,4BAA4B;AAGnC,mBAAW,SAAS;AACpB,mBAAW,kBAAkB;AAC7B,mBAAW,UAAU;AAErB,mBAAW,eAAe;AAC1B,mBAAW,mBAAmB,sBAAqB;AACnD,mBAAW,WAAW;AAEtB,mBAAW,yBAAyB;AACpC,mBAAW,eAAe;AAE1B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAE7B,cAAM,eAAe,+CAA+C,UAAU;AAC9E,yCAAiC,QAAQ,YAAY;AAErD,cAAM,cAAc,eAAc;AAClC,cAAM,eAAe,oBAAoB,WAAW;AACpD,oBACE,cACA,MAAK;AAEH,qBAAW,WAAW;AACtB,8DAAoD,UAAU;AAC9D,iBAAO;WAET,CAAAM,OAAI;AAEF,qBAAW,WAAW;AACtB,0CAAgC,QAAQA,EAAC;AACzC,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,uDAA0D,QACA,gBACA,eACA,eAA6C;AAC9G,cAAM,aAAa,OAAO,OAAO,gCAAgC,SAAS;AAE1E,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,MAAM,eAAe,MAAO,UAAU;eAClD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,WAAS,eAAe,MAAO,OAAO,UAAU;eAC5D;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAEtD,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,MAAM,eAAe,MAAM;eACvC;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAEtD,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,YAAU,eAAe,MAAO,MAAM;eAClD;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAGtD,6CACE,QAAQ,YAAY,gBAAgB,gBAAgB,gBAAgB,gBAAgB,eAAe,aAAa;MAEpH;AAGA,eAAS,+CAA+C,YAAgD;AACtG,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,yBAAyB;MACtC;AAEA,eAAS,qCAAwC,YAA8C;AAC7F,6BAAqB,YAAY,eAAe,CAAC;AACjD,4DAAoD,UAAU;MAChE;AAEA,eAAS,4CAA+C,YACA,OAAQ;AAC9D,YAAI;AACF,iBAAO,WAAW,uBAAuB,KAAK;iBACvC,YAAY;AACnB,uDAA6C,YAAY,UAAU;AACnE,iBAAO;;MAEX;AAEA,eAAS,8CAA8C,YAAgD;AACrG,eAAO,WAAW,eAAe,WAAW;MAC9C;AAEA,eAAS,qCAAwC,YACA,OACA,WAAiB;AAChE,YAAI;AACF,+BAAqB,YAAY,OAAO,SAAS;iBAC1C,UAAU;AACjB,uDAA6C,YAAY,QAAQ;AACjE;;AAGF,cAAM,SAAS,WAAW;AAC1B,YAAI,CAAC,oCAAoC,MAAM,KAAK,OAAO,WAAW,YAAY;AAChF,gBAAM,eAAe,+CAA+C,UAAU;AAC9E,2CAAiC,QAAQ,YAAY;;AAGvD,4DAAoD,UAAU;MAChE;AAIA,eAAS,oDAAuD,YAA8C;AAC5G,cAAM,SAAS,WAAW;AAE1B,YAAI,CAAC,WAAW,UAAU;AACxB;;AAGF,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY;AACxB,uCAA6B,MAAM;AACnC;;AAGF,YAAI,WAAW,OAAO,WAAW,GAAG;AAClC;;AAGF,cAAM,QAAQ,eAAe,UAAU;AACvC,YAAI,UAAU,eAAe;AAC3B,sDAA4C,UAAU;eACjD;AACL,sDAA4C,YAAY,KAAK;;MAEjE;AAEA,eAAS,6CAA6C,YAAkD,OAAU;AAChH,YAAI,WAAW,0BAA0B,WAAW,YAAY;AAC9D,+CAAqC,YAAY,KAAK;;MAE1D;AAEA,eAAS,4CAA4C,YAAgD;AACnG,cAAM,SAAS,WAAW;AAE1B,+CAAuC,MAAM;AAE7C,qBAAa,UAAU;AAGvB,cAAM,mBAAmB,WAAW,gBAAe;AACnD,uDAA+C,UAAU;AACzD,oBACE,kBACA,MAAK;AACH,4CAAkC,MAAM;AACxC,iBAAO;WAET,YAAS;AACP,qDAA2C,QAAQ,MAAM;AACzD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,4CAA+C,YAAgD,OAAQ;AAC9G,cAAM,SAAS,WAAW;AAE1B,oDAA4C,MAAM;AAElD,cAAM,mBAAmB,WAAW,gBAAgB,KAAK;AACzD,oBACE,kBACA,MAAK;AACH,4CAAkC,MAAM;AAExC,gBAAM,QAAQ,OAAO;AAGrB,uBAAa,UAAU;AAEvB,cAAI,CAAC,oCAAoC,MAAM,KAAK,UAAU,YAAY;AACxE,kBAAM,eAAe,+CAA+C,UAAU;AAC9E,6CAAiC,QAAQ,YAAY;;AAGvD,8DAAoD,UAAU;AAC9D,iBAAO;WAET,YAAS;AACP,cAAI,OAAO,WAAW,YAAY;AAChC,2DAA+C,UAAU;;AAE3D,qDAA2C,QAAQ,MAAM;AACzD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,+CAA+C,YAAgD;AACtG,cAAM,cAAc,8CAA8C,UAAU;AAC5E,eAAO,eAAe;MACxB;AAIA,eAAS,qCAAqC,YAAkD,OAAU;AACxG,cAAM,SAAS,WAAW;AAI1B,uDAA+C,UAAU;AACzD,oCAA4B,QAAQ,KAAK;MAC3C;AAIA,eAASE,4BAA0B,MAAY;AAC7C,eAAO,IAAI,UAAU,4BAA4B,IAAI,uCAAuC;MAC9F;AAIA,eAASC,uCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,6CAA6C,IAAI,wDAAwD;MAC7G;AAKA,eAAS,iCAAiC,MAAY;AACpD,eAAO,IAAI,UACT,yCAAyC,IAAI,oDAAoD;MACrG;AAEA,eAAS,2BAA2B,MAAY;AAC9C,eAAO,IAAI,UAAU,YAAY,OAAO,mCAAmC;MAC7E;AAEA,eAAS,qCAAqC,QAAmC;AAC/E,eAAO,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACrD,iBAAO,yBAAyB;AAChC,iBAAO,wBAAwB;AAC/B,iBAAO,sBAAsB;QAC/B,CAAC;MACH;AAEA,eAAS,+CAA+C,QAAqC,QAAW;AACtG,6CAAqC,MAAM;AAC3C,yCAAiC,QAAQ,MAAM;MACjD;AAEA,eAAS,+CAA+C,QAAmC;AACzF,6CAAqC,MAAM;AAC3C,0CAAkC,MAAM;MAC1C;AAEA,eAAS,iCAAiC,QAAqC,QAAW;AACxF,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAIF,kCAA0B,OAAO,cAAc;AAC/C,eAAO,sBAAsB,MAAM;AACnC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;AAC/B,eAAO,sBAAsB;MAC/B;AAEA,eAAS,0CAA0C,QAAqC,QAAW;AAKjG,uDAA+C,QAAQ,MAAM;MAC/D;AAEA,eAAS,kCAAkC,QAAmC;AAC5E,YAAI,OAAO,2BAA2B,QAAW;AAC/C;;AAIF,eAAO,uBAAuB,MAAS;AACvC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;AAC/B,eAAO,sBAAsB;MAC/B;AAEA,eAAS,oCAAoC,QAAmC;AAC9E,eAAO,gBAAgB,WAAW,CAAC,SAAS,WAAU;AACpD,iBAAO,wBAAwB;AAC/B,iBAAO,uBAAuB;QAChC,CAAC;AACD,eAAO,qBAAqB;MAC9B;AAEA,eAAS,8CAA8C,QAAqC,QAAW;AACrG,4CAAoC,MAAM;AAC1C,wCAAgC,QAAQ,MAAM;MAChD;AAEA,eAAS,8CAA8C,QAAmC;AACxF,4CAAoC,MAAM;AAC1C,yCAAiC,MAAM;MACzC;AAEA,eAAS,gCAAgC,QAAqC,QAAW;AACvF,YAAI,OAAO,yBAAyB,QAAW;AAC7C;;AAGF,kCAA0B,OAAO,aAAa;AAC9C,eAAO,qBAAqB,MAAM;AAClC,eAAO,wBAAwB;AAC/B,eAAO,uBAAuB;AAC9B,eAAO,qBAAqB;MAC9B;AAEA,eAAS,+BAA+B,QAAmC;AAIzE,4CAAoC,MAAM;MAC5C;AAEA,eAAS,yCAAyC,QAAqC,QAAW;AAIhG,sDAA8C,QAAQ,MAAM;MAC9D;AAEA,eAAS,iCAAiC,QAAmC;AAC3E,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,eAAO,sBAAsB,MAAS;AACtC,eAAO,wBAAwB;AAC/B,eAAO,uBAAuB;AAC9B,eAAO,qBAAqB;MAC9B;ACz5CA,eAAS,aAAU;AACjB,YAAI,OAAO,eAAe,aAAa;AACrC,iBAAO;mBACE,OAAO,SAAS,aAAa;AACtC,iBAAO;mBACE,OAAO,WAAW,aAAa;AACxC,iBAAO;;AAET,eAAO;MACT;AAEO,YAAM,UAAU,WAAU;ACFjC,eAAS,0BAA0B,MAAa;AAC9C,YAAI,EAAE,OAAO,SAAS,cAAc,OAAO,SAAS,WAAW;AAC7D,iBAAO;;AAET,YAAK,KAAiC,SAAS,gBAAgB;AAC7D,iBAAO;;AAET,YAAI;AACF,cAAK,KAAgC;AACrC,iBAAO;iBACPR,KAAM;AACN,iBAAO;;MAEX;AAOA,eAAS,gBAAa;AACpB,cAAM,OAAO,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACtB,eAAO,0BAA0B,IAAI,IAAI,OAAO;MAClD;AAMA,eAAS,iBAAc;AAErB,cAAM,OAAO,SAASS,cAAiC,SAAkB,MAAa;AACpF,eAAK,UAAU,WAAW;AAC1B,eAAK,OAAO,QAAQ;AACpB,cAAI,MAAM,mBAAmB;AAC3B,kBAAM,kBAAkB,MAAM,KAAK,WAAW;;QAElD;AACA,wBAAgB,MAAM,cAAc;AACpC,aAAK,YAAY,OAAO,OAAO,MAAM,SAAS;AAC9C,eAAO,eAAe,KAAK,WAAW,eAAe,EAAE,OAAO,MAAM,UAAU,MAAM,cAAc,KAAI,CAAE;AACxG,eAAO;MACT;AAGA,YAAMA,gBAAwC,cAAa,KAAM,eAAc;AC5B/D,eAAA,qBAAwB,QACA,MACA,cACA,cACA,eACA,QAA+B;AAUrE,cAAM,SAAS,mCAAsC,MAAM;AAC3D,cAAM,SAAS,mCAAsC,IAAI;AAEzD,eAAO,aAAa;AAEpB,YAAI,eAAe;AAGnB,YAAI,eAAe,oBAA0B,MAAS;AAEtD,eAAO,WAAW,CAAC,SAAS,WAAU;AACpC,cAAI;AACJ,cAAI,WAAW,QAAW;AACxB,6BAAiB,MAAK;AACpB,oBAAM,QAAQ,OAAO,WAAW,SAAY,OAAO,SAAS,IAAIA,cAAa,WAAW,YAAY;AACpG,oBAAM,UAAsC,CAAA;AAC5C,kBAAI,CAAC,cAAc;AACjB,wBAAQ,KAAK,MAAK;AAChB,sBAAI,KAAK,WAAW,YAAY;AAC9B,2BAAO,oBAAoB,MAAM,KAAK;;AAExC,yBAAO,oBAAoB,MAAS;gBACtC,CAAC;;AAEH,kBAAI,CAAC,eAAe;AAClB,wBAAQ,KAAK,MAAK;AAChB,sBAAI,OAAO,WAAW,YAAY;AAChC,2BAAO,qBAAqB,QAAQ,KAAK;;AAE3C,yBAAO,oBAAoB,MAAS;gBACtC,CAAC;;AAEH,iCAAmB,MAAM,QAAQ,IAAI,QAAQ,IAAI,YAAU,OAAM,CAAE,CAAC,GAAG,MAAM,KAAK;YACpF;AAEA,gBAAI,OAAO,SAAS;AAClB,6BAAc;AACd;;AAGF,mBAAO,iBAAiB,SAAS,cAAc;;AAMjD,mBAAS,WAAQ;AACf,mBAAO,WAAiB,CAAC,aAAa,eAAc;AAClD,uBAAS,KAAK,MAAa;AACzB,oBAAI,MAAM;AACR,8BAAW;uBACN;AAGL,qCAAmB,SAAQ,GAAI,MAAM,UAAU;;;AAInD,mBAAK,KAAK;YACZ,CAAC;;AAGH,mBAAS,WAAQ;AACf,gBAAI,cAAc;AAChB,qBAAO,oBAAoB,IAAI;;AAGjC,mBAAO,mBAAmB,OAAO,eAAe,MAAK;AACnD,qBAAO,WAAoB,CAAC,aAAa,eAAc;AACrD,gDACE,QACA;kBACE,aAAa,WAAQ;AACnB,mCAAe,mBAAmB,iCAAiC,QAAQ,KAAK,GAAG,QAAWX,KAAI;AAClG,gCAAY,KAAK;;kBAEnB,aAAa,MAAM,YAAY,IAAI;kBACnC,aAAa;gBACd,CAAA;cAEL,CAAC;YACH,CAAC;;AAIH,6BAAmB,QAAQ,OAAO,gBAAgB,iBAAc;AAC9D,gBAAI,CAAC,cAAc;AACjB,iCAAmB,MAAM,oBAAoB,MAAM,WAAW,GAAG,MAAM,WAAW;mBAC7E;AACL,uBAAS,MAAM,WAAW;;AAE5B,mBAAO;UACT,CAAC;AAGD,6BAAmB,MAAM,OAAO,gBAAgB,iBAAc;AAC5D,gBAAI,CAAC,eAAe;AAClB,iCAAmB,MAAM,qBAAqB,QAAQ,WAAW,GAAG,MAAM,WAAW;mBAChF;AACL,uBAAS,MAAM,WAAW;;AAE5B,mBAAO;UACT,CAAC;AAGD,4BAAkB,QAAQ,OAAO,gBAAgB,MAAK;AACpD,gBAAI,CAAC,cAAc;AACjB,iCAAmB,MAAM,qDAAqD,MAAM,CAAC;mBAChF;AACL,uBAAQ;;AAEV,mBAAO;UACT,CAAC;AAGD,cAAI,oCAAoC,IAAI,KAAK,KAAK,WAAW,UAAU;AACzE,kBAAM,aAAa,IAAI,UAAU,6EAA6E;AAE9G,gBAAI,CAAC,eAAe;AAClB,iCAAmB,MAAM,qBAAqB,QAAQ,UAAU,GAAG,MAAM,UAAU;mBAC9E;AACL,uBAAS,MAAM,UAAU;;;AAI7B,oCAA0B,SAAQ,CAAE;AAEpC,mBAAS,wBAAqB;AAG5B,kBAAM,kBAAkB;AACxB,mBAAO,mBACL,cACA,MAAM,oBAAoB,eAAe,sBAAqB,IAAK,MAAS;;AAIhF,mBAAS,mBAAmB,QACA,SACA,QAA6B;AACvD,gBAAI,OAAO,WAAW,WAAW;AAC/B,qBAAO,OAAO,YAAY;mBACrB;AACL,4BAAc,SAAS,MAAM;;;AAIjC,mBAAS,kBAAkB,QAAyC,SAAwB,QAAkB;AAC5G,gBAAI,OAAO,WAAW,UAAU;AAC9B,qBAAM;mBACD;AACL,8BAAgB,SAAS,MAAM;;;AAInC,mBAAS,mBAAmB,QAAgC,iBAA2B,eAAmB;AACxG,gBAAI,cAAc;AAChB;;AAEF,2BAAe;AAEf,gBAAI,KAAK,WAAW,cAAc,CAAC,oCAAoC,IAAI,GAAG;AAC5E,8BAAgB,sBAAqB,GAAI,SAAS;mBAC7C;AACL,wBAAS;;AAGX,qBAAS,YAAS;AAChB,0BACE,OAAM,GACN,MAAM,SAAS,iBAAiB,aAAa,GAC7C,cAAY,SAAS,MAAM,QAAQ,CAAC;AAEtC,qBAAO;;;AAIX,mBAAS,SAAS,SAAmB,OAAW;AAC9C,gBAAI,cAAc;AAChB;;AAEF,2BAAe;AAEf,gBAAI,KAAK,WAAW,cAAc,CAAC,oCAAoC,IAAI,GAAG;AAC5E,8BAAgB,sBAAqB,GAAI,MAAM,SAAS,SAAS,KAAK,CAAC;mBAClE;AACL,uBAAS,SAAS,KAAK;;;AAI3B,mBAAS,SAAS,SAAmB,OAAW;AAC9C,+CAAmC,MAAM;AACzC,+CAAmC,MAAM;AAEzC,gBAAI,WAAW,QAAW;AACxB,qBAAO,oBAAoB,SAAS,cAAc;;AAEpD,gBAAI,SAAS;AACX,qBAAO,KAAK;mBACP;AACL,sBAAQ,MAAS;;AAGnB,mBAAO;;QAEX,CAAC;MACH;YCpOa,gCAA+B;QAwB1C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;;QAO3C,IAAI,cAAW;AACb,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMU,uCAAqC,aAAa;;AAG1D,iBAAO,8CAA8C,IAAI;;;;;;QAO3D,QAAK;AACH,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,OAAO;;AAGpD,cAAI,CAAC,iDAAiD,IAAI,GAAG;AAC3D,kBAAM,IAAI,UAAU,iDAAiD;;AAGvE,+CAAqC,IAAI;;QAO3C,QAAQ,QAAW,QAAU;AAC3B,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,SAAS;;AAGtD,cAAI,CAAC,iDAAiD,IAAI,GAAG;AAC3D,kBAAM,IAAI,UAAU,mDAAmD;;AAGzE,iBAAO,uCAAuC,MAAM,KAAK;;;;;QAM3D,MAAML,KAAS,QAAS;AACtB,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMK,uCAAqC,OAAO;;AAGpD,+CAAqC,MAAML,EAAC;;;QAI9C,CAAC,WAAW,EAAE,QAAW;AACvB,qBAAW,IAAI;AACf,gBAAM,SAAS,KAAK,iBAAiB,MAAM;AAC3C,yDAA+C,IAAI;AACnD,iBAAO;;;QAIT,CAAC,SAAS,EAAE,aAA2B;AACrC,gBAAM,SAAS,KAAK;AAEpB,cAAI,KAAK,OAAO,SAAS,GAAG;AAC1B,kBAAM,QAAQ,aAAa,IAAI;AAE/B,gBAAI,KAAK,mBAAmB,KAAK,OAAO,WAAW,GAAG;AACpD,6DAA+C,IAAI;AACnD,kCAAoB,MAAM;mBACrB;AACL,8DAAgD,IAAI;;AAGtD,wBAAY,YAAY,KAAK;iBACxB;AACL,yCAA6B,QAAQ,WAAW;AAChD,4DAAgD,IAAI;;;;QAKxD,CAAC,YAAY,IAAC;;MAGf;AAED,aAAO,iBAAiB,gCAAgC,WAAW;QACjE,OAAO,EAAE,YAAY,KAAI;QACzB,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,gCAAgC,UAAU,OAAO,OAAO;AACxE,sBAAgB,gCAAgC,UAAU,SAAS,SAAS;AAC5E,sBAAgB,gCAAgC,UAAU,OAAO,OAAO;AACxE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gCAAgC,WAAW,OAAO,aAAa;UACnF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,kCAA2CJ,IAAM;AACxD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,gDAAgD,YAAgD;AACvG,cAAM,aAAa,8CAA8C,UAAU;AAC3E,YAAI,CAAC,YAAY;AACf;;AAGF,YAAI,WAAW,UAAU;AACvB,qBAAW,aAAa;AACxB;;AAKF,mBAAW,WAAW;AAEtB,cAAM,cAAc,WAAW,eAAc;AAC7C,oBACE,aACA,MAAK;AACH,qBAAW,WAAW;AAEtB,cAAI,WAAW,YAAY;AACzB,uBAAW,aAAa;AACxB,4DAAgD,UAAU;;AAG5D,iBAAO;WAET,CAAAI,OAAI;AACF,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,8CAA8C,YAAgD;AACrG,cAAM,SAAS,WAAW;AAE1B,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE,iBAAO;;AAGT,YAAI,CAAC,WAAW,UAAU;AACxB,iBAAO;;AAGT,YAAI,uBAAuB,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAClF,iBAAO;;AAGT,cAAM,cAAc,8CAA8C,UAAU;AAE5E,YAAI,cAAe,GAAG;AACpB,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,+CAA+C,YAAgD;AACtG,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAC9B,mBAAW,yBAAyB;MACtC;AAIM,eAAU,qCAAqC,YAAgD;AACnG,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE;;AAGF,cAAM,SAAS,WAAW;AAE1B,mBAAW,kBAAkB;AAE7B,YAAI,WAAW,OAAO,WAAW,GAAG;AAClC,yDAA+C,UAAU;AACzD,8BAAoB,MAAM;;MAE9B;AAEgB,eAAA,uCACd,YACA,OAAQ;AAER,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE;;AAGF,cAAM,SAAS,WAAW;AAE1B,YAAI,uBAAuB,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAClF,2CAAiC,QAAQ,OAAO,KAAK;eAChD;AACL,cAAI;AACJ,cAAI;AACF,wBAAY,WAAW,uBAAuB,KAAK;mBAC5C,YAAY;AACnB,iDAAqC,YAAY,UAAU;AAC3D,kBAAM;;AAGR,cAAI;AACF,iCAAqB,YAAY,OAAO,SAAS;mBAC1C,UAAU;AACjB,iDAAqC,YAAY,QAAQ;AACzD,kBAAM;;;AAIV,wDAAgD,UAAU;MAC5D;AAEgB,eAAA,qCAAqC,YAAkDA,IAAM;AAC3G,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC;;AAGF,mBAAW,UAAU;AAErB,uDAA+C,UAAU;AACzD,4BAAoB,QAAQA,EAAC;MAC/B;AAEM,eAAU,8CACd,YAAgD;AAEhD,cAAM,QAAQ,WAAW,0BAA0B;AAEnD,YAAI,UAAU,WAAW;AACvB,iBAAO;;AAET,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,WAAW,eAAe,WAAW;MAC9C;AAGM,eAAU,+CACd,YAAgD;AAEhD,YAAI,8CAA8C,UAAU,GAAG;AAC7D,iBAAO;;AAGT,eAAO;MACT;AAEM,eAAU,iDACd,YAAgD;AAEhD,cAAM,QAAQ,WAAW,0BAA0B;AAEnD,YAAI,CAAC,WAAW,mBAAmB,UAAU,YAAY;AACvD,iBAAO;;AAGT,eAAO;MACT;AAEgB,eAAA,qCAAwC,QACA,YACA,gBACA,eACA,iBACA,eACA,eAA6C;AAGnG,mBAAW,4BAA4B;AAEvC,mBAAW,SAAS;AACpB,mBAAW,kBAAkB;AAC7B,mBAAW,UAAU;AAErB,mBAAW,WAAW;AACtB,mBAAW,kBAAkB;AAC7B,mBAAW,aAAa;AACxB,mBAAW,WAAW;AAEtB,mBAAW,yBAAyB;AACpC,mBAAW,eAAe;AAE1B,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAE9B,eAAO,4BAA4B;AAEnC,cAAM,cAAc,eAAc;AAClC,oBACE,oBAAoB,WAAW,GAC/B,MAAK;AACH,qBAAW,WAAW;AAKtB,0DAAgD,UAAU;AAC1D,iBAAO;WAET,CAAAE,OAAI;AACF,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;MAEL;AAEM,eAAU,yDACd,QACA,kBACA,eACA,eAA6C;AAE7C,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAE9G,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,iBAAiB,UAAU,QAAW;AACxC,2BAAiB,MAAM,iBAAiB,MAAO,UAAU;eACpD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,iBAAiB,SAAS,QAAW;AACvC,0BAAgB,MAAM,iBAAiB,KAAM,UAAU;eAClD;AACL,0BAAgB,MAAM,oBAAoB,MAAS;;AAErD,YAAI,iBAAiB,WAAW,QAAW;AACzC,4BAAkB,YAAU,iBAAiB,OAAQ,MAAM;eACtD;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,6CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,aAAa;MAEpG;AAIA,eAASG,uCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,6CAA6C,IAAI,wDAAwD;MAC7G;ACxXgB,eAAA,kBAAqB,QACA,iBAAwB;AAG3D,YAAI,+BAA+B,OAAO,yBAAyB,GAAG;AACpE,iBAAO,sBAAsB,MAAuC;;AAGtE,eAAO,yBAAyB,MAAuB;MACzD;AAEgB,eAAA,yBACd,QACA,iBAAwB;AAKxB,cAAM,SAAS,mCAAsC,MAAM;AAE3D,YAAI,UAAU;AACd,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI;AACJ,cAAM,gBAAgB,WAAsB,aAAU;AACpD,iCAAuB;QACzB,CAAC;AAED,iBAAS,gBAAa;AACpB,cAAI,SAAS;AACX,wBAAY;AACZ,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAA8B;YAClC,aAAa,WAAQ;AAInBJ,8BAAe,MAAK;AAClB,4BAAY;AACZ,sBAAM,SAAS;AACf,sBAAM,SAAS;AAQf,oBAAI,CAAC,WAAW;AACd,yDAAuC,QAAQ,2BAA2B,MAAM;;AAElF,oBAAI,CAAC,WAAW;AACd,yDAAuC,QAAQ,2BAA2B,MAAM;;AAGlF,0BAAU;AACV,oBAAI,WAAW;AACb,gCAAa;;cAEjB,CAAC;;YAEH,aAAa,MAAK;AAChB,wBAAU;AACV,kBAAI,CAAC,WAAW;AACd,qDAAqC,QAAQ,yBAAyB;;AAExE,kBAAI,CAAC,WAAW;AACd,qDAAqC,QAAQ,yBAAyB;;AAGxE,kBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,0CAAgC,QAAQ,WAAW;AAEnD,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAc;;AAIvB,kBAAU,qBAAqB,gBAAgB,eAAe,gBAAgB;AAC9E,kBAAU,qBAAqB,gBAAgB,eAAe,gBAAgB;AAE9E,sBAAc,OAAO,gBAAgB,CAACC,OAAU;AAC9C,+CAAqC,QAAQ,2BAA2BA,EAAC;AACzE,+CAAqC,QAAQ,2BAA2BA,EAAC;AACzE,cAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,iCAAqB,MAAS;;AAEhC,iBAAO;QACT,CAAC;AAED,eAAO,CAAC,SAAS,OAAO;MAC1B;AAEM,eAAU,sBAAsB,QAA0B;AAI9D,YAAI,SAAsD,mCAAmC,MAAM;AACnG,YAAI,UAAU;AACd,YAAI,sBAAsB;AAC1B,YAAI,sBAAsB;AAC1B,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI;AACJ,cAAM,gBAAgB,WAAiB,aAAU;AAC/C,iCAAuB;QACzB,CAAC;AAED,iBAAS,mBAAmB,YAAuD;AACjF,wBAAc,WAAW,gBAAgB,CAAAA,OAAI;AAC3C,gBAAI,eAAe,QAAQ;AACzB,qBAAO;;AAET,8CAAkC,QAAQ,2BAA2BA,EAAC;AACtE,8CAAkC,QAAQ,2BAA2BA,EAAC;AACtE,gBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,mCAAqB,MAAS;;AAEhC,mBAAO;UACT,CAAC;;AAGH,iBAAS,wBAAqB;AAC5B,cAAI,2BAA2B,MAAM,GAAG;AAEtC,+CAAmC,MAAM;AAEzC,qBAAS,mCAAmC,MAAM;AAClD,+BAAmB,MAAM;;AAG3B,gBAAM,cAAkD;YACtD,aAAa,WAAQ;AAInBD,8BAAe,MAAK;AAClB,sCAAsB;AACtB,sCAAsB;AAEtB,sBAAM,SAAS;AACf,oBAAI,SAAS;AACb,oBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,sBAAI;AACF,6BAAS,kBAAkB,KAAK;2BACzB,QAAQ;AACf,sDAAkC,QAAQ,2BAA2B,MAAM;AAC3E,sDAAkC,QAAQ,2BAA2B,MAAM;AAC3E,yCAAqB,qBAAqB,QAAQ,MAAM,CAAC;AACzD;;;AAIJ,oBAAI,CAAC,WAAW;AACd,sDAAoC,QAAQ,2BAA2B,MAAM;;AAE/E,oBAAI,CAAC,WAAW;AACd,sDAAoC,QAAQ,2BAA2B,MAAM;;AAG/E,0BAAU;AACV,oBAAI,qBAAqB;AACvB,iCAAc;2BACL,qBAAqB;AAC9B,iCAAc;;cAElB,CAAC;;YAEH,aAAa,MAAK;AAChB,wBAAU;AACV,kBAAI,CAAC,WAAW;AACd,kDAAkC,QAAQ,yBAAyB;;AAErE,kBAAI,CAAC,WAAW;AACd,kDAAkC,QAAQ,yBAAyB;;AAErE,kBAAI,QAAQ,0BAA0B,kBAAkB,SAAS,GAAG;AAClE,oDAAoC,QAAQ,2BAA2B,CAAC;;AAE1E,kBAAI,QAAQ,0BAA0B,kBAAkB,SAAS,GAAG;AAClE,oDAAoC,QAAQ,2BAA2B,CAAC;;AAE1E,kBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,0CAAgC,QAAQ,WAAW;;AAGrD,iBAAS,mBAAmB,MAAkC,YAAmB;AAC/E,cAAI,8BAAqD,MAAM,GAAG;AAEhE,+CAAmC,MAAM;AAEzC,qBAAS,gCAAgC,MAAM;AAC/C,+BAAmB,MAAM;;AAG3B,gBAAM,aAAa,aAAa,UAAU;AAC1C,gBAAM,cAAc,aAAa,UAAU;AAE3C,gBAAM,kBAA+D;YACnE,aAAa,WAAQ;AAInBA,8BAAe,MAAK;AAClB,sCAAsB;AACtB,sCAAsB;AAEtB,sBAAM,eAAe,aAAa,YAAY;AAC9C,sBAAM,gBAAgB,aAAa,YAAY;AAE/C,oBAAI,CAAC,eAAe;AAClB,sBAAI;AACJ,sBAAI;AACF,kCAAc,kBAAkB,KAAK;2BAC9B,QAAQ;AACf,sDAAkC,WAAW,2BAA2B,MAAM;AAC9E,sDAAkC,YAAY,2BAA2B,MAAM;AAC/E,yCAAqB,qBAAqB,QAAQ,MAAM,CAAC;AACzD;;AAEF,sBAAI,CAAC,cAAc;AACjB,mEAA+C,WAAW,2BAA2B,KAAK;;AAE5F,sDAAoC,YAAY,2BAA2B,WAAW;2BAC7E,CAAC,cAAc;AACxB,iEAA+C,WAAW,2BAA2B,KAAK;;AAG5F,0BAAU;AACV,oBAAI,qBAAqB;AACvB,iCAAc;2BACL,qBAAqB;AAC9B,iCAAc;;cAElB,CAAC;;YAEH,aAAa,WAAQ;AACnB,wBAAU;AAEV,oBAAM,eAAe,aAAa,YAAY;AAC9C,oBAAM,gBAAgB,aAAa,YAAY;AAE/C,kBAAI,CAAC,cAAc;AACjB,kDAAkC,WAAW,yBAAyB;;AAExE,kBAAI,CAAC,eAAe;AAClB,kDAAkC,YAAY,yBAAyB;;AAGzE,kBAAI,UAAU,QAAW;AAGvB,oBAAI,CAAC,cAAc;AACjB,iEAA+C,WAAW,2BAA2B,KAAK;;AAE5F,oBAAI,CAAC,iBAAiB,YAAY,0BAA0B,kBAAkB,SAAS,GAAG;AACxF,sDAAoC,YAAY,2BAA2B,CAAC;;;AAIhF,kBAAI,CAAC,gBAAgB,CAAC,eAAe;AACnC,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,uCAA6B,QAAQ,MAAM,GAAG,eAAe;;AAG/D,iBAAS,iBAAc;AACrB,cAAI,SAAS;AACX,kCAAsB;AACtB,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAAc,2CAA2C,QAAQ,yBAAyB;AAChG,cAAI,gBAAgB,MAAM;AACxB,kCAAqB;iBAChB;AACL,+BAAmB,YAAY,OAAQ,KAAK;;AAG9C,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAc;AACrB,cAAI,SAAS;AACX,kCAAsB;AACtB,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAAc,2CAA2C,QAAQ,yBAAyB;AAChG,cAAI,gBAAgB,MAAM;AACxB,kCAAqB;iBAChB;AACL,+BAAmB,YAAY,OAAQ,IAAI;;AAG7C,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAc;AACrB;;AAGF,kBAAU,yBAAyB,gBAAgB,gBAAgB,gBAAgB;AACnF,kBAAU,yBAAyB,gBAAgB,gBAAgB,gBAAgB;AAEnF,2BAAmB,MAAM;AAEzB,eAAO,CAAC,SAAS,OAAO;MAC1B;ACtZM,eAAU,qBAAwB,QAAe;AACrD,eAAO,aAAa,MAAM,KAAK,OAAQ,OAAiC,cAAc;MACxF;ACnBM,eAAU,mBACd,QAA8D;AAE9D,YAAI,qBAAqB,MAAM,GAAG;AAChC,iBAAO,gCAAgC,OAAO,UAAS,CAAE;;AAE3D,eAAO,2BAA2B,MAAM;MAC1C;AAEM,eAAU,2BAA8B,eAA6C;AACzF,YAAI;AACJ,cAAM,iBAAiB,YAAY,eAAe,OAAO;AAEzD,cAAM,iBAAiBN;AAEvB,iBAAS,gBAAa;AACpB,cAAI;AACJ,cAAI;AACF,yBAAa,aAAa,cAAc;mBACjCK,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,cAAc,oBAAoB,UAAU;AAClD,iBAAO,qBAAqB,aAAa,gBAAa;AACpD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,gFAAgF;;AAEtG,kBAAM,OAAO,iBAAiB,UAAU;AACxC,gBAAI,MAAM;AACR,mDAAqC,OAAO,yBAAyB;mBAChE;AACL,oBAAM,QAAQ,cAAc,UAAU;AACtC,qDAAuC,OAAO,2BAA2B,KAAK;;UAElF,CAAC;;AAGH,iBAAS,gBAAgB,QAAW;AAClC,gBAAM,WAAW,eAAe;AAChC,cAAI;AACJ,cAAI;AACF,2BAAe,UAAU,UAAU,QAAQ;mBACpCA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,cAAI,iBAAiB,QAAW;AAC9B,mBAAO,oBAAoB,MAAS;;AAEtC,cAAI;AACJ,cAAI;AACF,2BAAe,YAAY,cAAc,UAAU,CAAC,MAAM,CAAC;mBACpDA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,gBAAgB,oBAAoB,YAAY;AACtD,iBAAO,qBAAqB,eAAe,gBAAa;AACtD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,kFAAkF;;AAExG,mBAAO;UACT,CAAC;;AAGH,iBAAS,qBAAqB,gBAAgB,eAAe,iBAAiB,CAAC;AAC/E,eAAO;MACT;AAEM,eAAU,gCACd,QAA0C;AAE1C,YAAI;AAEJ,cAAM,iBAAiBL;AAEvB,iBAAS,gBAAa;AACpB,cAAI;AACJ,cAAI;AACF,0BAAc,OAAO,KAAI;mBAClBK,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,iBAAO,qBAAqB,aAAa,gBAAa;AACpD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,8EAA8E;;AAEpG,gBAAI,WAAW,MAAM;AACnB,mDAAqC,OAAO,yBAAyB;mBAChE;AACL,oBAAM,QAAQ,WAAW;AACzB,qDAAuC,OAAO,2BAA2B,KAAK;;UAElF,CAAC;;AAGH,iBAAS,gBAAgB,QAAW;AAClC,cAAI;AACF,mBAAO,oBAAoB,OAAO,OAAO,MAAM,CAAC;mBACzCA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;;AAIhC,iBAAS,qBAAqB,gBAAgB,eAAe,iBAAiB,CAAC;AAC/E,eAAO;MACT;ACvGgB,eAAA,qCACd,QACA,SAAe;AAEf,yBAAiB,QAAQ,OAAO;AAChC,cAAM,WAAW;AACjB,cAAM,wBAAwB,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxC,cAAM,SAAS,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACzB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,eAAO;UACL,uBAAuB,0BAA0B,SAC/C,SACA,wCACE,uBACA,GAAG,OAAO,0CAA0C;UAExD,QAAQ,WAAW,SACjB,SACA,sCAAsC,QAAQ,UAAW,GAAG,OAAO,2BAA2B;UAChG,MAAM,SAAS,SACb,SACA,oCAAoC,MAAM,UAAW,GAAG,OAAO,yBAAyB;UAC1F,OAAO,UAAU,SACf,SACA,qCAAqC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC7F,MAAM,SAAS,SAAY,SAAY,0BAA0B,MAAM,GAAG,OAAO,yBAAyB;;MAE9G;AAEA,eAAS,sCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;AAEA,eAAS,oCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAA4C,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAC5F;AAEA,eAAS,qCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAA4C,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAC5F;AAEA,eAAS,0BAA0B,MAAc,SAAe;AAC9D,eAAO,GAAG,IAAI;AACd,YAAI,SAAS,SAAS;AACpB,gBAAM,IAAI,UAAU,GAAG,OAAO,KAAK,IAAI,2DAA2D;;AAEpG,eAAO;MACT;ACvEgB,eAAA,uBAAuB,SACA,SAAe;AACpD,yBAAiB,SAAS,OAAO;AACjC,cAAM,gBAAgB,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC/B,eAAO,EAAE,eAAe,QAAQ,aAAa,EAAC;MAChD;ACPgB,eAAA,mBAAmB,SACA,SAAe;AAChD,yBAAiB,SAAS,OAAO;AACjC,cAAM,eAAe,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC9B,cAAM,gBAAgB,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC/B,cAAM,eAAe,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC9B,cAAM,SAAS,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACxB,YAAI,WAAW,QAAW;AACxB,4BAAkB,QAAQ,GAAG,OAAO,2BAA2B;;AAEjE,eAAO;UACL,cAAc,QAAQ,YAAY;UAClC,eAAe,QAAQ,aAAa;UACpC,cAAc,QAAQ,YAAY;UAClC;;MAEJ;AAEA,eAAS,kBAAkB,QAAiB,SAAe;AACzD,YAAI,CAACG,eAAc,MAAM,GAAG;AAC1B,gBAAM,IAAI,UAAU,GAAG,OAAO,yBAAyB;;MAE3D;ACpBgB,eAAA,4BACd,MACA,SAAe;AAEf,yBAAiB,MAAM,OAAO;AAE9B,cAAM,WAAW,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACvB,4BAAoB,UAAU,YAAY,sBAAsB;AAChE,6BAAqB,UAAU,GAAG,OAAO,6BAA6B;AAEtE,cAAM,WAAW,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACvB,4BAAoB,UAAU,YAAY,sBAAsB;AAChE,6BAAqB,UAAU,GAAG,OAAO,6BAA6B;AAEtE,eAAO,EAAE,UAAU,SAAQ;MAC7B;YCkEaI,gBAAc;QAczB,YAAY,sBAAqF,CAAA,GACrF,cAAqD,CAAA,GAAE;AACjE,cAAI,wBAAwB,QAAW;AACrC,kCAAsB;iBACjB;AACL,yBAAa,qBAAqB,iBAAiB;;AAGrD,gBAAM,WAAW,uBAAuB,aAAa,kBAAkB;AACvE,gBAAM,mBAAmB,qCAAqC,qBAAqB,iBAAiB;AAEpG,mCAAyB,IAAI;AAE7B,cAAI,iBAAiB,SAAS,SAAS;AACrC,gBAAI,SAAS,SAAS,QAAW;AAC/B,oBAAM,IAAI,WAAW,4DAA4D;;AAEnF,kBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AACtD,kEACE,MACA,kBACA,aAAa;iBAEV;AAEL,kBAAM,gBAAgB,qBAAqB,QAAQ;AACnD,kBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AACtD,qEACE,MACA,kBACA,eACA,aAAa;;;;;;QAQnB,IAAI,SAAM;AACR,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMH,4BAA0B,QAAQ;;AAG1C,iBAAO,uBAAuB,IAAI;;;;;;;;QASpC,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,QAAQ,CAAC;;AAGhE,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,kDAAkD,CAAC;;AAG9F,iBAAO,qBAAqB,MAAM,MAAM;;QAsB1C,UACE,aAAgE,QAAS;AAEzE,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,WAAW;;AAG7C,gBAAM,UAAU,qBAAqB,YAAY,iBAAiB;AAElE,cAAI,QAAQ,SAAS,QAAW;AAC9B,mBAAO,mCAAmC,IAAI;;AAIhD,iBAAO,gCAAgC,IAAqC;;QAc9E,YACE,cACA,aAAmD,CAAA,GAAE;AAErD,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,aAAa;;AAE/C,iCAAuB,cAAc,GAAG,aAAa;AAErD,gBAAM,YAAY,4BAA4B,cAAc,iBAAiB;AAC7E,gBAAM,UAAU,mBAAmB,YAAY,kBAAkB;AAEjE,cAAI,uBAAuB,IAAI,GAAG;AAChC,kBAAM,IAAI,UAAU,gFAAgF;;AAEtG,cAAI,uBAAuB,UAAU,QAAQ,GAAG;AAC9C,kBAAM,IAAI,UAAU,gFAAgF;;AAGtG,gBAAM,UAAU,qBACd,MAAM,UAAU,UAAU,QAAQ,cAAc,QAAQ,cAAc,QAAQ,eAAe,QAAQ,MAAM;AAG7G,oCAA0B,OAAO;AAEjC,iBAAO,UAAU;;QAWnB,OAAO,aACA,aAAmD,CAAA,GAAE;AAC1D,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,QAAQ,CAAC;;AAGhE,cAAI,gBAAgB,QAAW;AAC7B,mBAAO,oBAAoB,sCAAsC;;AAEnE,cAAI,CAAC,iBAAiB,WAAW,GAAG;AAClC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAI9F,cAAI;AACJ,cAAI;AACF,sBAAU,mBAAmB,YAAY,kBAAkB;mBACpDJ,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAG9B,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAG9F,cAAI,uBAAuB,WAAW,GAAG;AACvC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAI9F,iBAAO,qBACL,MAAM,aAAa,QAAQ,cAAc,QAAQ,cAAc,QAAQ,eAAe,QAAQ,MAAM;;;;;;;;;;;;;QAexG,MAAG;AACD,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMI,4BAA0B,KAAK;;AAGvC,gBAAM,WAAW,kBAAkB,IAAW;AAC9C,iBAAO,oBAAoB,QAAQ;;QAerC,OAAO,aAA+D,QAAS;AAC7E,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,QAAQ;;AAG1C,gBAAM,UAAU,uBAAuB,YAAY,iBAAiB;AACpE,iBAAO,mCAAsC,MAAM,QAAQ,aAAa;;QAQ1E,CAAC,mBAAmB,EAAE,SAAuC;AAE3D,iBAAO,KAAK,OAAO,OAAO;;;;;;;;QAS5B,OAAO,KAAQ,eAAqE;AAClF,iBAAO,mBAAmB,aAAa;;MAE1C;AAED,aAAO,iBAAiBG,iBAAgB;QACtC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,aAAO,iBAAiBA,gBAAe,WAAW;QAChD,QAAQ,EAAE,YAAY,KAAI;QAC1B,WAAW,EAAE,YAAY,KAAI;QAC7B,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;QAC1B,KAAK,EAAE,YAAY,KAAI;QACvB,QAAQ,EAAE,YAAY,KAAI;QAC1B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgBA,gBAAe,MAAM,MAAM;AAC3C,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,sBAAgBA,gBAAe,UAAU,WAAW,WAAW;AAC/D,sBAAgBA,gBAAe,UAAU,aAAa,aAAa;AACnE,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,sBAAgBA,gBAAe,UAAU,KAAK,KAAK;AACnD,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAeA,gBAAe,WAAW,OAAO,aAAa;UAClE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AACA,aAAO,eAAeA,gBAAe,WAAW,qBAAqB;QACnE,OAAOA,gBAAe,UAAU;QAChC,UAAU;QACV,cAAc;MACf,CAAA;eAwBe,qBACd,gBACA,eACA,iBACA,gBAAgB,GAChB,gBAAgD,MAAM,GAAC;AAIvD,cAAM,SAAmC,OAAO,OAAOA,gBAAe,SAAS;AAC/E,iCAAyB,MAAM;AAE/B,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAC9G,6CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,aAAa;AAGlG,eAAO;MACT;eAGgB,yBACd,gBACA,eACA,iBAA+C;AAE/C,cAAM,SAA6B,OAAO,OAAOA,gBAAe,SAAS;AACzE,iCAAyB,MAAM;AAE/B,cAAM,aAA2C,OAAO,OAAO,6BAA6B,SAAS;AACrG,0CAAkC,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,GAAG,MAAS;AAElH,eAAO;MACT;AAEA,eAAS,yBAAyB,QAAsB;AACtD,eAAO,SAAS;AAChB,eAAO,UAAU;AACjB,eAAO,eAAe;AACtB,eAAO,aAAa;MACtB;AAEM,eAAU,iBAAiBX,IAAU;AACzC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAaW;MACtB;AAQM,eAAU,uBAAuB,QAAsB;AAG3D,YAAI,OAAO,YAAY,QAAW;AAChC,iBAAO;;AAGT,eAAO;MACT;AAIgB,eAAA,qBAAwB,QAA2B,QAAW;AAC5E,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,UAAU;AAC9B,iBAAO,oBAAoB,MAAS;;AAEtC,YAAI,OAAO,WAAW,WAAW;AAC/B,iBAAO,oBAAoB,OAAO,YAAY;;AAGhD,4BAAoB,MAAM;AAE1B,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,2BAA2B,MAAM,GAAG;AAC9D,gBAAM,mBAAmB,OAAO;AAChC,iBAAO,oBAAoB,IAAI,YAAW;AAC1C,2BAAiB,QAAQ,qBAAkB;AACzC,4BAAgB,YAAY,MAAS;UACvC,CAAC;;AAGH,cAAM,sBAAsB,OAAO,0BAA0B,WAAW,EAAE,MAAM;AAChF,eAAO,qBAAqB,qBAAqBZ,KAAI;MACvD;AAEM,eAAU,oBAAuB,QAAyB;AAG9D,eAAO,SAAS;AAEhB,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB;;AAGF,0CAAkC,MAAM;AAExC,YAAI,8BAAiC,MAAM,GAAG;AAC5C,gBAAM,eAAe,OAAO;AAC5B,iBAAO,gBAAgB,IAAI,YAAW;AACtC,uBAAa,QAAQ,iBAAc;AACjC,wBAAY,YAAW;UACzB,CAAC;;MAEL;AAEgB,eAAA,oBAAuB,QAA2BK,IAAM;AAItE,eAAO,SAAS;AAChB,eAAO,eAAeA;AAEtB,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB;;AAGF,yCAAiC,QAAQA,EAAC;AAE1C,YAAI,8BAAiC,MAAM,GAAG;AAC5C,uDAA6C,QAAQA,EAAC;eACjD;AAEL,wDAA8C,QAAQA,EAAC;;MAE3D;AAqBA,eAASI,4BAA0B,MAAY;AAC7C,eAAO,IAAI,UAAU,4BAA4B,IAAI,uCAAuC;MAC9F;ACljBgB,eAAA,2BAA2B,MACA,SAAe;AACxD,yBAAiB,MAAM,OAAO;AAC9B,cAAM,gBAAgB,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AAC5B,4BAAoB,eAAe,iBAAiB,qBAAqB;AACzE,eAAO;UACL,eAAe,0BAA0B,aAAa;;MAE1D;ACLA,YAAM,yBAAyB,CAAC,UAAkC;AAChE,eAAO,MAAM;MACf;AACA,sBAAgB,wBAAwB,MAAM;MAOhC,MAAO,0BAAyB;QAI5C,YAAY,SAA4B;AACtC,iCAAuB,SAAS,GAAG,2BAA2B;AAC9D,oBAAU,2BAA2B,SAAS,iBAAiB;AAC/D,eAAK,0CAA0C,QAAQ;;;;;QAMzD,IAAI,gBAAa;AACf,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,8BAA8B,eAAe;;AAErD,iBAAO,KAAK;;;;;QAMd,IAAI,OAAI;AACN,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,8BAA8B,MAAM;;AAE5C,iBAAO;;MAEV;AAED,aAAO,iBAAiB,0BAA0B,WAAW;QAC3D,eAAe,EAAE,YAAY,KAAI;QACjC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,0BAA0B,WAAW,OAAO,aAAa;UAC7E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,8BAA8B,MAAY;AACjD,eAAO,IAAI,UAAU,uCAAuC,IAAI,kDAAkD;MACpH;AAEM,eAAU,4BAA4BR,IAAM;AAChD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,yCAAyC,GAAG;AACvF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;ACpEA,YAAM,oBAAoB,MAAQ;AAChC,eAAO;MACT;AACA,sBAAgB,mBAAmB,MAAM;MAO3B,MAAO,qBAAoB;QAIvC,YAAY,SAA4B;AACtC,iCAAuB,SAAS,GAAG,sBAAsB;AACzD,oBAAU,2BAA2B,SAAS,iBAAiB;AAC/D,eAAK,qCAAqC,QAAQ;;;;;QAMpD,IAAI,gBAAa;AACf,cAAI,CAAC,uBAAuB,IAAI,GAAG;AACjC,kBAAM,yBAAyB,eAAe;;AAEhD,iBAAO,KAAK;;;;;;QAOd,IAAI,OAAI;AACN,cAAI,CAAC,uBAAuB,IAAI,GAAG;AACjC,kBAAM,yBAAyB,MAAM;;AAEvC,iBAAO;;MAEV;AAED,aAAO,iBAAiB,qBAAqB,WAAW;QACtD,eAAe,EAAE,YAAY,KAAI;QACjC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,qBAAqB,WAAW,OAAO,aAAa;UACxE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,yBAAyB,MAAY;AAC5C,eAAO,IAAI,UAAU,kCAAkC,IAAI,6CAA6C;MAC1G;AAEM,eAAU,uBAAuBA,IAAM;AAC3C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,oCAAoC,GAAG;AAClF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AC/DgB,eAAA,mBAAyB,UACA,SAAe;AACtD,yBAAiB,UAAU,OAAO;AAClC,cAAM,SAAS,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACzB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,eAAe,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC/B,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,YAAY,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC5B,cAAM,eAAe,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC/B,eAAO;UACL,QAAQ,WAAW,SACjB,SACA,iCAAiC,QAAQ,UAAW,GAAG,OAAO,2BAA2B;UAC3F,OAAO,UAAU,SACf,SACA,gCAAgC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UACxF;UACA,OAAO,UAAU,SACf,SACA,gCAAgC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UACxF,WAAW,cAAc,SACvB,SACA,oCAAoC,WAAW,UAAW,GAAG,OAAO,8BAA8B;UACpG;;MAEJ;AAEA,eAAS,gCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAoD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MACpG;AAEA,eAAS,gCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAoD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MACpG;AAEA,eAAS,oCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,OAAU,eAAoD,YAAY,IAAI,UAAU,CAAC,OAAO,UAAU,CAAC;MACrH;AAEA,eAAS,iCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;YC7Ba,gBAAe;QAmB1B,YAAY,iBAAuD,CAAA,GACvD,sBAA6D,CAAA,GAC7D,sBAA6D,CAAA,GAAE;AACzE,cAAI,mBAAmB,QAAW;AAChC,6BAAiB;;AAGnB,gBAAM,mBAAmB,uBAAuB,qBAAqB,kBAAkB;AACvF,gBAAM,mBAAmB,uBAAuB,qBAAqB,iBAAiB;AAEtF,gBAAM,cAAc,mBAAmB,gBAAgB,iBAAiB;AACxE,cAAI,YAAY,iBAAiB,QAAW;AAC1C,kBAAM,IAAI,WAAW,gCAAgC;;AAEvD,cAAI,YAAY,iBAAiB,QAAW;AAC1C,kBAAM,IAAI,WAAW,gCAAgC;;AAGvD,gBAAM,wBAAwB,qBAAqB,kBAAkB,CAAC;AACtE,gBAAM,wBAAwB,qBAAqB,gBAAgB;AACnE,gBAAM,wBAAwB,qBAAqB,kBAAkB,CAAC;AACtE,gBAAM,wBAAwB,qBAAqB,gBAAgB;AAEnE,cAAI;AACJ,gBAAM,eAAe,WAAiB,aAAU;AAC9C,mCAAuB;UACzB,CAAC;AAED,oCACE,MAAM,cAAc,uBAAuB,uBAAuB,uBAAuB,qBAAqB;AAEhH,+DAAqD,MAAM,WAAW;AAEtE,cAAI,YAAY,UAAU,QAAW;AACnC,iCAAqB,YAAY,MAAM,KAAK,0BAA0B,CAAC;iBAClE;AACL,iCAAqB,MAAS;;;;;;QAOlC,IAAI,WAAQ;AACV,cAAI,CAAC,kBAAkB,IAAI,GAAG;AAC5B,kBAAM,0BAA0B,UAAU;;AAG5C,iBAAO,KAAK;;;;;QAMd,IAAI,WAAQ;AACV,cAAI,CAAC,kBAAkB,IAAI,GAAG;AAC5B,kBAAM,0BAA0B,UAAU;;AAG5C,iBAAO,KAAK;;MAEf;AAED,aAAO,iBAAiB,gBAAgB,WAAW;QACjD,UAAU,EAAE,YAAY,KAAI;QAC5B,UAAU,EAAE,YAAY,KAAI;MAC7B,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gBAAgB,WAAW,OAAO,aAAa;UACnE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AA0CA,eAAS,0BAAgC,QACA,cACA,uBACA,uBACA,uBACA,uBAAqD;AAC5F,iBAAS,iBAAc;AACrB,iBAAO;;AAGT,iBAAS,eAAe,OAAQ;AAC9B,iBAAO,yCAAyC,QAAQ,KAAK;;AAG/D,iBAAS,eAAe,QAAW;AACjC,iBAAO,yCAAyC,QAAQ,MAAM;;AAGhE,iBAAS,iBAAc;AACrB,iBAAO,yCAAyC,MAAM;;AAGxD,eAAO,YAAY,qBAAqB,gBAAgB,gBAAgB,gBAAgB,gBAChD,uBAAuB,qBAAqB;AAEpF,iBAAS,gBAAa;AACpB,iBAAO,0CAA0C,MAAM;;AAGzD,iBAAS,gBAAgB,QAAW;AAClC,iBAAO,4CAA4C,QAAQ,MAAM;;AAGnE,eAAO,YAAY,qBAAqB,gBAAgB,eAAe,iBAAiB,uBAChD,qBAAqB;AAG7D,eAAO,gBAAgB;AACvB,eAAO,6BAA6B;AACpC,eAAO,qCAAqC;AAC5C,uCAA+B,QAAQ,IAAI;AAE3C,eAAO,6BAA6B;MACtC;AAEA,eAAS,kBAAkBA,IAAU;AACnC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,4BAA4B,GAAG;AAC1E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAGA,eAAS,qBAAqB,QAAyBI,IAAM;AAC3D,6CAAqC,OAAO,UAAU,2BAA2BA,EAAC;AAClF,oDAA4C,QAAQA,EAAC;MACvD;AAEA,eAAS,4CAA4C,QAAyBA,IAAM;AAClF,wDAAgD,OAAO,0BAA0B;AACjF,qDAA6C,OAAO,UAAU,2BAA2BA,EAAC;AAC1F,oCAA4B,MAAM;MACpC;AAEA,eAAS,4BAA4B,QAAuB;AAC1D,YAAI,OAAO,eAAe;AAIxB,yCAA+B,QAAQ,KAAK;;MAEhD;AAEA,eAAS,+BAA+B,QAAyB,cAAqB;AAIpF,YAAI,OAAO,+BAA+B,QAAW;AACnD,iBAAO,mCAAkC;;AAG3C,eAAO,6BAA6B,WAAW,aAAU;AACvD,iBAAO,qCAAqC;QAC9C,CAAC;AAED,eAAO,gBAAgB;MACzB;YASa,iCAAgC;QAgB3C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,cAAW;AACb,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,aAAa;;AAG1D,gBAAM,qBAAqB,KAAK,2BAA2B,UAAU;AACrE,iBAAO,8CAA8C,kBAAkB;;QAOzE,QAAQ,QAAW,QAAU;AAC3B,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,SAAS;;AAGtD,kDAAwC,MAAM,KAAK;;;;;;QAOrD,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,OAAO;;AAGpD,gDAAsC,MAAM,MAAM;;;;;;QAOpD,YAAS;AACP,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,WAAW;;AAGxD,oDAA0C,IAAI;;MAEjD;AAED,aAAO,iBAAiB,iCAAiC,WAAW;QAClE,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,WAAW,EAAE,YAAY,KAAI;QAC7B,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,iCAAiC,UAAU,SAAS,SAAS;AAC7E,sBAAgB,iCAAiC,UAAU,OAAO,OAAO;AACzE,sBAAgB,iCAAiC,UAAU,WAAW,WAAW;AACjF,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,iCAAiC,WAAW,OAAO,aAAa;UACpF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,mCAA4CJ,IAAM;AACzD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,4BAA4B,GAAG;AAC1E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,sCAA4C,QACA,YACA,oBACA,gBACA,iBAA+C;AAIlG,mBAAW,6BAA6B;AACxC,eAAO,6BAA6B;AAEpC,mBAAW,sBAAsB;AACjC,mBAAW,kBAAkB;AAC7B,mBAAW,mBAAmB;AAE9B,mBAAW,iBAAiB;AAC5B,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAEA,eAAS,qDAA2D,QACA,aAAuC;AACzG,cAAM,aAAkD,OAAO,OAAO,iCAAiC,SAAS;AAEhH,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,YAAY,cAAc,QAAW;AACvC,+BAAqB,WAAS,YAAY,UAAW,OAAO,UAAU;eACjE;AACL,+BAAqB,WAAQ;AAC3B,gBAAI;AACF,sDAAwC,YAAY,KAAqB;AACzE,qBAAO,oBAAoB,MAAS;qBAC7B,kBAAkB;AACzB,qBAAO,oBAAoB,gBAAgB;;UAE/C;;AAGF,YAAI,YAAY,UAAU,QAAW;AACnC,2BAAiB,MAAM,YAAY,MAAO,UAAU;eAC/C;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAGtD,YAAI,YAAY,WAAW,QAAW;AACpC,4BAAkB,YAAU,YAAY,OAAQ,MAAM;eACjD;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,8CAAsC,QAAQ,YAAY,oBAAoB,gBAAgB,eAAe;MAC/G;AAEA,eAAS,gDAAgD,YAAiD;AACxG,mBAAW,sBAAsB;AACjC,mBAAW,kBAAkB;AAC7B,mBAAW,mBAAmB;MAChC;AAEA,eAAS,wCAA2C,YAAiD,OAAQ;AAC3G,cAAM,SAAS,WAAW;AAC1B,cAAM,qBAAqB,OAAO,UAAU;AAC5C,YAAI,CAAC,iDAAiD,kBAAkB,GAAG;AACzE,gBAAM,IAAI,UAAU,sDAAsD;;AAM5E,YAAI;AACF,iDAAuC,oBAAoB,KAAK;iBACzDI,IAAG;AAEV,sDAA4C,QAAQA,EAAC;AAErD,gBAAM,OAAO,UAAU;;AAGzB,cAAM,eAAe,+CAA+C,kBAAkB;AACtF,YAAI,iBAAiB,OAAO,eAAe;AAEzC,yCAA+B,QAAQ,IAAI;;MAE/C;AAEA,eAAS,sCAAsC,YAAmDA,IAAM;AACtG,6BAAqB,WAAW,4BAA4BA,EAAC;MAC/D;AAEA,eAAS,iDAAuD,YACA,OAAQ;AACtE,cAAM,mBAAmB,WAAW,oBAAoB,KAAK;AAC7D,eAAO,qBAAqB,kBAAkB,QAAW,CAAAE,OAAI;AAC3D,+BAAqB,WAAW,4BAA4BA,EAAC;AAC7D,gBAAMA;QACR,CAAC;MACH;AAEA,eAAS,0CAA6C,YAA+C;AACnG,cAAM,SAAS,WAAW;AAC1B,cAAM,qBAAqB,OAAO,UAAU;AAE5C,6CAAqC,kBAAkB;AAEvD,cAAM,QAAQ,IAAI,UAAU,4BAA4B;AACxD,oDAA4C,QAAQ,KAAK;MAC3D;AAIA,eAAS,yCAA+C,QAA+B,OAAQ;AAG7F,cAAM,aAAa,OAAO;AAE1B,YAAI,OAAO,eAAe;AACxB,gBAAM,4BAA4B,OAAO;AAEzC,iBAAO,qBAAqB,2BAA2B,MAAK;AAC1D,kBAAM,WAAW,OAAO;AACxB,kBAAM,QAAQ,SAAS;AACvB,gBAAI,UAAU,YAAY;AACxB,oBAAM,SAAS;;AAGjB,mBAAO,iDAAuD,YAAY,KAAK;UACjF,CAAC;;AAGH,eAAO,iDAAuD,YAAY,KAAK;MACjF;AAEA,eAAS,yCAA+C,QAA+B,QAAW;AAChG,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAIxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,gBAAgB,WAAW,iBAAiB,MAAM;AACxD,wDAAgD,UAAU;AAE1D,oBAAY,eAAe,MAAK;AAC9B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,iDAAqC,SAAS,2BAA2B,MAAM;AAC/E,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,+CAAqC,SAAS,2BAA2BA,EAAC;AAC1E,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAEA,eAAS,yCAA+C,QAA6B;AACnF,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAIxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,eAAe,WAAW,gBAAe;AAC/C,wDAAgD,UAAU;AAE1D,oBAAY,cAAc,MAAK;AAC7B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,iDAAqC,SAAS,yBAAyB;AACvE,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,+CAAqC,SAAS,2BAA2BA,EAAC;AAC1E,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAIA,eAAS,0CAA0C,QAAuB;AAMxE,uCAA+B,QAAQ,KAAK;AAG5C,eAAO,OAAO;MAChB;AAEA,eAAS,4CAAkD,QAA+B,QAAW;AACnG,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAKxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,gBAAgB,WAAW,iBAAiB,MAAM;AACxD,wDAAgD,UAAU;AAE1D,oBAAY,eAAe,MAAK;AAC9B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,yDAA6C,SAAS,2BAA2B,MAAM;AACvF,wCAA4B,MAAM;AAClC,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,uDAA6C,SAAS,2BAA2BA,EAAC;AAClF,sCAA4B,MAAM;AAClC,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAIA,eAAS,qCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,8CAA8C,IAAI,yDAAyD;MAC/G;AAEM,eAAU,sCAAsC,YAAiD;AACrG,YAAI,WAAW,2BAA2B,QAAW;AACnD;;AAGF,mBAAW,uBAAsB;AACjC,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAEgB,eAAA,qCAAqC,YAAmD,QAAW;AACjH,YAAI,WAAW,0BAA0B,QAAW;AAClD;;AAGF,kCAA0B,WAAW,cAAe;AACpD,mBAAW,sBAAsB,MAAM;AACvC,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAIA,eAAS,0BAA0B,MAAY;AAC7C,eAAO,IAAI,UACT,6BAA6B,IAAI,wCAAwC;MAC7E;;;;;;;;;;;;;;;;;;;AC7pBA;AAAA;AAEA,QAAMM,aAAY;AAElB,QAAI,CAAC,WAAW,gBAAgB;AAI9B,UAAI;AACF,cAAMC,WAAU,QAAQ,SAAc;AACtC,cAAM,EAAE,YAAY,IAAIA;AACxB,YAAI;AACF,UAAAA,SAAQ,cAAc,MAAM;AAAA,UAAC;AAC7B,iBAAO,OAAO,YAAY,QAAQ,YAAiB,CAAC;AACpD,UAAAA,SAAQ,cAAc;AAAA,QACxB,SAAS,OAAO;AACd,UAAAA,SAAQ,cAAc;AACtB,gBAAM;AAAA,QACR;AAAA,MACF,SAAS,OAAO;AAEd,eAAO,OAAO,YAAY,yBAAuD;AAAA,MACnF;AAAA,IACF;AAEA,QAAI;AAGF,YAAM,EAAE,MAAAC,MAAK,IAAI,QAAQ,QAAQ;AACjC,UAAIA,SAAQ,CAACA,MAAK,UAAU,QAAQ;AAClC,QAAAA,MAAK,UAAU,SAAS,SAAS,KAAM,QAAQ;AAC7C,cAAI,WAAW;AACf,gBAAM,OAAO;AAEb,iBAAO,IAAI,eAAe;AAAA,YACxB,MAAM;AAAA,YACN,MAAM,KAAM,MAAM;AAChB,oBAAM,QAAQ,KAAK,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,WAAWF,UAAS,CAAC;AAC5E,oBAAM,SAAS,MAAM,MAAM,YAAY;AACvC,0BAAY,OAAO;AACnB,mBAAK,QAAQ,IAAI,WAAW,MAAM,CAAC;AAEnC,kBAAI,aAAa,KAAK,MAAM;AAC1B,qBAAK,MAAM;AAAA,cACb;AAAA,YACF;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AAAA,IAAC;AAAA;AAAA;;;ACtCjB,gBAAiB,WAAY,OAAOG,SAAQ,MAAM;AAChD,aAAW,QAAQ,OAAO;AACxB,QAAI,YAAY,MAAM;AACpB;AAAA;AAAA,QAA2D,KAAK,OAAO;AAAA;AAAA,IACzE,WAAW,YAAY,OAAO,IAAI,GAAG;AACnC,UAAIA,QAAO;AACT,YAAI,WAAW,KAAK;AACpB,cAAM,MAAM,KAAK,aAAa,KAAK;AACnC,eAAO,aAAa,KAAK;AACvB,gBAAM,OAAO,KAAK,IAAI,MAAM,UAAU,SAAS;AAC/C,gBAAM,QAAQ,KAAK,OAAO,MAAM,UAAU,WAAW,IAAI;AACzD,sBAAY,MAAM;AAClB,gBAAM,IAAI,WAAW,KAAK;AAAA,QAC5B;AAAA,MACF,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IAEF,OAAO;AAEL,UAAI,WAAW,GAAG;AAAA;AAAA,QAA0B;AAAA;AAC5C,aAAO,aAAa,EAAE,MAAM;AAC1B,cAAM,QAAQ,EAAE,MAAM,UAAU,KAAK,IAAI,EAAE,MAAM,WAAW,SAAS,CAAC;AACtE,cAAM,SAAS,MAAM,MAAM,YAAY;AACvC,oBAAY,OAAO;AACnB,cAAM,IAAI,WAAW,MAAM;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AACF;AAxCA,IAKA,gBAGM,WAkCA,OA8MOC,OACN;AAzPP;AAAA;AAKA,qBAAO;AAGP,IAAM,YAAY;AAkClB,IAAM,QAAQ,MAAM,KAAK;AAAA;AAAA,MAEvB,SAAS,CAAC;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUX,YAAa,YAAY,CAAC,GAAG,UAAU,CAAC,GAAG;AACzC,YAAI,OAAO,cAAc,YAAY,cAAc,MAAM;AACvD,gBAAM,IAAI,UAAU,mFAAqF;AAAA,QAC3G;AAEA,YAAI,OAAO,UAAU,OAAO,QAAQ,MAAM,YAAY;AACpD,gBAAM,IAAI,UAAU,kFAAoF;AAAA,QAC1G;AAEA,YAAI,OAAO,YAAY,YAAY,OAAO,YAAY,YAAY;AAChE,gBAAM,IAAI,UAAU,uEAAyE;AAAA,QAC/F;AAEA,YAAI,YAAY,KAAM,WAAU,CAAC;AAEjC,cAAM,UAAU,IAAI,YAAY;AAChC,mBAAW,WAAW,WAAW;AAC/B,cAAI;AACJ,cAAI,YAAY,OAAO,OAAO,GAAG;AAC/B,mBAAO,IAAI,WAAW,QAAQ,OAAO,MAAM,QAAQ,YAAY,QAAQ,aAAa,QAAQ,UAAU,CAAC;AAAA,UACzG,WAAW,mBAAmB,aAAa;AACzC,mBAAO,IAAI,WAAW,QAAQ,MAAM,CAAC,CAAC;AAAA,UACxC,WAAW,mBAAmB,MAAM;AAClC,mBAAO;AAAA,UACT,OAAO;AACL,mBAAO,QAAQ,OAAO,GAAG,OAAO,EAAE;AAAA,UACpC;AAEA,eAAK,SAAS,YAAY,OAAO,IAAI,IAAI,KAAK,aAAa,KAAK;AAChE,eAAK,OAAO,KAAK,IAAI;AAAA,QACvB;AAEA,aAAK,WAAW,GAAG,QAAQ,YAAY,SAAY,gBAAgB,QAAQ,OAAO;AAClF,cAAM,OAAO,QAAQ,SAAS,SAAY,KAAK,OAAO,QAAQ,IAAI;AAClE,aAAK,QAAQ,iBAAiB,KAAK,IAAI,IAAI,OAAO;AAAA,MACpD;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA;AAAA;AAAA;AAAA,MAKA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASA,MAAM,OAAQ;AAGZ,cAAM,UAAU,IAAI,YAAY;AAChC,YAAI,MAAM;AACV,yBAAiB,QAAQ,WAAW,KAAK,QAAQ,KAAK,GAAG;AACvD,iBAAO,QAAQ,OAAO,MAAM,EAAE,QAAQ,KAAK,CAAC;AAAA,QAC9C;AAEA,eAAO,QAAQ,OAAO;AACtB,eAAO;AAAA,MACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASA,MAAM,cAAe;AAMnB,cAAM,OAAO,IAAI,WAAW,KAAK,IAAI;AACrC,YAAI,SAAS;AACb,yBAAiB,SAAS,WAAW,KAAK,QAAQ,KAAK,GAAG;AACxD,eAAK,IAAI,OAAO,MAAM;AACtB,oBAAU,MAAM;AAAA,QAClB;AAEA,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,SAAU;AACR,cAAM,KAAK,WAAW,KAAK,QAAQ,IAAI;AAEvC,eAAO,IAAI,WAAW,eAAe;AAAA;AAAA,UAEnC,MAAM;AAAA,UACN,MAAM,KAAM,MAAM;AAChB,kBAAM,QAAQ,MAAM,GAAG,KAAK;AAC5B,kBAAM,OAAO,KAAK,MAAM,IAAI,KAAK,QAAQ,MAAM,KAAK;AAAA,UACtD;AAAA,UAEA,MAAM,SAAU;AACd,kBAAM,GAAG,OAAO;AAAA,UAClB;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAWA,MAAO,QAAQ,GAAG,MAAM,KAAK,MAAM,OAAO,IAAI;AAC5C,cAAM,EAAE,KAAK,IAAI;AAEjB,YAAI,gBAAgB,QAAQ,IAAI,KAAK,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,IAAI,OAAO,IAAI;AAChF,YAAI,cAAc,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI;AAExE,cAAM,OAAO,KAAK,IAAI,cAAc,eAAe,CAAC;AACpD,cAAM,QAAQ,KAAK;AACnB,cAAM,YAAY,CAAC;AACnB,YAAI,QAAQ;AAEZ,mBAAW,QAAQ,OAAO;AAExB,cAAI,SAAS,MAAM;AACjB;AAAA,UACF;AAEA,gBAAMC,QAAO,YAAY,OAAO,IAAI,IAAI,KAAK,aAAa,KAAK;AAC/D,cAAI,iBAAiBA,SAAQ,eAAe;AAG1C,6BAAiBA;AACjB,2BAAeA;AAAA,UACjB,OAAO;AACL,gBAAI;AACJ,gBAAI,YAAY,OAAO,IAAI,GAAG;AAC5B,sBAAQ,KAAK,SAAS,eAAe,KAAK,IAAIA,OAAM,WAAW,CAAC;AAChE,uBAAS,MAAM;AAAA,YACjB,OAAO;AACL,sBAAQ,KAAK,MAAM,eAAe,KAAK,IAAIA,OAAM,WAAW,CAAC;AAC7D,uBAAS,MAAM;AAAA,YACjB;AACA,2BAAeA;AACf,sBAAU,KAAK,KAAK;AACpB,4BAAgB;AAAA,UAClB;AAAA,QACF;AAEA,cAAM,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,OAAO,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9D,aAAK,QAAQ;AACb,aAAK,SAAS;AAEd,eAAO;AAAA,MACT;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,MAEA,QAAQ,OAAO,WAAW,EAAG,QAAQ;AACnC,eACE,UACA,OAAO,WAAW,YAClB,OAAO,OAAO,gBAAgB,eAE5B,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,gBAAgB,eAEhC,gBAAgB,KAAK,OAAO,OAAO,WAAW,CAAC;AAAA,MAEnD;AAAA,IACF;AAEA,WAAO,iBAAiB,MAAM,WAAW;AAAA,MACvC,MAAM,EAAE,YAAY,KAAK;AAAA,MACzB,MAAM,EAAE,YAAY,KAAK;AAAA,MACzB,OAAO,EAAE,YAAY,KAAK;AAAA,IAC5B,CAAC;AAGM,IAAMD,QAAO;AACpB,IAAO,qBAAQA;AAAA;AAAA;;;ACzPf,IAEM,OA6COE,OACN;AAhDP;AAAA;AAAA;AAEA,IAAM,QAAQ,MAAM,aAAa,mBAAK;AAAA,MACpC,gBAAgB;AAAA,MAChB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOR,YAAa,UAAU,UAAU,UAAU,CAAC,GAAG;AAC7C,YAAI,UAAU,SAAS,GAAG;AACxB,gBAAM,IAAI,UAAU,8DAA8D,UAAU,MAAM,WAAW;AAAA,QAC/G;AACA,cAAM,UAAU,OAAO;AAEvB,YAAI,YAAY,KAAM,WAAU,CAAC;AAGjC,cAAM,eAAe,QAAQ,iBAAiB,SAAY,KAAK,IAAI,IAAI,OAAO,QAAQ,YAAY;AAClG,YAAI,CAAC,OAAO,MAAM,YAAY,GAAG;AAC/B,eAAK,gBAAgB;AAAA,QACvB;AAEA,aAAK,QAAQ,OAAO,QAAQ;AAAA,MAC9B;AAAA,MAEA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,IAAI,eAAgB;AAClB,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,MAEA,QAAQ,OAAO,WAAW,EAAG,QAAQ;AACnC,eAAO,CAAC,CAAC,UAAU,kBAAkB,sBACnC,WAAW,KAAK,OAAO,OAAO,WAAW,CAAC;AAAA,MAC9C;AAAA,IACF;AAGO,IAAMA,QAAO;AACpB,IAAO,eAAQA;AAAA;AAAA;;;ACfR,SAAS,eAAgBC,IAAE,IAAE,oBAAE;AACtC,MAAI,IAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG,EAAE,SAAS,IAAI,GAAG,GAAE,IAAE,CAAC,GAAE,IAAE,KAAK,CAAC;AAAA;AAClF,EAAAA,GAAE,QAAQ,CAAC,GAAE,MAAI,OAAO,KAAG,WAC1B,EAAE,KAAK,IAAE,EAAE,CAAC,IAAE;AAAA;AAAA,EAAY,EAAE,QAAQ,uBAAuB,MAAM,CAAC;AAAA,CAAM,IACxE,EAAE,KAAK,IAAE,EAAE,CAAC,IAAE,gBAAgB,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA,gBAAsB,EAAE,QAAM,0BAA0B;AAAA;AAAA,GAAY,GAAG,MAAM,CAAC;AACzH,IAAE,KAAK,KAAK,CAAC,IAAI;AACjB,SAAO,IAAI,EAAE,GAAE,EAAC,MAAK,mCAAiC,EAAC,CAAC;AAAC;AAvCzD,IAKiB,GAAW,GAAc,GAC1C,GACA,GACA,GACA,GACA,GAKa;AAfb;AAAA;AAEA;AACA;AAEA,KAAI,EAAC,aAAY,GAAE,UAAS,GAAE,aAAY,MAAG;AAA7C,IACA,IAAE,KAAK;AADP,IAEA,IAAE,uEAAuE,MAAM,GAAG;AAFlF,IAGA,IAAE,CAAC,GAAE,GAAE,OAAK,KAAG,IAAG,gBAAgB,KAAK,KAAK,EAAE,CAAC,CAAC,IAAE,EAAE,IAAE,MAAI,SAAO,IAAE,KAAG,EAAE,CAAC,KAAG,SAAO,EAAE,OAAK,QAAO,IAAG,EAAE,SAAO,KAAG,EAAE,CAAC,KAAG,SAAO,IAAI,aAAE,CAAC,CAAC,GAAE,GAAE,CAAC,IAAE,CAAC,IAAE,CAAC,GAAE,IAAE,EAAE;AAHtJ,IAIA,IAAE,CAAC,GAAEC,QAAKA,KAAE,IAAE,EAAE,QAAQ,aAAY,MAAM,GAAG,QAAQ,OAAM,KAAK,EAAE,QAAQ,OAAM,KAAK,EAAE,QAAQ,MAAK,KAAK;AAJzG,IAKA,IAAE,CAAC,GAAG,GAAGC,OAAI;AAAC,UAAG,EAAE,SAAOA,IAAE;AAAC,cAAM,IAAI,UAAU,sBAAsB,CAAC,oBAAoBA,EAAC,iCAAiC,EAAE,MAAM,WAAW;AAAA,MAAC;AAAA,IAAC;AAK5I,IAAM,WAAW,MAAMC,UAAS;AAAA,MACvC,KAAG,CAAC;AAAA,MACJ,eAAe,GAAE;AAAC,YAAG,EAAE,OAAO,OAAM,IAAI,UAAU,+EAA+E;AAAA,MAAC;AAAA,MAClI,KAAK,CAAC,IAAI;AAAC,eAAO;AAAA,MAAU;AAAA,MAC5B,CAAC,CAAC,IAAG;AAAC,eAAO,KAAK,QAAQ;AAAA,MAAC;AAAA,MAC3B,QAAQ,CAAC,EAAE,GAAG;AAAC,eAAO,KAAG,OAAO,MAAI,YAAU,EAAE,CAAC,MAAI,cAAY,CAAC,EAAE,KAAK,CAAAC,OAAG,OAAO,EAAEA,EAAC,KAAG,UAAU;AAAA,MAAC;AAAA,MACpG,UAAU,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,aAAK,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;AAAA,MAAC;AAAA,MAC1D,OAAO,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,aAAG;AAAG,aAAK,KAAG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAI,MAAI,CAAC;AAAA,MAAC;AAAA,MAC5E,IAAI,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,aAAG;AAAG,iBAAQ,IAAE,KAAK,IAAG,IAAE,EAAE,QAAO,IAAE,GAAE,IAAE,GAAE,IAAI,KAAG,EAAE,CAAC,EAAE,CAAC,MAAI,EAAE,QAAO,EAAE,CAAC,EAAE,CAAC;AAAE,eAAO;AAAA,MAAI;AAAA,MACpH,OAAO,GAAE,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,YAAE,CAAC;AAAE,aAAG;AAAG,aAAK,GAAG,QAAQ,OAAG,EAAE,CAAC,MAAI,KAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAAE,eAAO;AAAA,MAAC;AAAA,MAClG,IAAI,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,aAAG;AAAG,eAAO,KAAK,GAAG,KAAK,OAAG,EAAE,CAAC,MAAI,CAAC;AAAA,MAAC;AAAA,MAClE,QAAQ,GAAE,GAAE;AAAC,UAAE,WAAU,WAAU,CAAC;AAAE,iBAAQ,CAAC,GAAE,CAAC,KAAI,KAAK,GAAE,KAAK,GAAE,GAAE,GAAE,IAAI;AAAA,MAAC;AAAA,MAC7E,OAAO,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,YAAI,IAAE,CAAC,GAAE,IAAE;AAAG,YAAE,EAAE,GAAG,CAAC;AAAE,aAAK,GAAG,QAAQ,OAAG;AAAC,YAAE,CAAC,MAAI,EAAE,CAAC,IAAE,MAAI,IAAE,CAAC,EAAE,KAAK,CAAC,KAAG,EAAE,KAAK,CAAC;AAAA,QAAC,CAAC;AAAE,aAAG,EAAE,KAAK,CAAC;AAAE,aAAK,KAAG;AAAA,MAAC;AAAA,MAC3I,CAAC,UAAS;AAAC,eAAM,KAAK;AAAA,MAAE;AAAA,MACxB,CAAC,OAAM;AAAC,iBAAO,CAAC,CAAC,KAAI,KAAK,OAAM;AAAA,MAAC;AAAA,MACjC,CAAC,SAAQ;AAAC,iBAAO,CAAC,EAAC,CAAC,KAAI,KAAK,OAAM;AAAA,MAAC;AAAA,IAAC;AAAA;AAAA;;;AC9BrC,IAAa;AAAb;AAAA;AAAO,IAAM,iBAAN,cAA6B,MAAM;AAAA,MACzC,YAAY,SAAS,MAAM;AAC1B,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAE9C,aAAK,OAAO;AAAA,MACb;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,IACD;AAAA;AAAA;;;AChBA,IAUa;AAVb;AAAA;AACA;AASO,IAAM,aAAN,cAAyB,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM9C,YAAY,SAAS,MAAM,aAAa;AACvC,cAAM,SAAS,IAAI;AAEnB,YAAI,aAAa;AAEhB,eAAK,OAAO,KAAK,QAAQ,YAAY;AACrC,eAAK,iBAAiB,YAAY;AAAA,QACnC;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;ACzBA,IAMM,MAQO,uBAmBA,QAiBA,eAiBA,qBAcA;AAjFb;AAAA;AAMA,IAAM,OAAO,OAAO;AAQb,IAAM,wBAAwB,YAAU;AAC9C,aACC,OAAO,WAAW,YAClB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,SAAS,cACvB,OAAO,IAAI,MAAM;AAAA,IAEnB;AAOO,IAAM,SAAS,YAAU;AAC/B,aACC,UACA,OAAO,WAAW,YAClB,OAAO,OAAO,gBAAgB,cAC9B,OAAO,OAAO,SAAS,YACvB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,gBAAgB,cAC9B,gBAAgB,KAAK,OAAO,IAAI,CAAC;AAAA,IAEnC;AAOO,IAAM,gBAAgB,YAAU;AACtC,aACC,OAAO,WAAW,aACjB,OAAO,IAAI,MAAM,iBACjB,OAAO,IAAI,MAAM;AAAA,IAGpB;AAUO,IAAM,sBAAsB,CAAC,aAAa,aAAa;AAC7D,YAAM,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC/B,YAAM,OAAO,IAAI,IAAI,WAAW,EAAE;AAElC,aAAO,SAAS,QAAQ,KAAK,SAAS,IAAI,IAAI,EAAE;AAAA,IACjD;AASO,IAAM,iBAAiB,CAAC,aAAa,aAAa;AACxD,YAAM,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC/B,YAAM,OAAO,IAAI,IAAI,WAAW,EAAE;AAElC,aAAO,SAAS;AAAA,IACjB;AAAA;AAAA;;;ACtFA;AAAA,4CAAAC,UAAAC,SAAA;AAEA,QAAI,CAAC,WAAW,cAAc;AAC5B,UAAI;AACF,cAAM,EAAE,eAAe,IAAI,QAAQ,gBAAgB,GACnD,OAAO,IAAI,eAAe,EAAE,OAC5B,KAAK,IAAI,YAAY;AACrB,aAAK,YAAY,IAAI,CAAC,IAAI,EAAE,CAAC;AAAA,MAC/B,SAAS,KAAK;AACZ,YAAI,YAAY,SAAS,mBACvB,WAAW,eAAe,IAAI;AAAA,MAElC;AAAA,IACF;AAEA,IAAAA,QAAO,UAAU,WAAW;AAAA;AAAA;;;ACf5B,oBACA,kBACA,0BAKQ,MAMF,cAOA,UAOA,UAMA,cAGA,UAQA,UAcA;AA1DN;AAAA;AAAA,qBAA2D;AAC3D,uBAAyB;AACzB,+BAAyB;AAEzB;AACA;AAEA,KAAM,EAAE,SAAS,eAAAC;AAMjB,IAAM,eAAe,CAAC,MAAM,SAAS,aAAS,yBAAS,IAAI,GAAG,MAAM,IAAI;AAOxE,IAAM,WAAW,CAAC,MAAM,SAAS,KAAK,IAAI,EAAE,KAAK,CAAAC,UAAQ,SAASA,OAAM,MAAM,IAAI,CAAC;AAOnF,IAAM,WAAW,CAAC,MAAM,SAAS,KAAK,IAAI,EAAE,KAAK,CAAAA,UAAQ,SAASA,OAAM,MAAM,IAAI,CAAC;AAMnF,IAAM,eAAe,CAAC,MAAM,SAAS,aAAS,yBAAS,IAAI,GAAG,MAAM,IAAI;AAGxE,IAAM,WAAW,CAACA,OAAM,MAAM,OAAO,OAAO,IAAI,mBAAK,CAAC,IAAI,aAAa;AAAA,MACrE;AAAA,MACA,MAAMA,MAAK;AAAA,MACX,cAAcA,MAAK;AAAA,MACnB,OAAO;AAAA,IACT,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC;AAGb,IAAM,WAAW,CAACA,OAAM,MAAM,OAAO,OAAO,IAAI,aAAK,CAAC,IAAI,aAAa;AAAA,MACrE;AAAA,MACA,MAAMA,MAAK;AAAA,MACX,cAAcA,MAAK;AAAA,MACnB,OAAO;AAAA,IACT,CAAC,CAAC,OAAG,2BAAS,IAAI,GAAG,EAAE,MAAM,cAAcA,MAAK,QAAQ,CAAC;AASzD,IAAM,eAAN,MAAM,cAAa;AAAA,MACjB;AAAA,MACA;AAAA,MAEA,YAAa,SAAS;AACpB,aAAK,QAAQ,QAAQ;AACrB,aAAK,SAAS,QAAQ;AACtB,aAAK,OAAO,QAAQ;AACpB,aAAK,eAAe,QAAQ;AAAA,MAC9B;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,MAAO,OAAO,KAAK;AACjB,eAAO,IAAI,cAAa;AAAA,UACtB,MAAM,KAAK;AAAA,UACX,cAAc,KAAK;AAAA,UACnB,MAAM,MAAM;AAAA,UACZ,OAAO,KAAK,SAAS;AAAA,QACvB,CAAC;AAAA,MACH;AAAA,MAEA,OAAQ,SAAU;AAChB,cAAM,EAAE,QAAQ,IAAI,MAAM,KAAK,KAAK,KAAK;AACzC,YAAI,UAAU,KAAK,cAAc;AAC/B,gBAAM,IAAI,yBAAAC,QAAa,2IAA2I,kBAAkB;AAAA,QACtL;AACA,mBAAQ,iCAAiB,KAAK,OAAO;AAAA,UACnC,OAAO,KAAK;AAAA,UACZ,KAAK,KAAK,SAAS,KAAK,OAAO;AAAA,QACjC,CAAC;AAAA,MACH;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;;;AChGA;AAAA;AAAA;AAAA;AA+TA,SAAS,UAAU,aAAa;AAE/B,QAAMC,KAAI,YAAY,MAAM,4DAA4D;AACxF,MAAI,CAACA,IAAG;AACP;AAAA,EACD;AAEA,QAAM,QAAQA,GAAE,CAAC,KAAKA,GAAE,CAAC,KAAK;AAC9B,MAAI,WAAW,MAAM,MAAM,MAAM,YAAY,IAAI,IAAI,CAAC;AACtD,aAAW,SAAS,QAAQ,QAAQ,GAAG;AACvC,aAAW,SAAS,QAAQ,eAAe,CAACA,IAAG,SAAS;AACvD,WAAO,OAAO,aAAa,IAAI;AAAA,EAChC,CAAC;AACD,SAAO;AACR;AAEA,eAAsB,WAAWC,OAAM,IAAI;AAC1C,MAAI,CAAC,aAAa,KAAK,EAAE,GAAG;AAC3B,UAAM,IAAI,UAAU,iBAAiB;AAAA,EACtC;AAEA,QAAMD,KAAI,GAAG,MAAM,iCAAiC;AAEpD,MAAI,CAACA,IAAG;AACP,UAAM,IAAI,UAAU,sDAAsD;AAAA,EAC3E;AAEA,QAAM,SAAS,IAAI,gBAAgBA,GAAE,CAAC,KAAKA,GAAE,CAAC,CAAC;AAE/C,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,QAAM,cAAc,CAAC;AACrB,QAAM,WAAW,IAAI,SAAS;AAE9B,QAAM,aAAa,UAAQ;AAC1B,kBAAc,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EAClD;AAEA,QAAM,eAAe,UAAQ;AAC5B,gBAAY,KAAK,IAAI;AAAA,EACtB;AAEA,QAAM,uBAAuB,MAAM;AAClC,UAAM,OAAO,IAAI,aAAK,aAAa,UAAU,EAAC,MAAM,YAAW,CAAC;AAChE,aAAS,OAAO,WAAW,IAAI;AAAA,EAChC;AAEA,QAAM,wBAAwB,MAAM;AACnC,aAAS,OAAO,WAAW,UAAU;AAAA,EACtC;AAEA,QAAM,UAAU,IAAI,YAAY,OAAO;AACvC,UAAQ,OAAO;AAEf,SAAO,cAAc,WAAY;AAChC,WAAO,aAAa;AACpB,WAAO,YAAY;AAEnB,kBAAc;AACd,kBAAc;AACd,iBAAa;AACb,gBAAY;AACZ,kBAAc;AACd,eAAW;AACX,gBAAY,SAAS;AAAA,EACtB;AAEA,SAAO,gBAAgB,SAAU,MAAM;AACtC,mBAAe,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EACnD;AAEA,SAAO,gBAAgB,SAAU,MAAM;AACtC,mBAAe,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EACnD;AAEA,SAAO,cAAc,WAAY;AAChC,mBAAe,QAAQ,OAAO;AAC9B,kBAAc,YAAY,YAAY;AAEtC,QAAI,gBAAgB,uBAAuB;AAE1C,YAAMA,KAAI,YAAY,MAAM,mDAAmD;AAE/E,UAAIA,IAAG;AACN,oBAAYA,GAAE,CAAC,KAAKA,GAAE,CAAC,KAAK;AAAA,MAC7B;AAEA,iBAAW,UAAU,WAAW;AAEhC,UAAI,UAAU;AACb,eAAO,aAAa;AACpB,eAAO,YAAY;AAAA,MACpB;AAAA,IACD,WAAW,gBAAgB,gBAAgB;AAC1C,oBAAc;AAAA,IACf;AAEA,kBAAc;AACd,kBAAc;AAAA,EACf;AAEA,mBAAiB,SAASC,OAAM;AAC/B,WAAO,MAAM,KAAK;AAAA,EACnB;AAEA,SAAO,IAAI;AAEX,SAAO;AACR;AA/aA,IAGI,GACE,GAaFC,IACE,GAKA,IACA,IACA,OACA,QACA,OACA,GACA,GAEA,OAEA,MAEA;AAnCN;AAAA;AAAA;AACA;AAEA,IAAI,IAAI;AACR,IAAM,IAAI;AAAA,MACT,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,MACpB,cAAc;AAAA,MACd,oBAAoB;AAAA,MACpB,cAAc;AAAA,MACd,0BAA0B;AAAA,MAC1B,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,KAAK;AAAA,IACN;AAEA,IAAIA,KAAI;AACR,IAAM,IAAI;AAAA,MACT,eAAeA;AAAA,MACf,eAAeA,MAAK;AAAA,IACrB;AAEA,IAAM,KAAK;AACX,IAAM,KAAK;AACX,IAAM,QAAQ;AACd,IAAM,SAAS;AACf,IAAM,QAAQ;AACd,IAAM,IAAI;AACV,IAAM,IAAI;AAEV,IAAM,QAAQ,OAAK,IAAI;AAEvB,IAAM,OAAO,MAAM;AAAA,IAAC;AAEpB,IAAM,kBAAN,MAAsB;AAAA;AAAA;AAAA;AAAA,MAIrB,YAAY,UAAU;AACrB,aAAK,QAAQ;AACb,aAAK,QAAQ;AAEb,aAAK,cAAc;AACnB,aAAK,gBAAgB;AACrB,aAAK,eAAe;AACpB,aAAK,gBAAgB;AACrB,aAAK,cAAc;AACnB,aAAK,aAAa;AAClB,aAAK,YAAY;AAEjB,aAAK,gBAAgB,CAAC;AAEtB,mBAAW,WAAW;AACtB,cAAM,OAAO,IAAI,WAAW,SAAS,MAAM;AAC3C,iBAASC,KAAI,GAAGA,KAAI,SAAS,QAAQA,MAAK;AACzC,eAAKA,EAAC,IAAI,SAAS,WAAWA,EAAC;AAC/B,eAAK,cAAc,KAAKA,EAAC,CAAC,IAAI;AAAA,QAC/B;AAEA,aAAK,WAAW;AAChB,aAAK,aAAa,IAAI,WAAW,KAAK,SAAS,SAAS,CAAC;AACzD,aAAK,QAAQ,EAAE;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA,MAKA,MAAM,MAAM;AACX,YAAIA,KAAI;AACR,cAAM,UAAU,KAAK;AACrB,YAAI,gBAAgB,KAAK;AACzB,YAAI,EAAC,YAAY,UAAU,eAAe,OAAO,OAAO,MAAK,IAAI;AACjE,cAAM,iBAAiB,KAAK,SAAS;AACrC,cAAM,cAAc,iBAAiB;AACrC,cAAM,eAAe,KAAK;AAC1B,YAAI;AACJ,YAAI;AAEJ,cAAM,OAAO,UAAQ;AACpB,eAAK,OAAO,MAAM,IAAIA;AAAA,QACvB;AAEA,cAAM,QAAQ,UAAQ;AACrB,iBAAO,KAAK,OAAO,MAAM;AAAA,QAC1B;AAEA,cAAM,WAAW,CAAC,gBAAgB,OAAO,KAAK,SAAS;AACtD,cAAI,UAAU,UAAa,UAAU,KAAK;AACzC,iBAAK,cAAc,EAAE,QAAQ,KAAK,SAAS,OAAO,GAAG,CAAC;AAAA,UACvD;AAAA,QACD;AAEA,cAAM,eAAe,CAAC,MAAMC,WAAU;AACrC,gBAAM,aAAa,OAAO;AAC1B,cAAI,EAAE,cAAc,OAAO;AAC1B;AAAA,UACD;AAEA,cAAIA,QAAO;AACV,qBAAS,MAAM,KAAK,UAAU,GAAGD,IAAG,IAAI;AACxC,mBAAO,KAAK,UAAU;AAAA,UACvB,OAAO;AACN,qBAAS,MAAM,KAAK,UAAU,GAAG,KAAK,QAAQ,IAAI;AAClD,iBAAK,UAAU,IAAI;AAAA,UACpB;AAAA,QACD;AAEA,aAAKA,KAAI,GAAGA,KAAI,SAASA,MAAK;AAC7B,cAAI,KAAKA,EAAC;AAEV,kBAAQ,OAAO;AAAA,YACd,KAAK,EAAE;AACN,kBAAI,UAAU,SAAS,SAAS,GAAG;AAClC,oBAAI,MAAM,QAAQ;AACjB,2BAAS,EAAE;AAAA,gBACZ,WAAW,MAAM,IAAI;AACpB;AAAA,gBACD;AAEA;AACA;AAAA,cACD,WAAW,QAAQ,MAAM,SAAS,SAAS,GAAG;AAC7C,oBAAI,QAAQ,EAAE,iBAAiB,MAAM,QAAQ;AAC5C,0BAAQ,EAAE;AACV,0BAAQ;AAAA,gBACT,WAAW,EAAE,QAAQ,EAAE,kBAAkB,MAAM,IAAI;AAClD,0BAAQ;AACR,2BAAS,aAAa;AACtB,0BAAQ,EAAE;AAAA,gBACX,OAAO;AACN;AAAA,gBACD;AAEA;AAAA,cACD;AAEA,kBAAI,MAAM,SAAS,QAAQ,CAAC,GAAG;AAC9B,wBAAQ;AAAA,cACT;AAEA,kBAAI,MAAM,SAAS,QAAQ,CAAC,GAAG;AAC9B;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN,sBAAQ,EAAE;AACV,mBAAK,eAAe;AACpB,sBAAQ;AAAA;AAAA,YAET,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb,sBAAM,eAAe;AACrB,wBAAQ,EAAE;AACV;AAAA,cACD;AAEA;AACA,kBAAI,MAAM,QAAQ;AACjB;AAAA,cACD;AAEA,kBAAI,MAAM,OAAO;AAChB,oBAAI,UAAU,GAAG;AAEhB;AAAA,gBACD;AAEA,6BAAa,iBAAiB,IAAI;AAClC,wBAAQ,EAAE;AACV;AAAA,cACD;AAEA,mBAAK,MAAM,CAAC;AACZ,kBAAI,KAAK,KAAK,KAAK,GAAG;AACrB;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,OAAO;AAChB;AAAA,cACD;AAEA,mBAAK,eAAe;AACpB,sBAAQ,EAAE;AAAA;AAAA,YAEX,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb,6BAAa,iBAAiB,IAAI;AAClC,yBAAS,aAAa;AACtB,wBAAQ,EAAE;AAAA,cACX;AAEA;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb;AAAA,cACD;AAEA,sBAAQ,EAAE;AACV;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb;AAAA,cACD;AAEA,uBAAS,cAAc;AACvB,sBAAQ,EAAE;AACV;AAAA,YACD,KAAK,EAAE;AACN,sBAAQ,EAAE;AACV,mBAAK,YAAY;AAAA;AAAA,YAElB,KAAK,EAAE;AACN,8BAAgB;AAEhB,kBAAI,UAAU,GAAG;AAEhB,gBAAAA,MAAK;AACL,uBAAOA,KAAI,gBAAgB,EAAE,KAAKA,EAAC,KAAK,gBAAgB;AACvD,kBAAAA,MAAK;AAAA,gBACN;AAEA,gBAAAA,MAAK;AACL,oBAAI,KAAKA,EAAC;AAAA,cACX;AAEA,kBAAI,QAAQ,SAAS,QAAQ;AAC5B,oBAAI,SAAS,KAAK,MAAM,GAAG;AAC1B,sBAAI,UAAU,GAAG;AAChB,iCAAa,cAAc,IAAI;AAAA,kBAChC;AAEA;AAAA,gBACD,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD,WAAW,UAAU,SAAS,QAAQ;AACrC;AACA,oBAAI,MAAM,IAAI;AAEb,2BAAS,EAAE;AAAA,gBACZ,WAAW,MAAM,QAAQ;AAExB,2BAAS,EAAE;AAAA,gBACZ,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD,WAAW,QAAQ,MAAM,SAAS,QAAQ;AACzC,oBAAI,QAAQ,EAAE,eAAe;AAC5B,0BAAQ;AACR,sBAAI,MAAM,IAAI;AAEb,6BAAS,CAAC,EAAE;AACZ,6BAAS,WAAW;AACpB,6BAAS,aAAa;AACtB,4BAAQ,EAAE;AACV;AAAA,kBACD;AAAA,gBACD,WAAW,QAAQ,EAAE,eAAe;AACnC,sBAAI,MAAM,QAAQ;AACjB,6BAAS,WAAW;AACpB,4BAAQ,EAAE;AACV,4BAAQ;AAAA,kBACT,OAAO;AACN,4BAAQ;AAAA,kBACT;AAAA,gBACD,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD;AAEA,kBAAI,QAAQ,GAAG;AAGd,2BAAW,QAAQ,CAAC,IAAI;AAAA,cACzB,WAAW,gBAAgB,GAAG;AAG7B,sBAAM,cAAc,IAAI,WAAW,WAAW,QAAQ,WAAW,YAAY,WAAW,UAAU;AAClG,yBAAS,cAAc,GAAG,eAAe,WAAW;AACpD,gCAAgB;AAChB,qBAAK,YAAY;AAIjB,gBAAAA;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN;AAAA,YACD;AACC,oBAAM,IAAI,MAAM,6BAA6B,KAAK,EAAE;AAAA,UACtD;AAAA,QACD;AAEA,qBAAa,eAAe;AAC5B,qBAAa,eAAe;AAC5B,qBAAa,YAAY;AAGzB,aAAK,QAAQ;AACb,aAAK,QAAQ;AACb,aAAK,QAAQ;AAAA,MACd;AAAA,MAEA,MAAM;AACL,YAAK,KAAK,UAAU,EAAE,sBAAsB,KAAK,UAAU,KACzD,KAAK,UAAU,EAAE,aAAa,KAAK,UAAU,KAAK,SAAS,QAAS;AACrE,eAAK,UAAU;AAAA,QAChB,WAAW,KAAK,UAAU,EAAE,KAAK;AAChC,gBAAM,IAAI,MAAM,kDAAkD;AAAA,QACnE;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;AC5HA,eAAe,YAAY,MAAM;AAChC,MAAI,KAAK,SAAS,EAAE,WAAW;AAC9B,UAAM,IAAI,UAAU,0BAA0B,KAAK,GAAG,EAAE;AAAA,EACzD;AAEA,OAAK,SAAS,EAAE,YAAY;AAE5B,MAAI,KAAK,SAAS,EAAE,OAAO;AAC1B,UAAM,KAAK,SAAS,EAAE;AAAA,EACvB;AAEA,QAAM,EAAC,KAAI,IAAI;AAGf,MAAI,SAAS,MAAM;AAClB,WAAO,0BAAO,MAAM,CAAC;AAAA,EACtB;AAGA,MAAI,EAAE,gBAAgB,mBAAAE,UAAS;AAC9B,WAAO,0BAAO,MAAM,CAAC;AAAA,EACtB;AAIA,QAAM,QAAQ,CAAC;AACf,MAAI,aAAa;AAEjB,MAAI;AACH,qBAAiB,SAAS,MAAM;AAC/B,UAAI,KAAK,OAAO,KAAK,aAAa,MAAM,SAAS,KAAK,MAAM;AAC3D,cAAM,QAAQ,IAAI,WAAW,mBAAmB,KAAK,GAAG,gBAAgB,KAAK,IAAI,IAAI,UAAU;AAC/F,aAAK,QAAQ,KAAK;AAClB,cAAM;AAAA,MACP;AAEA,oBAAc,MAAM;AACpB,YAAM,KAAK,KAAK;AAAA,IACjB;AAAA,EACD,SAAS,OAAO;AACf,UAAM,SAAS,iBAAiB,iBAAiB,QAAQ,IAAI,WAAW,+CAA+C,KAAK,GAAG,KAAK,MAAM,OAAO,IAAI,UAAU,KAAK;AACpK,UAAM;AAAA,EACP;AAEA,MAAI,KAAK,kBAAkB,QAAQ,KAAK,eAAe,UAAU,MAAM;AACtE,QAAI;AACH,UAAI,MAAM,MAAM,OAAK,OAAO,MAAM,QAAQ,GAAG;AAC5C,eAAO,0BAAO,KAAK,MAAM,KAAK,EAAE,CAAC;AAAA,MAClC;AAEA,aAAO,0BAAO,OAAO,OAAO,UAAU;AAAA,IACvC,SAAS,OAAO;AACf,YAAM,IAAI,WAAW,kDAAkD,KAAK,GAAG,KAAK,MAAM,OAAO,IAAI,UAAU,KAAK;AAAA,IACrH;AAAA,EACD,OAAO;AACN,UAAM,IAAI,WAAW,4DAA4D,KAAK,GAAG,EAAE;AAAA,EAC5F;AACD;AA1PA,IAOA,oBACA,kBACA,oBASM,UACA,WAWe,MAqOR,OA0BP,4BAgBO,oBAqDA,eAkCA;AApYb;AAAA;AAOA,yBAAkC;AAClC,uBAA0C;AAC1C,yBAAqB;AAErB;AACA;AAEA;AACA;AACA;AAEA,IAAM,eAAW,4BAAU,mBAAAA,QAAO,QAAQ;AAC1C,IAAM,YAAY,OAAO,gBAAgB;AAWzC,IAAqB,OAArB,MAA0B;AAAA,MACzB,YAAY,MAAM;AAAA,QACjB,OAAO;AAAA,MACR,IAAI,CAAC,GAAG;AACP,YAAI,WAAW;AAEf,YAAI,SAAS,MAAM;AAElB,iBAAO;AAAA,QACR,WAAW,sBAAsB,IAAI,GAAG;AAEvC,iBAAO,0BAAO,KAAK,KAAK,SAAS,CAAC;AAAA,QACnC,WAAW,OAAO,IAAI,GAAG;AAAA,QAEzB,WAAW,0BAAO,SAAS,IAAI,GAAG;AAAA,QAElC,WAAW,uBAAM,iBAAiB,IAAI,GAAG;AAExC,iBAAO,0BAAO,KAAK,IAAI;AAAA,QACxB,WAAW,YAAY,OAAO,IAAI,GAAG;AAEpC,iBAAO,0BAAO,KAAK,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AAAA,QACjE,WAAW,gBAAgB,mBAAAA,SAAQ;AAAA,QAEnC,WAAW,gBAAgB,UAAU;AAEpC,iBAAO,eAAe,IAAI;AAC1B,qBAAW,KAAK,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,QAClC,OAAO;AAGN,iBAAO,0BAAO,KAAK,OAAO,IAAI,CAAC;AAAA,QAChC;AAEA,YAAI,SAAS;AAEb,YAAI,0BAAO,SAAS,IAAI,GAAG;AAC1B,mBAAS,mBAAAA,QAAO,SAAS,KAAK,IAAI;AAAA,QACnC,WAAW,OAAO,IAAI,GAAG;AACxB,mBAAS,mBAAAA,QAAO,SAAS,KAAK,KAAK,OAAO,CAAC;AAAA,QAC5C;AAEA,aAAK,SAAS,IAAI;AAAA,UACjB;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX,OAAO;AAAA,QACR;AACA,aAAK,OAAO;AAEZ,YAAI,gBAAgB,mBAAAA,SAAQ;AAC3B,eAAK,GAAG,SAAS,YAAU;AAC1B,kBAAM,QAAQ,kBAAkB,iBAC/B,SACA,IAAI,WAAW,+CAA+C,KAAK,GAAG,KAAK,OAAO,OAAO,IAAI,UAAU,MAAM;AAC9G,iBAAK,SAAS,EAAE,QAAQ;AAAA,UACzB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAK,SAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,WAAW;AACd,eAAO,KAAK,SAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,cAAc;AACnB,cAAM,EAAC,QAAQ,YAAY,WAAU,IAAI,MAAM,YAAY,IAAI;AAC/D,eAAO,OAAO,MAAM,YAAY,aAAa,UAAU;AAAA,MACxD;AAAA,MAEA,MAAM,WAAW;AAChB,cAAM,KAAK,KAAK,QAAQ,IAAI,cAAc;AAE1C,YAAI,GAAG,WAAW,mCAAmC,GAAG;AACvD,gBAAM,WAAW,IAAI,SAAS;AAC9B,gBAAM,aAAa,IAAI,gBAAgB,MAAM,KAAK,KAAK,CAAC;AAExD,qBAAW,CAAC,MAAM,KAAK,KAAK,YAAY;AACvC,qBAAS,OAAO,MAAM,KAAK;AAAA,UAC5B;AAEA,iBAAO;AAAA,QACR;AAEA,cAAM,EAAC,YAAAC,YAAU,IAAI,MAAM;AAC3B,eAAOA,YAAW,KAAK,MAAM,EAAE;AAAA,MAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,KAAM,KAAK,WAAW,KAAK,QAAQ,IAAI,cAAc,KAAO,KAAK,SAAS,EAAE,QAAQ,KAAK,SAAS,EAAE,KAAK,QAAS;AACxH,cAAM,MAAM,MAAM,KAAK,YAAY;AAEnC,eAAO,IAAI,mBAAK,CAAC,GAAG,GAAG;AAAA,UACtB,MAAM;AAAA,QACP,CAAC;AAAA,MACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,OAAO,MAAM,KAAK,KAAK;AAC7B,eAAO,KAAK,MAAM,IAAI;AAAA,MACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,SAAS,MAAM,YAAY,IAAI;AACrC,eAAO,IAAI,YAAY,EAAE,OAAO,MAAM;AAAA,MACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,SAAS;AACR,eAAO,YAAY,IAAI;AAAA,MACxB;AAAA,IACD;AAEA,SAAK,UAAU,aAAS,4BAAU,KAAK,UAAU,QAAQ,sEAA0E,mBAAmB;AAGtJ,WAAO,iBAAiB,KAAK,WAAW;AAAA,MACvC,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,aAAa,EAAC,YAAY,KAAI;AAAA,MAC9B,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,SAAK;AAAA,QAAU,MAAM;AAAA,QAAC;AAAA,QAC5B;AAAA,QACA;AAAA,MAAiE,EAAC;AAAA,IACpE,CAAC;AA2EM,IAAM,QAAQ,CAAC,UAAU,kBAAkB;AACjD,UAAI;AACJ,UAAI;AACJ,UAAI,EAAC,KAAI,IAAI,SAAS,SAAS;AAG/B,UAAI,SAAS,UAAU;AACtB,cAAM,IAAI,MAAM,oCAAoC;AAAA,MACrD;AAIA,UAAK,gBAAgB,mBAAAD,WAAY,OAAO,KAAK,gBAAgB,YAAa;AAEzE,aAAK,IAAI,+BAAY,EAAC,cAAa,CAAC;AACpC,aAAK,IAAI,+BAAY,EAAC,cAAa,CAAC;AACpC,aAAK,KAAK,EAAE;AACZ,aAAK,KAAK,EAAE;AAEZ,iBAAS,SAAS,EAAE,SAAS;AAC7B,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,IACR;AAEA,IAAM,iCAA6B;AAAA,MAClC,UAAQ,KAAK,YAAY;AAAA,MACzB;AAAA,MACA;AAAA,IACD;AAYO,IAAM,qBAAqB,CAAC,MAAM,YAAY;AAEpD,UAAI,SAAS,MAAM;AAClB,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,SAAS,UAAU;AAC7B,eAAO;AAAA,MACR;AAGA,UAAI,sBAAsB,IAAI,GAAG;AAChC,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,IAAI,GAAG;AACjB,eAAO,KAAK,QAAQ;AAAA,MACrB;AAGA,UAAI,0BAAO,SAAS,IAAI,KAAK,uBAAM,iBAAiB,IAAI,KAAK,YAAY,OAAO,IAAI,GAAG;AACtF,eAAO;AAAA,MACR;AAEA,UAAI,gBAAgB,UAAU;AAC7B,eAAO,iCAAiC,QAAQ,SAAS,EAAE,QAAQ;AAAA,MACpE;AAGA,UAAI,QAAQ,OAAO,KAAK,gBAAgB,YAAY;AACnD,eAAO,gCAAgC,2BAA2B,IAAI,CAAC;AAAA,MACxE;AAGA,UAAI,gBAAgB,mBAAAA,SAAQ;AAC3B,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IACR;AAWO,IAAM,gBAAgB,aAAW;AACvC,YAAM,EAAC,KAAI,IAAI,QAAQ,SAAS;AAGhC,UAAI,SAAS,MAAM;AAClB,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,IAAI,GAAG;AACjB,eAAO,KAAK;AAAA,MACb;AAGA,UAAI,0BAAO,SAAS,IAAI,GAAG;AAC1B,eAAO,KAAK;AAAA,MACb;AAGA,UAAI,QAAQ,OAAO,KAAK,kBAAkB,YAAY;AACrD,eAAO,KAAK,kBAAkB,KAAK,eAAe,IAAI,KAAK,cAAc,IAAI;AAAA,MAC9E;AAGA,aAAO;AAAA,IACR;AASO,IAAM,gBAAgB,OAAO,MAAM,EAAC,KAAI,MAAM;AACpD,UAAI,SAAS,MAAM;AAElB,aAAK,IAAI;AAAA,MACV,OAAO;AAEN,cAAM,SAAS,MAAM,IAAI;AAAA,MAC1B;AAAA,IACD;AAAA;AAAA;;;ACxJO,SAAS,eAAe,UAAU,CAAC,GAAG;AAC5C,SAAO,IAAI;AAAA,IACV,QAEE,OAAO,CAAC,QAAQ,OAAO,OAAO,UAAU;AACxC,UAAI,QAAQ,MAAM,GAAG;AACpB,eAAO,KAAK,MAAM,MAAM,OAAO,QAAQ,CAAC,CAAC;AAAA,MAC1C;AAEA,aAAO;AAAA,IACR,GAAG,CAAC,CAAC,EACJ,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM;AAC1B,UAAI;AACH,2BAAmB,IAAI;AACvB,4BAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,eAAO;AAAA,MACR,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD,CAAC;AAAA,EAEH;AACD;AA1QA,IAMAE,mBACA,kBAGM,oBAWA,qBAsBe;AA3CrB;AAAA;AAMA,IAAAA,oBAAoB;AACpB,uBAAiB;AAGjB,IAAM,qBAAqB,OAAO,iBAAAC,QAAK,uBAAuB,aAC7D,iBAAAA,QAAK,qBACL,UAAQ;AACP,UAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAC1C,cAAM,QAAQ,IAAI,UAAU,2CAA2C,IAAI,GAAG;AAC9E,eAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,yBAAwB,CAAC;AACtE,cAAM;AAAA,MACP;AAAA,IACD;AAGD,IAAM,sBAAsB,OAAO,iBAAAA,QAAK,wBAAwB,aAC/D,iBAAAA,QAAK,sBACL,CAAC,MAAM,UAAU;AAChB,UAAI,kCAAkC,KAAK,KAAK,GAAG;AAClD,cAAM,QAAQ,IAAI,UAAU,yCAAyC,IAAI,IAAI;AAC7E,eAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,mBAAkB,CAAC;AAChE,cAAM;AAAA,MACP;AAAA,IACD;AAcD,IAAqB,UAArB,MAAqB,iBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOpD,YAAY,MAAM;AAGjB,YAAI,SAAS,CAAC;AACd,YAAI,gBAAgB,UAAS;AAC5B,gBAAM,MAAM,KAAK,IAAI;AACrB,qBAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,GAAG,GAAG;AACjD,mBAAO,KAAK,GAAG,OAAO,IAAI,WAAS,CAAC,MAAM,KAAK,CAAC,CAAC;AAAA,UAClD;AAAA,QACD,WAAW,QAAQ,MAAM;AAAA,QAEzB,WAAW,OAAO,SAAS,YAAY,CAAC,wBAAM,iBAAiB,IAAI,GAAG;AACrE,gBAAM,SAAS,KAAK,OAAO,QAAQ;AAEnC,cAAI,UAAU,MAAM;AAEnB,mBAAO,KAAK,GAAG,OAAO,QAAQ,IAAI,CAAC;AAAA,UACpC,OAAO;AACN,gBAAI,OAAO,WAAW,YAAY;AACjC,oBAAM,IAAI,UAAU,+BAA+B;AAAA,YACpD;AAIA,qBAAS,CAAC,GAAG,IAAI,EACf,IAAI,UAAQ;AACZ,kBACC,OAAO,SAAS,YAAY,wBAAM,iBAAiB,IAAI,GACtD;AACD,sBAAM,IAAI,UAAU,6CAA6C;AAAA,cAClE;AAEA,qBAAO,CAAC,GAAG,IAAI;AAAA,YAChB,CAAC,EAAE,IAAI,UAAQ;AACd,kBAAI,KAAK,WAAW,GAAG;AACtB,sBAAM,IAAI,UAAU,6CAA6C;AAAA,cAClE;AAEA,qBAAO,CAAC,GAAG,IAAI;AAAA,YAChB,CAAC;AAAA,UACH;AAAA,QACD,OAAO;AACN,gBAAM,IAAI,UAAU,sIAAyI;AAAA,QAC9J;AAGA,iBACC,OAAO,SAAS,IACf,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;AAC7B,6BAAmB,IAAI;AACvB,8BAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,iBAAO,CAAC,OAAO,IAAI,EAAE,YAAY,GAAG,OAAO,KAAK,CAAC;AAAA,QAClD,CAAC,IACD;AAEF,cAAM,MAAM;AAIZ,eAAO,IAAI,MAAM,MAAM;AAAA,UACtB,IAAI,QAAQ,GAAG,UAAU;AACxB,oBAAQ,GAAG;AAAA,cACV,KAAK;AAAA,cACL,KAAK;AACJ,uBAAO,CAAC,MAAM,UAAU;AACvB,qCAAmB,IAAI;AACvB,sCAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,yBAAO,gBAAgB,UAAU,CAAC,EAAE;AAAA,oBACnC;AAAA,oBACA,OAAO,IAAI,EAAE,YAAY;AAAA,oBACzB,OAAO,KAAK;AAAA,kBACb;AAAA,gBACD;AAAA,cAED,KAAK;AAAA,cACL,KAAK;AAAA,cACL,KAAK;AACJ,uBAAO,UAAQ;AACd,qCAAmB,IAAI;AACvB,yBAAO,gBAAgB,UAAU,CAAC,EAAE;AAAA,oBACnC;AAAA,oBACA,OAAO,IAAI,EAAE,YAAY;AAAA,kBAC1B;AAAA,gBACD;AAAA,cAED,KAAK;AACJ,uBAAO,MAAM;AACZ,yBAAO,KAAK;AACZ,yBAAO,IAAI,IAAI,gBAAgB,UAAU,KAAK,KAAK,MAAM,CAAC,EAAE,KAAK;AAAA,gBAClE;AAAA,cAED;AACC,uBAAO,QAAQ,IAAI,QAAQ,GAAG,QAAQ;AAAA,YACxC;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MAEF;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,MAEA,WAAW;AACV,eAAO,OAAO,UAAU,SAAS,KAAK,IAAI;AAAA,MAC3C;AAAA,MAEA,IAAI,MAAM;AACT,cAAM,SAAS,KAAK,OAAO,IAAI;AAC/B,YAAI,OAAO,WAAW,GAAG;AACxB,iBAAO;AAAA,QACR;AAEA,YAAI,QAAQ,OAAO,KAAK,IAAI;AAC5B,YAAI,sBAAsB,KAAK,IAAI,GAAG;AACrC,kBAAQ,MAAM,YAAY;AAAA,QAC3B;AAEA,eAAO;AAAA,MACR;AAAA,MAEA,QAAQ,UAAU,UAAU,QAAW;AACtC,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,kBAAQ,MAAM,UAAU,SAAS,CAAC,KAAK,IAAI,IAAI,GAAG,MAAM,IAAI,CAAC;AAAA,QAC9D;AAAA,MACD;AAAA,MAEA,CAAE,SAAS;AACV,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,gBAAM,KAAK,IAAI,IAAI;AAAA,QACpB;AAAA,MACD;AAAA;AAAA;AAAA;AAAA,MAKA,CAAE,UAAU;AACX,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,gBAAM,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC;AAAA,QAC5B;AAAA,MACD;AAAA,MAEA,CAAC,OAAO,QAAQ,IAAI;AACnB,eAAO,KAAK,QAAQ;AAAA,MACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM;AACL,eAAO,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,QAAQ;AAC/C,iBAAO,GAAG,IAAI,KAAK,OAAO,GAAG;AAC7B,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AAAA,MACN;AAAA;AAAA;AAAA;AAAA,MAKA,CAAC,OAAO,IAAI,4BAA4B,CAAC,IAAI;AAC5C,eAAO,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,QAAQ;AAC/C,gBAAM,SAAS,KAAK,OAAO,GAAG;AAG9B,cAAI,QAAQ,QAAQ;AACnB,mBAAO,GAAG,IAAI,OAAO,CAAC;AAAA,UACvB,OAAO;AACN,mBAAO,GAAG,IAAI,OAAO,SAAS,IAAI,SAAS,OAAO,CAAC;AAAA,UACpD;AAEA,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AAAA,MACN;AAAA,IACD;AAMA,WAAO;AAAA,MACN,QAAQ;AAAA,MACR,CAAC,OAAO,WAAW,WAAW,QAAQ,EAAE,OAAO,CAAC,QAAQ,aAAa;AACpE,eAAO,QAAQ,IAAI,EAAC,YAAY,KAAI;AACpC,eAAO;AAAA,MACR,GAAG,CAAC,CAAC;AAAA,IACN;AAAA;AAAA;;;AC7OA,IAAM,gBAQO;AARb;AAAA;AAAA,IAAM,iBAAiB,oBAAI,IAAI,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG,CAAC;AAQjD,IAAM,aAAa,UAAQ;AACjC,aAAO,eAAe,IAAI,IAAI;AAAA,IAC/B;AAAA;AAAA;;;ACVA,IAUMC,YAWe;AArBrB;AAAA;AAMA;AACA;AACA;AAEA,IAAMA,aAAY,OAAO,oBAAoB;AAW7C,IAAqB,WAArB,MAAqB,kBAAiB,KAAK;AAAA,MAC1C,YAAY,OAAO,MAAM,UAAU,CAAC,GAAG;AACtC,cAAM,MAAM,OAAO;AAGnB,cAAM,SAAS,QAAQ,UAAU,OAAO,QAAQ,SAAS;AAEzD,cAAM,UAAU,IAAI,QAAQ,QAAQ,OAAO;AAE3C,YAAI,SAAS,QAAQ,CAAC,QAAQ,IAAI,cAAc,GAAG;AAClD,gBAAM,cAAc,mBAAmB,MAAM,IAAI;AACjD,cAAI,aAAa;AAChB,oBAAQ,OAAO,gBAAgB,WAAW;AAAA,UAC3C;AAAA,QACD;AAEA,aAAKA,UAAS,IAAI;AAAA,UACjB,MAAM;AAAA,UACN,KAAK,QAAQ;AAAA,UACb;AAAA,UACA,YAAY,QAAQ,cAAc;AAAA,UAClC;AAAA,UACA,SAAS,QAAQ;AAAA,UACjB,eAAe,QAAQ;AAAA,QACxB;AAAA,MACD;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,MAAM;AACT,eAAO,KAAKA,UAAS,EAAE,OAAO;AAAA,MAC/B;AAAA,MAEA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA,MAKA,IAAI,KAAK;AACR,eAAO,KAAKA,UAAS,EAAE,UAAU,OAAO,KAAKA,UAAS,EAAE,SAAS;AAAA,MAClE;AAAA,MAEA,IAAI,aAAa;AAChB,eAAO,KAAKA,UAAS,EAAE,UAAU;AAAA,MAClC;AAAA,MAEA,IAAI,aAAa;AAChB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,UAAU;AACb,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,gBAAgB;AACnB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,QAAQ;AACP,eAAO,IAAI,UAAS,MAAM,MAAM,KAAK,aAAa,GAAG;AAAA,UACpD,MAAM,KAAK;AAAA,UACX,KAAK,KAAK;AAAA,UACV,QAAQ,KAAK;AAAA,UACb,YAAY,KAAK;AAAA,UACjB,SAAS,KAAK;AAAA,UACd,IAAI,KAAK;AAAA,UACT,YAAY,KAAK;AAAA,UACjB,MAAM,KAAK;AAAA,UACX,eAAe,KAAK;AAAA,QACrB,CAAC;AAAA,MACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAO,SAAS,KAAK,SAAS,KAAK;AAClC,YAAI,CAAC,WAAW,MAAM,GAAG;AACxB,gBAAM,IAAI,WAAW,iEAAiE;AAAA,QACvF;AAEA,eAAO,IAAI,UAAS,MAAM;AAAA,UACzB,SAAS;AAAA,YACR,UAAU,IAAI,IAAI,GAAG,EAAE,SAAS;AAAA,UACjC;AAAA,UACA;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MAEA,OAAO,QAAQ;AACd,cAAM,WAAW,IAAI,UAAS,MAAM,EAAC,QAAQ,GAAG,YAAY,GAAE,CAAC;AAC/D,iBAASA,UAAS,EAAE,OAAO;AAC3B,eAAO;AAAA,MACR;AAAA,MAEA,OAAO,KAAK,OAAO,QAAW,OAAO,CAAC,GAAG;AACxC,cAAM,OAAO,KAAK,UAAU,IAAI;AAEhC,YAAI,SAAS,QAAW;AACvB,gBAAM,IAAI,UAAU,+BAA+B;AAAA,QACpD;AAEA,cAAM,UAAU,IAAI,QAAQ,QAAQ,KAAK,OAAO;AAEhD,YAAI,CAAC,QAAQ,IAAI,cAAc,GAAG;AACjC,kBAAQ,IAAI,gBAAgB,kBAAkB;AAAA,QAC/C;AAEA,eAAO,IAAI,UAAS,MAAM;AAAA,UACzB,GAAG;AAAA,UACH;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO;AAAA,MACR;AAAA,IACD;AAEA,WAAO,iBAAiB,SAAS,WAAW;AAAA,MAC3C,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,KAAK,EAAC,YAAY,KAAI;AAAA,MACtB,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,IAAI,EAAC,YAAY,KAAI;AAAA,MACrB,YAAY,EAAC,YAAY,KAAI;AAAA,MAC7B,YAAY,EAAC,YAAY,KAAI;AAAA,MAC7B,SAAS,EAAC,YAAY,KAAI;AAAA,MAC1B,OAAO,EAAC,YAAY,KAAI;AAAA,IACzB,CAAC;AAAA;AAAA;;;AC/JD,IAAa;AAAb;AAAA;AAAO,IAAM,YAAY,eAAa;AACrC,UAAI,UAAU,QAAQ;AACrB,eAAO,UAAU;AAAA,MAClB;AAEA,YAAM,aAAa,UAAU,KAAK,SAAS;AAC3C,YAAM,OAAO,UAAU,SAAS,UAAU,KAAK,UAAU,MAAM,MAAM,MAAM;AAC3E,aAAO,UAAU,KAAK,aAAa,KAAK,MAAM,MAAM,MAAM,MAAM;AAAA,IACjE;AAAA;AAAA;;;ACSO,SAAS,0BAA0B,KAAK,aAAa,OAAO;AAElE,MAAI,OAAO,MAAM;AAChB,WAAO;AAAA,EACR;AAEA,QAAM,IAAI,IAAI,GAAG;AAGjB,MAAI,uBAAuB,KAAK,IAAI,QAAQ,GAAG;AAC9C,WAAO;AAAA,EACR;AAGA,MAAI,WAAW;AAIf,MAAI,WAAW;AAIf,MAAI,OAAO;AAGX,MAAI,YAAY;AAGf,QAAI,WAAW;AAIf,QAAI,SAAS;AAAA,EACd;AAGA,SAAO;AACR;AA2BO,SAAS,uBAAuB,gBAAgB;AACtD,MAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACxC,UAAM,IAAI,UAAU,2BAA2B,cAAc,EAAE;AAAA,EAChE;AAEA,SAAO;AACR;AAOO,SAAS,+BAA+B,KAAK;AAQnD,MAAI,gBAAgB,KAAK,IAAI,QAAQ,GAAG;AACvC,WAAO;AAAA,EACR;AAGA,QAAM,SAAS,IAAI,KAAK,QAAQ,eAAe,EAAE;AACjD,QAAM,oBAAgB,sBAAK,MAAM;AAEjC,MAAI,kBAAkB,KAAK,SAAS,KAAK,MAAM,GAAG;AACjD,WAAO;AAAA,EACR;AAEA,MAAI,kBAAkB,KAAK,mCAAmC,KAAK,MAAM,GAAG;AAC3E,WAAO;AAAA,EACR;AAKA,MAAI,IAAI,SAAS,eAAe,IAAI,KAAK,SAAS,YAAY,GAAG;AAChE,WAAO;AAAA,EACR;AAGA,MAAI,IAAI,aAAa,SAAS;AAC7B,WAAO;AAAA,EACR;AASA,SAAO;AACR;AAOO,SAAS,4BAA4B,KAAK;AAEhD,MAAI,yBAAyB,KAAK,GAAG,GAAG;AACvC,WAAO;AAAA,EACR;AAGA,MAAI,IAAI,aAAa,SAAS;AAC7B,WAAO;AAAA,EACR;AAKA,MAAI,uBAAuB,KAAK,IAAI,QAAQ,GAAG;AAC9C,WAAO;AAAA,EACR;AAGA,SAAO,+BAA+B,GAAG;AAC1C;AA0BO,SAAS,0BAA0B,SAAS,EAAC,qBAAqB,uBAAsB,IAAI,CAAC,GAAG;AAMtG,MAAI,QAAQ,aAAa,iBAAiB,QAAQ,mBAAmB,IAAI;AACxE,WAAO;AAAA,EACR;AAGA,QAAM,SAAS,QAAQ;AAMvB,MAAI,QAAQ,aAAa,gBAAgB;AACxC,WAAO;AAAA,EACR;AAGA,QAAM,iBAAiB,QAAQ;AAG/B,MAAI,cAAc,0BAA0B,cAAc;AAI1D,MAAI,iBAAiB,0BAA0B,gBAAgB,IAAI;AAInE,MAAI,YAAY,SAAS,EAAE,SAAS,MAAM;AACzC,kBAAc;AAAA,EACf;AAMA,MAAI,qBAAqB;AACxB,kBAAc,oBAAoB,WAAW;AAAA,EAC9C;AAEA,MAAI,wBAAwB;AAC3B,qBAAiB,uBAAuB,cAAc;AAAA,EACvD;AAGA,QAAM,aAAa,IAAI,IAAI,QAAQ,GAAG;AAEtC,UAAQ,QAAQ;AAAA,IACf,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO,eAAe,SAAS;AAAA,IAEhC,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAIA,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER;AACC,YAAM,IAAI,UAAU,2BAA2B,MAAM,EAAE;AAAA,EACzD;AACD;AAOO,SAAS,8BAA8B,SAAS;AAGtD,QAAM,gBAAgB,QAAQ,IAAI,iBAAiB,KAAK,IAAI,MAAM,QAAQ;AAG1E,MAAI,SAAS;AAMb,aAAW,SAAS,cAAc;AACjC,QAAI,SAAS,eAAe,IAAI,KAAK,GAAG;AACvC,eAAS;AAAA,IACV;AAAA,EACD;AAGA,SAAO;AACR;AAnVA,qBA2Da,gBAeA;AA1Eb;AAAA;AAAA,sBAAmB;AA2DZ,IAAM,iBAAiB,oBAAI,IAAI;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAC;AAKM,IAAM,0BAA0B;AAAA;AAAA;;;AC1EvC,IAQA,iBACAC,mBASMC,YAQA,WAOA,eAae,SAmLR;AAjOb;AAAA;AAQA,sBAAkC;AAClC,IAAAD,oBAAwB;AACxB;AACA;AACA;AACA;AACA;AAIA,IAAMC,aAAY,OAAO,mBAAmB;AAQ5C,IAAM,YAAY,YAAU;AAC3B,aACC,OAAO,WAAW,YAClB,OAAO,OAAOA,UAAS,MAAM;AAAA,IAE/B;AAEA,IAAM,oBAAgB;AAAA,MAAU,MAAM;AAAA,MAAC;AAAA,MACtC;AAAA,MACA;AAAA,IAAgE;AAWjE,IAAqB,UAArB,MAAqB,iBAAgB,KAAK;AAAA,MACzC,YAAY,OAAO,OAAO,CAAC,GAAG;AAC7B,YAAI;AAGJ,YAAI,UAAU,KAAK,GAAG;AACrB,sBAAY,IAAI,IAAI,MAAM,GAAG;AAAA,QAC9B,OAAO;AACN,sBAAY,IAAI,IAAI,KAAK;AACzB,kBAAQ,CAAC;AAAA,QACV;AAEA,YAAI,UAAU,aAAa,MAAM,UAAU,aAAa,IAAI;AAC3D,gBAAM,IAAI,UAAU,GAAG,SAAS,uCAAuC;AAAA,QACxE;AAEA,YAAI,SAAS,KAAK,UAAU,MAAM,UAAU;AAC5C,YAAI,wCAAwC,KAAK,MAAM,GAAG;AACzD,mBAAS,OAAO,YAAY;AAAA,QAC7B;AAEA,YAAI,CAAC,UAAU,IAAI,KAAK,UAAU,MAAM;AACvC,wBAAc;AAAA,QACf;AAGA,aAAK,KAAK,QAAQ,QAAS,UAAU,KAAK,KAAK,MAAM,SAAS,UAC5D,WAAW,SAAS,WAAW,SAAS;AACzC,gBAAM,IAAI,UAAU,+CAA+C;AAAA,QACpE;AAEA,cAAM,YAAY,KAAK,OACtB,KAAK,OACJ,UAAU,KAAK,KAAK,MAAM,SAAS,OACnC,MAAM,KAAK,IACX;AAEF,cAAM,WAAW;AAAA,UAChB,MAAM,KAAK,QAAQ,MAAM,QAAQ;AAAA,QAClC,CAAC;AAED,cAAM,UAAU,IAAI,QAAQ,KAAK,WAAW,MAAM,WAAW,CAAC,CAAC;AAE/D,YAAI,cAAc,QAAQ,CAAC,QAAQ,IAAI,cAAc,GAAG;AACvD,gBAAM,cAAc,mBAAmB,WAAW,IAAI;AACtD,cAAI,aAAa;AAChB,oBAAQ,IAAI,gBAAgB,WAAW;AAAA,UACxC;AAAA,QACD;AAEA,YAAI,SAAS,UAAU,KAAK,IAC3B,MAAM,SACN;AACD,YAAI,YAAY,MAAM;AACrB,mBAAS,KAAK;AAAA,QACf;AAGA,YAAI,UAAU,QAAQ,CAAC,cAAc,MAAM,GAAG;AAC7C,gBAAM,IAAI,UAAU,gEAAgE;AAAA,QACrF;AAIA,YAAI,WAAW,KAAK,YAAY,OAAO,MAAM,WAAW,KAAK;AAC7D,YAAI,aAAa,IAAI;AAEpB,qBAAW;AAAA,QACZ,WAAW,UAAU;AAEpB,gBAAM,iBAAiB,IAAI,IAAI,QAAQ;AAEvC,qBAAW,wBAAwB,KAAK,cAAc,IAAI,WAAW;AAAA,QACtE,OAAO;AACN,qBAAW;AAAA,QACZ;AAEA,aAAKA,UAAS,IAAI;AAAA,UACjB;AAAA,UACA,UAAU,KAAK,YAAY,MAAM,YAAY;AAAA,UAC7C;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAGA,aAAK,SAAS,KAAK,WAAW,SAAa,MAAM,WAAW,SAAY,KAAK,MAAM,SAAU,KAAK;AAClG,aAAK,WAAW,KAAK,aAAa,SAAa,MAAM,aAAa,SAAY,OAAO,MAAM,WAAY,KAAK;AAC5G,aAAK,UAAU,KAAK,WAAW,MAAM,WAAW;AAChD,aAAK,QAAQ,KAAK,SAAS,MAAM;AACjC,aAAK,gBAAgB,KAAK,iBAAiB,MAAM,iBAAiB;AAClE,aAAK,qBAAqB,KAAK,sBAAsB,MAAM,sBAAsB;AAIjF,aAAK,iBAAiB,KAAK,kBAAkB,MAAM,kBAAkB;AAAA,MACtE;AAAA;AAAA,MAGA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,MAAM;AACT,mBAAO,gBAAAC,QAAU,KAAKD,UAAS,EAAE,SAAS;AAAA,MAC3C;AAAA;AAAA,MAGA,IAAI,UAAU;AACb,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,WAAW;AACd,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,WAAW;AACd,YAAI,KAAKA,UAAS,EAAE,aAAa,eAAe;AAC/C,iBAAO;AAAA,QACR;AAEA,YAAI,KAAKA,UAAS,EAAE,aAAa,UAAU;AAC1C,iBAAO;AAAA,QACR;AAEA,YAAI,KAAKA,UAAS,EAAE,UAAU;AAC7B,iBAAO,KAAKA,UAAS,EAAE,SAAS,SAAS;AAAA,QAC1C;AAEA,eAAO;AAAA,MACR;AAAA,MAEA,IAAI,iBAAiB;AACpB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,eAAe,gBAAgB;AAClC,aAAKA,UAAS,EAAE,iBAAiB,uBAAuB,cAAc;AAAA,MACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,QAAQ;AACP,eAAO,IAAI,SAAQ,IAAI;AAAA,MACxB;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO;AAAA,MACR;AAAA,IACD;AAEA,WAAO,iBAAiB,QAAQ,WAAW;AAAA,MAC1C,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,KAAK,EAAC,YAAY,KAAI;AAAA,MACtB,SAAS,EAAC,YAAY,KAAI;AAAA,MAC1B,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,OAAO,EAAC,YAAY,KAAI;AAAA,MACxB,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,gBAAgB,EAAC,YAAY,KAAI;AAAA,IAClC,CAAC;AAQM,IAAM,wBAAwB,aAAW;AAC/C,YAAM,EAAC,UAAS,IAAI,QAAQA,UAAS;AACrC,YAAM,UAAU,IAAI,QAAQ,QAAQA,UAAS,EAAE,OAAO;AAGtD,UAAI,CAAC,QAAQ,IAAI,QAAQ,GAAG;AAC3B,gBAAQ,IAAI,UAAU,KAAK;AAAA,MAC5B;AAGA,UAAI,qBAAqB;AACzB,UAAI,QAAQ,SAAS,QAAQ,gBAAgB,KAAK,QAAQ,MAAM,GAAG;AAClE,6BAAqB;AAAA,MACtB;AAEA,UAAI,QAAQ,SAAS,MAAM;AAC1B,cAAM,aAAa,cAAc,OAAO;AAExC,YAAI,OAAO,eAAe,YAAY,CAAC,OAAO,MAAM,UAAU,GAAG;AAChE,+BAAqB,OAAO,UAAU;AAAA,QACvC;AAAA,MACD;AAEA,UAAI,oBAAoB;AACvB,gBAAQ,IAAI,kBAAkB,kBAAkB;AAAA,MACjD;AAKA,UAAI,QAAQ,mBAAmB,IAAI;AAClC,gBAAQ,iBAAiB;AAAA,MAC1B;AAKA,UAAI,QAAQ,YAAY,QAAQ,aAAa,eAAe;AAC3D,gBAAQA,UAAS,EAAE,WAAW,0BAA0B,OAAO;AAAA,MAChE,OAAO;AACN,gBAAQA,UAAS,EAAE,WAAW;AAAA,MAC/B;AAKA,UAAI,QAAQA,UAAS,EAAE,oBAAoB,KAAK;AAC/C,gBAAQ,IAAI,WAAW,QAAQ,QAAQ;AAAA,MACxC;AAGA,UAAI,CAAC,QAAQ,IAAI,YAAY,GAAG;AAC/B,gBAAQ,IAAI,cAAc,YAAY;AAAA,MACvC;AAGA,UAAI,QAAQ,YAAY,CAAC,QAAQ,IAAI,iBAAiB,GAAG;AACxD,gBAAQ,IAAI,mBAAmB,mBAAmB;AAAA,MACnD;AAEA,UAAI,EAAC,MAAK,IAAI;AACd,UAAI,OAAO,UAAU,YAAY;AAChC,gBAAQ,MAAM,SAAS;AAAA,MACxB;AAKA,YAAM,SAAS,UAAU,SAAS;AAIlC,YAAM,UAAU;AAAA;AAAA,QAEf,MAAM,UAAU,WAAW;AAAA;AAAA,QAE3B,QAAQ,QAAQ;AAAA,QAChB,SAAS,QAAQ,OAAO,IAAI,4BAA4B,CAAC,EAAE;AAAA,QAC3D,oBAAoB,QAAQ;AAAA,QAC5B;AAAA,MACD;AAEA,aAAO;AAAA;AAAA,QAEN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;ACxTA,IAKa;AALb;AAAA;AAAA;AAKO,IAAM,aAAN,cAAyB,eAAe;AAAA,MAC9C,YAAY,SAAS,OAAO,WAAW;AACtC,cAAM,SAAS,IAAI;AAAA,MACpB;AAAA,IACD;AAAA;AAAA;;;ACTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA,eAAO,MAA6B,KAAK,UAAU;AAClD,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEvC,UAAM,UAAU,IAAI,QAAQ,KAAK,QAAQ;AACzC,UAAM,EAAC,WAAW,QAAO,IAAI,sBAAsB,OAAO;AAC1D,QAAI,CAAC,iBAAiB,IAAI,UAAU,QAAQ,GAAG;AAC9C,YAAM,IAAI,UAAU,0BAA0B,GAAG,iBAAiB,UAAU,SAAS,QAAQ,MAAM,EAAE,CAAC,qBAAqB;AAAA,IAC5H;AAEA,QAAI,UAAU,aAAa,SAAS;AACnC,YAAM,OAAO,aAAgB,QAAQ,GAAG;AACxC,YAAME,YAAW,IAAI,SAAS,MAAM,EAAC,SAAS,EAAC,gBAAgB,KAAK,SAAQ,EAAC,CAAC;AAC9E,cAAQA,SAAQ;AAChB;AAAA,IACD;AAGA,UAAM,QAAQ,UAAU,aAAa,WAAW,kBAAAC,UAAQ,kBAAAC,SAAM;AAC9D,UAAM,EAAC,OAAM,IAAI;AACjB,QAAI,WAAW;AAEf,UAAM,QAAQ,MAAM;AACnB,YAAM,QAAQ,IAAI,WAAW,4BAA4B;AACzD,aAAO,KAAK;AACZ,UAAI,QAAQ,QAAQ,QAAQ,gBAAgB,oBAAAC,QAAO,UAAU;AAC5D,gBAAQ,KAAK,QAAQ,KAAK;AAAA,MAC3B;AAEA,UAAI,CAAC,YAAY,CAAC,SAAS,MAAM;AAChC;AAAA,MACD;AAEA,eAAS,KAAK,KAAK,SAAS,KAAK;AAAA,IAClC;AAEA,QAAI,UAAU,OAAO,SAAS;AAC7B,YAAM;AACN;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,YAAM;AACN,eAAS;AAAA,IACV;AAGA,UAAM,WAAW,KAAK,UAAU,SAAS,GAAG,OAAO;AAEnD,QAAI,QAAQ;AACX,aAAO,iBAAiB,SAAS,gBAAgB;AAAA,IAClD;AAEA,UAAM,WAAW,MAAM;AACtB,eAAS,MAAM;AACf,UAAI,QAAQ;AACX,eAAO,oBAAoB,SAAS,gBAAgB;AAAA,MACrD;AAAA,IACD;AAEA,aAAS,GAAG,SAAS,WAAS;AAC7B,aAAO,IAAI,WAAW,cAAc,QAAQ,GAAG,oBAAoB,MAAM,OAAO,IAAI,UAAU,KAAK,CAAC;AACpG,eAAS;AAAA,IACV,CAAC;AAED,wCAAoC,UAAU,WAAS;AACtD,UAAI,YAAY,SAAS,MAAM;AAC9B,iBAAS,KAAK,QAAQ,KAAK;AAAA,MAC5B;AAAA,IACD,CAAC;AAGD,QAAI,QAAQ,UAAU,OAAO;AAG5B,eAAS,GAAG,UAAU,CAAAC,OAAK;AAC1B,YAAI;AACJ,QAAAA,GAAE,gBAAgB,OAAO,MAAM;AAC9B,iCAAuBA,GAAE;AAAA,QAC1B,CAAC;AACD,QAAAA,GAAE,gBAAgB,SAAS,cAAY;AAEtC,cAAI,YAAY,uBAAuBA,GAAE,gBAAgB,CAAC,UAAU;AACnE,kBAAM,QAAQ,IAAI,MAAM,iBAAiB;AACzC,kBAAM,OAAO;AACb,qBAAS,KAAK,KAAK,SAAS,KAAK;AAAA,UAClC;AAAA,QACD,CAAC;AAAA,MACF,CAAC;AAAA,IACF;AAEA,aAAS,GAAG,YAAY,eAAa;AACpC,eAAS,WAAW,CAAC;AACrB,YAAM,UAAU,eAAe,UAAU,UAAU;AAGnD,UAAI,WAAW,UAAU,UAAU,GAAG;AAErC,cAAM,WAAW,QAAQ,IAAI,UAAU;AAGvC,YAAI,cAAc;AAClB,YAAI;AACH,wBAAc,aAAa,OAAO,OAAO,IAAI,IAAI,UAAU,QAAQ,GAAG;AAAA,QACvE,QAAQ;AAIP,cAAI,QAAQ,aAAa,UAAU;AAClC,mBAAO,IAAI,WAAW,wDAAwD,QAAQ,IAAI,kBAAkB,CAAC;AAC7G,qBAAS;AACT;AAAA,UACD;AAAA,QACD;AAGA,gBAAQ,QAAQ,UAAU;AAAA,UACzB,KAAK;AACJ,mBAAO,IAAI,WAAW,0EAA0E,QAAQ,GAAG,IAAI,aAAa,CAAC;AAC7H,qBAAS;AACT;AAAA,UACD,KAAK;AAEJ;AAAA,UACD,KAAK,UAAU;AAEd,gBAAI,gBAAgB,MAAM;AACzB;AAAA,YACD;AAGA,gBAAI,QAAQ,WAAW,QAAQ,QAAQ;AACtC,qBAAO,IAAI,WAAW,gCAAgC,QAAQ,GAAG,IAAI,cAAc,CAAC;AACpF,uBAAS;AACT;AAAA,YACD;AAIA,kBAAM,iBAAiB;AAAA,cACtB,SAAS,IAAI,QAAQ,QAAQ,OAAO;AAAA,cACpC,QAAQ,QAAQ;AAAA,cAChB,SAAS,QAAQ,UAAU;AAAA,cAC3B,OAAO,QAAQ;AAAA,cACf,UAAU,QAAQ;AAAA,cAClB,QAAQ,QAAQ;AAAA,cAChB,MAAM,MAAM,OAAO;AAAA,cACnB,QAAQ,QAAQ;AAAA,cAChB,MAAM,QAAQ;AAAA,cACd,UAAU,QAAQ;AAAA,cAClB,gBAAgB,QAAQ;AAAA,YACzB;AAWA,gBAAI,CAAC,oBAAoB,QAAQ,KAAK,WAAW,KAAK,CAAC,eAAe,QAAQ,KAAK,WAAW,GAAG;AAChG,yBAAW,QAAQ,CAAC,iBAAiB,oBAAoB,UAAU,SAAS,GAAG;AAC9E,+BAAe,QAAQ,OAAO,IAAI;AAAA,cACnC;AAAA,YACD;AAGA,gBAAI,UAAU,eAAe,OAAO,QAAQ,QAAQ,SAAS,gBAAgB,oBAAAD,QAAO,UAAU;AAC7F,qBAAO,IAAI,WAAW,4DAA4D,sBAAsB,CAAC;AACzG,uBAAS;AACT;AAAA,YACD;AAGA,gBAAI,UAAU,eAAe,QAAS,UAAU,eAAe,OAAO,UAAU,eAAe,QAAQ,QAAQ,WAAW,QAAS;AAClI,6BAAe,SAAS;AACxB,6BAAe,OAAO;AACtB,6BAAe,QAAQ,OAAO,gBAAgB;AAAA,YAC/C;AAGA,kBAAM,yBAAyB,8BAA8B,OAAO;AACpE,gBAAI,wBAAwB;AAC3B,6BAAe,iBAAiB;AAAA,YACjC;AAGA,oBAAQ,MAAM,IAAI,QAAQ,aAAa,cAAc,CAAC,CAAC;AACvD,qBAAS;AACT;AAAA,UACD;AAAA,UAEA;AACC,mBAAO,OAAO,IAAI,UAAU,oBAAoB,QAAQ,QAAQ,2CAA2C,CAAC;AAAA,QAC9G;AAAA,MACD;AAGA,UAAI,QAAQ;AACX,kBAAU,KAAK,OAAO,MAAM;AAC3B,iBAAO,oBAAoB,SAAS,gBAAgB;AAAA,QACrD,CAAC;AAAA,MACF;AAEA,UAAI,WAAO,oBAAAE,UAAK,WAAW,IAAI,gCAAY,GAAG,WAAS;AACtD,YAAI,OAAO;AACV,iBAAO,KAAK;AAAA,QACb;AAAA,MACD,CAAC;AAGD,UAAI,QAAQ,UAAU,UAAU;AAC/B,kBAAU,GAAG,WAAW,gBAAgB;AAAA,MACzC;AAEA,YAAM,kBAAkB;AAAA,QACvB,KAAK,QAAQ;AAAA,QACb,QAAQ,UAAU;AAAA,QAClB,YAAY,UAAU;AAAA,QACtB;AAAA,QACA,MAAM,QAAQ;AAAA,QACd,SAAS,QAAQ;AAAA,QACjB,eAAe,QAAQ;AAAA,MACxB;AAGA,YAAM,UAAU,QAAQ,IAAI,kBAAkB;AAU9C,UAAI,CAAC,QAAQ,YAAY,QAAQ,WAAW,UAAU,YAAY,QAAQ,UAAU,eAAe,OAAO,UAAU,eAAe,KAAK;AACvI,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAOA,YAAM,cAAc;AAAA,QACnB,OAAO,iBAAAC,QAAK;AAAA,QACZ,aAAa,iBAAAA,QAAK;AAAA,MACnB;AAGA,UAAI,YAAY,UAAU,YAAY,UAAU;AAC/C,mBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,aAAa,WAAW,GAAG,WAAS;AAC1D,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAGA,UAAI,YAAY,aAAa,YAAY,aAAa;AAGrD,cAAM,UAAM,oBAAAD,UAAK,WAAW,IAAI,gCAAY,GAAG,WAAS;AACvD,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,YAAI,KAAK,QAAQ,WAAS;AAEzB,eAAK,MAAM,CAAC,IAAI,QAAU,GAAM;AAC/B,uBAAO,oBAAAA,UAAK,MAAM,iBAAAC,QAAK,cAAc,GAAG,WAAS;AAChD,kBAAI,OAAO;AACV,uBAAO,KAAK;AAAA,cACb;AAAA,YACD,CAAC;AAAA,UACF,OAAO;AACN,uBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,iBAAiB,GAAG,WAAS;AACnD,kBAAI,OAAO;AACV,uBAAO,KAAK;AAAA,cACb;AAAA,YACD,CAAC;AAAA,UACF;AAEA,qBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,kBAAQ,QAAQ;AAAA,QACjB,CAAC;AACD,YAAI,KAAK,OAAO,MAAM;AAGrB,cAAI,CAAC,UAAU;AACd,uBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,oBAAQ,QAAQ;AAAA,UACjB;AAAA,QACD,CAAC;AACD;AAAA,MACD;AAGA,UAAI,YAAY,MAAM;AACrB,mBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,uBAAuB,GAAG,WAAS;AACzD,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAGA,iBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,cAAQ,QAAQ;AAAA,IACjB,CAAC;AAGD,kBAAc,UAAU,OAAO,EAAE,MAAM,MAAM;AAAA,EAC9C,CAAC;AACF;AAEA,SAAS,oCAAoC,SAAS,eAAe;AACpE,QAAM,aAAa,2BAAO,KAAK,WAAW;AAE1C,MAAI,oBAAoB;AACxB,MAAI,0BAA0B;AAC9B,MAAI;AAEJ,UAAQ,GAAG,YAAY,cAAY;AAClC,UAAM,EAAC,QAAO,IAAI;AAClB,wBAAoB,QAAQ,mBAAmB,MAAM,aAAa,CAAC,QAAQ,gBAAgB;AAAA,EAC5F,CAAC;AAED,UAAQ,GAAG,UAAU,YAAU;AAC9B,UAAM,gBAAgB,MAAM;AAC3B,UAAI,qBAAqB,CAAC,yBAAyB;AAClD,cAAM,QAAQ,IAAI,MAAM,iBAAiB;AACzC,cAAM,OAAO;AACb,sBAAc,KAAK;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,SAAS,SAAO;AACrB,gCAA0B,2BAAO,QAAQ,IAAI,MAAM,EAAE,GAAG,UAAU,MAAM;AAGxE,UAAI,CAAC,2BAA2B,eAAe;AAC9C,kCACC,2BAAO,QAAQ,cAAc,MAAM,EAAE,GAAG,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,KACpE,2BAAO,QAAQ,IAAI,MAAM,EAAE,GAAG,WAAW,MAAM,CAAC,CAAC,MAAM;AAAA,MAEzD;AAEA,sBAAgB;AAAA,IACjB;AAEA,WAAO,gBAAgB,SAAS,aAAa;AAC7C,WAAO,GAAG,QAAQ,MAAM;AAExB,YAAQ,GAAG,SAAS,MAAM;AACzB,aAAO,eAAe,SAAS,aAAa;AAC5C,aAAO,eAAe,QAAQ,MAAM;AAAA,IACrC,CAAC;AAAA,EACF,CAAC;AACF;AAhaA,IAQAC,mBACA,mBACA,kBACAC,qBACAC,qBA0BM;AAtCN;AAAA;AAQA,IAAAF,oBAAiB;AACjB,wBAAkB;AAClB,uBAAiB;AACjB,IAAAC,sBAAoD;AACpD,IAAAC,sBAAqB;AAErB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA,IAAM,mBAAmB,oBAAI,IAAI,CAAC,SAAS,SAAS,QAAQ,CAAC;AAAA;AAAA;;;AC9B7D,SAAS,gBAAgB,KAAK,WAAW,MAAM;AAC7C,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAE7B,MAAI,CAAC,SAAS,MAAM,KAAK,MAAM,IAAI;AACjC,QAAI,UAAU;AACZ,cAAQ,MAAM,iCAAiC,GAAG,sBAAsB;AACxE,aAAO;AAAA,IACT;AACA,YAAQ,KAAK,iCAAiC,GAAG,aAAa;AAC9D,WAAO;AAAA,EACT;AAGA,MAAI,IAAI,SAAS,SAAS,KAAK,MAAM,SAAS,IAAI;AAChD,YAAQ,MAAM,wBAAwB,GAAG,oCAAoC;AAC7E,WAAO;AAAA,EACT;AAEA,SAAO,MAAM,KAAK;AACpB;AASA,SAAS,oBAAoB,YAAY,SAAS,UAAU,MAAM;AAChE,QAAM,WAAW;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,+BAA+B;AAAA,MAC/B,gCAAgC;AAAA,MAChC,gCAAgC;AAAA,IAClC;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,OAAO;AAAA,MACP,GAAI,WAAW,EAAE,QAAQ;AAAA,IAC3B,CAAC;AAAA,EACH;AAGA,UAAQ,MAAM,SAAS,UAAU,KAAK,OAAO,GAAG,UAAU,MAAM,OAAO,KAAK,EAAE,EAAE;AAEhF,SAAO;AACT;AAEA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,QAAM,EAAE,SAASC,OAAM,IAAI,MAAM;AAGjC,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAGA,MAAI,MAAM,eAAe,QAAQ;AAC/B,WAAO,oBAAoB,KAAK,oBAAoB;AAAA,EACtD;AAEA,MAAI;AAEF,QAAI;AACJ,QAAI;AACF,oBAAc,KAAK,MAAM,MAAM,IAAI;AAAA,IACrC,SAAS,YAAY;AACnB,aAAO,oBAAoB,KAAK,gCAAgC,WAAW,OAAO;AAAA,IACpF;AAEA,UAAM,EAAE,UAAU,KAAK,IAAI;AAE3B,QAAI,CAAC,UAAU;AACb,aAAO,oBAAoB,KAAK,4BAA4B;AAAA,IAC9D;AAGA,QAAI,OAAO,aAAa,YAAY,SAAS,KAAK,MAAM,IAAI;AAC1D,aAAO,oBAAoB,KAAK,4BAA4B;AAAA,IAC9D;AAIA,QAAI;AACJ,QAAI,SAAS,WAAW,KAAK,GAAG;AAE9B,kBAAY,6CAA6C,QAAQ;AAAA,IACnE,OAAO;AAEL,kBAAY,6CAA6C,QAAQ;AAAA,IACnE;AAGA,UAAM,SAAS,gBAAgB,kBAAkB,IAAI;AAErD,QAAI,CAAC,QAAQ;AACX,aAAO,oBAAoB,KAAK,mCAAmC;AAAA,IACrE;AAGA,UAAM,gBAAgB,gBAAgB,YAAY,KAAK,MAAM;AAC7D,QAAI,eAAe;AACjB,cAAQ,IAAI,sBAAsB,SAAS,EAAE;AAC7C,cAAQ,IAAI,sBAAsB,OAAO,KAAK,QAAQ,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;AACtE,cAAQ,IAAI,sBAAsB;AAAA,IACpC;AAGA,QAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,aAAO,oBAAoB,KAAK,gCAAgC;AAAA,IAClE;AAGA,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,YAAY,WAAW,MAAM,WAAW,MAAM,GAAG,GAAK;AAE5D,QAAI;AACJ,QAAI;AACF,iBAAW,MAAMA,OAAM,WAAW;AAAA,QAChC,QAAQ;AAAA,QACR,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,aAAa;AAAA,UACb,cAAc;AAAA,QAChB;AAAA,QACA,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC;AAAA,QAC/B,QAAQ,WAAW;AAAA,MACrB,CAAC;AAAA,IACH,SAAS,YAAY;AACnB,mBAAa,SAAS;AACtB,UAAI,WAAW,SAAS,cAAc;AACpC,eAAO,oBAAoB,KAAK,iBAAiB;AAAA,MACnD;AACA,aAAO,oBAAoB,KAAK,mCAAmC,WAAW,OAAO;AAAA,IACvF,UAAE;AACA,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,eAAe;AACjB,cAAQ,IAAI,oBAAoB,SAAS,MAAM,EAAE;AACjD,cAAQ,IAAI,yBAAyB,SAAS,UAAU,EAAE;AAAA,IAC5D;AAGA,QAAI;AACJ,QAAI;AACF,aAAO,MAAM,SAAS,KAAK;AAAA,IAC7B,SAAS,WAAW;AAClB,aAAO,oBAAoB,KAAK,yCAAyC,UAAU,OAAO;AAAA,IAC5F;AAGA,WAAO;AAAA,MACL,YAAY,SAAS;AAAA,MACrB,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,QAChC,iBAAiB;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,IAAI;AAAA,IAC3B;AAAA,EACF,SAAS,OAAO;AAEd,YAAQ,MAAM,mBAAmB;AAAA,MAC/B,SAAS,MAAM;AAAA,MACf,OAAO,MAAM;AAAA,MACb,MAAM,MAAM;AAAA,IACd,CAAC;AAED,WAAO,oBAAoB,KAAK,yBAAyB,MAAM,OAAO;AAAA,EACxE;AACF;", "names": ["i", "noop", "x", "_a", "F", "i", "e", "queueMicrotask", "r", "isAbortSignal", "streamBrandCheckException", "defaultControllerBrandCheckException", "DOMException", "ReadableStream", "POOL_SIZE", "process", "Blob", "clone", "Blob", "size", "File", "F", "f", "e", "FormData", "m", "exports", "module", "fs", "stat", "DOMException", "m", "Body", "f", "i", "clear", "Stream", "toFormData", "import_node_util", "http", "INTERNALS", "import_node_util", "INTERNALS", "formatUrl", "response", "https", "http", "Stream", "s", "pump", "zlib", "import_node_http", "import_node_stream", "import_node_buffer", "fetch"] }
๐Ÿ“„ package.json
{"type":"commonjs"}
๐Ÿ“ sitemap
๐Ÿ“„ ___netlify-telemetry.mjs
var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from"module";const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=>{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lz(e))!uz.call(r,s)&&s!==t&&xu(r,s,{get:()=>e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=>(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,"default",{value:r,enumerable:!0}):t,r)),ee=r=>NR(xu({},"__esModule",{value:!0}),r);var CR,PR=p(()=>{CR=typeof globalThis=="object"?globalThis:global});var IR=p(()=>{PR()});var bR=p(()=>{IR()});var cn,hm=p(()=>{cn="1.9.0"});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&&s.patch<=u.patch?i(l):a(l):s.minor<=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=>{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&&(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&&s!==void 0?s:{version:cn};if(!o&&a[r]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+r+" does not match previously registered API v"+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug("@opentelemetry/api: Registered a global for "+r+" v"+cn+"."),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug("@opentelemetry/api: Unregistering a global for "+r+" v"+cn+".");var t=Fa[Va];t&&delete t[r]}var pz,Va,Fa,Ei=p(()=>{bR();hm();MR();pz=cn.split(".")[0],Va=Symbol.for("opentelemetry.js.api."+pz),Fa=CR});function Ga(r,e,t){var o=xt("diag");if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=>{Ei();dz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||"DiagComponentLogger"}return r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("debug",this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("error",this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("info",this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("warn",this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("verbose",this._namespace,e)},r})()});var H,Mu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(H||(H={}))});function UR(r,e){r<H.NONE?r=H.NONE:r>H.ALL&&(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a=="function"&&r>=s?a.bind(e):function(){}}return{error:t("error",H.ERROR),warn:t("warn",H.WARN),info:t("info",H.INFO),debug:t("debug",H.DEBUG),verbose:t("verbose",H.VERBOSE)}}var kR=p(()=>{Mu()});var _z,Ez,mz,ft,mi=p(()=>{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz="diag",ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var n=xt("diag");if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&&(a={logLevel:H.INFO}),s===t){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((i=c.stack)!==null&&i!==void 0?i:c.message),!1}typeof a=="number"&&(a={logLevel:a});var u=xt("diag"),f=UR((n=a.logLevel)!==null&&n!==void 0?n:H.INFO,s);if(u&&!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+_),f.warn("Current logger will overwrite one already registered from "+_)}return Ir("diag",f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=>{Tz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=>{FR=Symbol("BaggageEntryMetadata")});function HR(r){return r===void 0&&(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!="string"&&(gz.error("Cannot create baggage metadata from unknown type: "+typeof r),r=""),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=>{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=>{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=>{Em=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!="function"&&(i=console.log),typeof i=="function")return i.apply(console,s)}}}for(var t=0;t<Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=>{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=>{(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=>{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&&(r[e]=t)}}});var kz,Bz,YR,zR=p(()=>{Ha();kz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=>{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm="context",Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=>{ym();ja="0000000000000000",Ya="00000000000000000000000000000000",Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=>{Fu();Pn=(function(){function r(e){e===void 0&&(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=>{Ha();Gu();qa();Om=De("OpenTelemetry Context Key SPAN")});function Mt(r){return Hz.test(r)&&r!==Ya}function Si(r){return qz.test(r)&&r!==ja}function xe(r){return Mt(r.traceId)&&Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=>{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r=="object"&&typeof r.spanId=="string"&&typeof r.traceId=="string"&&typeof r.traceFlags=="number"}var Rm,Yu,Nm=p(()=>{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&&(o=Rm.active());var s=!!(t!=null&&t.root);if(s)return new Pn;var a=o&&qu(o);return jz(a)&&xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length<2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=>{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=>{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=>{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&&s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(ke||(ke={}))});var qt,eN=p(()=>{(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(qt||(qt={}))});var jt,tN=p(()=>{(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&&!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=>{Im="[_0-9a-z-*/]",Kz="[a-z]"+Im+"{0,255}",$z="[a-z0-9]"+Im+"{0,240}@[a-z]"+Im+"{0,13}",Xz=new RegExp("^(?:"+Kz+"|"+$z+")$"),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=>{iN();oN=32,Qz=512,sN=",",aN="=",lN=(function(){function r(e){this._internalState=new Map,e&&this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length>Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&&nN(n)&&t.set(i,n)}return t},new Map),this._internalState.size>oN&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=>{cN()});var he,pN=p(()=>{qa();he=Cn.getInstance()});var S,dN=p(()=>{mi();S=ft.instance()});var Zz,hN,_N=p(()=>{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=>{_N();Ei();mi();bm="metrics",EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=>{mN();gi=EN.getInstance()});var SN,gN=p(()=>{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=>{qa();Ha();Lm=De("OpenTelemetry Baggage Key")});var Mm,eK,RN,NN=p(()=>{Ei();gN();gm();AN();_m();mi();Mm="propagation",eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&&(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&&(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=>{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=>{Ei();Pm();ju();Am();mi();wm="trace",PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=>{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=>Du,DiagLogLevel:()=>H,INVALID_SPANID:()=>ja,INVALID_SPAN_CONTEXT:()=>Uo,INVALID_TRACEID:()=>Ya,ProxyTracer:()=>zu,ProxyTracerProvider:()=>Ka,ROOT_CONTEXT:()=>wu,SamplingDecision:()=>ke,SpanKind:()=>qt,SpanStatusCode:()=>jt,TraceFlags:()=>se,ValueType:()=>Ot,baggageEntryMetadataFromString:()=>Lr,context:()=>he,createContextKey:()=>De,createNoopMeter:()=>ku,createTraceState:()=>uN,default:()=>tK,defaultTextMapGetter:()=>Bu,defaultTextMapSetter:()=>Vu,diag:()=>S,isSpanContextValid:()=>xe,isValidSpanId:()=>Si,isValidTraceId:()=>Mt,metrics:()=>gi,propagation:()=>Ue,trace:()=>ie});var tK,P=p(()=>{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o<t;o++){var s=r[o];s&&(e[String(s).toUpperCase().replace(/[-.]/g,"_")]=s)}return e}var Dm=p(()=>{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=>{Dm();MN="aws.lambda.invoked_arn",wN="db.system",DN="db.connection_string",UN="db.user",kN="db.jdbc.driver_classname",BN="db.name",VN="db.statement",FN="db.operation",GN="db.mssql.instance_name",HN="db.cassandra.keyspace",qN="db.cassandra.page_size",jN="db.cassandra.consistency_level",YN="db.cassandra.table",zN="db.cassandra.idempotence",KN="db.cassandra.speculative_execution_count",$N="db.cassandra.coordinator.id",XN="db.cassandra.coordinator.dc",WN="db.hbase.namespace",JN="db.redis.database_index",QN="db.mongodb.collection",ZN="db.sql.table",eC="exception.type",tC="exception.message",rC="exception.stacktrace",nC="exception.escaped",iC="faas.trigger",oC="faas.execution",sC="faas.document.collection",aC="faas.document.operation",lC="faas.document.time",cC="faas.document.name",uC="faas.time",fC="faas.cron",pC="faas.coldstart",dC="faas.invoked_name",hC="faas.invoked_provider",_C="faas.invoked_region",EC="net.transport",mC="net.peer.ip",TC="net.peer.port",SC="net.peer.name",gC="net.host.ip",vC="net.host.port",yC="net.host.name",OC="net.host.connection.type",AC="net.host.connection.subtype",RC="net.host.carrier.name",NC="net.host.carrier.mcc",CC="net.host.carrier.mnc",PC="net.host.carrier.icc",IC="peer.service",bC="enduser.id",LC="enduser.role",xC="enduser.scope",MC="thread.id",wC="thread.name",DC="code.function",UC="code.namespace",kC="code.filepath",BC="code.lineno",VC="http.method",FC="http.url",GC="http.target",HC="http.host",qC="http.scheme",jC="http.status_code",YC="http.flavor",zC="http.user_agent",KC="http.request_content_length",$C="http.request_content_length_uncompressed",XC="http.response_content_length",WC="http.response_content_length_uncompressed",JC="http.server_name",QC="http.route",ZC="http.client_ip",eP="aws.dynamodb.table_names",tP="aws.dynamodb.consumed_capacity",rP="aws.dynamodb.item_collection_metrics",nP="aws.dynamodb.provisioned_read_capacity",iP="aws.dynamodb.provisioned_write_capacity",oP="aws.dynamodb.consistent_read",sP="aws.dynamodb.projection",aP="aws.dynamodb.limit",lP="aws.dynamodb.attributes_to_get",cP="aws.dynamodb.index_name",uP="aws.dynamodb.select",fP="aws.dynamodb.global_secondary_indexes",pP="aws.dynamodb.local_secondary_indexes",dP="aws.dynamodb.exclusive_start_table",hP="aws.dynamodb.table_count",_P="aws.dynamodb.scan_forward",EP="aws.dynamodb.segment",mP="aws.dynamodb.total_segments",TP="aws.dynamodb.count",SP="aws.dynamodb.scanned_count",gP="aws.dynamodb.attribute_definitions",vP="aws.dynamodb.global_secondary_index_updates",yP="messaging.system",OP="messaging.destination",AP="messaging.destination_kind",RP="messaging.temp_destination",NP="messaging.protocol",CP="messaging.protocol_version",PP="messaging.url",IP="messaging.message_id",bP="messaging.conversation_id",LP="messaging.message_payload_size_bytes",xP="messaging.message_payload_compressed_size_bytes",MP="messaging.operation",wP="messaging.consumer_id",DP="messaging.rabbitmq.routing_key",UP="messaging.kafka.message_key",kP="messaging.kafka.consumer_group",BP="messaging.kafka.client_id",VP="messaging.kafka.partition",FP="messaging.kafka.tombstone",GP="rpc.system",HP="rpc.service",qP="rpc.method",jP="rpc.grpc.status_code",YP="rpc.jsonrpc.version",zP="rpc.jsonrpc.request_id",KP="rpc.jsonrpc.error_code",$P="rpc.jsonrpc.error_message",XP="message.type",WP="message.id",JP="message.compressed_size",QP="message.uncompressed_size",rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP="other_sql",eI="mssql",tI="mysql",rI="oracle",nI="db2",iI="postgresql",oI="redshift",sI="hive",aI="cloudscape",lI="hsqldb",cI="progress",uI="maxdb",fI="hanadb",pI="ingres",dI="firstsql",hI="edb",_I="cache",EI="adabas",mI="firebird",TI="derby",SI="filemaker",gI="informix",vI="instantdb",yI="interbase",OI="mariadb",AI="netezza",RI="pervasive",NI="pointbase",CI="sqlite",PI="sybase",II="teradata",bI="vertica",LI="h2",xI="coldfusion",MI="cassandra",wI="hbase",DI="mongodb",UI="redis",kI="couchbase",BI="couchdb",VI="cosmosdb",FI="dynamodb",GI="neo4j",HI="geode",qI="elasticsearch",jI="memcached",YI="cockroachdb",gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI="all",KI="each_quorum",$I="quorum",XI="local_quorum",WI="one",JI="two",QI="three",ZI="local_one",eb="any",tb="serial",rb="local_serial",hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb="datasource",ib="http",ob="pubsub",sb="timer",ab="other",NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb="insert",cb="edit",ub="delete",xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb="alibaba_cloud",pb="aws",db="azure",hb="gcp",UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b="ip_tcp",Eb="ip_udp",mb="ip",Tb="unix",Sb="pipe",gb="inproc",vb="other",GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb="wifi",Ob="wired",Ab="cell",Rb="unavailable",Nb="unknown",XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb="gprs",Pb="edge",Ib="umts",bb="cdma",Lb="evdo_0",xb="evdo_a",Mb="cdma2000_1xrtt",wb="hsdpa",Db="hsupa",Ub="hspa",kb="iden",Bb="evdo_b",Vb="lte",Fb="ehrpd",Gb="hspap",Hb="gsm",qb="td_scdma",jb="iwlan",Yb="nr",zb="nrnsa",Kb="lte_ca",t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b="1.0",Xb="1.1",Wb="2.0",Jb="SPDY",Qb="QUIC",O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb="queue",eL="topic",I8=Zb,b8=eL,L8=Be([Zb,eL]),tL="receive",rL="process",x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL="SENT",vL="RECEIVED",Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=>{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=>{Dm();AL="cloud.provider",RL="cloud.account.id",NL="cloud.region",CL="cloud.availability_zone",PL="cloud.platform",IL="aws.ecs.container.arn",bL="aws.ecs.cluster.arn",LL="aws.ecs.launchtype",xL="aws.ecs.task.arn",ML="aws.ecs.task.family",wL="aws.ecs.task.revision",DL="aws.eks.cluster.arn",UL="aws.log.group.names",kL="aws.log.group.arns",BL="aws.log.stream.names",VL="aws.log.stream.arns",FL="container.name",GL="container.id",HL="container.runtime",qL="container.image.name",jL="container.image.tag",YL="deployment.environment",zL="device.id",KL="device.model.identifier",$L="device.model.name",XL="faas.name",WL="faas.id",JL="faas.version",QL="faas.instance",ZL="faas.max_memory",e0="host.id",t0="host.name",r0="host.type",n0="host.arch",i0="host.image.name",o0="host.image.id",s0="host.image.version",a0="k8s.cluster.name",l0="k8s.node.name",c0="k8s.node.uid",u0="k8s.namespace.name",f0="k8s.pod.uid",p0="k8s.pod.name",d0="k8s.container.name",h0="k8s.replicaset.uid",_0="k8s.replicaset.name",E0="k8s.deployment.uid",m0="k8s.deployment.name",T0="k8s.statefulset.uid",S0="k8s.statefulset.name",g0="k8s.daemonset.uid",v0="k8s.daemonset.name",y0="k8s.job.uid",O0="k8s.job.name",A0="k8s.cronjob.uid",R0="k8s.cronjob.name",N0="os.type",C0="os.description",P0="os.name",I0="os.version",b0="process.pid",L0="process.executable.name",x0="process.executable.path",M0="process.command",w0="process.command_line",D0="process.command_args",U0="process.owner",k0="process.runtime.name",B0="process.runtime.version",V0="process.runtime.description",F0="service.name",G0="service.namespace",H0="service.instance.id",q0="service.version",j0="telemetry.sdk.name",Y0="telemetry.sdk.language",z0="telemetry.sdk.version",K0="telemetry.auto.version",$0="webengine.name",X0="webengine.version",W0="webengine.description",r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0="alibaba_cloud",Q0="aws",Z0="azure",ex="gcp",f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx="alibaba_cloud_ecs",rx="alibaba_cloud_fc",nx="aws_ec2",ix="aws_ecs",ox="aws_eks",sx="aws_lambda",ax="aws_elastic_beanstalk",lx="azure_vm",cx="azure_container_instances",ux="azure_aks",fx="azure_functions",px="azure_app_service",dx="gcp_compute_engine",hx="gcp_cloud_run",_x="gcp_kubernetes_engine",Ex="gcp_cloud_functions",mx="gcp_app_engine",E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx="ec2",Sx="fargate",w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx="amd64",vx="arm32",yx="arm64",Ox="ia64",Ax="ppc32",Rx="ppc64",Nx="x86",k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx="windows",Px="linux",Ix="darwin",bx="freebsd",Lx="netbsd",xx="openbsd",Mx="dragonflybsd",wx="hpux",Dx="aix",Ux="solaris",kx="z_os",Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx="cpp",Vx="dotnet",Fx="erlang",Gx="go",Hx="java",qx="nodejs",jx="php",Yx="python",zx="ruby",Kx="webjs",n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=>{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=>{d9="aspnetcore.rate_limiting.result",h9="acquired",_9="endpoint_limiter",E9="global_limiter",m9="request_canceled",T9="telemetry.sdk.language",S9="cpp",g9="dotnet",v9="erlang",y9="go",O9="java",A9="nodejs",R9="php",N9="python",C9="ruby",P9="rust",I9="swift",b9="webjs",L9="telemetry.sdk.name",x9="telemetry.sdk.version",M9="aspnetcore.diagnostics.handler.type",w9="aspnetcore.diagnostics.exception.result",D9="aborted",U9="handled",k9="skipped",B9="unhandled",V9="aspnetcore.rate_limiting.policy",F9="aspnetcore.request.is_unhandled",G9="aspnetcore.routing.is_fallback",H9="aspnetcore.routing.match_status",q9="failure",j9="success",Y9="client.address",z9="client.port",K9="error.type",$9="_OTHER",X9="exception.escaped",W9="exception.message",J9="exception.stacktrace",Q9="exception.type",Z9=function(r){return"http.request.header."+r},eJ="http.request.method",tJ="_OTHER",rJ="CONNECT",nJ="DELETE",iJ="GET",oJ="HEAD",sJ="OPTIONS",aJ="PATCH",lJ="POST",cJ="PUT",uJ="TRACE",fJ="http.request.method_original",pJ="http.request.resend_count",dJ=function(r){return"http.response.header."+r},hJ="http.response.status_code",_J="http.route",EJ="jvm.gc.action",mJ="jvm.gc.name",TJ="jvm.memory.pool.name",SJ="jvm.memory.type",gJ="heap",vJ="non_heap",yJ="jvm.thread.daemon",OJ="jvm.thread.state",AJ="blocked",RJ="new",NJ="runnable",CJ="terminated",PJ="timed_waiting",IJ="waiting",bJ="network.local.address",LJ="network.local.port",xJ="network.peer.address",MJ="network.peer.port",wJ="network.protocol.name",DJ="network.protocol.version",UJ="network.transport",kJ="pipe",BJ="quic",VJ="tcp",FJ="udp",GJ="unix",HJ="network.type",qJ="ipv4",jJ="ipv6",YJ="otel.scope.name",zJ="otel.scope.version",KJ="otel.status_code",$J="ERROR",XJ="OK",WJ="otel.status_description",JJ="server.address",QJ="server.port",ZJ="service.name",eQ="service.version",tQ="signalr.connection.status",rQ="app_shutdown",nQ="normal_closure",iQ="timeout",oQ="signalr.transport",sQ="long_polling",aQ="server_sent_events",lQ="web_sockets",cQ="url.fragment",uQ="url.full",fQ="url.path",pQ="url.query",dQ="url.scheme",hQ="user_agent.original"});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=>{_Q="aspnetcore.diagnostics.exceptions",EQ="aspnetcore.rate_limiting.active_request_leases",mQ="aspnetcore.rate_limiting.queued_requests",TQ="aspnetcore.rate_limiting.request.time_in_queue",SQ="aspnetcore.rate_limiting.request_lease.duration",gQ="aspnetcore.rate_limiting.requests",vQ="aspnetcore.routing.match_attempts",yQ="http.client.request.duration",OQ="http.server.request.duration",AQ="jvm.class.count",RQ="jvm.class.loaded",NQ="jvm.class.unloaded",CQ="jvm.cpu.count",PQ="jvm.cpu.recent_utilization",IQ="jvm.cpu.time",bQ="jvm.gc.duration",LQ="jvm.memory.committed",xQ="jvm.memory.limit",MQ="jvm.memory.used",wQ="jvm.memory.used_after_last_gc",DQ="jvm.thread.count",UQ="kestrel.active_connections",kQ="kestrel.active_tls_handshakes",BQ="kestrel.connection.duration",VQ="kestrel.queued_connections",FQ="kestrel.queued_requests",GQ="kestrel.rejected_connections",HQ="kestrel.tls_handshake.duration",qQ="kestrel.upgraded_connections",jQ="signalr.server.active_connections",YQ="signalr.server.connection.duration"});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>H9,ATTR_CLIENT_ADDRESS:()=>Y9,ATTR_CLIENT_PORT:()=>z9,ATTR_ERROR_TYPE:()=>K9,ATTR_EXCEPTION_ESCAPED:()=>X9,ATTR_EXCEPTION_MESSAGE:()=>W9,ATTR_EXCEPTION_STACKTRACE:()=>J9,ATTR_EXCEPTION_TYPE:()=>Q9,ATTR_HTTP_REQUEST_HEADER:()=>Z9,ATTR_HTTP_REQUEST_METHOD:()=>eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>pJ,ATTR_HTTP_RESPONSE_HEADER:()=>dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>hJ,ATTR_HTTP_ROUTE:()=>_J,ATTR_JVM_GC_ACTION:()=>EJ,ATTR_JVM_GC_NAME:()=>mJ,ATTR_JVM_MEMORY_POOL_NAME:()=>TJ,ATTR_JVM_MEMORY_TYPE:()=>SJ,ATTR_JVM_THREAD_DAEMON:()=>yJ,ATTR_JVM_THREAD_STATE:()=>OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=>bJ,ATTR_NETWORK_LOCAL_PORT:()=>LJ,ATTR_NETWORK_PEER_ADDRESS:()=>xJ,ATTR_NETWORK_PEER_PORT:()=>MJ,ATTR_NETWORK_PROTOCOL_NAME:()=>wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=>DJ,ATTR_NETWORK_TRANSPORT:()=>UJ,ATTR_NETWORK_TYPE:()=>HJ,ATTR_OTEL_SCOPE_NAME:()=>YJ,ATTR_OTEL_SCOPE_VERSION:()=>zJ,ATTR_OTEL_STATUS_CODE:()=>KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=>WJ,ATTR_SERVER_ADDRESS:()=>JJ,ATTR_SERVER_PORT:()=>QJ,ATTR_SERVICE_NAME:()=>ZJ,ATTR_SERVICE_VERSION:()=>eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=>tQ,ATTR_SIGNALR_TRANSPORT:()=>oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=>T9,ATTR_TELEMETRY_SDK_NAME:()=>L9,ATTR_TELEMETRY_SDK_VERSION:()=>x9,ATTR_URL_FRAGMENT:()=>cQ,ATTR_URL_FULL:()=>uQ,ATTR_URL_PATH:()=>fQ,ATTR_URL_QUERY:()=>pQ,ATTR_URL_SCHEME:()=>dQ,ATTR_USER_AGENT_ORIGINAL:()=>hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=>w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>D7,AwsEcsLaunchtypeValues:()=>U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>m7,CLOUDPLATFORMVALUES_AWS_EC2:()=>T7,CLOUDPLATFORMVALUES_AWS_ECS:()=>S7,CLOUDPLATFORMVALUES_AWS_EKS:()=>g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=>R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>N7,CLOUDPLATFORMVALUES_AZURE_VM:()=>O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>f7,CLOUDPROVIDERVALUES_AWS:()=>p7,CLOUDPROVIDERVALUES_AZURE:()=>d7,CLOUDPROVIDERVALUES_GCP:()=>h7,CloudPlatformValues:()=>M7,CloudProviderValues:()=>_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>SW,DBSYSTEMVALUES_ADABAS:()=>kX,DBSYSTEMVALUES_CACHE:()=>UX,DBSYSTEMVALUES_CASSANDRA:()=>eW,DBSYSTEMVALUES_CLOUDSCAPE:()=>PX,DBSYSTEMVALUES_COCKROACHDB:()=>pW,DBSYSTEMVALUES_COLDFUSION:()=>ZX,DBSYSTEMVALUES_COSMOSDB:()=>sW,DBSYSTEMVALUES_COUCHBASE:()=>iW,DBSYSTEMVALUES_COUCHDB:()=>oW,DBSYSTEMVALUES_DB2:()=>AX,DBSYSTEMVALUES_DERBY:()=>VX,DBSYSTEMVALUES_DYNAMODB:()=>aW,DBSYSTEMVALUES_EDB:()=>DX,DBSYSTEMVALUES_ELASTICSEARCH:()=>uW,DBSYSTEMVALUES_FILEMAKER:()=>FX,DBSYSTEMVALUES_FIREBIRD:()=>BX,DBSYSTEMVALUES_FIRSTSQL:()=>wX,DBSYSTEMVALUES_GEODE:()=>cW,DBSYSTEMVALUES_H2:()=>QX,DBSYSTEMVALUES_HANADB:()=>xX,DBSYSTEMVALUES_HBASE:()=>tW,DBSYSTEMVALUES_HIVE:()=>CX,DBSYSTEMVALUES_HSQLDB:()=>IX,DBSYSTEMVALUES_INFORMIX:()=>GX,DBSYSTEMVALUES_INGRES:()=>MX,DBSYSTEMVALUES_INSTANTDB:()=>HX,DBSYSTEMVALUES_INTERBASE:()=>qX,DBSYSTEMVALUES_MARIADB:()=>jX,DBSYSTEMVALUES_MAXDB:()=>LX,DBSYSTEMVALUES_MEMCACHED:()=>fW,DBSYSTEMVALUES_MONGODB:()=>rW,DBSYSTEMVALUES_MSSQL:()=>vX,DBSYSTEMVALUES_MYSQL:()=>yX,DBSYSTEMVALUES_NEO4J:()=>lW,DBSYSTEMVALUES_NETEZZA:()=>YX,DBSYSTEMVALUES_ORACLE:()=>OX,DBSYSTEMVALUES_OTHER_SQL:()=>gX,DBSYSTEMVALUES_PERVASIVE:()=>zX,DBSYSTEMVALUES_POINTBASE:()=>KX,DBSYSTEMVALUES_POSTGRESQL:()=>RX,DBSYSTEMVALUES_PROGRESS:()=>bX,DBSYSTEMVALUES_REDIS:()=>nW,DBSYSTEMVALUES_REDSHIFT:()=>NX,DBSYSTEMVALUES_SQLITE:()=>$X,DBSYSTEMVALUES_SYBASE:()=>XX,DBSYSTEMVALUES_TERADATA:()=>WX,DBSYSTEMVALUES_VERTICA:()=>JX,DbCassandraConsistencyLevelValues:()=>RW,DbSystemValues:()=>dW,ERROR_TYPE_VALUE_OTHER:()=>$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>UW,FAASINVOKEDPROVIDERVALUES_AWS:()=>kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=>BW,FAASINVOKEDPROVIDERVALUES_GCP:()=>VW,FAASTRIGGERVALUES_DATASOURCE:()=>NW,FAASTRIGGERVALUES_HTTP:()=>CW,FAASTRIGGERVALUES_OTHER:()=>bW,FAASTRIGGERVALUES_PUBSUB:()=>PW,FAASTRIGGERVALUES_TIMER:()=>IW,FaasDocumentOperationValues:()=>DW,FaasInvokedProviderValues:()=>FW,FaasTriggerValues:()=>LW,HOSTARCHVALUES_AMD64:()=>k7,HOSTARCHVALUES_ARM32:()=>B7,HOSTARCHVALUES_ARM64:()=>V7,HOSTARCHVALUES_IA64:()=>F7,HOSTARCHVALUES_PPC32:()=>G7,HOSTARCHVALUES_PPC64:()=>H7,HOSTARCHVALUES_X86:()=>q7,HTTPFLAVORVALUES_HTTP_1_0:()=>O8,HTTPFLAVORVALUES_HTTP_1_1:()=>A8,HTTPFLAVORVALUES_HTTP_2_0:()=>R8,HTTPFLAVORVALUES_QUIC:()=>C8,HTTPFLAVORVALUES_SPDY:()=>N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=>iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=>lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=>cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>uJ,HostArchValues:()=>j7,HttpFlavorValues:()=>P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=>gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=>AJ,JVM_THREAD_STATE_VALUE_NEW:()=>RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=>CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>PJ,JVM_THREAD_STATE_VALUE_WAITING:()=>IJ,MESSAGETYPEVALUES_RECEIVED:()=>e5,MESSAGETYPEVALUES_SENT:()=>Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>b8,MESSAGINGOPERATIONVALUES_PROCESS:()=>M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=>x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>OQ,METRIC_JVM_CLASS_COUNT:()=>AQ,METRIC_JVM_CLASS_LOADED:()=>RQ,METRIC_JVM_CLASS_UNLOADED:()=>NQ,METRIC_JVM_CPU_COUNT:()=>CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>PQ,METRIC_JVM_CPU_TIME:()=>IQ,METRIC_JVM_GC_DURATION:()=>bQ,METRIC_JVM_MEMORY_COMMITTED:()=>LQ,METRIC_JVM_MEMORY_LIMIT:()=>xQ,METRIC_JVM_MEMORY_USED:()=>MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>wQ,METRIC_JVM_THREAD_COUNT:()=>DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>kQ,METRIC_KESTREL_CONNECTION_DURATION:()=>BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=>FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>YQ,MessageTypeValues:()=>t5,MessagingDestinationKindValues:()=>L8,MessagingOperationValues:()=>w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>WW,NETTRANSPORTVALUES_INPROC:()=>zW,NETTRANSPORTVALUES_IP:()=>qW,NETTRANSPORTVALUES_IP_TCP:()=>GW,NETTRANSPORTVALUES_IP_UDP:()=>HW,NETTRANSPORTVALUES_OTHER:()=>KW,NETTRANSPORTVALUES_PIPE:()=>YW,NETTRANSPORTVALUES_UNIX:()=>jW,NETWORK_TRANSPORT_VALUE_PIPE:()=>kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=>BJ,NETWORK_TRANSPORT_VALUE_TCP:()=>VJ,NETWORK_TRANSPORT_VALUE_UDP:()=>FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=>GJ,NETWORK_TYPE_VALUE_IPV4:()=>qJ,NETWORK_TYPE_VALUE_IPV6:()=>jJ,NetHostConnectionSubtypeValues:()=>y8,NetHostConnectionTypeValues:()=>e8,NetTransportValues:()=>$W,OSTYPEVALUES_AIX:()=>Z7,OSTYPEVALUES_DARWIN:()=>K7,OSTYPEVALUES_DRAGONFLYBSD:()=>J7,OSTYPEVALUES_FREEBSD:()=>$7,OSTYPEVALUES_HPUX:()=>Q7,OSTYPEVALUES_LINUX:()=>z7,OSTYPEVALUES_NETBSD:()=>X7,OSTYPEVALUES_OPENBSD:()=>W7,OSTYPEVALUES_SOLARIS:()=>e9,OSTYPEVALUES_WINDOWS:()=>Y7,OSTYPEVALUES_Z_OS:()=>t9,OTEL_STATUS_CODE_VALUE_ERROR:()=>$J,OTEL_STATUS_CODE_VALUE_OK:()=>XJ,OsTypeValues:()=>r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>F8,RPCGRPCSTATUSCODEVALUES_OK:()=>D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>k8,RpcGrpcStatusCodeValues:()=>Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=>B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=>b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>rK,SEMATTRS_CODE_FILEPATH:()=>n$,SEMATTRS_CODE_FUNCTION:()=>t$,SEMATTRS_CODE_LINENO:()=>i$,SEMATTRS_CODE_NAMESPACE:()=>r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>EK,SEMATTRS_DB_CASSANDRA_TABLE:()=>hK,SEMATTRS_DB_CONNECTION_STRING:()=>iK,SEMATTRS_DB_HBASE_NAMESPACE:()=>SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>sK,SEMATTRS_DB_MONGODB_COLLECTION:()=>vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>uK,SEMATTRS_DB_NAME:()=>aK,SEMATTRS_DB_OPERATION:()=>cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>gK,SEMATTRS_DB_SQL_TABLE:()=>yK,SEMATTRS_DB_STATEMENT:()=>lK,SEMATTRS_DB_SYSTEM:()=>nK,SEMATTRS_DB_USER:()=>oK,SEMATTRS_ENDUSER_ID:()=>WK,SEMATTRS_ENDUSER_ROLE:()=>JK,SEMATTRS_ENDUSER_SCOPE:()=>QK,SEMATTRS_EXCEPTION_ESCAPED:()=>OK,SEMATTRS_EXCEPTION_MESSAGE:()=>Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=>Um,SEMATTRS_EXCEPTION_TYPE:()=>Xa,SEMATTRS_FAAS_COLDSTART:()=>xK,SEMATTRS_FAAS_CRON:()=>LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=>IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=>PK,SEMATTRS_FAAS_EXECUTION:()=>RK,SEMATTRS_FAAS_INVOKED_NAME:()=>MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>wK,SEMATTRS_FAAS_INVOKED_REGION:()=>DK,SEMATTRS_FAAS_TIME:()=>bK,SEMATTRS_FAAS_TRIGGER:()=>AK,SEMATTRS_HTTP_CLIENT_IP:()=>S$,SEMATTRS_HTTP_FLAVOR:()=>f$,SEMATTRS_HTTP_HOST:()=>l$,SEMATTRS_HTTP_METHOD:()=>o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>E$,SEMATTRS_HTTP_ROUTE:()=>T$,SEMATTRS_HTTP_SCHEME:()=>c$,SEMATTRS_HTTP_SERVER_NAME:()=>m$,SEMATTRS_HTTP_STATUS_CODE:()=>u$,SEMATTRS_HTTP_TARGET:()=>a$,SEMATTRS_HTTP_URL:()=>s$,SEMATTRS_HTTP_USER_AGENT:()=>p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>mX,SEMATTRS_MESSAGE_ID:()=>EX,SEMATTRS_MESSAGE_TYPE:()=>_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=>eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>W$,SEMATTRS_MESSAGING_DESTINATION:()=>q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=>X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>J$,SEMATTRS_MESSAGING_OPERATION:()=>Z$,SEMATTRS_MESSAGING_PROTOCOL:()=>z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>tX,SEMATTRS_MESSAGING_SYSTEM:()=>H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Y$,SEMATTRS_MESSAGING_URL:()=>$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=>$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=>zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=>KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=>YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>qK,SEMATTRS_NET_HOST_IP:()=>FK,SEMATTRS_NET_HOST_NAME:()=>HK,SEMATTRS_NET_HOST_PORT:()=>GK,SEMATTRS_NET_PEER_IP:()=>kK,SEMATTRS_NET_PEER_NAME:()=>VK,SEMATTRS_NET_PEER_PORT:()=>BK,SEMATTRS_NET_TRANSPORT:()=>UK,SEMATTRS_PEER_SERVICE:()=>XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pX,SEMATTRS_RPC_JSONRPC_VERSION:()=>fX,SEMATTRS_RPC_METHOD:()=>cX,SEMATTRS_RPC_SERVICE:()=>lX,SEMATTRS_RPC_SYSTEM:()=>aX,SEMATTRS_THREAD_ID:()=>ZK,SEMATTRS_THREAD_NAME:()=>e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>o5,SEMRESATTRS_CLOUD_PLATFORM:()=>s5,SEMRESATTRS_CLOUD_PROVIDER:()=>r5,SEMRESATTRS_CLOUD_REGION:()=>i5,SEMRESATTRS_CONTAINER_ID:()=>S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>y5,SEMRESATTRS_CONTAINER_NAME:()=>T5,SEMRESATTRS_CONTAINER_RUNTIME:()=>g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>O5,SEMRESATTRS_DEVICE_ID:()=>A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=>N5,SEMRESATTRS_FAAS_ID:()=>P5,SEMRESATTRS_FAAS_INSTANCE:()=>b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=>L5,SEMRESATTRS_FAAS_NAME:()=>C5,SEMRESATTRS_FAAS_VERSION:()=>I5,SEMRESATTRS_HOST_ARCH:()=>Vm,SEMRESATTRS_HOST_ID:()=>km,SEMRESATTRS_HOST_IMAGE_ID:()=>w5,SEMRESATTRS_HOST_IMAGE_NAME:()=>M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=>D5,SEMRESATTRS_HOST_NAME:()=>Bm,SEMRESATTRS_HOST_TYPE:()=>x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=>U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=>H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=>e7,SEMRESATTRS_K8S_CRONJOB_UID:()=>Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=>X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Y5,SEMRESATTRS_K8S_JOB_NAME:()=>Q5,SEMRESATTRS_K8S_JOB_UID:()=>J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>V5,SEMRESATTRS_K8S_NODE_NAME:()=>k5,SEMRESATTRS_K8S_NODE_UID:()=>B5,SEMRESATTRS_K8S_POD_NAME:()=>G5,SEMRESATTRS_K8S_POD_UID:()=>F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=>j5,SEMRESATTRS_K8S_REPLICASET_UID:()=>q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=>K5,SEMRESATTRS_OS_DESCRIPTION:()=>t7,SEMRESATTRS_OS_NAME:()=>r7,SEMRESATTRS_OS_TYPE:()=>Fm,SEMRESATTRS_OS_VERSION:()=>Gm,SEMRESATTRS_PROCESS_COMMAND:()=>Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>jm,SEMRESATTRS_PROCESS_OWNER:()=>Km,SEMRESATTRS_PROCESS_PID:()=>Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>$m,SEMRESATTRS_SERVICE_NAME:()=>at,SEMRESATTRS_SERVICE_NAMESPACE:()=>i7,SEMRESATTRS_SERVICE_VERSION:()=>o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>c7,SEMRESATTRS_WEBENGINE_NAME:()=>a7,SEMRESATTRS_WEBENGINE_VERSION:()=>l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>lQ,SemanticAttributes:()=>SX,SemanticResourceAttributes:()=>u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=>s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>b9,TelemetrySdkLanguageValues:()=>p9});var Ve=p(()=>{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=>{P();Zm=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Zu,SM=p(()=>{Zu="baggage"});function tf(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function rf(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function il(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>il(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var eT=p(()=>{P()});var nf,yM=p(()=>{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=>n.length<=4096).slice(0,180),i=tf(a);i.length>0&&o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=il(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=>{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r=="string"&&r.length>0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var NM=p(()=>{P()});function sf(){return r=>{S.error(EZ(r))}}function EZ(r){return typeof r=="string"?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=>{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=>{nT();CM=sf()});var Vo,oT=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)>-1}function yZ(r){return vZ.indexOf(r)>-1}function AZ(r){return OZ.indexOf(r)>-1}function RZ(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o=="string"){let s=PZ[o.toUpperCase()];s!=null&&(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case"OTEL_LOG_LEVEL":IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=>{P();oT();TZ=",",SZ=["OTEL_SDK_DISABLED"];vZ=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];OZ=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=>{lT()});var cf,bM=p(()=>{cf=typeof globalThis=="object"?globalThis:global});function LM(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var cT=p(()=>{});function ff(r){return Buffer.from(uf(r)).toString("base64")}var xM=p(()=>{cT()});function MM(r){return function(){for(let t=0;t<r/4;t++)pf.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(pf[t]>0);t++)t===r-1&&(pf[r-1]=1);return pf.toString("hex",0,r)}}var Go,pf,wM=p(()=>{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from"perf_hooks";var In,DM=p(()=>{In=bZ});var df,uT=p(()=>{df="1.29.0"});var bn,UM=p(()=>{uT();Ve();bn={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=>{});var BM=p(()=>{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=>{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!="number"){let e=In;r=e.timing&&e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r=="number"?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r=="number")return r<Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError("Invalid input type")}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function zM(r){return mf(r)||typeof r=="number"||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=_f&&(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=>{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Tf||(Tf={}))});var Sf,XM=p(()=>{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&&!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=>{hT="[_0-9a-z-*/]",MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=>{QM();ZM=32,BZ=512,ew=",",tw="=",qo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length>BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&&JM(n)&&t.set(i,n)}return t},new Map),this._internalState.size>ZM&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=>{P();nl();_T();cl="traceparent",ul="tracestate",VZ="00",FZ="(?!ff)[\\da-f]{2}",GZ="(?![0]{32})[\\da-f]{32}",HZ="(?![0]{16})[\\da-f]{16}",qZ="[\\da-f]{2}",jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&&o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new qo(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=>{P();mT=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(vf||(vf={}))});var Ai,TT=p(()=>{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Ln,ST=p(()=>{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var yf,aw=p(()=>{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=>{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&cw.call(t)===XZ}function QZ(r){return r!=null&&typeof r=="object"}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&&Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&&(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=>{YZ="[object Object]",zZ="[object Null]",KZ="[object Undefined]",$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t>ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a<i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Af(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&&fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r=="function"}function fl(r){return!Af(r)&&!Rf(r)&&!mw(r)&&typeof r=="object"}function Af(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=>{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var pl,gw=p(()=>{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e=="string"?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=>{});function Ow(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Aw=p(()=>{});var Nf,Rw=p(()=>{Nf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=>{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=>{he.with(Qu(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Pw=p(()=>{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=>Ai,AlwaysOnSampler:()=>Ln,AnchoredClock:()=>of,BindOnceFuture:()=>Cf,CompositePropagator:()=>Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>ol,DEFAULT_ENVIRONMENT:()=>al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>aT,ExportResultCode:()=>Tf,ParentBasedSampler:()=>yf,RPCType:()=>vf,RandomIdGenerator:()=>Go,SDK_INFO:()=>bn,TRACE_PARENT_HEADER:()=>cl,TRACE_STATE_HEADER:()=>ul,TimeoutError:()=>pl,TraceIdRatioBasedSampler:()=>Of,TraceState:()=>qo,TracesSamplerValues:()=>Vo,VERSION:()=>df,W3CBaggagePropagator:()=>nf,W3CTraceContextPropagator:()=>gf,_globalThis:()=>cf,addHrTimes:()=>dT,baggageUtils:()=>iee,callWithTimeout:()=>Sw,deleteRPCMetadata:()=>iw,getEnv:()=>Fo,getEnvWithoutDefaults:()=>lf,getRPCMetadata:()=>ow,getTimeOrigin:()=>Ef,globalErrorHandler:()=>af,hexToBase64:()=>ff,hexToBinary:()=>uf,hrTime:()=>pT,hrTimeDuration:()=>GM,hrTimeToMicroseconds:()=>YM,hrTimeToMilliseconds:()=>jM,hrTimeToNanoseconds:()=>qM,hrTimeToTimeStamp:()=>HM,internal:()=>oee,isAttributeKey:()=>tT,isAttributeValue:()=>rT,isTimeInput:()=>zM,isTimeInputHrTime:()=>mf,isTracingSuppressed:()=>At,isUrlIgnored:()=>vw,isWrapped:()=>Ow,loggingErrorHandler:()=>sf,merge:()=>_w,millisToHrTime:()=>Ho,otperformance:()=>In,parseEnvironment:()=>ll,parseTraceParent:()=>ET,sanitizeAttributes:()=>AM,setGlobalErrorHandler:()=>PM,setRPCMetadata:()=>nw,suppressTracing:()=>Qu,timeInputToHrTime:()=>FM,unrefTimer:()=>hf,unsuppressTracing:()=>TM,urlMatches:()=>yT});var iee,oee,xr=p(()=>{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=>{(function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.TRACE=1]="TRACE",r[r.TRACE2=2]="TRACE2",r[r.TRACE3=3]="TRACE3",r[r.TRACE4=4]="TRACE4",r[r.DEBUG=5]="DEBUG",r[r.DEBUG2=6]="DEBUG2",r[r.DEBUG3=7]="DEBUG3",r[r.DEBUG4=8]="DEBUG4",r[r.INFO=9]="INFO",r[r.INFO2=10]="INFO2",r[r.INFO3=11]="INFO3",r[r.INFO4=12]="INFO4",r[r.WARN=13]="WARN",r[r.WARN2=14]="WARN2",r[r.WARN3=15]="WARN3",r[r.WARN4=16]="WARN4",r[r.ERROR=17]="ERROR",r[r.ERROR2=18]="ERROR2",r[r.ERROR3=19]="ERROR3",r[r.ERROR4=20]="ERROR4",r[r.FATAL=21]="FATAL",r[r.FATAL2=22]="FATAL2",r[r.FATAL3=23]="FATAL3",r[r.FATAL4=24]="FATAL4"})(If||(If={}))});var Ni,jo,bf=p(()=>{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=>{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=>{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=>{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&&s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=>{xf=typeof globalThis=="object"?globalThis:global});var Lw=p(()=>{bw()});var xw=p(()=>{Lw()});function Mw(r,e,t){return o=>o===r?e:t}var hl,Ko,RT,ww=p(()=>{xw();hl=Symbol.for("io.opentelemetry.js.api.logs"),Ko=xf;RT=1});var Mf,Dw=p(()=>{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&&t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=>jo,NOOP_LOGGER_PROVIDER:()=>Yo,NoopLogger:()=>Ni,NoopLoggerProvider:()=>dl,ProxyLogger:()=>zo,ProxyLoggerProvider:()=>Ci,SeverityNumber:()=>If,logs:()=>_l});var _l,El=p(()=>{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=>{P();see=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var Fw=p(()=>{});function Gw(){return r=>{S.error(lee(r))}}function lee(r){return typeof r=="string"?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=>{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=>{Hw();uee=Gw()});var Df,jw=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Df||(Df={}))});function dee(r){return pee.indexOf(r)>-1}function _ee(r){return hee.indexOf(r)>-1}function mee(r){return Eee.indexOf(r)>-1}function Tee(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o=="string"){let s=vee[o.toUpperCase()];s!=null&&(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case"OTEL_LOG_LEVEL":yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=>{P();jw();fee=",",pee=["OTEL_SDK_DISABLED"];hee=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];Eee=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=>{NT()});import{performance as Oee}from"perf_hooks";var Pi,$w=p(()=>{Pi=Oee});var Xw,Ww=p(()=>{Xw="1.29.0"});var Ii,Jw=p(()=>{Ww();Ve();Ii={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=>{});var Zw=p(()=>{Kw();$w();Jw();Qw()});var CT=p(()=>{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!="number"){let e=Pi;r=e.timing&&e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r=="number"?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r=="number")return r<PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError("Invalid input type")}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=e1&&(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=>{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&s1.call(t)===wee}function kee(r){return r!=null&&typeof r=="object"}function Bee(r){return r==null?r===void 0?xee:Lee:bi&&bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&&(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=>{bee="[object Object]",Lee="[object Null]",xee="[object Undefined]",Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t>Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a<i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&&gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r=="function"}function gl(r){return!Vf(r)&&!Ff(r)&&!d1(r)&&typeof r=="object"}function Vf(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=>{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Gf,_1=p(()=>{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=>{Hf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=>{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=>{he.with(kw(he.active()),()=>{r.export(e,o=>{t(o)})})})}var S1=p(()=>{P();Bw()});var qf,cr=p(()=>{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=>{});var v1=p(()=>{g1()});var y1=p(()=>{v1()});var Mn,O1=p(()=>{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=>{O1()});var Wo,MT=p(()=>{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&&xe(_)&&(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&&S.warn("Dropping extra attributes."),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&S.warn("Can not execute the operation on emitted log record"),this._isReadonly}}});var Yf,R1=p(()=>{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&&s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&i!==void 0?i:$o}}var P1=p(()=>{cr()});var zf,I1=p(()=>{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=>o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}}});var Jo,wT=p(()=>{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=>{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=>{P();El();A1();cr();R1();P1();I1();b1();qee="unknown";$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn("A shutdown LoggerProvider cannot provide a Logger"),jo;e||S.warn("Logger requested without instrumentation scope name.");let s=e||qee,a=`${s}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=>{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=>{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=>qf._export(this._exporter,[e]).then(a=>{var i;a.code!==Yt.SUCCESS&&Mr((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(this._unresolvedExports.delete(a),s()),Mr);a!=null&&this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=>{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=>{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&&o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&&s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&&a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&&i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a<s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=>qf._export(this._exporter,e).then(s=>{var a;s.code!==Yt.SUCCESS&&Mr((a=s.error)!==null&&a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=>s.resource).filter(s=>s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=>{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=>{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=>{U1()});var B1=p(()=>{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=>Qo,ConsoleLogRecordExporter:()=>Xf,InMemoryLogRecordExporter:()=>Jf,LogRecord:()=>Wo,LoggerProvider:()=>$f,NoopLogRecordProcessor:()=>Jo,SimpleLogRecordProcessor:()=>Wf});var UT=p(()=>{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=>{(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(ur||(ur={}))});var lt,Zo=p(()=>{(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}function H1(r){return r.status==="rejected"}function kT(r,e){let t=[];return r.forEach(o=>{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o>=t;){let a=t+Math.trunc((o-t)/2);r[a]<e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=>{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=>{(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(zt||(zt={}))});var yl,z1=p(()=>{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&&o!==void 0?o:"",unit:(s=t==null?void 0:t.unit)!==null&&s!==void 0?s:"",valueType:(a=t==null?void 0:t.valueType)!==null&&a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&&i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(o=r.description)!==null&&o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=>{P();fr();(function(r){r.COUNTER="COUNTER",r.GAUGE="GAUGE",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=>{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u<a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&&(o.hasMinMax&&s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&&(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&&(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l<a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=>{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1<<e,s=0,a=0;for(let i=this.indexStart;i<=this.indexEnd;){let n=i%o;n<0&&(n+=o);for(let l=n;l<o&&s<t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s<o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&2146435072)>>20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&1048575)*Math.pow(2,32)+o}var Al,VT=p(()=>{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}var np=p(()=>{});var Dr,ip=p(()=>{Dr=class extends Error{}});var op,eD=p(()=>{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new Dr(`underflow: ${e} is < minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e>o)throw new Dr(`overflow: ${e} is > maximum lower boundary: ${o}`);return Rl(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=>{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e<=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t>=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is > maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e<=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is < minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function HT(r){if(r>nD||r<rD)throw new Dr(`expected scale >= ${rD} && <= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=>{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=>e>10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=>{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize<qT&&(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s<e.indexStart&&e.indexEnd-s>=this._maxSize?(a=!0,n=s,i=e.indexEnd):s>e.indexEnd&&s-e.indexStart>=this._maxSize&&(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let a=e.indexEnd-t;a>=e.backing.length&&this._grow(e,a+1),e.indexStart=t}else if(t>e.indexEnd){let a=t-e.indexStart;a>=e.backing.length&&this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s<0&&(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i>this._maxSize&&(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,o++;return o}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart>>s,e.indexEnd>>s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++)this._incrementIndexBy(e,a+n>>i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++){let c=(a+n>>i)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=>{P();Qee=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function lD(){return r=>{S.error(Zee(r))}}function Zee(r){return typeof r=="string"?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=>{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=>{cD();tte=lD()});var fD,pD=p(()=>{fD="1.29.0"});var xi,dD=p(()=>{pD();Ve();xi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=>{});var _D=p(()=>{dD();hD()});var ED=p(()=>{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=>{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(pr||(pr={}))});function SD(r,e){return new Promise(t=>{he.with(sD(he.active()),()=>{r.export(e,o=>{t(o)})})})}var gD=p(()=>{P();aD()});var vD,Dn=p(()=>{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=>{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=>{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&&o>s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=>{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=>{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");e=e.concat(),e=e.sort((a,i)=>a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=>{cp();Zf();ID=r=>mt.Default(),up=r=>ur.CUMULATIVE});var us,YT=p(()=>{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&&t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&&o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&&s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=>n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=>n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=>n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error("Cannot call shutdown twice.");return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn("Cannot forceFlush on already shutdown MetricReader.");return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=>{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(s=e.exportIntervalMillis)!==null&&s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&&a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length>0&&S.error("PeriodicExportingMetricReader: metrics collection errors",...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug("Error while resolving async portion of resource: ",i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=>{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=>{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&&t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=>{});var wD=p(()=>{MD()});var DD=p(()=>{wD()});var kn,UD=p(()=>{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=>{UD()});var _p,BD=p(()=>{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,e)&&this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=>{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e<0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e<0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=>{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=>{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=>{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=>{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={"otel.metric.overflow":!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=>{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=>{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=>{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&&(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=>{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=>{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}' `),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}' `),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}' `),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}' `),t}function hte(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}function _te(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}'`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}' - OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):""}var GD=p(()=>{});var Np,HD=p(()=>{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&&(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&&(e.description.length>a.description.length&&s.updateDescription(e.description),S.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=>{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=>{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=>{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&&(s=new Dt,this._buffer.set(e,s)),typeof t!="number"){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&&!Number.isInteger(t)&&(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=>{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o<0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,o)>=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s<0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=>n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=>{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s._metricStorages.forEach(n=>{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=>{let a=new Ip,i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s.forEach(n=>{let l=a._buffer.get(n);l!=null&&n._metricStorages.forEach(c=>{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=>o.callback===e&&o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=>o.callback===e&&q1(o.instruments,t))}}});var Lp,zD=p(()=>{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=>{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=>this._allowedAttributeNames.includes(s)).forEach(s=>o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=>{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=>n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=>{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=>{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&&(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=>{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=>{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&&o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&&s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&&s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=>{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&&t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&&e.views.length>0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&&e.readers.length>0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t="",o={}){return this._shutdown?(S.warn("A shutdown MeterProvider cannot provide a Meter"),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=>{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=>{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&&t!==void 0?t:"*"),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=>{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Fp,ZD=p(()=>{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=>mt,AggregationTemporality:()=>ur,ConsoleMetricExporter:()=>dp,DataPointType:()=>lt,DefaultAggregation:()=>Ll,DropAggregation:()=>as,ExplicitBucketHistogramAggregation:()=>Il,ExponentialHistogramAggregation:()=>bl,HistogramAggregation:()=>cs,InMemoryMetricExporter:()=>pp,InstrumentType:()=>_e,LastValueAggregation:()=>ls,MeterProvider:()=>Up,MetricReader:()=>us,PeriodicExportingMetricReader:()=>fp,SumAggregation:()=>wi,TimeoutError:()=>Li,View:()=>Fp});var Gp=p(()=>{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V("events"),Ote=["addListener","on","once","prependListener","prependOnceListener"],tS=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=>t.apply(this,a))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=>{t[s]!==void 0&&(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&&(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&&delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&&(n=s._createPatchMap(e));let l=n[a];l===void 0&&(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V("async_hooks"),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t==="TIMERWRAP")return;let o=this._stack[this._stack.length-1];o!==void 0&&this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&&this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V("async_hooks"),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,"AsyncHooksContextManager",{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=>{P();Ts=De("OpenTelemetry Context Key B3 Debug Flag")});var Ss,gs,vs,ys,Yp,Os,sS=p(()=>{Ss="b3",gs="x-b3-traceid",vs="x-b3-spanid",ys="x-b3-sampled",Yp="x-b3-parentspanid",Os="x-b3-flags"});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t=="string"?t.padStart(32,"0"):""}function kte(r,e){let t=Kp(r,e,vs);return typeof t=="string"?t:""}function nU(r,e){return Kp(r,e,Os)==="1"?"1":void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)==="1"||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=>{P();xr();oS();sS();xte=new Set([!0,"true","True","1",1]),Mte=new Set([!1,"false","False","0",0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a==="1"?o.set(t,Os,a):s.traceFlags!==void 0&&o.set(t,ys,(se.SAMPLED&s.traceFlags)===se.SAMPLED?"1":"0")}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&&Si(a)&&wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&&Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=>{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte="0".repeat(16),Gte=new Set(["d","1"]),Hte="d";$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,"b3",i)}extract(e,t,o){let s=o.get(t,"b3"),a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&&(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return["b3"]}}});var As,aS=p(()=>{(function(r){r[r.SINGLE_HEADER=0]="SINGLE_HEADER",r[r.MULTI_HEADER=1]="MULTI_HEADER"})(As||(As={}))});var Xp,sU=p(()=>{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,"b3");return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=>As,B3Propagator:()=>Xp,B3_CONTEXT_HEADER:()=>Ss,X_B3_FLAGS:()=>Os,X_B3_PARENT_SPAN_ID:()=>Yp,X_B3_SAMPLED:()=>ys,X_B3_SPAN_ID:()=>vs,X_B3_TRACE_ID:()=>gs});var lU=p(()=>{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=>{P();cU=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Wp,uU=p(()=>{Wp="baggage"});function pU(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function dU(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function hU(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}var _U=p(()=>{P()});var Ul,EU=p(()=>{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=>n.length<=4096).slice(0,180),i=pU(a);i.length>0&&o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=hU(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r=="string"&&r.length>0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var SU=p(()=>{P()});function gU(){return r=>{S.error($te(r))}}function $te(r){return typeof r=="string"?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=>{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=>{vU();Wte=gU()});var Ut,cS=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)>-1}function tre(r){return ere.indexOf(r)>-1}function nre(r){return rre.indexOf(r)>-1}function ire(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o=="string"){let s=are[o.toUpperCase()];s!=null&&(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case"OTEL_LOG_LEVEL":lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=>{P();cS();Jte=",",Qte=["OTEL_SDK_DISABLED"];ere=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rre=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=>{uS()});import{performance as cre}from"perf_hooks";var dr,NU=p(()=>{dr=cre});var CU,PU=p(()=>{CU="1.29.0"});var ki,IU=p(()=>{PU();Ve();ki={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=>{});var LU=p(()=>{RU();NU();IU();bU()});var fS=p(()=>{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!="number"){let e=dr;r=e.timing&&e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r=="number"?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function nd(r){return rd(r)||typeof r=="number"||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=pS&&(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=>{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Xt||(Xt={}))});var Vl,wU=p(()=>{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&&!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=>{_S="[_0-9a-z-*/]",Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=>{kU();BU=32,vre=512,VU=",",FU="=",od=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length>vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&&UU(n)&&t.set(i,n)}return t},new Map),this._internalState.size>BU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=>{P();Dl();GU();sd="traceparent",ad="tracestate",yre="00",Ore="(?!ff)[\\da-f]{2}",Are="(?![0]{32})[\\da-f]{32}",Rre="(?![0]{16})[\\da-f]{16}",Nre="[\\da-f]{2}",Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&&o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new od(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&jU.call(t)===xre}function Dre(r){return r!=null&&typeof r=="object"}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&&Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&&(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=>{Pre="[object Object]",Ire="[object Null]",bre="[object Undefined]",Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t>Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a<i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(ld(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&&Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r=="function"}function Gl(r){return!ld(r)&&!cd(r)&&!JU(r)&&typeof r=="object"}function ld(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=>{$U();Vre=20});var ud,ZU=p(()=>{ud=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=>{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=>{he.with(wl(he.active()),()=>{r.export(e,o=>{t(o)})})})}var rk=p(()=>{P();Dl()});var nk,kt=p(()=>{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=>{ik="exception"});var Cs,SS=p(()=>{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&&this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&S.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),nd(t)&&(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&&typeof e.message!="string"&&(S.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]<0&&(S.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=dr.now())return dS(e+this._performanceOffset);if(typeof e=="number")return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e=="string"?o[Wa]=e:e&&(e.code?o[Xa]=e.code.toString():e.name&&(o[Xa]=e.name),e.message&&(o[Wa]=e.message),e.stack&&(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(hr||(hr={}))});var Ur,fd=p(()=>{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Wt,pd=p(()=>{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var Gn,gS=p(()=>{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=>{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}".`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e<0||e>1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=>{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&&s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&&l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=>{OS();kt()});var hd,ck=p(()=>{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)=="number"?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)=="number"?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)=="number"?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)=="number"?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&S.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a<i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let o=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);he.with(wl(he.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=>this._exporter.export(s,n=>{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&&l!==void 0?l:new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let n=0,l=s.length;n<l;n++){let c=s[n];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=>{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=>{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t<r/4;t++)_d.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(_d[t]>0);t++)t===r-1&&(_d[r-1]=1);return _d.toString("hex",0,r)}}var qn,_d,pk=p(()=>{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=>{uk();pk()});var Ed=p(()=>{dk()});var Is,hk=p(()=>{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&&(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug("Instrumentation suppressed, returning Noop Span"),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&&s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&&a!==void 0?a:[]).map(z=>({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&&i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug("Recording is off, propagating context in a non-recording span"),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length<2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=>{});var Ek=p(()=>{_k()});var mk=p(()=>{Ek()});var jn,Tk=p(()=>{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=>{Tk()});var ql,gk=p(()=>{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(o=>{Kt(o||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=>{Promise.all(e).then(()=>{t()},o)})}}});var bs,RS=p(()=>{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=>{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&&t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&&(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&&o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&he.setGlobalContextManager(e.contextManager),e.propagator&&Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=>new Promise(s=>{let a,i=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=>{clearTimeout(i),a!==pn.timeout&&(a=pn.resolved,s(a))}).catch(n=>{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=>{Promise.all(t).then(a=>{let i=a.filter(n=>n!==pn.resolved);i.length>0?s(i):o()}).catch(a=>s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=>{let a=this._getPropagator(s);return a||S.warn(`Propagator "${s}" requested through environment variable is unavailable.`),a}).reduce((s,a)=>(a&&s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||S.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([["tracecontext",()=>new Fl],["baggage",()=>new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=>{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=>{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=>{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)===0)return;let s=()=>nk._export(this._exporter,[e]).then(a=>{var i;a.code!==Xt.SUCCESS&&Kt((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=>{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(a!=null&&this._unresolvedExports.delete(a),s()),i=>Kt(i));a!=null&&this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=>Ur,AlwaysOnSampler:()=>Wt,BasicTracerProvider:()=>Ls,BatchSpanProcessor:()=>Hn,ConsoleSpanExporter:()=>Td,ForceFlushState:()=>pn,InMemorySpanExporter:()=>Sd,NoopSpanProcessor:()=>bs,ParentBasedSampler:()=>Gn,RandomIdGenerator:()=>qn,SamplingDecision:()=>hr,SimpleSpanProcessor:()=>gd,Span:()=>Cs,TraceIdRatioBasedSampler:()=>Fi,Tracer:()=>Is});var Gi=p(()=>{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=>{"use strict";var qre="2.0.0",jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=>{"use strict";var $re=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Nk.exports=$re});var Ms=T((kr,Ck)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS="[a-zA-Z0-9-]",rne=[["\\s",1],["\\d",Wre],[CS,Xre]],nne=r=>{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=>{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?"g":void 0),Zre[s]=new RegExp(o,t?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CS}*`);re("MAINVERSION",`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASE",`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${CS}+`);re("BUILD",`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re("FULL",`^${D[U.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re("LOOSE",`^${D[U.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re("XRANGE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re("COERCE",`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",D[U.COERCE],!0);re("COERCERTLFULL",D[U.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace="$1~";re("TILDE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace="$1^";re("CARET",`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var vd=T((c1e,Pk)=>{"use strict";var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=>r?typeof r!="object"?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=>{"use strict";var Ik=/^[0-9]+$/,bk=(r,e)=>{let t=Ik.test(r),o=Ik.test(e);return t&&o&&(r=+r,e=+e),r===e?0:t&&!o?-1:o&&!t?1:r<e?-1:1},ane=(r,e)=>bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=>{"use strict";var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>xk)throw new TypeError(`version is longer than ${xk} characters`);yd("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Od||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Od||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Od||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let a=+s;if(a>=0&&a<Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(yd("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd("prerelease compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd("build compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith("pre")){if(!t&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,o),this.inc("pre",t,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,o),this.inc("pre",t,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&&(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=>{"use strict";var wk=pt(),cne=(r,e,t=!1)=>{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=>{"use strict";var une=Hi(),fne=(r,e)=>{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=>{"use strict";var pne=Hi(),dne=(r,e)=>{let t=pne(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=>{"use strict";var Fk=pt(),hne=(r,e,t,o,s)=>{typeof t=="string"&&(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=>{"use strict";var qk=Hi(),_ne=(r,e)=>{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s>0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&&!l){if(!n.patch&&!n.minor)return"major";if(n.compareMain(i)===0)return n.minor&&!n.patch?"minor":"patch"}let u=l?"pre":"";return t.major!==o.major?u+"major":t.minor!==o.minor?u+"minor":t.patch!==o.patch?u+"patch":"prerelease"};jk.exports=_ne});var Kk=T((m1e,zk)=>{"use strict";var Ene=pt(),mne=(r,e)=>new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=>{"use strict";var Tne=pt(),Sne=(r,e)=>new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=>{"use strict";var gne=pt(),vne=(r,e)=>new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=>{"use strict";var yne=Hi(),One=(r,e)=>{let t=yne(r,e);return t&&t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=>{"use strict";var eB=pt(),Ane=(r,e,t)=>new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=>{"use strict";var Rne=Jt(),Nne=(r,e,t)=>Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=>{"use strict";var Cne=Jt(),Pne=(r,e)=>Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=>{"use strict";var sB=pt(),Ine=(r,e,t)=>{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=>{"use strict";var bne=Nd(),Lne=(r,e)=>r.sort((t,o)=>bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=>{"use strict";var xne=Nd(),Mne=(r,e)=>r.sort((t,o)=>xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=>{"use strict";var wne=Jt(),Dne=(r,e,t)=>wne(r,e,t)>0;pB.exports=Dne});var Cd=T((P1e,dB)=>{"use strict";var Une=Jt(),kne=(r,e,t)=>Une(r,e,t)<0;dB.exports=kne});var bS=T((I1e,hB)=>{"use strict";var Bne=Jt(),Vne=(r,e,t)=>Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=>{"use strict";var Fne=Jt(),Gne=(r,e,t)=>Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=>{"use strict";var Hne=Jt(),qne=(r,e,t)=>Hne(r,e,t)>=0;EB.exports=qne});var Id=T((x1e,mB)=>{"use strict";var jne=Jt(),Yne=(r,e,t)=>jne(r,e,t)<=0;mB.exports=Yne});var xS=T((M1e,TB)=>{"use strict";var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return zne(r,t,o);case"!=":return Kne(r,t,o);case">":return $ne(r,t,o);case">=":return Xne(r,t,o);case"<":return Wne(r,t,o);case"<=":return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=>{"use strict";var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=>{if(r instanceof Zne)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||"0",a=t[4]||"0",i=e.includePrerelease&&t[5]?`-${t[5]}`:"",n=e.includePrerelease&&t[6]?`+${t[6]}`:"";return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=>{"use strict";var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=>{"use strict";var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(s=>!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let o=0;o<t.length;o++)o>0&&(this.formatted+=" "),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&&cie)|(this.options.loose&&uie))+":"+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be("hyphen replace",e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be("comparator trim",e),e=e.replace(Rt[Tt.TILDETRIM],aie),be("tilde trim",e),e=e.replace(Rt[Tt.CARETTRIM],lie),be("caret trim",e);let n=e.split(" ").map(f=>pie(f,this.options)).join(" ").split(/\s+/).map(f=>gie(f,this.options));a&&(n=n.filter(f=>(be("loose invalid filter",f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be("range list",n);let l=new Map,c=n.map(f=>new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>RB(o,t)&&e.set.some(s=>RB(s,t)&&o.every(a=>s.every(i=>a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=>r.value==="<0.0.0-0",fie=r=>r.value==="",RB=(r,e)=>{let t=!0,o=r.slice(),s=o.pop();for(;t&&o.length;)t=o.every(a=>s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=>(be("comp",r,e),r=_ie(r,e),be("caret",r),r=die(r,e),be("tildes",r),r=mie(r,e),be("xrange",r),r=Sie(r,e),be("stars",r),r),St=r=>!r||r.toLowerCase()==="x"||r==="*",die=(r,e)=>r.trim().split(/\s+/).map(t=>hie(t,e)).join(" "),hie=(r,e)=>{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=>{be("tilde",r,o,s,a,i,n);let l;return St(s)?l="":St(a)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:St(i)?l=`>=${s}.${a}.0 <${s}.${+a+1}.0-0`:n?(be("replaceTilde pr",n),l=`>=${s}.${a}.${i}-${n} <${s}.${+a+1}.0-0`):l=`>=${s}.${a}.${i} <${s}.${+a+1}.0-0`,be("tilde return",l),l})},_ie=(r,e)=>r.trim().split(/\s+/).map(t=>Eie(t,e)).join(" "),Eie=(r,e)=>{be("caret",r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?"-0":"";return r.replace(t,(s,a,i,n,l)=>{be("caret",r,s,a,i,n,l);let c;return St(a)?c="":St(i)?c=`>=${a}.0.0${o} <${+a+1}.0.0-0`:St(n)?a==="0"?c=`>=${a}.${i}.0${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.0${o} <${+a+1}.0.0-0`:l?(be("replaceCaret pr",l),a==="0"?i==="0"?c=`>=${a}.${i}.${n}-${l} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}-${l} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n}-${l} <${+a+1}.0.0-0`):(be("no pr"),a==="0"?i==="0"?c=`>=${a}.${i}.${n}${o} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n} <${+a+1}.0.0-0`),be("caret return",c),c})},mie=(r,e)=>(be("replaceXRanges",r,e),r.split(/\s+/).map(t=>Tie(t,e)).join(" ")),Tie=(r,e)=>{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=>{be("xRange",r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s==="="&&_&&(s=""),l=e.includePrerelease?"-0":"",c?s===">"||s==="<"?o="<0.0.0-0":o="*":s&&_?(u&&(i=0),n=0,s===">"?(s=">=",u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s==="<="&&(s="<",u?a=+a+1:i=+i+1),s==="<"&&(l="-0"),o=`${s+a}.${i}.${n}${l}`):u?o=`>=${a}.0.0${l} <${+a+1}.0.0-0`:f&&(o=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),be("xRange return",o),o})},Sie=(r,e)=>(be("replaceStars",r,e),r.trim().replace(Rt[Tt.STAR],"")),gie=(r,e)=>(be("replaceGTE0",r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],"")),vie=r=>(e,t,o,s,a,i,n,l,c,u,f,_)=>(St(o)?t="":St(s)?t=`>=${o}.0.0${r?"-0":""}`:St(a)?t=`>=${o}.${s}.0${r?"-0":""}`:i?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,St(c)?l="":St(u)?l=`<${+c+1}.0.0-0`:St(f)?l=`<${c}.${+u+1}.0-0`:_?l=`<=${c}.${u}.${f}-${_}`:r?l=`<${c}.${u}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=>{for(let o=0;o<r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let o=0;o<r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&&r[o].semver.prerelease.length>0){let s=r[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=>{"use strict";var $l=Symbol("SemVer ANY"),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),kS("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value="":this.value=this.operator+this.semver.version,kS("comp",this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS("Comparator.test",e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e=="string")try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new LB(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||US(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||US(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=>{"use strict";var Oie=Qt(),Aie=(r,e,t)=>{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=>{"use strict";var Rie=Qt(),Nie=(r,e)=>new Rie(r,e).set.map(t=>t.map(o=>o.value).join(" ").trim().split(" "));wB.exports=Nie});var kB=T((F1e,UB)=>{"use strict";var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===-1)&&(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=>{"use strict";var bie=pt(),Lie=Qt(),xie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===1)&&(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=>{"use strict";var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=>{r=new Mie(r,e);let t=new VS("0.0.0");if(r.test(t)||(t=new VS("0.0.0-0"),r.test(t)))return t;t=null;for(let o=0;o<r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=>{let n=new VS(i.semver.version);switch(i.operator){case">":n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":(!a||FB(n,a))&&(a=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&&(!t||FB(t,a))&&(t=a)}return t&&r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=>{"use strict";var Die=Qt(),Uie=(r,e)=>{try{return new Die(r,e).range||"*"}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=>{"use strict";var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=>{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case">":s=YB,a=Gie,i=zB,n=">",l=">=";break;case"<":s=zB,a=Hie,i=YB,n="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fie(r,e,o))return!1;for(let c=0;c<e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=>{m.semver===Bie&&(m=new KB(">=0.0.0")),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&&(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&&a(r,_.semver))return!1;if(_.operator===l&&i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=>{"use strict";var jie=xd(),Yie=(r,e,t)=>jie(r,e,">",t);XB.exports=Yie});var QB=T((z1e,JB)=>{"use strict";var zie=xd(),Kie=(r,e,t)=>zie(r,e,"<",t);JB.exports=Kie});var tV=T((K1e,eV)=>{"use strict";var ZB=Qt(),$ie=(r,e,t)=>(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=>{"use strict";var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=>{let o=[],s=null,a=null,i=r.sort((u,f)=>Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&&u===i[0]?n.push("*"):f?u===i[0]?n.push(`<=${f}`):n.push(`${u} - ${f}`):n.push(`>=${u}`);let l=n.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var cV=T((X1e,lV)=>{"use strict";var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=>{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(">=0.0.0-0")],oV=[new GS(">=0.0.0")],Zie=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===FS){if(e.length===1&&e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&&e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===">"||m.operator===">="?s=sV(s,m,t):m.operator==="<"||m.operator==="<="?a=aV(a,m,t):o.add(m.semver);if(o.size>1)return null;let i;if(s&&a){if(i=HS(s.semver,a.semver,t),i>0)return null;if(i===0&&(s.operator!==">="||a.operator!=="<="))return null}for(let m of o){if(s&&!Wl(m,String(s),t)||a&&!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&&!t.includePrerelease&&a.semver.prerelease.length?a.semver:!1,_=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&a.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let m of e){if(u=u||m.operator===">"||m.operator===">=",c=c||m.operator==="<"||m.operator==="<=",s){if(_&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===_.major&&m.semver.minor===_.minor&&m.semver.patch===_.patch&&(_=!1),m.operator===">"||m.operator===">="){if(n=sV(s,m,t),n===m&&n!==s)return!1}else if(s.operator===">="&&!Wl(s.semver,String(m),t))return!1}if(a){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(l=aV(a,m,t),l===m&&l!==a)return!1}else if(a.operator==="<="&&!Wl(a.semver,String(m),t))return!1}if(!m.operator&&(a||s)&&i!==0)return!1}return!(s&&c&&!a&&i!==0||a&&u&&!s&&i!==0||_||f)},sV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o>0?r:o<0||e.operator===">"&&r.operator===">="?e:r},aV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o<0?r:o>0||e.operator==="<"&&r.operator==="<="?e:r};lV.exports=Jie});var jS=T((W1e,pV)=>{"use strict";var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(":");if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,"0"),n=s.padStart(16,"0"),l=Boe.test(a)?parseInt(a,16)&1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=>{P();xr();dV=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hV=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},YS="uber-trace-id",Md="uberctx",_V=(function(){function r(e){typeof e=="string"?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&&At(e)===!1){var l="0"+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+":"+i.spanId+":0:"+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+"-"+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+"-")}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c=="string"){var _=Voe(c);_&&(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&&n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&&(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&&!y.done&&(a=O.return)&&a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=>_V,UBER_BAGGAGE_HEADER_PREFIX:()=>Md,UBER_TRACE_ID_HEADER:()=>YS});var TV=p(()=>{EV()});var vV=T(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,"14.8.0")?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,["b3",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],["b3multi",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],["jaeger",()=>new Goe.JaegerPropagator]])});var zS=T(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,"NodeTracerProvider",{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,"AlwaysOffSampler",{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,"AlwaysOnSampler",{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,"BasicTracerProvider",{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,"BatchSpanProcessor",{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,"ConsoleSpanExporter",{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,"ForceFlushState",{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,"InMemorySpanExporter",{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,"NoopSpanProcessor",{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,"ParentBasedSampler",{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,"RandomIdGenerator",{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,"SamplingDecision",{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,"SimpleSpanProcessor",{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,"Span",{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,"Tracer",{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=>{});var OV=p(()=>{yV()});var KS=p(()=>{OV()});var Ce,dn=p(()=>{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=>{AV=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}},RV=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}}});import*as NV from"child_process";import*as CV from"util";var Us,kd=p(()=>{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=>qoe});async function qoe(){try{let e=(await Us('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(` `).find(o=>o.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var IV=p(()=>{kd();P()});var bV={};Ae(bV,{getMachineId:()=>Yoe});import{promises as joe}from"fs";async function Yoe(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await joe.readFile(e,{encoding:"utf8"})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var LV=p(()=>{P()});var xV={};Ae(xV,{getMachineId:()=>Koe});import{promises as zoe}from"fs";async function Koe(){try{return(await zoe.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var MV=p(()=>{kd();P()});var wV={};Ae(wV,{getMachineId:()=>$oe});import*as Bd from"process";async function $oe(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Bd.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Bd.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await Us(`${e} ${r}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var DV=p(()=>{kd();P()});var UV={};Ae(UV,{getMachineId:()=>Xoe});async function Xoe(){return S.debug("could not read machine-id: unsupported platform"),""}var kV=p(()=>{P()});import*as BV from"process";var qi,VV=p(()=>{switch(BV.platform){case"darwin":({getMachineId:qi}=(IV(),ee(PV)));break;case"linux":({getMachineId:qi}=(LV(),ee(bV)));break;case"freebsd":({getMachineId:qi}=(MV(),ee(xV)));break;case"win32":({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from"os";var XS,ji,WS=p(()=>{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=>{let t={};return e&&(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=>{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from"os";var QS,Yi,ZS=p(()=>{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=>{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from"os";var tg,zi,rg=p(()=>{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:"nodejs",[Ja]:"Node.js"};process.argv.length>1&&(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=>{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from"crypto";var ig,ec,jV=p(()=>{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=>{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=>{YV()});var og,tc,sg=p(()=>{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator<"u"&&((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&&((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:"browser",[Ja]:"Web Browser",[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===""?(S.debug("BrowserDetector failed: Unable to find required browser resources. "),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=>{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=>{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&&(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=>{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=>{zV();KV();$V();sg();ug()});var WV,JV=p(()=>{WV=r=>r!==null&&typeof r=="object"&&typeof r.then=="function"});var QV,ZV,e2,t2=p(()=>{dn();P();JV();QV=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=>t.merge(o),Ce.empty())},ZV=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(s=>{try{let a=s.detect(r),i;if(WV(a)){let n=async()=>{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=>S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=>s.merge(a),Ce.empty());return o.waitForAsyncAttributes&&o.waitForAsyncAttributes().then(()=>{e2(t)}),o},e2=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=>Ce,browserDetector:()=>lg,browserDetectorSync:()=>tc,defaultServiceName:()=>Ds,detectResources:()=>QV,detectResourcesSync:()=>ZV,envDetector:()=>pg,envDetectorSync:()=>rc,hostDetector:()=>Jl,hostDetectorSync:()=>ji,osDetector:()=>Ql,osDetectorSync:()=>Yi,processDetector:()=>Zl,processDetectorSync:()=>zi,serviceInstanceIdDetectorSync:()=>ec});var Fd=p(()=>{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s<a;s++){let i=r[s];e&&i.setTracerProvider(e),t&&i.setMeterProvider(t),o&&i.setLoggerProvider&&i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=>e.disable())}var i2=p(()=>{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&t!==void 0?t:[];return r2(i,o,s,a),()=>{n2(i)}}var s2=p(()=>{P();El();i2()});var hg=T((FUe,c2)=>{"use strict";function dg(r){return typeof r=="function"}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&&r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&&r.logger&&(dg(r.logger)?vt=r.logger:vt("new logger isn't a function, not replacing"))}function a2(r,e,t){if(!r||!r[e]){vt("no original function "+e+" to wrap");return}if(!t){vt("no wrapper function"),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt("original object and wrapper must be functions");return}var o=r[e],s=t(o,e);return nc(s,"__original",o),nc(s,"__unwrap",function(){r[e]===s&&nc(r,e,o)}),nc(s,"__wrapped",!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to wrap on modules");return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt("no function to unwrap."),vt(new Error().stack);return}if(!r[e].__unwrap)vt("no original to unwrap to -- has "+e+" already been unwrapped?");else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to unwrap on modules");return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=>{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},a)}}}});var p2=T((jUe,f2)=>{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return ose(r);if(t==="number"&&isFinite(r))return e.long?ase(r):sse(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return t*ise;case"weeks":case"week":case"w":return t*nse;case"days":case"day":case"d":return t*Ki;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return t*Bs;case"seconds":case"second":case"secs":case"sec":case"s":return t*ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function sse(r){var e=Math.abs(r);return e>=Ki?Math.round(r/Ki)+"d":e>=Vs?Math.round(r/Vs)+"h":e>=Bs?Math.round(r/Bs)+"m":e>=ks?Math.round(r/ks)+"s":r+"ms"}function ase(r){var e=Math.abs(r);return e>=Ki?Hd(r,e,Ki,"day"):e>=Vs?Hd(r,e,Vs,"hour"):e>=Bs?Hd(r,e,Bs,"minute"):e>=ks?Hd(r,e,ks,"second"):r+" ms"}function Hd(r,e,t,o){var s=e>=t*1.5;return Math.round(r/t)+" "+o+(s?"s":"")}});var _g=T((YUe,d2)=>{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_<u.length;_++)f=(f<<5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=>{if(B==="%%")return"%";N++;let te=t.formatters[G];if(typeof te=="function"){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(m!==t.namespaces&&(m=t.namespaces,O=t.enabled(u)),O),set:A=>{_=A}}),typeof t.init=="function"&&t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f>"u"?":":f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of f)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_<u.length;)if(m<f.length&&(f[m]===u[_]||f[m]==="*"))f[m]==="*"?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m<f.length&&f[m]==="*";)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=>{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Nt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cse(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+qd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=>{});function fse(r){try{r?Nt.storage.setItem("debug",r):Nt.storage.removeItem("debug")}catch{}}function pse(){let r;try{r=Nt.storage.getItem("debug")||Nt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var E2=T((zUe,_2)=>{"use strict";_2.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),s=e.indexOf("--");return o!==-1&&(s===-1||o<s)}});var S2=T((KUe,T2)=>{"use strict";var _se=V("os"),m2=V("tty"),Zt=E2(),{env:Ze}=process,zn;Zt("no-color")||Zt("no-colors")||Zt("color=false")||Zt("color=never")?zn=0:(Zt("color")||Zt("colors")||Zt("color=true")||Zt("color=always"))&&(zn=1);"FORCE_COLOR"in Ze&&(Ze.FORCE_COLOR==="true"?zn=1:Ze.FORCE_COLOR==="false"?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function mg(r,e){if(zn===0)return 0;if(Zt("color=16m")||Zt("color=full")||Zt("color=truecolor"))return 3;if(Zt("color=256"))return 2;if(r&&!e&&zn===void 0)return 0;let t=zn||0;if(Ze.TERM==="dumb")return t;if(process.platform==="win32"){let o=_se.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in Ze)||Ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:t}function Ese(r){let e=mg(r,r&&r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=>{var mse=V("tty"),jd=V("util");et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");et.colors=[6,2,3,4,5,1];try{let r=S2();r&&(r.stderr||r).level>=2&&(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return"colors"in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s="\x1B[3"+(o<8?o:"8;5;"+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+"m+"+Yd.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=gse()+e+" "+r[0]}function gse(){return et.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=>e.trim()).join(" ")};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=>{"use strict";var Sg=V("path").sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf("node_modules");if(t!==-1&&e[t+1]){for(var o=e[t+1][0]==="@",s=o?e[t+1]+"/"+e[t+2]:e[t+1],a=o?3:2,i="",n=t+a-1,l=0;l<=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c="",u=e.length-1,f=t+a;f<=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=>{"use strict";var Rse=V("os");A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(t?"/Users/"+t:null):process.platform==="linux"?e||(process.getuid()===0?"/root":t?"/home/"+t:null):e||null}});var yg=T((JUe,R2)=>{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=>{"use strict";var Nse=process.platform==="win32",Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=>{var I2=V("path"),C2=I2.parse||N2(),P2=function(e,t){var o="/";/^([A-Za-z]:)/.test(e)?o="":/^\\\\/.test(e)&&(o="\\\\");for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&typeof t.paths=="function")return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&&t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=>{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=>{"use strict";var Lse="Function.prototype.bind called on incompatible ",xse=Object.prototype.toString,Mse=Math.max,wse="[object Function]",x2=function(e,t){for(var o=[],s=0;s<e.length;s+=1)o[s]=e[s];for(var a=0;a<t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s<e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t="",o=0;o<r.length;o+=1)t+=r[o],o+1<r.length&&(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!="function"||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l<i;l++)n[l]="$"+l;if(s=Function("binder","return function ("+Use(n,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=>{"use strict";var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=>{"use strict";var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=>{Gse.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var sc=T((oke,H2)=>{"use strict";var Hse=B2();function qse(r,e){for(var t=r.split("."),o=e.split(" "),s=o.length>1?o[0]:"=",a=(o.length>1?o[1]:o[0]).split("."),i=0;i<3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s==="<"?n<l:s===">="?n>=l:!1}return s===">="}function F2(r,e){var t=e.split(/ ?&& ?/);if(t.length===0)return!1;for(var o=0;o<t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e=="boolean")return e;var t=typeof r>"u"?process.versions&&process.versions.node:r;if(typeof t!="string")throw new TypeError(typeof r>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var o=0;o<e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&&jse(t,G2[e])}});var Y2=T((ske,j2)=>{var $i=V("fs"),Yse=vg(),ze=V("path"),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!=="win32"&&$i.realpath&&typeof $i.realpath.native=="function"?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,".node_modules"),ze.join(q2,".node_libraries")]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&&o.code!=="ENOENT"?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&&o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a<s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t=="function"&&(s=a,a={}),typeof e!="string"){var i=new TypeError("Path must be a string.");return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&&a.readPackage){var _=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[".js"],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e==="."||e===".."||e.slice(-1)==="/")&&(F+="/"),/\/$/.test(e)&&F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&&Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error("Cannot find module '"+e+"' from '"+I+"'");C.code="MODULE_NOT_FOUND",s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error("Cannot find module '"+e+"' from '"+I+"'");Y.code="MODULE_NOT_FOUND",s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E=="function"&&(C=E,E=void 0);var Q=[""].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&&Te&&a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([""].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===""||v==="/"||process.platform==="win32"&&/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,"package.json");n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&&W(J);var Ne=ce;Ne&&a.packageFilter&&(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C=="function"&&(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,"package.json");n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,"index"),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&&a.packageFilter&&(Z=a.packageFilter(Z,J)),Z&&Z.main){if(typeof Z.main!="string"){var je=new TypeError("package \u201C"+Z.name+"\u201D `main` must be a string");return je.code="INVALID_PACKAGE_MAIN",E(je)}(Z.main==="."||Z.main==="./")&&(Z.main="index"),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,"index"),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,"index"),Ye,E)})});return}B(ze.join(v,"/index"),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=>{nae.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var W2=T((lke,X2)=>{"use strict";var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&&($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=>{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=>{var sae=sc(),Xi=V("fs"),dt=V("path"),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!=="win32"&&Xi.realpathSync&&typeof Xi.realpathSync.native=="function"?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,".node_modules"),dt.join(Z2,".node_libraries")]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!=="ENOENT")throw t}return e},lc=function(e,t,o){return o&&o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a<s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!="string")throw new TypeError("Path must be a string.");var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&&o.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var c=o.packageIterator,u=o.extensions||[".js"],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e==="."||e===".."||e.slice(-1)==="/")&&(y+="/");var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&&sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error("Cannot find module '"+e+"' from '"+m+"'");throw M.code="MODULE_NOT_FOUND",M;function F(G){var te=N(dt.dirname(G));if(te&&te.dir&&te.pkg&&o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&&(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v<u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===""||G==="/")&&!(process.platform==="win32"&&/^\w:[/\\]*$/.test(G))&&!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),"package.json");if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&&o.packageFilter&&($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),"/package.json");if(s(te)){try{var $=l(a,te)}catch{}if($&&o.packageFilter&&($=o.packageFilter($,G)),$&&$.main){if(typeof $.main!="string"){var le=new TypeError("package \u201C"+$.name+"\u201D `main` must be a string");throw le.code="INVALID_PACKAGE_MAIN",le}($.main==="."||$.main==="./")&&($.main="index");try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,"/index"))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v<le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=>{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=>{Tae.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Lg=T((dke,bg)=>{"use strict";var Gs=V("path"),_r=V("module"),Fe=y2()("require-in-the-middle"),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=>r.startsWith("node:")?!0:(Pg===void 0&&(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(".").map(Number);e===8&&t<8?Fs=o=>o==="http2"?!0:!!r.core[o]:Fs=o=>!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&&V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&&this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&&s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),typeof _r._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof _r._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe("registering require hook"),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe("ignoring require call - module is soft-unhooked"),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe("ignoring process.getBuiltinModule call - module is soft-unhooked"),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith("node:")){let M=u.slice(5);Fs(M)&&(_=M)}}else{if(c)return Fe("call to process.getBuiltinModule with unknown built-in id"),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe('Module._resolveFilename("%s") threw %j, calling original Module.require',u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe("processing %s module require('%s'): %s",f===!0?"core":"non-core",u,_),o._cache.has(_,f)===!0)return Fe("returning already patched cached module: %s",_),o._cache.get(_,f);let y=s.has(_);y===!1&&s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe("module is in the process of being patched already - ignoring: %s",_),A;if(s.delete(_),f===!0){if(i===!0&&r.includes(_)===!1)return Fe("ignoring core module not on whitelist: %s",_),A;m=_}else if(i===!0&&r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe("could not parse filename: %s",_),A;m=M.name,O=M.basedir;let F=yae(M);Fe("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",m,u,F,O);let N=!1;if(i){if(!u.startsWith(".")&&r.includes(u)&&(m=u,N=!0),!r.includes(m)&&!r.includes(F))return A;r.includes(F)&&F!==m&&(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe("could not resolve module: %s",m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe("preparing to process require of internal file: %s",m);else return Fe("ignoring require of non-main module file: %s",z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe("calling require hook: %s",m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe("returning module: %s",m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe("require unhook successful")):Fe("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe("process.getBuiltinModule unhook successful")):Fe("process.getBuiltinModule unhook unsuccessful"))};function yae(r){let e=Gs.sep!=="/"?r.path.split(Gs.sep).join("/"):r.path;return Gs.posix.join(r.name,e).replace(vae,"")}});var Xd,Wd,iF=p(()=>{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split("/")){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split("/")){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&&i&&a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&&a.sort((n,l)=>n.insertedId-l.insertedId),a.map(({hook:n})=>n))}}});import*as xg from"path";function Aae(r){return xg.sep!=="/"?r.split(xg.sep).join("/"):r}var sF,Oae,Jd,aF=p(()=>{sF=Nn(Lg());iF();Oae=["afterEach","after","beforeEach","before","describe","it"].every(r=>typeof global[r]=="function"),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=>{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&&e!==void 0?e:new r}}});var dF=T(Wi=>{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return"Module";let t=cF.get(r)[e];if(typeof t=="function")return t()},defineProperty(r,e,t){if(!("value"in t))throw new Error("Getters/setters are not supported for exports property descriptors.");return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=>i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=>{var hF=V("path"),Iae=gg(),{fileURLToPath:_F}=V("url"),{MessageChannel:bae}=V("worker_threads"),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=>r(e,t))}function TF(r){let e=wg.indexOf(r);e>-1&&wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&&s!==e&&(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=>{t++,r.postMessage(n)},r.on("message",()=>{t--,o&&t<=0&&o()}).unref();function s(){let n=setInterval(()=>{},1e3),l=new Promise(c=>{o=c}).then(()=>{clearInterval(n)});return t===0&&o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null);let o=e?e.internals===!0:!1;Dg&&Array.isArray(r)&&Dg(r),this._iitmHook=(s,a)=>{let i=s,n=s.startsWith("node:"),l;if(n)s=s.replace(/^node:/,"");else{if(s.startsWith("file://"))try{s=_F(s)}catch{}let c=Iae(s);c&&(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&&!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}function Qd(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Ug=p(()=>{});import*as hn from"path";import{types as yF}from"util";import{readFileSync as Dae}from"fs";function OF(r,e,t){return typeof e>"u"?r.includes("*"):r.some(o=>(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=>{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=>{if(Qd(a[i])&&this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=>yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(l=>{i.forEach(c=>{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(n=>{i.forEach(l=>{this._unwrap(n,l)})})};let s=this.init();s&&!Array.isArray(s)&&(s=[s]),this._modules=s||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,"package.json"),{encoding:"utf8"}),o=JSON.parse(t).version;return typeof o=="string"?o:void 0}catch{S.warn("Failed extracting version",e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&&a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=>u.name===l).filter(u=>OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=>(f.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=>{if(!l&&hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=>this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from"path";var PF=p(()=>{});var IF=p(()=>{CF();PF()});var kg=p(()=>{IF()});var eh,bF=p(()=>{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=>{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=>qs,InstrumentationNodeModuleDefinition:()=>eh,InstrumentationNodeModuleFile:()=>th,isWrapped:()=>Qd,registerInstrumentations:()=>o2,safeExecuteInTheMiddle:()=>gF,safeExecuteInTheMiddleAsync:()=>vF});var MF=p(()=>{s2();kg();bF();LF();Ug()});var Br,wF=p(()=>{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=>{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name="OTLPExporterError",a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&&Number.isFinite(r)&&r>0)return r;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+r+"')")}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&&o!==void 0?o:e.timeoutMillis)!==null&&s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&&a!==void 0?a:e.concurrencyLimit)!==null&&i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&&n!==void 0?n:e.compression)!==null&&l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var pc=p(()=>{});var sh,DF=p(()=>{(function(r){r.NONE="none",r.GZIP="gzip"})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=>{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length>=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function BF(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Vg(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Vg(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var FF=p(()=>{P()});var Er,GF=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Er||(Er={}))});var dc,Fg=p(()=>{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,"partialSuccess")}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn("Received Partial Success response:",JSON.stringify(r.partialSuccess))}}}var qF=p(()=>{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=>{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:"OTLPExportDelegate"})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error("Concurrent export limit reached")});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status==="success"){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,a.data)}t({code:Er.SUCCESS});return}else if(a.status==="failure"&&a.error){t({code:Er.FAILED,error:a.error});return}else a.status==="retryable"?t({code:Er.FAILED,error:new Ji("Export failed with retryable status")}):t({code:Er.FAILED,error:new Ji("Export failed with unknown error")})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug("shutdown started"),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=>{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=>sh,OTLPExporterBase:()=>Br,OTLPExporterError:()=>Ji,createOtlpNetworkExportDelegate:()=>jF,getSharedConfigurationDefaults:()=>oh,mergeOtlpSharedConfigurationWithDefaults:()=>ih});var _n=p(()=>{wF();rh();pc();DF();YF()});function zF(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var KF=p(()=>{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=>{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=>{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=>{XF();Xae=typeof BigInt<"u"?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=>{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=>ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>ph(t,o))}}:{}}var Ys=p(()=>{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=>{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=>{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=>{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=>({scope:js(t.scope),metrics:t.metrics.map(o=>rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=>nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=>{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=>rG(t,e))}}var Eh=p(()=>{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a="",schemaUrl:i=""}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=>({resource:zs(o),scopeLogs:Array.from(s,([,a])=>({scope:js(a[0].instrumentationScope),logRecords:a.map(i=>cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=>ph(e,r[e]))}var mh=p(()=>{Ec();Ys();hh()});var Yg=T((sVe,iG)=>{"use strict";iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s<arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&&(a=!1,l(c))}})}});var lG=T(aG=>{"use strict";var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&e.charAt(t)==="=";)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr<64;)sG[Ws[mr]=mr<26?mr+65:mr<52?mr+71:mr<62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t<o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c>>2],l=(c&3)<<4,n=1;break;case 1:a[i++]=Ws[l|c>>4],l=(c&15)<<2,n=2;break;case 2:a[i++]=Ws[l|c>>6],a[i++]=Ws[c&63],n=0;break}i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&&(a[i++]=Ws[l],a[i++]=61,n===1&&(a[i++]=61)),s?(i&&s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join("")):String.fromCharCode.apply(String,a.slice(0,i))};var oG="invalid encoding";Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n<e.length;){var l=e.charCodeAt(n++);if(l===61&&a>1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i<<2|(l&48)>>4,i=l,a=2;break;case 2:t[o++]=(i&15)<<4|(l&60)>>2,i=l,a=3;break;case 3:t[o++]=(i&3)<<6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=>{"use strict";cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=>{"use strict";EG.exports=fG(fG);function fG(r){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s<0?1:0;if(n&&(s=-s),s===0)o(1/s>0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s>34028234663852886e22)o((n<<31|2139095040)>>>0,a,i);else if(s<11754943508222875e-54)o((n<<31|Math.round(s/1401298464324817e-60))>>>0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&8388607;o((n<<31|l+127<<23|c)>>>0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i>>31)*2+1,l=i>>>23&255,c=i&8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i<0?1:0;if(c&&(i=-i),i===0)o(0,n,l+s),o(1/i>0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i>17976931348623157e292)o(0,n,l+s),o((c<<31|2146435072)>>>0,n,l+a);else{var u;if(i<22250738585072014e-324)u=i/5e-324,o(u>>>0,n,l+s),o((c<<31|u/4294967296)>>>0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&&(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496>>>0,n,l+s),o((c<<31|f+1023<<20|u*1048576&1048575)>>>0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c>>31)*2+1,f=c>>>20&2047,_=4294967296*(c&1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function dG(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function hG(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function _G(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var zg=T((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=>{"use strict";var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s<e.length;++s)o=e.charCodeAt(s),o<128?t+=1:o<2048?t+=2:(o&64512)===55296&&(e.charCodeAt(s+1)&64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s<1)return"";for(var a=null,i=[],n=0,l;t<o;)l=e[t++],l<128?i[n++]=l:l>191&&l<224?i[n++]=(l&31)<<6|e[t++]&63:l>239&&l<365?(l=((l&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,i[n++]=55296+(l>>10),i[n++]=56320+(l&1023)):i[n++]=(l&15)<<12|(e[t++]&63)<<6|e[t++]&63,n>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&&a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join("")):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n<e.length;++n)a=e.charCodeAt(n),a<128?t[o++]=a:a<2048?(t[o++]=a>>6|192,t[o++]=a&63|128):(a&64512)===55296&&((i=e.charCodeAt(n+1))&64512)===56320?(a=65536+((a&1023)<<10)+(i&1023),++n,t[o++]=a>>18|240,t[o++]=a>>12&63|128,t[o++]=a>>6&63|128,t[o++]=a&63|128):(t[o++]=a>>12|224,t[o++]=a>>6&63|128,t[o++]=a&63|128);return o-s}});var vG=T((fVe,gG)=>{"use strict";gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o>>>1,a=null,i=o;return function(l){if(l<1||l>s)return r(l);i+l>o&&(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&7&&(i=(i|7)+1),c}}});var OG=T((pVe,yG)=>{"use strict";yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r>>>0,this.hi=e>>>0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash="\0\0\0\0\0\0\0\0";tt.fromNumber=function(e){if(e===0)return Qi;var t=e<0;t&&(e=-e);var o=e>>>0,s=(e-o)/4294967296>>>0;return t&&(s=~s>>>0,o=~o>>>0,++o>4294967295&&(o=0,++s>4294967295&&(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e=="number")return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low>>>0,e.high>>>0):Qi};tt.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)<<8|$n.call(e,2)<<16|$n.call(e,3)<<24)>>>0,($n.call(e,4)|$n.call(e,5)<<8|$n.call(e,6)<<16|$n.call(e,7)<<24)>>>0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};tt.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}});var Fr=T($g=>{"use strict";var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);K.global=K.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};K.isString=function(e){return typeof e=="string"||e instanceof String};K.isObject=function(e){return e&&typeof e=="object"};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&&e.hasOwnProperty(t)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};K.Buffer=(function(){try{var r=K.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e=="number"?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};K.Array=typeof Uint8Array<"u"?Uint8Array:Array;K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long");K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s<o.length;++s)(r[o[s]]===void 0||!t)&&(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG("ProtocolError");K.oneOfGetter=function(e){for(var t={},o=0;o<e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a>-1;--a)if(t[s[a]]===1&&this[s[a]]!==void 0&&this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o<e.length;++o)e[o]!==t&&delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=>{"use strict";IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&&(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&255}function _le(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e<0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e>>>0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s<e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=>{"use strict";LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&&Xn.Buffer.prototype instanceof Uint8Array&&Xn.Buffer.prototype.set.name==="set"?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s<e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&&(e=Xn._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length<40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&&this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=>{"use strict";kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Ge(e);throw Error("illegal buffer")},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}Ge.prototype.fixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8>this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4>this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8>this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Sr(this);while(this.buf[this.pos++]&128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?"toLong":"toNumber";Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=>{"use strict";FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&&(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=>{"use strict";HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError("request must be specified");var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(l,c){if(l)return i.emit("error",l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?"decodeDelimited":"decode"](c)}catch(u){return i.emit("error",u,e),a(u)}return i.emit("data",c,e),a(null,c)})}catch(n){i.emit("error",n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var iv=T(jG=>{"use strict";var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=>{"use strict";YG.exports={}});var sv=T(KG=>{"use strict";var Ct=KG;Ct.build="minimal";Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=>{"use strict";$G.exports=sv()});var JG=T((OVe,WG)=>{"use strict";var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&&Object.hasOwnProperty.call(n,"stringValue")&&l.uint32(10).string(n.stringValue),n.boolValue!=null&&Object.hasOwnProperty.call(n,"boolValue")&&l.uint32(16).bool(n.boolValue),n.intValue!=null&&Object.hasOwnProperty.call(n,"intValue")&&l.uint32(24).int64(n.intValue),n.doubleValue!=null&&Object.hasOwnProperty.call(n,"doubleValue")&&l.uint32(33).double(n.doubleValue),n.arrayValue!=null&&Object.hasOwnProperty.call(n,"arrayValue")&&d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&&Object.hasOwnProperty.call(n,"kvlistValue")&&d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&&Object.hasOwnProperty.call(n,"bytesValue")&&l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(l.value=1,!h.isString(n.stringValue)))return"stringValue: string expected";if(n.boolValue!=null&&n.hasOwnProperty("boolValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.boolValue!="boolean")return"boolValue: boolean expected"}if(n.intValue!=null&&n.hasOwnProperty("intValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.intValue)&&!(n.intValue&&h.isInteger(n.intValue.low)&&h.isInteger(n.intValue.high)))return"intValue: integer|Long expected"}if(n.doubleValue!=null&&n.hasOwnProperty("doubleValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.doubleValue!="number")return"doubleValue: number expected"}if(n.arrayValue!=null&&n.hasOwnProperty("arrayValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return"arrayValue."+c}}if(n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return"kvlistValue."+c}}if(n.bytesValue!=null&&n.hasOwnProperty("bytesValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!(n.bytesValue&&typeof n.bytesValue.length=="number"||h.isString(n.bytesValue)))return"bytesValue: buffer expected"}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&&(l.stringValue=String(n.stringValue)),n.boolValue!=null&&(l.boolValue=!!n.boolValue),n.intValue!=null&&(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue=="string"?l.intValue=parseInt(n.intValue,10):typeof n.intValue=="number"?l.intValue=n.intValue:typeof n.intValue=="object"&&(l.intValue=new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber())),n.doubleValue!=null&&(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&&(typeof n.bytesValue=="string"?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length>=0&&(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(c.stringValue=n.stringValue,l.oneofs&&(c.value="stringValue")),n.boolValue!=null&&n.hasOwnProperty("boolValue")&&(c.boolValue=n.boolValue,l.oneofs&&(c.value="boolValue")),n.intValue!=null&&n.hasOwnProperty("intValue")&&(typeof n.intValue=="number"?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber():n.intValue,l.oneofs&&(c.value="intValue")),n.doubleValue!=null&&n.hasOwnProperty("doubleValue")&&(c.doubleValue=l.json&&!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&&(c.value="doubleValue")),n.arrayValue!=null&&n.hasOwnProperty("arrayValue")&&(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&&(c.value="arrayValue")),n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")&&(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&&(c.value="kvlistValue")),n.bytesValue!=null&&n.hasOwnProperty("bytesValue")&&(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&&(c.value="bytesValue")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.common.v1.AnyValue"},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.ArrayValue"},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValueList"},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&&Object.hasOwnProperty.call(i,"key")&&n.uint32(10).string(i.key),i.value!=null&&Object.hasOwnProperty.call(i,"value")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.key!=null&&i.hasOwnProperty("key")&&!h.isString(i.key))return"key: string expected";if(i.value!=null&&i.hasOwnProperty("value")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return"value."+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&&(n.key=String(i.key)),i.value!=null){if(typeof i.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.key="",l.value=null),i.key!=null&&i.hasOwnProperty("key")&&(l.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValue"},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(10).string(i.name),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&n.uint32(18).string(i.version),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.version!=null&&i.hasOwnProperty("version")&&!h.isString(i.version))return"version: string expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&&(n.name=String(i.name)),i.version!=null&&(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.name="",l.version="",l.droppedAttributesCount=0),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.version!=null&&i.hasOwnProperty("version")&&(l.version=i.version),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.InstrumentationScope"},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.droppedAttributesCount=0),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.resource.v1.Resource"},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&&i.resourceSpans.length)for(var l=0;l<i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceSpans&&c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceSpans!=null&&i.hasOwnProperty("resourceSpans")){if(!Array.isArray(i.resourceSpans))return"resourceSpans: array expected";for(var n=0;n<i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return"resourceSpans."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");n.resourceSpans=[];for(var l=0;l<i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceSpans=[]),i.resourceSpans&&i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c<i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.TracesData"},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&&i.scopeSpans.length)for(var l=0;l<i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&&c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeSpans!=null&&i.hasOwnProperty("scopeSpans")){if(!Array.isArray(i.scopeSpans))return"scopeSpans: array expected";for(var l=0;l<i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return"scopeSpans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");n.scopeSpans=[];for(var l=0;l<i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeSpans=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&&i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c<i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ResourceSpans"},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&&i.spans.length)for(var l=0;l<i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&&c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.spans!=null&&i.hasOwnProperty("spans")){if(!Array.isArray(i.spans))return"spans: array expected";for(var l=0;l<i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return"spans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");n.spans=[];for(var l=0;l<i.spans.length;++l){if(typeof i.spans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.spans=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&&i.spans.length){l.spans=[];for(var c=0;c<i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ScopeSpans"},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(10).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(18).bytes(i.spanId),i.traceState!=null&&Object.hasOwnProperty.call(i,"traceState")&&n.uint32(26).string(i.traceState),i.parentSpanId!=null&&Object.hasOwnProperty.call(i,"parentSpanId")&&n.uint32(34).bytes(i.parentSpanId),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(42).string(i.name),i.kind!=null&&Object.hasOwnProperty.call(i,"kind")&&n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"endTimeUnixNano")&&n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&&i.events.length)for(var l=0;l<i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&&Object.hasOwnProperty.call(i,"droppedEventsCount")&&n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&&i.links.length)for(var l=0;l<i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&&Object.hasOwnProperty.call(i,"droppedLinksCount")&&n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&&Object.hasOwnProperty.call(i,"status")&&d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&&c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&&c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId)))return"traceId: buffer expected";if(i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId)))return"spanId: buffer expected";if(i.traceState!=null&&i.hasOwnProperty("traceState")&&!h.isString(i.traceState))return"traceState: string expected";if(i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&!(i.parentSpanId&&typeof i.parentSpanId.length=="number"||h.isString(i.parentSpanId)))return"parentSpanId: buffer expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.kind!=null&&i.hasOwnProperty("kind"))switch(i.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&!h.isInteger(i.endTimeUnixNano)&&!(i.endTimeUnixNano&&h.isInteger(i.endTimeUnixNano.low)&&h.isInteger(i.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(i.events!=null&&i.hasOwnProperty("events")){if(!Array.isArray(i.events))return"events: array expected";for(var n=0;n<i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return"events."+l}}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&!h.isInteger(i.droppedEventsCount))return"droppedEventsCount: integer expected";if(i.links!=null&&i.hasOwnProperty("links")){if(!Array.isArray(i.links))return"links: array expected";for(var n=0;n<i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return"links."+l}}if(i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&!h.isInteger(i.droppedLinksCount))return"droppedLinksCount: integer expected";if(i.status!=null&&i.hasOwnProperty("status")){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return"status."+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),i.traceState!=null&&(n.traceState=String(i.traceState)),i.parentSpanId!=null&&(typeof i.parentSpanId=="string"?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length>=0&&(n.parentSpanId=i.parentSpanId)),i.name!=null&&(n.name=String(i.name)),i.kind){default:if(typeof i.kind=="number"){n.kind=i.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:n.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:n.kind=1;break;case"SPAN_KIND_SERVER":case 2:n.kind=2;break;case"SPAN_KIND_CLIENT":case 3:n.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:n.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.endTimeUnixNano!=null&&(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano=="string"?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano=="number"?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano=="object"&&(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.events){if(!Array.isArray(i.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");n.events=[];for(var l=0;l<i.events.length;++l){if(typeof i.events[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&&(n.droppedEventsCount=i.droppedEventsCount>>>0),i.links){if(!Array.isArray(i.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");n.links=[];for(var l=0;l<i.links.length;++l){if(typeof i.links[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&&(n.droppedLinksCount=i.droppedLinksCount>>>0),i.status!=null){if(typeof i.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),l.traceState="",n.bytes===String?l.parentSpanId="":(l.parentSpanId=[],n.bytes!==Array&&(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name="",l.kind=n.enums===String?"SPAN_KIND_UNSPECIFIED":0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?"0":0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&&i.hasOwnProperty("traceState")&&(l.traceState=i.traceState),i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.kind!=null&&i.hasOwnProperty("kind")&&(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&(typeof i.endTimeUnixNano=="number"?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber():i.endTimeUnixNano),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.events&&i.events.length){l.events=[];for(var u=0;u<i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&(l.droppedEventsCount=i.droppedEventsCount),i.links&&i.links.length){l.links=[];for(var u=0;u<i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&&i.hasOwnProperty("status")&&(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Span"},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]="SPAN_KIND_UNSPECIFIED"]=0,i[a[1]="SPAN_KIND_INTERNAL"]=1,i[a[2]="SPAN_KIND_SERVER"]=2,i[a[3]="SPAN_KIND_CLIENT"]=3,i[a[4]="SPAN_KIND_PRODUCER"]=4,i[a[5]="SPAN_KIND_CONSUMER"]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(18).string(n.name),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.name!=null&&(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.name="",c.droppedAttributesCount=0}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Event"},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(10).bytes(n.traceId),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(18).bytes(n.spanId),n.traceState!=null&&Object.hasOwnProperty.call(n,"traceState")&&l.uint32(26).string(n.traceState),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId)))return"traceId: buffer expected";if(n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId)))return"spanId: buffer expected";if(n.traceState!=null&&n.hasOwnProperty("traceState")&&!h.isString(n.traceState))return"traceState: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceState!=null&&(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults&&(l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),c.traceState="",c.droppedAttributesCount=0),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&&n.hasOwnProperty("traceState")&&(c.traceState=n.traceState),n.attributes&&n.attributes.length){c.attributes=[];for(var u=0;u<n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Link"},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&&Object.hasOwnProperty.call(i,"message")&&n.uint32(18).string(i.message),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos<l;){var u=i.uint32();switch(u>>>3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.message!=null&&i.hasOwnProperty("message")&&!h.isString(i.message))return"message: string expected";if(i.code!=null&&i.hasOwnProperty("code"))switch(i.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&&(n.message=String(i.message)),i.code){default:if(typeof i.code=="number"){n.code=i.code;break}break;case"STATUS_CODE_UNSET":case 0:n.code=0;break;case"STATUS_CODE_OK":case 1:n.code=1;break;case"STATUS_CODE_ERROR":case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.message="",l.code=n.enums===String?"STATUS_CODE_UNSET":0),i.message!=null&&i.hasOwnProperty("message")&&(l.message=i.message),i.code!=null&&i.hasOwnProperty("code")&&(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Status"},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]="STATUS_CODE_UNSET"]=0,i[a[1]="STATUS_CODE_OK"]=1,i[a[2]="STATUS_CODE_ERROR"]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&&n.resourceSpans.length)for(var c=0;c<n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceSpans&&u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceSpans!=null&&n.hasOwnProperty("resourceSpans")){if(!Array.isArray(n.resourceSpans))return"resourceSpans: array expected";for(var l=0;l<n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return"resourceSpans."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");l.resourceSpans=[];for(var c=0;c<n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceSpans=[]),n.resourceSpans&&n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u<n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&&Object.hasOwnProperty.call(n,"rejectedSpans")&&l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&!h.isInteger(n.rejectedSpans)&&!(n.rejectedSpans&&h.isInteger(n.rejectedSpans.low)&&h.isInteger(n.rejectedSpans.high))?"rejectedSpans: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&&(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans=="string"?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans=="number"?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans=="object"&&(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&(typeof n.rejectedSpans=="number"?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber():n.rejectedSpans),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&&n.resourceMetrics.length)for(var c=0;c<n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceMetrics&&u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceMetrics!=null&&n.hasOwnProperty("resourceMetrics")){if(!Array.isArray(n.resourceMetrics))return"resourceMetrics: array expected";for(var l=0;l<n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return"resourceMetrics."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");l.resourceMetrics=[];for(var c=0;c<n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceMetrics=[]),n.resourceMetrics&&n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u<n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&&Object.hasOwnProperty.call(n,"rejectedDataPoints")&&l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&!h.isInteger(n.rejectedDataPoints)&&!(n.rejectedDataPoints&&h.isInteger(n.rejectedDataPoints.low)&&h.isInteger(n.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&&(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints=="string"?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints=="number"?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints=="object"&&(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&(typeof n.rejectedDataPoints=="number"?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&&n.resourceLogs.length)for(var c=0;c<n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceLogs&&u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceLogs!=null&&n.hasOwnProperty("resourceLogs")){if(!Array.isArray(n.resourceLogs))return"resourceLogs: array expected";for(var l=0;l<n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return"resourceLogs."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");l.resourceLogs=[];for(var c=0;c<n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceLogs=[]),n.resourceLogs&&n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u<n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&&Object.hasOwnProperty.call(n,"rejectedLogRecords")&&l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&!h.isInteger(n.rejectedLogRecords)&&!(n.rejectedLogRecords&&h.isInteger(n.rejectedLogRecords.low)&&h.isInteger(n.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&&(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords=="string"?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords=="number"?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords=="object"&&(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&(typeof n.rejectedLogRecords=="number"?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&&i.resourceMetrics.length)for(var l=0;l<i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceMetrics&&c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceMetrics!=null&&i.hasOwnProperty("resourceMetrics")){if(!Array.isArray(i.resourceMetrics))return"resourceMetrics: array expected";for(var n=0;n<i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return"resourceMetrics."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");n.resourceMetrics=[];for(var l=0;l<i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceMetrics=[]),i.resourceMetrics&&i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c<i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.MetricsData"},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&&i.scopeMetrics.length)for(var l=0;l<i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&&c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeMetrics!=null&&i.hasOwnProperty("scopeMetrics")){if(!Array.isArray(i.scopeMetrics))return"scopeMetrics: array expected";for(var l=0;l<i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return"scopeMetrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");n.scopeMetrics=[];for(var l=0;l<i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeMetrics=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&&i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c<i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&&i.metrics.length)for(var l=0;l<i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&&c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.metrics!=null&&i.hasOwnProperty("metrics")){if(!Array.isArray(i.metrics))return"metrics: array expected";for(var l=0;l<i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return"metrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");n.metrics=[];for(var l=0;l<i.metrics.length;++l){if(typeof i.metrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.metrics=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&&i.metrics.length){l.metrics=[];for(var c=0;c<i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,"data",{get:h.oneOfGetter(a=["gauge","sum","histogram","exponentialHistogram","summary"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(10).string(n.name),n.description!=null&&Object.hasOwnProperty.call(n,"description")&&l.uint32(18).string(n.description),n.unit!=null&&Object.hasOwnProperty.call(n,"unit")&&l.uint32(26).string(n.unit),n.gauge!=null&&Object.hasOwnProperty.call(n,"gauge")&&d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&&Object.hasOwnProperty.call(n,"histogram")&&d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&&Object.hasOwnProperty.call(n,"exponentialHistogram")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&&Object.hasOwnProperty.call(n,"summary")&&d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.description!=null&&n.hasOwnProperty("description")&&!h.isString(n.description))return"description: string expected";if(n.unit!=null&&n.hasOwnProperty("unit")&&!h.isString(n.unit))return"unit: string expected";if(n.gauge!=null&&n.hasOwnProperty("gauge")){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return"gauge."+c}}if(n.sum!=null&&n.hasOwnProperty("sum")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return"sum."+c}}if(n.histogram!=null&&n.hasOwnProperty("histogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return"histogram."+c}}if(n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return"exponentialHistogram."+c}}if(n.summary!=null&&n.hasOwnProperty("summary")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return"summary."+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&&(l.name=String(n.name)),n.description!=null&&(l.description=String(n.description)),n.unit!=null&&(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.name="",c.description="",c.unit=""),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.description!=null&&n.hasOwnProperty("description")&&(c.description=n.description),n.unit!=null&&n.hasOwnProperty("unit")&&(c.unit=n.unit),n.gauge!=null&&n.hasOwnProperty("gauge")&&(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&&(c.data="gauge")),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&&(c.data="sum")),n.histogram!=null&&n.hasOwnProperty("histogram")&&(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&&(c.data="histogram")),n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")&&(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&&(c.data="exponentialHistogram")),n.summary!=null&&n.hasOwnProperty("summary")&&(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&&(c.data="summary")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Metric"},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Gauge"},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&&Object.hasOwnProperty.call(i,"isMonotonic")&&n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&typeof i.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&&(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,l.isMonotonic=!1),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Sum"},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Histogram"},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Summary"},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,a[s[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,a[s[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,a[s[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(33).double(n.asDouble),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.bucketCounts!=null&&n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c<n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&&n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c<n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(89).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 9:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&&u.bucketCounts.length||(u.bucketCounts=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&&u.explicitBounds.length||(u.explicitBounds=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.bucketCounts!=null&&n.hasOwnProperty("bucketCounts")){if(!Array.isArray(n.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&&!(n.bucketCounts[c]&&h.isInteger(n.bucketCounts[c].low)&&h.isInteger(n.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}if(n.explicitBounds!=null&&n.hasOwnProperty("explicitBounds")){if(!Array.isArray(n.explicitBounds))return"explicitBounds: array expected";for(var c=0;c<n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!="number")return"explicitBounds: number[] expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");l.bucketCounts=[];for(var c=0;c<n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]=="string"?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]=="number"?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]=="object"&&(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low>>>0,n.bucketCounts[c].high>>>0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");l.explicitBounds=[];for(var c=0;c<n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.bucketCounts&&n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f<n.bucketCounts.length;++f)typeof n.bucketCounts[f]=="number"?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low>>>0,n.bucketCounts[f].high>>>0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&&n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f<n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&&!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.scale!=null&&Object.hasOwnProperty.call(n,"scale")&&l.uint32(48).sint32(n.scale),n.zeroCount!=null&&Object.hasOwnProperty.call(n,"zeroCount")&&l.uint32(57).fixed64(n.zeroCount),n.positive!=null&&Object.hasOwnProperty.call(n,"positive")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&&Object.hasOwnProperty.call(n,"negative")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(97).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(105).double(n.max),n.zeroThreshold!=null&&Object.hasOwnProperty.call(n,"zeroThreshold")&&l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.scale!=null&&n.hasOwnProperty("scale")&&!h.isInteger(n.scale))return"scale: integer expected";if(n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&!h.isInteger(n.zeroCount)&&!(n.zeroCount&&h.isInteger(n.zeroCount.low)&&h.isInteger(n.zeroCount.high)))return"zeroCount: integer|Long expected";if(n.positive!=null&&n.hasOwnProperty("positive")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return"positive."+u}if(n.negative!=null&&n.hasOwnProperty("negative")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return"negative."+u}if(n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags))return"flags: integer expected";if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&typeof n.zeroThreshold!="number"?"zeroThreshold: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.scale!=null&&(l.scale=n.scale|0),n.zeroCount!=null&&(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount=="string"?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount=="number"?l.zeroCount=n.zeroCount:typeof n.zeroCount=="object"&&(l.zeroCount=new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber())),n.positive!=null){if(typeof n.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&&(l.flags=n.flags>>>0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),n.zeroThreshold!=null&&(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?"0":0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.scale!=null&&n.hasOwnProperty("scale")&&(c.scale=n.scale),n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&(typeof n.zeroCount=="number"?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber():n.zeroCount),n.positive!=null&&n.hasOwnProperty("positive")&&(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&&n.hasOwnProperty("negative")&&(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&(c.zeroThreshold=l.json&&!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c<l.length;++c)n[l[c]]!=null&&(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&&Object.hasOwnProperty.call(l,"offset")&&c.uint32(8).sint32(l.offset),l.bucketCounts!=null&&l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u<l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos<u;){var _=l.uint32();switch(_>>>3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&&f.bucketCounts.length||(f.bucketCounts=[]),(_&7)===2)for(var m=l.uint32()+l.pos;l.pos<m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!="object"||l===null)return"object expected";if(l.offset!=null&&l.hasOwnProperty("offset")&&!h.isInteger(l.offset))return"offset: integer expected";if(l.bucketCounts!=null&&l.hasOwnProperty("bucketCounts")){if(!Array.isArray(l.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&&!(l.bucketCounts[c]&&h.isInteger(l.bucketCounts[c].low)&&h.isInteger(l.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&&(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");c.bucketCounts=[];for(var u=0;u<l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]=="string"?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]=="number"?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]=="object"&&(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low>>>0,l.bucketCounts[u].high>>>0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.bucketCounts=[]),c.defaults&&(u.offset=0),l.offset!=null&&l.hasOwnProperty("offset")&&(u.offset=l.offset),l.bucketCounts&&l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f<l.bucketCounts.length;++f)typeof l.bucketCounts[f]=="number"?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low>>>0,l.bucketCounts[f].high>>>0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&&(l="type.googleapis.com"),l+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&&Object.hasOwnProperty.call(i,"count")&&n.uint32(33).fixed64(i.count),i.sum!=null&&Object.hasOwnProperty.call(i,"sum")&&n.uint32(41).double(i.sum),i.quantileValues!=null&&i.quantileValues.length)for(var l=0;l<i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos<l;){var u=i.uint32();switch(u>>>3){case 7:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&&c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.count!=null&&i.hasOwnProperty("count")&&!h.isInteger(i.count)&&!(i.count&&h.isInteger(i.count.low)&&h.isInteger(i.count.high)))return"count: integer|Long expected";if(i.sum!=null&&i.hasOwnProperty("sum")&&typeof i.sum!="number")return"sum: number expected";if(i.quantileValues!=null&&i.hasOwnProperty("quantileValues")){if(!Array.isArray(i.quantileValues))return"quantileValues: array expected";for(var n=0;n<i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return"quantileValues."+l}}return i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.count!=null&&(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count=="string"?n.count=parseInt(i.count,10):typeof i.count=="number"?n.count=i.count:typeof i.count=="object"&&(n.count=new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber())),i.sum!=null&&(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");n.quantileValues=[];for(var l=0;l<i.quantileValues.length;++l){if(typeof i.quantileValues[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&&(n.flags=i.flags>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?"0":0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.count!=null&&i.hasOwnProperty("count")&&(typeof i.count=="number"?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber():i.count),i.sum!=null&&i.hasOwnProperty("sum")&&(l.sum=n.json&&!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&&i.quantileValues.length){l.quantileValues=[];for(var u=0;u<i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&&Object.hasOwnProperty.call(n,"quantile")&&l.uint32(9).double(n.quantile),n.value!=null&&Object.hasOwnProperty.call(n,"value")&&l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.quantile!=null&&n.hasOwnProperty("quantile")&&typeof n.quantile!="number"?"quantile: number expected":n.value!=null&&n.hasOwnProperty("value")&&typeof n.value!="number"?"value: number expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&&(l.quantile=Number(n.quantile)),n.value!=null&&(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.quantile=0,c.value=0),n.quantile!=null&&n.hasOwnProperty("quantile")&&(c.quantile=l.json&&!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&&n.hasOwnProperty("value")&&(c.value=l.json&&!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(25).double(n.asDouble),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(34).bytes(n.spanId),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(42).bytes(n.traceId),n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&&n.filteredAttributes.length)for(var c=0;c<n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.filteredAttributes&&u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.filteredAttributes!=null&&n.hasOwnProperty("filteredAttributes")){if(!Array.isArray(n.filteredAttributes))return"filteredAttributes: array expected";for(var c=0;c<n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return"filteredAttributes."+u}}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}return n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId))?"spanId: buffer expected":n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId))?"traceId: buffer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");l.filteredAttributes=[];for(var c=0;c<n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.filteredAttributes&&n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f<n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Exemplar"},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&&i.resourceLogs.length)for(var l=0;l<i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceLogs&&c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceLogs!=null&&i.hasOwnProperty("resourceLogs")){if(!Array.isArray(i.resourceLogs))return"resourceLogs: array expected";for(var n=0;n<i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return"resourceLogs."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");n.resourceLogs=[];for(var l=0;l<i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceLogs=[]),i.resourceLogs&&i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c<i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogsData"},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&&i.scopeLogs.length)for(var l=0;l<i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&&c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeLogs!=null&&i.hasOwnProperty("scopeLogs")){if(!Array.isArray(i.scopeLogs))return"scopeLogs: array expected";for(var l=0;l<i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return"scopeLogs."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");n.scopeLogs=[];for(var l=0;l<i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeLogs=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&&i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c<i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ResourceLogs"},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&&i.logRecords.length)for(var l=0;l<i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&&c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.logRecords!=null&&i.hasOwnProperty("logRecords")){if(!Array.isArray(i.logRecords))return"logRecords: array expected";for(var l=0;l<i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return"logRecords."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");n.logRecords=[];for(var l=0;l<i.logRecords.length;++l){if(typeof i.logRecords[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.logRecords=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&&i.logRecords.length){l.logRecords=[];for(var c=0;c<i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ScopeLogs"},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,a[s[1]="SEVERITY_NUMBER_TRACE"]=1,a[s[2]="SEVERITY_NUMBER_TRACE2"]=2,a[s[3]="SEVERITY_NUMBER_TRACE3"]=3,a[s[4]="SEVERITY_NUMBER_TRACE4"]=4,a[s[5]="SEVERITY_NUMBER_DEBUG"]=5,a[s[6]="SEVERITY_NUMBER_DEBUG2"]=6,a[s[7]="SEVERITY_NUMBER_DEBUG3"]=7,a[s[8]="SEVERITY_NUMBER_DEBUG4"]=8,a[s[9]="SEVERITY_NUMBER_INFO"]=9,a[s[10]="SEVERITY_NUMBER_INFO2"]=10,a[s[11]="SEVERITY_NUMBER_INFO3"]=11,a[s[12]="SEVERITY_NUMBER_INFO4"]=12,a[s[13]="SEVERITY_NUMBER_WARN"]=13,a[s[14]="SEVERITY_NUMBER_WARN2"]=14,a[s[15]="SEVERITY_NUMBER_WARN3"]=15,a[s[16]="SEVERITY_NUMBER_WARN4"]=16,a[s[17]="SEVERITY_NUMBER_ERROR"]=17,a[s[18]="SEVERITY_NUMBER_ERROR2"]=18,a[s[19]="SEVERITY_NUMBER_ERROR3"]=19,a[s[20]="SEVERITY_NUMBER_ERROR4"]=20,a[s[21]="SEVERITY_NUMBER_FATAL"]=21,a[s[22]="SEVERITY_NUMBER_FATAL2"]=22,a[s[23]="SEVERITY_NUMBER_FATAL3"]=23,a[s[24]="SEVERITY_NUMBER_FATAL4"]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,a[s[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&&Object.hasOwnProperty.call(i,"severityNumber")&&n.uint32(16).int32(i.severityNumber),i.severityText!=null&&Object.hasOwnProperty.call(i,"severityText")&&n.uint32(26).string(i.severityText),i.body!=null&&Object.hasOwnProperty.call(i,"body")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(69).fixed32(i.flags),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(74).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"observedTimeUnixNano")&&n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&!h.isInteger(i.observedTimeUnixNano)&&!(i.observedTimeUnixNano&&h.isInteger(i.observedTimeUnixNano.low)&&h.isInteger(i.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(i.severityNumber!=null&&i.hasOwnProperty("severityNumber"))switch(i.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&&i.hasOwnProperty("severityText")&&!h.isString(i.severityText))return"severityText: string expected";if(i.body!=null&&i.hasOwnProperty("body")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return"body."+n}if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var l=0;l<i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return"attributes."+n}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId))?"traceId: buffer expected":i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId))?"spanId: buffer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.observedTimeUnixNano!=null&&(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano=="string"?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano=="number"?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano=="object"&&(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber=="number"){n.severityNumber=i.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:n.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:n.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:n.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:n.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:n.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:n.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:n.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:n.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:n.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:n.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:n.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:n.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:n.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:n.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:n.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:n.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:n.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:n.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:n.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:n.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:n.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:n.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:n.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:n.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:n.severityNumber=24;break}if(i.severityText!=null&&(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.flags!=null&&(n.flags=i.flags>>>0),i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(l.severityNumber=n.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,l.severityText="",l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?"0":0}if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.severityNumber!=null&&i.hasOwnProperty("severityNumber")&&(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&&i.hasOwnProperty("severityText")&&(l.severityText=i.severityText),i.body!=null&&i.hasOwnProperty("body")&&(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&(typeof i.observedTimeUnixNano=="number"?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogRecord"},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=>{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=>{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=>gle.decode(r)},QG={serializeRequest:r=>{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=>yle.decode(r)},Rh={serializeRequest:r=>{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=>Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=>{_h();Eh();mh();Nh={serializeRequest:r=>{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=>{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=>{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=>fh,JsonLogsSerializer:()=>Ch,JsonMetricsSerializer:()=>e3,JsonTraceSerializer:()=>Nh,ProtobufLogsSerializer:()=>Ah,ProtobufMetricsSerializer:()=>QG,ProtobufTraceSerializer:()=>Rh,createExportLogsServiceRequest:()=>Xs,createExportMetricsServiceRequest:()=>$s,createExportTraceServiceRequest:()=>Ks,encodeAsLongBits:()=>uh,encodeAsString:()=>jg,getOtlpEncoder:()=>Kn,hrTimeToNanos:()=>ch,toLongBits:()=>qg});var to=p(()=>{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=>{r3="0.56.0"});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t>=0?t:0}}var s3=p(()=>{});var c3={};Ae(c3,{compressAndSend:()=>l3,createHttpAgent:()=>Ile,sendWithHttp:()=>Cle});import*as Ph from"http";import*as Ih from"https";import*as a3 from"zlib";import{Readable as Nle}from"stream";function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(".")[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:"POST",headers:lv({},r.headers()),agent:e},l=a.protocol==="http:"?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on("data",function(m){return _.push(m)}),f.on("end",function(){if(f.statusCode&&f.statusCode<299)o({status:"success",data:Buffer.concat(_)});else if(f.statusCode&&i3(f.statusCode))o({status:"retryable",retryInMillis:o3(f.headers["retry-after"])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:"failure",error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:"failure",error:new Error("Request Timeout")})}),c.on("error",function(f){o({status:"failure",error:f})});var u=i>=14?"close":"abort";c.on(u,function(){o({status:"failure",error:new Error("Request timed out")})}),l3(c,r.compression,t,function(f){o({status:"failure",error:f})})}function l3(r,e,t,o){var s=Ple(t);e==="gzip"&&(r.setHeader("Content-Encoding","gzip"),s=s.on("error",o).pipe(a3.createGzip()).on("error",o)),s.pipe(r).on("error",o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol==="http:"?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=>{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=>{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&&(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=>{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status==="retryable"&&i>0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&&o!==void 0?o:l,u=s-Date.now(),c>u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=>{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&&t!==""){var o=Number(t);if(!Number.isNaN(o)&&Number.isFinite(o)&&o>0)return o;S.warn("Configuration: "+r+" is invalid, expected number greater than 0 (actual: "+t+")")}}function Gle(r){var e=m3("OTEL_EXPORTER_OTLP_"+r+"_TIMEOUT"),t=m3("OTEL_EXPORTER_OTLP_TIMEOUT");return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==""){if(t==null||t==="none"||t==="gzip")return t;S.warn("Configuration: "+r+" is invalid, expected 'none' or 'gzip' (actual: '"+t+"')")}}function Hle(r){var e=T3("OTEL_EXPORTER_OTLP_"+r+"_COMPRESSION"),t=T3("OTEL_EXPORTER_OTLP_COMPRESSION");return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=>{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&&e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i<"u"?t[a]=String(i):S.warn('Header "'+a+'" has invalid value ('+i+") and will be ignored")}),t}}var qle,g3=p(()=>{P();qle=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&&Object.assign(s,e()),r!=null&&Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error("Configuration: Could not parse user-provided export URL: '"+r+"'")}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&&a!==void 0?a:e.agentOptions)!==null&&i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=>{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_HEADERS"])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&&Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}}function $le(r,e){try{new URL(r)}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}r.endsWith("/")||(r=r+"/"),r+=e;try{new URL(r)}catch{S.warn("Configuration: Provided URL appended with '"+e+"' is not a valid URL, using 'undefined' instead of '"+r+"'");return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return $le(t,r)}function Wle(r){var e,t=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_ENDPOINT"])===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&&t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=>{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&&(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&&(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&&S.warn("Metadata cannot be set when using http"),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=>{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=>qr,createOtlpHttpExportDelegate:()=>Hr,getSharedConfigurationFromEnvironment:()=>bh});var Js=p(()=>{E3();cv();N3()});var Qs,P3=p(()=>{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${r3}`,"Content-Type":"application/json"}),Ch))}}});var I3=p(()=>{P3()});var b3=p(()=>{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=>Qs});var x3=p(()=>{b3()});var ue=T(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.NONE=3]="NONE"})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]="DEADLINE",r[r.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",r[r.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",r[r.CANCELLATION=8]="CANCELLATION",r[r.DEFAULTS=65535]="DEFAULTS"})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=>{Qle.exports={name:"@grpc/grpc-js",version:"1.13.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var Pe=T(Bt=>{"use strict";var fv,pv,dv,hv;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V("process"),ece=uv().version,tce={error:(r,...e)=>{console.error("E "+r,...e)},info:(r,...e)=>{console.error("I "+r,...e)},debug:(r,...e)=>{console.error("D "+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&&fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&&pv!==void 0?pv:"";switch(rce.toUpperCase()){case"DEBUG":Zs=Wn.LogVerbosity.DEBUG;break;case"INFO":Zs=Wn.LogVerbosity.INFO;break;case"ERROR":Zs=Wn.LogVerbosity.ERROR;break;case"NONE":Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=>no;Bt.getLogger=nce;var ice=r=>{no=r};Bt.setLogger=ice;var oce=r=>{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=>{let t;if(r>=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&&t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&&dv!==void 0?dv:process.env.GRPC_TRACE)!==null&&hv!==void 0?hv:"",_v=new Set,U3=new Set;for(let r of ace.split(","))r.startsWith("-")?U3.add(r.substring(1)):_v.add(r);var lce=_v.has("all");function cce(r,e,t){k3(e)&&(0,Bt.log)(r,new Date().toISOString()+" | v"+ece+" "+Zle.pid+" | "+e+" | "+t)}function k3(r){return!U3.has(r)&&(lce||_v.has(r))}});var Mh=T(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r=="object"&&r!==null&&"code"in r&&typeof r.code=="number"?r.code:null}});var ht=T(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith("-bin")}function Sce(r){return!r.startsWith("grpc-")}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error('Metadata key "'+r+'" contains illegal characters');if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Tce(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length>0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=>Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===":")continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=>{t.add(o,Buffer.from(a,"base64"))}):s!==void 0&&(Sce(o)?s.split(",").forEach(a=>{t.add(o,Buffer.from(a.trim(),"base64"))}):t.add(o,Buffer.from(s,"base64"))):Array.isArray(s)?s.forEach(a=>{t.add(o,a)}):s!==void 0&&t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=>Buffer.isBuffer(r)?r.toString("base64"):r});var kh=T(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return"getRequestHeaders"in r&&typeof r.getRequestHeaders=="function"}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=>{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=>{e.getRequestMetadata(t.service_url,(n,l)=>{if(n){i(n);return}if(!l){i(new Error("Headers not set by metadata plugin"));return}a(l)})}),s.then(a=>{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=>{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=>s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=>t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=>{this.metadataGenerator(e,(s,a)=>{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V("fs");gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&&(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith("[")){let e=r.indexOf("]");if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(":")===-1)return null;if(r.length>e+1)if(r[e+1]===":"){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(":");return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(":")?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e="";return r.scheme!==void 0&&(e+=r.scheme+":"),r.authority!==void 0&&(e+="//"+r.authority+"/"),e+=r.path,e}});var jr=T(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&&r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&&r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V("tls"),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&&!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,"Root certificate"),Rv(t,"Private key"),Rv(o,"Certificate chain"),t&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&o)throw new Error("Certificate chain must be given with accompanying private key");let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&&a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if("grpc.http_connect_target"in o){let f=(0,H3.parseUri)(o["grpc.http_connect_target"]);f&&(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&&s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&&(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=["h2"],o["grpc.ssl_target_name_override"]){let f=o["grpc.ssl_target_name_override"],_=(a=i.checkServerIdentity)!==null&&a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=>_(f,O),i.servername=f}else i.servername=u;return o["grpc-node.tls_enable_trace"]&&(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=>{let a=(0,vc.connect)(t,()=>{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&&i!==void 0)||i)&&!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on("error",i=>{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,"Failed to createSecureContext with error "+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=>{let o=this.parent.getLatestSecureContext();if(!o){t(new Error("Failed to load credentials"));return}r.closed&&t(new Error("Socket closed while loading credentials"));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=>{t(new Error("Socket closed"))},n=c=>{t(c)},l=(0,vc.connect)(a,()=>{var c;if(l.removeListener("close",i),l.removeListener("error",n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&&c!==void 0)||c)&&!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once("close",i),l.once("error",n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&&a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&&n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error("No default load balancer type registered");return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,"Config parsing failed with error",o.message);continue}return e&&Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V("os"),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce="node";function Xce(r){if("service"in r&&r.service!==""){if(typeof r.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if("method"in r&&r.method!==""){if(typeof r.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if("method"in r&&r.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function Wce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in r)||typeof r.initialBackoff!="string"||!Hh.test(r.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in r)||typeof r.maxBackoff!="string"||!Hh.test(r.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in r)||typeof r.backoffMultiplier!="number"||r.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in r&&Array.isArray(r.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(r.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of r.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Gh.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in r&&(typeof r.hedgingDelay!="string"||!Hh.test(r.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in r&&Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Gh.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&&(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&&(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!("name"in r)||!Array.isArray(r.name))throw new Error("Invalid method config: invalid name array");for(let o of r.name)t.name.push(Xce(o));if("waitForReady"in r){if(typeof r.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=r.waitForReady}if("timeout"in r)if(typeof r.timeout=="object"){if(!("seconds"in r.timeout)||typeof r.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in r.timeout)||typeof r.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=r.timeout}else if(typeof r.timeout=="string"&&Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(".");t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in r){if(typeof r.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=r.maxRequestBytes}if("maxResponseBytes"in r){if(typeof r.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=r.maxResponseBytes}if("retryPolicy"in r){if("hedgingPolicy"in r)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=Wce(r.retryPolicy)}else"hedgingPolicy"in r&&(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!("maxTokens"in r)||typeof r.maxTokens!="number"||r.maxTokens<=0||r.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in r)||typeof r.tokenRatio!="number"||r.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r=="object"&&r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in r)if(typeof r.loadBalancingPolicy=="string")e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in r&&Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));"retryThrottling"in r&&(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&&s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!("serviceConfig"in r))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:z3(r.serviceConfig)};if("clientLanguage"in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o=="string")e.clientLanguage.push(o);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o=="string")e.clientHostname.push(o);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in r)if(typeof r.percentage=="number"&&0<=r.percentage&&r.percentage<=100)e.percentage=r.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error("Invalid service config list");for(let t of r){let o=eue(t);if(!(typeof o.percentage=="number"&&e>o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&&(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&&(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error("No matching service config found")}function rue(r,e){for(let t of r)if(t.length>0&&t[0].startsWith("grpc_config=")){let o=t.join("").substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]="IDLE",r[r.CONNECTING=1]="CONNECTING",r[r.READY=2]="READY",r[r.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",r[r.SHUTDOWN=4]="SHUTDOWN"})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]="COMPLETE",r[r.QUEUE=1]="QUEUE",r[r.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",r[r.DROP=3]="DROP"})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:"No connection established",metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue="backoff",lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,"{"+this.id+"} "+e)}runTimer(e){var t,o;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue="child_load_balancer_helper",Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===o&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue="resolving_load_balancer";function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Cue(r,e,t,o){for(let s of t.name)switch(o){case"EMPTY":if(!s.service&&!s.method)return!0;break;case"SERVICE":if(s.service===r&&!s.method)return!0;break;case"SERVICE_AND_METHOD":if(s.service===r&&s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split("/").filter(l=>l.length>0),i=(o=a[0])!==null&&o!==void 0?o:"",n=(s=a[1])!==null&&s!==void 0?s:"";if(r&&r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?($3("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=>{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=>{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&&_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=>{this.handleResolutionFailure(n)}},o);let i={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Sue.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&&this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+" "+It.ConnectivityState[this.currentState]+" -> "+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&&(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&&(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V("net");function bc(r){return"port"in r}function Wh(r,e){return!r&&!e?!0:!r||!e?!1:bc(r)?bc(e)&&r.host===e.host&&r.port===e.port:!bc(e)&&r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t<r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return"["+r.addresses.map(Q3).join(", ")+"]"}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&&(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=>Hue});function na(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(t=0)),t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError("Iterator access denied!")}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=>{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&&(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&&(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&&(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&&(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&&(t=function(a,i){return a<i?-1:a>i?1:0}),o===void 0&&(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)t=t.i;else if(a>0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)s=t,t=t.i;else if(a>0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&&s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&&s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&&s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&&s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&&(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t=="number"?t:void 0,s=typeof t=="function"?t:void 0,a=typeof t>"u"?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&&a.push(n),s&&s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&&(t.t.h=o),t.i&&(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&&(t.t.h=s),t.i&&(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&&(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n>0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c<0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f>0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m<0&&(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O>0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O<0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s<0)t=t.i;else if(s>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&&ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)>0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)<0?(s.u=o,!0):!1:this.g(i,o)>=0||this.g(a,o)<=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&&ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&&t.next():(!s||o.t===void 0)&&t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&&ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&&ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&&(s+=t.t.O);t!==o;){var a=t.h;t===a.i&&(s+=1,a.t&&(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&ao();var t=this;return new Proxy([],{get:function(o,s){return s==="0"?t.C.u:s==="1"?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!=="1")throw new TypeError("prop must be 1");return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&&(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s<t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V("events"),Hv=V("stream"),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveStatus:(r,e)=>{e(r)}},Mc={start:(r,e,t)=>{t(r,e)},sendMessage:(r,e)=>{e(r)},halfClose:r=>{r()},cancel:r=>{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&&o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&&s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&&a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&&i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(u=>{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&&i!==void 0?i:(u=>{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&&l!==void 0?l:(u=>{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=>{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&&_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&&m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&&O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&&o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&&s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&&u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=>{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=>{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=>{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(n=>{}),onReceiveMessage:n=>{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=>{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length>0&&r.clientInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(r.callInterceptors.length>0&&r.callInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];r.callInterceptors.length>0||r.callInterceptorProviders.length>0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=>n(e))).filter(n=>n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=>n(e))).filter(n=>n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=>c=>l(c,n),n=>Wue(o,n,e))(a)}});var Zv=T(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r=="function"}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||"no stack trace available"}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&&s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&&a!==void 0?a:[],delete o.interceptor_providers,this[oa].length>0&&this[sa].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=>{if(s){t(new Error("Failed to connect before the deadline"));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error("The channel has been closed"));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error("The channel has been closed"))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&&t instanceof Object&&Jv(o)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&&(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&&l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=>{m.emit("metadata",F)},onReceiveMessage(F){A!==null&&y.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit("status",F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=>{_.emit("metadata",M)},onReceiveMessage(M){y!==null&&O.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit("status",M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit("metadata",I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit("error",(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit("status",I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&&(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&&i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&&n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit("metadata",A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit("error",(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit("status",A)}}}),f}};t_.Client=Qv});var ry=T(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return["__proto__","prototype","constructor"].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=>{if(ty(s))return;let a=r[s],i;if(typeof s=="string"&&s.charAt(0)==="$")throw new Error("Method names cannot start with $");a.requestStream?a.responseStream?i="bidi":i="client_stream":a.responseStream?i="server_stream":i="unary";let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&&!ty(a.originalName)&&(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return"format"in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(".");if(s.some(n=>ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=>{var ife=1/0,ofe="[object Symbol]",sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_="\\ud800-\\udfff",mH="\\u0300-\\u036f\\ufe20-\\ufe23",TH="\\u20d0-\\u20f0",SH="\\u2700-\\u27bf",gH="a-z\\xdf-\\xf6\\xf8-\\xff",lfe="\\xac\\xb1\\xd7\\xf7",cfe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ufe="\\u2000-\\u206f",ffe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vH="A-Z\\xc0-\\xd6\\xd8-\\xde",yH="\\ufe0e\\ufe0f",OH=lfe+cfe+ufe+ffe,iy="['\u2019]",pfe="["+i_+"]",uH="["+OH+"]",n_="["+mH+TH+"]",AH="\\d+",dfe="["+SH+"]",RH="["+gH+"]",NH="[^"+i_+OH+AH+SH+gH+vH+"]",ny="\\ud83c[\\udffb-\\udfff]",hfe="(?:"+n_+"|"+ny+")",CH="[^"+i_+"]",oy="(?:\\ud83c[\\udde6-\\uddff]){2}",sy="[\\ud800-\\udbff][\\udc00-\\udfff]",la="["+vH+"]",PH="\\u200d",fH="(?:"+RH+"|"+NH+")",_fe="(?:"+la+"|"+NH+")",pH="(?:"+iy+"(?:d|ll|m|re|s|t|ve))?",dH="(?:"+iy+"(?:D|LL|M|RE|S|T|VE))?",IH=hfe+"?",bH="["+yH+"]?",Efe="(?:"+PH+"(?:"+[CH,oy,sy].join("|")+")"+bH+IH+")*",LH=bH+IH+Efe,mfe="(?:"+[dfe,oy,sy].join("|")+")"+LH,Tfe="(?:"+[CH+n_+"?",n_,oy,sy,pfe].join("|")+")",Sfe=RegExp(iy,"g"),gfe=RegExp(n_,"g"),vfe=RegExp(ny+"(?="+ny+")|"+Tfe+LH,"g"),yfe=RegExp([la+"?"+RH+"+"+pH+"(?="+[uH,la,"$"].join("|")+")",_fe+"+"+dH+"(?="+[uH,la+fH,"$"].join("|")+")",la+"?"+fH+"+"+pH,la+"+"+dH,AH,mfe].join("|"),"g"),Ofe=RegExp("["+PH+i_+mH+TH+yH+"]"),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Nfe=typeof global=="object"&&global&&global.Object===Object&&global,Cfe=typeof self=="object"&&self&&self.Object===Object&&self,Pfe=Nfe||Cfe||Function("return this")();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&&a&&(t=r[++s]);++s<a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split("")}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e<0&&(e=-e>s?0:s+e),t=t>s?s:t,t<0&&(t+=s),s=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(s);++o<s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r=="string")return r;if(zfe(r))return EH?EH.call(r):"";var e=r+"";return e=="0"&&1/r==-ife?"-0":e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&&t>=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(""):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,"")),r,"")}}function Yfe(r){return!!r&&typeof r=="object"}function zfe(r){return typeof r=="symbol"||Yfe(r)&&Vfe.call(r)==ofe}function o_(r){return r==null?"":Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&&r.replace(afe,Mfe).replace(gfe,"")}var Wfe=qfe("toUpperCase");function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=>{"use strict";DH.exports=ay;function ay(r,e){typeof r=="string"&&(e=r,r=void 0);var t=[];function o(a){if(typeof a!="string"){var i=s();if(ay.verbose&&console.log("codegen: "+i),i="return "+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u<n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case"d":case"f":return String(Number(A));case"i":return String(Math.floor(A));case"j":return JSON.stringify(A);case"s":return String(A)}return"%"}),_!==f.length)throw Error("parameter count mismatch");return t.push(a),o}function s(a){return"function "+(a||e||"")+"("+(r&&r.join(",")||"")+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=>{"use strict";kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe("fs");function Uc(r,e,t){return typeof e=="function"?(t=e,e={}):e||(e={}),t?!e.xhr&&ly&&ly.readFile?ly.readFile(r,function(s,a){return s&&typeof XMLHttpRequest<"u"?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString("utf8"))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&&s.status!==200)return o(Error("status "+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n<s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&255)}return o(null,typeof Uint8Array<"u"?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&&("overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.responseType="arraybuffer"),s.open("GET",e),s.send()}});var GH=T(FH=>{"use strict";var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),o=VH(e),s="";o&&(s=t.shift()+"/");for(var a=0;a<t.length;)t[a]===".."?a>0&&t[a-1]!==".."?t.splice(--a,2):o?t.splice(a,1):++a:t[a]==="."?t.splice(a,1):++a;return s+t.join("/")};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?cy(e+"/"+t):t)}});var ua=T((iFe,jH)=>{"use strict";jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className="Namespace";var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&&r.length){for(var t={},o=0;o<r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o<e.length;++o)if(typeof e[o]!="string"&&e[o][0]<=t&&e[o][1]>t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o<e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject(["options",this.options,"nested",HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s<o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&&this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof co)return this.nested[e].values;throw Error("no such enum: "+e)};pe.prototype.add=function(e){if(!(e instanceof fy&&e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&&e instanceof pe&&!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s<o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");for(var o=this;e.length>0;){var s=e.shift();if(o.nested&&o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error("path conflicts with non-namespace objects")}else o.add(o=new pe(s))}return t&&o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t=="boolean"?(o=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),a_.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var s=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+s];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&&(e=e.slice(1),s=o._lookupImpl(e,e.join(".")));else for(var a=0;a<this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&&(o=this._nestedArray[a]._lookupImpl(e,t))&&(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error("no such type: "+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=>{"use strict";YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className="MapField";var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError("keyType must be a string");this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o=="function"?o=kc.decorateType(o).name:o&&typeof o=="object"&&(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=>{"use strict";zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className="Method";var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&&(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError("type must be a string");if(!fa.isString(t))throw TypeError("requestType must be a string");if(!fa.isString(o))throw TypeError("responseType must be a string");dy.call(this,r,i),this.type=e||"rpc",this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=>{"use strict";$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className="Service";var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a<s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&&o.addJSON(t.nested),t.edition&&(o._edition=t.edition),o.comment=t.comment,o._defaultEdition="proto3",o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",Sn.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Object.defineProperty(Vt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a<this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[n]=Bc.codegen(["r","c"],Bc.isReserved(n)?n+"_":n)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=>{"use strict";XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=>{"use strict";JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return"missing required '"+r.name+"'"}function spe(r){for(var e=WH.codegen(["r","l","e"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(n){return n.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),t=0;t<r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?"int32":o.type,a="m"+WH.safeProp(o.name);e("case %i: {",o.id),o.map?(e("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),gn.defaults[o.keyType]!==void 0?e("k=%j",gn.defaults[o.keyType]):e("k=null"),gn.defaults[s]!==void 0?e("value=%j",gn.defaults[s]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),gn.basic[s]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",s),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),gn.long[o.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',a):e("%s[k]=value",a)):o.repeated?(e("if(!(%s&&%s.length))",a,a)("%s=[]",a),gn.packed[s]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,s)("}else"),gn.basic[s]===void 0?e(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",a,t):e("%s.push(r.%s())",a,s)):gn.basic[s]===void 0?e(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",a,t):e("%s=r.%s()",a,s),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&&e("if(!m.hasOwnProperty(%j))",i.name)("throw util.ProtocolError(%j,{instance:m})",ope(i))}return e("return m")}});var Ty=T((uFe,QH)=>{"use strict";QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+": "+e+(r.repeated&&e!=="array"?"[]":r.map&&e!=="object"?"{k:"+r.keyType+"}":"")+" expected"}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r("switch(%s){",o)("default:")("return%j",ir(e,"enum value"));for(var s=Object.keys(e.resolvedType.values),a=0;a<s.length;++a)r("case %i:",e.resolvedType.values[s[a]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",t,o)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",o)("return%j",ir(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",ir(e,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',o)("return%j",ir(e,"number"));break;case"bool":r('if(typeof %s!=="boolean")',o)("return%j",ir(e,"boolean"));break;case"string":r("if(!util.isString(%s))",o)("return%j",ir(e,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",ir(e,"buffer"));break}return r}function lpe(r,e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",t)("return%j",ir(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",t)("return%j",ir(e,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",t)("return%j",ir(e,"boolean key"));break}return r}function cpe(r){var e=Ey.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=r.oneofsArray,o={};t.length&&e("var p={}");for(var s=0;s<r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i="m"+Ey.safeProp(a.name);if(a.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",i,a.name),a.map)e("if(!util.isObject(%s))",i)("return%j",ir(a,"object"))("var k=Object.keys(%s)",i)("for(var i=0;i<k.length;++i){"),lpe(e,a,"k[i]"),my(e,a,s,i+"[k[i]]")("}");else if(a.repeated)e("if(!Array.isArray(%s))",i)("return%j",ir(a,"array"))("for(var i=0;i<%s.length;++i){",i),my(e,a,s,i+"[i]")("}");else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&&e("if(p%s===1)",n)("return%j",a.partOf.name+": multiple values"),o[a.partOf.name]=1,e("p%s=1",n)}my(e,a,s,i)}a.optional&&e("}")}return e("return null")}});var vy=T(eq=>{"use strict";var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r("switch(d%s){",o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]===e.typeDefault&&!s&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),e.repeated||r("break"),s=!0),r("case%j:",i[n])("case %i:",a[i[n]])("m%s=%j",o,a[i[n]])("break");r("}")}else r('if(typeof d%s!=="object")',o)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,t,o);else{var l=!1;switch(e.type){case"double":case"float":r("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",o,o);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,l)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,l?"true":"");break;case"bytes":r('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":r("m%s=String(d%s)",o,o);break;case"bool":r("m%s=Boolean(d%s)",o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return o("return new this.ctor");o("var m=new this.ctor");for(var s=0;s<t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o("if(d%s){",i)('if(typeof d%s!=="object")',i)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",i)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",i),Sy(o,a,s,i+"[ks[i]]")("}")("}")):a.repeated?(o("if(d%s){",i)("if(!Array.isArray(d%s))",i)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",i)("for(var i=0;i<d%s.length;++i){",i),Sy(o,a,s,i+"[i]")("}")("}")):(a.resolvedType instanceof Vc||o("if(d%s!=null){",i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o("}"))}return o("return m")};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,t,o,o,t,o,o):r("d%s=types[%i].toObject(m%s,o)",o,t,o);else{var s=!1;switch(e.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,s?"true":"",o);break;case"bytes":r("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:r("d%s=m%s",o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()("return {}");for(var o=$r.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),s=[],a=[],i=[],n=0;n<t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o("if(o.arrays||o.defaults){"),n=0;n<s.length;++n)o("d%s=[]",$r.safeProp(s[n].name));o("}")}if(a.length){for(o("if(o.objects||o.defaults){"),n=0;n<a.length;++n)o("d%s={}",$r.safeProp(a[n].name));o("}")}if(i.length){for(o("if(o.defaults){"),n=0;n<i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o("d%s=o.enums===String?%j:%j",c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",c,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else o("d%s=%j",c,l.typeDefault)}o("}")}var f=!1;for(n=0;n<t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),gy(o,l,_,c+"[ks2[j]]")("}")):l.repeated?(o("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),gy(o,l,_,c+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",c,l.name),gy(o,l,_,c),l.partOf&&o("if(o.oneofs)")("d%s=%j",$r.safeProp(l.partOf.name),l.name)),o("}")}return o("return d")}});var yy=T(tq=>{"use strict";var upe=tq,fpe=f_();upe[".google.protobuf.Any"]={fromObject:function(r){if(r&&r["@type"]){var e=r["@type"].substring(r["@type"].lastIndexOf("/")+1),t=this.lookup(e);if(t){var o=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return o.indexOf("/")===-1&&(o="/"+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t="type.googleapis.com/",o="",s="";if(e&&e.json&&r.type_url&&r.value){s=r.type_url.substring(r.type_url.lastIndexOf("/")+1),o=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var a=this.lookup(s);a&&(r=a.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return o===""&&(o=t),s=o+n,i["@type"]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=>{"use strict";nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className="Type";var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e<r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t<this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t<this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&&Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen(["p"],e.name),o=0,s;o<e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t("this%s={}",_t.safeProp(s.name)):s.repeated&&t("this%s=[]",_t.safeProp(s.name));return t("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a<s.length;++a)o.add((typeof t.fields[s[a]].keyType<"u"?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a<s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a<s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&&t.extensions.length&&(o.extensions=t.extensions),t.reserved&&t.reserved.length&&(o.reserved=t.reserved),t.group&&(o.group=!0),t.comment&&(o.comment=t.comment),t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",or.arrayToJSON(this.oneofsArray,e),"fields",or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o<e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o<t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof p_&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o<this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=>{"use strict";sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className="Root";var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,"",r),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t=="function"&&(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&&O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf("google/protobuf/");if(O>-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&&O.charAt(0)==="{"&&(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I<y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&&c(A);if(y.weakImports)for(I=0;I<y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&&c(A,!0)}}catch(M){i(M)}!a&&!u&&i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)>-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString("utf8")}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&&(e=[e]);for(var f=0,_;f<e.length;++f)(_=s.resolvePath("",e[f]))&&c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error("not supported");return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&&!e.extensionField&&(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t<this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o<e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&&(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&&(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&&delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o<e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=>{"use strict";var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire("fs");He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s<t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o<e.length;){var s=e[o++],a=e[o++];a!==void 0&&(t[s]=a)}return t};var vpe=/\\/g,ype=/"/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?'["'+e.replace(vpe,"\\\\").replace(ype,'\\"')+'"]':"."+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly("Enum"+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c==="__proto__"||c==="prototype")return i;if(n.length>0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&&s)return i;u&&(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!="object")throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),a(e,t,o)};Object.defineProperty(He,"decorateRoot",{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=>{"use strict";var Gc=cq,Rpe=rt(),Npe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Hc(r,e){var t=0,o={};for(e|=0;t<r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=>{"use strict";fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className="Field";var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&&(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Ke.isString(t))throw TypeError("type must be a string");if(o!==void 0&&!Cpe.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==void 0&&!Ke.isString(s))throw TypeError("extend must be a string");o==="proto3_optional"&&(o="optional"),this.rule=o&&o!=="optional"?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(nt.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(nt.prototype,"delimited",{get:function(){return this.resolvedType instanceof qc&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(nt.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(nt.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof uq&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof uq)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&&(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var t={};if(this.rule==="required"&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof qc&&o.group&&(t.message_encoding="DELIMITED")}return this.getOption("packed")===!0?t.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(t.repeated_field_encoding="EXPANDED"),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t=="function"?t=Ke.decorateType(t).name:t&&typeof t=="object"&&(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=>{"use strict";hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className="OneOf";var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e<r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o<this.oneof.length;++o){var s=e.get(this.oneof[o]);s&&!s.partOf&&(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t<this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&&o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&&r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=>{"use strict";_q.exports=ct;ct.className="ReflectionObject";var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},bpe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},Lpe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function ct(r,e){if(!Yc.isString(r))throw TypeError("name must be a string");if(e&&!Yc.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(".")}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&&t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&&t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&&(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")t=Object.assign({},bpe);else if(e==="proto3")t=Object.assign({},Lpe);else if(e==="2023")t=Object.assign({},Ipe);else throw new Error("Unknown edition: "+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s<o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=>{"use strict";mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className="Enum";var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n<i.length;++n)typeof e[i[n]]=="number"&&(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=>{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&&this.valuesOptions[t]&&this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError("name must be a string");if(!y_.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(t==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=>{"use strict";Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,o,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,o,(e.id<<3|2)>>>0)}function Mpe(r){for(var e=Dy.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t<s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?"int32":a.type,l=wy.basic[n];o="m"+Dy.safeProp(a.name),a.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",o,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",i,o):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,n,o),e("}")("}")):a.repeated?(e("if(%s!=null&&%s.length){",o,o),a.packed&&wy.packed[n]!==void 0?e("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",o)("w.%s(%s[i])",n,o)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",o),l===void 0?Tq(e,a,i,o+"[i]"):e("w.uint32(%i).%s(%s[i])",(a.id<<3|l)>>>0,n,o)),e("}")):(a.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",o,a.name),l===void 0?Tq(e,a,i,o):e("w.uint32(%i).%s(%s)",(a.id<<3|l)>>>0,n,o))}return e("return w")}});var vq=T((yFe,gq)=>{"use strict";var de=gq.exports=sv();de.build="light";function wpe(r,e,t){return typeof e=="function"?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=>{"use strict";Aq.exports=Oq;var Uy=/[\s{}=;:[\],'"()<>]/g,Upe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,kpe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:"\0",r:"\r",n:` `,t:" "};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case"\\":case"":return t;default:return qpe[t]||""}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error("illegal "+N+" (line "+s+")")}function u(){var N=l==="'"?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c("string");return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$<0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===" "||le===" ");for(var v=r.substring(N,z).split(Fpe),W=0;W<v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,"").trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z<o&&f(z)!==` `;)z++;return z}function y(){if(n.length>0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&&($=!0,++s),++t===o)return null;if(f(t)==="/"){if(++t===o)throw c("comment");if(f(t)==="/")if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&&(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)==="/";f(++t)!==` `;)if(t===o)return null;++t,te&&(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))==="*"){G=t+1,te=e||f(G)==="*";do{if(B===` `&&++s,++t===o)throw c("comment");z=B,B=f(t)}while(z!=="*"||B!=="/");++t,te&&(_(G,t-2,$),$=!0),N=!0}else return"/"}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le<o&&!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W==='"'||W==="'")&&(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c("token '"+B+"', '"+N+"' expected");return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&&(e||B.type==="*"||B.lineEmpty)&&(z=B.leading?B.text:null)):(a<N&&I(),B=i[N],delete i[N],B&&!B.lineEmpty&&(e||B.type==="/")&&(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},"line",{get:function(){return s}})}});var bq=T((AFe,Iq)=>{"use strict";Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O="proto2",y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=>{L._edition=O,Object.keys(I).forEach(b=>{L.getOption(b)===void 0&&L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error("illegal "+(b||"token")+" '"+L+"' ("+(j?j+", ":"")+"line "+s.line+")")}function z(){var L=[],b;do{if((b=a())!=='"'&&b!=="'")throw N(b);L.push(a()),l(b),b=n()}while(b==='"'||b==="'");return L.join("")}function B(L){var b=a();switch(b){case"'":case'"':return i(b),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return te(b,!0)}catch{if(L&&Wr.test(b))return b;throw N(b,"value")}}function G(L,b){var x,j;do if(b&&((x=n())==='"'||x==="'")){var q=z();if(L.push(q),O>=2023)throw N(q,"id")}else try{L.push([j=$(a()),l("to",!0)?$(a()):j])}catch(Le){if(b&&Wr.test(x)&&O>=2023)L.push(x);else throw Le}while(l(",",!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&&(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut==="option")Z(ne,ut),l(";");else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)==="-"&&(x=-1,L=L.substring(1)),L){case"inf":case"INF":case"Inf":return x*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,"number",b)}function $(L,b){switch(L){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!b&&L.charAt(0)==="-")throw N(L,"id");if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,"id")}function le(){if(f!==void 0)throw N("package");if(f=a(),!Wr.test(f))throw N(f,"name");y=y.define(f),l(";")}function v(){var L=n(),b;switch(L){case"weak":b=m||(m=[]),a();break;case"public":a();default:b=_||(_=[]);break}L=z(),l(";"),b.push(L)}function W(){if(l("="),O=z(),O<2023)throw N(O,"syntax");l(";")}function R(){if(l("="),O=z(),!["2023"].includes(O))throw N(O,"edition");l(";")}function E(L,b){switch(b){case"option":return Z(L,b),l(";"),!0;case"message":return Q(L,b),!0;case"enum":return Me(L,b),!0;case"service":return wo(L,b),!0;case"extend":return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&&(typeof L.comment!="string"&&(L.comment=c()),L.filename=vn.filename),l("{",!0)){for(var q;(q=a())!=="}";)b(q);l(";",!0)}else x&&x(),l(";"),L&&(typeof L.comment!="string"||o)&&(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,"type name");var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case"map":ce(x,q);break;case"required":if(O!=="proto2")throw N(q);case"repeated":Y(x,q);break;case"optional":if(O==="proto3")Y(x,"proto3_optional");else{if(O!=="proto2")throw N(q);Y(x,"optional")}break;case"oneof":Ne(x,q);break;case"extensions":G(x.extensions||(x.extensions=[]));break;case"reserved":G(x.reserved||(x.reserved=[]),!0);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(x,"optional");break}}),L.add(x),L===y&&A.push(x)}function Y(L,b,x){var j=a();if(j==="group"){J(L,b);return}for(;j.endsWith(".")||n().startsWith(".");)j+=a();if(!Wr.test(j))throw N(j,"type");var q=a();if(!Xr.test(q))throw N(q,"name");q=M(q),l("=");var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et==="option")Z(ne,Et),l(";");else throw N(Et)},function(){We(ne)}),b==="proto3_optional"){var Le=new Pq("_"+q);ne.setOption("proto3_optional",!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&&A.push(ne)}function J(L,b){if(O>=2023)throw N("group");var x=a();if(!Xr.test(x))throw N(x,"name");var j=By.lcFirst(x);x===j&&(x=By.ucFirst(x)),l("=");var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case"option":Z(ne,Et),l(";");break;case"required":case"repeated":Y(ne,Et);break;case"optional":O==="proto3"?Y(ne,"proto3_optional"):Y(ne,"optional");break;case"message":Q(ne,Et);break;case"enum":Me(ne,Et);break;case"reserved":G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l("<");var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,"type");l(",");var x=a();if(!Wr.test(x))throw N(x,"type");l(">");var j=a();if(!Xr.test(j))throw N(j,"name");l("=");var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le==="option")Z(q,Le),l(";");else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new Pq(M(b));C(x,function(q){q==="option"?(Z(x,q),l(";")):(i(q),Y(x,"optional"))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new zpe(b);C(x,function(q){switch(q){case"option":Z(x,q),l(";");break;case"reserved":G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&&(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&&A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,"name");l("=");var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne==="option")Z(j,ne),l(";");else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b==="option"&&(b=a());b!=="=";){if(b==="("){var ne=a();l(")"),b="("+ne+")"}if(q){if(q=!1,b.includes(".")&&!b.includes("(")){var Le=b.split(".");x=Le[0]+".",b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&&j[0]==="."?j.slice(1):j,x=x&&x[x.length-1]==="."?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l("{",!0)){for(var x={};!l("}",!0);){if(!Xr.test(Ye=a()))throw N(Ye,"name");if(Ye===null)throw N(Ye,"end of input");var j,q=Ye;if(l(":",!0),n()==="{")j=je(L,b+"."+Ye);else if(n()==="["){j=[];var ne;if(l("[",!0)){do ne=B(!0),j.push(ne);while(l(",",!0));l("]"),typeof ne<"u"&&me(L,b+"."+Ye,ne)}}else j=B(!0),me(L,b+"."+Ye,j);var Le=x[q];Le&&(j=[].concat(Le).concat(j)),x[q]=j,l(",",!0),l(";",!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&&/^features\./.test(b)){I[b]=x;return}L.setOption&&L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&&L.setParsedOption(b,x,j)}function We(L){if(l("[",!0)){do Z(L,"option");while(l(",",!0));l("]")}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,"service name");var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q==="rpc")Do(x,q);else throw N(q)}),L.add(x),L===y&&A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,"name");var q=b,ne,Le,ut,Et;if(l("("),l("stream",!0)&&(Le=!0),!Wr.test(b=a())||(ne=b,l(")"),l("returns"),l("("),l("stream",!0)&&(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(")");var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm==="option")Z(Lu,dm),l(";");else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,"reference");var x=b;C(null,function(q){switch(q){case"required":case"repeated":Y(L,q,x);break;case"optional":O==="proto3"?Y(L,"proto3_optional",x):Y(L,"optional",x);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(L,"optional",x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case"package":if(!u)throw N(Ye);le();break;case"import":if(!u)throw N(Ye);v();break;case"syntax":if(!u)throw N(Ye);W();break;case"edition":if(!u)throw N(Ye);R();break;case"option":Z(y,Ye),l(";",!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=>{"use strict";xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r="google/protobuf/"+r+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Lq;Nr("duration",{Duration:Lq={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Nr("timestamp",{Timestamp:Lq});Nr("empty",{Empty:{fields:{}}});Nr("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});Nr("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});Nr("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=>{"use strict";var ii=wq.exports=vq();ii.build="full";ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=>{"use strict";Uq.exports=Dq()});var Vy=T((PFe,ode)=>{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],"php_generic_services",[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=>{"use strict";var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(".google.protobuf");var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length=="number"&&(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a<e.file.length;++a){s=t,(o=e.file[a]).package&&o.package.length&&(s=t.define(o.package));var n=Ede(o);if(o.name&&o.name.length&&t.files.push(s.filename=o.name),o.messageType)for(i=0;i<o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i<o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i<o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i<o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i<c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s<r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&&Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&&e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:"Type"+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a<e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a<e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty("oneofIndex")&&s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a<e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a<e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&&e.nestedType[a].options.mapEntry&&s.setOption("map_entry",!0);if(e.enumType)for(a=0;a<e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&&e.extensionRange.length)for(s.extensions=[],a=0;a<e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a<e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a<e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o<this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&&Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:"key",number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:"value",number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o<this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&&t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o<this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o<this.reserved.length;++o)typeof this.reserved[o]=="string"?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var s;e.typeName&&e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a="required";break;case 3:a="repeated";break;default:throw Error("illegal label: "+e.label)}var i=e.extendee;e.extendee!==void 0&&(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:"field"+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&&(n.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var c=lde.exec(l);c&&(l=parseInt(l));break}n.setOption("default",l)}return hde(e.type)&&(t==="proto3"?e.options&&!e.options.packed&&n.setOption("packed",!1):(!t||t==="proto2")&&e.options&&e.options.packed&&n.setOption("packed",!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?t.label=3:this.required&&e==="proto2"?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&&(t.defaultValue=String(this.options.default)),this.options.proto3_optional&&(t.proto3_optional=!0)),e==="proto3"?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a<e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&&i.length?i:"NAME"+n]=n}var l=new yn(e.name&&e.name.length?e.name:"Enum"+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t<o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&&e.name.length?e.name:"oneof"+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&&e.name.length?e.name:"Service"+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a<e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t<this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&&e.name.length?e.name:"Method"+pde++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error("illegal type: "+r)}function Vq(r,e){for(var t={},o=0,s,a;o<e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&&!Array.isArray(t[i])&&(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split("."),o=e.fullName.split("."),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&&e instanceof kq)for(;s<t.length&&a<i&&t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&&n!==e)break;++a}else for(;s<t.length&&a<i&&t[s]===o[a];++s,++a);return o.slice(a).join(".")}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function Ede(r){if(r.syntax==="editions")switch(r.edition){case ae.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+r.edition)}return r.syntax==="proto3"?"proto3":"proto2"}function mde(r,e){if(r)if(r==="proto2"||r==="proto3")e.syntax=r;else switch(e.syntax="editions",r){case"2023":e.edition=ae.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+r)}}});var jq=T((IFe,Tde)=>{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=>{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zq=T((LFe,gde)=>{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Wq=T(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V("fs"),$q=V("path"),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=>{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common("api",r.nested.google.nested.protobuf.nested),ha.common("descriptor",e.nested.google.nested.protobuf.nested),ha.common("source_context",t.nested.google.nested.protobuf.nested),ha.common("type",o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=>{(function(r,e){function t(o){return o.default||o}typeof define=="function"&&define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c=="object"?(e($c),typeof Gy=="object"&&(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:$c,function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function o(R){return(R&&R.__isLong__)===!0}function s(R){var E=Math.clz32(R&-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R>>>=0,(Y=0<=R&&R<256)&&(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&&(i[R]=C),C)):(R|=0,(Y=-128<=R&&R<128)&&(Q=a[R],Q)?Q:(C=c(R,R<0?-1:0,!1),Y&&(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R<0)return N;if(R>=A)return $}else{if(R<=-I)return le;if(R+1>=I)return te}return R<0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error("empty string");if(typeof E=="number"?(C=E,E=!1):E=!!E,R==="NaN"||R==="Infinity"||R==="+Infinity"||R==="-Infinity")return E?N:F;if(C=C||10,C<2||36<C)throw RangeError("radix");var Q;if((Q=R.indexOf("-"))>0)throw Error("interior hyphen");if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce<R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne<8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R=="number"?l(R,E):typeof R=="string"?f(R,E):c(R.low,R.high,typeof E=="boolean"?E:R.unsigned)}t.fromValue=_;var m=65536,O=1<<24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},v.toString=function(E){if(E=E||10,E<2||36<E)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return"-"+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne="";;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()>>>0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length<6;)Z="0"+Z;Ne=""+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C>0&&(E&1<<C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high>>21;return E?this.unsigned?!1:E===-1&&!(this.low===0&&this.high===-2097152):!0},v.isZero=function(){return this.high===0&&this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(this.low&1)===1},v.isEven=function(){return(this.low&1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&&this.high>>>31===1&&E.high>>>31===1?!1:this.high===E.high&&this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&&!Q?-1:!C&&Q?1:this.unsigned?E.high>>>0>this.high>>>0||E.high===this.high&&E.low>>>0>this.low>>>0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high>>>16,Q=this.high&65535,Y=this.low>>>16,J=this.low&65535,ce=E.high>>>16,Ne=E.high&65535,Me=E.low>>>16,Te=E.low&65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we>>>16,we&=65535,me+=Y+Me,je+=me>>>16,me&=65535,je+=Q+Ne,Z+=je>>>16,je&=65535,Z+=C+ce,Z&=65535,c(me<<16|we,Z<<16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&&E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high>>>16,Y=this.high&65535,J=this.low>>>16,ce=this.low&65535,Ne=E.high>>>16,Me=E.high&65535,Te=E.low>>>16,Z=E.low&65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We>>>16,We&=65535,we+=J*Z,me+=we>>>16,we&=65535,we+=ce*Te,me+=we>>>16,we&=65535,me+=Y*Z,je+=me>>>16,me&=65535,me+=J*Te,je+=me>>>16,me&=65535,me+=ce*Me,je+=me>>>16,me&=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&=65535,c(we<<16|We,je<<16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&E.low===-1&&E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne<=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&&(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&E.low,this.high&E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low<<E,this.high<<E|this.low>>>32-E,this.unsigned):c(0,this.low<<E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>E,this.unsigned):c(this.high>>E-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>>E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high>>>E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.low<<E|this.high>>>C,this.high<<E|this.low>>>C,this.unsigned)):(E-=32,C=32-E,c(this.high<<E|this.low>>>C,this.low<<E|this.high>>>C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.high<<C|this.low>>>E,this.low<<C|this.high>>>E,this.unsigned)):(E-=32,C=32-E,c(this.low<<C|this.high>>>E,this.high<<C|this.low>>>E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&255,C>>>8&255,C>>>16&255,C>>>24,E&255,E>>>8&255,E>>>16&255,E>>>24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E>>>24,E>>>16&255,E>>>8&255,E&255,C>>>24,C>>>16&255,C>>>8&255,C&255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]<<8|E[2]<<16|E[3]<<24,E[4]|E[5]<<8|E[6]<<16|E[7]<<24,C)},t.fromBytesBE=function(E,C){return new t(E[4]<<24|E[5]<<16|E[6]<<8|E[7],E[0]<<24|E[1]<<16|E[2]<<8|E[3],C)},typeof BigInt=="function"&&(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E>>BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E=="bigint"?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low>>>0),C=BigInt(this.unsigned?this.high>>>0:this.high);return C<<BigInt(32)|E});var W=r.default=t})});var ij=T(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return"@type"in r&&typeof r["@type"]=="string"}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",r.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",r.IDEMPOTENT="IDEMPOTENT"})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===""?e:r+"."+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&&typeof r.nested<"u"?Object.keys(r.nested).map(o=>rj(r.nested[o],t)).reduce((o,s)=>o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=>{for(let[o,s]of Object.entries(t))switch(o){case"uninterpreted_option":e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:"/"+e+"/"+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error("Type mismatch in reflection object handling")}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor("proto3").file.map(a=>Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,""))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=>N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V("net"),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)==="channel"?o:void 0,childSubchannel:(o==null?void 0:o.kind)==="subchannel"?o:void 0}),this.events.length>=oj*2&&(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&&(o.count-=1,o.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=>{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=>{let n=t(),l={id:n,name:s,kind:r};return i&&o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_("channel");Ie.registerChannelzSubchannel=x_("subchannel");Ie.registerChannelzServer=x_("server");Ie.registerChannelzSocket=x_("socket");function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r==="")return[];let e=r.split(":").map(o=>Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&&r.toLowerCase().startsWith("::ffff:")&&(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(".").map(e=>Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf("::");o===-1?(e=r,t=""):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Xc.ConnectivityState.IDLE:return{state:"IDLE"};case Xc.ConnectivityState.READY:return{state:"READY"};case Xc.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=>{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=>{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No channel data found for id "+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&&o.length<t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=>{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&&a.length<t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No subchannel data found for id "+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=>{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:"tcpip_address",tcpip_address:{ip_address:(e=Kde(r.host))!==null&&e!==void 0?e:void 0,port:r.port}}:{address:"uds_address",uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:"No socket data found for id "+n});return}let c=l.getInfo(),u=c.security?{model:"tls",tls:{cipher_suite:c.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(t=c.security.cipherSuiteStandardName)!==null&&t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&&o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&&s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&&a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&&i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&&l.length<a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe="subchannel",she=~(1<<31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new rhe.BackoffTimeout(()=>{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o["grpc.keepalive_time_ms"])!==null&&i!==void 0?i:-1,o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=>{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&&this.keepaliveTime>0&&(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]+' with error "'+o+'"'):this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=>{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=>{"use strict";var eO;Object.defineProperty(D_,"__esModule",{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&eO!==void 0?eO:"false")==="true"});var oO=T(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V("dns"),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V("net"),uhe=Nc(),Tj=_j(),fhe="dns_resolver";function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn("Resolver constructed for target "+(0,ai.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&&s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&&a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoff=new uhe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o["grpc.dns_min_time_between_resolutions_ms"])!==null&&i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn("Returning IP address for target "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn("Failed to parse DNS address "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=>({addresses:[s]}));let o="["+t.map(s=>s.host+":"+s.port).join(",")+"]";if(tn("Resolved addresses for target "+(0,ai.uriToString)(this.target)+": "+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=>{this.pendingLookupPromise!==null&&(tn("Resolution error for target "+(0,ai.uriToString)(this.target)+": "+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=>{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn("Using alternative DNS resolver.");let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=>s.status==="rejected"))throw new Error(o[0].reason);return o.reduce((s,a)=>a.status==="fulfilled"?[...s,...a.value]:s,[]).map(s=>({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=>({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn('resolution update delayed by "min time between resolutions" rate limit'):tn("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)("dns",iO),(0,Ej.registerDefaultScheme)("dns")}});var sO=T(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V("net"),hhe=V("http"),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V("url"),mhe=oO(),The="proxy";function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r="",e="";if(process.env.grpc_proxy)e="grpc_proxy",r=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",r=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(t.protocol!=="http:")return(0,Jc.log)(_a.LogVerbosity.ERROR,`"${t.protocol}" scheme not supported in proxy URI`),{};let o=null;t.username&&(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,"userinfo found in proxy URI"),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===""&&(a="80");let i={address:`${s}:${a}`};return o&&(i.creds=o),Ea("Proxy server "+i.address+" set by environment variable "+e),i}function ghe(){let r=process.env.no_grpc_proxy,e="no_grpc_proxy";return r||(r=process.env.no_proxy,e="no_proxy"),r?(Ea("No proxy server list set by environment variable "+e),r.split(",")):[]}function vj(r){let e=r.split("/");if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t<0||t>32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1<<32-r.prefixLength;return(yj(e)&o)===(t&o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&&t&&vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e["grpc.enable_http_proxy"])!==null&&t!==void 0?t:1)===0||r.scheme==="unix")return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea("Not using proxy for target in no_proxy list: "+(0,Qc.uriToString)(r)),o;let n={"grpc.http_connect_target":(0,Qc.uriToString)(r)};return s.creds&&(n["grpc.http_connect_creds"]=s.creds),{target:{scheme:"dns",path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let o=e["grpc.http_connect_target"],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&&t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:"CONNECT",path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,"grpc.http_connect_creds"in e&&(l["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea("Using proxy "+c+" to connect to "+n.path),new Promise((u,f)=>{let _=hhe.request(n);_.once("connect",(m,O,y)=>{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea("Successfully connected to "+n.path+" through proxy "+c),y.length>0&&O.unshift(y),Ea("Successfully established a plaintext connection to "+n.path+" through proxy "+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to "+n.path+" through proxy "+c+" with status "+m.statusCode),f())}),_.once("error",m=>{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to proxy "+c+" with error "+m.message),f()}),_.end()})}});var lO=T(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]="NO_DATA",r[r.READING_SIZE=1]="READING_SIZE",r[r.READING_MESSAGE=2]="READING_MESSAGE"})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t<e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error("Unexpected read state")}return s}};U_.StreamDecoder=aO});var Oj=T(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});k_.Http2SubchannelCall=void 0;var An=V("http2"),Rhe=V("os"),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe="subchannel_call";function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return"Unknown system error "+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()["grpc.max_receive_message_length"])!==null&&i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on("response",(l,c)=>{let u="";for(let f of Object.keys(l))u+=" "+f+": "+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[":status"],c&An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on("trailers",l=>{this.handleTrailers(l)}),e.on("data",l=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var l;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u="";switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u="Stream refused by server";break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u="Connection dropped"):(c=Oe.Status.CANCELLED,u="Call cancelled");break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on("error",l=>{l.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+l.message+" code="+l.code+" errno="+bhe(l.errno)+" syscall="+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:Oe.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t="";for(let i of Object.keys(e))t+=" "+i+": "+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s["grpc-status"]=="string"){let i=Number(s["grpc-status"]);this.trace("received status code "+i+" from server"),o.remove("grpc-status");let n="";if(typeof s["grpc-message"]=="string"){try{n=decodeURI(s["grpc-message"])}catch{n=s["grpc-message"]}o.remove("grpc-message"),this.trace('received status details string "'+n+'" from server')}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:"No status information received",metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);let o=s=>{process.nextTick(()=>{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)==="ERR_STREAM_WRITE_AFTER_END"&&(i=Oe.Status.INTERNAL),s&&this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=>{"use strict";Object.defineProperty(fO,"__esModule",{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V("http2"),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V("net"),Uhe=Oj(),khe=pO(),hO="transport",Bhe="transport_flowctrl",Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from("too_many_pings","ascii"),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o["grpc.primary_user_agent"],`grpc-node-js/${Vhe}`,o["grpc.secondary_user_agent"]].filter(a=>a).join(" "),"grpc.keepalive_time_ms"in o?this.keepaliveTimeMs=o["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in o?this.keepaliveTimeoutMs=o["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=zhe,"grpc.keepalive_permit_without_calls"in o?this.keepaliveWithoutCalls=o["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(a,i,n)=>{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(Khe)&&(l=!0),this.trace("connection closed by GOAWAY with code "+a+" and data "+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once("error",a=>{this.trace("connection closed with error "+a.message),this.handleDisconnect()}),e.socket.once("close",a=>{this.trace("connection closed. hadError="+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&&(e.on("remoteSettings",a=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))}),e.on("localSettings",a=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&&"raw"in f?f.raw:null,remoteCertificate:_&&"raw"in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&&t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&&o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o="";try{this.session.ping((a,i,n)=>{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace("Ping failed with error "+a.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(o="Ping returned false")}catch(s){o=(s instanceof Error?s.message:"")||"Unknown error"}o&&(this.keepaliveTrace("Ping send failed: "+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]="application/grpc",i[Hhe]="POST",i[qhe]=o,i[jhe]="trailers";let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=>{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+" "+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((s,a)=>{let i=null,n=this.channelTarget;if("grpc.http_connect_target"in o){let A=(0,dO.parseUri)(o["grpc.http_connect_target"]);A&&(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?"https":"http",c=(0,whe.getDefaultAuthority)(n),u=()=>{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=>{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace("connection failed with error "+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=>e.socket};o["grpc-node.flow_control_window"]!==void 0&&(_.settings={initialWindowSize:o["grpc-node.flow_control_window"]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O="Failed to connect",y=!1;m.unref(),m.once("remoteSettings",()=>{m.removeAllListeners(),e.socket.removeListener("close",u),e.socket.removeListener("error",f),s(new _O(m,t,o,i)),this.session=null}),m.once("close",u),m.once("error",f),e.socket.once("close",u),e.socket.once("error",f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=>o||new Promise((s,a)=>{let i=()=>{a(new Error("Socket closed"))},n=c=>{a(c)},l=Dhe.connect(e,()=>{l.removeListener("close",i),l.removeListener("error",n),s(l)});l.once("close",i),l.once("error",n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+" Waiting for secureConnector to be ready"),await t.waitForReady(),this.trace(i+" secureConnector is ready"),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+" Established TCP connection"),a=await t.connect(s),this.trace(i+" Established secure connection"),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=>!a.subchannel.unrefIfOneRef());s.length>0&&(e=!1),this.pool[t]=s}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&&(0,$he.channelOptionsEqual)(o,l.channelArguments)&&s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=>e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]="identity",r[r.deflate=1]="deflate",r[r.gzip=2]="gzip"})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V("zlib"),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=>typeof r=="number"&&typeof Pj.CompressionAlgorithms[r]=="string",ga=class{async writeMessage(e,t){let o=e;t&&(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&&(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.deflate(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createInflate();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.gzip(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createGunzip();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case"identity":return new mo;case"deflate":return new OO(e);case"gzip":return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm="identity";let i=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(o=e["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e["grpc.max_send_message_length"])!==null&&s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(",");(!l||l.includes(n))&&(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get("grpc-encoding");if(t.length>0){let s=t[0];typeof s=="string"&&(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let o=e.get("grpc-accept-encoding")[0];return o&&(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&&o.message.length>this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&&t!==void 0?t:0)&2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o<e&&(e=o)}return e}var s_e=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&&(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a<1e8)return String(Math.ceil(a))+o}throw new Error("Deadline is too far in the future")}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o<0?0:o>l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?""+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+"s"}});var z_=T(CO=>{"use strict";Object.defineProperty(CO,"__esModule",{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V("http2"),m_e="load_balancing_call",IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split("/"),f="";u.length>=2&&(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&&c!==void 0?c:"localhost";this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&o.push("wait_for_ready"),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&o.push("wait_for_ready"),o.push("Waiting for LB pick"),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,"["+this.callNumber+"] "+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?"("+s.subchannel.getChannelzRef().id+") "+s.subchannel.getAddress():""+s.subchannel;switch(this.trace("Pick result: "+iu.PickResultType[s.pickResultType]+" subchannel: "+a+" status: "+((e=s.status)===null||e===void 0?void 0:e.code)+" "+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(o.merge(c),o.get("authorization").length>1&&this.outputStatus({code:K_.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new $_.Metadata},"PROCESSED"),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace("Picked subchannel "+a+" has state "+bj.ConnectivityState[s.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&o.set("grpc-timeout",(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=>{this.trace("Received message"),this.listener.onReceiveMessage(f)},onReceiveStatus:f=>{this.trace("Received status"),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,"REFUSED"):this.outputStatus(f,"PROCESSED")}}),this.childStartTime=new Date}catch(f){this.trace("Failed to start call on picked subchannel "+a+" with error "+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+f.message,metadata:new $_.Metadata},"NOT_STARTED");return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},c=>{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code=="number"?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},"PROCESSED")});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:n,details:l,metadata:s.status.metadata},"DROP")});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:c,details:u,metadata:s.status.metadata},"PROCESSED")})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},"PROCESSED")}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e="resolving_call",bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&&(o.flags&So.Propagate.CANCELLATION&&o.parentCall.on("cancelled",()=>{this.cancelWithStatus(So.Status.CANCELLED,"Cancelled by parent call")}),o.flags&So.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push("waiting for metadata filters")):o.push("waiting for name resolution"),this.child&&o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(","))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(o=>o(t)),process.nextTick(()=>{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=>{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&&o.halfClose()},s=>{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,"Failed to route call to method "+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},a=>{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},o=>{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e="retrying_call",xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;return this.limitPerCall-s<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;if(s<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&&t!==void 0?t:0;if(this.totalAllocated<o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} > total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO="grpc-previous-rpc-attempts",N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:N_e;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state="RETRY";let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&&t!==void 0?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let o=this.getBufferEntry(t);o.allocated&&this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s<this.underlyingCalls.length;s++)s!==e&&this.underlyingCalls[s].state!=="COMPLETED"&&(this.underlyingCalls[s].state="COMPLETED",this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state==="ACTIVE"&&s.nextMessageToSend>e&&(e=s.nextMessageToSend,t=o);t===-1?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=>{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!=="RETRY"){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var s,a;if(this.state!=="RETRY"){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&&a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o<0){this.state="TRANSPARENT_ONLY",this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get("grpc-retry-pushback-ms");if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[t].call.getCallNumber()+"] in state "+this.underlyingCalls[t].state),this.underlyingCalls[t].state="COMPLETED",e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(t),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(t),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&&e!==void 0?e:"0s",i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o>0&&s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),a=!0,o>0&&i.set(LO,`${o}`),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMetadata(i)},onReceiveMessage:i=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMessage(i)},onReceiveStatus:i=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!a&&o>0&&i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace("start called"),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!=="COMPLETED"&&this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:s=>{this.handleChildWriteCompleted(e)}},o.message.message);break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,t){var o;this.trace("write() called with message of length "+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:"MESSAGE",message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state==="ACTIVE"&&l.nextMessageToSend===a&&l.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state==="ACTIVE"&&n.nextMessageToSend===a&&n.call.sendMessageWithContext({callback:l=>{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&t.nextMessageToSend===e&&(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1<<24,q_e=1<<20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof C_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options["grpc.use_local_subchannel_pool"])!==null&&s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options["grpc.retry_buffer_size"])!==null&&a!==void 0?a:H_e,(i=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&i!==void 0?i:q_e),this.keepaliveTime=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options["grpc.client_idle_timeout_ms"])!==null&&l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=>{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=>{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length>0&&this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=>{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=>{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length>0&&this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+y.code+' and details "'+y.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length>0&&this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)("channel_stacktrace")&&(0,eE.trace)(ci.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&&t.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=>o===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+sr.ConnectivityState[this.connectivityState]+" -> "+sr.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&&(o.timer&&clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+i+'] method="'+t+'"'),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createRetryingCall ["+i+'] method="'+t+'"'),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace("createResolvingCall ["+i+'] method="'+e+'", deadline='+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=>{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i<=n){process.nextTick(o,new Error("Deadline passed without connectivity state change"));return}s=setTimeout(()=>{this.removeConnectivityStateWatcher(a),o(new Error("Deadline passed without connectivity state change"))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof j_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V("events"),XO=V("stream"),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:"message"in r?r.message:"Unknown Error",metadata:(t=e??r.metadata)!==null&&t!==void 0?t:null};return"code"in r&&typeof r.code=="number"&&Number.isInteger(r.code)&&(o.code=r.code,"details"in r&&typeof r.details=="string"&&(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",a=>{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",s=>{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(t))throw new TypeError("keyCertPairs must be an array");if(typeof o!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let a=[],i=[];for(let n=0;n<t.length;n++){let l=t[n];if(l===null||typeof l!="object")throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t<this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t<this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t<this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V("http2"),Vj=Mh(),Fj=V("zlib"),X_e=lO(),jj=Pe(),Yj="server_call";function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveHalfClose:r=>{r()},onCancel:()=>{}},sE={start:r=>{r()},sendMetadata:(r,e)=>{e(r)},sendMessage:(r,e)=>{e(r)},sendStatus:(r,e)=>{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&&o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&&s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&&a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&&i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&&o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&&s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&&a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&&i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=>{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj="grpc-accept-encoding",cA="grpc-encoding",Gj="grpc-message",Hj="grpc-status",nA="grpc-timeout",J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:"identity,deflate,gzip",[cA]:"identity"},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once("error",u=>{}),this.stream.once("close",()=>{var u;Oo("Request to method "+((u=this.handler)===null||u===void 0?void 0:u.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",u=>{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in a&&(this.maxSendMessageSize=a["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in a&&(this.maxReceiveMessageSize=a["grpc.max_receive_message_length"]),this.host=(i=t[":authority"])!==null&&i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&&Oo("Request to "+this.handler.path+" received headers "+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length>0&&this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length>0&&(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=>{let a={code:bt.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t==="identity")return o;if(t==="deflate"||t==="gzip"){let s;return t==="deflate"?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=>{let n=0,l=[];s.on("data",c=>{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&&n>this.maxReceiveMessageSize&&(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on("end",()=>{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo("Request to "+this.handler.path+" received data frame of size "+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:"COMPRESSED",compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&o.length-5>this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo("Request to "+this.handler.path+" sent data frame of size "+o.length),this.stream.write(o,s=>{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo("Request to method "+((t=this.handler)===null||t===void 0?void 0:t.path)+" ended with status code: "+bt.Status[e.code]+" details: "+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var s;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&&t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type==="clientStream"||s.type==="bidi",responseStream:s.type==="serverStream"||s.type==="bidi",requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=>c(i,l),n)}});var Zj=T(fi=>{"use strict";var rEe=fi&&fi.__runInitializers||function(r,e,t){for(var o=arguments.length>2,s=0;s<e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&&fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var n=o.kind,l=n==="getter"?"get":n==="setter"?"set":"value",c=!e&&r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m>=0;m--){var O={};for(var y in o)O[y]=y==="access"?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(I||null))};var A=(0,t[m])(n==="accessor"?{get:u.get,set:u.set}:u[l],O);if(n==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(f=i(A.get))&&(u.get=f),(f=i(A.set))&&(u.set=f),(f=i(A.init))&&s.unshift(f)}else(f=i(A))&&(n==="field"?s.unshift(f):u[l]=f)}c&&Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,"__esModule",{value:!0});fi.Server=void 0;var Lt=V("http2"),iEe=V("util"),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1<<31),pA=~(1<<31),oEe=2e4,Xj=~(1<<31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe="server",Jj=Buffer.from("max_age");function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,"server_call",r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case"unary":return(o,s)=>{s(t,null)};case"clientStream":return(o,s)=>{s(t,null)};case"serverStream":return o=>{o.emit("error",t)};case"bidi":return o=>{o.emit("error",t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=>{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=s??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(a=this.options["grpc.max_connection_age_ms"])!==null&&a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options["grpc.max_connection_age_grace_ms"])!==null&&i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options["grpc.keepalive_timeout_ms"])!==null&&l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options["grpc.max_connection_idle_ms"])!==null&&c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&&a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:I&&"raw"in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&&i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,"("+this.channelzRef.id+") "+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+s)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(s,a){if(s===null||typeof s!="object"||a===null||typeof a!="object")throw new Error("addService() requires two objects as arguments");let i=Object.keys(s);if(i.length===0)throw new Error("Cannot add an empty service to a server");i.forEach(n=>{let l=s[n],c;l.requestStream?l.responseStream?c="bidi":c="clientStream":l.responseStream?c="serverStream":c="unary";let u=a[n],f;if(u===void 0&&typeof l.originalName=="string"&&(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!="object")throw new Error("removeService() requires object as argument");Object.keys(s).forEach(i=>{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=>({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),c=n!==null;this.trace("Initial credentials valid: "+c),a=Lt.createSecureServer(l),a.prependListener("connection",f=>{c||(this.trace("Dropped connection from "+JSON.stringify(f.address())+" due to unloaded credentials"),f.destroy())}),a.on("secureConnection",f=>{f.on("error",_=>{this.trace("An incoming TLS connection closed with error: "+_.message)})});let u=f=>{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,"Failed to set secure context with error "+m.message),f=null}}c=f!==null,this.trace("Post-update credentials valid: "+c)};s._addWatcher(u),a.on("close",()=>{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace("Attempting to bind "+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=>{let c=u=>{this.trace("Failed to bind "+(0,ui.subchannelAddressToString)(s)+" with error "+u.message),n({port:"port"in s?s.port:1,error:u.message})};i.once("error",c),i.listen(s,()=>{let u=i.address(),f;typeof u=="string"?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace("Successfully bound "+(0,ui.subchannelAddressToString)(f)),n({port:"port"in f?f.port:1}),i.removeListener("error",c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&&s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=>(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=>this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=>u.error===void 0).length,port:i.port,errors:c.filter(u=>u.error).map(u=>u.error)}}}else{let i=await Promise.all(s.map(n=>this.bindOneAddress(n,a)));return{count:i.filter(n=>n.error===void 0).length,port:i[0].port,errors:i.filter(n=>n.error).map(n=>n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count>0)return i.count<s.length&&Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(",")}]`)}}resolvePort(s){return new Promise((a,i)=>{let n={onSuccessfulResolution:(c,u,f)=>{n.onSuccessfulResolution=()=>{};let _=[].concat(...c.map(m=>m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=>{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port "${s}"`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port "${s}"`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof s!="string")throw new TypeError("port must be a string");if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof i!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+s);let n=this.normalizePort(s),l=(_,m)=>{process.nextTick(()=>i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=>i(null,_),_=>i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=>{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=>{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=>{c.completionPromise=null,c.portNumber=_,i(null,_)},_=>{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=>{n.emit("connection",c)},drain:c=>{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=>{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=>{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace("Closing server with address "+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=>{i&&i.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace("Closing session initiated by "+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=>{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace("unbind port="+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error("Cannot unbind port 0");let n=this.boundPorts.get((0,Pr.uriToString)(a));n&&(this.trace("unbinding "+n.mapKey+" originally bound as "+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace("drain port="+s+" graceTimeMs="+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=>{f.delete(O)})}(n=(i=setTimeout(()=>{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=>{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=>!s.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(s){var a;let i=c=>{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&&i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace("Waiting for server "+f+" to close"),this.closeServer(c,()=>{this.trace("Server "+f+" finished closing"),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace("Waiting for session "+m+" to close"),this.closeSession(_,()=>{this.trace("Session "+m+" finished closing"),l()})}}n===0&&i()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!="string"||!i.startsWith("application/grpc")?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj("Received call to method "+s+" at address "+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj("No handler registered for method "+s+". Sending UNIMPLEMENTED status."),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({"grpc-status":(n=s.code)!==null&&n!==void 0?n:qe.Status.INTERNAL,"grpc-message":s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=>{n&&(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{n&&(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=>{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=>{n&&(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i==="unary")fEe(s,a);else if(i==="clientStream")pEe(s,a);else if(i==="serverStream")dEe(s,a);else if(i==="bidi")hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n="null";i&&(typeof i=="string"?n=i:n=i.address+":"+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on("stream",l.bind(this,a)),s.on("session",c)}_sessionHandler(s){return a=>{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=>{var F,N;f=!0,this.trace("Connection dropped by max connection age: "+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(c=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=>{u&&(clearTimeout(u),u=null)},O=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,y,A=()=>{var I;O()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=>{var I;if(!O())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let M="";try{a.ping((N,z,B)=>{m(),N?(this.keepaliveTrace("Ping failed with error: "+N.message),f=!0,a.close()):(this.keepaliveTrace("Received ping response"),A())})||(M="Ping returned false")}catch(F){M=(F instanceof Error?F.message:"")||"Unknown error"}if(M){this.keepaliveTrace("Ping send failed: "+M),this.trace("Connection dropped due to ping send error: "+M),f=!0,a.close();return}u=setTimeout(()=>{m(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on("close",()=>{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&&clearTimeout(l),c&&clearTimeout(c),m(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=>{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&&n!==void 0?n:"unknown",this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+_),this.trace("Connection established by client "+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=>{var te;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(O=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=>{y&&(clearTimeout(y),y=null)},F=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,N,z=()=>{var B;F()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),y=setTimeout(()=>{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=>{var B;if(!F())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let G="";try{a.ping(($,le,v)=>{M(),$?(this.keepaliveTrace("Ping failed with error: "+$.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+$.message+" return in "+le),A=!0,a.close()):(this.keepaliveTrace("Received ping response"),z())})||(G="Ping returned false")}catch(te){G=(te instanceof Error?te.message:"")||"Unknown error"}if(G){this.keepaliveTrace("Ping send failed: "+G),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=>{M(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on("close",()=>{var B;A||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&&clearTimeout(m),O&&clearTimeout(O),M(),I!==null&&(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout>=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace("Enable idle timeout for "+l.remoteAddress+":"+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&&n.activeStreams===0&&(Date.now()-n.lastIdle>=s.sessionIdleTimeout?(s.trace("Session idle timeout triggered for "+(i==null?void 0:i.remoteAddress)+":"+(i==null?void 0:i.remotePort)+" last idle at "+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&&(i.activeStreams+=1,s.once("close",i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&&(n.activeStreams-=1,n.activeStreams===0&&(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace("Session onStreamClose"+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+":"+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+" at "+n.lastIdle)))}},(()=>{let o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[lEe("Calling start() is no longer necessary. It can be safely omitted.")],nEe(r,null,t,{kind:"method",name:"start",static:!1,private:!1,access:{has:s=>"start"in s,get:s=>s.start},metadata:o},null,e),o&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}});var e4=T(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}});var cE=T(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V("net"),yEe="pick_first";function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au="pick_first",OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t>1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&&(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&&(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n<Math.max(a.length,i.length);n++)n<a.length&&e.push(a[n]),n<i.length&&e.push(i[n]);return e}var o4="grpc-node.internal.pick-first.report_health_status",lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=>{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&&a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&&this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&&(n.hasReportedTransientFailure=!0,s&&(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t>=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&&(su("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+" -> "+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su("connectToAddressList(["+e.map(s=>(0,t4.subchannelAddressToString)(s))+"])");let o=e.map(s=>({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&&(e=i4(e));let s=[].concat(...e.map(i=>i.addresses));su("updateAddressList(["+s.map(i=>(0,t4.subchannelAddressToString)(i))+"])"),s.length===0&&(this.lastError="No addresses resolved");let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=>{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V("fs"),PEe=Pe(),IEe=ue(),bEe=V("util"),LEe="certificate_provider";function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");uE("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=>{if(this.refreshTimer){uE("File watcher read certificates certificate "+e.status+", privateKey "+t.status+", CA certificate "+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&t.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status==="fulfilled"?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),uE("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,"trace",{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,"log",{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,"registerResolver",{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,"createResolver",{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,"uriToString",{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,"splitHostPort",{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,"durationToMs",{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,"parseDuration",{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,"BackoffTimeout",{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,"createChildChannelControlHelper",{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,"registerLoadBalancerType",{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,"selectLbConfigFromList",{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,"LeafLoadBalancer",{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,"subchannelAddressToString",{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,"endpointToString",{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,"endpointHasAddress",{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,"EndpointMap",{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,"UnavailablePicker",{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,"QueuePicker",{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,"PickResultType",{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,"BaseFilter",{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,"FilterStackFactory",{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,"registerAdminService",{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===""?s="/"+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function qEe(){(0,HEe.registerResolver)("unix",OA)}});var m4=T(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.setup=KEe;var d4=V("net"),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe="ip_resolver";function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA="ipv4",CA="ipv6",zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4("Resolver constructed for target "+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(",");for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&&!(0,d4.isIPv4)(l.host)||e.scheme===CA&&!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&&s!==void 0?s:zEe})}this.endpoints=a.map(n=>({addresses:[n]})),E4("Parsed "+e.scheme+" address list "+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe="round_robin";function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E="round_robin",bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=>{this.currentState===yt.ConnectivityState.READY&&t!==yt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),s&&(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)>0){let e=this.children.filter(o=>o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=>(0,T4.endpointEqual)(s.getEndpoint(),o)),t<0&&(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=>({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)>0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+" -> "+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4("Connect to endpoint list "+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=>new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=>{"use strict";var xA;Object.defineProperty(No,"__esModule",{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome="outlier_detection";function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA="outlier_detection",sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&xA!==void 0?xA:"true")==="true",ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&&r[e]!==void 0&&typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&&r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds>=0&&r[e].seconds<=315576e6&&r[e].nanos>=0&&r[e].nanos<=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,"number",t),e in r&&r[e]!==void 0&&!(r[e]>=0&&r[e]<=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&&t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,"interval"),wA(e,"base_ejection_time"),wA(e,"max_ejection_time"),mE(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Ia(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),mE(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Ia(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Ia(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");mE(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),mE(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&&t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&&(a=i=>{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=>{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&&i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=>{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it("Running success rate check");let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it("Stats for "+(0,MA.endpointToString)(f)+": successes="+m+" failures="+O+" targetRequestVolume="+o),m+O>=o&&(s+=1,a.push(m/(m+O)))}if(it("Found "+s+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+a+"]"),s<t.minimum_hosts)return;let i=a.reduce((f,_)=>f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it("stdev="+c+" ejectionThreshold="+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O<o)continue;let y=m/(m+O);if(it("Checking candidate "+f+" successRate="+y),y<u){let A=Math.random()*100;it("Candidate "+f+" randomNumber="+A+" enforcement_percentage="+t.enforcement_percentage),A<t.enforcement_percentage&&(it("Ejecting candidate "+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i>=t.request_volume&&(o+=1)}if(!(o<t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it("Candidate successes="+i+" failures="+n),i+n<t.request_volume)continue;if(n*100/(n+i)>t.threshold){let c=Math.random()*100;it("Candidate "+s+" randomNumber="+c+" enforcement_percentage="+t.enforcement_percentage),c<t.enforcement_percentage&&(it("Ejecting candidate "+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier>0&&(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i<new Date&&(it("Unejecting "+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it("Received update with config: "+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it("Adding map entry for "+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&&(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,"CallCredentials",{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,"Channel",{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,"compressionAlgorithms",{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,"connectivityState",{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,"ChannelCredentials",{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,"Client",{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,"logVerbosity",{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,"status",{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,"propagate",{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,"loadPackageDefinition",{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,"makeClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,"makeGenericClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,"Metadata",{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,"Server",{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,"ServerCredentials",{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,"StatusBuilder",{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),combineCallCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=>r.close();w.closeClient=mme;var Tme=(r,e,t)=>r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.loadObject=Sme;var gme=(r,e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.load=gme;var vme=r=>{N4.setLogger(r)};w.setLogger=vme;var yme=r=>{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=>R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,"ListenerBuilder",{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,"RequesterBuilder",{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,"InterceptingCall",{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,"InterceptorConfigurationError",{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,"getChannelzHandlers",{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,"addAdminServicesToServer",{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,"ServerListenerBuilder",{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,"ResponderBuilder",{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,"ServerInterceptingCall",{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=>o,requestDeserialize:o=>o,responseSerialize:o=>o,responseDeserialize:o=>o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r==="gzip"?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:"failure",error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:"failure",error:i})}}return new Promise(s=>{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error("metadata was null"),status:"failure"});this._client.export(o,this._metadata,{deadline:a},(i,n)=>{s(i?{status:"failure",error:i}:{data:n,status:"success"})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.VERSION=void 0;AE.VERSION="0.56.0"});var w4=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V("url"),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol==="unix:"?r:(o.pathname&&o.pathname!=="/"&&b4.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),o.protocol!==""&&!(!((e=o.protocol)===null||e===void 0)&&e.match(/^(http)s?:$/))&&b4.diag.warn("URL protocol should be http(s)://. Using http://."),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length<1&&r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=>{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&&u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&&_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&&a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&&n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=>{let r=(0,hu.createEmptyMetadata)();return r.set("User-Agent",`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:"http://localhost:4317",credentials:r=>r.startsWith("http://")?()=>(0,hu.createInsecureCredentials)():()=>(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=>{P();qA=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var NE,U4=p(()=>{NE="baggage"});function PE(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function IE(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Eu(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Eu(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var jA=p(()=>{P()});var bE,V4=p(()=>{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=>n.length<=4096).slice(0,180),i=PE(a);i.length>0&&o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=Eu(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=>{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r=="string"&&r.length>0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var q4=p(()=>{P()});function xE(){return r=>{S.error(Xme(r))}}function Xme(r){return typeof r=="string"?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=>{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=>{KA();j4=xE()});var La,XA=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(La||(La={}))});function Zme(r){return Qme.indexOf(r)>-1}function tTe(r){return eTe.indexOf(r)>-1}function nTe(r){return rTe.indexOf(r)>-1}function iTe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o=="string"){let s=aTe[o.toUpperCase()];s!=null&&(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case"OTEL_LOG_LEVEL":lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=>{P();XA();Jme=",",Qme=["OTEL_SDK_DISABLED"];eTe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rTe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=>{QA()});var UE,K4=p(()=>{UE=typeof globalThis=="object"?globalThis:global});function $4(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var ZA=p(()=>{});function BE(r){return Buffer.from(kE(r)).toString("base64")}var X4=p(()=>{ZA()});function W4(r){return function(){for(let t=0;t<r/4;t++)VE.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(VE[t]>0);t++)t===r-1&&(VE[r-1]=1);return VE.toString("hex",0,r)}}var xa,VE,J4=p(()=>{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from"perf_hooks";var di,Q4=p(()=>{di=cTe});var FE,eR=p(()=>{FE="1.29.0"});var GE,Z4=p(()=>{eR();Ve();GE={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=>{});var t6=p(()=>{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=>{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!="number"){let e=di;r=e.timing&&e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r=="number"?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r=="number")return r<jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError("Invalid input type")}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function c6(r){return YE(r)||typeof r=="number"||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=qE&&(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=>{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(zE||(zE={}))});var KE,p6=p(()=>{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&&!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=>{iR="[_0-9a-z-*/]",pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=>{_6();E6=32,mTe=512,m6=",",T6="=",wa=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length>mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&&h6(n)&&t.set(i,n)}return t},new Map),this._internalState.size>E6&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=>{P();_u();oR();vu="traceparent",yu="tracestate",TTe="00",STe="(?!ff)[\\da-f]{2}",gTe="(?![0]{32})[\\da-f]{32}",vTe="(?![0]{16})[\\da-f]{16}",yTe="[\\da-f]{2}",OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&&o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new wa(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=>{P();aR=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(XE||(XE={}))});var Co,lR=p(()=>{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var hi,cR=p(()=>{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var WE,A6=p(()=>{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=>{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&N6.call(t)===PTe}function LTe(r){return r!=null&&typeof r=="object"}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&&Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&&(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=>{ATe="[object Object]",RTe="[object Null]",NTe="[object Undefined]",CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t>DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a<i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(QE(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&&Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r=="function"}function Ou(r){return!QE(r)&&!ZE(r)&&!w6(r)&&typeof r=="object"}function QE(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=>{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Au,k6=p(()=>{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e=="string"?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=>{});function F6(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var G6=p(()=>{});var em,H6=p(()=>{em=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=>{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=>{he.with(RE(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Y6=p(()=>{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=>Co,AlwaysOnSampler:()=>hi,AnchoredClock:()=>LE,BindOnceFuture:()=>tm,CompositePropagator:()=>KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>mu,DEFAULT_ENVIRONMENT:()=>Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>JA,ExportResultCode:()=>zE,ParentBasedSampler:()=>WE,RPCType:()=>XE,RandomIdGenerator:()=>xa,SDK_INFO:()=>GE,TRACE_PARENT_HEADER:()=>vu,TRACE_STATE_HEADER:()=>yu,TimeoutError:()=>Au,TraceIdRatioBasedSampler:()=>JE,TraceState:()=>wa,TracesSamplerValues:()=>La,VERSION:()=>FE,W3CBaggagePropagator:()=>bE,W3CTraceContextPropagator:()=>$E,_globalThis:()=>UE,addHrTimes:()=>nR,baggageUtils:()=>kTe,callWithTimeout:()=>U6,deleteRPCMetadata:()=>v6,getEnv:()=>wE,getEnvWithoutDefaults:()=>DE,getRPCMetadata:()=>y6,getTimeOrigin:()=>jE,globalErrorHandler:()=>ME,hexToBase64:()=>BE,hexToBinary:()=>kE,hrTime:()=>rR,hrTimeDuration:()=>i6,hrTimeToMicroseconds:()=>l6,hrTimeToMilliseconds:()=>a6,hrTimeToNanoseconds:()=>s6,hrTimeToTimeStamp:()=>o6,internal:()=>BTe,isAttributeKey:()=>YA,isAttributeValue:()=>zA,isTimeInput:()=>c6,isTimeInputHrTime:()=>YE,isTracingSuppressed:()=>ba,isUrlIgnored:()=>B6,isWrapped:()=>F6,loggingErrorHandler:()=>xE,merge:()=>x6,millisToHrTime:()=>Ma,otperformance:()=>di,parseEnvironment:()=>gu,parseTraceParent:()=>sR,sanitizeAttributes:()=>G4,setGlobalErrorHandler:()=>Y4,setRPCMetadata:()=>g6,suppressTracing:()=>RE,timeInputToHrTime:()=>n6,unrefTimer:()=>HE,unsuppressTracing:()=>D4,urlMatches:()=>pR});var kTe,BTe,K6=p(()=>{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V("fs"),GTe=V("path"),W6=(P(),ee(ot));function dR(r,e){if(r!=null&&r!=="")return r;if(e!=null&&e!=="")return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&&Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=>e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)==="true"}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&&t!=null;return o!=null&&!s?(W6.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=>e.startsWith("http://")?()=>(0,Ru.createInsecureCredentials)():e.startsWith("https://")?()=>J6(r):()=>$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&&WTe.diag.warn("Headers cannot be set when using grpc");let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=>{var o;return(o=r.metadata)!==null&&o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=>t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,"LOGS"),oSe.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}};om.OTLPLogExporter=ER});var iY=T(Io=>{"use strict";var aSe=Io&&Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),lSe=Io&&Io.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aSe(e,r,t)};Object.defineProperty(Io,"__esModule",{value:!0});lSe(nY(),Io)});var oY,sY=p(()=>{oY="0.56.0"});var Ua,aY=p(()=>{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${oY}`,"Content-Type":"application/x-protobuf"}),Ah))}}});var lY=p(()=>{aY()});var cY=p(()=>{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=>Ua});var fY=p(()=>{cY()});var pY,dY=p(()=>{pY="0.56.0"});var ka,hY=p(()=>{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${pY}`,"Content-Type":"application/x-protobuf"}),Rh))}}});var _Y=p(()=>{hY()});var EY=p(()=>{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=>ka});var TY=p(()=>{EY()});var SY,gY=p(()=>{SY="0.56.0"});var mR,vY=p(()=>{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${SY}`,"Content-Type":"application/json"}),Nh))}}});var yY=p(()=>{vY()});var OY=p(()=>{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=>mR});var RY=p(()=>{OY()});var CY=T(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,"TRACES"),cSe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};sm.OTLPTraceExporter=TR});var PY=T(bo=>{"use strict";var fSe=bo&&bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),pSe=bo&&bo.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fSe(e,r,t)};Object.defineProperty(bo,"__esModule",{value:!0});pSe(CY(),bo)});var am,IY=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(am||(am={}))});function _Se(r){return hSe.indexOf(r)>-1}function mSe(r){return ESe.indexOf(r)>-1}function SSe(r){return TSe.indexOf(r)>-1}function ySe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o=="string"){let s=RSe[o.toUpperCase()];s!=null&&(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case"OTEL_LOG_LEVEL":NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=>{P();IY();dSe=",",hSe=["OTEL_SDK_DISABLED"];ESe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];TSe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=>{LY()});var wY=p(()=>{xY()});var DY=p(()=>{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=>{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(sn||(sn={}))});var lm=p(()=>{UY();kY();DY()});import*as DSe from"http";import*as USe from"https";import*as BY from"url";function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:"POST",headers:Object.assign({"Content-Type":"application/json"},e)},t);return function(a,i){if(a.length===0)return S.debug("Zipkin send with empty spans"),i({code:sn.SUCCESS});let{request:n}=o.protocol==="http:"?DSe:USe,l=n(o,u=>{let f="";u.on("data",_=>{f+=_}),u.on("end",()=>{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_<400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on("error",u=>i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,"utf8"),l.end()}}var VY=p(()=>{P();lm()});var FY=p(()=>{VY()});var yR=p(()=>{FY()});var xo,GY=p(()=>{(function(r){r.CLIENT="CLIENT",r.SERVER="SERVER",r.CONSUMER="CONSUMER",r.PRODUCER="PRODUCER"})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&&(l[i]=String(jt[t.code])),t.code===jt.ERROR&&t.message&&(l[n]=t.message),o&&(l["otel.dropped_attributes_count"]=String(o)),s&&(l["otel.dropped_events_count"]=String(s)),a&&(l["otel.dropped_links_count"]=String(a)),Object.keys(e.attributes).forEach(c=>l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=>({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=>{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY="otel.status_code",qY="error"});function zY(r){return function(){return r()}}var KY=p(()=>{});var cm,$Y=p(()=>{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME="OpenTelemetry Service",this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders=="function"?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug("Zipkin exporter export"),this._isShutdown){setTimeout(()=>t({code:sn.FAILED,error:new Error("Exporter has been shutdown")}));return}let s=new Promise(i=>{this._sendSpans(e,o,n=>{i(),t(n)})});this._sendingPromises.push(s);let a=()=>{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug("Zipkin exporter shutdown"),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=>{Promise.all(this._sendingPromises).then(()=>{e()},t)})}_beforeSend(){this._getHeaders&&(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=>jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=>{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=>cm,prepareSend:()=>Lo});var WY=p(()=>{yR();$Y()});var ez=T(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe="env",YSe="host",zSe="os",KSe="process",$Se="serviceinstance";function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(","))!==null&&e!==void 0?e:["all"];return o.includes("all")?[...t.values()].flat():o.includes("none")?[]:o.flatMap(s=>{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector "${s}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=>e.trim()).filter(e=>e!=="null"&&e!=="")}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&&e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case"grpc":return new HSe.OTLPTraceExporter;case"http/json":return new GSe.OTLPTraceExporter;case"http/protobuf":return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V("@opentelemetry/exporter-jaeger");return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([["otlp",()=>WSe()],["zipkin",()=>new qSe.ZipkinExporter],["console",()=>new um.ConsoleSpanExporter],["jaeger",()=>JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(","))));if(s[0]==="none")return Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.'),[];s.length===0?(Mo.diag.warn("OTEL_TRACES_EXPORTER is empty. Using default otlp exporter."),s=["otlp"]):s.length>1&&s.includes("none")&&(Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.'),s=["otlp"]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&&Mo.diag.warn("Unable to set up trace exporter(s) due to invalid exporter and/or protocol values."),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&&(this._disabled=!0),u.OTEL_LOG_LEVEL&&ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&&t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&&o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&&s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&&(f.sampler=e.sampler),e.spanLimits&&(f.spanLimits=e.spanLimits),e.idGenerator&&(f.idGenerator=e.idGenerator),e.spanProcessor&&ln.diag.warn("The 'spanProcessor' option is deprecated. Please use 'spanProcessors' instead.");let _=(a=e.spanProcessor)!==null&&a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&&i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn("The 'logRecordProcessor' option is deprecated. Please use 'logRecordProcessors' instead.")):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&&(f.reader=e.metricReader),e.views&&(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&&l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length>0&&this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&&t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&&l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&&i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=>{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&&e!==void 0?e:"",o=(0,AR.filterBlanksAndNulls)(t.split(","));if(o.length===0&&(ln.diag.info("OTEL_LOGS_EXPORTER is empty. Using default otlp exporter."),o.push("otlp")),o.includes("none")){ln.diag.info('OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.');return}let s=[];o.forEach(a=>{var i,n;if(a==="otlp"){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&&i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case"grpc":s.push(new rge.OTLPLogExporter);break;case"http/json":s.push(new tge.OTLPLogExporter);break;case"http/protobuf":s.push(new OR.OTLPLogExporter);break;case void 0:case"":s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: "${l}". Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a==="console"?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: "${a}". Supported values are: otlp, console, none.`)}),s.length>0&&(this._loggerProviderConfig={logRecordProcessors:s.map(a=>a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,"NodeSDK",{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from"process";P();var vi=typeof globalThis=="object"?globalThis:global;function LN(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var xN="1.30.1";Ve();var yi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt<"u"?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=>sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=>{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=>{throw TypeError(r)},Jm=(r,e,t)=>e.has(r)||uM("Cannot "+t),el=(r,e,t)=>(Jm(r,e,"read from private field"),t?t.call(r):e.get(r)),Wu=(r,e,t)=>e.has(r)?uM("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=>(Jm(r,e,"write to private field"),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=>(Jm(r,e,"access private method"),t),fZ="__nfOTLPTrace",tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:"netlify-span-exporter"}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error("Exporter has been shutdown")});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug("Shutting down"),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&&!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&&o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)=="function"?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName="@netlify/otel/instrumentation-fetch",this.instrumentationVersion="1.0.0",this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,"http.request.method":e.method,"url.full":o.href,"url.host":o.host,"url.scheme":o.protocol.slice(0,-1),"server.address":o.hostname,"server.port":o.port,...this.prepareHeaders("request",e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,"http.response.status_code":e.status,...this.prepareHeaders("response",e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=["*","/.*/"],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=>t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=>typeof f=="string"?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=>typeof f=="string"?f==l:f.test(l))?i[u]="REDACTED":i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=>{var a;let o=typeof e=="string"?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&&a.some(i=>typeof i=="string"?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan("fetch",async i=>{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&&(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&&S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({"service.name":SERVICE_NAME??"lambda-function","service.version":SERVICE_VERSION,"process.runtime.name":"nodejs","process.runtime.version":lge.slice(1),"deployment.environment":(iz=bu.URL)!=null&&iz.includes("netlifystg.com")?"staging":"production","http.url":bu.URL,"netlify.site.id":bu.SITE_ID,"netlify.site.name":bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */
๐Ÿ“ netlify
๐Ÿ“ functions
๐Ÿ“„ sitemap.js
// netlify/functions/sitemap.js var fs = require("fs").promises; var path = require("path"); var SITEMAP_CONFIG = { MAX_URLS_PER_SITEMAP: 5e4, CACHE_DURATION: 24 * 60 * 60 * 1e3, // 24 hours DEFAULT_CHANGEFREQ: "weekly", DEFAULT_PRIORITY: 0.5, HIGH_PRIORITY: 0.9, MEDIUM_PRIORITY: 0.7, LOW_PRIORITY: 0.3 }; var STATIC_PAGES = [ { path: "/", changefreq: "daily", priority: 1 }, { path: "/tools", changefreq: "weekly", priority: 0.9 }, { path: "/blog", changefreq: "daily", priority: 0.8 }, { path: "/about", changefreq: "monthly", priority: 0.6 }, { path: "/contact", changefreq: "monthly", priority: 0.6 }, { path: "/privacy-policy", changefreq: "yearly", priority: 0.3 }, { path: "/terms-of-use", changefreq: "yearly", priority: 0.3 }, { path: "/dmca", changefreq: "yearly", priority: 0.3 }, { path: "/cookies-policy", changefreq: "yearly", priority: 0.3 } ]; var sitemapCache = null; function getSiteOrigin() { return process.env.URL || process.env.SITE_URL || "https://modernphototools.com"; } function escapeXml(str) { return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"); } async function loadBlogArticles() { try { const contentDir = path.join(process.cwd(), "content", "blog"); const files = await fs.readdir(contentDir); const markdownFiles = files.filter((file) => file.endsWith(".md")); const articles = []; for (const file of markdownFiles) { const filePath = path.join(contentDir, file); const content = await fs.readFile(filePath, "utf-8"); const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); if (frontmatterMatch) { const frontmatter = frontmatterMatch[1]; const slug = file.replace(".md", ""); const titleMatch = frontmatter.match(/title:\s*["']?([^"'\n]+)["']?/); const dateMatch = frontmatter.match(/date:\s*["']?([^"'\n]+)["']?/); if (titleMatch) { articles.push({ slug, title: titleMatch[1], date: dateMatch ? dateMatch[1] : (/* @__PURE__ */ new Date()).toISOString() }); } } } return articles; } catch (error) { console.error("Error loading blog articles:", error); return []; } } async function getImageFiles() { try { const imagesDir = path.join(process.cwd(), "public", "images"); const images = []; async function scanDirectory(dir, relativePath = "") { try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { await scanDirectory(itemPath, path.join(relativePath, item)); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { images.push({ path: `/images/${path.join(relativePath, item).replace(/\\/g, "/")}`, filename: item }); } } } catch (error) { console.warn(`Could not scan directory ${dir}:`, error.message); } } await scanDirectory(imagesDir); return images; } catch (error) { console.error("Error loading images:", error); return []; } } async function getAllSitemapUrls() { const baseUrl = getSiteOrigin(); const urls = []; const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0]; STATIC_PAGES.forEach((page) => { urls.push({ loc: `${baseUrl}${page.path}`, lastmod: now, changefreq: page.changefreq, priority: page.priority }); }); TOOLS.forEach((tool) => { urls.push({ loc: `${baseUrl}${tool.path}`, lastmod: now, changefreq: "weekly", priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); try { const articles = await loadBlogArticles(); articles.forEach((article) => { urls.push({ loc: `${baseUrl}/blog/${article.slug}`, lastmod: article.date.split("T")[0], changefreq: "monthly", priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); } catch (error) { console.error("Error adding blog articles to sitemap:", error); } try { const images = await getImageFiles(); images.forEach((image) => { urls.push({ loc: `${baseUrl}${image.path}`, lastmod: now, changefreq: "yearly", priority: SITEMAP_CONFIG.LOW_PRIORITY }); }); } catch (error) { console.error("Error adding images to sitemap:", error); } return urls; } function formatSitemapXml(urls) { const xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>'; const urlsetOpen = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; const urlsetClose = "</urlset>"; const urlEntries = urls.map((url) => { let urlXml = ` <url> <loc>${escapeXml(url.loc)}</loc>`; if (url.lastmod) { urlXml += ` <lastmod>${url.lastmod}</lastmod>`; } if (url.changefreq) { urlXml += ` <changefreq>${url.changefreq}</changefreq>`; } if (url.priority !== void 0) { urlXml += ` <priority>${url.priority.toFixed(1)}</priority>`; } urlXml += "\n </url>"; return urlXml; }).join("\n"); return `${xmlHeader} ${urlsetOpen} ${urlEntries} ${urlsetClose}`; } function isCacheValid(timestamp) { return timestamp && Date.now() - timestamp < SITEMAP_CONFIG.CACHE_DURATION; } async function generateSitemap() { try { if (sitemapCache && isCacheValid(sitemapCache.timestamp)) { console.log("Returning cached sitemap"); return sitemapCache.xml; } console.log("Generating new sitemap..."); const allUrls = await getAllSitemapUrls(); console.log(`Found ${allUrls.length} URLs for sitemap`); const xml = formatSitemapXml(allUrls); sitemapCache = { xml, timestamp: Date.now(), urlCount: allUrls.length }; console.log("Sitemap generated and cached successfully"); return xml; } catch (error) { console.error("Error generating sitemap:", error); throw new Error("Failed to generate sitemap"); } } exports.handler = async function(event, context) { if (event.httpMethod === "OPTIONS") { return { statusCode: 200, headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, OPTIONS", "Access-Control-Allow-Headers": "Content-Type" }, body: "" }; } if (event.httpMethod !== "GET") { return { statusCode: 405, headers: { "Content-Type": "application/xml; charset=utf-8" }, body: '<?xml version="1.0" encoding="UTF-8"?><error>Method Not Allowed</error>' }; } try { console.log("Sitemap request received"); const sitemapXml = await generateSitemap(); return { statusCode: 200, headers: { "Content-Type": "application/xml; charset=utf-8", "Cache-Control": "public, max-age=3600, s-maxage=3600", // Cache for 1 hour "Access-Control-Allow-Origin": "*" }, body: sitemapXml }; } catch (error) { console.error("Error serving sitemap:", error); return { statusCode: 500, headers: { "Content-Type": "application/xml; charset=utf-8" }, body: '<?xml version="1.0" encoding="UTF-8"?><error>Internal Server Error</error>' }; } }; //# sourceMappingURL=sitemap.js.map
๐Ÿ“„ sitemap.js.map
{ "version": 3, "sources": ["../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap.js"], "sourceRoot": "C:/Users/6732~1/AppData/Local/Temp/tmp-13180-B6Y5Lgc620L3", "sourcesContent": ["// Netlify function for serving sitemap.xml\nconst fs = require('fs').promises;\nconst path = require('path');\n\n// Import the sitemap utilities (we'll need to adapt these for Node.js)\n// Since we can't directly import TypeScript modules in Netlify functions,\n// we'll implement the core functionality here\n\n// Configuration\nconst SITEMAP_CONFIG = {\n MAX_URLS_PER_SITEMAP: 50000,\n CACHE_DURATION: 24 * 60 * 60 * 1000, // 24 hours\n DEFAULT_CHANGEFREQ: 'weekly',\n DEFAULT_PRIORITY: 0.5,\n HIGH_PRIORITY: 0.9,\n MEDIUM_PRIORITY: 0.7,\n LOW_PRIORITY: 0.3,\n};\n\n// Static pages configuration\nconst STATIC_PAGES = [\n { path: '/', changefreq: 'daily', priority: 1.0 },\n { path: '/tools', changefreq: 'weekly', priority: 0.9 },\n { path: '/blog', changefreq: 'daily', priority: 0.8 },\n { path: '/about', changefreq: 'monthly', priority: 0.6 },\n { path: '/contact', changefreq: 'monthly', priority: 0.6 },\n { path: '/privacy-policy', changefreq: 'yearly', priority: 0.3 },\n { path: '/terms-of-use', changefreq: 'yearly', priority: 0.3 },\n { path: '/dmca', changefreq: 'yearly', priority: 0.3 },\n { path: '/cookies-policy', changefreq: 'yearly', priority: 0.3 },\n];\n\n/**\n * Load tools from the actual tools data file\n */\nasync function loadTools() {\n try {\n // Read the tools.ts file and extract the tools array\n const toolsFilePath = path.join(process.cwd(), 'src', 'data', 'tools.ts');\n const toolsContent = await fs.readFile(toolsFilePath, 'utf-8');\n \n // Extract tools data using regex (since we can't directly import TypeScript)\n const toolsMatch = toolsContent.match(/export const tools: Tool\\[\\] = \\[([\\s\\S]*?)\\];/);\n if (!toolsMatch) {\n throw new Error('Could not parse tools from tools.ts');\n }\n \n // Parse each tool object\n const toolsArrayContent = toolsMatch[1];\n const toolObjects = [];\n \n // Split by tool objects (looking for id, name, path patterns)\n const toolMatches = toolsArrayContent.match(/\\{[^}]*id:\\s*['\"`]([^'\"`]+)['\"`][^}]*name:\\s*['\"`]([^'\"`]+)['\"`][^}]*path:\\s*['\"`]([^'\"`]+)['\"`][^}]*\\}/g);\n \n if (toolMatches) {\n for (const toolMatch of toolMatches) {\n const idMatch = toolMatch.match(/id:\\s*['\"`]([^'\"`]+)['\"`]/);\n const nameMatch = toolMatch.match(/name:\\s*['\"`]([^'\"`]+)['\"`]/);\n const pathMatch = toolMatch.match(/path:\\s*['\"`]([^'\"`]+)['\"`]/);\n \n if (idMatch && nameMatch && pathMatch) {\n toolObjects.push({\n id: idMatch[1],\n name: nameMatch[1],\n path: pathMatch[1]\n });\n }\n }\n }\n \n return toolObjects;\n } catch (error) {\n console.error('Error loading tools:', error);\n // Fallback to empty array if loading fails\n return [];\n }\n}\n\n// Cache storage (in production, this could be in a database or external cache)\nlet sitemapCache = null;\n\n/**\n * Get site origin\n */\nfunction getSiteOrigin() {\n return process.env.URL || process.env.SITE_URL || 'https://modernphototools.com';\n}\n\n/**\n * Escape XML characters\n */\nfunction escapeXml(str) {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Load blog articles from markdown files\n */\nasync function loadBlogArticles() {\n try {\n const contentDir = path.join(process.cwd(), 'content', 'blog');\n const files = await fs.readdir(contentDir);\n const markdownFiles = files.filter(file => file.endsWith('.md'));\n \n const articles = [];\n for (const file of markdownFiles) {\n const filePath = path.join(contentDir, file);\n const content = await fs.readFile(filePath, 'utf-8');\n \n // Extract frontmatter\n const frontmatterMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (frontmatterMatch) {\n const frontmatter = frontmatterMatch[1];\n const slug = file.replace('.md', '');\n \n // Parse basic frontmatter (simplified)\n const titleMatch = frontmatter.match(/title:\\s*[\"']?([^\"'\\n]+)[\"']?/);\n const dateMatch = frontmatter.match(/date:\\s*[\"']?([^\"'\\n]+)[\"']?/);\n \n if (titleMatch) {\n articles.push({\n slug,\n title: titleMatch[1],\n date: dateMatch ? dateMatch[1] : new Date().toISOString(),\n });\n }\n }\n }\n \n return articles;\n } catch (error) {\n console.error('Error loading blog articles:', error);\n return [];\n }\n}\n\n/**\n * Get all image files from public directory\n */\nasync function getImageFiles() {\n try {\n const imagesDir = path.join(process.cwd(), 'public', 'images');\n const images = [];\n \n async function scanDirectory(dir, relativePath = '') {\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n await scanDirectory(itemPath, path.join(relativePath, item));\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n images.push({\n path: `/images/${path.join(relativePath, item).replace(/\\\\/g, '/')}`,\n filename: item,\n });\n }\n }\n } catch (error) {\n console.warn(`Could not scan directory ${dir}:`, error.message);\n }\n }\n \n await scanDirectory(imagesDir);\n return images;\n } catch (error) {\n console.error('Error loading images:', error);\n return [];\n }\n}\n\n/**\n * Generate all sitemap URLs\n */\nasync function getAllSitemapUrls() {\n const baseUrl = getSiteOrigin();\n const urls = [];\n const now = new Date().toISOString().split('T')[0];\n \n // Add static pages\n STATIC_PAGES.forEach(page => {\n urls.push({\n loc: `${baseUrl}${page.path}`,\n lastmod: now,\n changefreq: page.changefreq,\n priority: page.priority,\n });\n });\n \n // Add tool pages\n TOOLS.forEach(tool => {\n urls.push({\n loc: `${baseUrl}${tool.path}`,\n lastmod: now,\n changefreq: 'weekly',\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n \n // Add blog articles\n try {\n const articles = await loadBlogArticles();\n articles.forEach(article => {\n urls.push({\n loc: `${baseUrl}/blog/${article.slug}`,\n lastmod: article.date.split('T')[0],\n changefreq: 'monthly',\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n } catch (error) {\n console.error('Error adding blog articles to sitemap:', error);\n }\n \n // Add image files\n try {\n const images = await getImageFiles();\n images.forEach(image => {\n urls.push({\n loc: `${baseUrl}${image.path}`,\n lastmod: now,\n changefreq: 'yearly',\n priority: SITEMAP_CONFIG.LOW_PRIORITY,\n });\n });\n } catch (error) {\n console.error('Error adding images to sitemap:', error);\n }\n \n return urls;\n}\n\n/**\n * Format sitemap XML\n */\nfunction formatSitemapXml(urls) {\n const xmlHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n const urlsetOpen = '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n const urlsetClose = '</urlset>';\n \n const urlEntries = urls.map(url => {\n let urlXml = ` <url>\\n <loc>${escapeXml(url.loc)}</loc>`;\n \n if (url.lastmod) {\n urlXml += `\\n <lastmod>${url.lastmod}</lastmod>`;\n }\n \n if (url.changefreq) {\n urlXml += `\\n <changefreq>${url.changefreq}</changefreq>`;\n }\n \n if (url.priority !== undefined) {\n urlXml += `\\n <priority>${url.priority.toFixed(1)}</priority>`;\n }\n \n urlXml += '\\n </url>';\n return urlXml;\n }).join('\\n');\n \n return `${xmlHeader}\\n${urlsetOpen}\\n${urlEntries}\\n${urlsetClose}`;\n}\n\n/**\n * Check if cache is valid\n */\nfunction isCacheValid(timestamp) {\n return timestamp && (Date.now() - timestamp) < SITEMAP_CONFIG.CACHE_DURATION;\n}\n\n/**\n * Generate sitemap\n */\nasync function generateSitemap() {\n try {\n // Check cache first\n if (sitemapCache && isCacheValid(sitemapCache.timestamp)) {\n console.log('Returning cached sitemap');\n return sitemapCache.xml;\n }\n \n console.log('Generating new sitemap...');\n \n // Get all URLs\n const allUrls = await getAllSitemapUrls();\n console.log(`Found ${allUrls.length} URLs for sitemap`);\n \n // Generate XML\n const xml = formatSitemapXml(allUrls);\n \n // Cache the result\n sitemapCache = {\n xml,\n timestamp: Date.now(),\n urlCount: allUrls.length,\n };\n \n console.log('Sitemap generated and cached successfully');\n return xml;\n \n } catch (error) {\n console.error('Error generating sitemap:', error);\n throw new Error('Failed to generate sitemap');\n }\n}\n\n/**\n * Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === 'OPTIONS') {\n return {\n statusCode: 200,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, OPTIONS',\n 'Access-Control-Allow-Headers': 'Content-Type',\n },\n body: '',\n };\n }\n \n // Only allow GET requests\n if (event.httpMethod !== 'GET') {\n return {\n statusCode: 405,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n },\n body: '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error>Method Not Allowed</error>',\n };\n }\n \n try {\n console.log('Sitemap request received');\n \n // Generate sitemap\n const sitemapXml = await generateSitemap();\n \n // Return sitemap with appropriate headers\n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n 'Cache-Control': 'public, max-age=3600, s-maxage=3600', // Cache for 1 hour\n 'Access-Control-Allow-Origin': '*',\n },\n body: sitemapXml,\n };\n \n } catch (error) {\n console.error('Error serving sitemap:', error);\n \n return {\n statusCode: 500,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n },\n body: '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error>Internal Server Error</error>',\n };\n }\n};"], "mappings": ";AACA,IAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,IAAM,OAAO,QAAQ,MAAM;AAO3B,IAAM,iBAAiB;AAAA,EACrB,sBAAsB;AAAA,EACtB,gBAAgB,KAAK,KAAK,KAAK;AAAA;AAAA,EAC/B,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAGA,IAAM,eAAe;AAAA,EACnB,EAAE,MAAM,KAAK,YAAY,SAAS,UAAU,EAAI;AAAA,EAChD,EAAE,MAAM,UAAU,YAAY,UAAU,UAAU,IAAI;AAAA,EACtD,EAAE,MAAM,SAAS,YAAY,SAAS,UAAU,IAAI;AAAA,EACpD,EAAE,MAAM,UAAU,YAAY,WAAW,UAAU,IAAI;AAAA,EACvD,EAAE,MAAM,YAAY,YAAY,WAAW,UAAU,IAAI;AAAA,EACzD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,EAC/D,EAAE,MAAM,iBAAiB,YAAY,UAAU,UAAU,IAAI;AAAA,EAC7D,EAAE,MAAM,SAAS,YAAY,UAAU,UAAU,IAAI;AAAA,EACrD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AACjE;AAiDA,IAAI,eAAe;AAKnB,SAAS,gBAAgB;AACvB,SAAO,QAAQ,IAAI,OAAO,QAAQ,IAAI,YAAY;AACpD;AAKA,SAAS,UAAU,KAAK;AACtB,SAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAC1B;AAKA,eAAe,mBAAmB;AAChC,MAAI;AACF,UAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,UAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,UAAM,gBAAgB,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC;AAE/D,UAAM,WAAW,CAAC;AAClB,eAAW,QAAQ,eAAe;AAChC,YAAM,WAAW,KAAK,KAAK,YAAY,IAAI;AAC3C,YAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AAGnD,YAAM,mBAAmB,QAAQ,MAAM,uBAAuB;AAC9D,UAAI,kBAAkB;AACpB,cAAM,cAAc,iBAAiB,CAAC;AACtC,cAAM,OAAO,KAAK,QAAQ,OAAO,EAAE;AAGnC,cAAM,aAAa,YAAY,MAAM,+BAA+B;AACpE,cAAM,YAAY,YAAY,MAAM,8BAA8B;AAElE,YAAI,YAAY;AACd,mBAAS,KAAK;AAAA,YACZ;AAAA,YACA,OAAO,WAAW,CAAC;AAAA,YACnB,MAAM,YAAY,UAAU,CAAC,KAAI,oBAAI,KAAK,GAAE,YAAY;AAAA,UAC1D,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO,CAAC;AAAA,EACV;AACF;AAKA,eAAe,gBAAgB;AAC7B,MAAI;AACF,UAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAC7D,UAAM,SAAS,CAAC;AAEhB,mBAAe,cAAc,KAAK,eAAe,IAAI;AACnD,UAAI;AACF,cAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,mBAAW,QAAQ,OAAO;AACxB,gBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,gBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,cAAI,KAAK,YAAY,GAAG;AACtB,kBAAM,cAAc,UAAU,KAAK,KAAK,cAAc,IAAI,CAAC;AAAA,UAC7D,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD,mBAAO,KAAK;AAAA,cACV,MAAM,WAAW,KAAK,KAAK,cAAc,IAAI,EAAE,QAAQ,OAAO,GAAG,CAAC;AAAA,cAClE,UAAU;AAAA,YACZ,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,gBAAQ,KAAK,4BAA4B,GAAG,KAAK,MAAM,OAAO;AAAA,MAChE;AAAA,IACF;AAEA,UAAM,cAAc,SAAS;AAC7B,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,yBAAyB,KAAK;AAC5C,WAAO,CAAC;AAAA,EACV;AACF;AAKA,eAAe,oBAAoB;AACjC,QAAM,UAAU,cAAc;AAC9B,QAAM,OAAO,CAAC;AACd,QAAM,OAAM,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAGjD,eAAa,QAAQ,UAAQ;AAC3B,SAAK,KAAK;AAAA,MACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,MAC3B,SAAS;AAAA,MACT,YAAY,KAAK;AAAA,MACjB,UAAU,KAAK;AAAA,IACjB,CAAC;AAAA,EACH,CAAC;AAGD,QAAM,QAAQ,UAAQ;AACpB,SAAK,KAAK;AAAA,MACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,MAC3B,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU,eAAe;AAAA,IAC3B,CAAC;AAAA,EACH,CAAC;AAGD,MAAI;AACF,UAAM,WAAW,MAAM,iBAAiB;AACxC,aAAS,QAAQ,aAAW;AAC1B,WAAK,KAAK;AAAA,QACR,KAAK,GAAG,OAAO,SAAS,QAAQ,IAAI;AAAA,QACpC,SAAS,QAAQ,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,QAClC,YAAY;AAAA,QACZ,UAAU,eAAe;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,0CAA0C,KAAK;AAAA,EAC/D;AAGA,MAAI;AACF,UAAM,SAAS,MAAM,cAAc;AACnC,WAAO,QAAQ,WAAS;AACtB,WAAK,KAAK;AAAA,QACR,KAAK,GAAG,OAAO,GAAG,MAAM,IAAI;AAAA,QAC5B,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,UAAU,eAAe;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,mCAAmC,KAAK;AAAA,EACxD;AAEA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAM;AAC9B,QAAM,YAAY;AAClB,QAAM,aAAa;AACnB,QAAM,cAAc;AAEpB,QAAM,aAAa,KAAK,IAAI,SAAO;AACjC,QAAI,SAAS;AAAA,WAAqB,UAAU,IAAI,GAAG,CAAC;AAEpD,QAAI,IAAI,SAAS;AACf,gBAAU;AAAA,eAAkB,IAAI,OAAO;AAAA,IACzC;AAEA,QAAI,IAAI,YAAY;AAClB,gBAAU;AAAA,kBAAqB,IAAI,UAAU;AAAA,IAC/C;AAEA,QAAI,IAAI,aAAa,QAAW;AAC9B,gBAAU;AAAA,gBAAmB,IAAI,SAAS,QAAQ,CAAC,CAAC;AAAA,IACtD;AAEA,cAAU;AACV,WAAO;AAAA,EACT,CAAC,EAAE,KAAK,IAAI;AAEZ,SAAO,GAAG,SAAS;AAAA,EAAK,UAAU;AAAA,EAAK,UAAU;AAAA,EAAK,WAAW;AACnE;AAKA,SAAS,aAAa,WAAW;AAC/B,SAAO,aAAc,KAAK,IAAI,IAAI,YAAa,eAAe;AAChE;AAKA,eAAe,kBAAkB;AAC/B,MAAI;AAEF,QAAI,gBAAgB,aAAa,aAAa,SAAS,GAAG;AACxD,cAAQ,IAAI,0BAA0B;AACtC,aAAO,aAAa;AAAA,IACtB;AAEA,YAAQ,IAAI,2BAA2B;AAGvC,UAAM,UAAU,MAAM,kBAAkB;AACxC,YAAQ,IAAI,SAAS,QAAQ,MAAM,mBAAmB;AAGtD,UAAM,MAAM,iBAAiB,OAAO;AAGpC,mBAAe;AAAA,MACb;AAAA,MACA,WAAW,KAAK,IAAI;AAAA,MACpB,UAAU,QAAQ;AAAA,IACpB;AAEA,YAAQ,IAAI,2CAA2C;AACvD,WAAO;AAAA,EAET,SAAS,OAAO;AACd,YAAQ,MAAM,6BAA6B,KAAK;AAChD,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AACF;AAKA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAGA,MAAI,MAAM,eAAe,OAAO;AAC9B,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,MAAI;AACF,YAAQ,IAAI,0BAA0B;AAGtC,UAAM,aAAa,MAAM,gBAAgB;AAGzC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,iBAAiB;AAAA;AAAA,QACjB,+BAA+B;AAAA,MACjC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,0BAA0B,KAAK;AAE7C,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AACF;", "names": [] }
๐Ÿ“„ package.json
{"type":"commonjs"}
๐Ÿ“„ sitemap.js
module.exports = require('./netlify/functions/sitemap.js')
๐Ÿ“ sitemap-admin
๐Ÿ“„ ___netlify-telemetry.mjs
var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from"module";const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=>{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lz(e))!uz.call(r,s)&&s!==t&&xu(r,s,{get:()=>e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=>(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,"default",{value:r,enumerable:!0}):t,r)),ee=r=>NR(xu({},"__esModule",{value:!0}),r);var CR,PR=p(()=>{CR=typeof globalThis=="object"?globalThis:global});var IR=p(()=>{PR()});var bR=p(()=>{IR()});var cn,hm=p(()=>{cn="1.9.0"});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&&s.patch<=u.patch?i(l):a(l):s.minor<=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=>{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&&(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&&s!==void 0?s:{version:cn};if(!o&&a[r]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+r+" does not match previously registered API v"+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug("@opentelemetry/api: Registered a global for "+r+" v"+cn+"."),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug("@opentelemetry/api: Unregistering a global for "+r+" v"+cn+".");var t=Fa[Va];t&&delete t[r]}var pz,Va,Fa,Ei=p(()=>{bR();hm();MR();pz=cn.split(".")[0],Va=Symbol.for("opentelemetry.js.api."+pz),Fa=CR});function Ga(r,e,t){var o=xt("diag");if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=>{Ei();dz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||"DiagComponentLogger"}return r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("debug",this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("error",this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("info",this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("warn",this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ga("verbose",this._namespace,e)},r})()});var H,Mu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(H||(H={}))});function UR(r,e){r<H.NONE?r=H.NONE:r>H.ALL&&(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a=="function"&&r>=s?a.bind(e):function(){}}return{error:t("error",H.ERROR),warn:t("warn",H.WARN),info:t("info",H.INFO),debug:t("debug",H.DEBUG),verbose:t("verbose",H.VERBOSE)}}var kR=p(()=>{Mu()});var _z,Ez,mz,ft,mi=p(()=>{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz="diag",ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var n=xt("diag");if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&&(a={logLevel:H.INFO}),s===t){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((i=c.stack)!==null&&i!==void 0?i:c.message),!1}typeof a=="number"&&(a={logLevel:a});var u=xt("diag"),f=UR((n=a.logLevel)!==null&&n!==void 0?n:H.INFO,s);if(u&&!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+_),f.warn("Current logger will overwrite one already registered from "+_)}return Ir("diag",f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=>{Tz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=>{FR=Symbol("BaggageEntryMetadata")});function HR(r){return r===void 0&&(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!="string"&&(gz.error("Cannot create baggage metadata from unknown type: "+typeof r),r=""),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=>{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=>{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=>{Em=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!="function"&&(i=console.log),typeof i=="function")return i.apply(console,s)}}}for(var t=0;t<Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=>{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=>{(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=>{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&&(r[e]=t)}}});var kz,Bz,YR,zR=p(()=>{Ha();kz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=>{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm="context",Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=>{ym();ja="0000000000000000",Ya="00000000000000000000000000000000",Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=>{Fu();Pn=(function(){function r(e){e===void 0&&(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=>{Ha();Gu();qa();Om=De("OpenTelemetry Context Key SPAN")});function Mt(r){return Hz.test(r)&&r!==Ya}function Si(r){return qz.test(r)&&r!==ja}function xe(r){return Mt(r.traceId)&&Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=>{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r=="object"&&typeof r.spanId=="string"&&typeof r.traceId=="string"&&typeof r.traceFlags=="number"}var Rm,Yu,Nm=p(()=>{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&&(o=Rm.active());var s=!!(t!=null&&t.root);if(s)return new Pn;var a=o&&qu(o);return jz(a)&&xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length<2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=>{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=>{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=>{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&&s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(ke||(ke={}))});var qt,eN=p(()=>{(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(qt||(qt={}))});var jt,tN=p(()=>{(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&&!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=>{Im="[_0-9a-z-*/]",Kz="[a-z]"+Im+"{0,255}",$z="[a-z0-9]"+Im+"{0,240}@[a-z]"+Im+"{0,13}",Xz=new RegExp("^(?:"+Kz+"|"+$z+")$"),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=>{iN();oN=32,Qz=512,sN=",",aN="=",lN=(function(){function r(e){this._internalState=new Map,e&&this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length>Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&&nN(n)&&t.set(i,n)}return t},new Map),this._internalState.size>oN&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=>{cN()});var he,pN=p(()=>{qa();he=Cn.getInstance()});var S,dN=p(()=>{mi();S=ft.instance()});var Zz,hN,_N=p(()=>{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=>{_N();Ei();mi();bm="metrics",EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=>{mN();gi=EN.getInstance()});var SN,gN=p(()=>{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=>{qa();Ha();Lm=De("OpenTelemetry Baggage Key")});var Mm,eK,RN,NN=p(()=>{Ei();gN();gm();AN();_m();mi();Mm="propagation",eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&&(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&&(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=>{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=>{Ei();Pm();ju();Am();mi();wm="trace",PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=>{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=>Du,DiagLogLevel:()=>H,INVALID_SPANID:()=>ja,INVALID_SPAN_CONTEXT:()=>Uo,INVALID_TRACEID:()=>Ya,ProxyTracer:()=>zu,ProxyTracerProvider:()=>Ka,ROOT_CONTEXT:()=>wu,SamplingDecision:()=>ke,SpanKind:()=>qt,SpanStatusCode:()=>jt,TraceFlags:()=>se,ValueType:()=>Ot,baggageEntryMetadataFromString:()=>Lr,context:()=>he,createContextKey:()=>De,createNoopMeter:()=>ku,createTraceState:()=>uN,default:()=>tK,defaultTextMapGetter:()=>Bu,defaultTextMapSetter:()=>Vu,diag:()=>S,isSpanContextValid:()=>xe,isValidSpanId:()=>Si,isValidTraceId:()=>Mt,metrics:()=>gi,propagation:()=>Ue,trace:()=>ie});var tK,P=p(()=>{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o<t;o++){var s=r[o];s&&(e[String(s).toUpperCase().replace(/[-.]/g,"_")]=s)}return e}var Dm=p(()=>{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=>{Dm();MN="aws.lambda.invoked_arn",wN="db.system",DN="db.connection_string",UN="db.user",kN="db.jdbc.driver_classname",BN="db.name",VN="db.statement",FN="db.operation",GN="db.mssql.instance_name",HN="db.cassandra.keyspace",qN="db.cassandra.page_size",jN="db.cassandra.consistency_level",YN="db.cassandra.table",zN="db.cassandra.idempotence",KN="db.cassandra.speculative_execution_count",$N="db.cassandra.coordinator.id",XN="db.cassandra.coordinator.dc",WN="db.hbase.namespace",JN="db.redis.database_index",QN="db.mongodb.collection",ZN="db.sql.table",eC="exception.type",tC="exception.message",rC="exception.stacktrace",nC="exception.escaped",iC="faas.trigger",oC="faas.execution",sC="faas.document.collection",aC="faas.document.operation",lC="faas.document.time",cC="faas.document.name",uC="faas.time",fC="faas.cron",pC="faas.coldstart",dC="faas.invoked_name",hC="faas.invoked_provider",_C="faas.invoked_region",EC="net.transport",mC="net.peer.ip",TC="net.peer.port",SC="net.peer.name",gC="net.host.ip",vC="net.host.port",yC="net.host.name",OC="net.host.connection.type",AC="net.host.connection.subtype",RC="net.host.carrier.name",NC="net.host.carrier.mcc",CC="net.host.carrier.mnc",PC="net.host.carrier.icc",IC="peer.service",bC="enduser.id",LC="enduser.role",xC="enduser.scope",MC="thread.id",wC="thread.name",DC="code.function",UC="code.namespace",kC="code.filepath",BC="code.lineno",VC="http.method",FC="http.url",GC="http.target",HC="http.host",qC="http.scheme",jC="http.status_code",YC="http.flavor",zC="http.user_agent",KC="http.request_content_length",$C="http.request_content_length_uncompressed",XC="http.response_content_length",WC="http.response_content_length_uncompressed",JC="http.server_name",QC="http.route",ZC="http.client_ip",eP="aws.dynamodb.table_names",tP="aws.dynamodb.consumed_capacity",rP="aws.dynamodb.item_collection_metrics",nP="aws.dynamodb.provisioned_read_capacity",iP="aws.dynamodb.provisioned_write_capacity",oP="aws.dynamodb.consistent_read",sP="aws.dynamodb.projection",aP="aws.dynamodb.limit",lP="aws.dynamodb.attributes_to_get",cP="aws.dynamodb.index_name",uP="aws.dynamodb.select",fP="aws.dynamodb.global_secondary_indexes",pP="aws.dynamodb.local_secondary_indexes",dP="aws.dynamodb.exclusive_start_table",hP="aws.dynamodb.table_count",_P="aws.dynamodb.scan_forward",EP="aws.dynamodb.segment",mP="aws.dynamodb.total_segments",TP="aws.dynamodb.count",SP="aws.dynamodb.scanned_count",gP="aws.dynamodb.attribute_definitions",vP="aws.dynamodb.global_secondary_index_updates",yP="messaging.system",OP="messaging.destination",AP="messaging.destination_kind",RP="messaging.temp_destination",NP="messaging.protocol",CP="messaging.protocol_version",PP="messaging.url",IP="messaging.message_id",bP="messaging.conversation_id",LP="messaging.message_payload_size_bytes",xP="messaging.message_payload_compressed_size_bytes",MP="messaging.operation",wP="messaging.consumer_id",DP="messaging.rabbitmq.routing_key",UP="messaging.kafka.message_key",kP="messaging.kafka.consumer_group",BP="messaging.kafka.client_id",VP="messaging.kafka.partition",FP="messaging.kafka.tombstone",GP="rpc.system",HP="rpc.service",qP="rpc.method",jP="rpc.grpc.status_code",YP="rpc.jsonrpc.version",zP="rpc.jsonrpc.request_id",KP="rpc.jsonrpc.error_code",$P="rpc.jsonrpc.error_message",XP="message.type",WP="message.id",JP="message.compressed_size",QP="message.uncompressed_size",rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP="other_sql",eI="mssql",tI="mysql",rI="oracle",nI="db2",iI="postgresql",oI="redshift",sI="hive",aI="cloudscape",lI="hsqldb",cI="progress",uI="maxdb",fI="hanadb",pI="ingres",dI="firstsql",hI="edb",_I="cache",EI="adabas",mI="firebird",TI="derby",SI="filemaker",gI="informix",vI="instantdb",yI="interbase",OI="mariadb",AI="netezza",RI="pervasive",NI="pointbase",CI="sqlite",PI="sybase",II="teradata",bI="vertica",LI="h2",xI="coldfusion",MI="cassandra",wI="hbase",DI="mongodb",UI="redis",kI="couchbase",BI="couchdb",VI="cosmosdb",FI="dynamodb",GI="neo4j",HI="geode",qI="elasticsearch",jI="memcached",YI="cockroachdb",gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI="all",KI="each_quorum",$I="quorum",XI="local_quorum",WI="one",JI="two",QI="three",ZI="local_one",eb="any",tb="serial",rb="local_serial",hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb="datasource",ib="http",ob="pubsub",sb="timer",ab="other",NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb="insert",cb="edit",ub="delete",xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb="alibaba_cloud",pb="aws",db="azure",hb="gcp",UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b="ip_tcp",Eb="ip_udp",mb="ip",Tb="unix",Sb="pipe",gb="inproc",vb="other",GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb="wifi",Ob="wired",Ab="cell",Rb="unavailable",Nb="unknown",XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb="gprs",Pb="edge",Ib="umts",bb="cdma",Lb="evdo_0",xb="evdo_a",Mb="cdma2000_1xrtt",wb="hsdpa",Db="hsupa",Ub="hspa",kb="iden",Bb="evdo_b",Vb="lte",Fb="ehrpd",Gb="hspap",Hb="gsm",qb="td_scdma",jb="iwlan",Yb="nr",zb="nrnsa",Kb="lte_ca",t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b="1.0",Xb="1.1",Wb="2.0",Jb="SPDY",Qb="QUIC",O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb="queue",eL="topic",I8=Zb,b8=eL,L8=Be([Zb,eL]),tL="receive",rL="process",x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL="SENT",vL="RECEIVED",Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=>{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=>{Dm();AL="cloud.provider",RL="cloud.account.id",NL="cloud.region",CL="cloud.availability_zone",PL="cloud.platform",IL="aws.ecs.container.arn",bL="aws.ecs.cluster.arn",LL="aws.ecs.launchtype",xL="aws.ecs.task.arn",ML="aws.ecs.task.family",wL="aws.ecs.task.revision",DL="aws.eks.cluster.arn",UL="aws.log.group.names",kL="aws.log.group.arns",BL="aws.log.stream.names",VL="aws.log.stream.arns",FL="container.name",GL="container.id",HL="container.runtime",qL="container.image.name",jL="container.image.tag",YL="deployment.environment",zL="device.id",KL="device.model.identifier",$L="device.model.name",XL="faas.name",WL="faas.id",JL="faas.version",QL="faas.instance",ZL="faas.max_memory",e0="host.id",t0="host.name",r0="host.type",n0="host.arch",i0="host.image.name",o0="host.image.id",s0="host.image.version",a0="k8s.cluster.name",l0="k8s.node.name",c0="k8s.node.uid",u0="k8s.namespace.name",f0="k8s.pod.uid",p0="k8s.pod.name",d0="k8s.container.name",h0="k8s.replicaset.uid",_0="k8s.replicaset.name",E0="k8s.deployment.uid",m0="k8s.deployment.name",T0="k8s.statefulset.uid",S0="k8s.statefulset.name",g0="k8s.daemonset.uid",v0="k8s.daemonset.name",y0="k8s.job.uid",O0="k8s.job.name",A0="k8s.cronjob.uid",R0="k8s.cronjob.name",N0="os.type",C0="os.description",P0="os.name",I0="os.version",b0="process.pid",L0="process.executable.name",x0="process.executable.path",M0="process.command",w0="process.command_line",D0="process.command_args",U0="process.owner",k0="process.runtime.name",B0="process.runtime.version",V0="process.runtime.description",F0="service.name",G0="service.namespace",H0="service.instance.id",q0="service.version",j0="telemetry.sdk.name",Y0="telemetry.sdk.language",z0="telemetry.sdk.version",K0="telemetry.auto.version",$0="webengine.name",X0="webengine.version",W0="webengine.description",r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0="alibaba_cloud",Q0="aws",Z0="azure",ex="gcp",f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx="alibaba_cloud_ecs",rx="alibaba_cloud_fc",nx="aws_ec2",ix="aws_ecs",ox="aws_eks",sx="aws_lambda",ax="aws_elastic_beanstalk",lx="azure_vm",cx="azure_container_instances",ux="azure_aks",fx="azure_functions",px="azure_app_service",dx="gcp_compute_engine",hx="gcp_cloud_run",_x="gcp_kubernetes_engine",Ex="gcp_cloud_functions",mx="gcp_app_engine",E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx="ec2",Sx="fargate",w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx="amd64",vx="arm32",yx="arm64",Ox="ia64",Ax="ppc32",Rx="ppc64",Nx="x86",k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx="windows",Px="linux",Ix="darwin",bx="freebsd",Lx="netbsd",xx="openbsd",Mx="dragonflybsd",wx="hpux",Dx="aix",Ux="solaris",kx="z_os",Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx="cpp",Vx="dotnet",Fx="erlang",Gx="go",Hx="java",qx="nodejs",jx="php",Yx="python",zx="ruby",Kx="webjs",n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=>{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=>{d9="aspnetcore.rate_limiting.result",h9="acquired",_9="endpoint_limiter",E9="global_limiter",m9="request_canceled",T9="telemetry.sdk.language",S9="cpp",g9="dotnet",v9="erlang",y9="go",O9="java",A9="nodejs",R9="php",N9="python",C9="ruby",P9="rust",I9="swift",b9="webjs",L9="telemetry.sdk.name",x9="telemetry.sdk.version",M9="aspnetcore.diagnostics.handler.type",w9="aspnetcore.diagnostics.exception.result",D9="aborted",U9="handled",k9="skipped",B9="unhandled",V9="aspnetcore.rate_limiting.policy",F9="aspnetcore.request.is_unhandled",G9="aspnetcore.routing.is_fallback",H9="aspnetcore.routing.match_status",q9="failure",j9="success",Y9="client.address",z9="client.port",K9="error.type",$9="_OTHER",X9="exception.escaped",W9="exception.message",J9="exception.stacktrace",Q9="exception.type",Z9=function(r){return"http.request.header."+r},eJ="http.request.method",tJ="_OTHER",rJ="CONNECT",nJ="DELETE",iJ="GET",oJ="HEAD",sJ="OPTIONS",aJ="PATCH",lJ="POST",cJ="PUT",uJ="TRACE",fJ="http.request.method_original",pJ="http.request.resend_count",dJ=function(r){return"http.response.header."+r},hJ="http.response.status_code",_J="http.route",EJ="jvm.gc.action",mJ="jvm.gc.name",TJ="jvm.memory.pool.name",SJ="jvm.memory.type",gJ="heap",vJ="non_heap",yJ="jvm.thread.daemon",OJ="jvm.thread.state",AJ="blocked",RJ="new",NJ="runnable",CJ="terminated",PJ="timed_waiting",IJ="waiting",bJ="network.local.address",LJ="network.local.port",xJ="network.peer.address",MJ="network.peer.port",wJ="network.protocol.name",DJ="network.protocol.version",UJ="network.transport",kJ="pipe",BJ="quic",VJ="tcp",FJ="udp",GJ="unix",HJ="network.type",qJ="ipv4",jJ="ipv6",YJ="otel.scope.name",zJ="otel.scope.version",KJ="otel.status_code",$J="ERROR",XJ="OK",WJ="otel.status_description",JJ="server.address",QJ="server.port",ZJ="service.name",eQ="service.version",tQ="signalr.connection.status",rQ="app_shutdown",nQ="normal_closure",iQ="timeout",oQ="signalr.transport",sQ="long_polling",aQ="server_sent_events",lQ="web_sockets",cQ="url.fragment",uQ="url.full",fQ="url.path",pQ="url.query",dQ="url.scheme",hQ="user_agent.original"});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=>{_Q="aspnetcore.diagnostics.exceptions",EQ="aspnetcore.rate_limiting.active_request_leases",mQ="aspnetcore.rate_limiting.queued_requests",TQ="aspnetcore.rate_limiting.request.time_in_queue",SQ="aspnetcore.rate_limiting.request_lease.duration",gQ="aspnetcore.rate_limiting.requests",vQ="aspnetcore.routing.match_attempts",yQ="http.client.request.duration",OQ="http.server.request.duration",AQ="jvm.class.count",RQ="jvm.class.loaded",NQ="jvm.class.unloaded",CQ="jvm.cpu.count",PQ="jvm.cpu.recent_utilization",IQ="jvm.cpu.time",bQ="jvm.gc.duration",LQ="jvm.memory.committed",xQ="jvm.memory.limit",MQ="jvm.memory.used",wQ="jvm.memory.used_after_last_gc",DQ="jvm.thread.count",UQ="kestrel.active_connections",kQ="kestrel.active_tls_handshakes",BQ="kestrel.connection.duration",VQ="kestrel.queued_connections",FQ="kestrel.queued_requests",GQ="kestrel.rejected_connections",HQ="kestrel.tls_handshake.duration",qQ="kestrel.upgraded_connections",jQ="signalr.server.active_connections",YQ="signalr.server.connection.duration"});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>H9,ATTR_CLIENT_ADDRESS:()=>Y9,ATTR_CLIENT_PORT:()=>z9,ATTR_ERROR_TYPE:()=>K9,ATTR_EXCEPTION_ESCAPED:()=>X9,ATTR_EXCEPTION_MESSAGE:()=>W9,ATTR_EXCEPTION_STACKTRACE:()=>J9,ATTR_EXCEPTION_TYPE:()=>Q9,ATTR_HTTP_REQUEST_HEADER:()=>Z9,ATTR_HTTP_REQUEST_METHOD:()=>eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>pJ,ATTR_HTTP_RESPONSE_HEADER:()=>dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>hJ,ATTR_HTTP_ROUTE:()=>_J,ATTR_JVM_GC_ACTION:()=>EJ,ATTR_JVM_GC_NAME:()=>mJ,ATTR_JVM_MEMORY_POOL_NAME:()=>TJ,ATTR_JVM_MEMORY_TYPE:()=>SJ,ATTR_JVM_THREAD_DAEMON:()=>yJ,ATTR_JVM_THREAD_STATE:()=>OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=>bJ,ATTR_NETWORK_LOCAL_PORT:()=>LJ,ATTR_NETWORK_PEER_ADDRESS:()=>xJ,ATTR_NETWORK_PEER_PORT:()=>MJ,ATTR_NETWORK_PROTOCOL_NAME:()=>wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=>DJ,ATTR_NETWORK_TRANSPORT:()=>UJ,ATTR_NETWORK_TYPE:()=>HJ,ATTR_OTEL_SCOPE_NAME:()=>YJ,ATTR_OTEL_SCOPE_VERSION:()=>zJ,ATTR_OTEL_STATUS_CODE:()=>KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=>WJ,ATTR_SERVER_ADDRESS:()=>JJ,ATTR_SERVER_PORT:()=>QJ,ATTR_SERVICE_NAME:()=>ZJ,ATTR_SERVICE_VERSION:()=>eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=>tQ,ATTR_SIGNALR_TRANSPORT:()=>oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=>T9,ATTR_TELEMETRY_SDK_NAME:()=>L9,ATTR_TELEMETRY_SDK_VERSION:()=>x9,ATTR_URL_FRAGMENT:()=>cQ,ATTR_URL_FULL:()=>uQ,ATTR_URL_PATH:()=>fQ,ATTR_URL_QUERY:()=>pQ,ATTR_URL_SCHEME:()=>dQ,ATTR_USER_AGENT_ORIGINAL:()=>hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=>w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>D7,AwsEcsLaunchtypeValues:()=>U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>m7,CLOUDPLATFORMVALUES_AWS_EC2:()=>T7,CLOUDPLATFORMVALUES_AWS_ECS:()=>S7,CLOUDPLATFORMVALUES_AWS_EKS:()=>g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=>R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>N7,CLOUDPLATFORMVALUES_AZURE_VM:()=>O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>f7,CLOUDPROVIDERVALUES_AWS:()=>p7,CLOUDPROVIDERVALUES_AZURE:()=>d7,CLOUDPROVIDERVALUES_GCP:()=>h7,CloudPlatformValues:()=>M7,CloudProviderValues:()=>_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>SW,DBSYSTEMVALUES_ADABAS:()=>kX,DBSYSTEMVALUES_CACHE:()=>UX,DBSYSTEMVALUES_CASSANDRA:()=>eW,DBSYSTEMVALUES_CLOUDSCAPE:()=>PX,DBSYSTEMVALUES_COCKROACHDB:()=>pW,DBSYSTEMVALUES_COLDFUSION:()=>ZX,DBSYSTEMVALUES_COSMOSDB:()=>sW,DBSYSTEMVALUES_COUCHBASE:()=>iW,DBSYSTEMVALUES_COUCHDB:()=>oW,DBSYSTEMVALUES_DB2:()=>AX,DBSYSTEMVALUES_DERBY:()=>VX,DBSYSTEMVALUES_DYNAMODB:()=>aW,DBSYSTEMVALUES_EDB:()=>DX,DBSYSTEMVALUES_ELASTICSEARCH:()=>uW,DBSYSTEMVALUES_FILEMAKER:()=>FX,DBSYSTEMVALUES_FIREBIRD:()=>BX,DBSYSTEMVALUES_FIRSTSQL:()=>wX,DBSYSTEMVALUES_GEODE:()=>cW,DBSYSTEMVALUES_H2:()=>QX,DBSYSTEMVALUES_HANADB:()=>xX,DBSYSTEMVALUES_HBASE:()=>tW,DBSYSTEMVALUES_HIVE:()=>CX,DBSYSTEMVALUES_HSQLDB:()=>IX,DBSYSTEMVALUES_INFORMIX:()=>GX,DBSYSTEMVALUES_INGRES:()=>MX,DBSYSTEMVALUES_INSTANTDB:()=>HX,DBSYSTEMVALUES_INTERBASE:()=>qX,DBSYSTEMVALUES_MARIADB:()=>jX,DBSYSTEMVALUES_MAXDB:()=>LX,DBSYSTEMVALUES_MEMCACHED:()=>fW,DBSYSTEMVALUES_MONGODB:()=>rW,DBSYSTEMVALUES_MSSQL:()=>vX,DBSYSTEMVALUES_MYSQL:()=>yX,DBSYSTEMVALUES_NEO4J:()=>lW,DBSYSTEMVALUES_NETEZZA:()=>YX,DBSYSTEMVALUES_ORACLE:()=>OX,DBSYSTEMVALUES_OTHER_SQL:()=>gX,DBSYSTEMVALUES_PERVASIVE:()=>zX,DBSYSTEMVALUES_POINTBASE:()=>KX,DBSYSTEMVALUES_POSTGRESQL:()=>RX,DBSYSTEMVALUES_PROGRESS:()=>bX,DBSYSTEMVALUES_REDIS:()=>nW,DBSYSTEMVALUES_REDSHIFT:()=>NX,DBSYSTEMVALUES_SQLITE:()=>$X,DBSYSTEMVALUES_SYBASE:()=>XX,DBSYSTEMVALUES_TERADATA:()=>WX,DBSYSTEMVALUES_VERTICA:()=>JX,DbCassandraConsistencyLevelValues:()=>RW,DbSystemValues:()=>dW,ERROR_TYPE_VALUE_OTHER:()=>$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>UW,FAASINVOKEDPROVIDERVALUES_AWS:()=>kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=>BW,FAASINVOKEDPROVIDERVALUES_GCP:()=>VW,FAASTRIGGERVALUES_DATASOURCE:()=>NW,FAASTRIGGERVALUES_HTTP:()=>CW,FAASTRIGGERVALUES_OTHER:()=>bW,FAASTRIGGERVALUES_PUBSUB:()=>PW,FAASTRIGGERVALUES_TIMER:()=>IW,FaasDocumentOperationValues:()=>DW,FaasInvokedProviderValues:()=>FW,FaasTriggerValues:()=>LW,HOSTARCHVALUES_AMD64:()=>k7,HOSTARCHVALUES_ARM32:()=>B7,HOSTARCHVALUES_ARM64:()=>V7,HOSTARCHVALUES_IA64:()=>F7,HOSTARCHVALUES_PPC32:()=>G7,HOSTARCHVALUES_PPC64:()=>H7,HOSTARCHVALUES_X86:()=>q7,HTTPFLAVORVALUES_HTTP_1_0:()=>O8,HTTPFLAVORVALUES_HTTP_1_1:()=>A8,HTTPFLAVORVALUES_HTTP_2_0:()=>R8,HTTPFLAVORVALUES_QUIC:()=>C8,HTTPFLAVORVALUES_SPDY:()=>N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=>iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=>lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=>cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>uJ,HostArchValues:()=>j7,HttpFlavorValues:()=>P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=>gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=>AJ,JVM_THREAD_STATE_VALUE_NEW:()=>RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=>CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>PJ,JVM_THREAD_STATE_VALUE_WAITING:()=>IJ,MESSAGETYPEVALUES_RECEIVED:()=>e5,MESSAGETYPEVALUES_SENT:()=>Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>b8,MESSAGINGOPERATIONVALUES_PROCESS:()=>M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=>x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>OQ,METRIC_JVM_CLASS_COUNT:()=>AQ,METRIC_JVM_CLASS_LOADED:()=>RQ,METRIC_JVM_CLASS_UNLOADED:()=>NQ,METRIC_JVM_CPU_COUNT:()=>CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>PQ,METRIC_JVM_CPU_TIME:()=>IQ,METRIC_JVM_GC_DURATION:()=>bQ,METRIC_JVM_MEMORY_COMMITTED:()=>LQ,METRIC_JVM_MEMORY_LIMIT:()=>xQ,METRIC_JVM_MEMORY_USED:()=>MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>wQ,METRIC_JVM_THREAD_COUNT:()=>DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>kQ,METRIC_KESTREL_CONNECTION_DURATION:()=>BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=>FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>YQ,MessageTypeValues:()=>t5,MessagingDestinationKindValues:()=>L8,MessagingOperationValues:()=>w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>WW,NETTRANSPORTVALUES_INPROC:()=>zW,NETTRANSPORTVALUES_IP:()=>qW,NETTRANSPORTVALUES_IP_TCP:()=>GW,NETTRANSPORTVALUES_IP_UDP:()=>HW,NETTRANSPORTVALUES_OTHER:()=>KW,NETTRANSPORTVALUES_PIPE:()=>YW,NETTRANSPORTVALUES_UNIX:()=>jW,NETWORK_TRANSPORT_VALUE_PIPE:()=>kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=>BJ,NETWORK_TRANSPORT_VALUE_TCP:()=>VJ,NETWORK_TRANSPORT_VALUE_UDP:()=>FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=>GJ,NETWORK_TYPE_VALUE_IPV4:()=>qJ,NETWORK_TYPE_VALUE_IPV6:()=>jJ,NetHostConnectionSubtypeValues:()=>y8,NetHostConnectionTypeValues:()=>e8,NetTransportValues:()=>$W,OSTYPEVALUES_AIX:()=>Z7,OSTYPEVALUES_DARWIN:()=>K7,OSTYPEVALUES_DRAGONFLYBSD:()=>J7,OSTYPEVALUES_FREEBSD:()=>$7,OSTYPEVALUES_HPUX:()=>Q7,OSTYPEVALUES_LINUX:()=>z7,OSTYPEVALUES_NETBSD:()=>X7,OSTYPEVALUES_OPENBSD:()=>W7,OSTYPEVALUES_SOLARIS:()=>e9,OSTYPEVALUES_WINDOWS:()=>Y7,OSTYPEVALUES_Z_OS:()=>t9,OTEL_STATUS_CODE_VALUE_ERROR:()=>$J,OTEL_STATUS_CODE_VALUE_OK:()=>XJ,OsTypeValues:()=>r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>F8,RPCGRPCSTATUSCODEVALUES_OK:()=>D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>k8,RpcGrpcStatusCodeValues:()=>Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=>B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=>b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>rK,SEMATTRS_CODE_FILEPATH:()=>n$,SEMATTRS_CODE_FUNCTION:()=>t$,SEMATTRS_CODE_LINENO:()=>i$,SEMATTRS_CODE_NAMESPACE:()=>r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>EK,SEMATTRS_DB_CASSANDRA_TABLE:()=>hK,SEMATTRS_DB_CONNECTION_STRING:()=>iK,SEMATTRS_DB_HBASE_NAMESPACE:()=>SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>sK,SEMATTRS_DB_MONGODB_COLLECTION:()=>vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>uK,SEMATTRS_DB_NAME:()=>aK,SEMATTRS_DB_OPERATION:()=>cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>gK,SEMATTRS_DB_SQL_TABLE:()=>yK,SEMATTRS_DB_STATEMENT:()=>lK,SEMATTRS_DB_SYSTEM:()=>nK,SEMATTRS_DB_USER:()=>oK,SEMATTRS_ENDUSER_ID:()=>WK,SEMATTRS_ENDUSER_ROLE:()=>JK,SEMATTRS_ENDUSER_SCOPE:()=>QK,SEMATTRS_EXCEPTION_ESCAPED:()=>OK,SEMATTRS_EXCEPTION_MESSAGE:()=>Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=>Um,SEMATTRS_EXCEPTION_TYPE:()=>Xa,SEMATTRS_FAAS_COLDSTART:()=>xK,SEMATTRS_FAAS_CRON:()=>LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=>IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=>PK,SEMATTRS_FAAS_EXECUTION:()=>RK,SEMATTRS_FAAS_INVOKED_NAME:()=>MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>wK,SEMATTRS_FAAS_INVOKED_REGION:()=>DK,SEMATTRS_FAAS_TIME:()=>bK,SEMATTRS_FAAS_TRIGGER:()=>AK,SEMATTRS_HTTP_CLIENT_IP:()=>S$,SEMATTRS_HTTP_FLAVOR:()=>f$,SEMATTRS_HTTP_HOST:()=>l$,SEMATTRS_HTTP_METHOD:()=>o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>E$,SEMATTRS_HTTP_ROUTE:()=>T$,SEMATTRS_HTTP_SCHEME:()=>c$,SEMATTRS_HTTP_SERVER_NAME:()=>m$,SEMATTRS_HTTP_STATUS_CODE:()=>u$,SEMATTRS_HTTP_TARGET:()=>a$,SEMATTRS_HTTP_URL:()=>s$,SEMATTRS_HTTP_USER_AGENT:()=>p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>mX,SEMATTRS_MESSAGE_ID:()=>EX,SEMATTRS_MESSAGE_TYPE:()=>_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=>eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>W$,SEMATTRS_MESSAGING_DESTINATION:()=>q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=>X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>J$,SEMATTRS_MESSAGING_OPERATION:()=>Z$,SEMATTRS_MESSAGING_PROTOCOL:()=>z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>tX,SEMATTRS_MESSAGING_SYSTEM:()=>H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Y$,SEMATTRS_MESSAGING_URL:()=>$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=>$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=>zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=>KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=>YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>qK,SEMATTRS_NET_HOST_IP:()=>FK,SEMATTRS_NET_HOST_NAME:()=>HK,SEMATTRS_NET_HOST_PORT:()=>GK,SEMATTRS_NET_PEER_IP:()=>kK,SEMATTRS_NET_PEER_NAME:()=>VK,SEMATTRS_NET_PEER_PORT:()=>BK,SEMATTRS_NET_TRANSPORT:()=>UK,SEMATTRS_PEER_SERVICE:()=>XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pX,SEMATTRS_RPC_JSONRPC_VERSION:()=>fX,SEMATTRS_RPC_METHOD:()=>cX,SEMATTRS_RPC_SERVICE:()=>lX,SEMATTRS_RPC_SYSTEM:()=>aX,SEMATTRS_THREAD_ID:()=>ZK,SEMATTRS_THREAD_NAME:()=>e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>o5,SEMRESATTRS_CLOUD_PLATFORM:()=>s5,SEMRESATTRS_CLOUD_PROVIDER:()=>r5,SEMRESATTRS_CLOUD_REGION:()=>i5,SEMRESATTRS_CONTAINER_ID:()=>S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>y5,SEMRESATTRS_CONTAINER_NAME:()=>T5,SEMRESATTRS_CONTAINER_RUNTIME:()=>g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>O5,SEMRESATTRS_DEVICE_ID:()=>A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=>N5,SEMRESATTRS_FAAS_ID:()=>P5,SEMRESATTRS_FAAS_INSTANCE:()=>b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=>L5,SEMRESATTRS_FAAS_NAME:()=>C5,SEMRESATTRS_FAAS_VERSION:()=>I5,SEMRESATTRS_HOST_ARCH:()=>Vm,SEMRESATTRS_HOST_ID:()=>km,SEMRESATTRS_HOST_IMAGE_ID:()=>w5,SEMRESATTRS_HOST_IMAGE_NAME:()=>M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=>D5,SEMRESATTRS_HOST_NAME:()=>Bm,SEMRESATTRS_HOST_TYPE:()=>x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=>U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=>H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=>e7,SEMRESATTRS_K8S_CRONJOB_UID:()=>Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=>X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Y5,SEMRESATTRS_K8S_JOB_NAME:()=>Q5,SEMRESATTRS_K8S_JOB_UID:()=>J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>V5,SEMRESATTRS_K8S_NODE_NAME:()=>k5,SEMRESATTRS_K8S_NODE_UID:()=>B5,SEMRESATTRS_K8S_POD_NAME:()=>G5,SEMRESATTRS_K8S_POD_UID:()=>F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=>j5,SEMRESATTRS_K8S_REPLICASET_UID:()=>q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=>K5,SEMRESATTRS_OS_DESCRIPTION:()=>t7,SEMRESATTRS_OS_NAME:()=>r7,SEMRESATTRS_OS_TYPE:()=>Fm,SEMRESATTRS_OS_VERSION:()=>Gm,SEMRESATTRS_PROCESS_COMMAND:()=>Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>jm,SEMRESATTRS_PROCESS_OWNER:()=>Km,SEMRESATTRS_PROCESS_PID:()=>Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>$m,SEMRESATTRS_SERVICE_NAME:()=>at,SEMRESATTRS_SERVICE_NAMESPACE:()=>i7,SEMRESATTRS_SERVICE_VERSION:()=>o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>c7,SEMRESATTRS_WEBENGINE_NAME:()=>a7,SEMRESATTRS_WEBENGINE_VERSION:()=>l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>lQ,SemanticAttributes:()=>SX,SemanticResourceAttributes:()=>u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=>s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>b9,TelemetrySdkLanguageValues:()=>p9});var Ve=p(()=>{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=>{P();Zm=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Zu,SM=p(()=>{Zu="baggage"});function tf(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function rf(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function il(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>il(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var eT=p(()=>{P()});var nf,yM=p(()=>{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=>n.length<=4096).slice(0,180),i=tf(a);i.length>0&&o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=il(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=>{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r=="string"&&r.length>0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var NM=p(()=>{P()});function sf(){return r=>{S.error(EZ(r))}}function EZ(r){return typeof r=="string"?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=>{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=>{nT();CM=sf()});var Vo,oT=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)>-1}function yZ(r){return vZ.indexOf(r)>-1}function AZ(r){return OZ.indexOf(r)>-1}function RZ(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o=="string"){let s=PZ[o.toUpperCase()];s!=null&&(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case"OTEL_LOG_LEVEL":IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=>{P();oT();TZ=",",SZ=["OTEL_SDK_DISABLED"];vZ=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];OZ=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=>{lT()});var cf,bM=p(()=>{cf=typeof globalThis=="object"?globalThis:global});function LM(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var cT=p(()=>{});function ff(r){return Buffer.from(uf(r)).toString("base64")}var xM=p(()=>{cT()});function MM(r){return function(){for(let t=0;t<r/4;t++)pf.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(pf[t]>0);t++)t===r-1&&(pf[r-1]=1);return pf.toString("hex",0,r)}}var Go,pf,wM=p(()=>{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from"perf_hooks";var In,DM=p(()=>{In=bZ});var df,uT=p(()=>{df="1.29.0"});var bn,UM=p(()=>{uT();Ve();bn={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=>{});var BM=p(()=>{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=>{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!="number"){let e=In;r=e.timing&&e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r=="number"?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r=="number")return r<Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError("Invalid input type")}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function zM(r){return mf(r)||typeof r=="number"||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=_f&&(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=>{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Tf||(Tf={}))});var Sf,XM=p(()=>{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&&!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=>{hT="[_0-9a-z-*/]",MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=>{QM();ZM=32,BZ=512,ew=",",tw="=",qo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length>BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&&JM(n)&&t.set(i,n)}return t},new Map),this._internalState.size>ZM&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=>{P();nl();_T();cl="traceparent",ul="tracestate",VZ="00",FZ="(?!ff)[\\da-f]{2}",GZ="(?![0]{32})[\\da-f]{32}",HZ="(?![0]{16})[\\da-f]{16}",qZ="[\\da-f]{2}",jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&&o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new qo(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=>{P();mT=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(vf||(vf={}))});var Ai,TT=p(()=>{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Ln,ST=p(()=>{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var yf,aw=p(()=>{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=>{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&cw.call(t)===XZ}function QZ(r){return r!=null&&typeof r=="object"}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&&Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&&(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=>{YZ="[object Object]",zZ="[object Null]",KZ="[object Undefined]",$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t>ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a<i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Af(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&&fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r=="function"}function fl(r){return!Af(r)&&!Rf(r)&&!mw(r)&&typeof r=="object"}function Af(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=>{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var pl,gw=p(()=>{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e=="string"?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=>{});function Ow(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Aw=p(()=>{});var Nf,Rw=p(()=>{Nf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=>{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=>{he.with(Qu(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Pw=p(()=>{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=>Ai,AlwaysOnSampler:()=>Ln,AnchoredClock:()=>of,BindOnceFuture:()=>Cf,CompositePropagator:()=>Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>ol,DEFAULT_ENVIRONMENT:()=>al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>aT,ExportResultCode:()=>Tf,ParentBasedSampler:()=>yf,RPCType:()=>vf,RandomIdGenerator:()=>Go,SDK_INFO:()=>bn,TRACE_PARENT_HEADER:()=>cl,TRACE_STATE_HEADER:()=>ul,TimeoutError:()=>pl,TraceIdRatioBasedSampler:()=>Of,TraceState:()=>qo,TracesSamplerValues:()=>Vo,VERSION:()=>df,W3CBaggagePropagator:()=>nf,W3CTraceContextPropagator:()=>gf,_globalThis:()=>cf,addHrTimes:()=>dT,baggageUtils:()=>iee,callWithTimeout:()=>Sw,deleteRPCMetadata:()=>iw,getEnv:()=>Fo,getEnvWithoutDefaults:()=>lf,getRPCMetadata:()=>ow,getTimeOrigin:()=>Ef,globalErrorHandler:()=>af,hexToBase64:()=>ff,hexToBinary:()=>uf,hrTime:()=>pT,hrTimeDuration:()=>GM,hrTimeToMicroseconds:()=>YM,hrTimeToMilliseconds:()=>jM,hrTimeToNanoseconds:()=>qM,hrTimeToTimeStamp:()=>HM,internal:()=>oee,isAttributeKey:()=>tT,isAttributeValue:()=>rT,isTimeInput:()=>zM,isTimeInputHrTime:()=>mf,isTracingSuppressed:()=>At,isUrlIgnored:()=>vw,isWrapped:()=>Ow,loggingErrorHandler:()=>sf,merge:()=>_w,millisToHrTime:()=>Ho,otperformance:()=>In,parseEnvironment:()=>ll,parseTraceParent:()=>ET,sanitizeAttributes:()=>AM,setGlobalErrorHandler:()=>PM,setRPCMetadata:()=>nw,suppressTracing:()=>Qu,timeInputToHrTime:()=>FM,unrefTimer:()=>hf,unsuppressTracing:()=>TM,urlMatches:()=>yT});var iee,oee,xr=p(()=>{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=>{(function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.TRACE=1]="TRACE",r[r.TRACE2=2]="TRACE2",r[r.TRACE3=3]="TRACE3",r[r.TRACE4=4]="TRACE4",r[r.DEBUG=5]="DEBUG",r[r.DEBUG2=6]="DEBUG2",r[r.DEBUG3=7]="DEBUG3",r[r.DEBUG4=8]="DEBUG4",r[r.INFO=9]="INFO",r[r.INFO2=10]="INFO2",r[r.INFO3=11]="INFO3",r[r.INFO4=12]="INFO4",r[r.WARN=13]="WARN",r[r.WARN2=14]="WARN2",r[r.WARN3=15]="WARN3",r[r.WARN4=16]="WARN4",r[r.ERROR=17]="ERROR",r[r.ERROR2=18]="ERROR2",r[r.ERROR3=19]="ERROR3",r[r.ERROR4=20]="ERROR4",r[r.FATAL=21]="FATAL",r[r.FATAL2=22]="FATAL2",r[r.FATAL3=23]="FATAL3",r[r.FATAL4=24]="FATAL4"})(If||(If={}))});var Ni,jo,bf=p(()=>{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=>{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=>{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=>{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&&s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=>{xf=typeof globalThis=="object"?globalThis:global});var Lw=p(()=>{bw()});var xw=p(()=>{Lw()});function Mw(r,e,t){return o=>o===r?e:t}var hl,Ko,RT,ww=p(()=>{xw();hl=Symbol.for("io.opentelemetry.js.api.logs"),Ko=xf;RT=1});var Mf,Dw=p(()=>{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&&t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=>jo,NOOP_LOGGER_PROVIDER:()=>Yo,NoopLogger:()=>Ni,NoopLoggerProvider:()=>dl,ProxyLogger:()=>zo,ProxyLoggerProvider:()=>Ci,SeverityNumber:()=>If,logs:()=>_l});var _l,El=p(()=>{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=>{P();see=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var Fw=p(()=>{});function Gw(){return r=>{S.error(lee(r))}}function lee(r){return typeof r=="string"?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=>{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=>{Hw();uee=Gw()});var Df,jw=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Df||(Df={}))});function dee(r){return pee.indexOf(r)>-1}function _ee(r){return hee.indexOf(r)>-1}function mee(r){return Eee.indexOf(r)>-1}function Tee(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o=="string"){let s=vee[o.toUpperCase()];s!=null&&(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case"OTEL_LOG_LEVEL":yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=>{P();jw();fee=",",pee=["OTEL_SDK_DISABLED"];hee=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];Eee=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=>{NT()});import{performance as Oee}from"perf_hooks";var Pi,$w=p(()=>{Pi=Oee});var Xw,Ww=p(()=>{Xw="1.29.0"});var Ii,Jw=p(()=>{Ww();Ve();Ii={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=>{});var Zw=p(()=>{Kw();$w();Jw();Qw()});var CT=p(()=>{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!="number"){let e=Pi;r=e.timing&&e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r=="number"?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r=="number")return r<PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError("Invalid input type")}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=e1&&(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=>{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&s1.call(t)===wee}function kee(r){return r!=null&&typeof r=="object"}function Bee(r){return r==null?r===void 0?xee:Lee:bi&&bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&&(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=>{bee="[object Object]",Lee="[object Null]",xee="[object Undefined]",Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t>Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a<i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&&gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r=="function"}function gl(r){return!Vf(r)&&!Ff(r)&&!d1(r)&&typeof r=="object"}function Vf(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=>{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Gf,_1=p(()=>{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=>{Hf=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=>{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=>{he.with(kw(he.active()),()=>{r.export(e,o=>{t(o)})})})}var S1=p(()=>{P();Bw()});var qf,cr=p(()=>{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=>{});var v1=p(()=>{g1()});var y1=p(()=>{v1()});var Mn,O1=p(()=>{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=>{O1()});var Wo,MT=p(()=>{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&&xe(_)&&(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&&S.warn("Dropping extra attributes."),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&S.warn("Can not execute the operation on emitted log record"),this._isReadonly}}});var Yf,R1=p(()=>{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&&s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&i!==void 0?i:$o}}var P1=p(()=>{cr()});var zf,I1=p(()=>{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=>o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}}});var Jo,wT=p(()=>{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=>{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=>{P();El();A1();cr();R1();P1();I1();b1();qee="unknown";$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn("A shutdown LoggerProvider cannot provide a Logger"),jo;e||S.warn("Logger requested without instrumentation scope name.");let s=e||qee,a=`${s}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=>{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=>{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=>qf._export(this._exporter,[e]).then(a=>{var i;a.code!==Yt.SUCCESS&&Mr((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(this._unresolvedExports.delete(a),s()),Mr);a!=null&&this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=>{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=>{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&&o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&&s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&&a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&&i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a<s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=>qf._export(this._exporter,e).then(s=>{var a;s.code!==Yt.SUCCESS&&Mr((a=s.error)!==null&&a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=>s.resource).filter(s=>s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=>{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=>{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=>{U1()});var B1=p(()=>{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=>Qo,ConsoleLogRecordExporter:()=>Xf,InMemoryLogRecordExporter:()=>Jf,LogRecord:()=>Wo,LoggerProvider:()=>$f,NoopLogRecordProcessor:()=>Jo,SimpleLogRecordProcessor:()=>Wf});var UT=p(()=>{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=>{(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(ur||(ur={}))});var lt,Zo=p(()=>{(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}function H1(r){return r.status==="rejected"}function kT(r,e){let t=[];return r.forEach(o=>{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o>=t;){let a=t+Math.trunc((o-t)/2);r[a]<e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=>{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=>{(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(zt||(zt={}))});var yl,z1=p(()=>{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&&o!==void 0?o:"",unit:(s=t==null?void 0:t.unit)!==null&&s!==void 0?s:"",valueType:(a=t==null?void 0:t.valueType)!==null&&a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&&i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(o=r.description)!==null&&o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=>{P();fr();(function(r){r.COUNTER="COUNTER",r.GAUGE="GAUGE",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=>{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u<a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&&(o.hasMinMax&&s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&&(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&&(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l<a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=>{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1<<e,s=0,a=0;for(let i=this.indexStart;i<=this.indexEnd;){let n=i%o;n<0&&(n+=o);for(let l=n;l<o&&s<t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s<o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&2146435072)>>20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&1048575)*Math.pow(2,32)+o}var Al,VT=p(()=>{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}var np=p(()=>{});var Dr,ip=p(()=>{Dr=class extends Error{}});var op,eD=p(()=>{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new Dr(`underflow: ${e} is < minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e>o)throw new Dr(`overflow: ${e} is > maximum lower boundary: ${o}`);return Rl(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=>{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e<=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t>=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is > maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e<=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is < minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function HT(r){if(r>nD||r<rD)throw new Dr(`expected scale >= ${rD} && <= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=>{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=>e>10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=>{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize<qT&&(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s<e.indexStart&&e.indexEnd-s>=this._maxSize?(a=!0,n=s,i=e.indexEnd):s>e.indexEnd&&s-e.indexStart>=this._maxSize&&(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let a=e.indexEnd-t;a>=e.backing.length&&this._grow(e,a+1),e.indexStart=t}else if(t>e.indexEnd){let a=t-e.indexStart;a>=e.backing.length&&this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s<0&&(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i>this._maxSize&&(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,o++;return o}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart>>s,e.indexEnd>>s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++)this._incrementIndexBy(e,a+n>>i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n<o.length;n++){let c=(a+n>>i)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=>{P();Qee=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});function lD(){return r=>{S.error(Zee(r))}}function Zee(r){return typeof r=="string"?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=>{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=>{cD();tte=lD()});var fD,pD=p(()=>{fD="1.29.0"});var xi,dD=p(()=>{pD();Ve();xi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=>{});var _D=p(()=>{dD();hD()});var ED=p(()=>{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=>{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(pr||(pr={}))});function SD(r,e){return new Promise(t=>{he.with(sD(he.active()),()=>{r.export(e,o=>{t(o)})})})}var gD=p(()=>{P();aD()});var vD,Dn=p(()=>{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=>{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)>=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=>{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&&o>s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=>{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=>{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");e=e.concat(),e=e.sort((a,i)=>a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=>{cp();Zf();ID=r=>mt.Default(),up=r=>ur.CUMULATIVE});var us,YT=p(()=>{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&&t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&&o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&&s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=>n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=>n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=>n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error("Cannot call shutdown twice.");return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn("Cannot forceFlush on already shutdown MetricReader.");return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=>{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(s=e.exportIntervalMillis)!==null&&s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&&a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length>0&&S.error("PeriodicExportingMetricReader: metrics collection errors",...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug("Error while resolving async portion of resource: ",i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=>{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=>{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&&t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=>{});var wD=p(()=>{MD()});var DD=p(()=>{wD()});var kn,UD=p(()=>{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=>{UD()});var _p,BD=p(()=>{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,e)&&this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=>{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e<0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e<0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=>{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=>{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=>{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=>{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={"otel.metric.overflow":!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=>{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=>{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=>{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&&(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=>{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=>{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}' `),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}' `),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}' `),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}' `),t}function hte(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}function _te(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}'`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${o}' - OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):""}var GD=p(()=>{});var Np,HD=p(()=>{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&&(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&&(e.description.length>a.description.length&&s.updateDescription(e.description),S.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=>{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=>{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=>{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!="number"){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&&!Number.isInteger(e)&&(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&&(s=new Dt,this._buffer.set(e,s)),typeof t!="number"){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&&!Number.isInteger(t)&&(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=>{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o<0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,o)>=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s<0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=>n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=>{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s._metricStorages.forEach(n=>{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=>{let a=new Ip,i=Promise.resolve(o(a));t!=null&&(i=wn(i,t)),await i,s.forEach(n=>{let l=a._buffer.get(n);l!=null&&n._metricStorages.forEach(c=>{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=>o.callback===e&&o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=>o.callback===e&&q1(o.instruments,t))}}});var Lp,zD=p(()=>{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=>{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=>this._allowedAttributeNames.includes(s)).forEach(s=>o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=>{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=>n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=>{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=>{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&&(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=>{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=>{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&&o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&&s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&&s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=>{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&&t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&&e.views.length>0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&&e.readers.length>0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t="",o={}){return this._shutdown?(S.warn("A shutdown MeterProvider cannot provide a Meter"),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=>{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=>{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&&t!==void 0?t:"*"),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=>{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Fp,ZD=p(()=>{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=>mt,AggregationTemporality:()=>ur,ConsoleMetricExporter:()=>dp,DataPointType:()=>lt,DefaultAggregation:()=>Ll,DropAggregation:()=>as,ExplicitBucketHistogramAggregation:()=>Il,ExponentialHistogramAggregation:()=>bl,HistogramAggregation:()=>cs,InMemoryMetricExporter:()=>pp,InstrumentType:()=>_e,LastValueAggregation:()=>ls,MeterProvider:()=>Up,MetricReader:()=>us,PeriodicExportingMetricReader:()=>fp,SumAggregation:()=>wi,TimeoutError:()=>Li,View:()=>Fp});var Gp=p(()=>{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V("events"),Ote=["addListener","on","once","prependListener","prependOnceListener"],tS=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=>t.apply(this,a))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=>{t[s]!==void 0&&(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&&(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&&delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&&(n=s._createPatchMap(e));let l=n[a];l===void 0&&(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V("async_hooks"),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t==="TIMERWRAP")return;let o=this._stack[this._stack.length-1];o!==void 0&&this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&&this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V("async_hooks"),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,"AsyncHooksContextManager",{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=>{P();Ts=De("OpenTelemetry Context Key B3 Debug Flag")});var Ss,gs,vs,ys,Yp,Os,sS=p(()=>{Ss="b3",gs="x-b3-traceid",vs="x-b3-spanid",ys="x-b3-sampled",Yp="x-b3-parentspanid",Os="x-b3-flags"});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t=="string"?t.padStart(32,"0"):""}function kte(r,e){let t=Kp(r,e,vs);return typeof t=="string"?t:""}function nU(r,e){return Kp(r,e,Os)==="1"?"1":void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)==="1"||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=>{P();xr();oS();sS();xte=new Set([!0,"true","True","1",1]),Mte=new Set([!1,"false","False","0",0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a==="1"?o.set(t,Os,a):s.traceFlags!==void 0&&o.set(t,ys,(se.SAMPLED&s.traceFlags)===se.SAMPLED?"1":"0")}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&&Si(a)&&wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&&Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=>{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte="0".repeat(16),Gte=new Set(["d","1"]),Hte="d";$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,"b3",i)}extract(e,t,o){let s=o.get(t,"b3"),a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&&(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return["b3"]}}});var As,aS=p(()=>{(function(r){r[r.SINGLE_HEADER=0]="SINGLE_HEADER",r[r.MULTI_HEADER=1]="MULTI_HEADER"})(As||(As={}))});var Xp,sU=p(()=>{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,"b3");return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=>As,B3Propagator:()=>Xp,B3_CONTEXT_HEADER:()=>Ss,X_B3_FLAGS:()=>Os,X_B3_PARENT_SPAN_ID:()=>Yp,X_B3_SAMPLED:()=>ys,X_B3_SPAN_ID:()=>vs,X_B3_TRACE_ID:()=>gs});var lU=p(()=>{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=>{P();cU=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var Wp,uU=p(()=>{Wp="baggage"});function pU(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function dU(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function hU(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}var _U=p(()=>{P()});var Ul,EU=p(()=>{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=>n.length<=4096).slice(0,180),i=pU(a);i.length>0&&o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=hU(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r=="string"&&r.length>0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var SU=p(()=>{P()});function gU(){return r=>{S.error($te(r))}}function $te(r){return typeof r=="string"?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=>{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=>{vU();Wte=gU()});var Ut,cS=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)>-1}function tre(r){return ere.indexOf(r)>-1}function nre(r){return rre.indexOf(r)>-1}function ire(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o=="string"){let s=are[o.toUpperCase()];s!=null&&(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case"OTEL_LOG_LEVEL":lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=>{P();cS();Jte=",",Qte=["OTEL_SDK_DISABLED"];ere=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rre=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=>{uS()});import{performance as cre}from"perf_hooks";var dr,NU=p(()=>{dr=cre});var CU,PU=p(()=>{CU="1.29.0"});var ki,IU=p(()=>{PU();Ve();ki={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=>{});var LU=p(()=>{RU();NU();IU();bU()});var fS=p(()=>{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!="number"){let e=dr;r=e.timing&&e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r=="number"?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function nd(r){return rd(r)||typeof r=="number"||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=pS&&(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=>{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Xt||(Xt={}))});var Vl,wU=p(()=>{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&&!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=>{_S="[_0-9a-z-*/]",Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=>{kU();BU=32,vre=512,VU=",",FU="=",od=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length>vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&&UU(n)&&t.set(i,n)}return t},new Map),this._internalState.size>BU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=>{P();Dl();GU();sd="traceparent",ad="tracestate",yre="00",Ore="(?!ff)[\\da-f]{2}",Are="(?![0]{32})[\\da-f]{32}",Rre="(?![0]{16})[\\da-f]{16}",Nre="[\\da-f]{2}",Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&&o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new od(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&jU.call(t)===xre}function Dre(r){return r!=null&&typeof r=="object"}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&&Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&&(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=>{Pre="[object Object]",Ire="[object Null]",bre="[object Undefined]",Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t>Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a<i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(ld(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&&Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r=="function"}function Gl(r){return!ld(r)&&!cd(r)&&!JU(r)&&typeof r=="object"}function ld(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=>{$U();Vre=20});var ud,ZU=p(()=>{ud=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=>{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=>{he.with(wl(he.active()),()=>{r.export(e,o=>{t(o)})})})}var rk=p(()=>{P();Dl()});var nk,kt=p(()=>{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=>{ik="exception"});var Cs,SS=p(()=>{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&&this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&S.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),nd(t)&&(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&&typeof e.message!="string"&&(S.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]<0&&(S.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=dr.now())return dS(e+this._performanceOffset);if(typeof e=="number")return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e=="string"?o[Wa]=e:e&&(e.code?o[Xa]=e.code.toString():e.name&&(o[Xa]=e.name),e.message&&(o[Wa]=e.message),e.stack&&(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(hr||(hr={}))});var Ur,fd=p(()=>{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var Wt,pd=p(()=>{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var Gn,gS=p(()=>{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=>{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}".`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e<0||e>1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=>{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&&s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&&l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=>{OS();kt()});var hd,ck=p(()=>{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)=="number"?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)=="number"?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)=="number"?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)=="number"?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&S.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a<i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let o=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);he.with(wl(he.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=>this._exporter.export(s,n=>{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&&l!==void 0?l:new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let n=0,l=s.length;n<l;n++){let c=s[n];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=>{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=>{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t<r/4;t++)_d.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(_d[t]>0);t++)t===r-1&&(_d[r-1]=1);return _d.toString("hex",0,r)}}var qn,_d,pk=p(()=>{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=>{uk();pk()});var Ed=p(()=>{dk()});var Is,hk=p(()=>{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&&(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug("Instrumentation suppressed, returning Noop Span"),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&&s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&&a!==void 0?a:[]).map(z=>({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&&i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug("Recording is off, propagating context in a non-recording span"),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length<2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=>{});var Ek=p(()=>{_k()});var mk=p(()=>{Ek()});var jn,Tk=p(()=>{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=>{Tk()});var ql,gk=p(()=>{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(o=>{Kt(o||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=>{Promise.all(e).then(()=>{t()},o)})}}});var bs,RS=p(()=>{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=>{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&&t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&&(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&&o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||""}:${(o==null?void 0:o.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>S.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&he.setGlobalContextManager(e.contextManager),e.propagator&&Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=>new Promise(s=>{let a,i=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=>{clearTimeout(i),a!==pn.timeout&&(a=pn.resolved,s(a))}).catch(n=>{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=>{Promise.all(t).then(a=>{let i=a.filter(n=>n!==pn.resolved);i.length>0?s(i):o()}).catch(a=>s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=>{let a=this._getPropagator(s);return a||S.warn(`Propagator "${s}" requested through environment variable is unavailable.`),a}).reduce((s,a)=>(a&&s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||S.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([["tracecontext",()=>new Fl],["baggage",()=>new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=>{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=>{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=>{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&se.SAMPLED)===0)return;let s=()=>nk._export(this._exporter,[e]).then(a=>{var i;a.code!==Xt.SUCCESS&&Kt((i=a.error)!==null&&i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=>{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=>(a!=null&&this._unresolvedExports.delete(a),s()),i=>Kt(i));a!=null&&this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=>Ur,AlwaysOnSampler:()=>Wt,BasicTracerProvider:()=>Ls,BatchSpanProcessor:()=>Hn,ConsoleSpanExporter:()=>Td,ForceFlushState:()=>pn,InMemorySpanExporter:()=>Sd,NoopSpanProcessor:()=>bs,ParentBasedSampler:()=>Gn,RandomIdGenerator:()=>qn,SamplingDecision:()=>hr,SimpleSpanProcessor:()=>gd,Span:()=>Cs,TraceIdRatioBasedSampler:()=>Fi,Tracer:()=>Is});var Gi=p(()=>{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=>{"use strict";var qre="2.0.0",jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=>{"use strict";var $re=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Nk.exports=$re});var Ms=T((kr,Ck)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS="[a-zA-Z0-9-]",rne=[["\\s",1],["\\d",Wre],[CS,Xre]],nne=r=>{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=>{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?"g":void 0),Zre[s]=new RegExp(o,t?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CS}*`);re("MAINVERSION",`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASE",`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${CS}+`);re("BUILD",`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re("FULL",`^${D[U.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re("LOOSE",`^${D[U.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re("XRANGE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re("COERCE",`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",D[U.COERCE],!0);re("COERCERTLFULL",D[U.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace="$1~";re("TILDE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace="$1^";re("CARET",`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var vd=T((c1e,Pk)=>{"use strict";var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=>r?typeof r!="object"?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=>{"use strict";var Ik=/^[0-9]+$/,bk=(r,e)=>{let t=Ik.test(r),o=Ik.test(e);return t&&o&&(r=+r,e=+e),r===e?0:t&&!o?-1:o&&!t?1:r<e?-1:1},ane=(r,e)=>bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=>{"use strict";var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>xk)throw new TypeError(`version is longer than ${xk} characters`);yd("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Od||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Od||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Od||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let a=+s;if(a>=0&&a<Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(yd("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd("prerelease compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd("build compare",t,o,s),o===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith("pre")){if(!t&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,o),this.inc("pre",t,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,o),this.inc("pre",t,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&&(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=>{"use strict";var wk=pt(),cne=(r,e,t=!1)=>{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=>{"use strict";var une=Hi(),fne=(r,e)=>{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=>{"use strict";var pne=Hi(),dne=(r,e)=>{let t=pne(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=>{"use strict";var Fk=pt(),hne=(r,e,t,o,s)=>{typeof t=="string"&&(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=>{"use strict";var qk=Hi(),_ne=(r,e)=>{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s>0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&&!l){if(!n.patch&&!n.minor)return"major";if(n.compareMain(i)===0)return n.minor&&!n.patch?"minor":"patch"}let u=l?"pre":"";return t.major!==o.major?u+"major":t.minor!==o.minor?u+"minor":t.patch!==o.patch?u+"patch":"prerelease"};jk.exports=_ne});var Kk=T((m1e,zk)=>{"use strict";var Ene=pt(),mne=(r,e)=>new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=>{"use strict";var Tne=pt(),Sne=(r,e)=>new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=>{"use strict";var gne=pt(),vne=(r,e)=>new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=>{"use strict";var yne=Hi(),One=(r,e)=>{let t=yne(r,e);return t&&t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=>{"use strict";var eB=pt(),Ane=(r,e,t)=>new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=>{"use strict";var Rne=Jt(),Nne=(r,e,t)=>Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=>{"use strict";var Cne=Jt(),Pne=(r,e)=>Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=>{"use strict";var sB=pt(),Ine=(r,e,t)=>{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=>{"use strict";var bne=Nd(),Lne=(r,e)=>r.sort((t,o)=>bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=>{"use strict";var xne=Nd(),Mne=(r,e)=>r.sort((t,o)=>xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=>{"use strict";var wne=Jt(),Dne=(r,e,t)=>wne(r,e,t)>0;pB.exports=Dne});var Cd=T((P1e,dB)=>{"use strict";var Une=Jt(),kne=(r,e,t)=>Une(r,e,t)<0;dB.exports=kne});var bS=T((I1e,hB)=>{"use strict";var Bne=Jt(),Vne=(r,e,t)=>Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=>{"use strict";var Fne=Jt(),Gne=(r,e,t)=>Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=>{"use strict";var Hne=Jt(),qne=(r,e,t)=>Hne(r,e,t)>=0;EB.exports=qne});var Id=T((x1e,mB)=>{"use strict";var jne=Jt(),Yne=(r,e,t)=>jne(r,e,t)<=0;mB.exports=Yne});var xS=T((M1e,TB)=>{"use strict";var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return zne(r,t,o);case"!=":return Kne(r,t,o);case">":return $ne(r,t,o);case">=":return Xne(r,t,o);case"<":return Wne(r,t,o);case"<=":return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=>{"use strict";var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=>{if(r instanceof Zne)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||"0",a=t[4]||"0",i=e.includePrerelease&&t[5]?`-${t[5]}`:"",n=e.includePrerelease&&t[6]?`+${t[6]}`:"";return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=>{"use strict";var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=>{"use strict";var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(s=>!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let o=0;o<t.length;o++)o>0&&(this.formatted+=" "),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&&cie)|(this.options.loose&&uie))+":"+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be("hyphen replace",e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be("comparator trim",e),e=e.replace(Rt[Tt.TILDETRIM],aie),be("tilde trim",e),e=e.replace(Rt[Tt.CARETTRIM],lie),be("caret trim",e);let n=e.split(" ").map(f=>pie(f,this.options)).join(" ").split(/\s+/).map(f=>gie(f,this.options));a&&(n=n.filter(f=>(be("loose invalid filter",f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be("range list",n);let l=new Map,c=n.map(f=>new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>RB(o,t)&&e.set.some(s=>RB(s,t)&&o.every(a=>s.every(i=>a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=>r.value==="<0.0.0-0",fie=r=>r.value==="",RB=(r,e)=>{let t=!0,o=r.slice(),s=o.pop();for(;t&&o.length;)t=o.every(a=>s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=>(be("comp",r,e),r=_ie(r,e),be("caret",r),r=die(r,e),be("tildes",r),r=mie(r,e),be("xrange",r),r=Sie(r,e),be("stars",r),r),St=r=>!r||r.toLowerCase()==="x"||r==="*",die=(r,e)=>r.trim().split(/\s+/).map(t=>hie(t,e)).join(" "),hie=(r,e)=>{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=>{be("tilde",r,o,s,a,i,n);let l;return St(s)?l="":St(a)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:St(i)?l=`>=${s}.${a}.0 <${s}.${+a+1}.0-0`:n?(be("replaceTilde pr",n),l=`>=${s}.${a}.${i}-${n} <${s}.${+a+1}.0-0`):l=`>=${s}.${a}.${i} <${s}.${+a+1}.0-0`,be("tilde return",l),l})},_ie=(r,e)=>r.trim().split(/\s+/).map(t=>Eie(t,e)).join(" "),Eie=(r,e)=>{be("caret",r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?"-0":"";return r.replace(t,(s,a,i,n,l)=>{be("caret",r,s,a,i,n,l);let c;return St(a)?c="":St(i)?c=`>=${a}.0.0${o} <${+a+1}.0.0-0`:St(n)?a==="0"?c=`>=${a}.${i}.0${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.0${o} <${+a+1}.0.0-0`:l?(be("replaceCaret pr",l),a==="0"?i==="0"?c=`>=${a}.${i}.${n}-${l} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}-${l} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n}-${l} <${+a+1}.0.0-0`):(be("no pr"),a==="0"?i==="0"?c=`>=${a}.${i}.${n}${o} <${a}.${i}.${+n+1}-0`:c=`>=${a}.${i}.${n}${o} <${a}.${+i+1}.0-0`:c=`>=${a}.${i}.${n} <${+a+1}.0.0-0`),be("caret return",c),c})},mie=(r,e)=>(be("replaceXRanges",r,e),r.split(/\s+/).map(t=>Tie(t,e)).join(" ")),Tie=(r,e)=>{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=>{be("xRange",r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s==="="&&_&&(s=""),l=e.includePrerelease?"-0":"",c?s===">"||s==="<"?o="<0.0.0-0":o="*":s&&_?(u&&(i=0),n=0,s===">"?(s=">=",u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s==="<="&&(s="<",u?a=+a+1:i=+i+1),s==="<"&&(l="-0"),o=`${s+a}.${i}.${n}${l}`):u?o=`>=${a}.0.0${l} <${+a+1}.0.0-0`:f&&(o=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),be("xRange return",o),o})},Sie=(r,e)=>(be("replaceStars",r,e),r.trim().replace(Rt[Tt.STAR],"")),gie=(r,e)=>(be("replaceGTE0",r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],"")),vie=r=>(e,t,o,s,a,i,n,l,c,u,f,_)=>(St(o)?t="":St(s)?t=`>=${o}.0.0${r?"-0":""}`:St(a)?t=`>=${o}.${s}.0${r?"-0":""}`:i?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,St(c)?l="":St(u)?l=`<${+c+1}.0.0-0`:St(f)?l=`<${c}.${+u+1}.0-0`:_?l=`<=${c}.${u}.${f}-${_}`:r?l=`<${c}.${u}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=>{for(let o=0;o<r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let o=0;o<r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&&r[o].semver.prerelease.length>0){let s=r[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=>{"use strict";var $l=Symbol("SemVer ANY"),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),kS("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value="":this.value=this.operator+this.semver.version,kS("comp",this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS("Comparator.test",e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e=="string")try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new LB(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||US(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||US(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=>{"use strict";var Oie=Qt(),Aie=(r,e,t)=>{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=>{"use strict";var Rie=Qt(),Nie=(r,e)=>new Rie(r,e).set.map(t=>t.map(o=>o.value).join(" ").trim().split(" "));wB.exports=Nie});var kB=T((F1e,UB)=>{"use strict";var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===-1)&&(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=>{"use strict";var bie=pt(),Lie=Qt(),xie=(r,e,t)=>{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=>{a.test(i)&&(!o||s.compare(i)===1)&&(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=>{"use strict";var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=>{r=new Mie(r,e);let t=new VS("0.0.0");if(r.test(t)||(t=new VS("0.0.0-0"),r.test(t)))return t;t=null;for(let o=0;o<r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=>{let n=new VS(i.semver.version);switch(i.operator){case">":n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":(!a||FB(n,a))&&(a=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&&(!t||FB(t,a))&&(t=a)}return t&&r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=>{"use strict";var Die=Qt(),Uie=(r,e)=>{try{return new Die(r,e).range||"*"}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=>{"use strict";var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=>{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case">":s=YB,a=Gie,i=zB,n=">",l=">=";break;case"<":s=zB,a=Hie,i=YB,n="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fie(r,e,o))return!1;for(let c=0;c<e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=>{m.semver===Bie&&(m=new KB(">=0.0.0")),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&&(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&&a(r,_.semver))return!1;if(_.operator===l&&i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=>{"use strict";var jie=xd(),Yie=(r,e,t)=>jie(r,e,">",t);XB.exports=Yie});var QB=T((z1e,JB)=>{"use strict";var zie=xd(),Kie=(r,e,t)=>zie(r,e,"<",t);JB.exports=Kie});var tV=T((K1e,eV)=>{"use strict";var ZB=Qt(),$ie=(r,e,t)=>(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=>{"use strict";var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=>{let o=[],s=null,a=null,i=r.sort((u,f)=>Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&&u===i[0]?n.push("*"):f?u===i[0]?n.push(`<=${f}`):n.push(`${u} - ${f}`):n.push(`>=${u}`);let l=n.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var cV=T((X1e,lV)=>{"use strict";var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=>{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(">=0.0.0-0")],oV=[new GS(">=0.0.0")],Zie=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===FS){if(e.length===1&&e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&&e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===">"||m.operator===">="?s=sV(s,m,t):m.operator==="<"||m.operator==="<="?a=aV(a,m,t):o.add(m.semver);if(o.size>1)return null;let i;if(s&&a){if(i=HS(s.semver,a.semver,t),i>0)return null;if(i===0&&(s.operator!==">="||a.operator!=="<="))return null}for(let m of o){if(s&&!Wl(m,String(s),t)||a&&!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&&!t.includePrerelease&&a.semver.prerelease.length?a.semver:!1,_=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&a.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let m of e){if(u=u||m.operator===">"||m.operator===">=",c=c||m.operator==="<"||m.operator==="<=",s){if(_&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===_.major&&m.semver.minor===_.minor&&m.semver.patch===_.patch&&(_=!1),m.operator===">"||m.operator===">="){if(n=sV(s,m,t),n===m&&n!==s)return!1}else if(s.operator===">="&&!Wl(s.semver,String(m),t))return!1}if(a){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(l=aV(a,m,t),l===m&&l!==a)return!1}else if(a.operator==="<="&&!Wl(a.semver,String(m),t))return!1}if(!m.operator&&(a||s)&&i!==0)return!1}return!(s&&c&&!a&&i!==0||a&&u&&!s&&i!==0||_||f)},sV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o>0?r:o<0||e.operator===">"&&r.operator===">="?e:r},aV=(r,e,t)=>{if(!r)return e;let o=HS(r.semver,e.semver,t);return o<0?r:o>0||e.operator==="<"&&r.operator==="<="?e:r};lV.exports=Jie});var jS=T((W1e,pV)=>{"use strict";var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(":");if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,"0"),n=s.padStart(16,"0"),l=Boe.test(a)?parseInt(a,16)&1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=>{P();xr();dV=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hV=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a},YS="uber-trace-id",Md="uberctx",_V=(function(){function r(e){typeof e=="string"?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&&At(e)===!1){var l="0"+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+":"+i.spanId+":0:"+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+"-"+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+"-")}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c=="string"){var _=Voe(c);_&&(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&&n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&&(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&&!y.done&&(a=O.return)&&a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=>_V,UBER_BAGGAGE_HEADER_PREFIX:()=>Md,UBER_TRACE_ID_HEADER:()=>YS});var TV=p(()=>{EV()});var vV=T(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,"14.8.0")?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,["b3",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],["b3multi",()=>new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],["jaeger",()=>new Goe.JaegerPropagator]])});var zS=T(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,"NodeTracerProvider",{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,"AlwaysOffSampler",{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,"AlwaysOnSampler",{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,"BasicTracerProvider",{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,"BatchSpanProcessor",{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,"ConsoleSpanExporter",{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,"ForceFlushState",{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,"InMemorySpanExporter",{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,"NoopSpanProcessor",{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,"ParentBasedSampler",{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,"RandomIdGenerator",{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,"SamplingDecision",{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,"SimpleSpanProcessor",{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,"Span",{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,"Tracer",{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=>{});var OV=p(()=>{yV()});var KS=p(()=>{OV()});var Ce,dn=p(()=>{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=>{AV=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}},RV=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}}});import*as NV from"child_process";import*as CV from"util";var Us,kd=p(()=>{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=>qoe});async function qoe(){try{let e=(await Us('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(` `).find(o=>o.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var IV=p(()=>{kd();P()});var bV={};Ae(bV,{getMachineId:()=>Yoe});import{promises as joe}from"fs";async function Yoe(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await joe.readFile(e,{encoding:"utf8"})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var LV=p(()=>{P()});var xV={};Ae(xV,{getMachineId:()=>Koe});import{promises as zoe}from"fs";async function Koe(){try{return(await zoe.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return""}var MV=p(()=>{kd();P()});var wV={};Ae(wV,{getMachineId:()=>$oe});import*as Bd from"process";async function $oe(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Bd.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Bd.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await Us(`${e} ${r}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return""}var DV=p(()=>{kd();P()});var UV={};Ae(UV,{getMachineId:()=>Xoe});async function Xoe(){return S.debug("could not read machine-id: unsupported platform"),""}var kV=p(()=>{P()});import*as BV from"process";var qi,VV=p(()=>{switch(BV.platform){case"darwin":({getMachineId:qi}=(IV(),ee(PV)));break;case"linux":({getMachineId:qi}=(LV(),ee(bV)));break;case"freebsd":({getMachineId:qi}=(MV(),ee(xV)));break;case"win32":({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from"os";var XS,ji,WS=p(()=>{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=>{let t={};return e&&(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=>{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from"os";var QS,Yi,ZS=p(()=>{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=>{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from"os";var tg,zi,rg=p(()=>{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:"nodejs",[Ja]:"Node.js"};process.argv.length>1&&(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=>{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from"crypto";var ig,ec,jV=p(()=>{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=>{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=>{YV()});var og,tc,sg=p(()=>{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator<"u"&&((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&&((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:"browser",[Ja]:"Web Browser",[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===""?(S.debug("BrowserDetector failed: Unable to find required browser resources. "),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=>{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=>{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&&(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=>{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=>{zV();KV();$V();sg();ug()});var WV,JV=p(()=>{WV=r=>r!==null&&typeof r=="object"&&typeof r.then=="function"});var QV,ZV,e2,t2=p(()=>{dn();P();JV();QV=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=>t.merge(o),Ce.empty())},ZV=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(s=>{try{let a=s.detect(r),i;if(WV(a)){let n=async()=>{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=>S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=>s.merge(a),Ce.empty());return o.waitForAsyncAttributes&&o.waitForAsyncAttributes().then(()=>{e2(t)}),o},e2=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=>Ce,browserDetector:()=>lg,browserDetectorSync:()=>tc,defaultServiceName:()=>Ds,detectResources:()=>QV,detectResourcesSync:()=>ZV,envDetector:()=>pg,envDetectorSync:()=>rc,hostDetector:()=>Jl,hostDetectorSync:()=>ji,osDetector:()=>Ql,osDetectorSync:()=>Yi,processDetector:()=>Zl,processDetectorSync:()=>zi,serviceInstanceIdDetectorSync:()=>ec});var Fd=p(()=>{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s<a;s++){let i=r[s];e&&i.setTracerProvider(e),t&&i.setMeterProvider(t),o&&i.setLoggerProvider&&i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=>e.disable())}var i2=p(()=>{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&t!==void 0?t:[];return r2(i,o,s,a),()=>{n2(i)}}var s2=p(()=>{P();El();i2()});var hg=T((FUe,c2)=>{"use strict";function dg(r){return typeof r=="function"}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&&r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&&r.logger&&(dg(r.logger)?vt=r.logger:vt("new logger isn't a function, not replacing"))}function a2(r,e,t){if(!r||!r[e]){vt("no original function "+e+" to wrap");return}if(!t){vt("no wrapper function"),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt("original object and wrapper must be functions");return}var o=r[e],s=t(o,e);return nc(s,"__original",o),nc(s,"__unwrap",function(){r[e]===s&&nc(r,e,o)}),nc(s,"__wrapped",!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to wrap on modules");return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt("no function to unwrap."),vt(new Error().stack);return}if(!r[e].__unwrap)vt("no original to unwrap to -- has "+e+" already been unwrapped?");else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt("must provide one or more modules to patch"),vt(new Error().stack);return}if(!(e&&Array.isArray(e))){vt("must provide one or more functions to unwrap on modules");return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=>{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},a)}}}});var p2=T((jUe,f2)=>{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return ose(r);if(t==="number"&&isFinite(r))return e.long?ase(r):sse(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return t*ise;case"weeks":case"week":case"w":return t*nse;case"days":case"day":case"d":return t*Ki;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return t*Bs;case"seconds":case"second":case"secs":case"sec":case"s":return t*ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function sse(r){var e=Math.abs(r);return e>=Ki?Math.round(r/Ki)+"d":e>=Vs?Math.round(r/Vs)+"h":e>=Bs?Math.round(r/Bs)+"m":e>=ks?Math.round(r/ks)+"s":r+"ms"}function ase(r){var e=Math.abs(r);return e>=Ki?Hd(r,e,Ki,"day"):e>=Vs?Hd(r,e,Vs,"hour"):e>=Bs?Hd(r,e,Bs,"minute"):e>=ks?Hd(r,e,ks,"second"):r+" ms"}function Hd(r,e,t,o){var s=e>=t*1.5;return Math.round(r/t)+" "+o+(s?"s":"")}});var _g=T((YUe,d2)=>{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_<u.length;_++)f=(f<<5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=>{if(B==="%%")return"%";N++;let te=t.formatters[G];if(typeof te=="function"){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(m!==t.namespaces&&(m=t.namespaces,O=t.enabled(u)),O),set:A=>{_=A}}),typeof t.init=="function"&&t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f>"u"?":":f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of f)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_<u.length;)if(m<f.length&&(f[m]===u[_]||f[m]==="*"))f[m]==="*"?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m<f.length&&f[m]==="*";)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=>{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Nt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cse(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+qd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=>{});function fse(r){try{r?Nt.storage.setItem("debug",r):Nt.storage.removeItem("debug")}catch{}}function pse(){let r;try{r=Nt.storage.getItem("debug")||Nt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var E2=T((zUe,_2)=>{"use strict";_2.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),s=e.indexOf("--");return o!==-1&&(s===-1||o<s)}});var S2=T((KUe,T2)=>{"use strict";var _se=V("os"),m2=V("tty"),Zt=E2(),{env:Ze}=process,zn;Zt("no-color")||Zt("no-colors")||Zt("color=false")||Zt("color=never")?zn=0:(Zt("color")||Zt("colors")||Zt("color=true")||Zt("color=always"))&&(zn=1);"FORCE_COLOR"in Ze&&(Ze.FORCE_COLOR==="true"?zn=1:Ze.FORCE_COLOR==="false"?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function mg(r,e){if(zn===0)return 0;if(Zt("color=16m")||Zt("color=full")||Zt("color=truecolor"))return 3;if(Zt("color=256"))return 2;if(r&&!e&&zn===void 0)return 0;let t=zn||0;if(Ze.TERM==="dumb")return t;if(process.platform==="win32"){let o=_se.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in Ze)||Ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:t}function Ese(r){let e=mg(r,r&&r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=>{var mse=V("tty"),jd=V("util");et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");et.colors=[6,2,3,4,5,1];try{let r=S2();r&&(r.stderr||r).level>=2&&(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return"colors"in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s="\x1B[3"+(o<8?o:"8;5;"+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+"m+"+Yd.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=gse()+e+" "+r[0]}function gse(){return et.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=>e.trim()).join(" ")};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=>{"use strict";var Sg=V("path").sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf("node_modules");if(t!==-1&&e[t+1]){for(var o=e[t+1][0]==="@",s=o?e[t+1]+"/"+e[t+2]:e[t+1],a=o?3:2,i="",n=t+a-1,l=0;l<=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c="",u=e.length-1,f=t+a;f<=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=>{"use strict";var Rse=V("os");A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(t?"/Users/"+t:null):process.platform==="linux"?e||(process.getuid()===0?"/root":t?"/home/"+t:null):e||null}});var yg=T((JUe,R2)=>{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=>{"use strict";var Nse=process.platform==="win32",Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError("Invalid path '"+r+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=>{var I2=V("path"),C2=I2.parse||N2(),P2=function(e,t){var o="/";/^([A-Za-z]:)/.test(e)?o="":/^\\\\/.test(e)&&(o="\\\\");for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&typeof t.paths=="function")return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&&t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=>{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=>{"use strict";var Lse="Function.prototype.bind called on incompatible ",xse=Object.prototype.toString,Mse=Math.max,wse="[object Function]",x2=function(e,t){for(var o=[],s=0;s<e.length;s+=1)o[s]=e[s];for(var a=0;a<t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s<e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t="",o=0;o<r.length;o+=1)t+=r[o],o+1<r.length&&(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!="function"||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l<i;l++)n[l]="$"+l;if(s=Function("binder","return function ("+Use(n,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=>{"use strict";var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=>{"use strict";var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=>{Gse.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var sc=T((oke,H2)=>{"use strict";var Hse=B2();function qse(r,e){for(var t=r.split("."),o=e.split(" "),s=o.length>1?o[0]:"=",a=(o.length>1?o[1]:o[0]).split("."),i=0;i<3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s==="<"?n<l:s===">="?n>=l:!1}return s===">="}function F2(r,e){var t=e.split(/ ?&& ?/);if(t.length===0)return!1;for(var o=0;o<t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e=="boolean")return e;var t=typeof r>"u"?process.versions&&process.versions.node:r;if(typeof t!="string")throw new TypeError(typeof r>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var o=0;o<e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&&jse(t,G2[e])}});var Y2=T((ske,j2)=>{var $i=V("fs"),Yse=vg(),ze=V("path"),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!=="win32"&&$i.realpath&&typeof $i.realpath.native=="function"?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,".node_modules"),ze.join(q2,".node_libraries")]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code==="ENOENT"||o.code==="ENOTDIR"?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&&o.code!=="ENOENT"?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&&o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a<s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t=="function"&&(s=a,a={}),typeof e!="string"){var i=new TypeError("Path must be a string.");return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&&a.readPackage){var _=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[".js"],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e==="."||e===".."||e.slice(-1)==="/")&&(F+="/"),/\/$/.test(e)&&F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&&Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error("Cannot find module '"+e+"' from '"+I+"'");C.code="MODULE_NOT_FOUND",s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error("Cannot find module '"+e+"' from '"+I+"'");Y.code="MODULE_NOT_FOUND",s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E=="function"&&(C=E,E=void 0);var Q=[""].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&&Te&&a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([""].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===""||v==="/"||process.platform==="win32"&&/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,"package.json");n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&&W(J);var Ne=ce;Ne&&a.packageFilter&&(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C=="function"&&(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,"package.json");n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,"index"),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&&a.packageFilter&&(Z=a.packageFilter(Z,J)),Z&&Z.main){if(typeof Z.main!="string"){var je=new TypeError("package \u201C"+Z.name+"\u201D `main` must be a string");return je.code="INVALID_PACKAGE_MAIN",E(je)}(Z.main==="."||Z.main==="./")&&(Z.main="index"),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,"index"),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,"index"),Ye,E)})});return}B(ze.join(v,"/index"),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=>{nae.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var W2=T((lke,X2)=>{"use strict";var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&&($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=>{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=>{var sae=sc(),Xi=V("fs"),dt=V("path"),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!=="win32"&&Xi.realpathSync&&typeof Xi.realpathSync.native=="function"?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,".node_modules"),dt.join(Z2,".node_libraries")]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return!1;throw o}return!!t&&t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!=="ENOENT")throw t}return e},lc=function(e,t,o){return o&&o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a<s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!="string")throw new TypeError("Path must be a string.");var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&&o.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var c=o.packageIterator,u=o.extensions||[".js"],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e==="."||e===".."||e.slice(-1)==="/")&&(y+="/");var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&&sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error("Cannot find module '"+e+"' from '"+m+"'");throw M.code="MODULE_NOT_FOUND",M;function F(G){var te=N(dt.dirname(G));if(te&&te.dir&&te.pkg&&o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&&(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v<u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===""||G==="/")&&!(process.platform==="win32"&&/^\w:[/\\]*$/.test(G))&&!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),"package.json");if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&&o.packageFilter&&($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),"/package.json");if(s(te)){try{var $=l(a,te)}catch{}if($&&o.packageFilter&&($=o.packageFilter($,G)),$&&$.main){if(typeof $.main!="string"){var le=new TypeError("package \u201C"+$.name+"\u201D `main` must be a string");throw le.code="INVALID_PACKAGE_MAIN",le}($.main==="."||$.main==="./")&&($.main="index");try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,"/index"))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v<le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=>{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=>{Tae.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Lg=T((dke,bg)=>{"use strict";var Gs=V("path"),_r=V("module"),Fe=y2()("require-in-the-middle"),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=>r.startsWith("node:")?!0:(Pg===void 0&&(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(".").map(Number);e===8&&t<8?Fs=o=>o==="http2"?!0:!!r.core[o]:Fs=o=>!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&&V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&&this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&&s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),typeof _r._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof _r._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe("registering require hook"),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe("ignoring require call - module is soft-unhooked"),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe("ignoring process.getBuiltinModule call - module is soft-unhooked"),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith("node:")){let M=u.slice(5);Fs(M)&&(_=M)}}else{if(c)return Fe("call to process.getBuiltinModule with unknown built-in id"),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe('Module._resolveFilename("%s") threw %j, calling original Module.require',u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe("processing %s module require('%s'): %s",f===!0?"core":"non-core",u,_),o._cache.has(_,f)===!0)return Fe("returning already patched cached module: %s",_),o._cache.get(_,f);let y=s.has(_);y===!1&&s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe("module is in the process of being patched already - ignoring: %s",_),A;if(s.delete(_),f===!0){if(i===!0&&r.includes(_)===!1)return Fe("ignoring core module not on whitelist: %s",_),A;m=_}else if(i===!0&&r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe("could not parse filename: %s",_),A;m=M.name,O=M.basedir;let F=yae(M);Fe("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",m,u,F,O);let N=!1;if(i){if(!u.startsWith(".")&&r.includes(u)&&(m=u,N=!0),!r.includes(m)&&!r.includes(F))return A;r.includes(F)&&F!==m&&(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe("could not resolve module: %s",m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe("preparing to process require of internal file: %s",m);else return Fe("ignoring require of non-main module file: %s",z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe("calling require hook: %s",m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe("returning module: %s",m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe("require unhook successful")):Fe("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe("process.getBuiltinModule unhook successful")):Fe("process.getBuiltinModule unhook unsuccessful"))};function yae(r){let e=Gs.sep!=="/"?r.path.split(Gs.sep).join("/"):r.path;return Gs.posix.join(r.name,e).replace(vae,"")}});var Xd,Wd,iF=p(()=>{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split("/")){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split("/")){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&&i&&a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&&a.sort((n,l)=>n.insertedId-l.insertedId),a.map(({hook:n})=>n))}}});import*as xg from"path";function Aae(r){return xg.sep!=="/"?r.split(xg.sep).join("/"):r}var sF,Oae,Jd,aF=p(()=>{sF=Nn(Lg());iF();Oae=["afterEach","after","beforeEach","before","describe","it"].every(r=>typeof global[r]=="function"),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=>{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&&e!==void 0?e:new r}}});var dF=T(Wi=>{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return"Module";let t=cF.get(r)[e];if(typeof t=="function")return t()},defineProperty(r,e,t){if(!("value"in t))throw new Error("Getters/setters are not supported for exports property descriptors.");return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=>i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=>{var hF=V("path"),Iae=gg(),{fileURLToPath:_F}=V("url"),{MessageChannel:bae}=V("worker_threads"),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=>r(e,t))}function TF(r){let e=wg.indexOf(r);e>-1&&wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&&s!==e&&(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=>{t++,r.postMessage(n)},r.on("message",()=>{t--,o&&t<=0&&o()}).unref();function s(){let n=setInterval(()=>{},1e3),l=new Promise(c=>{o=c}).then(()=>{clearInterval(n)});return t===0&&o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null);let o=e?e.internals===!0:!1;Dg&&Array.isArray(r)&&Dg(r),this._iitmHook=(s,a)=>{let i=s,n=s.startsWith("node:"),l;if(n)s=s.replace(/^node:/,"");else{if(s.startsWith("file://"))try{s=_F(s)}catch{}let c=Iae(s);c&&(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&&!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&&!t)throw o;return s}}function Qd(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var Ug=p(()=>{});import*as hn from"path";import{types as yF}from"util";import{readFileSync as Dae}from"fs";function OF(r,e,t){return typeof e>"u"?r.includes("*"):r.some(o=>(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=>{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=>{if(Qd(a[i])&&this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=>yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(l=>{i.forEach(c=>{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=>{if(a)Array.isArray(a)||(a=[a]);else{S.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){S.error("must provide one or more functions to wrap on modules");return}a.forEach(n=>{i.forEach(l=>{this._unwrap(n,l)})})};let s=this.init();s&&!Array.isArray(s)&&(s=[s]),this._modules=s||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,"package.json"),{encoding:"utf8"}),o=JSON.parse(t).version;return typeof o=="string"?o:void 0}catch{S.warn("Failed extracting version",e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&&a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=>u.name===l).filter(u=>OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=>(f.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=>{if(!l&&hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=>this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from"path";var PF=p(()=>{});var IF=p(()=>{CF();PF()});var kg=p(()=>{IF()});var eh,bF=p(()=>{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=>{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=>qs,InstrumentationNodeModuleDefinition:()=>eh,InstrumentationNodeModuleFile:()=>th,isWrapped:()=>Qd,registerInstrumentations:()=>o2,safeExecuteInTheMiddle:()=>gF,safeExecuteInTheMiddleAsync:()=>vF});var MF=p(()=>{s2();kg();bF();LF();Ug()});var Br,wF=p(()=>{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=>{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name="OTLPExporterError",a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&&Number.isFinite(r)&&r>0)return r;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+r+"')")}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&&o!==void 0?o:e.timeoutMillis)!==null&&s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&&a!==void 0?a:e.concurrencyLimit)!==null&&i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&&n!==void 0?n:e.compression)!==null&&l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var pc=p(()=>{});var sh,DF=p(()=>{(function(r){r.NONE="none",r.GZIP="gzip"})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=>{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length>=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function BF(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Vg(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Vg(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var FF=p(()=>{P()});var Er,GF=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Er||(Er={}))});var dc,Fg=p(()=>{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,"partialSuccess")}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn("Received Partial Success response:",JSON.stringify(r.partialSuccess))}}}var qF=p(()=>{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=>{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:"OTLPExportDelegate"})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error("Concurrent export limit reached")});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status==="success"){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,a.data)}t({code:Er.SUCCESS});return}else if(a.status==="failure"&&a.error){t({code:Er.FAILED,error:a.error});return}else a.status==="retryable"?t({code:Er.FAILED,error:new Ji("Export failed with retryable status")}):t({code:Er.FAILED,error:new Ji("Export failed with unknown error")})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug("shutdown started"),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=>{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=>sh,OTLPExporterBase:()=>Br,OTLPExporterError:()=>Ji,createOtlpNetworkExportDelegate:()=>jF,getSharedConfigurationDefaults:()=>oh,mergeOtlpSharedConfigurationWithDefaults:()=>ih});var _n=p(()=>{wF();rh();pc();DF();YF()});function zF(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var KF=p(()=>{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=>{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=>{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=>{XF();Xae=typeof BigInt<"u"?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=>{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=>ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>ph(t,o))}}:{}}var Ys=p(()=>{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=>{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=>{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=>{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=>({scope:js(t.scope),metrics:t.metrics.map(o=>rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=>nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=>{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=>{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=>rG(t,e))}}var Eh=p(()=>{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a="",schemaUrl:i=""}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=>({resource:zs(o),scopeLogs:Array.from(s,([,a])=>({scope:js(a[0].instrumentationScope),logRecords:a.map(i=>cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=>ph(e,r[e]))}var mh=p(()=>{Ec();Ys();hh()});var Yg=T((sVe,iG)=>{"use strict";iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s<arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&&(a=!1,l(c))}})}});var lG=T(aG=>{"use strict";var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&e.charAt(t)==="=";)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr<64;)sG[Ws[mr]=mr<26?mr+65:mr<52?mr+71:mr<62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t<o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c>>2],l=(c&3)<<4,n=1;break;case 1:a[i++]=Ws[l|c>>4],l=(c&15)<<2,n=2;break;case 2:a[i++]=Ws[l|c>>6],a[i++]=Ws[c&63],n=0;break}i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&&(a[i++]=Ws[l],a[i++]=61,n===1&&(a[i++]=61)),s?(i&&s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join("")):String.fromCharCode.apply(String,a.slice(0,i))};var oG="invalid encoding";Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n<e.length;){var l=e.charCodeAt(n++);if(l===61&&a>1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i<<2|(l&48)>>4,i=l,a=2;break;case 2:t[o++]=(i&15)<<4|(l&60)>>2,i=l,a=3;break;case 3:t[o++]=(i&3)<<6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=>{"use strict";cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=>{"use strict";EG.exports=fG(fG);function fG(r){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s<0?1:0;if(n&&(s=-s),s===0)o(1/s>0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s>34028234663852886e22)o((n<<31|2139095040)>>>0,a,i);else if(s<11754943508222875e-54)o((n<<31|Math.round(s/1401298464324817e-60))>>>0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&8388607;o((n<<31|l+127<<23|c)>>>0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i>>31)*2+1,l=i>>>23&255,c=i&8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i<0?1:0;if(c&&(i=-i),i===0)o(0,n,l+s),o(1/i>0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i>17976931348623157e292)o(0,n,l+s),o((c<<31|2146435072)>>>0,n,l+a);else{var u;if(i<22250738585072014e-324)u=i/5e-324,o(u>>>0,n,l+s),o((c<<31|u/4294967296)>>>0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&&(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496>>>0,n,l+s),o((c<<31|f+1023<<20|u*1048576&1048575)>>>0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c>>31)*2+1,f=c>>>20&2047,_=4294967296*(c&1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function dG(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function hG(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function _G(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var zg=T((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=>{"use strict";var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s<e.length;++s)o=e.charCodeAt(s),o<128?t+=1:o<2048?t+=2:(o&64512)===55296&&(e.charCodeAt(s+1)&64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s<1)return"";for(var a=null,i=[],n=0,l;t<o;)l=e[t++],l<128?i[n++]=l:l>191&&l<224?i[n++]=(l&31)<<6|e[t++]&63:l>239&&l<365?(l=((l&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,i[n++]=55296+(l>>10),i[n++]=56320+(l&1023)):i[n++]=(l&15)<<12|(e[t++]&63)<<6|e[t++]&63,n>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&&a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join("")):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n<e.length;++n)a=e.charCodeAt(n),a<128?t[o++]=a:a<2048?(t[o++]=a>>6|192,t[o++]=a&63|128):(a&64512)===55296&&((i=e.charCodeAt(n+1))&64512)===56320?(a=65536+((a&1023)<<10)+(i&1023),++n,t[o++]=a>>18|240,t[o++]=a>>12&63|128,t[o++]=a>>6&63|128,t[o++]=a&63|128):(t[o++]=a>>12|224,t[o++]=a>>6&63|128,t[o++]=a&63|128);return o-s}});var vG=T((fVe,gG)=>{"use strict";gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o>>>1,a=null,i=o;return function(l){if(l<1||l>s)return r(l);i+l>o&&(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&7&&(i=(i|7)+1),c}}});var OG=T((pVe,yG)=>{"use strict";yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r>>>0,this.hi=e>>>0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash="\0\0\0\0\0\0\0\0";tt.fromNumber=function(e){if(e===0)return Qi;var t=e<0;t&&(e=-e);var o=e>>>0,s=(e-o)/4294967296>>>0;return t&&(s=~s>>>0,o=~o>>>0,++o>4294967295&&(o=0,++s>4294967295&&(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e=="number")return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low>>>0,e.high>>>0):Qi};tt.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)<<8|$n.call(e,2)<<16|$n.call(e,3)<<24)>>>0,($n.call(e,4)|$n.call(e,5)<<8|$n.call(e,6)<<16|$n.call(e,7)<<24)>>>0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};tt.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}});var Fr=T($g=>{"use strict";var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);K.global=K.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};K.isString=function(e){return typeof e=="string"||e instanceof String};K.isObject=function(e){return e&&typeof e=="object"};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&&e.hasOwnProperty(t)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};K.Buffer=(function(){try{var r=K.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e=="number"?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};K.Array=typeof Uint8Array<"u"?Uint8Array:Array;K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long");K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s<o.length;++s)(r[o[s]]===void 0||!t)&&(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG("ProtocolError");K.oneOfGetter=function(e){for(var t={},o=0;o<e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a>-1;--a)if(t[s[a]]===1&&this[s[a]]!==void 0&&this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o<e.length;++o)e[o]!==t&&delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=>{"use strict";IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&&(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&255}function _le(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e<0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e>>>0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s<e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=>{"use strict";LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&&Xn.Buffer.prototype instanceof Uint8Array&&Xn.Buffer.prototype.set.name==="set"?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s<e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&&(e=Xn._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length<40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&&this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=>{"use strict";kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Ge(e);throw Error("illegal buffer")},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}Ge.prototype.fixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8>this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4>this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8>this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Sr(this);while(this.buf[this.pos++]&128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?"toLong":"toNumber";Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=>{"use strict";FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&&(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=>{"use strict";HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError("request must be specified");var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(l,c){if(l)return i.emit("error",l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?"decodeDelimited":"decode"](c)}catch(u){return i.emit("error",u,e),a(u)}return i.emit("data",c,e),a(null,c)})}catch(n){i.emit("error",n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var iv=T(jG=>{"use strict";var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=>{"use strict";YG.exports={}});var sv=T(KG=>{"use strict";var Ct=KG;Ct.build="minimal";Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=>{"use strict";$G.exports=sv()});var JG=T((OVe,WG)=>{"use strict";var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&&Object.hasOwnProperty.call(n,"stringValue")&&l.uint32(10).string(n.stringValue),n.boolValue!=null&&Object.hasOwnProperty.call(n,"boolValue")&&l.uint32(16).bool(n.boolValue),n.intValue!=null&&Object.hasOwnProperty.call(n,"intValue")&&l.uint32(24).int64(n.intValue),n.doubleValue!=null&&Object.hasOwnProperty.call(n,"doubleValue")&&l.uint32(33).double(n.doubleValue),n.arrayValue!=null&&Object.hasOwnProperty.call(n,"arrayValue")&&d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&&Object.hasOwnProperty.call(n,"kvlistValue")&&d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&&Object.hasOwnProperty.call(n,"bytesValue")&&l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(l.value=1,!h.isString(n.stringValue)))return"stringValue: string expected";if(n.boolValue!=null&&n.hasOwnProperty("boolValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.boolValue!="boolean")return"boolValue: boolean expected"}if(n.intValue!=null&&n.hasOwnProperty("intValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.intValue)&&!(n.intValue&&h.isInteger(n.intValue.low)&&h.isInteger(n.intValue.high)))return"intValue: integer|Long expected"}if(n.doubleValue!=null&&n.hasOwnProperty("doubleValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof n.doubleValue!="number")return"doubleValue: number expected"}if(n.arrayValue!=null&&n.hasOwnProperty("arrayValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return"arrayValue."+c}}if(n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return"kvlistValue."+c}}if(n.bytesValue!=null&&n.hasOwnProperty("bytesValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!(n.bytesValue&&typeof n.bytesValue.length=="number"||h.isString(n.bytesValue)))return"bytesValue: buffer expected"}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&&(l.stringValue=String(n.stringValue)),n.boolValue!=null&&(l.boolValue=!!n.boolValue),n.intValue!=null&&(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue=="string"?l.intValue=parseInt(n.intValue,10):typeof n.intValue=="number"?l.intValue=n.intValue:typeof n.intValue=="object"&&(l.intValue=new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber())),n.doubleValue!=null&&(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&&(typeof n.bytesValue=="string"?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length>=0&&(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(c.stringValue=n.stringValue,l.oneofs&&(c.value="stringValue")),n.boolValue!=null&&n.hasOwnProperty("boolValue")&&(c.boolValue=n.boolValue,l.oneofs&&(c.value="boolValue")),n.intValue!=null&&n.hasOwnProperty("intValue")&&(typeof n.intValue=="number"?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber():n.intValue,l.oneofs&&(c.value="intValue")),n.doubleValue!=null&&n.hasOwnProperty("doubleValue")&&(c.doubleValue=l.json&&!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&&(c.value="doubleValue")),n.arrayValue!=null&&n.hasOwnProperty("arrayValue")&&(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&&(c.value="arrayValue")),n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")&&(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&&(c.value="kvlistValue")),n.bytesValue!=null&&n.hasOwnProperty("bytesValue")&&(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&&(c.value="bytesValue")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.common.v1.AnyValue"},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.ArrayValue"},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&&i.values.length)for(var l=0;l<i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.values&&c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return"values."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");n.values=[];for(var l=0;l<i.values.length;++l){if(typeof i.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.values=[]),i.values&&i.values.length){l.values=[];for(var c=0;c<i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValueList"},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&&Object.hasOwnProperty.call(i,"key")&&n.uint32(10).string(i.key),i.value!=null&&Object.hasOwnProperty.call(i,"value")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.key!=null&&i.hasOwnProperty("key")&&!h.isString(i.key))return"key: string expected";if(i.value!=null&&i.hasOwnProperty("value")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return"value."+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&&(n.key=String(i.key)),i.value!=null){if(typeof i.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.key="",l.value=null),i.key!=null&&i.hasOwnProperty("key")&&(l.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValue"},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(10).string(i.name),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&n.uint32(18).string(i.version),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.version!=null&&i.hasOwnProperty("version")&&!h.isString(i.version))return"version: string expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&&(n.name=String(i.name)),i.version!=null&&(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.name="",l.version="",l.droppedAttributesCount=0),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.version!=null&&i.hasOwnProperty("version")&&(l.version=i.version),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.InstrumentationScope"},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults&&(l.droppedAttributesCount=0),i.attributes&&i.attributes.length){l.attributes=[];for(var c=0;c<i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.resource.v1.Resource"},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&&i.resourceSpans.length)for(var l=0;l<i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceSpans&&c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceSpans!=null&&i.hasOwnProperty("resourceSpans")){if(!Array.isArray(i.resourceSpans))return"resourceSpans: array expected";for(var n=0;n<i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return"resourceSpans."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");n.resourceSpans=[];for(var l=0;l<i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceSpans=[]),i.resourceSpans&&i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c<i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.TracesData"},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&&i.scopeSpans.length)for(var l=0;l<i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&&c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeSpans!=null&&i.hasOwnProperty("scopeSpans")){if(!Array.isArray(i.scopeSpans))return"scopeSpans: array expected";for(var l=0;l<i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return"scopeSpans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");n.scopeSpans=[];for(var l=0;l<i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeSpans=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&&i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c<i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ResourceSpans"},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&&i.spans.length)for(var l=0;l<i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&&c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.spans!=null&&i.hasOwnProperty("spans")){if(!Array.isArray(i.spans))return"spans: array expected";for(var l=0;l<i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return"spans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");n.spans=[];for(var l=0;l<i.spans.length;++l){if(typeof i.spans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.spans=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&&i.spans.length){l.spans=[];for(var c=0;c<i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ScopeSpans"},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(10).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(18).bytes(i.spanId),i.traceState!=null&&Object.hasOwnProperty.call(i,"traceState")&&n.uint32(26).string(i.traceState),i.parentSpanId!=null&&Object.hasOwnProperty.call(i,"parentSpanId")&&n.uint32(34).bytes(i.parentSpanId),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(42).string(i.name),i.kind!=null&&Object.hasOwnProperty.call(i,"kind")&&n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"endTimeUnixNano")&&n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&&i.events.length)for(var l=0;l<i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&&Object.hasOwnProperty.call(i,"droppedEventsCount")&&n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&&i.links.length)for(var l=0;l<i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&&Object.hasOwnProperty.call(i,"droppedLinksCount")&&n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&&Object.hasOwnProperty.call(i,"status")&&d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&&c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&&c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId)))return"traceId: buffer expected";if(i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId)))return"spanId: buffer expected";if(i.traceState!=null&&i.hasOwnProperty("traceState")&&!h.isString(i.traceState))return"traceState: string expected";if(i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&!(i.parentSpanId&&typeof i.parentSpanId.length=="number"||h.isString(i.parentSpanId)))return"parentSpanId: buffer expected";if(i.name!=null&&i.hasOwnProperty("name")&&!h.isString(i.name))return"name: string expected";if(i.kind!=null&&i.hasOwnProperty("kind"))switch(i.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&!h.isInteger(i.endTimeUnixNano)&&!(i.endTimeUnixNano&&h.isInteger(i.endTimeUnixNano.low)&&h.isInteger(i.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(i.events!=null&&i.hasOwnProperty("events")){if(!Array.isArray(i.events))return"events: array expected";for(var n=0;n<i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return"events."+l}}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&!h.isInteger(i.droppedEventsCount))return"droppedEventsCount: integer expected";if(i.links!=null&&i.hasOwnProperty("links")){if(!Array.isArray(i.links))return"links: array expected";for(var n=0;n<i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return"links."+l}}if(i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&!h.isInteger(i.droppedLinksCount))return"droppedLinksCount: integer expected";if(i.status!=null&&i.hasOwnProperty("status")){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return"status."+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),i.traceState!=null&&(n.traceState=String(i.traceState)),i.parentSpanId!=null&&(typeof i.parentSpanId=="string"?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length>=0&&(n.parentSpanId=i.parentSpanId)),i.name!=null&&(n.name=String(i.name)),i.kind){default:if(typeof i.kind=="number"){n.kind=i.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:n.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:n.kind=1;break;case"SPAN_KIND_SERVER":case 2:n.kind=2;break;case"SPAN_KIND_CLIENT":case 3:n.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:n.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.endTimeUnixNano!=null&&(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano=="string"?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano=="number"?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano=="object"&&(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.events){if(!Array.isArray(i.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");n.events=[];for(var l=0;l<i.events.length;++l){if(typeof i.events[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&&(n.droppedEventsCount=i.droppedEventsCount>>>0),i.links){if(!Array.isArray(i.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");n.links=[];for(var l=0;l<i.links.length;++l){if(typeof i.links[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&&(n.droppedLinksCount=i.droppedLinksCount>>>0),i.status!=null){if(typeof i.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),l.traceState="",n.bytes===String?l.parentSpanId="":(l.parentSpanId=[],n.bytes!==Array&&(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name="",l.kind=n.enums===String?"SPAN_KIND_UNSPECIFIED":0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?"0":0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&&i.hasOwnProperty("traceState")&&(l.traceState=i.traceState),i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&&i.hasOwnProperty("name")&&(l.name=i.name),i.kind!=null&&i.hasOwnProperty("kind")&&(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&(typeof i.endTimeUnixNano=="number"?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber():i.endTimeUnixNano),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.events&&i.events.length){l.events=[];for(var u=0;u<i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&(l.droppedEventsCount=i.droppedEventsCount),i.links&&i.links.length){l.links=[];for(var u=0;u<i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&&i.hasOwnProperty("status")&&(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Span"},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]="SPAN_KIND_UNSPECIFIED"]=0,i[a[1]="SPAN_KIND_INTERNAL"]=1,i[a[2]="SPAN_KIND_SERVER"]=2,i[a[3]="SPAN_KIND_CLIENT"]=3,i[a[4]="SPAN_KIND_PRODUCER"]=4,i[a[5]="SPAN_KIND_CONSUMER"]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(18).string(n.name),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.name!=null&&(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.name="",c.droppedAttributesCount=0}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Event"},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(10).bytes(n.traceId),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(18).bytes(n.spanId),n.traceState!=null&&Object.hasOwnProperty.call(n,"traceState")&&l.uint32(26).string(n.traceState),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId)))return"traceId: buffer expected";if(n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId)))return"spanId: buffer expected";if(n.traceState!=null&&n.hasOwnProperty("traceState")&&!h.isString(n.traceState))return"traceState: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var l=0;l<n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return"attributes."+c}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceState!=null&&(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&&(l.droppedAttributesCount=n.droppedAttributesCount>>>0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults&&(l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),c.traceState="",c.droppedAttributesCount=0),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&&n.hasOwnProperty("traceState")&&(c.traceState=n.traceState),n.attributes&&n.attributes.length){c.attributes=[];for(var u=0;u<n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Link"},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&&Object.hasOwnProperty.call(i,"message")&&n.uint32(18).string(i.message),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos<l;){var u=i.uint32();switch(u>>>3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.message!=null&&i.hasOwnProperty("message")&&!h.isString(i.message))return"message: string expected";if(i.code!=null&&i.hasOwnProperty("code"))switch(i.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&&(n.message=String(i.message)),i.code){default:if(typeof i.code=="number"){n.code=i.code;break}break;case"STATUS_CODE_UNSET":case 0:n.code=0;break;case"STATUS_CODE_OK":case 1:n.code=1;break;case"STATUS_CODE_ERROR":case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&&(l.message="",l.code=n.enums===String?"STATUS_CODE_UNSET":0),i.message!=null&&i.hasOwnProperty("message")&&(l.message=i.message),i.code!=null&&i.hasOwnProperty("code")&&(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Status"},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]="STATUS_CODE_UNSET"]=0,i[a[1]="STATUS_CODE_OK"]=1,i[a[2]="STATUS_CODE_ERROR"]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&&n.resourceSpans.length)for(var c=0;c<n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceSpans&&u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceSpans!=null&&n.hasOwnProperty("resourceSpans")){if(!Array.isArray(n.resourceSpans))return"resourceSpans: array expected";for(var l=0;l<n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return"resourceSpans."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");l.resourceSpans=[];for(var c=0;c<n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceSpans=[]),n.resourceSpans&&n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u<n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&&Object.hasOwnProperty.call(n,"rejectedSpans")&&l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&!h.isInteger(n.rejectedSpans)&&!(n.rejectedSpans&&h.isInteger(n.rejectedSpans.low)&&h.isInteger(n.rejectedSpans.high))?"rejectedSpans: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&&(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans=="string"?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans=="number"?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans=="object"&&(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&(typeof n.rejectedSpans=="number"?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber():n.rejectedSpans),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&&n.resourceMetrics.length)for(var c=0;c<n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceMetrics&&u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceMetrics!=null&&n.hasOwnProperty("resourceMetrics")){if(!Array.isArray(n.resourceMetrics))return"resourceMetrics: array expected";for(var l=0;l<n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return"resourceMetrics."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");l.resourceMetrics=[];for(var c=0;c<n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceMetrics=[]),n.resourceMetrics&&n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u<n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&&Object.hasOwnProperty.call(n,"rejectedDataPoints")&&l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&!h.isInteger(n.rejectedDataPoints)&&!(n.rejectedDataPoints&&h.isInteger(n.rejectedDataPoints.low)&&h.isInteger(n.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&&(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints=="string"?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints=="number"?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints=="object"&&(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&(typeof n.rejectedDataPoints=="number"?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},"name",{value:"Export"}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&&n.resourceLogs.length)for(var c=0;c<n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.resourceLogs&&u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceLogs!=null&&n.hasOwnProperty("resourceLogs")){if(!Array.isArray(n.resourceLogs))return"resourceLogs: array expected";for(var l=0;l<n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return"resourceLogs."+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");l.resourceLogs=[];for(var c=0;c<n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceLogs=[]),n.resourceLogs&&n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u<n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return"partialSuccess."+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&&Object.hasOwnProperty.call(n,"rejectedLogRecords")&&l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&!h.isInteger(n.rejectedLogRecords)&&!(n.rejectedLogRecords&&h.isInteger(n.rejectedLogRecords.low)&&h.isInteger(n.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!h.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&&(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords=="string"?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords=="number"?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords=="object"&&(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber())),n.errorMessage!=null&&(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?"0":0;c.errorMessage=""}return n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&(typeof n.rejectedLogRecords=="number"?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&&i.resourceMetrics.length)for(var l=0;l<i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceMetrics&&c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceMetrics!=null&&i.hasOwnProperty("resourceMetrics")){if(!Array.isArray(i.resourceMetrics))return"resourceMetrics: array expected";for(var n=0;n<i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return"resourceMetrics."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");n.resourceMetrics=[];for(var l=0;l<i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceMetrics=[]),i.resourceMetrics&&i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c<i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.MetricsData"},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&&i.scopeMetrics.length)for(var l=0;l<i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&&c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeMetrics!=null&&i.hasOwnProperty("scopeMetrics")){if(!Array.isArray(i.scopeMetrics))return"scopeMetrics: array expected";for(var l=0;l<i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return"scopeMetrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");n.scopeMetrics=[];for(var l=0;l<i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeMetrics=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&&i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c<i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&&i.metrics.length)for(var l=0;l<i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&&c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.metrics!=null&&i.hasOwnProperty("metrics")){if(!Array.isArray(i.metrics))return"metrics: array expected";for(var l=0;l<i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return"metrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");n.metrics=[];for(var l=0;l<i.metrics.length;++l){if(typeof i.metrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.metrics=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&&i.metrics.length){l.metrics=[];for(var c=0;c<i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,"data",{get:h.oneOfGetter(a=["gauge","sum","histogram","exponentialHistogram","summary"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(10).string(n.name),n.description!=null&&Object.hasOwnProperty.call(n,"description")&&l.uint32(18).string(n.description),n.unit!=null&&Object.hasOwnProperty.call(n,"unit")&&l.uint32(26).string(n.unit),n.gauge!=null&&Object.hasOwnProperty.call(n,"gauge")&&d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&&Object.hasOwnProperty.call(n,"histogram")&&d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&&Object.hasOwnProperty.call(n,"exponentialHistogram")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&&Object.hasOwnProperty.call(n,"summary")&&d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.name!=null&&n.hasOwnProperty("name")&&!h.isString(n.name))return"name: string expected";if(n.description!=null&&n.hasOwnProperty("description")&&!h.isString(n.description))return"description: string expected";if(n.unit!=null&&n.hasOwnProperty("unit")&&!h.isString(n.unit))return"unit: string expected";if(n.gauge!=null&&n.hasOwnProperty("gauge")){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return"gauge."+c}}if(n.sum!=null&&n.hasOwnProperty("sum")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return"sum."+c}}if(n.histogram!=null&&n.hasOwnProperty("histogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return"histogram."+c}}if(n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return"exponentialHistogram."+c}}if(n.summary!=null&&n.hasOwnProperty("summary")){if(l.data===1)return"data: multiple values";l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return"summary."+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&&(l.name=String(n.name)),n.description!=null&&(l.description=String(n.description)),n.unit!=null&&(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.name="",c.description="",c.unit=""),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.description!=null&&n.hasOwnProperty("description")&&(c.description=n.description),n.unit!=null&&n.hasOwnProperty("unit")&&(c.unit=n.unit),n.gauge!=null&&n.hasOwnProperty("gauge")&&(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&&(c.data="gauge")),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&&(c.data="sum")),n.histogram!=null&&n.hasOwnProperty("histogram")&&(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&&(c.data="histogram")),n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")&&(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&&(c.data="exponentialHistogram")),n.summary!=null&&n.hasOwnProperty("summary")&&(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&&(c.data="summary")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Metric"},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Gauge"},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&&Object.hasOwnProperty.call(i,"isMonotonic")&&n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&typeof i.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&&(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,l.isMonotonic=!1),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Sum"},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Histogram"},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),n.defaults&&(l.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&&i.dataPoints.length)for(var l=0;l<i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.dataPoints&&c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return"dataPoints."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");n.dataPoints=[];for(var l=0;l<i.dataPoints.length;++l){if(typeof i.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.dataPoints=[]),i.dataPoints&&i.dataPoints.length){l.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Summary"},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,a[s[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,a[s[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,a[s[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(33).double(n.asDouble),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.bucketCounts!=null&&n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c<n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&&n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c<n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(89).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 9:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&&u.bucketCounts.length||(u.bucketCounts=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&&u.explicitBounds.length||(u.explicitBounds=[]),(f&7)===2)for(var _=n.uint32()+n.pos;n.pos<_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.bucketCounts!=null&&n.hasOwnProperty("bucketCounts")){if(!Array.isArray(n.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&&!(n.bucketCounts[c]&&h.isInteger(n.bucketCounts[c].low)&&h.isInteger(n.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}if(n.explicitBounds!=null&&n.hasOwnProperty("explicitBounds")){if(!Array.isArray(n.explicitBounds))return"explicitBounds: array expected";for(var c=0;c<n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!="number")return"explicitBounds: number[] expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags)?"flags: integer expected":n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");l.bucketCounts=[];for(var c=0;c<n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]=="string"?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]=="number"?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]=="object"&&(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low>>>0,n.bucketCounts[c].high>>>0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");l.explicitBounds=[];for(var c=0;c<n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&&(l.flags=n.flags>>>0),n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;c.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.bucketCounts&&n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f<n.bucketCounts.length;++f)typeof n.bucketCounts[f]=="number"?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low>>>0,n.bucketCounts[f].high>>>0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&&n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f<n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&&!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:h.oneOfGetter(a=["sum"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:h.oneOfGetter(a=["min"]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:h.oneOfGetter(a=["max"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&&n.attributes.length)for(var c=0;c<n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&l.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&l.uint32(41).double(n.sum),n.scale!=null&&Object.hasOwnProperty.call(n,"scale")&&l.uint32(48).sint32(n.scale),n.zeroCount!=null&&Object.hasOwnProperty.call(n,"zeroCount")&&l.uint32(57).fixed64(n.zeroCount),n.positive!=null&&Object.hasOwnProperty.call(n,"positive")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&&Object.hasOwnProperty.call(n,"negative")&&d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&l.uint32(80).uint32(n.flags),n.exemplars!=null&&n.exemplars.length)for(var c=0;c<n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&&Object.hasOwnProperty.call(n,"min")&&l.uint32(97).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&l.uint32(105).double(n.max),n.zeroThreshold!=null&&Object.hasOwnProperty.call(n,"zeroThreshold")&&l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&&u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&h.isInteger(n.startTimeUnixNano.low)&&h.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!h.isInteger(n.count)&&!(n.count&&h.isInteger(n.count.low)&&h.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(l._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.scale!=null&&n.hasOwnProperty("scale")&&!h.isInteger(n.scale))return"scale: integer expected";if(n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&!h.isInteger(n.zeroCount)&&!(n.zeroCount&&h.isInteger(n.zeroCount.low)&&h.isInteger(n.zeroCount.high)))return"zeroCount: integer|Long expected";if(n.positive!=null&&n.hasOwnProperty("positive")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return"positive."+u}if(n.negative!=null&&n.hasOwnProperty("negative")){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return"negative."+u}if(n.flags!=null&&n.hasOwnProperty("flags")&&!h.isInteger(n.flags))return"flags: integer expected";if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var c=0;c<n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return"exemplars."+u}}return n.min!=null&&n.hasOwnProperty("min")&&(l._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(l._max=1,typeof n.max!="number")?"max: number expected":n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&typeof n.zeroThreshold!="number"?"zeroThreshold: number expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<n.attributes.length;++c){if(typeof n.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&&(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?l.count=parseInt(n.count,10):typeof n.count=="number"?l.count=n.count:typeof n.count=="object"&&(l.count=new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(l.sum=Number(n.sum)),n.scale!=null&&(l.scale=n.scale|0),n.zeroCount!=null&&(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount=="string"?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount=="number"?l.zeroCount=n.zeroCount:typeof n.zeroCount=="object"&&(l.zeroCount=new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber())),n.positive!=null){if(typeof n.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&&(l.flags=n.flags>>>0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<n.exemplars.length;++c){if(typeof n.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&&(l.min=Number(n.min)),n.max!=null&&(l.max=Number(n.max)),n.zeroThreshold!=null&&(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?"0":0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?"0":0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&&n.attributes.length){c.attributes=[];for(var f=0;f<n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&&(c._sum="sum")),n.scale!=null&&n.hasOwnProperty("scale")&&(c.scale=n.scale),n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&(typeof n.zeroCount=="number"?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber():n.zeroCount),n.positive!=null&&n.hasOwnProperty("positive")&&(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&&n.hasOwnProperty("negative")&&(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&&n.hasOwnProperty("flags")&&(c.flags=n.flags),n.exemplars&&n.exemplars.length){c.exemplars=[];for(var f=0;f<n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&&n.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(n.min)?String(n.min):n.min,l.oneofs&&(c._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(n.max)?String(n.max):n.max,l.oneofs&&(c._max="max")),n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&(c.zeroThreshold=l.json&&!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c<l.length;++c)n[l[c]]!=null&&(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&&Object.hasOwnProperty.call(l,"offset")&&c.uint32(8).sint32(l.offset),l.bucketCounts!=null&&l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u<l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos<u;){var _=l.uint32();switch(_>>>3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&&f.bucketCounts.length||(f.bucketCounts=[]),(_&7)===2)for(var m=l.uint32()+l.pos;l.pos<m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!="object"||l===null)return"object expected";if(l.offset!=null&&l.hasOwnProperty("offset")&&!h.isInteger(l.offset))return"offset: integer expected";if(l.bucketCounts!=null&&l.hasOwnProperty("bucketCounts")){if(!Array.isArray(l.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&&!(l.bucketCounts[c]&&h.isInteger(l.bucketCounts[c].low)&&h.isInteger(l.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&&(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");c.bucketCounts=[];for(var u=0;u<l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]=="string"?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]=="number"?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]=="object"&&(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low>>>0,l.bucketCounts[u].high>>>0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.bucketCounts=[]),c.defaults&&(u.offset=0),l.offset!=null&&l.hasOwnProperty("offset")&&(u.offset=l.offset),l.bucketCounts&&l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f<l.bucketCounts.length;++f)typeof l.bucketCounts[f]=="number"?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low>>>0,l.bucketCounts[f].high>>>0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&&(l="type.googleapis.com"),l+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&&Object.hasOwnProperty.call(i,"count")&&n.uint32(33).fixed64(i.count),i.sum!=null&&Object.hasOwnProperty.call(i,"sum")&&n.uint32(41).double(i.sum),i.quantileValues!=null&&i.quantileValues.length)for(var l=0;l<i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos<l;){var u=i.uint32();switch(u>>>3){case 7:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&&c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return"attributes."+l}}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!h.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&h.isInteger(i.startTimeUnixNano.low)&&h.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.count!=null&&i.hasOwnProperty("count")&&!h.isInteger(i.count)&&!(i.count&&h.isInteger(i.count.low)&&h.isInteger(i.count.high)))return"count: integer|Long expected";if(i.sum!=null&&i.hasOwnProperty("sum")&&typeof i.sum!="number")return"sum: number expected";if(i.quantileValues!=null&&i.hasOwnProperty("quantileValues")){if(!Array.isArray(i.quantileValues))return"quantileValues: array expected";for(var n=0;n<i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return"quantileValues."+l}}return i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&&(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.count!=null&&(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count=="string"?n.count=parseInt(i.count,10):typeof i.count=="number"?n.count=i.count:typeof i.count=="object"&&(n.count=new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber())),i.sum!=null&&(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");n.quantileValues=[];for(var l=0;l<i.quantileValues.length;++l){if(typeof i.quantileValues[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&&(n.flags=i.flags>>>0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?"0":0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.count!=null&&i.hasOwnProperty("count")&&(typeof i.count=="number"?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber():i.count),i.sum!=null&&i.hasOwnProperty("sum")&&(l.sum=n.json&&!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&&i.quantileValues.length){l.quantileValues=[];for(var u=0;u<i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&&Object.hasOwnProperty.call(n,"quantile")&&l.uint32(9).double(n.quantile),n.value!=null&&Object.hasOwnProperty.call(n,"value")&&l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos<c;){var f=n.uint32();switch(f>>>3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.quantile!=null&&n.hasOwnProperty("quantile")&&typeof n.quantile!="number"?"quantile: number expected":n.value!=null&&n.hasOwnProperty("value")&&typeof n.value!="number"?"value: number expected":null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&&(l.quantile=Number(n.quantile)),n.value!=null&&(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&&(c.quantile=0,c.value=0),n.quantile!=null&&n.hasOwnProperty("quantile")&&(c.quantile=l.json&&!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&&n.hasOwnProperty("value")&&(c.value=l.json&&!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l<n.length;++l)i[n[l]]!=null&&(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,"value",{get:h.oneOfGetter(a=["asDouble","asInt"]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&l.uint32(25).double(n.asDouble),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&l.uint32(34).bytes(n.spanId),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&l.uint32(42).bytes(n.traceId),n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&&n.filteredAttributes.length)for(var c=0;c<n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos<c;){var f=n.uint32();switch(f>>>3){case 7:{u.filteredAttributes&&u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var l={};if(n.filteredAttributes!=null&&n.hasOwnProperty("filteredAttributes")){if(!Array.isArray(n.filteredAttributes))return"filteredAttributes: array expected";for(var c=0;c<n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return"filteredAttributes."+u}}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!h.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&h.isInteger(n.timeUnixNano.low)&&h.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(l.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!h.isInteger(n.asInt)&&!(n.asInt&&h.isInteger(n.asInt.low)&&h.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}return n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||h.isString(n.spanId))?"spanId: buffer expected":n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||h.isString(n.traceId))?"traceId: buffer expected":null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");l.filteredAttributes=[];for(var c=0;c<n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&&(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(l.asDouble=Number(n.asDouble)),n.asInt!=null&&(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?l.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?l.asInt=n.asInt:typeof n.asInt=="object"&&(l.asInt=new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.spanId!=null&&(typeof n.spanId=="string"?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length>=0&&(l.spanId=n.spanId)),n.traceId!=null&&(typeof n.traceId=="string"?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length>=0&&(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?"0":0;l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&&(c.value="asDouble")),n.spanId!=null&&n.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&&n.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,l.oneofs&&(c.value="asInt")),n.filteredAttributes&&n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f<n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Exemplar"},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&&i.resourceLogs.length)for(var l=0;l<i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resourceLogs&&c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceLogs!=null&&i.hasOwnProperty("resourceLogs")){if(!Array.isArray(i.resourceLogs))return"resourceLogs: array expected";for(var n=0;n<i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return"resourceLogs."+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");n.resourceLogs=[];for(var l=0;l<i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.resourceLogs=[]),i.resourceLogs&&i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c<i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogsData"},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&&i.scopeLogs.length)for(var l=0;l<i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&&c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeLogs!=null&&i.hasOwnProperty("scopeLogs")){if(!Array.isArray(i.scopeLogs))return"scopeLogs: array expected";for(var l=0;l<i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return"scopeLogs."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");n.scopeLogs=[];for(var l=0;l<i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.scopeLogs=[]),n.defaults&&(l.resource=null,l.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&&i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c<i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ResourceLogs"},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&&i.logRecords.length)for(var l=0;l<i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&&c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.logRecords!=null&&i.hasOwnProperty("logRecords")){if(!Array.isArray(i.logRecords))return"logRecords: array expected";for(var l=0;l<i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return"logRecords."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!h.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");n.logRecords=[];for(var l=0;l<i.logRecords.length;++l){if(typeof i.logRecords[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.logRecords=[]),n.defaults&&(l.scope=null,l.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&&i.logRecords.length){l.logRecords=[];for(var c=0;c<i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ScopeLogs"},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,a[s[1]="SEVERITY_NUMBER_TRACE"]=1,a[s[2]="SEVERITY_NUMBER_TRACE2"]=2,a[s[3]="SEVERITY_NUMBER_TRACE3"]=3,a[s[4]="SEVERITY_NUMBER_TRACE4"]=4,a[s[5]="SEVERITY_NUMBER_DEBUG"]=5,a[s[6]="SEVERITY_NUMBER_DEBUG2"]=6,a[s[7]="SEVERITY_NUMBER_DEBUG3"]=7,a[s[8]="SEVERITY_NUMBER_DEBUG4"]=8,a[s[9]="SEVERITY_NUMBER_INFO"]=9,a[s[10]="SEVERITY_NUMBER_INFO2"]=10,a[s[11]="SEVERITY_NUMBER_INFO3"]=11,a[s[12]="SEVERITY_NUMBER_INFO4"]=12,a[s[13]="SEVERITY_NUMBER_WARN"]=13,a[s[14]="SEVERITY_NUMBER_WARN2"]=14,a[s[15]="SEVERITY_NUMBER_WARN3"]=15,a[s[16]="SEVERITY_NUMBER_WARN4"]=16,a[s[17]="SEVERITY_NUMBER_ERROR"]=17,a[s[18]="SEVERITY_NUMBER_ERROR2"]=18,a[s[19]="SEVERITY_NUMBER_ERROR3"]=19,a[s[20]="SEVERITY_NUMBER_ERROR4"]=20,a[s[21]="SEVERITY_NUMBER_FATAL"]=21,a[s[22]="SEVERITY_NUMBER_FATAL2"]=22,a[s[23]="SEVERITY_NUMBER_FATAL3"]=23,a[s[24]="SEVERITY_NUMBER_FATAL4"]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,a[s[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&&Object.hasOwnProperty.call(i,"severityNumber")&&n.uint32(16).int32(i.severityNumber),i.severityText!=null&&Object.hasOwnProperty.call(i,"severityText")&&n.uint32(26).string(i.severityText),i.body!=null&&Object.hasOwnProperty.call(i,"body")&&d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&&i.attributes.length)for(var l=0;l<i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(69).fixed32(i.flags),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(74).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"observedTimeUnixNano")&&n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos<l;){var u=i.uint32();switch(u>>>3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&&c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!h.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&h.isInteger(i.timeUnixNano.low)&&h.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&!h.isInteger(i.observedTimeUnixNano)&&!(i.observedTimeUnixNano&&h.isInteger(i.observedTimeUnixNano.low)&&h.isInteger(i.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(i.severityNumber!=null&&i.hasOwnProperty("severityNumber"))switch(i.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&&i.hasOwnProperty("severityText")&&!h.isString(i.severityText))return"severityText: string expected";if(i.body!=null&&i.hasOwnProperty("body")){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return"body."+n}if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var l=0;l<i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return"attributes."+n}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!h.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":i.flags!=null&&i.hasOwnProperty("flags")&&!h.isInteger(i.flags)?"flags: integer expected":i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||h.isString(i.traceId))?"traceId: buffer expected":i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||h.isString(i.spanId))?"spanId: buffer expected":null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&&(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.observedTimeUnixNano!=null&&(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano=="string"?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano=="number"?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano=="object"&&(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber=="number"){n.severityNumber=i.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:n.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:n.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:n.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:n.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:n.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:n.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:n.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:n.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:n.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:n.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:n.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:n.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:n.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:n.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:n.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:n.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:n.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:n.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:n.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:n.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:n.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:n.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:n.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:n.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:n.severityNumber=24;break}if(i.severityText!=null&&(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");n.attributes=[];for(var l=0;l<i.attributes.length;++l){if(typeof i.attributes[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.flags!=null&&(n.flags=i.flags>>>0),i.traceId!=null&&(typeof i.traceId=="string"?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?"0":0;if(l.severityNumber=n.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,l.severityText="",l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId="":(l.traceId=[],n.bytes!==Array&&(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId="":(l.spanId=[],n.bytes!==Array&&(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?"0":0}if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.severityNumber!=null&&i.hasOwnProperty("severityNumber")&&(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&&i.hasOwnProperty("severityText")&&(l.severityText=i.severityText),i.body!=null&&i.hasOwnProperty("body")&&(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&&i.attributes.length){l.attributes=[];for(var u=0;u<i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&&i.hasOwnProperty("flags")&&(l.flags=i.flags),i.traceId!=null&&i.hasOwnProperty("traceId")&&(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&(typeof i.observedTimeUnixNano=="number"?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogRecord"},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=>{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=>{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=>gle.decode(r)},QG={serializeRequest:r=>{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=>yle.decode(r)},Rh={serializeRequest:r=>{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=>Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=>{_h();Eh();mh();Nh={serializeRequest:r=>{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=>{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=>{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=>fh,JsonLogsSerializer:()=>Ch,JsonMetricsSerializer:()=>e3,JsonTraceSerializer:()=>Nh,ProtobufLogsSerializer:()=>Ah,ProtobufMetricsSerializer:()=>QG,ProtobufTraceSerializer:()=>Rh,createExportLogsServiceRequest:()=>Xs,createExportMetricsServiceRequest:()=>$s,createExportTraceServiceRequest:()=>Ks,encodeAsLongBits:()=>uh,encodeAsString:()=>jg,getOtlpEncoder:()=>Kn,hrTimeToNanos:()=>ch,toLongBits:()=>qg});var to=p(()=>{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=>{r3="0.56.0"});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t>=0?t:0}}var s3=p(()=>{});var c3={};Ae(c3,{compressAndSend:()=>l3,createHttpAgent:()=>Ile,sendWithHttp:()=>Cle});import*as Ph from"http";import*as Ih from"https";import*as a3 from"zlib";import{Readable as Nle}from"stream";function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(".")[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:"POST",headers:lv({},r.headers()),agent:e},l=a.protocol==="http:"?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on("data",function(m){return _.push(m)}),f.on("end",function(){if(f.statusCode&&f.statusCode<299)o({status:"success",data:Buffer.concat(_)});else if(f.statusCode&&i3(f.statusCode))o({status:"retryable",retryInMillis:o3(f.headers["retry-after"])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:"failure",error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:"failure",error:new Error("Request Timeout")})}),c.on("error",function(f){o({status:"failure",error:f})});var u=i>=14?"close":"abort";c.on(u,function(){o({status:"failure",error:new Error("Request timed out")})}),l3(c,r.compression,t,function(f){o({status:"failure",error:f})})}function l3(r,e,t,o){var s=Ple(t);e==="gzip"&&(r.setHeader("Content-Encoding","gzip"),s=s.on("error",o).pipe(a3.createGzip()).on("error",o)),s.pipe(r).on("error",o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol==="http:"?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=>{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=>{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&&(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=>{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status==="retryable"&&i>0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&&o!==void 0?o:l,u=s-Date.now(),c>u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=>{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&&t!==""){var o=Number(t);if(!Number.isNaN(o)&&Number.isFinite(o)&&o>0)return o;S.warn("Configuration: "+r+" is invalid, expected number greater than 0 (actual: "+t+")")}}function Gle(r){var e=m3("OTEL_EXPORTER_OTLP_"+r+"_TIMEOUT"),t=m3("OTEL_EXPORTER_OTLP_TIMEOUT");return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==""){if(t==null||t==="none"||t==="gzip")return t;S.warn("Configuration: "+r+" is invalid, expected 'none' or 'gzip' (actual: '"+t+"')")}}function Hle(r){var e=T3("OTEL_EXPORTER_OTLP_"+r+"_COMPRESSION"),t=T3("OTEL_EXPORTER_OTLP_COMPRESSION");return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=>{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&&e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i<"u"?t[a]=String(i):S.warn('Header "'+a+'" has invalid value ('+i+") and will be ignored")}),t}}var qle,g3=p(()=>{P();qle=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&&Object.assign(s,e()),r!=null&&Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error("Configuration: Could not parse user-provided export URL: '"+r+"'")}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&&a!==void 0?a:e.agentOptions)!==null&&i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=>{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_HEADERS"])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&&Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}}function $le(r,e){try{new URL(r)}catch{S.warn("Configuration: Could not parse environment-provided export URL: '"+r+"', falling back to undefined");return}r.endsWith("/")||(r=r+"/"),r+=e;try{new URL(r)}catch{S.warn("Configuration: Provided URL appended with '"+e+"' is not a valid URL, using 'undefined' instead of '"+r+"'");return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return $le(t,r)}function Wle(r){var e,t=(e=process.env["OTEL_EXPORTER_OTLP_"+r+"_ENDPOINT"])===null||e===void 0?void 0:e.trim();if(!(t==null||t===""))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&&t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=>{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&&(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&&(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&&S.warn("Metadata cannot be set when using http"),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=>{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=>qr,createOtlpHttpExportDelegate:()=>Hr,getSharedConfigurationFromEnvironment:()=>bh});var Js=p(()=>{E3();cv();N3()});var Qs,P3=p(()=>{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${r3}`,"Content-Type":"application/json"}),Ch))}}});var I3=p(()=>{P3()});var b3=p(()=>{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=>Qs});var x3=p(()=>{b3()});var ue=T(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.NONE=3]="NONE"})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]="DEADLINE",r[r.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",r[r.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",r[r.CANCELLATION=8]="CANCELLATION",r[r.DEFAULTS=65535]="DEFAULTS"})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=>{Qle.exports={name:"@grpc/grpc-js",version:"1.13.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var Pe=T(Bt=>{"use strict";var fv,pv,dv,hv;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V("process"),ece=uv().version,tce={error:(r,...e)=>{console.error("E "+r,...e)},info:(r,...e)=>{console.error("I "+r,...e)},debug:(r,...e)=>{console.error("D "+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&&fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&&pv!==void 0?pv:"";switch(rce.toUpperCase()){case"DEBUG":Zs=Wn.LogVerbosity.DEBUG;break;case"INFO":Zs=Wn.LogVerbosity.INFO;break;case"ERROR":Zs=Wn.LogVerbosity.ERROR;break;case"NONE":Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=>no;Bt.getLogger=nce;var ice=r=>{no=r};Bt.setLogger=ice;var oce=r=>{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=>{let t;if(r>=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&&t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&&dv!==void 0?dv:process.env.GRPC_TRACE)!==null&&hv!==void 0?hv:"",_v=new Set,U3=new Set;for(let r of ace.split(","))r.startsWith("-")?U3.add(r.substring(1)):_v.add(r);var lce=_v.has("all");function cce(r,e,t){k3(e)&&(0,Bt.log)(r,new Date().toISOString()+" | v"+ece+" "+Zle.pid+" | "+e+" | "+t)}function k3(r){return!U3.has(r)&&(lce||_v.has(r))}});var Mh=T(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r=="object"&&r!==null&&"code"in r&&typeof r.code=="number"?r.code:null}});var ht=T(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith("-bin")}function Sce(r){return!r.startsWith("grpc-")}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error('Metadata key "'+r+'" contains illegal characters');if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Tce(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length>0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=>Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===":")continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=>{t.add(o,Buffer.from(a,"base64"))}):s!==void 0&&(Sce(o)?s.split(",").forEach(a=>{t.add(o,Buffer.from(a.trim(),"base64"))}):t.add(o,Buffer.from(s,"base64"))):Array.isArray(s)?s.forEach(a=>{t.add(o,a)}):s!==void 0&&t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=>Buffer.isBuffer(r)?r.toString("base64"):r});var kh=T(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return"getRequestHeaders"in r&&typeof r.getRequestHeaders=="function"}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=>{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=>{e.getRequestMetadata(t.service_url,(n,l)=>{if(n){i(n);return}if(!l){i(new Error("Headers not set by metadata plugin"));return}a(l)})}),s.then(a=>{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=>{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=>s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=>t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=>{this.metadataGenerator(e,(s,a)=>{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V("fs");gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&&(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith("[")){let e=r.indexOf("]");if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(":")===-1)return null;if(r.length>e+1)if(r[e+1]===":"){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(":");return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(":")?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e="";return r.scheme!==void 0&&(e+=r.scheme+":"),r.authority!==void 0&&(e+="//"+r.authority+"/"),e+=r.path,e}});var jr=T(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&&r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&&r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V("tls"),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&&!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,"Root certificate"),Rv(t,"Private key"),Rv(o,"Certificate chain"),t&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&o)throw new Error("Certificate chain must be given with accompanying private key");let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&&a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if("grpc.http_connect_target"in o){let f=(0,H3.parseUri)(o["grpc.http_connect_target"]);f&&(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&&s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&&(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=["h2"],o["grpc.ssl_target_name_override"]){let f=o["grpc.ssl_target_name_override"],_=(a=i.checkServerIdentity)!==null&&a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=>_(f,O),i.servername=f}else i.servername=u;return o["grpc-node.tls_enable_trace"]&&(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=>{let a=(0,vc.connect)(t,()=>{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&&i!==void 0)||i)&&!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on("error",i=>{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,"Failed to createSecureContext with error "+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=>{let o=this.parent.getLatestSecureContext();if(!o){t(new Error("Failed to load credentials"));return}r.closed&&t(new Error("Socket closed while loading credentials"));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=>{t(new Error("Socket closed"))},n=c=>{t(c)},l=(0,vc.connect)(a,()=>{var c;if(l.removeListener("close",i),l.removeListener("error",n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&&c!==void 0)||c)&&!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once("close",i),l.once("error",n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&&a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&&n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error("No default load balancer type registered");return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,"Config parsing failed with error",o.message);continue}return e&&Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V("os"),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce="node";function Xce(r){if("service"in r&&r.service!==""){if(typeof r.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if("method"in r&&r.method!==""){if(typeof r.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if("method"in r&&r.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function Wce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in r)||typeof r.initialBackoff!="string"||!Hh.test(r.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in r)||typeof r.maxBackoff!="string"||!Hh.test(r.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in r)||typeof r.backoffMultiplier!="number"||r.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in r&&Array.isArray(r.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(r.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of r.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Gh.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in r&&(typeof r.hedgingDelay!="string"||!Hh.test(r.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in r&&Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Gh.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&&(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&&(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!("name"in r)||!Array.isArray(r.name))throw new Error("Invalid method config: invalid name array");for(let o of r.name)t.name.push(Xce(o));if("waitForReady"in r){if(typeof r.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=r.waitForReady}if("timeout"in r)if(typeof r.timeout=="object"){if(!("seconds"in r.timeout)||typeof r.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in r.timeout)||typeof r.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=r.timeout}else if(typeof r.timeout=="string"&&Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(".");t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in r){if(typeof r.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=r.maxRequestBytes}if("maxResponseBytes"in r){if(typeof r.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=r.maxResponseBytes}if("retryPolicy"in r){if("hedgingPolicy"in r)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=Wce(r.retryPolicy)}else"hedgingPolicy"in r&&(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!("maxTokens"in r)||typeof r.maxTokens!="number"||r.maxTokens<=0||r.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in r)||typeof r.tokenRatio!="number"||r.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r=="object"&&r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in r)if(typeof r.loadBalancingPolicy=="string")e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in r&&Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));"retryThrottling"in r&&(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&&s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!("serviceConfig"in r))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:z3(r.serviceConfig)};if("clientLanguage"in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o=="string")e.clientLanguage.push(o);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o=="string")e.clientHostname.push(o);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in r)if(typeof r.percentage=="number"&&0<=r.percentage&&r.percentage<=100)e.percentage=r.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error("Invalid service config list");for(let t of r){let o=eue(t);if(!(typeof o.percentage=="number"&&e>o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&&(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&&(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error("No matching service config found")}function rue(r,e){for(let t of r)if(t.length>0&&t[0].startsWith("grpc_config=")){let o=t.join("").substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]="IDLE",r[r.CONNECTING=1]="CONNECTING",r[r.READY=2]="READY",r[r.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",r[r.SHUTDOWN=4]="SHUTDOWN"})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]="COMPLETE",r[r.QUEUE=1]="QUEUE",r[r.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",r[r.DROP=3]="DROP"})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:"No connection established",metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue="backoff",lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,"{"+this.id+"} "+e)}runTimer(e){var t,o;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue="child_load_balancer_helper",Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===o&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue="resolving_load_balancer";function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Cue(r,e,t,o){for(let s of t.name)switch(o){case"EMPTY":if(!s.service&&!s.method)return!0;break;case"SERVICE":if(s.service===r&&!s.method)return!0;break;case"SERVICE_AND_METHOD":if(s.service===r&&s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split("/").filter(l=>l.length>0),i=(o=a[0])!==null&&o!==void 0?o:"",n=(s=a[1])!==null&&s!==void 0?s:"";if(r&&r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?($3("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=>{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=>{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&&_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=>{this.handleResolutionFailure(n)}},o);let i={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Sue.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&&this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+" "+It.ConnectivityState[this.currentState]+" -> "+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&&(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&&(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s<t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V("net");function bc(r){return"port"in r}function Wh(r,e){return!r&&!e?!0:!r||!e?!1:bc(r)?bc(e)&&r.host===e.host&&r.port===e.port:!bc(e)&&r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t<r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return"["+r.addresses.map(Q3).join(", ")+"]"}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&&(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=>Hue});function na(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(t=0)),t;)try{if(o=1,s&&(a=c[0]&2?s.return:c[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,c[1])).done)return a;switch(s=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){t.label=c[1];break}if(c[0]===6&&t.label<a[1]){t.label=a[1],a=c;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(c);break}a[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError("Iterator access denied!")}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=>{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&&(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&&(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&&(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&&(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&&(t=function(a,i){return a<i?-1:a>i?1:0}),o===void 0&&(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)t=t.i;else if(a>0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a<0)s=t,t=t.i;else if(a>0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a<0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&&s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&&s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&&s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&&s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&&(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t=="number"?t:void 0,s=typeof t=="function"?t:void 0,a=typeof t>"u"?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&&a.push(n),s&&s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&&(t.t.h=o),t.i&&(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&&a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&&(t.t.h=s),t.i&&(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&&(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n>0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c<0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f>0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m<0&&(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O>0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O<0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s<0)t=t.i;else if(s>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&&ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)>0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)<0?(s.u=o,!0):!1:this.g(i,o)>=0||this.g(a,o)<=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&&ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&&t.next():(!s||o.t===void 0)&&t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&&ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&&ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&&ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&&(s+=t.t.O);t!==o;){var a=t.h;t===a.i&&(s+=1,a.t&&(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&ao();var t=this;return new Proxy([],{get:function(o,s){return s==="0"?t.C.u:s==="1"?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!=="1")throw new TypeError("prop must be 1");return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&&(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s<t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V("events"),Hv=V("stream"),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveStatus:(r,e)=>{e(r)}},Mc={start:(r,e,t)=>{t(r,e)},sendMessage:(r,e)=>{e(r)},halfClose:r=>{r()},cancel:r=>{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&&o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&&s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&&a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&&i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(u=>{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&&i!==void 0?i:(u=>{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&&l!==void 0?l:(u=>{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=>{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&&_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&&m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&&O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&&o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&&s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&&u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=>{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=>{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=>{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&&s!==void 0?s:(n=>{}),onReceiveMessage:n=>{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=>{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length>0&&r.clientInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(r.callInterceptors.length>0&&r.callInterceptorProviders.length>0)throw new wc("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];r.callInterceptors.length>0||r.callInterceptorProviders.length>0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=>n(e))).filter(n=>n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=>n(e))).filter(n=>n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=>c=>l(c,n),n=>Wue(o,n,e))(a)}});var Zv=T(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r=="function"}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||"no stack trace available"}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&&s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&&a!==void 0?a:[],delete o.interceptor_providers,this[oa].length>0&&this[sa].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=>{if(s){t(new Error("Failed to connect before the deadline"));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error("The channel has been closed"));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error("The channel has been closed"))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&&t instanceof Object&&Jv(o)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&&(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&&l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=>{m.emit("metadata",F)},onReceiveMessage(F){A!==null&&y.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit("status",F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=>{_.emit("metadata",M)},onReceiveMessage(M){y!==null&&O.cancelWithStatus(ei.Status.UNIMPLEMENTED,"Too many responses received"),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:"No message received",metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit("status",M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&&(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit("metadata",I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit("error",(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit("status",I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&&(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&&i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&&n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit("metadata",A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit("error",(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit("status",A)}}}),f}};t_.Client=Qv});var ry=T(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return["__proto__","prototype","constructor"].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=>{if(ty(s))return;let a=r[s],i;if(typeof s=="string"&&s.charAt(0)==="$")throw new Error("Method names cannot start with $");a.requestStream?a.responseStream?i="bidi":i="client_stream":a.responseStream?i="server_stream":i="unary";let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&&!ty(a.originalName)&&(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return"format"in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(".");if(s.some(n=>ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=>{var ife=1/0,ofe="[object Symbol]",sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_="\\ud800-\\udfff",mH="\\u0300-\\u036f\\ufe20-\\ufe23",TH="\\u20d0-\\u20f0",SH="\\u2700-\\u27bf",gH="a-z\\xdf-\\xf6\\xf8-\\xff",lfe="\\xac\\xb1\\xd7\\xf7",cfe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ufe="\\u2000-\\u206f",ffe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vH="A-Z\\xc0-\\xd6\\xd8-\\xde",yH="\\ufe0e\\ufe0f",OH=lfe+cfe+ufe+ffe,iy="['\u2019]",pfe="["+i_+"]",uH="["+OH+"]",n_="["+mH+TH+"]",AH="\\d+",dfe="["+SH+"]",RH="["+gH+"]",NH="[^"+i_+OH+AH+SH+gH+vH+"]",ny="\\ud83c[\\udffb-\\udfff]",hfe="(?:"+n_+"|"+ny+")",CH="[^"+i_+"]",oy="(?:\\ud83c[\\udde6-\\uddff]){2}",sy="[\\ud800-\\udbff][\\udc00-\\udfff]",la="["+vH+"]",PH="\\u200d",fH="(?:"+RH+"|"+NH+")",_fe="(?:"+la+"|"+NH+")",pH="(?:"+iy+"(?:d|ll|m|re|s|t|ve))?",dH="(?:"+iy+"(?:D|LL|M|RE|S|T|VE))?",IH=hfe+"?",bH="["+yH+"]?",Efe="(?:"+PH+"(?:"+[CH,oy,sy].join("|")+")"+bH+IH+")*",LH=bH+IH+Efe,mfe="(?:"+[dfe,oy,sy].join("|")+")"+LH,Tfe="(?:"+[CH+n_+"?",n_,oy,sy,pfe].join("|")+")",Sfe=RegExp(iy,"g"),gfe=RegExp(n_,"g"),vfe=RegExp(ny+"(?="+ny+")|"+Tfe+LH,"g"),yfe=RegExp([la+"?"+RH+"+"+pH+"(?="+[uH,la,"$"].join("|")+")",_fe+"+"+dH+"(?="+[uH,la+fH,"$"].join("|")+")",la+"?"+fH+"+"+pH,la+"+"+dH,AH,mfe].join("|"),"g"),Ofe=RegExp("["+PH+i_+mH+TH+yH+"]"),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Nfe=typeof global=="object"&&global&&global.Object===Object&&global,Cfe=typeof self=="object"&&self&&self.Object===Object&&self,Pfe=Nfe||Cfe||Function("return this")();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&&a&&(t=r[++s]);++s<a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split("")}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e<0&&(e=-e>s?0:s+e),t=t>s?s:t,t<0&&(t+=s),s=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(s);++o<s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r=="string")return r;if(zfe(r))return EH?EH.call(r):"";var e=r+"";return e=="0"&&1/r==-ife?"-0":e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&&t>=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(""):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,"")),r,"")}}function Yfe(r){return!!r&&typeof r=="object"}function zfe(r){return typeof r=="symbol"||Yfe(r)&&Vfe.call(r)==ofe}function o_(r){return r==null?"":Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&&r.replace(afe,Mfe).replace(gfe,"")}var Wfe=qfe("toUpperCase");function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=>{"use strict";DH.exports=ay;function ay(r,e){typeof r=="string"&&(e=r,r=void 0);var t=[];function o(a){if(typeof a!="string"){var i=s();if(ay.verbose&&console.log("codegen: "+i),i="return "+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u<n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_<f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case"d":case"f":return String(Number(A));case"i":return String(Math.floor(A));case"j":return JSON.stringify(A);case"s":return String(A)}return"%"}),_!==f.length)throw Error("parameter count mismatch");return t.push(a),o}function s(a){return"function "+(a||e||"")+"("+(r&&r.join(",")||"")+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=>{"use strict";kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe("fs");function Uc(r,e,t){return typeof e=="function"?(t=e,e={}):e||(e={}),t?!e.xhr&&ly&&ly.readFile?ly.readFile(r,function(s,a){return s&&typeof XMLHttpRequest<"u"?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString("utf8"))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&&s.status!==200)return o(Error("status "+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n<s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&255)}return o(null,typeof Uint8Array<"u"?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&&("overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.responseType="arraybuffer"),s.open("GET",e),s.send()}});var GH=T(FH=>{"use strict";var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),o=VH(e),s="";o&&(s=t.shift()+"/");for(var a=0;a<t.length;)t[a]===".."?a>0&&t[a-1]!==".."?t.splice(--a,2):o?t.splice(a,1):++a:t[a]==="."?t.splice(a,1):++a;return s+t.join("/")};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?cy(e+"/"+t):t)}});var ua=T((iFe,jH)=>{"use strict";jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className="Namespace";var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&&r.length){for(var t={},o=0;o<r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o<e.length;++o)if(typeof e[o]!="string"&&e[o][0]<=t&&e[o][1]>t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o<e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject(["options",this.options,"nested",HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s<o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&&this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof co)return this.nested[e].values;throw Error("no such enum: "+e)};pe.prototype.add=function(e){if(!(e instanceof fy&&e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&&e instanceof pe&&!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s<o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");for(var o=this;e.length>0;){var s=e.shift();if(o.nested&&o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error("path conflicts with non-namespace objects")}else o.add(o=new pe(s))}return t&&o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t=="boolean"?(o=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),a_.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var s=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+s];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&&(!t||t.indexOf(a.constructor)>-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&&(e=e.slice(1),s=o._lookupImpl(e,e.join(".")));else for(var a=0;a<this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&&(o=this._nestedArray[a]._lookupImpl(e,t))&&(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error("no such type: "+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=>{"use strict";YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className="MapField";var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError("keyType must be a string");this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o=="function"?o=kc.decorateType(o).name:o&&typeof o=="object"&&(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=>{"use strict";zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className="Method";var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&&(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError("type must be a string");if(!fa.isString(t))throw TypeError("requestType must be a string");if(!fa.isString(o))throw TypeError("responseType must be a string");dy.call(this,r,i),this.type=e||"rpc",this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=>{"use strict";$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className="Service";var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a<s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&&o.addJSON(t.nested),t.edition&&(o._edition=t.edition),o.comment=t.comment,o._defaultEdition="proto3",o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",Sn.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Object.defineProperty(Vt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a<this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[n]=Bc.codegen(["r","c"],Bc.isReserved(n)?n+"_":n)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=>{"use strict";XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=>{"use strict";JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return"missing required '"+r.name+"'"}function spe(r){for(var e=WH.codegen(["r","l","e"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(n){return n.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),t=0;t<r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?"int32":o.type,a="m"+WH.safeProp(o.name);e("case %i: {",o.id),o.map?(e("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),gn.defaults[o.keyType]!==void 0?e("k=%j",gn.defaults[o.keyType]):e("k=null"),gn.defaults[s]!==void 0?e("value=%j",gn.defaults[s]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),gn.basic[s]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",s),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),gn.long[o.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',a):e("%s[k]=value",a)):o.repeated?(e("if(!(%s&&%s.length))",a,a)("%s=[]",a),gn.packed[s]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,s)("}else"),gn.basic[s]===void 0?e(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",a,t):e("%s.push(r.%s())",a,s)):gn.basic[s]===void 0?e(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",a,t):e("%s=r.%s()",a,s),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&&e("if(!m.hasOwnProperty(%j))",i.name)("throw util.ProtocolError(%j,{instance:m})",ope(i))}return e("return m")}});var Ty=T((uFe,QH)=>{"use strict";QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+": "+e+(r.repeated&&e!=="array"?"[]":r.map&&e!=="object"?"{k:"+r.keyType+"}":"")+" expected"}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r("switch(%s){",o)("default:")("return%j",ir(e,"enum value"));for(var s=Object.keys(e.resolvedType.values),a=0;a<s.length;++a)r("case %i:",e.resolvedType.values[s[a]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",t,o)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",o)("return%j",ir(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",ir(e,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',o)("return%j",ir(e,"number"));break;case"bool":r('if(typeof %s!=="boolean")',o)("return%j",ir(e,"boolean"));break;case"string":r("if(!util.isString(%s))",o)("return%j",ir(e,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",ir(e,"buffer"));break}return r}function lpe(r,e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",t)("return%j",ir(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",t)("return%j",ir(e,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",t)("return%j",ir(e,"boolean key"));break}return r}function cpe(r){var e=Ey.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=r.oneofsArray,o={};t.length&&e("var p={}");for(var s=0;s<r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i="m"+Ey.safeProp(a.name);if(a.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",i,a.name),a.map)e("if(!util.isObject(%s))",i)("return%j",ir(a,"object"))("var k=Object.keys(%s)",i)("for(var i=0;i<k.length;++i){"),lpe(e,a,"k[i]"),my(e,a,s,i+"[k[i]]")("}");else if(a.repeated)e("if(!Array.isArray(%s))",i)("return%j",ir(a,"array"))("for(var i=0;i<%s.length;++i){",i),my(e,a,s,i+"[i]")("}");else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&&e("if(p%s===1)",n)("return%j",a.partOf.name+": multiple values"),o[a.partOf.name]=1,e("p%s=1",n)}my(e,a,s,i)}a.optional&&e("}")}return e("return null")}});var vy=T(eq=>{"use strict";var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r("switch(d%s){",o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]===e.typeDefault&&!s&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),e.repeated||r("break"),s=!0),r("case%j:",i[n])("case %i:",a[i[n]])("m%s=%j",o,a[i[n]])("break");r("}")}else r('if(typeof d%s!=="object")',o)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,t,o);else{var l=!1;switch(e.type){case"double":case"float":r("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",o,o);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,l)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,l?"true":"");break;case"bytes":r('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":r("m%s=String(d%s)",o,o);break;case"bool":r("m%s=Boolean(d%s)",o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return o("return new this.ctor");o("var m=new this.ctor");for(var s=0;s<t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o("if(d%s){",i)('if(typeof d%s!=="object")',i)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",i)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",i),Sy(o,a,s,i+"[ks[i]]")("}")("}")):a.repeated?(o("if(d%s){",i)("if(!Array.isArray(d%s))",i)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",i)("for(var i=0;i<d%s.length;++i){",i),Sy(o,a,s,i+"[i]")("}")("}")):(a.resolvedType instanceof Vc||o("if(d%s!=null){",i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o("}"))}return o("return m")};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,t,o,o,t,o,o):r("d%s=types[%i].toObject(m%s,o)",o,t,o);else{var s=!1;switch(e.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,s?"true":"",o);break;case"bytes":r("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:r("d%s=m%s",o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()("return {}");for(var o=$r.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),s=[],a=[],i=[],n=0;n<t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o("if(o.arrays||o.defaults){"),n=0;n<s.length;++n)o("d%s=[]",$r.safeProp(s[n].name));o("}")}if(a.length){for(o("if(o.objects||o.defaults){"),n=0;n<a.length;++n)o("d%s={}",$r.safeProp(a[n].name));o("}")}if(i.length){for(o("if(o.defaults){"),n=0;n<i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o("d%s=o.enums===String?%j:%j",c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",c,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else o("d%s=%j",c,l.typeDefault)}o("}")}var f=!1;for(n=0;n<t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),gy(o,l,_,c+"[ks2[j]]")("}")):l.repeated?(o("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),gy(o,l,_,c+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",c,l.name),gy(o,l,_,c),l.partOf&&o("if(o.oneofs)")("d%s=%j",$r.safeProp(l.partOf.name),l.name)),o("}")}return o("return d")}});var yy=T(tq=>{"use strict";var upe=tq,fpe=f_();upe[".google.protobuf.Any"]={fromObject:function(r){if(r&&r["@type"]){var e=r["@type"].substring(r["@type"].lastIndexOf("/")+1),t=this.lookup(e);if(t){var o=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return o.indexOf("/")===-1&&(o="/"+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t="type.googleapis.com/",o="",s="";if(e&&e.json&&r.type_url&&r.value){s=r.type_url.substring(r.type_url.lastIndexOf("/")+1),o=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var a=this.lookup(s);a&&(r=a.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return o===""&&(o=t),s=o+n,i["@type"]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=>{"use strict";nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className="Type";var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e<r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t<this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t<this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&&Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen(["p"],e.name),o=0,s;o<e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t("this%s={}",_t.safeProp(s.name)):s.repeated&&t("this%s=[]",_t.safeProp(s.name));return t("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a<s.length;++a)o.add((typeof t.fields[s[a]].keyType<"u"?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a<s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a<s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&&t.extensions.length&&(o.extensions=t.extensions),t.reserved&&t.reserved.length&&(o.reserved=t.reserved),t.group&&(o.group=!0),t.comment&&(o.comment=t.comment),t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",or.arrayToJSON(this.oneofsArray,e),"fields",or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o<e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o<t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof p_&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o<this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=>{"use strict";sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className="Root";var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,"",r),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t=="function"&&(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&&O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf("google/protobuf/");if(O>-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&&O.charAt(0)==="{"&&(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I<y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&&c(A);if(y.weakImports)for(I=0;I<y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&&c(A,!0)}}catch(M){i(M)}!a&&!u&&i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)>-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString("utf8")}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&&(e=[e]);for(var f=0,_;f<e.length;++f)(_=s.resolvePath("",e[f]))&&c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error("not supported");return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&&!e.extensionField&&(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t<this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o<e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&&(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&&(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&&delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o<e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=>{"use strict";var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire("fs");He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s<t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o<e.length;){var s=e[o++],a=e[o++];a!==void 0&&(t[s]=a)}return t};var vpe=/\\/g,ype=/"/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?'["'+e.replace(vpe,"\\\\").replace(ype,'\\"')+'"]':"."+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly("Enum"+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c==="__proto__"||c==="prototype")return i;if(n.length>0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&&s)return i;u&&(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!="object")throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),a(e,t,o)};Object.defineProperty(He,"decorateRoot",{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=>{"use strict";var Gc=cq,Rpe=rt(),Npe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Hc(r,e){var t=0,o={};for(e|=0;t<r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=>{"use strict";fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className="Field";var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&&(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Ke.isString(t))throw TypeError("type must be a string");if(o!==void 0&&!Cpe.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==void 0&&!Ke.isString(s))throw TypeError("extend must be a string");o==="proto3_optional"&&(o="optional"),this.rule=o&&o!=="optional"?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(nt.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(nt.prototype,"delimited",{get:function(){return this.resolvedType instanceof qc&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(nt.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(nt.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof uq&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof uq)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&&(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var t={};if(this.rule==="required"&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof qc&&o.group&&(t.message_encoding="DELIMITED")}return this.getOption("packed")===!0?t.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(t.repeated_field_encoding="EXPANDED"),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t=="function"?t=Ke.decorateType(t).name:t&&typeof t=="object"&&(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=>{"use strict";hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className="OneOf";var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e<r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o<this.oneof.length;++o){var s=e.get(this.oneof[o]);s&&!s.partOf&&(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t<this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&&o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&&r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=>{"use strict";_q.exports=ct;ct.className="ReflectionObject";var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},bpe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},Lpe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function ct(r,e){if(!Yc.isString(r))throw TypeError("name must be a string");if(e&&!Yc.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(".")}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&&t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&&t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&&(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")t=Object.assign({},bpe);else if(e==="proto3")t=Object.assign({},Lpe);else if(e==="2023")t=Object.assign({},Ipe);else throw new Error("Unknown edition: "+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s<o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=>{"use strict";mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className="Enum";var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n<i.length;++n)typeof e[i[n]]=="number"&&(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=>{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&&this.valuesOptions[t]&&this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&&(o._edition=t.edition),o._defaultEdition="proto3",o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError("name must be a string");if(!y_.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(t==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=>{"use strict";Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,o,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,o,(e.id<<3|2)>>>0)}function Mpe(r){for(var e=Dy.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t<s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?"int32":a.type,l=wy.basic[n];o="m"+Dy.safeProp(a.name),a.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",o,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",i,o):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,n,o),e("}")("}")):a.repeated?(e("if(%s!=null&&%s.length){",o,o),a.packed&&wy.packed[n]!==void 0?e("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",o)("w.%s(%s[i])",n,o)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",o),l===void 0?Tq(e,a,i,o+"[i]"):e("w.uint32(%i).%s(%s[i])",(a.id<<3|l)>>>0,n,o)),e("}")):(a.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",o,a.name),l===void 0?Tq(e,a,i,o):e("w.uint32(%i).%s(%s)",(a.id<<3|l)>>>0,n,o))}return e("return w")}});var vq=T((yFe,gq)=>{"use strict";var de=gq.exports=sv();de.build="light";function wpe(r,e,t){return typeof e=="function"?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=>{"use strict";Aq.exports=Oq;var Uy=/[\s{}=;:[\],'"()<>]/g,Upe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,kpe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:"\0",r:"\r",n:` `,t:" "};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case"\\":case"":return t;default:return qpe[t]||""}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error("illegal "+N+" (line "+s+")")}function u(){var N=l==="'"?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c("string");return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$<0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===" "||le===" ");for(var v=r.substring(N,z).split(Fpe),W=0;W<v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,"").trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z<o&&f(z)!==` `;)z++;return z}function y(){if(n.length>0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&&($=!0,++s),++t===o)return null;if(f(t)==="/"){if(++t===o)throw c("comment");if(f(t)==="/")if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&&(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)==="/";f(++t)!==` `;)if(t===o)return null;++t,te&&(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))==="*"){G=t+1,te=e||f(G)==="*";do{if(B===` `&&++s,++t===o)throw c("comment");z=B,B=f(t)}while(z!=="*"||B!=="/");++t,te&&(_(G,t-2,$),$=!0),N=!0}else return"/"}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le<o&&!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W==='"'||W==="'")&&(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c("token '"+B+"', '"+N+"' expected");return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&&(e||B.type==="*"||B.lineEmpty)&&(z=B.leading?B.text:null)):(a<N&&I(),B=i[N],delete i[N],B&&!B.lineEmpty&&(e||B.type==="/")&&(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},"line",{get:function(){return s}})}});var bq=T((AFe,Iq)=>{"use strict";Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O="proto2",y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=>{L._edition=O,Object.keys(I).forEach(b=>{L.getOption(b)===void 0&&L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error("illegal "+(b||"token")+" '"+L+"' ("+(j?j+", ":"")+"line "+s.line+")")}function z(){var L=[],b;do{if((b=a())!=='"'&&b!=="'")throw N(b);L.push(a()),l(b),b=n()}while(b==='"'||b==="'");return L.join("")}function B(L){var b=a();switch(b){case"'":case'"':return i(b),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return te(b,!0)}catch{if(L&&Wr.test(b))return b;throw N(b,"value")}}function G(L,b){var x,j;do if(b&&((x=n())==='"'||x==="'")){var q=z();if(L.push(q),O>=2023)throw N(q,"id")}else try{L.push([j=$(a()),l("to",!0)?$(a()):j])}catch(Le){if(b&&Wr.test(x)&&O>=2023)L.push(x);else throw Le}while(l(",",!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&&(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut==="option")Z(ne,ut),l(";");else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)==="-"&&(x=-1,L=L.substring(1)),L){case"inf":case"INF":case"Inf":return x*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,"number",b)}function $(L,b){switch(L){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!b&&L.charAt(0)==="-")throw N(L,"id");if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,"id")}function le(){if(f!==void 0)throw N("package");if(f=a(),!Wr.test(f))throw N(f,"name");y=y.define(f),l(";")}function v(){var L=n(),b;switch(L){case"weak":b=m||(m=[]),a();break;case"public":a();default:b=_||(_=[]);break}L=z(),l(";"),b.push(L)}function W(){if(l("="),O=z(),O<2023)throw N(O,"syntax");l(";")}function R(){if(l("="),O=z(),!["2023"].includes(O))throw N(O,"edition");l(";")}function E(L,b){switch(b){case"option":return Z(L,b),l(";"),!0;case"message":return Q(L,b),!0;case"enum":return Me(L,b),!0;case"service":return wo(L,b),!0;case"extend":return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&&(typeof L.comment!="string"&&(L.comment=c()),L.filename=vn.filename),l("{",!0)){for(var q;(q=a())!=="}";)b(q);l(";",!0)}else x&&x(),l(";"),L&&(typeof L.comment!="string"||o)&&(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,"type name");var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case"map":ce(x,q);break;case"required":if(O!=="proto2")throw N(q);case"repeated":Y(x,q);break;case"optional":if(O==="proto3")Y(x,"proto3_optional");else{if(O!=="proto2")throw N(q);Y(x,"optional")}break;case"oneof":Ne(x,q);break;case"extensions":G(x.extensions||(x.extensions=[]));break;case"reserved":G(x.reserved||(x.reserved=[]),!0);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(x,"optional");break}}),L.add(x),L===y&&A.push(x)}function Y(L,b,x){var j=a();if(j==="group"){J(L,b);return}for(;j.endsWith(".")||n().startsWith(".");)j+=a();if(!Wr.test(j))throw N(j,"type");var q=a();if(!Xr.test(q))throw N(q,"name");q=M(q),l("=");var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et==="option")Z(ne,Et),l(";");else throw N(Et)},function(){We(ne)}),b==="proto3_optional"){var Le=new Pq("_"+q);ne.setOption("proto3_optional",!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&&A.push(ne)}function J(L,b){if(O>=2023)throw N("group");var x=a();if(!Xr.test(x))throw N(x,"name");var j=By.lcFirst(x);x===j&&(x=By.ucFirst(x)),l("=");var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case"option":Z(ne,Et),l(";");break;case"required":case"repeated":Y(ne,Et);break;case"optional":O==="proto3"?Y(ne,"proto3_optional"):Y(ne,"optional");break;case"message":Q(ne,Et);break;case"enum":Me(ne,Et);break;case"reserved":G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l("<");var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,"type");l(",");var x=a();if(!Wr.test(x))throw N(x,"type");l(">");var j=a();if(!Xr.test(j))throw N(j,"name");l("=");var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le==="option")Z(q,Le),l(";");else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new Pq(M(b));C(x,function(q){q==="option"?(Z(x,q),l(";")):(i(q),Y(x,"optional"))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,"name");var x=new zpe(b);C(x,function(q){switch(q){case"option":Z(x,q),l(";");break;case"reserved":G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&&(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&&A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,"name");l("=");var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne==="option")Z(j,ne),l(";");else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b==="option"&&(b=a());b!=="=";){if(b==="("){var ne=a();l(")"),b="("+ne+")"}if(q){if(q=!1,b.includes(".")&&!b.includes("(")){var Le=b.split(".");x=Le[0]+".",b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&&j[0]==="."?j.slice(1):j,x=x&&x[x.length-1]==="."?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l("{",!0)){for(var x={};!l("}",!0);){if(!Xr.test(Ye=a()))throw N(Ye,"name");if(Ye===null)throw N(Ye,"end of input");var j,q=Ye;if(l(":",!0),n()==="{")j=je(L,b+"."+Ye);else if(n()==="["){j=[];var ne;if(l("[",!0)){do ne=B(!0),j.push(ne);while(l(",",!0));l("]"),typeof ne<"u"&&me(L,b+"."+Ye,ne)}}else j=B(!0),me(L,b+"."+Ye,j);var Le=x[q];Le&&(j=[].concat(Le).concat(j)),x[q]=j,l(",",!0),l(";",!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&&/^features\./.test(b)){I[b]=x;return}L.setOption&&L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&&L.setParsedOption(b,x,j)}function We(L){if(l("[",!0)){do Z(L,"option");while(l(",",!0));l("]")}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,"service name");var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q==="rpc")Do(x,q);else throw N(q)}),L.add(x),L===y&&A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,"name");var q=b,ne,Le,ut,Et;if(l("("),l("stream",!0)&&(Le=!0),!Wr.test(b=a())||(ne=b,l(")"),l("returns"),l("("),l("stream",!0)&&(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(")");var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm==="option")Z(Lu,dm),l(";");else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,"reference");var x=b;C(null,function(q){switch(q){case"required":case"repeated":Y(L,q,x);break;case"optional":O==="proto3"?Y(L,"proto3_optional",x):Y(L,"optional",x);break;default:if(O==="proto2"||!Wr.test(q))throw N(q);i(q),Y(L,"optional",x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case"package":if(!u)throw N(Ye);le();break;case"import":if(!u)throw N(Ye);v();break;case"syntax":if(!u)throw N(Ye);W();break;case"edition":if(!u)throw N(Ye);R();break;case"option":Z(y,Ye),l(";",!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=>{"use strict";xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r="google/protobuf/"+r+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Lq;Nr("duration",{Duration:Lq={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Nr("timestamp",{Timestamp:Lq});Nr("empty",{Empty:{fields:{}}});Nr("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});Nr("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});Nr("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=>{"use strict";var ii=wq.exports=vq();ii.build="full";ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=>{"use strict";Uq.exports=Dq()});var Vy=T((PFe,ode)=>{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],"php_generic_services",[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=>{"use strict";var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(".google.protobuf");var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length=="number"&&(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a<e.file.length;++a){s=t,(o=e.file[a]).package&&o.package.length&&(s=t.define(o.package));var n=Ede(o);if(o.name&&o.name.length&&t.files.push(s.filename=o.name),o.messageType)for(i=0;i<o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i<o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i<o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i<o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i<c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s<r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&&Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&&e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:"Type"+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a<e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a<e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty("oneofIndex")&&s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a<e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a<e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&&e.nestedType[a].options.mapEntry&&s.setOption("map_entry",!0);if(e.enumType)for(a=0;a<e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&&e.extensionRange.length)for(s.extensions=[],a=0;a<e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a<e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a<e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o<this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&&Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:"key",number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:"value",number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o<this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&&t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o<this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o<this.reserved.length;++o)typeof this.reserved[o]=="string"?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length=="number"&&(e=ae.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var s;e.typeName&&e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a="required";break;case 3:a="repeated";break;default:throw Error("illegal label: "+e.label)}var i=e.extendee;e.extendee!==void 0&&(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:"field"+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&&(n.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var c=lde.exec(l);c&&(l=parseInt(l));break}n.setOption("default",l)}return hde(e.type)&&(t==="proto3"?e.options&&!e.options.packed&&n.setOption("packed",!1):(!t||t==="proto2")&&e.options&&e.options.packed&&n.setOption("packed",!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?t.label=3:this.required&&e==="proto2"?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&&(t.defaultValue=String(this.options.default)),this.options.proto3_optional&&(t.proto3_optional=!0)),e==="proto3"?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a<e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&&i.length?i:"NAME"+n]=n}var l=new yn(e.name&&e.name.length?e.name:"Enum"+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t<o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&&e.name.length?e.name:"oneof"+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length=="number"&&(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&&e.name.length?e.name:"Service"+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a<e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t<this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&&e.name.length?e.name:"Method"+pde++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error("illegal type: "+r)}function Vq(r,e){for(var t={},o=0,s,a;o<e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&&!Array.isArray(t[i])&&(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split("."),o=e.fullName.split("."),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&&e instanceof kq)for(;s<t.length&&a<i&&t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&&n!==e)break;++a}else for(;s<t.length&&a<i&&t[s]===o[a];++s,++a);return o.slice(a).join(".")}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function Ede(r){if(r.syntax==="editions")switch(r.edition){case ae.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+r.edition)}return r.syntax==="proto3"?"proto3":"proto2"}function mde(r,e){if(r)if(r==="proto2"||r==="proto3")e.syntax=r;else switch(e.syntax="editions",r){case"2023":e.edition=ae.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+r)}}});var jq=T((IFe,Tde)=>{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=>{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zq=T((LFe,gde)=>{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Wq=T(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V("fs"),$q=V("path"),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=>{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common("api",r.nested.google.nested.protobuf.nested),ha.common("descriptor",e.nested.google.nested.protobuf.nested),ha.common("source_context",t.nested.google.nested.protobuf.nested),ha.common("type",o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=>{(function(r,e){function t(o){return o.default||o}typeof define=="function"&&define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c=="object"?(e($c),typeof Gy=="object"&&(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:$c,function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function o(R){return(R&&R.__isLong__)===!0}function s(R){var E=Math.clz32(R&-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R>>>=0,(Y=0<=R&&R<256)&&(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&&(i[R]=C),C)):(R|=0,(Y=-128<=R&&R<128)&&(Q=a[R],Q)?Q:(C=c(R,R<0?-1:0,!1),Y&&(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R<0)return N;if(R>=A)return $}else{if(R<=-I)return le;if(R+1>=I)return te}return R<0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error("empty string");if(typeof E=="number"?(C=E,E=!1):E=!!E,R==="NaN"||R==="Infinity"||R==="+Infinity"||R==="-Infinity")return E?N:F;if(C=C||10,C<2||36<C)throw RangeError("radix");var Q;if((Q=R.indexOf("-"))>0)throw Error("interior hyphen");if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce<R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne<8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R=="number"?l(R,E):typeof R=="string"?f(R,E):c(R.low,R.high,typeof E=="boolean"?E:R.unsigned)}t.fromValue=_;var m=65536,O=1<<24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},v.toString=function(E){if(E=E||10,E<2||36<E)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return"-"+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne="";;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()>>>0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length<6;)Z="0"+Z;Ne=""+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C>0&&(E&1<<C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high>>21;return E?this.unsigned?!1:E===-1&&!(this.low===0&&this.high===-2097152):!0},v.isZero=function(){return this.high===0&&this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(this.low&1)===1},v.isEven=function(){return(this.low&1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&&this.high>>>31===1&&E.high>>>31===1?!1:this.high===E.high&&this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&&!Q?-1:!C&&Q?1:this.unsigned?E.high>>>0>this.high>>>0||E.high===this.high&&E.low>>>0>this.low>>>0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high>>>16,Q=this.high&65535,Y=this.low>>>16,J=this.low&65535,ce=E.high>>>16,Ne=E.high&65535,Me=E.low>>>16,Te=E.low&65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we>>>16,we&=65535,me+=Y+Me,je+=me>>>16,me&=65535,je+=Q+Ne,Z+=je>>>16,je&=65535,Z+=C+ce,Z&=65535,c(me<<16|we,Z<<16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&&E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high>>>16,Y=this.high&65535,J=this.low>>>16,ce=this.low&65535,Ne=E.high>>>16,Me=E.high&65535,Te=E.low>>>16,Z=E.low&65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We>>>16,We&=65535,we+=J*Z,me+=we>>>16,we&=65535,we+=ce*Te,me+=we>>>16,we&=65535,me+=Y*Z,je+=me>>>16,me&=65535,me+=J*Te,je+=me>>>16,me&=65535,me+=ce*Me,je+=me>>>16,me&=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&=65535,c(we<<16|We,je<<16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&E.low===-1&&E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne<=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&&(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&E.low,this.high&E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low<<E,this.high<<E|this.low>>>32-E,this.unsigned):c(0,this.low<<E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>E,this.unsigned):c(this.high>>E-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&&(E=E.toInt()),(E&=63)===0?this:E<32?c(this.low>>>E|this.high<<32-E,this.high>>>E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high>>>E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.low<<E|this.high>>>C,this.high<<E|this.low>>>C,this.unsigned)):(E-=32,C=32-E,c(this.high<<E|this.low>>>C,this.low<<E|this.high>>>C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&&(E=E.toInt()),(E&=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E<32?(C=32-E,c(this.high<<C|this.low>>>E,this.low<<C|this.high>>>E,this.unsigned)):(E-=32,C=32-E,c(this.low<<C|this.high>>>E,this.high<<C|this.low>>>E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&255,C>>>8&255,C>>>16&255,C>>>24,E&255,E>>>8&255,E>>>16&255,E>>>24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E>>>24,E>>>16&255,E>>>8&255,E&255,C>>>24,C>>>16&255,C>>>8&255,C&255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]<<8|E[2]<<16|E[3]<<24,E[4]|E[5]<<8|E[6]<<16|E[7]<<24,C)},t.fromBytesBE=function(E,C){return new t(E[4]<<24|E[5]<<16|E[6]<<8|E[7],E[0]<<24|E[1]<<16|E[2]<<8|E[3],C)},typeof BigInt=="function"&&(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E>>BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E=="bigint"?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low>>>0),C=BigInt(this.unsigned?this.high>>>0:this.high);return C<<BigInt(32)|E});var W=r.default=t})});var ij=T(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return"@type"in r&&typeof r["@type"]=="string"}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",r.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",r.IDEMPOTENT="IDEMPOTENT"})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===""?e:r+"."+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&&typeof r.nested<"u"?Object.keys(r.nested).map(o=>rj(r.nested[o],t)).reduce((o,s)=>o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=>{for(let[o,s]of Object.entries(t))switch(o){case"uninterpreted_option":e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:"/"+e+"/"+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error("Type mismatch in reflection object handling")}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor("proto3").file.map(a=>Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,""))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=>N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V("net"),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)==="channel"?o:void 0,childSubchannel:(o==null?void 0:o.kind)==="subchannel"?o:void 0}),this.events.length>=oj*2&&(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&&(o.count-=1,o.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=>{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=>{let n=t(),l={id:n,name:s,kind:r};return i&&o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_("channel");Ie.registerChannelzSubchannel=x_("subchannel");Ie.registerChannelzServer=x_("server");Ie.registerChannelzSocket=x_("socket");function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r==="")return[];let e=r.split(":").map(o=>Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&&r.toLowerCase().startsWith("::ffff:")&&(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(".").map(e=>Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf("::");o===-1?(e=r,t=""):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Xc.ConnectivityState.IDLE:return{state:"IDLE"};case Xc.ConnectivityState.READY:return{state:"READY"};case Xc.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=>{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=>{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No channel data found for id "+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&&o.length<t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=>{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&&a.length<t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No subchannel data found for id "+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=>{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:"tcpip_address",tcpip_address:{ip_address:(e=Kde(r.host))!==null&&e!==void 0?e:void 0,port:r.port}}:{address:"uds_address",uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:"No socket data found for id "+n});return}let c=l.getInfo(),u=c.security?{model:"tls",tls:{cipher_suite:c.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(t=c.security.cipherSuiteStandardName)!==null&&t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&&o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&&s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&&a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&&i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:"No server data found for id "+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&&l.length<a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe="subchannel",she=~(1<<31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new rhe.BackoffTimeout(()=>{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o["grpc.keepalive_time_ms"])!==null&&i!==void 0?i:-1,o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=>{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&&this.keepaliveTime>0&&(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=>{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]+' with error "'+o+'"'):this.trace(ye.ConnectivityState[this.connectivityState]+" -> "+ye.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=>{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=>{"use strict";var eO;Object.defineProperty(D_,"__esModule",{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&eO!==void 0?eO:"false")==="true"});var oO=T(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V("dns"),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V("net"),uhe=Nc(),Tj=_j(),fhe="dns_resolver";function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn("Resolver constructed for target "+(0,ai.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&&s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&&a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoff=new uhe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o["grpc.dns_min_time_between_resolutions_ms"])!==null&&i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn("Returning IP address for target "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn("Failed to parse DNS address "+(0,ai.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=>({addresses:[s]}));let o="["+t.map(s=>s.host+":"+s.port).join(",")+"]";if(tn("Resolved addresses for target "+(0,ai.uriToString)(this.target)+": "+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=>{this.pendingLookupPromise!==null&&(tn("Resolution error for target "+(0,ai.uriToString)(this.target)+": "+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=>{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn("Using alternative DNS resolver.");let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=>s.status==="rejected"))throw new Error(o[0].reason);return o.reduce((s,a)=>a.status==="fulfilled"?[...s,...a.value]:s,[]).map(s=>({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=>({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn('resolution update delayed by "min time between resolutions" rate limit'):tn("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)("dns",iO),(0,Ej.registerDefaultScheme)("dns")}});var sO=T(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V("net"),hhe=V("http"),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V("url"),mhe=oO(),The="proxy";function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r="",e="";if(process.env.grpc_proxy)e="grpc_proxy",r=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",r=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(t.protocol!=="http:")return(0,Jc.log)(_a.LogVerbosity.ERROR,`"${t.protocol}" scheme not supported in proxy URI`),{};let o=null;t.username&&(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,"userinfo found in proxy URI"),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===""&&(a="80");let i={address:`${s}:${a}`};return o&&(i.creds=o),Ea("Proxy server "+i.address+" set by environment variable "+e),i}function ghe(){let r=process.env.no_grpc_proxy,e="no_grpc_proxy";return r||(r=process.env.no_proxy,e="no_proxy"),r?(Ea("No proxy server list set by environment variable "+e),r.split(",")):[]}function vj(r){let e=r.split("/");if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t<0||t>32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1<<32-r.prefixLength;return(yj(e)&o)===(t&o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&&t&&vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e["grpc.enable_http_proxy"])!==null&&t!==void 0?t:1)===0||r.scheme==="unix")return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea("Not using proxy for target in no_proxy list: "+(0,Qc.uriToString)(r)),o;let n={"grpc.http_connect_target":(0,Qc.uriToString)(r)};return s.creds&&(n["grpc.http_connect_creds"]=s.creds),{target:{scheme:"dns",path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let o=e["grpc.http_connect_target"],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&&t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:"CONNECT",path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,"grpc.http_connect_creds"in e&&(l["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea("Using proxy "+c+" to connect to "+n.path),new Promise((u,f)=>{let _=hhe.request(n);_.once("connect",(m,O,y)=>{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea("Successfully connected to "+n.path+" through proxy "+c),y.length>0&&O.unshift(y),Ea("Successfully established a plaintext connection to "+n.path+" through proxy "+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to "+n.path+" through proxy "+c+" with status "+m.statusCode),f())}),_.once("error",m=>{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,"Failed to connect to proxy "+c+" with error "+m.message),f()}),_.end()})}});var lO=T(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]="NO_DATA",r[r.READING_SIZE=1]="READING_SIZE",r[r.READING_MESSAGE=2]="READING_MESSAGE"})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t<e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error("Unexpected read state")}return s}};U_.StreamDecoder=aO});var Oj=T(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});k_.Http2SubchannelCall=void 0;var An=V("http2"),Rhe=V("os"),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe="subchannel_call";function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return"Unknown system error "+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()["grpc.max_receive_message_length"])!==null&&i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on("response",(l,c)=>{let u="";for(let f of Object.keys(l))u+=" "+f+": "+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[":status"],c&An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on("trailers",l=>{this.handleTrailers(l)}),e.on("data",l=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var l;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u="";switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u="Stream refused by server";break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u="Connection dropped"):(c=Oe.Status.CANCELLED,u="Call cancelled");break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on("error",l=>{l.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+l.message+" code="+l.code+" errno="+bhe(l.errno)+" syscall="+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:Oe.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t="";for(let i of Object.keys(e))t+=" "+i+": "+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s["grpc-status"]=="string"){let i=Number(s["grpc-status"]);this.trace("received status code "+i+" from server"),o.remove("grpc-status");let n="";if(typeof s["grpc-message"]=="string"){try{n=decodeURI(s["grpc-message"])}catch{n=s["grpc-message"]}o.remove("grpc-message"),this.trace('received status details string "'+n+'" from server')}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:"No status information received",metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);let o=s=>{process.nextTick(()=>{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)==="ERR_STREAM_WRITE_AFTER_END"&&(i=Oe.Status.INTERNAL),s&&this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=>{"use strict";Object.defineProperty(fO,"__esModule",{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V("http2"),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V("net"),Uhe=Oj(),khe=pO(),hO="transport",Bhe="transport_flowctrl",Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from("too_many_pings","ascii"),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o["grpc.primary_user_agent"],`grpc-node-js/${Vhe}`,o["grpc.secondary_user_agent"]].filter(a=>a).join(" "),"grpc.keepalive_time_ms"in o?this.keepaliveTimeMs=o["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in o?this.keepaliveTimeoutMs=o["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=zhe,"grpc.keepalive_permit_without_calls"in o?this.keepaliveWithoutCalls=o["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(a,i,n)=>{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(Khe)&&(l=!0),this.trace("connection closed by GOAWAY with code "+a+" and data "+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once("error",a=>{this.trace("connection closed with error "+a.message),this.handleDisconnect()}),e.socket.once("close",a=>{this.trace("connection closed. hadError="+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&&(e.on("remoteSettings",a=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))}),e.on("localSettings",a=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&&"raw"in f?f.raw:null,remoteCertificate:_&&"raw"in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&&t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&&o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o="";try{this.session.ping((a,i,n)=>{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace("Ping failed with error "+a.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(o="Ping returned false")}catch(s){o=(s instanceof Error?s.message:"")||"Unknown error"}o&&(this.keepaliveTrace("Ping send failed: "+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]="application/grpc",i[Hhe]="POST",i[qhe]=o,i[jhe]="trailers";let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=>{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=>{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=>{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=>{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+" "+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((s,a)=>{let i=null,n=this.channelTarget;if("grpc.http_connect_target"in o){let A=(0,dO.parseUri)(o["grpc.http_connect_target"]);A&&(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?"https":"http",c=(0,whe.getDefaultAuthority)(n),u=()=>{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=>{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace("connection failed with error "+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=>e.socket};o["grpc-node.flow_control_window"]!==void 0&&(_.settings={initialWindowSize:o["grpc-node.flow_control_window"]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O="Failed to connect",y=!1;m.unref(),m.once("remoteSettings",()=>{m.removeAllListeners(),e.socket.removeListener("close",u),e.socket.removeListener("error",f),s(new _O(m,t,o,i)),this.session=null}),m.once("close",u),m.once("error",f),e.socket.once("close",u),e.socket.once("error",f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=>o||new Promise((s,a)=>{let i=()=>{a(new Error("Socket closed"))},n=c=>{a(c)},l=Dhe.connect(e,()=>{l.removeListener("close",i),l.removeListener("error",n),s(l)});l.once("close",i),l.once("error",n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+" Waiting for secureConnector to be ready"),await t.waitForReady(),this.trace(i+" secureConnector is ready"),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+" Established TCP connection"),a=await t.connect(s),this.trace(i+" Established secure connection"),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=>!a.subchannel.unrefIfOneRef());s.length>0&&(e=!1),this.pool[t]=s}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&&(0,$he.channelOptionsEqual)(o,l.channelArguments)&&s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o<this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o>=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=>e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]="identity",r[r.deflate=1]="deflate",r[r.gzip=2]="gzip"})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V("zlib"),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=>typeof r=="number"&&typeof Pj.CompressionAlgorithms[r]=="string",ga=class{async writeMessage(e,t){let o=e;t&&(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&&(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.deflate(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createInflate();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=>{j_.gzip(e,(s,a)=>{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=>{let s=0,a=[],i=j_.createGunzip();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case"identity":return new mo;case"deflate":return new OO(e);case"gzip":return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm="identity";let i=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(o=e["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e["grpc.max_send_message_length"])!==null&&s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(",");(!l||l.includes(n))&&(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get("grpc-encoding");if(t.length>0){let s=t[0];typeof s=="string"&&(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let o=e.get("grpc-accept-encoding")[0];return o&&(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&&o.message.length>this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&&t!==void 0?t:0)&2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o<e&&(e=o)}return e}var s_e=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&&(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a<1e8)return String(Math.ceil(a))+o}throw new Error("Deadline is too far in the future")}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o<0?0:o>l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?""+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+"s"}});var z_=T(CO=>{"use strict";Object.defineProperty(CO,"__esModule",{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V("http2"),m_e="load_balancing_call",IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split("/"),f="";u.length>=2&&(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&&c!==void 0?c:"localhost";this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&o.push("wait_for_ready"),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&o.push("wait_for_ready"),o.push("Waiting for LB pick"),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,"["+this.callNumber+"] "+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?"("+s.subchannel.getChannelzRef().id+") "+s.subchannel.getAddress():""+s.subchannel;switch(this.trace("Pick result: "+iu.PickResultType[s.pickResultType]+" subchannel: "+a+" status: "+((e=s.status)===null||e===void 0?void 0:e.code)+" "+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(o.merge(c),o.get("authorization").length>1&&this.outputStatus({code:K_.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new $_.Metadata},"PROCESSED"),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace("Picked subchannel "+a+" has state "+bj.ConnectivityState[s.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&o.set("grpc-timeout",(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=>{this.trace("Received message"),this.listener.onReceiveMessage(f)},onReceiveStatus:f=>{this.trace("Received status"),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,"REFUSED"):this.outputStatus(f,"PROCESSED")}}),this.childStartTime=new Date}catch(f){this.trace("Failed to start call on picked subchannel "+a+" with error "+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+f.message,metadata:new $_.Metadata},"NOT_STARTED");return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},c=>{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code=="number"?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},"PROCESSED")});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:n,details:l,metadata:s.status.metadata},"DROP")});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:c,details:u,metadata:s.status.metadata},"PROCESSED")})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},"PROCESSED")}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e="resolving_call",bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&&(o.flags&So.Propagate.CANCELLATION&&o.parentCall.on("cancelled",()=>{this.cancelWithStatus(So.Status.CANCELLED,"Cancelled by parent call")}),o.flags&So.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push("waiting for metadata filters")):o.push("waiting for name resolution"),this.child&&o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(","))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(o=>o(t)),process.nextTick(()=>{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=>{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&&o.halfClose()},s=>{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,"Failed to route call to method "+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},a=>{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},o=>{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e="retrying_call",xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;return this.limitPerCall-s<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&&o!==void 0?o:0;if(s<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&&t!==void 0?t:0;if(this.totalAllocated<o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} > total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO="grpc-previous-rpc-attempts",N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:N_e;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state="RETRY";let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&&t!==void 0?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let o=this.getBufferEntry(t);o.allocated&&this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s<this.underlyingCalls.length;s++)s!==e&&this.underlyingCalls[s].state!=="COMPLETED"&&(this.underlyingCalls[s].state="COMPLETED",this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state==="ACTIVE"&&s.nextMessageToSend>e&&(e=s.nextMessageToSend,t=o);t===-1?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=>{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!=="RETRY"){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var s,a;if(this.state!=="RETRY"){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&&a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o<0){this.state="TRANSPARENT_ONLY",this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get("grpc-retry-pushback-ms");if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[t].call.getCallNumber()+"] in state "+this.underlyingCalls[t].state),this.underlyingCalls[t].state="COMPLETED",e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(t),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(t),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&&e!==void 0?e:"0s",i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o>0&&s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),a=!0,o>0&&i.set(LO,`${o}`),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMetadata(i)},onReceiveMessage:i=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMessage(i)},onReceiveStatus:i=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!a&&o>0&&i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace("start called"),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!=="COMPLETED"&&this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:s=>{this.handleChildWriteCompleted(e)}},o.message.message);break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,t){var o;this.trace("write() called with message of length "+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:"MESSAGE",message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state==="ACTIVE"&&l.nextMessageToSend===a&&l.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state==="ACTIVE"&&n.nextMessageToSend===a&&n.call.sendMessageWithContext({callback:l=>{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)==="ACTIVE"&&t.nextMessageToSend===e&&(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1<<24,q_e=1<<20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof C_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options["grpc.use_local_subchannel_pool"])!==null&&s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options["grpc.retry_buffer_size"])!==null&&a!==void 0?a:H_e,(i=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&i!==void 0?i:q_e),this.keepaliveTime=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options["grpc.client_idle_timeout_ms"])!==null&&l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=>{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=>{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length>0&&this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=>{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=>{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length>0&&this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+y.code+' and details "'+y.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length>0&&this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)("channel_stacktrace")&&(0,eE.trace)(ci.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&&t.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=>o===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,tE.uriToString)(this.target)+" "+sr.ConnectivityState[this.connectivityState]+" -> "+sr.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&&(o.timer&&clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+i+'] method="'+t+'"'),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace("createRetryingCall ["+i+'] method="'+t+'"'),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace("createResolvingCall ["+i+'] method="'+e+'", deadline='+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=>{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i<=n){process.nextTick(o,new Error("Deadline passed without connectivity state change"));return}s=setTimeout(()=>{this.removeConnectivityStateWatcher(a),o(new Error("Deadline passed without connectivity state change"))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof j_e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V("events"),XO=V("stream"),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:"message"in r?r.message:"Unknown Error",metadata:(t=e??r.metadata)!==null&&t!==void 0?t:null};return"code"in r&&typeof r.code=="number"&&Number.isInteger(r.code)&&(o.code=r.code,"details"in r&&typeof r.details=="string"&&(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",a=>{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on("error",s=>{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(t))throw new TypeError("keyCertPairs must be an array");if(typeof o!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let a=[],i=[];for(let n=0;n<t.length;n++){let l=t[n];if(l===null||typeof l!="object")throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t<this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t<this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t<this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V("http2"),Vj=Mh(),Fj=V("zlib"),X_e=lO(),jj=Pe(),Yj="server_call";function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveHalfClose:r=>{r()},onCancel:()=>{}},sE={start:r=>{r()},sendMetadata:(r,e)=>{e(r)},sendMessage:(r,e)=>{e(r)},sendStatus:(r,e)=>{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&&o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&&s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&&a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&&i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&&o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&&s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&&a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&&i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=>{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj="grpc-accept-encoding",cA="grpc-encoding",Gj="grpc-message",Hj="grpc-status",nA="grpc-timeout",J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:"identity,deflate,gzip",[cA]:"identity"},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once("error",u=>{}),this.stream.once("close",()=>{var u;Oo("Request to method "+((u=this.handler)===null||u===void 0?void 0:u.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",u=>{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in a&&(this.maxSendMessageSize=a["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in a&&(this.maxReceiveMessageSize=a["grpc.max_receive_message_length"]),this.host=(i=t[":authority"])!==null&&i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&&Oo("Request to "+this.handler.path+" received headers "+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length>0&&this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length>0&&(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=>{let a={code:bt.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t==="identity")return o;if(t==="deflate"||t==="gzip"){let s;return t==="deflate"?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=>{let n=0,l=[];s.on("data",c=>{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&&n>this.maxReceiveMessageSize&&(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on("end",()=>{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo("Request to "+this.handler.path+" received data frame of size "+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:"COMPRESSED",compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&o.length-5>this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo("Request to "+this.handler.path+" sent data frame of size "+o.length),this.stream.write(o,s=>{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo("Request to method "+((t=this.handler)===null||t===void 0?void 0:t.path)+" ended with status code: "+bt.Status[e.code]+" details: "+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var s;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&&t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type==="clientStream"||s.type==="bidi",responseStream:s.type==="serverStream"||s.type==="bidi",requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=>c(i,l),n)}});var Zj=T(fi=>{"use strict";var rEe=fi&&fi.__runInitializers||function(r,e,t){for(var o=arguments.length>2,s=0;s<e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&&fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var n=o.kind,l=n==="getter"?"get":n==="setter"?"set":"value",c=!e&&r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m>=0;m--){var O={};for(var y in o)O[y]=y==="access"?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(I||null))};var A=(0,t[m])(n==="accessor"?{get:u.get,set:u.set}:u[l],O);if(n==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(f=i(A.get))&&(u.get=f),(f=i(A.set))&&(u.set=f),(f=i(A.init))&&s.unshift(f)}else(f=i(A))&&(n==="field"?s.unshift(f):u[l]=f)}c&&Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,"__esModule",{value:!0});fi.Server=void 0;var Lt=V("http2"),iEe=V("util"),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1<<31),pA=~(1<<31),oEe=2e4,Xj=~(1<<31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe="server",Jj=Buffer.from("max_age");function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,"server_call",r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case"unary":return(o,s)=>{s(t,null)};case"clientStream":return(o,s)=>{s(t,null)};case"serverStream":return o=>{o.emit("error",t)};case"bidi":return o=>{o.emit("error",t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=>{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=s??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(a=this.options["grpc.max_connection_age_ms"])!==null&&a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options["grpc.max_connection_age_grace_ms"])!==null&&i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options["grpc.keepalive_timeout_ms"])!==null&&l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options["grpc.max_connection_idle_ms"])!==null&&c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&&a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:I&&"raw"in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&&i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,"("+this.channelzRef.id+") "+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+s)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(s,a){if(s===null||typeof s!="object"||a===null||typeof a!="object")throw new Error("addService() requires two objects as arguments");let i=Object.keys(s);if(i.length===0)throw new Error("Cannot add an empty service to a server");i.forEach(n=>{let l=s[n],c;l.requestStream?l.responseStream?c="bidi":c="clientStream":l.responseStream?c="serverStream":c="unary";let u=a[n],f;if(u===void 0&&typeof l.originalName=="string"&&(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!="object")throw new Error("removeService() requires object as argument");Object.keys(s).forEach(i=>{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=>({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),c=n!==null;this.trace("Initial credentials valid: "+c),a=Lt.createSecureServer(l),a.prependListener("connection",f=>{c||(this.trace("Dropped connection from "+JSON.stringify(f.address())+" due to unloaded credentials"),f.destroy())}),a.on("secureConnection",f=>{f.on("error",_=>{this.trace("An incoming TLS connection closed with error: "+_.message)})});let u=f=>{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,"Failed to set secure context with error "+m.message),f=null}}c=f!==null,this.trace("Post-update credentials valid: "+c)};s._addWatcher(u),a.on("close",()=>{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace("Attempting to bind "+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=>{let c=u=>{this.trace("Failed to bind "+(0,ui.subchannelAddressToString)(s)+" with error "+u.message),n({port:"port"in s?s.port:1,error:u.message})};i.once("error",c),i.listen(s,()=>{let u=i.address(),f;typeof u=="string"?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace("Successfully bound "+(0,ui.subchannelAddressToString)(f)),n({port:"port"in f?f.port:1}),i.removeListener("error",c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&&s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=>(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=>this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=>u.error===void 0).length,port:i.port,errors:c.filter(u=>u.error).map(u=>u.error)}}}else{let i=await Promise.all(s.map(n=>this.bindOneAddress(n,a)));return{count:i.filter(n=>n.error===void 0).length,port:i[0].port,errors:i.filter(n=>n.error).map(n=>n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count>0)return i.count<s.length&&Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(",")}]`)}}resolvePort(s){return new Promise((a,i)=>{let n={onSuccessfulResolution:(c,u,f)=>{n.onSuccessfulResolution=()=>{};let _=[].concat(...c.map(m=>m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=>{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port "${s}"`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port "${s}"`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof s!="string")throw new TypeError("port must be a string");if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof i!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+s);let n=this.normalizePort(s),l=(_,m)=>{process.nextTick(()=>i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=>i(null,_),_=>i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=>{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=>{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=>{c.completionPromise=null,c.portNumber=_,i(null,_)},_=>{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=>{n.emit("connection",c)},drain:c=>{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=>{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=>{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace("Closing server with address "+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=>{i&&i.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace("Closing session initiated by "+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=>{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace("unbind port="+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error("Cannot unbind port 0");let n=this.boundPorts.get((0,Pr.uriToString)(a));n&&(this.trace("unbinding "+n.mapKey+" originally bound as "+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace("drain port="+s+" graceTimeMs="+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=>{f.delete(O)})}(n=(i=setTimeout(()=>{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=>{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=>!s.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(s){var a;let i=c=>{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&&i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace("Waiting for server "+f+" to close"),this.closeServer(c,()=>{this.trace("Server "+f+" finished closing"),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace("Waiting for session "+m+" to close"),this.closeSession(_,()=>{this.trace("Session "+m+" finished closing"),l()})}}n===0&&i()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!="string"||!i.startsWith("application/grpc")?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj("Received call to method "+s+" at address "+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj("No handler registered for method "+s+". Sending UNIMPLEMENTED status."),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({"grpc-status":(n=s.code)!==null&&n!==void 0?n:qe.Status.INTERNAL,"grpc-message":s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=>{n&&(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{n&&(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=>{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=>{n&&(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i==="unary")fEe(s,a);else if(i==="clientStream")pEe(s,a);else if(i==="serverStream")dEe(s,a);else if(i==="bidi")hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n="null";i&&(typeof i=="string"?n=i:n=i.address+":"+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on("stream",l.bind(this,a)),s.on("session",c)}_sessionHandler(s){return a=>{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=>{var F,N;f=!0,this.trace("Connection dropped by max connection age: "+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(c=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=>{u&&(clearTimeout(u),u=null)},O=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,y,A=()=>{var I;O()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=>{var I;if(!O())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let M="";try{a.ping((N,z,B)=>{m(),N?(this.keepaliveTrace("Ping failed with error: "+N.message),f=!0,a.close()):(this.keepaliveTrace("Received ping response"),A())})||(M="Ping returned false")}catch(F){M=(F instanceof Error?F.message:"")||"Unknown error"}if(M){this.keepaliveTrace("Ping send failed: "+M),this.trace("Connection dropped due to ping send error: "+M),f=!0,a.close();return}u=setTimeout(()=>{m(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on("close",()=>{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&&clearTimeout(l),c&&clearTimeout(c),m(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=>{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&&n!==void 0?n:"unknown",this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+_),this.trace("Connection established by client "+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=>{var te;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1<<31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&&(O=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=>{y&&(clearTimeout(y),y=null)},F=()=>!a.destroyed&&this.keepaliveTimeMs<pA&&this.keepaliveTimeMs>0,N,z=()=>{var B;F()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),y=setTimeout(()=>{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=>{var B;if(!F())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let G="";try{a.ping(($,le,v)=>{M(),$?(this.keepaliveTrace("Ping failed with error: "+$.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+$.message+" return in "+le),A=!0,a.close()):(this.keepaliveTrace("Received ping response"),z())})||(G="Ping returned false")}catch(te){G=(te instanceof Error?te.message:"")||"Unknown error"}if(G){this.keepaliveTrace("Ping send failed: "+G),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=>{M(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on("close",()=>{var B;A||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&&clearTimeout(m),O&&clearTimeout(O),M(),I!==null&&(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout>=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace("Enable idle timeout for "+l.remoteAddress+":"+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&&n.activeStreams===0&&(Date.now()-n.lastIdle>=s.sessionIdleTimeout?(s.trace("Session idle timeout triggered for "+(i==null?void 0:i.remoteAddress)+":"+(i==null?void 0:i.remotePort)+" last idle at "+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&&(i.activeStreams+=1,s.once("close",i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&&(n.activeStreams-=1,n.activeStreams===0&&(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace("Session onStreamClose"+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+":"+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+" at "+n.lastIdle)))}},(()=>{let o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[lEe("Calling start() is no longer necessary. It can be safely omitted.")],nEe(r,null,t,{kind:"method",name:"start",static:!1,private:!1,access:{has:s=>"start"in s,get:s=>s.start},metadata:o},null,e),o&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=>{r.sendStatus({code:qe.Status.OK,details:"OK",metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}});var e4=T(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}});var cE=T(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V("net"),yEe="pick_first";function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au="pick_first",OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t>1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&&(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&&(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n<Math.max(a.length,i.length);n++)n<a.length&&e.push(a[n]),n<i.length&&e.push(i[n]);return e}var o4="grpc-node.internal.pick-first.report_health_status",lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=>{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&&a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&&this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&&(n.hasReportedTransientFailure=!0,s&&(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t>=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&&(su("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+" -> "+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su("connectToAddressList(["+e.map(s=>(0,t4.subchannelAddressToString)(s))+"])");let o=e.map(s=>({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&&(e=i4(e));let s=[].concat(...e.map(i=>i.addresses));su("updateAddressList(["+s.map(i=>(0,t4.subchannelAddressToString)(i))+"])"),s.length===0&&(this.lastError="No addresses resolved");let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=>{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V("fs"),PEe=Pe(),IEe=ue(),bEe=V("util"),LEe="certificate_provider";function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");uE("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=>{if(this.refreshTimer){uE("File watcher read certificates certificate "+e.status+", privateKey "+t.status+", CA certificate "+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&t.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status==="fulfilled"?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),uE("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,"trace",{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,"log",{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,"registerResolver",{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,"createResolver",{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,"uriToString",{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,"splitHostPort",{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,"durationToMs",{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,"parseDuration",{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,"BackoffTimeout",{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,"createChildChannelControlHelper",{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,"registerLoadBalancerType",{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,"selectLbConfigFromList",{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,"LeafLoadBalancer",{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,"subchannelAddressToString",{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,"endpointToString",{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,"endpointHasAddress",{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,"EndpointMap",{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,"UnavailablePicker",{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,"QueuePicker",{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,"PickResultType",{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,"BaseFilter",{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,"FilterStackFactory",{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,"registerAdminService",{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===""?s="/"+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function qEe(){(0,HEe.registerResolver)("unix",OA)}});var m4=T(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.setup=KEe;var d4=V("net"),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe="ip_resolver";function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA="ipv4",CA="ipv6",zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4("Resolver constructed for target "+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(",");for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&&!(0,d4.isIPv4)(l.host)||e.scheme===CA&&!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&&s!==void 0?s:zEe})}this.endpoints=a.map(n=>({addresses:[n]})),E4("Parsed "+e.scheme+" address list "+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe="round_robin";function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E="round_robin",bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=>{this.currentState===yt.ConnectivityState.READY&&t!==yt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),s&&(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)>0){let e=this.children.filter(o=>o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=>(0,T4.endpointEqual)(s.getEndpoint(),o)),t<0&&(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=>({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)>0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+" -> "+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4("Connect to endpoint list "+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=>new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=>{"use strict";var xA;Object.defineProperty(No,"__esModule",{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome="outlier_detection";function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA="outlier_detection",sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&xA!==void 0?xA:"true")==="true",ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&&r[e]!==void 0&&typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&&r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds>=0&&r[e].seconds<=315576e6&&r[e].nanos>=0&&r[e].nanos<=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,"number",t),e in r&&r[e]!==void 0&&!(r[e]>=0&&r[e]<=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&&t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,"interval"),wA(e,"base_ejection_time"),wA(e,"max_ejection_time"),mE(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Ia(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),mE(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Ia(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Ia(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");mE(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),mE(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Ia(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&&t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&&(a=i=>{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=>{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&&i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=>{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it("Running success rate check");let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it("Stats for "+(0,MA.endpointToString)(f)+": successes="+m+" failures="+O+" targetRequestVolume="+o),m+O>=o&&(s+=1,a.push(m/(m+O)))}if(it("Found "+s+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+a+"]"),s<t.minimum_hosts)return;let i=a.reduce((f,_)=>f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it("stdev="+c+" ejectionThreshold="+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O<o)continue;let y=m/(m+O);if(it("Checking candidate "+f+" successRate="+y),y<u){let A=Math.random()*100;it("Candidate "+f+" randomNumber="+A+" enforcement_percentage="+t.enforcement_percentage),A<t.enforcement_percentage&&(it("Ejecting candidate "+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i>=t.request_volume&&(o+=1)}if(!(o<t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it("Candidate successes="+i+" failures="+n),i+n<t.request_volume)continue;if(n*100/(n+i)>t.threshold){let c=Math.random()*100;it("Candidate "+s+" randomNumber="+c+" enforcement_percentage="+t.enforcement_percentage),c<t.enforcement_percentage&&(it("Ejecting candidate "+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier>0&&(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i<new Date&&(it("Unejecting "+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it("Received update with config: "+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it("Adding map entry for "+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&&(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,"CallCredentials",{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,"Channel",{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,"compressionAlgorithms",{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,"connectivityState",{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,"ChannelCredentials",{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,"Client",{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,"logVerbosity",{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,"status",{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,"propagate",{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,"loadPackageDefinition",{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,"makeClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,"makeGenericClientConstructor",{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,"Metadata",{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,"Server",{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,"ServerCredentials",{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,"StatusBuilder",{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),combineCallCredentials:(r,...e)=>e.reduce((t,o)=>t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=>r.close();w.closeClient=mme;var Tme=(r,e,t)=>r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.loadObject=Sme;var gme=(r,e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};w.load=gme;var vme=r=>{N4.setLogger(r)};w.setLogger=vme;var yme=r=>{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=>R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,"ListenerBuilder",{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,"RequesterBuilder",{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,"InterceptingCall",{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,"InterceptorConfigurationError",{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,"getChannelzHandlers",{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,"addAdminServicesToServer",{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,"ServerListenerBuilder",{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,"ResponderBuilder",{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,"ServerInterceptingCall",{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=>o,requestDeserialize:o=>o,responseSerialize:o=>o,responseDeserialize:o=>o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r==="gzip"?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:"failure",error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:"failure",error:i})}}return new Promise(s=>{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error("metadata was null"),status:"failure"});this._client.export(o,this._metadata,{deadline:a},(i,n)=>{s(i?{status:"failure",error:i}:{data:n,status:"success"})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.VERSION=void 0;AE.VERSION="0.56.0"});var w4=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V("url"),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol==="unix:"?r:(o.pathname&&o.pathname!=="/"&&b4.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),o.protocol!==""&&!(!((e=o.protocol)===null||e===void 0)&&e.match(/^(http)s?:$/))&&b4.diag.warn("URL protocol should be http(s)://. Using http://."),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length<1&&r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&&o!==void 0?o:e.url)!==null&&s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=>{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&&u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&&_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&&a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&&n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=>{let r=(0,hu.createEmptyMetadata)();return r.set("User-Agent",`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:"http://localhost:4317",credentials:r=>r.startsWith("http://")?()=>(0,hu.createInsecureCredentials)():()=>(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=>{P();qA=De("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var NE,U4=p(()=>{NE="baggage"});function PE(r){return r.reduce((e,t)=>{let o=`${e}${e!==""?",":""}${t}`;return o.length>8192?e:o},"")}function IE(r){return r.getAllEntries().map(([e,t])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(o+=";"+t.metadata.toString()),o})}function Eu(r){let e=r.split(";");if(e.length<=0)return;let t=e.shift();if(!t)return;let o=t.indexOf("=");if(o<=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length>0&&(i=Lr(e.join(";"))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!="string"||r.length===0?{}:r.split(",").map(e=>Eu(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}var jA=p(()=>{P()});var bE,V4=p(()=>{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=>n.length<=4096).slice(0,180),i=PE(a);i.length>0&&o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(","):s;if(!a)return e;let i={};return a.length===0||(a.split(",").forEach(l=>{let c=Eu(l);if(c){let u={value:c.value};c.metadata&&(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=>{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r=="string"&&r.length>0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}var q4=p(()=>{P()});function xE(){return r=>{S.error(Xme(r))}}function Xme(r){return typeof r=="string"?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=>{if(e[o])return;let s=t[o];s&&(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=>{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=>{KA();j4=xE()});var La,XA=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(La||(La={}))});function Zme(r){return Qme.indexOf(r)>-1}function tTe(r){return eTe.indexOf(r)>-1}function nTe(r){return rTe.indexOf(r)>-1}function iTe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o=="string"){let s=aTe[o.toUpperCase()];s!=null&&(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case"OTEL_LOG_LEVEL":lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=>{P();XA();Jme=",",Qme=["OTEL_SDK_DISABLED"];eTe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];rTe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=>{QA()});var UE,K4=p(()=>{UE=typeof globalThis=="object"?globalThis:global});function $4(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var ZA=p(()=>{});function BE(r){return Buffer.from(kE(r)).toString("base64")}var X4=p(()=>{ZA()});function W4(r){return function(){for(let t=0;t<r/4;t++)VE.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(VE[t]>0);t++)t===r-1&&(VE[r-1]=1);return VE.toString("hex",0,r)}}var xa,VE,J4=p(()=>{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from"perf_hooks";var di,Q4=p(()=>{di=cTe});var FE,eR=p(()=>{FE="1.29.0"});var GE,Z4=p(()=>{eR();Ve();GE={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=>{});var t6=p(()=>{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=>{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!="number"){let e=di;r=e.timing&&e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r=="number"?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r=="number")return r<jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError("Invalid input type")}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o<0&&(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${"0".repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function c6(r){return YE(r)||typeof r=="number"||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=qE&&(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=>{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(zE||(zE={}))});var KE,p6=p(()=>{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=>typeof o.fields=="function"?o.fields():[]).reduce((o,s)=>o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&&!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=>{iR="[_0-9a-z-*/]",pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=>{_6();E6=32,mTe=512,m6=",",T6="=",wa=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length>mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=>{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&&h6(n)&&t.set(i,n)}return t},new Map),this._internalState.size>E6&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=>{P();_u();oR();vu="traceparent",yu="tracestate",TTe="00",STe="(?!ff)[\\da-f]{2}",gTe="(?![0]{32})[\\da-f]{32}",vTe="(?![0]{16})[\\da-f]{16}",yTe="[\\da-f]{2}",OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&&o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(","):n;i.traceState=new wa(typeof l=="string"?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=>{P();aR=De("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(XE||(XE={}))});var Co,lR=p(()=>{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}});var hi,cR=p(()=>{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}});var WE,A6=p(()=>{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&&o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&&s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=>{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&&this._accumulate(t)<this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)>>>0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&N6.call(t)===PTe}function LTe(r){return r!=null&&typeof r=="object"}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&&Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&&(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=>{ATe="[object Object]",RTe="[object Null]",NTe="[object Undefined]",CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t>DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a<i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let l=a[i],c=e[l];if(QE(c))typeof c>"u"?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&&Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r=="function"}function Ou(r){return!QE(r)&&!ZE(r)&&!w6(r)&&typeof r=="object"}function QE(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=>{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au("Operation timed out."))},e)});return Promise.race([r,o]).then(s=>(clearTimeout(t),s),s=>{throw clearTimeout(t),s})}var Au,k6=p(()=>{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e=="string"?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=>{});function F6(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}var G6=p(()=>{});var em,H6=p(()=>{em=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=>{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=>{he.with(RE(he.active()),()=>{r.export(e,o=>{t(o)})})})}var Y6=p(()=>{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=>Co,AlwaysOnSampler:()=>hi,AnchoredClock:()=>LE,BindOnceFuture:()=>tm,CompositePropagator:()=>KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>mu,DEFAULT_ENVIRONMENT:()=>Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>JA,ExportResultCode:()=>zE,ParentBasedSampler:()=>WE,RPCType:()=>XE,RandomIdGenerator:()=>xa,SDK_INFO:()=>GE,TRACE_PARENT_HEADER:()=>vu,TRACE_STATE_HEADER:()=>yu,TimeoutError:()=>Au,TraceIdRatioBasedSampler:()=>JE,TraceState:()=>wa,TracesSamplerValues:()=>La,VERSION:()=>FE,W3CBaggagePropagator:()=>bE,W3CTraceContextPropagator:()=>$E,_globalThis:()=>UE,addHrTimes:()=>nR,baggageUtils:()=>kTe,callWithTimeout:()=>U6,deleteRPCMetadata:()=>v6,getEnv:()=>wE,getEnvWithoutDefaults:()=>DE,getRPCMetadata:()=>y6,getTimeOrigin:()=>jE,globalErrorHandler:()=>ME,hexToBase64:()=>BE,hexToBinary:()=>kE,hrTime:()=>rR,hrTimeDuration:()=>i6,hrTimeToMicroseconds:()=>l6,hrTimeToMilliseconds:()=>a6,hrTimeToNanoseconds:()=>s6,hrTimeToTimeStamp:()=>o6,internal:()=>BTe,isAttributeKey:()=>YA,isAttributeValue:()=>zA,isTimeInput:()=>c6,isTimeInputHrTime:()=>YE,isTracingSuppressed:()=>ba,isUrlIgnored:()=>B6,isWrapped:()=>F6,loggingErrorHandler:()=>xE,merge:()=>x6,millisToHrTime:()=>Ma,otperformance:()=>di,parseEnvironment:()=>gu,parseTraceParent:()=>sR,sanitizeAttributes:()=>G4,setGlobalErrorHandler:()=>Y4,setRPCMetadata:()=>g6,suppressTracing:()=>RE,timeInputToHrTime:()=>n6,unrefTimer:()=>HE,unsuppressTracing:()=>D4,urlMatches:()=>pR});var kTe,BTe,K6=p(()=>{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V("fs"),GTe=V("path"),W6=(P(),ee(ot));function dR(r,e){if(r!=null&&r!=="")return r;if(e!=null&&e!=="")return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&&Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=>e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)==="true"}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&&t!=null;return o!=null&&!s?(W6.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=>e.startsWith("http://")?()=>(0,Ru.createInsecureCredentials)():e.startsWith("https://")?()=>J6(r):()=>$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&&WTe.diag.warn("Headers cannot be set when using grpc");let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=>{var o;return(o=r.metadata)!==null&&o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=>t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,"LOGS"),oSe.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}};om.OTLPLogExporter=ER});var iY=T(Io=>{"use strict";var aSe=Io&&Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),lSe=Io&&Io.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aSe(e,r,t)};Object.defineProperty(Io,"__esModule",{value:!0});lSe(nY(),Io)});var oY,sY=p(()=>{oY="0.56.0"});var Ua,aY=p(()=>{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${oY}`,"Content-Type":"application/x-protobuf"}),Ah))}}});var lY=p(()=>{aY()});var cY=p(()=>{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=>Ua});var fY=p(()=>{cY()});var pY,dY=p(()=>{pY="0.56.0"});var ka,hY=p(()=>{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${pY}`,"Content-Type":"application/x-protobuf"}),Rh))}}});var _Y=p(()=>{hY()});var EY=p(()=>{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=>ka});var TY=p(()=>{EY()});var SY,gY=p(()=>{SY="0.56.0"});var mR,vY=p(()=>{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${SY}`,"Content-Type":"application/json"}),Nh))}}});var yY=p(()=>{vY()});var OY=p(()=>{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=>mR});var RY=p(()=>{OY()});var CY=T(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,"TRACES"),cSe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};sm.OTLPTraceExporter=TR});var PY=T(bo=>{"use strict";var fSe=bo&&bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&&(o=t),r[o]=e[t]})),pSe=bo&&bo.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fSe(e,r,t)};Object.defineProperty(bo,"__esModule",{value:!0});pSe(CY(),bo)});var am,IY=p(()=>{(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(am||(am={}))});function _Se(r){return hSe.indexOf(r)>-1}function mSe(r){return ESe.indexOf(r)>-1}function SSe(r){return TSe.indexOf(r)>-1}function ySe(r,e,t){if(typeof t[r]>"u")return;let o=String(t[r]);e[r]=o.toLowerCase()==="true"}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]<"u"){let a=Number(t[r]);isNaN(a)||(a<o?e[r]=o:a>s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s=="string"&&(e[r]=s.split(o).map(a=>a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o=="string"){let s=RSe[o.toUpperCase()];s!=null&&(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case"OTEL_LOG_LEVEL":NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s<"u"&&s!==null&&(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=>{P();IY();dSe=",",hSe=["OTEL_SDK_DISABLED"];ESe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];TSe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=>{LY()});var wY=p(()=>{xY()});var DY=p(()=>{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=>{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=>{(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(sn||(sn={}))});var lm=p(()=>{UY();kY();DY()});import*as DSe from"http";import*as USe from"https";import*as BY from"url";function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:"POST",headers:Object.assign({"Content-Type":"application/json"},e)},t);return function(a,i){if(a.length===0)return S.debug("Zipkin send with empty spans"),i({code:sn.SUCCESS});let{request:n}=o.protocol==="http:"?DSe:USe,l=n(o,u=>{let f="";u.on("data",_=>{f+=_}),u.on("end",()=>{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_<400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on("error",u=>i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,"utf8"),l.end()}}var VY=p(()=>{P();lm()});var FY=p(()=>{VY()});var yR=p(()=>{FY()});var xo,GY=p(()=>{(function(r){r.CLIENT="CLIENT",r.SERVER="SERVER",r.CONSUMER="CONSUMER",r.PRODUCER="PRODUCER"})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&&(l[i]=String(jt[t.code])),t.code===jt.ERROR&&t.message&&(l[n]=t.message),o&&(l["otel.dropped_attributes_count"]=String(o)),s&&(l["otel.dropped_events_count"]=String(s)),a&&(l["otel.dropped_links_count"]=String(a)),Object.keys(e.attributes).forEach(c=>l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=>({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=>{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY="otel.status_code",qY="error"});function zY(r){return function(){return r()}}var KY=p(()=>{});var cm,$Y=p(()=>{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME="OpenTelemetry Service",this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders=="function"?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug("Zipkin exporter export"),this._isShutdown){setTimeout(()=>t({code:sn.FAILED,error:new Error("Exporter has been shutdown")}));return}let s=new Promise(i=>{this._sendSpans(e,o,n=>{i(),t(n)})});this._sendingPromises.push(s);let a=()=>{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug("Zipkin exporter shutdown"),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=>{Promise.all(this._sendingPromises).then(()=>{e()},t)})}_beforeSend(){this._getHeaders&&(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=>jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=>{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=>cm,prepareSend:()=>Lo});var WY=p(()=>{yR();$Y()});var ez=T(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe="env",YSe="host",zSe="os",KSe="process",$Se="serviceinstance";function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(","))!==null&&e!==void 0?e:["all"];return o.includes("all")?[...t.values()].flat():o.includes("none")?[]:o.flatMap(s=>{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector "${s}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=>e.trim()).filter(e=>e!=="null"&&e!=="")}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&&e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case"grpc":return new HSe.OTLPTraceExporter;case"http/json":return new GSe.OTLPTraceExporter;case"http/protobuf":return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V("@opentelemetry/exporter-jaeger");return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([["otlp",()=>WSe()],["zipkin",()=>new qSe.ZipkinExporter],["console",()=>new um.ConsoleSpanExporter],["jaeger",()=>JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(","))));if(s[0]==="none")return Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.'),[];s.length===0?(Mo.diag.warn("OTEL_TRACES_EXPORTER is empty. Using default otlp exporter."),s=["otlp"]):s.length>1&&s.includes("none")&&(Mo.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.'),s=["otlp"]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&&Mo.diag.warn("Unable to set up trace exporter(s) due to invalid exporter and/or protocol values."),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&&(this._disabled=!0),u.OTEL_LOG_LEVEL&&ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&&t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&&o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&&s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&&(f.sampler=e.sampler),e.spanLimits&&(f.spanLimits=e.spanLimits),e.idGenerator&&(f.idGenerator=e.idGenerator),e.spanProcessor&&ln.diag.warn("The 'spanProcessor' option is deprecated. Please use 'spanProcessors' instead.");let _=(a=e.spanProcessor)!==null&&a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&&i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn("The 'logRecordProcessor' option is deprecated. Please use 'logRecordProcessors' instead.")):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&&(f.reader=e.metricReader),e.views&&(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&&l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length>0&&this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&&t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&&l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&&i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=>{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&&e!==void 0?e:"",o=(0,AR.filterBlanksAndNulls)(t.split(","));if(o.length===0&&(ln.diag.info("OTEL_LOGS_EXPORTER is empty. Using default otlp exporter."),o.push("otlp")),o.includes("none")){ln.diag.info('OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.');return}let s=[];o.forEach(a=>{var i,n;if(a==="otlp"){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&&i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case"grpc":s.push(new rge.OTLPLogExporter);break;case"http/json":s.push(new tge.OTLPLogExporter);break;case"http/protobuf":s.push(new OR.OTLPLogExporter);break;case void 0:case"":s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: "${l}". Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a==="console"?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: "${a}". Supported values are: otlp, console, none.`)}),s.length>0&&(this._loggerProviderConfig={logRecordProcessors:s.map(a=>a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,"NodeSDK",{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from"process";P();var vi=typeof globalThis=="object"?globalThis:global;function LN(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o<r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s<<4|a}return e}var xN="1.30.1";Ve();var yi={[Se]:"opentelemetry",[st]:"node",[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt<"u"?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&&e!==void 0?e:!0,s=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=>sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=>sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=>(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=>(S.debug("a resource's async attributes promise rejected: %s",s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&&S.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=>{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=>aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=>sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length>0){let m=_.map(O=>oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=>{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=>{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=>{throw TypeError(r)},Jm=(r,e,t)=>e.has(r)||uM("Cannot "+t),el=(r,e,t)=>(Jm(r,e,"read from private field"),t?t.call(r):e.get(r)),Wu=(r,e,t)=>e.has(r)?uM("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=>(Jm(r,e,"write to private field"),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=>(Jm(r,e,"access private method"),t),fZ="__nfOTLPTrace",tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:"netlify-span-exporter"}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error("Exporter has been shutdown")});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug("Shutting down"),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&&!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&&o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)=="function"?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName="@netlify/otel/instrumentation-fetch",this.instrumentationVersion="1.0.0",this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,"http.request.method":e.method,"url.full":o.href,"url.host":o.host,"url.scheme":o.protocol.slice(0,-1),"server.address":o.hostname,"server.port":o.port,...this.prepareHeaders("request",e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,"http.response.status_code":e.status,...this.prepareHeaders("response",e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=["*","/.*/"],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=>t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=>typeof f=="string"?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=>typeof f=="string"?f==l:f.test(l))?i[u]="REDACTED":i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=>{var a;let o=typeof e=="string"?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&&a.some(i=>typeof i=="string"?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan("fetch",async i=>{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&&(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&&S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({"service.name":SERVICE_NAME??"lambda-function","service.version":SERVICE_VERSION,"process.runtime.name":"nodejs","process.runtime.version":lge.slice(1),"deployment.environment":(iz=bu.URL)!=null&&iz.includes("netlifystg.com")?"staging":"production","http.url":bu.URL,"netlify.site.id":bu.SITE_ID,"netlify.site.name":bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */
๐Ÿ“ netlify
๐Ÿ“ functions
๐Ÿ“„ sitemap-admin.js
var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; // netlify/functions/sitemap.js var require_sitemap = __commonJS({ "netlify/functions/sitemap.js"(exports2) { var fs = require("fs").promises; var path = require("path"); var SITEMAP_CONFIG = { MAX_URLS_PER_SITEMAP: 5e4, CACHE_DURATION: 24 * 60 * 60 * 1e3, // 24 hours DEFAULT_CHANGEFREQ: "weekly", DEFAULT_PRIORITY: 0.5, HIGH_PRIORITY: 0.9, MEDIUM_PRIORITY: 0.7, LOW_PRIORITY: 0.3 }; var STATIC_PAGES = [ { path: "/", changefreq: "daily", priority: 1 }, { path: "/tools", changefreq: "weekly", priority: 0.9 }, { path: "/blog", changefreq: "daily", priority: 0.8 }, { path: "/about", changefreq: "monthly", priority: 0.6 }, { path: "/contact", changefreq: "monthly", priority: 0.6 }, { path: "/privacy-policy", changefreq: "yearly", priority: 0.3 }, { path: "/terms-of-use", changefreq: "yearly", priority: 0.3 }, { path: "/dmca", changefreq: "yearly", priority: 0.3 }, { path: "/cookies-policy", changefreq: "yearly", priority: 0.3 } ]; var sitemapCache = null; function getSiteOrigin() { return process.env.URL || process.env.SITE_URL || "https://modernphototools.com"; } function escapeXml(str) { return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"); } async function loadBlogArticles() { try { const contentDir = path.join(process.cwd(), "content", "blog"); const files = await fs.readdir(contentDir); const markdownFiles = files.filter((file) => file.endsWith(".md")); const articles = []; for (const file of markdownFiles) { const filePath = path.join(contentDir, file); const content = await fs.readFile(filePath, "utf-8"); const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); if (frontmatterMatch) { const frontmatter = frontmatterMatch[1]; const slug = file.replace(".md", ""); const titleMatch = frontmatter.match(/title:\s*["']?([^"'\n]+)["']?/); const dateMatch = frontmatter.match(/date:\s*["']?([^"'\n]+)["']?/); if (titleMatch) { articles.push({ slug, title: titleMatch[1], date: dateMatch ? dateMatch[1] : (/* @__PURE__ */ new Date()).toISOString() }); } } } return articles; } catch (error) { console.error("Error loading blog articles:", error); return []; } } async function getImageFiles() { try { const imagesDir = path.join(process.cwd(), "public", "images"); const images = []; async function scanDirectory(dir, relativePath = "") { try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { await scanDirectory(itemPath, path.join(relativePath, item)); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { images.push({ path: `/images/${path.join(relativePath, item).replace(/\\/g, "/")}`, filename: item }); } } } catch (error) { console.warn(`Could not scan directory ${dir}:`, error.message); } } await scanDirectory(imagesDir); return images; } catch (error) { console.error("Error loading images:", error); return []; } } async function getAllSitemapUrls() { const baseUrl = getSiteOrigin(); const urls = []; const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0]; STATIC_PAGES.forEach((page) => { urls.push({ loc: `${baseUrl}${page.path}`, lastmod: now, changefreq: page.changefreq, priority: page.priority }); }); TOOLS.forEach((tool) => { urls.push({ loc: `${baseUrl}${tool.path}`, lastmod: now, changefreq: "weekly", priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); try { const articles = await loadBlogArticles(); articles.forEach((article) => { urls.push({ loc: `${baseUrl}/blog/${article.slug}`, lastmod: article.date.split("T")[0], changefreq: "monthly", priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); } catch (error) { console.error("Error adding blog articles to sitemap:", error); } try { const images = await getImageFiles(); images.forEach((image) => { urls.push({ loc: `${baseUrl}${image.path}`, lastmod: now, changefreq: "yearly", priority: SITEMAP_CONFIG.LOW_PRIORITY }); }); } catch (error) { console.error("Error adding images to sitemap:", error); } return urls; } function formatSitemapXml(urls) { const xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>'; const urlsetOpen = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; const urlsetClose = "</urlset>"; const urlEntries = urls.map((url) => { let urlXml = ` <url> <loc>${escapeXml(url.loc)}</loc>`; if (url.lastmod) { urlXml += ` <lastmod>${url.lastmod}</lastmod>`; } if (url.changefreq) { urlXml += ` <changefreq>${url.changefreq}</changefreq>`; } if (url.priority !== void 0) { urlXml += ` <priority>${url.priority.toFixed(1)}</priority>`; } urlXml += "\n </url>"; return urlXml; }).join("\n"); return `${xmlHeader} ${urlsetOpen} ${urlEntries} ${urlsetClose}`; } function isCacheValid(timestamp) { return timestamp && Date.now() - timestamp < SITEMAP_CONFIG.CACHE_DURATION; } async function generateSitemap() { try { if (sitemapCache && isCacheValid(sitemapCache.timestamp)) { console.log("Returning cached sitemap"); return sitemapCache.xml; } console.log("Generating new sitemap..."); const allUrls = await getAllSitemapUrls(); console.log(`Found ${allUrls.length} URLs for sitemap`); const xml = formatSitemapXml(allUrls); sitemapCache = { xml, timestamp: Date.now(), urlCount: allUrls.length }; console.log("Sitemap generated and cached successfully"); return xml; } catch (error) { console.error("Error generating sitemap:", error); throw new Error("Failed to generate sitemap"); } } exports2.handler = async function(event, context) { if (event.httpMethod === "OPTIONS") { return { statusCode: 200, headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, OPTIONS", "Access-Control-Allow-Headers": "Content-Type" }, body: "" }; } if (event.httpMethod !== "GET") { return { statusCode: 405, headers: { "Content-Type": "application/xml; charset=utf-8" }, body: '<?xml version="1.0" encoding="UTF-8"?><error>Method Not Allowed</error>' }; } try { console.log("Sitemap request received"); const sitemapXml = await generateSitemap(); return { statusCode: 200, headers: { "Content-Type": "application/xml; charset=utf-8", "Cache-Control": "public, max-age=3600, s-maxage=3600", // Cache for 1 hour "Access-Control-Allow-Origin": "*" }, body: sitemapXml }; } catch (error) { console.error("Error serving sitemap:", error); return { statusCode: 500, headers: { "Content-Type": "application/xml; charset=utf-8" }, body: '<?xml version="1.0" encoding="UTF-8"?><error>Internal Server Error</error>' }; } }; } }); // netlify/functions/sitemap-admin.js var { handler: sitemapHandler } = require_sitemap(); var adminCache = { stats: null, lastStatsUpdate: null }; function isValidAdminToken(authHeader) { if (!authHeader) return false; const token = authHeader.replace("Bearer ", ""); const validTokens = [ process.env.SITEMAP_ADMIN_KEY, process.env.NETLIFY_AUTH_TOKEN // Fallback to Netlify token ].filter(Boolean); return validTokens.includes(token); } async function getSitemapStats() { try { if (adminCache.stats && adminCache.lastStatsUpdate && Date.now() - adminCache.lastStatsUpdate < 5 * 60 * 1e3) { return adminCache.stats; } const fs = require("fs").promises; const path = require("path"); let blogCount = 0; try { const contentDir = path.join(process.cwd(), "content", "blog"); const files = await fs.readdir(contentDir); blogCount = files.filter((file) => file.endsWith(".md")).length; } catch (error) { console.warn("Could not count blog articles:", error.message); } let imageCount = 0; try { const imagesDir = path.join(process.cwd(), "public", "images"); async function countImages(dir) { let count = 0; try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { count += await countImages(itemPath); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { count++; } } } catch (error) { console.warn(`Could not count images in ${dir}:`, error.message); } return count; } imageCount = await countImages(imagesDir); } catch (error) { console.warn("Could not count images:", error.message); } const staticPages = 9; const toolPages = 15; const totalUrls = staticPages + toolPages + blogCount + imageCount; const stats = { totalUrls, breakdown: { staticPages, toolPages, blogArticles: blogCount, images: imageCount }, sitemapCount: Math.ceil(totalUrls / 5e4), lastGenerated: (/* @__PURE__ */ new Date()).toISOString(), cacheValid: true // Simplified for this implementation }; adminCache.stats = stats; adminCache.lastStatsUpdate = Date.now(); return stats; } catch (error) { console.error("Error getting sitemap stats:", error); return { totalUrls: 0, breakdown: { staticPages: 0, toolPages: 0, blogArticles: 0, images: 0 }, sitemapCount: 0, lastGenerated: null, cacheValid: false, error: error.message }; } } function invalidateSitemapCache() { adminCache = { stats: null, lastStatsUpdate: null }; console.log("Sitemap cache invalidated"); return { success: true, message: "Sitemap cache invalidated successfully", timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } async function regenerateSitemap() { try { console.log("Manual sitemap regeneration triggered"); invalidateSitemapCache(); const mockEvent = { httpMethod: "GET", path: "/sitemap.xml", headers: {} }; const result = await sitemapHandler(mockEvent, {}); if (result.statusCode === 200) { const stats = await getSitemapStats(); return { success: true, message: "Sitemap regenerated successfully", stats, timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } else { throw new Error("Sitemap generation failed"); } } catch (error) { console.error("Error during manual sitemap regeneration:", error); return { success: false, message: `Failed to regenerate sitemap: ${error.message}`, timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } } async function handleWebhook(event) { try { const body = JSON.parse(event.body || "{}"); const { action, type } = body; console.log("Webhook received:", { action, type }); const shouldRegenerate = [ "published", "created", "updated", "deleted" ].includes(action) && [ "blog", "article", "page", "tool", "image" ].includes(type); if (shouldRegenerate) { console.log("Triggering sitemap regeneration due to content change"); const result = await regenerateSitemap(); return { statusCode: 200, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: "Webhook processed successfully", sitemapRegenerated: true, result }) }; } else { return { statusCode: 200, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: "Webhook received but no sitemap regeneration needed", sitemapRegenerated: false }) }; } } catch (error) { console.error("Error processing webhook:", error); return { statusCode: 500, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ error: "Failed to process webhook", message: error.message }) }; } } exports.handler = async function(event, context) { if (event.httpMethod === "OPTIONS") { return { statusCode: 200, headers: { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, OPTIONS", "Access-Control-Allow-Headers": "Content-Type, Authorization" }, body: "" }; } const path = event.path || ""; const method = event.httpMethod; try { if (path.includes("/webhook") && method === "POST") { return await handleWebhook(event); } const authHeader = event.headers.authorization || event.headers.Authorization; if (!isValidAdminToken(authHeader)) { return { statusCode: 401, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ error: "Unauthorized", message: "Valid admin token required" }) }; } if (path.includes("/stats") && method === "GET") { const stats = await getSitemapStats(); return { statusCode: 200, headers: { "Content-Type": "application/json", "Cache-Control": "no-cache" }, body: JSON.stringify({ success: true, stats, timestamp: (/* @__PURE__ */ new Date()).toISOString() }) }; } if (path.includes("/regenerate") && method === "POST") { const result = await regenerateSitemap(); return { statusCode: result.success ? 200 : 500, headers: { "Content-Type": "application/json", "Cache-Control": "no-cache" }, body: JSON.stringify(result) }; } if (path.includes("/invalidate") && method === "POST") { const result = invalidateSitemapCache(); return { statusCode: 200, headers: { "Content-Type": "application/json", "Cache-Control": "no-cache" }, body: JSON.stringify(result) }; } return { statusCode: 404, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ error: "Not Found", message: "Unknown admin endpoint", availableEndpoints: [ "GET /stats", "POST /regenerate", "POST /invalidate", "POST /webhook" ] }) }; } catch (error) { console.error("Error in sitemap admin function:", error); return { statusCode: 500, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ error: "Internal Server Error", message: error.message }) }; } }; //# sourceMappingURL=sitemap-admin.js.map
๐Ÿ“„ sitemap-admin.js.map
{ "version": 3, "sources": ["../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap.js", "../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap-admin.js"], "sourceRoot": "C:/Users/6732~1/AppData/Local/Temp/tmp-13180-Oz6uPhesQX1K", "sourcesContent": ["// Netlify function for serving sitemap.xml\nconst fs = require('fs').promises;\nconst path = require('path');\n\n// Import the sitemap utilities (we'll need to adapt these for Node.js)\n// Since we can't directly import TypeScript modules in Netlify functions,\n// we'll implement the core functionality here\n\n// Configuration\nconst SITEMAP_CONFIG = {\n MAX_URLS_PER_SITEMAP: 50000,\n CACHE_DURATION: 24 * 60 * 60 * 1000, // 24 hours\n DEFAULT_CHANGEFREQ: 'weekly',\n DEFAULT_PRIORITY: 0.5,\n HIGH_PRIORITY: 0.9,\n MEDIUM_PRIORITY: 0.7,\n LOW_PRIORITY: 0.3,\n};\n\n// Static pages configuration\nconst STATIC_PAGES = [\n { path: '/', changefreq: 'daily', priority: 1.0 },\n { path: '/tools', changefreq: 'weekly', priority: 0.9 },\n { path: '/blog', changefreq: 'daily', priority: 0.8 },\n { path: '/about', changefreq: 'monthly', priority: 0.6 },\n { path: '/contact', changefreq: 'monthly', priority: 0.6 },\n { path: '/privacy-policy', changefreq: 'yearly', priority: 0.3 },\n { path: '/terms-of-use', changefreq: 'yearly', priority: 0.3 },\n { path: '/dmca', changefreq: 'yearly', priority: 0.3 },\n { path: '/cookies-policy', changefreq: 'yearly', priority: 0.3 },\n];\n\n/**\n * Load tools from the actual tools data file\n */\nasync function loadTools() {\n try {\n // Read the tools.ts file and extract the tools array\n const toolsFilePath = path.join(process.cwd(), 'src', 'data', 'tools.ts');\n const toolsContent = await fs.readFile(toolsFilePath, 'utf-8');\n \n // Extract tools data using regex (since we can't directly import TypeScript)\n const toolsMatch = toolsContent.match(/export const tools: Tool\\[\\] = \\[([\\s\\S]*?)\\];/);\n if (!toolsMatch) {\n throw new Error('Could not parse tools from tools.ts');\n }\n \n // Parse each tool object\n const toolsArrayContent = toolsMatch[1];\n const toolObjects = [];\n \n // Split by tool objects (looking for id, name, path patterns)\n const toolMatches = toolsArrayContent.match(/\\{[^}]*id:\\s*['\"`]([^'\"`]+)['\"`][^}]*name:\\s*['\"`]([^'\"`]+)['\"`][^}]*path:\\s*['\"`]([^'\"`]+)['\"`][^}]*\\}/g);\n \n if (toolMatches) {\n for (const toolMatch of toolMatches) {\n const idMatch = toolMatch.match(/id:\\s*['\"`]([^'\"`]+)['\"`]/);\n const nameMatch = toolMatch.match(/name:\\s*['\"`]([^'\"`]+)['\"`]/);\n const pathMatch = toolMatch.match(/path:\\s*['\"`]([^'\"`]+)['\"`]/);\n \n if (idMatch && nameMatch && pathMatch) {\n toolObjects.push({\n id: idMatch[1],\n name: nameMatch[1],\n path: pathMatch[1]\n });\n }\n }\n }\n \n return toolObjects;\n } catch (error) {\n console.error('Error loading tools:', error);\n // Fallback to empty array if loading fails\n return [];\n }\n}\n\n// Cache storage (in production, this could be in a database or external cache)\nlet sitemapCache = null;\n\n/**\n * Get site origin\n */\nfunction getSiteOrigin() {\n return process.env.URL || process.env.SITE_URL || 'https://modernphototools.com';\n}\n\n/**\n * Escape XML characters\n */\nfunction escapeXml(str) {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Load blog articles from markdown files\n */\nasync function loadBlogArticles() {\n try {\n const contentDir = path.join(process.cwd(), 'content', 'blog');\n const files = await fs.readdir(contentDir);\n const markdownFiles = files.filter(file => file.endsWith('.md'));\n \n const articles = [];\n for (const file of markdownFiles) {\n const filePath = path.join(contentDir, file);\n const content = await fs.readFile(filePath, 'utf-8');\n \n // Extract frontmatter\n const frontmatterMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (frontmatterMatch) {\n const frontmatter = frontmatterMatch[1];\n const slug = file.replace('.md', '');\n \n // Parse basic frontmatter (simplified)\n const titleMatch = frontmatter.match(/title:\\s*[\"']?([^\"'\\n]+)[\"']?/);\n const dateMatch = frontmatter.match(/date:\\s*[\"']?([^\"'\\n]+)[\"']?/);\n \n if (titleMatch) {\n articles.push({\n slug,\n title: titleMatch[1],\n date: dateMatch ? dateMatch[1] : new Date().toISOString(),\n });\n }\n }\n }\n \n return articles;\n } catch (error) {\n console.error('Error loading blog articles:', error);\n return [];\n }\n}\n\n/**\n * Get all image files from public directory\n */\nasync function getImageFiles() {\n try {\n const imagesDir = path.join(process.cwd(), 'public', 'images');\n const images = [];\n \n async function scanDirectory(dir, relativePath = '') {\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n await scanDirectory(itemPath, path.join(relativePath, item));\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n images.push({\n path: `/images/${path.join(relativePath, item).replace(/\\\\/g, '/')}`,\n filename: item,\n });\n }\n }\n } catch (error) {\n console.warn(`Could not scan directory ${dir}:`, error.message);\n }\n }\n \n await scanDirectory(imagesDir);\n return images;\n } catch (error) {\n console.error('Error loading images:', error);\n return [];\n }\n}\n\n/**\n * Generate all sitemap URLs\n */\nasync function getAllSitemapUrls() {\n const baseUrl = getSiteOrigin();\n const urls = [];\n const now = new Date().toISOString().split('T')[0];\n \n // Add static pages\n STATIC_PAGES.forEach(page => {\n urls.push({\n loc: `${baseUrl}${page.path}`,\n lastmod: now,\n changefreq: page.changefreq,\n priority: page.priority,\n });\n });\n \n // Add tool pages\n TOOLS.forEach(tool => {\n urls.push({\n loc: `${baseUrl}${tool.path}`,\n lastmod: now,\n changefreq: 'weekly',\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n \n // Add blog articles\n try {\n const articles = await loadBlogArticles();\n articles.forEach(article => {\n urls.push({\n loc: `${baseUrl}/blog/${article.slug}`,\n lastmod: article.date.split('T')[0],\n changefreq: 'monthly',\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n } catch (error) {\n console.error('Error adding blog articles to sitemap:', error);\n }\n \n // Add image files\n try {\n const images = await getImageFiles();\n images.forEach(image => {\n urls.push({\n loc: `${baseUrl}${image.path}`,\n lastmod: now,\n changefreq: 'yearly',\n priority: SITEMAP_CONFIG.LOW_PRIORITY,\n });\n });\n } catch (error) {\n console.error('Error adding images to sitemap:', error);\n }\n \n return urls;\n}\n\n/**\n * Format sitemap XML\n */\nfunction formatSitemapXml(urls) {\n const xmlHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n const urlsetOpen = '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n const urlsetClose = '</urlset>';\n \n const urlEntries = urls.map(url => {\n let urlXml = ` <url>\\n <loc>${escapeXml(url.loc)}</loc>`;\n \n if (url.lastmod) {\n urlXml += `\\n <lastmod>${url.lastmod}</lastmod>`;\n }\n \n if (url.changefreq) {\n urlXml += `\\n <changefreq>${url.changefreq}</changefreq>`;\n }\n \n if (url.priority !== undefined) {\n urlXml += `\\n <priority>${url.priority.toFixed(1)}</priority>`;\n }\n \n urlXml += '\\n </url>';\n return urlXml;\n }).join('\\n');\n \n return `${xmlHeader}\\n${urlsetOpen}\\n${urlEntries}\\n${urlsetClose}`;\n}\n\n/**\n * Check if cache is valid\n */\nfunction isCacheValid(timestamp) {\n return timestamp && (Date.now() - timestamp) < SITEMAP_CONFIG.CACHE_DURATION;\n}\n\n/**\n * Generate sitemap\n */\nasync function generateSitemap() {\n try {\n // Check cache first\n if (sitemapCache && isCacheValid(sitemapCache.timestamp)) {\n console.log('Returning cached sitemap');\n return sitemapCache.xml;\n }\n \n console.log('Generating new sitemap...');\n \n // Get all URLs\n const allUrls = await getAllSitemapUrls();\n console.log(`Found ${allUrls.length} URLs for sitemap`);\n \n // Generate XML\n const xml = formatSitemapXml(allUrls);\n \n // Cache the result\n sitemapCache = {\n xml,\n timestamp: Date.now(),\n urlCount: allUrls.length,\n };\n \n console.log('Sitemap generated and cached successfully');\n return xml;\n \n } catch (error) {\n console.error('Error generating sitemap:', error);\n throw new Error('Failed to generate sitemap');\n }\n}\n\n/**\n * Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === 'OPTIONS') {\n return {\n statusCode: 200,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, OPTIONS',\n 'Access-Control-Allow-Headers': 'Content-Type',\n },\n body: '',\n };\n }\n \n // Only allow GET requests\n if (event.httpMethod !== 'GET') {\n return {\n statusCode: 405,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n },\n body: '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error>Method Not Allowed</error>',\n };\n }\n \n try {\n console.log('Sitemap request received');\n \n // Generate sitemap\n const sitemapXml = await generateSitemap();\n \n // Return sitemap with appropriate headers\n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n 'Cache-Control': 'public, max-age=3600, s-maxage=3600', // Cache for 1 hour\n 'Access-Control-Allow-Origin': '*',\n },\n body: sitemapXml,\n };\n \n } catch (error) {\n console.error('Error serving sitemap:', error);\n \n return {\n statusCode: 500,\n headers: {\n 'Content-Type': 'application/xml; charset=utf-8',\n },\n body: '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error>Internal Server Error</error>',\n };\n }\n};", "// Netlify function for sitemap administration\nconst { handler: sitemapHandler } = require('./sitemap');\n\n// Simple in-memory cache for admin operations\nlet adminCache = {\n stats: null,\n lastStatsUpdate: null,\n};\n\n/**\n * Validate admin authentication\n */\nfunction isValidAdminToken(authHeader) {\n if (!authHeader) return false;\n \n const token = authHeader.replace('Bearer ', '');\n const validTokens = [\n process.env.SITEMAP_ADMIN_KEY,\n process.env.NETLIFY_AUTH_TOKEN, // Fallback to Netlify token\n ].filter(Boolean);\n \n return validTokens.includes(token);\n}\n\n/**\n * Get sitemap statistics\n */\nasync function getSitemapStats() {\n try {\n // Check cache first (cache for 5 minutes)\n if (adminCache.stats && adminCache.lastStatsUpdate && \n (Date.now() - adminCache.lastStatsUpdate) < 5 * 60 * 1000) {\n return adminCache.stats;\n }\n \n // Import sitemap utilities\n const fs = require('fs').promises;\n const path = require('path');\n \n // Count blog articles\n let blogCount = 0;\n try {\n const contentDir = path.join(process.cwd(), 'content', 'blog');\n const files = await fs.readdir(contentDir);\n blogCount = files.filter(file => file.endsWith('.md')).length;\n } catch (error) {\n console.warn('Could not count blog articles:', error.message);\n }\n \n // Count images\n let imageCount = 0;\n try {\n const imagesDir = path.join(process.cwd(), 'public', 'images');\n \n async function countImages(dir) {\n let count = 0;\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n count += await countImages(itemPath);\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n count++;\n }\n }\n } catch (error) {\n console.warn(`Could not count images in ${dir}:`, error.message);\n }\n return count;\n }\n \n imageCount = await countImages(imagesDir);\n } catch (error) {\n console.warn('Could not count images:', error.message);\n }\n \n // Calculate totals\n const staticPages = 9; // From STATIC_PAGES array\n const toolPages = 15; // From TOOLS array\n const totalUrls = staticPages + toolPages + blogCount + imageCount;\n \n const stats = {\n totalUrls,\n breakdown: {\n staticPages,\n toolPages,\n blogArticles: blogCount,\n images: imageCount,\n },\n sitemapCount: Math.ceil(totalUrls / 50000),\n lastGenerated: new Date().toISOString(),\n cacheValid: true, // Simplified for this implementation\n };\n \n // Cache the results\n adminCache.stats = stats;\n adminCache.lastStatsUpdate = Date.now();\n \n return stats;\n \n } catch (error) {\n console.error('Error getting sitemap stats:', error);\n return {\n totalUrls: 0,\n breakdown: {\n staticPages: 0,\n toolPages: 0,\n blogArticles: 0,\n images: 0,\n },\n sitemapCount: 0,\n lastGenerated: null,\n cacheValid: false,\n error: error.message,\n };\n }\n}\n\n/**\n * Invalidate sitemap cache\n */\nfunction invalidateSitemapCache() {\n // Clear admin cache\n adminCache = {\n stats: null,\n lastStatsUpdate: null,\n };\n \n // Clear sitemap cache (this would need to be coordinated with the main sitemap function)\n console.log('Sitemap cache invalidated');\n \n return {\n success: true,\n message: 'Sitemap cache invalidated successfully',\n timestamp: new Date().toISOString(),\n };\n}\n\n/**\n * Regenerate sitemap\n */\nasync function regenerateSitemap() {\n try {\n console.log('Manual sitemap regeneration triggered');\n \n // Invalidate cache first\n invalidateSitemapCache();\n \n // Generate new sitemap by calling the main sitemap function\n const mockEvent = {\n httpMethod: 'GET',\n path: '/sitemap.xml',\n headers: {},\n };\n \n const result = await sitemapHandler(mockEvent, {});\n \n if (result.statusCode === 200) {\n const stats = await getSitemapStats();\n \n return {\n success: true,\n message: 'Sitemap regenerated successfully',\n stats,\n timestamp: new Date().toISOString(),\n };\n } else {\n throw new Error('Sitemap generation failed');\n }\n \n } catch (error) {\n console.error('Error during manual sitemap regeneration:', error);\n return {\n success: false,\n message: `Failed to regenerate sitemap: ${error.message}`,\n timestamp: new Date().toISOString(),\n };\n }\n}\n\n/**\n * Handle webhook for automatic sitemap updates\n */\nasync function handleWebhook(event) {\n try {\n const body = JSON.parse(event.body || '{}');\n const { action, type } = body;\n \n console.log('Webhook received:', { action, type });\n \n // Determine if we should regenerate the sitemap\n const shouldRegenerate = [\n 'published',\n 'created',\n 'updated',\n 'deleted',\n ].includes(action) && [\n 'blog',\n 'article',\n 'page',\n 'tool',\n 'image',\n ].includes(type);\n \n if (shouldRegenerate) {\n console.log('Triggering sitemap regeneration due to content change');\n const result = await regenerateSitemap();\n \n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n message: 'Webhook processed successfully',\n sitemapRegenerated: true,\n result,\n }),\n };\n } else {\n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n message: 'Webhook received but no sitemap regeneration needed',\n sitemapRegenerated: false,\n }),\n };\n }\n \n } catch (error) {\n console.error('Error processing webhook:', error);\n return {\n statusCode: 500,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n error: 'Failed to process webhook',\n message: error.message,\n }),\n };\n }\n}\n\n/**\n * Main Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === 'OPTIONS') {\n return {\n statusCode: 200,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n 'Access-Control-Allow-Headers': 'Content-Type, Authorization',\n },\n body: '',\n };\n }\n \n const path = event.path || '';\n const method = event.httpMethod;\n \n try {\n // Handle webhook (no auth required for webhooks)\n if (path.includes('/webhook') && method === 'POST') {\n return await handleWebhook(event);\n }\n \n // All other endpoints require authentication\n const authHeader = event.headers.authorization || event.headers.Authorization;\n if (!isValidAdminToken(authHeader)) {\n return {\n statusCode: 401,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n error: 'Unauthorized',\n message: 'Valid admin token required',\n }),\n };\n }\n \n // Handle stats request\n if (path.includes('/stats') && method === 'GET') {\n const stats = await getSitemapStats();\n \n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json',\n 'Cache-Control': 'no-cache',\n },\n body: JSON.stringify({\n success: true,\n stats,\n timestamp: new Date().toISOString(),\n }),\n };\n }\n \n // Handle regenerate request\n if (path.includes('/regenerate') && method === 'POST') {\n const result = await regenerateSitemap();\n \n return {\n statusCode: result.success ? 200 : 500,\n headers: {\n 'Content-Type': 'application/json',\n 'Cache-Control': 'no-cache',\n },\n body: JSON.stringify(result),\n };\n }\n \n // Handle cache invalidation request\n if (path.includes('/invalidate') && method === 'POST') {\n const result = invalidateSitemapCache();\n \n return {\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json',\n 'Cache-Control': 'no-cache',\n },\n body: JSON.stringify(result),\n };\n }\n \n // Default response for unknown endpoints\n return {\n statusCode: 404,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n error: 'Not Found',\n message: 'Unknown admin endpoint',\n availableEndpoints: [\n 'GET /stats',\n 'POST /regenerate',\n 'POST /invalidate',\n 'POST /webhook',\n ],\n }),\n };\n \n } catch (error) {\n console.error('Error in sitemap admin function:', error);\n \n return {\n statusCode: 500,\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n error: 'Internal Server Error',\n message: error.message,\n }),\n };\n }\n};"], "mappings": ";;;;;;AAAA;AAAA,iCAAAA,UAAA;AACA,QAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,QAAM,OAAO,QAAQ,MAAM;AAO3B,QAAM,iBAAiB;AAAA,MACrB,sBAAsB;AAAA,MACtB,gBAAgB,KAAK,KAAK,KAAK;AAAA;AAAA,MAC/B,oBAAoB;AAAA,MACpB,kBAAkB;AAAA,MAClB,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,cAAc;AAAA,IAChB;AAGA,QAAM,eAAe;AAAA,MACnB,EAAE,MAAM,KAAK,YAAY,SAAS,UAAU,EAAI;AAAA,MAChD,EAAE,MAAM,UAAU,YAAY,UAAU,UAAU,IAAI;AAAA,MACtD,EAAE,MAAM,SAAS,YAAY,SAAS,UAAU,IAAI;AAAA,MACpD,EAAE,MAAM,UAAU,YAAY,WAAW,UAAU,IAAI;AAAA,MACvD,EAAE,MAAM,YAAY,YAAY,WAAW,UAAU,IAAI;AAAA,MACzD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,MAC/D,EAAE,MAAM,iBAAiB,YAAY,UAAU,UAAU,IAAI;AAAA,MAC7D,EAAE,MAAM,SAAS,YAAY,UAAU,UAAU,IAAI;AAAA,MACrD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,IACjE;AAiDA,QAAI,eAAe;AAKnB,aAAS,gBAAgB;AACvB,aAAO,QAAQ,IAAI,OAAO,QAAQ,IAAI,YAAY;AAAA,IACpD;AAKA,aAAS,UAAU,KAAK;AACtB,aAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAAA,IAC1B;AAKA,mBAAe,mBAAmB;AAChC,UAAI;AACF,cAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,cAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,cAAM,gBAAgB,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC;AAE/D,cAAM,WAAW,CAAC;AAClB,mBAAW,QAAQ,eAAe;AAChC,gBAAM,WAAW,KAAK,KAAK,YAAY,IAAI;AAC3C,gBAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AAGnD,gBAAM,mBAAmB,QAAQ,MAAM,uBAAuB;AAC9D,cAAI,kBAAkB;AACpB,kBAAM,cAAc,iBAAiB,CAAC;AACtC,kBAAM,OAAO,KAAK,QAAQ,OAAO,EAAE;AAGnC,kBAAM,aAAa,YAAY,MAAM,+BAA+B;AACpE,kBAAM,YAAY,YAAY,MAAM,8BAA8B;AAElE,gBAAI,YAAY;AACd,uBAAS,KAAK;AAAA,gBACZ;AAAA,gBACA,OAAO,WAAW,CAAC;AAAA,gBACnB,MAAM,YAAY,UAAU,CAAC,KAAI,oBAAI,KAAK,GAAE,YAAY;AAAA,cAC1D,CAAC;AAAA,YACH;AAAA,UACF;AAAA,QACF;AAEA,eAAO;AAAA,MACT,SAAS,OAAO;AACd,gBAAQ,MAAM,gCAAgC,KAAK;AACnD,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAKA,mBAAe,gBAAgB;AAC7B,UAAI;AACF,cAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAC7D,cAAM,SAAS,CAAC;AAEhB,uBAAe,cAAc,KAAK,eAAe,IAAI;AACnD,cAAI;AACF,kBAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,uBAAW,QAAQ,OAAO;AACxB,oBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,oBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,kBAAI,KAAK,YAAY,GAAG;AACtB,sBAAM,cAAc,UAAU,KAAK,KAAK,cAAc,IAAI,CAAC;AAAA,cAC7D,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD,uBAAO,KAAK;AAAA,kBACV,MAAM,WAAW,KAAK,KAAK,cAAc,IAAI,EAAE,QAAQ,OAAO,GAAG,CAAC;AAAA,kBAClE,UAAU;AAAA,gBACZ,CAAC;AAAA,cACH;AAAA,YACF;AAAA,UACF,SAAS,OAAO;AACd,oBAAQ,KAAK,4BAA4B,GAAG,KAAK,MAAM,OAAO;AAAA,UAChE;AAAA,QACF;AAEA,cAAM,cAAc,SAAS;AAC7B,eAAO;AAAA,MACT,SAAS,OAAO;AACd,gBAAQ,MAAM,yBAAyB,KAAK;AAC5C,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAKA,mBAAe,oBAAoB;AACjC,YAAM,UAAU,cAAc;AAC9B,YAAM,OAAO,CAAC;AACd,YAAM,OAAM,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAGjD,mBAAa,QAAQ,UAAQ;AAC3B,aAAK,KAAK;AAAA,UACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT,YAAY,KAAK;AAAA,UACjB,UAAU,KAAK;AAAA,QACjB,CAAC;AAAA,MACH,CAAC;AAGD,YAAM,QAAQ,UAAQ;AACpB,aAAK,KAAK;AAAA,UACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,UAAU,eAAe;AAAA,QAC3B,CAAC;AAAA,MACH,CAAC;AAGD,UAAI;AACF,cAAM,WAAW,MAAM,iBAAiB;AACxC,iBAAS,QAAQ,aAAW;AAC1B,eAAK,KAAK;AAAA,YACR,KAAK,GAAG,OAAO,SAAS,QAAQ,IAAI;AAAA,YACpC,SAAS,QAAQ,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,YAClC,YAAY;AAAA,YACZ,UAAU,eAAe;AAAA,UAC3B,CAAC;AAAA,QACH,CAAC;AAAA,MACH,SAAS,OAAO;AACd,gBAAQ,MAAM,0CAA0C,KAAK;AAAA,MAC/D;AAGA,UAAI;AACF,cAAM,SAAS,MAAM,cAAc;AACnC,eAAO,QAAQ,WAAS;AACtB,eAAK,KAAK;AAAA,YACR,KAAK,GAAG,OAAO,GAAG,MAAM,IAAI;AAAA,YAC5B,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,UAAU,eAAe;AAAA,UAC3B,CAAC;AAAA,QACH,CAAC;AAAA,MACH,SAAS,OAAO;AACd,gBAAQ,MAAM,mCAAmC,KAAK;AAAA,MACxD;AAEA,aAAO;AAAA,IACT;AAKA,aAAS,iBAAiB,MAAM;AAC9B,YAAM,YAAY;AAClB,YAAM,aAAa;AACnB,YAAM,cAAc;AAEpB,YAAM,aAAa,KAAK,IAAI,SAAO;AACjC,YAAI,SAAS;AAAA,WAAqB,UAAU,IAAI,GAAG,CAAC;AAEpD,YAAI,IAAI,SAAS;AACf,oBAAU;AAAA,eAAkB,IAAI,OAAO;AAAA,QACzC;AAEA,YAAI,IAAI,YAAY;AAClB,oBAAU;AAAA,kBAAqB,IAAI,UAAU;AAAA,QAC/C;AAEA,YAAI,IAAI,aAAa,QAAW;AAC9B,oBAAU;AAAA,gBAAmB,IAAI,SAAS,QAAQ,CAAC,CAAC;AAAA,QACtD;AAEA,kBAAU;AACV,eAAO;AAAA,MACT,CAAC,EAAE,KAAK,IAAI;AAEZ,aAAO,GAAG,SAAS;AAAA,EAAK,UAAU;AAAA,EAAK,UAAU;AAAA,EAAK,WAAW;AAAA,IACnE;AAKA,aAAS,aAAa,WAAW;AAC/B,aAAO,aAAc,KAAK,IAAI,IAAI,YAAa,eAAe;AAAA,IAChE;AAKA,mBAAe,kBAAkB;AAC/B,UAAI;AAEF,YAAI,gBAAgB,aAAa,aAAa,SAAS,GAAG;AACxD,kBAAQ,IAAI,0BAA0B;AACtC,iBAAO,aAAa;AAAA,QACtB;AAEA,gBAAQ,IAAI,2BAA2B;AAGvC,cAAM,UAAU,MAAM,kBAAkB;AACxC,gBAAQ,IAAI,SAAS,QAAQ,MAAM,mBAAmB;AAGtD,cAAM,MAAM,iBAAiB,OAAO;AAGpC,uBAAe;AAAA,UACb;AAAA,UACA,WAAW,KAAK,IAAI;AAAA,UACpB,UAAU,QAAQ;AAAA,QACpB;AAEA,gBAAQ,IAAI,2CAA2C;AACvD,eAAO;AAAA,MAET,SAAS,OAAO;AACd,gBAAQ,MAAM,6BAA6B,KAAK;AAChD,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC9C;AAAA,IACF;AAKA,IAAAA,SAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,UAAI,MAAM,eAAe,WAAW;AAClC,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,+BAA+B;AAAA,YAC/B,gCAAgC;AAAA,YAChC,gCAAgC;AAAA,UAClC;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAGA,UAAI,MAAM,eAAe,OAAO;AAC9B,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,UAClB;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAEA,UAAI;AACF,gBAAQ,IAAI,0BAA0B;AAGtC,cAAM,aAAa,MAAM,gBAAgB;AAGzC,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,YAChB,iBAAiB;AAAA;AAAA,YACjB,+BAA+B;AAAA,UACjC;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MAEF,SAAS,OAAO;AACd,gBAAQ,MAAM,0BAA0B,KAAK;AAE7C,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,UAClB;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;AChXA,IAAM,EAAE,SAAS,eAAe,IAAI;AAGpC,IAAI,aAAa;AAAA,EACf,OAAO;AAAA,EACP,iBAAiB;AACnB;AAKA,SAAS,kBAAkB,YAAY;AACrC,MAAI,CAAC,WAAY,QAAO;AAExB,QAAM,QAAQ,WAAW,QAAQ,WAAW,EAAE;AAC9C,QAAM,cAAc;AAAA,IAClB,QAAQ,IAAI;AAAA,IACZ,QAAQ,IAAI;AAAA;AAAA,EACd,EAAE,OAAO,OAAO;AAEhB,SAAO,YAAY,SAAS,KAAK;AACnC;AAKA,eAAe,kBAAkB;AAC/B,MAAI;AAEF,QAAI,WAAW,SAAS,WAAW,mBAC9B,KAAK,IAAI,IAAI,WAAW,kBAAmB,IAAI,KAAK,KAAM;AAC7D,aAAO,WAAW;AAAA,IACpB;AAGA,UAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,UAAM,OAAO,QAAQ,MAAM;AAG3B,QAAI,YAAY;AAChB,QAAI;AACF,YAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,YAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,kBAAY,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC,EAAE;AAAA,IACzD,SAAS,OAAO;AACd,cAAQ,KAAK,kCAAkC,MAAM,OAAO;AAAA,IAC9D;AAGA,QAAI,aAAa;AACjB,QAAI;AACF,YAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAE7D,qBAAe,YAAY,KAAK;AAC9B,YAAI,QAAQ;AACZ,YAAI;AACF,gBAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,qBAAW,QAAQ,OAAO;AACxB,kBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,kBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,gBAAI,KAAK,YAAY,GAAG;AACtB,uBAAS,MAAM,YAAY,QAAQ;AAAA,YACrC,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD;AAAA,YACF;AAAA,UACF;AAAA,QACF,SAAS,OAAO;AACd,kBAAQ,KAAK,6BAA6B,GAAG,KAAK,MAAM,OAAO;AAAA,QACjE;AACA,eAAO;AAAA,MACT;AAEA,mBAAa,MAAM,YAAY,SAAS;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,KAAK,2BAA2B,MAAM,OAAO;AAAA,IACvD;AAGA,UAAM,cAAc;AACpB,UAAM,YAAY;AAClB,UAAM,YAAY,cAAc,YAAY,YAAY;AAExD,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,cAAc;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MACA,cAAc,KAAK,KAAK,YAAY,GAAK;AAAA,MACzC,gBAAe,oBAAI,KAAK,GAAE,YAAY;AAAA,MACtC,YAAY;AAAA;AAAA,IACd;AAGA,eAAW,QAAQ;AACnB,eAAW,kBAAkB,KAAK,IAAI;AAEtC,WAAO;AAAA,EAET,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO;AAAA,MACL,WAAW;AAAA,MACX,WAAW;AAAA,QACT,aAAa;AAAA,QACb,WAAW;AAAA,QACX,cAAc;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,OAAO,MAAM;AAAA,IACf;AAAA,EACF;AACF;AAKA,SAAS,yBAAyB;AAEhC,eAAa;AAAA,IACX,OAAO;AAAA,IACP,iBAAiB;AAAA,EACnB;AAGA,UAAQ,IAAI,2BAA2B;AAEvC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACF;AAKA,eAAe,oBAAoB;AACjC,MAAI;AACF,YAAQ,IAAI,uCAAuC;AAGnD,2BAAuB;AAGvB,UAAM,YAAY;AAAA,MAChB,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,IACZ;AAEA,UAAM,SAAS,MAAM,eAAe,WAAW,CAAC,CAAC;AAEjD,QAAI,OAAO,eAAe,KAAK;AAC7B,YAAM,QAAQ,MAAM,gBAAgB;AAEpC,aAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MACpC;AAAA,IACF,OAAO;AACL,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,6CAA6C,KAAK;AAChE,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,iCAAiC,MAAM,OAAO;AAAA,MACvD,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAKA,eAAe,cAAc,OAAO;AAClC,MAAI;AACF,UAAM,OAAO,KAAK,MAAM,MAAM,QAAQ,IAAI;AAC1C,UAAM,EAAE,QAAQ,KAAK,IAAI;AAEzB,YAAQ,IAAI,qBAAqB,EAAE,QAAQ,KAAK,CAAC;AAGjD,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,MAAM,KAAK;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,IAAI;AAEf,QAAI,kBAAkB;AACpB,cAAQ,IAAI,uDAAuD;AACnE,YAAM,SAAS,MAAM,kBAAkB;AAEvC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT,oBAAoB;AAAA,UACpB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,OAAO;AACL,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT,oBAAoB;AAAA,QACtB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,6BAA6B,KAAK;AAChD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAKA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,QAAM,OAAO,MAAM,QAAQ;AAC3B,QAAM,SAAS,MAAM;AAErB,MAAI;AAEF,QAAI,KAAK,SAAS,UAAU,KAAK,WAAW,QAAQ;AAClD,aAAO,MAAM,cAAc,KAAK;AAAA,IAClC;AAGA,UAAM,aAAa,MAAM,QAAQ,iBAAiB,MAAM,QAAQ;AAChE,QAAI,CAAC,kBAAkB,UAAU,GAAG;AAClC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,QAAQ,KAAK,WAAW,OAAO;AAC/C,YAAM,QAAQ,MAAM,gBAAgB;AAEpC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT;AAAA,UACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,QACpC,CAAC;AAAA,MACH;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,aAAa,KAAK,WAAW,QAAQ;AACrD,YAAM,SAAS,MAAM,kBAAkB;AAEvC,aAAO;AAAA,QACL,YAAY,OAAO,UAAU,MAAM;AAAA,QACnC,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU,MAAM;AAAA,MAC7B;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,aAAa,KAAK,WAAW,QAAQ;AACrD,YAAM,SAAS,uBAAuB;AAEtC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU,MAAM;AAAA,MAC7B;AAAA,IACF;AAGA,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS;AAAA,QACT,oBAAoB;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,oCAAoC,KAAK;AAEvD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF;", "names": ["exports"] }
๐Ÿ“„ package.json
{"type":"commonjs"}
๐Ÿ“„ sitemap-admin.js
module.exports = require('./netlify/functions/sitemap-admin.js')
๐Ÿ“„ state.json
{ "geolocation": { "data": { "city": "Damietta", "country": { "code": "EG", "name": "Egypt" }, "subdivision": { "code": "DT", "name": "Damietta Governorate" }, "timezone": "Africa/Cairo", "latitude": 31.4166, "longitude": 31.8105 }, "timestamp": 1761763857385 } }
๐Ÿ“ v1
๐Ÿ“ functions
๐Ÿ“ .trae
๐Ÿ“ documents
๐Ÿ“ .vite
๐Ÿ“ deps
๐Ÿ“„ _metadata.json
{ "hash": "d387aa5f", "configHash": "ed5bde56", "lockfileHash": "e3b0c442", "browserHash": "3351bb2f", "optimized": {}, "chunks": {} }
๐Ÿ“„ package.json
{ "type": "module" }
๐Ÿ“„ NETLIFY_DEPLOYMENT.md
# Netlify Deployment Guide This guide explains how to deploy the LightX API proxy function to Netlify. ## Prerequisites 1. A Netlify account 2. Netlify CLI installed (`npm install -g netlify-cli`) 3. Your LightX API key ## Deployment Steps ### 1. Set up Environment Variables You need to set up your LightX API key as an environment variable in Netlify: 1. Go to your Netlify site dashboard 2. Navigate to Site settings > Build & deploy > Environment 3. Add a new variable: - Key: `LIGHTX_API_KEY` - Value: `13fc2dd3a975430b93850487c527d817_90b2d76b36a3491aa0d429457da8e3eb_andoraitools` ### 2. Deploy to Netlify You can deploy to Netlify using the Netlify CLI: ```bash # Login to Netlify npm install -g netlify-cli netlify login # Initialize your site (if not already done) netlify init # Deploy to Netlify netlify deploy --prod ``` Alternatively, you can connect your GitHub repository to Netlify for automatic deployments. ### 3. Verify Function Deployment After deployment, verify that your function is working: 1. Go to your Netlify site dashboard 2. Navigate to Functions 3. You should see `lightx-proxy` listed 4. Test the function by making a request to `https://your-netlify-site.netlify.app/api/lightx-proxy` ## Local Development For local development, you can use the Netlify CLI to test your functions: ```bash # Install dependencies in the functions directory cd netlify/functions npm install # Start the Netlify dev server cd ../.. netlify dev ``` This will start a local development server that simulates the Netlify environment, including your functions. ## Troubleshooting ### Function Not Found If your function is not found, check: 1. The function file is in the correct location (`netlify/functions/lightx-proxy.js`) 2. The `netlify.toml` file has the correct redirects 3. The function has been deployed successfully ### 403 Forbidden Error If you're getting a 403 Forbidden error from the LightX API: 1. Check that your API key is correctly set in the Netlify environment variables 2. Verify that your API key is valid and has not expired 3. Check the function logs in the Netlify dashboard for more details ### CORS Issues If you're experiencing CORS issues: 1. Check that the function is returning the correct CORS headers 2. Verify that your frontend is making requests to the correct URL ## Additional Resources - [Netlify Functions Documentation](https://docs.netlify.com/functions/overview/) - [Netlify CLI Documentation](https://docs.netlify.com/cli/get-started/)
๐Ÿ“„ NETLIFY_FUNCTION_SECURITY.md
# Netlify Serverless Function Security Guide ## Overview This document outlines the security enhancements implemented in the Netlify serverless function for dynamic environment variable access and secure API key handling. ## Key Security Features ### 1. Runtime Environment Variable Access - **Dynamic Reading**: Environment variables are read at runtime using `process.env`, not at build time - **Validation**: All environment variables are validated before use - **Secure Retrieval**: The `getSecureEnvVar()` function provides secure access with validation ### 2. API Key Security - **Runtime Validation**: API keys are validated for format and length - **Secure Storage**: API keys are stored in Netlify environment variables (not in code) - **No Logging**: API key values are never logged, only their presence is confirmed ### 3. Input Validation - **JSON Parsing**: Safe JSON parsing with error handling - **Endpoint Validation**: Endpoint parameters are validated for type and format - **Request Body Validation**: Request bodies are validated as proper objects ### 4. Error Handling - **Standardized Responses**: All errors use the `createErrorResponse()` function - **Detailed Logging**: Errors are logged with full details for debugging - **No Sensitive Data**: Error responses never expose sensitive information ### 5. Request Security - **Timeout Protection**: 30-second timeout prevents hanging requests - **CORS Headers**: Proper CORS headers for cross-origin requests - **User Agent**: Custom User-Agent header for API identification - **Cache Control**: No-cache headers prevent sensitive data caching ## Environment Variables Required ### Production Environment Set these in your Netlify dashboard under Site Settings > Environment Variables: ``` LIGHTX_API_KEY=your_actual_api_key_here NODE_ENV=production ``` ### Development Environment For local testing, create a `.env` file in the `netlify/functions` directory: ``` LIGHTX_API_KEY=your_test_api_key_here NODE_ENV=development ``` ## Security Best Practices Implemented 1. **No Build-Time Dependencies**: Environment variables are accessed at runtime only 2. **Input Sanitization**: All inputs are validated and sanitized 3. **Error Boundaries**: Comprehensive error handling prevents crashes 4. **Logging Controls**: Sensitive information is never logged 5. **Timeout Protection**: Prevents resource exhaustion attacks 6. **CORS Security**: Proper CORS configuration for web security ## Testing the Function ### Local Testing 1. Install Netlify CLI: `npm install -g netlify-cli` 2. Run locally: `netlify dev` 3. Test endpoint: `http://localhost:8888/.netlify/functions/lightx-proxy` ### Production Testing 1. Deploy to Netlify 2. Set environment variables in Netlify dashboard 3. Test with your application ## Deployment Notes - **No Redeployment Required**: Environment variable changes take effect immediately - **Zero Downtime**: Function updates don't require application restarts - **Secure by Default**: All security features are enabled by default ## Monitoring and Debugging - **Development Mode**: Detailed logging when `NODE_ENV` is not "production" - **Error Tracking**: All errors are logged with stack traces - **Performance Monitoring**: Request/response timing information available ## Security Checklist - [ ] Environment variables set in Netlify dashboard - [ ] API keys are not committed to version control - [ ] Function deployed and tested - [ ] Error handling verified - [ ] CORS headers working correctly - [ ] Timeout protection tested - [ ] Input validation confirmed
๐Ÿ“„ New Text Document.txt
Complete Specification: AI Prompt Generator Tool Executive Summary A rule-based, interactive prompt engineering tool that transforms amateur AI prompts into professional-grade prompts using 4 proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Zero authentication required, completely free, educational, and seamlessly integrated into modernphototools.com. 1. Product Overview Core Value Proposition "Turn your simple AI idea into a professional prompt in 60 secondsโ€”no AI expertise required." Target Users Photographers using AI image generators (Midjourney, DALL-E, Stable Diffusion) Content creators using ChatGPT, Claude, Gemini Marketers writing AI-powered copy Anyone frustrated with generic AI outputs Key Differentiator Educational + Practical: Users don't just get a better promptโ€”they learn WHY it's better through contextual tooltips. 2. User Journey Flow Landing Page (Quick-Start Wizard) โ†“ [4 Big Visual Cards - User Selects Goal] โ†“ Initial Prompt Input โ†“ Framework Auto-Detected (Rule-Based) โ†“ Adaptive Questionnaire (3-7 questions) โ†“ Before/After Comparison Display โ†“ Copy to Clipboard โ†’ Done 3. Detailed Feature Specification 3.1 Landing Page (/prompt-generator) Layout: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ [Site Header - Existing Component] โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ ๐ŸŽฏ AI Prompt Generator โ”‚ โ”‚ Transform simple ideas into โ”‚ โ”‚ professional AI prompts โ”‚ โ”‚ โ”‚ โ”‚ What do you want to create? โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ ๐Ÿ“Š ICDF โ”‚ โ”‚ ๐Ÿ‘” RCREOCโ”‚ โ”‚ โ”‚ โ”‚ Analyze โ”‚ โ”‚ Expert โ”‚ โ”‚ โ”‚ โ”‚ Data โ”‚ โ”‚ Advice โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โœ๏ธ MICRO โ”‚ โ”‚ ๐Ÿ’ฐ COSTARโ”‚ โ”‚ โ”‚ โ”‚ Create โ”‚ โ”‚ Marketingโ”‚ โ”‚ โ”‚ โ”‚ Content โ”‚ โ”‚ & Sales โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ [Not sure? Describe your goal โ†’] โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Framework Cards: Framework Icon Title Subtitle Use Cases ICDF ๐Ÿ“Š Analyze Data Get precise, analytical results "Review my photos", "Analyze traffic", "Evaluate performance" RCREOC ๐Ÿ‘” Expert Advice Create an AI expert consultant "Professional feedback", "Technical review", "Expert opinion" MICRO โœ๏ธ Create Content Write compelling content "Blog post", "YouTube script", "Social media", "Image prompt" COSTAR ๐Ÿ’ฐ Marketing & Sales Craft persuasive copy "Sales email", "Product description", "Ad copy" Visual Design: Cards: 2x2 grid on desktop, stacked on mobile Each card: Icon (large), Title (bold), Subtitle (light), hover effect Colors: Match existing site palette "Not sure?" fallback: Opens text area with keyword detection 3.2 Framework Detection Logic (Rule-Based) File: /lib/prompt-frameworks/detector.ts typescript interface KeywordMap { framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; keywords: string[]; weight: number; } const DETECTION_RULES: KeywordMap[] = [ { framework: 'ICDF', keywords: ['analyze', 'review', 'evaluate', 'assess', 'data', 'metrics', 'performance', 'statistics', 'report', 'insights'], weight: 1 }, { framework: 'RCREOC', keywords: ['expert', 'professional', 'advice', 'consult', 'opinion', 'feedback', 'critique', 'recommend', 'specialist'], weight: 1 }, { framework: 'MICRO', keywords: ['write', 'create', 'content', 'blog', 'script', 'post', 'article', 'story', 'caption', 'image', 'photo', 'picture', 'generate'], weight: 1 }, { framework: 'COSTAR', keywords: ['sell', 'marketing', 'email', 'ad', 'promotion', 'sales', 'campaign', 'offer', 'discount', 'buy', 'customer'], weight: 1 } ]; function detectFramework(userInput: string): string { // Scoring logic: count keyword matches // Return framework with highest score // Default to MICRO if no clear match } 3.3 Adaptive Questionnaire System Question Types: Multiple Choice (Buttons) Tone/Style selection Target audience categories Content format types Timeframe/urgency Text Input (Fields) Product/service descriptions Specific context details Custom data inputs Unique requirements Question Sets by Framework: ICDF Questions: Instruction (Text): "What specific task should the AI perform?" Placeholder: "e.g., Analyze my portfolio's engagement metrics" Context (Text): "Why do you need this analysis?" Placeholder: "e.g., I want to know which photos get the most client inquiries" Tooltip: "Context helps the AI understand your goals and tailor the analysis" Data Type (Multiple Choice): Numbers/Statistics Text/Documents Images/Visual content Mixed data Tooltip: "Specifying data type ensures proper analysis methods" Output Format (Multiple Choice): Bullet points Table/Chart Detailed report Executive summary Tooltip: "Format determines how readable and actionable your results are" RCREOC Questions: Role (Multiple Choice): Senior Art Director Marketing Strategist Technical Expert Business Consultant Custom (text input) Tooltip: "The AI adopts this professional perspective" Context (Text): "Describe the situation or project" Placeholder: "e.g., Reviewing a new photographer's portfolio for a campaign" Request (Text): "What specific task should this expert perform?" Placeholder: "e.g., Identify strengths and weaknesses in composition" Output Structure (Multiple Choice): Table Numbered list Pros/Cons format Detailed paragraphs Tooltip: "Structure makes expert feedback actionable" Tone (Multiple Choice): Constructive & encouraging Direct & critical Formal & professional Friendly & casual Tooltip: "Sets the communication style of your AI expert" MICRO Questions: Message (Text): "What's the core idea you want to communicate?" Placeholder: "e.g., Aperture controls both light and depth of field" Tooltip: "Your central thesis or key takeaway" Intention (Multiple Choice): Educate/Teach Persuade/Convince Entertain Inspire action Tooltip: "What should the audience feel or do after reading?" Target Audience (Text): "Who is this for?" Placeholder: "e.g., Beginner photographers, 25-40 years old" Tooltip: "Specific audience = specific language and examples" Rhythm/Tone (Multiple Choice): Fast-paced & exciting Calm & instructional Witty & conversational Formal & authoritative Tooltip: "The 'voice' and pacing of your content" Output Format (Multiple Choice): Blog post YouTube script Social media post Email newsletter Image generation prompt Tooltip: "Format determines structure and length" Content Length (Multiple Choice - only if applicable): Short (1-2 min read) Medium (5 min read) Long-form (10+ min) COSTAR Questions: Context (Text): "What's the situation or launch?" Placeholder: "e.g., Launching new Lightroom presets" Offer (Text): "What's the specific product/deal?" Placeholder: "e.g., 25% off for first 3 days" Tooltip: "Clear offers convert better" Style/Tone (Multiple Choice): Elegant & sophisticated Urgent & exciting Friendly & warm Professional & trustworthy Tooltip: "Brand voice affects trust and conversion" Target Audience (Text): "Who are you selling to?" Placeholder: "e.g., 25-45 year old wedding photographers" Tooltip: "Specific targeting = specific messaging" Desired Action (Text): "What should they do?" Placeholder: "e.g., Click to buy before offer expires" Tooltip: "One clear CTA performs best" Business Goal (Multiple Choice): Drive immediate sales Build email list Increase brand awareness Get trial signups Tooltip: "Goal shapes the entire message" 3.4 Smart Defaults System File: /lib/prompt-frameworks/defaults.ts typescript const SMART_DEFAULTS = { ICDF: { context: "For general analysis and insights", format: "Clear bullet points with key findings" }, RCREOC: { role: "Experienced professional consultant", tone: "Constructive and professional", output: "Organized list format" }, MICRO: { tone: "Professional and clear", audience: "General audience", length: "Medium-length content" }, COSTAR: { style: "Professional and trustworthy", goal: "Drive conversions" } }; Logic: If user skips a question, apply the default silently. No warnings neededโ€”the prompt will still be professional-grade. 3.5 Prompt Assembly Engine File: /lib/prompt-frameworks/assembler.ts Each framework has a template structure: typescript // ICDF Template const ICDFTemplate = (answers: ICDFAnswers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context || SMART_DEFAULTS.ICDF.context} **Data:** ${answers.dataType} data is provided. ${answers.dataDetails || ''} **Format:** Please provide the output as ${answers.outputFormat || SMART_DEFAULTS.ICDF.format}. `; // RCREOC Template const RCREOCTemplate = (answers: RCREOCAnswers) => ` **Role:** You are ${answers.role || SMART_DEFAULTS.RCREOC.role}. **Context:** ${answers.context} **Request:** ${answers.request} ${answers.examples ? `**Example:** ${answers.examples}` : ''} **Output:** Provide your response as ${answers.outputStructure || SMART_DEFAULTS.RCREOC.output}. **Constraints:** ${answers.tone || SMART_DEFAULTS.RCREOC.tone} tone. ${answers.additionalConstraints || ''} `; // MICRO Template const MICROTemplate = (answers: MICROAnswers) => ` **Message:** ${answers.message} **Intention:** The goal is to ${answers.intention}. **Context:** The audience is ${answers.targetAudience || SMART_DEFAULTS.MICRO.audience}. They will see this as ${answers.outputFormat}. **Rhythm:** The tone should be ${answers.rhythmTone || SMART_DEFAULTS.MICRO.tone}. ${answers.styleNotes || ''} **Output:** Create ${answers.outputFormat}${answers.contentLength ? ` (${answers.contentLength})` : ''}. `; // COSTAR Template const COSTARTemplate = (answers: COSTARAnswers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.styleTone || SMART_DEFAULTS.COSTAR.style}. **Target:** This is for ${answers.targetAudience}. **Action:** The reader should ${answers.desiredAction}. **Result:** The business goal is to ${answers.businessGoal || SMART_DEFAULTS.COSTAR.goal}. `; 3.6 Before/After Display Desktop Layout (Side-by-Side): โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Transformation โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Your Original Promptโ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ โ”‚ "Write a script โ”‚ **Message:** The script needs โ”‚ โ”‚ about aperture" โ”‚ to explain that aperture... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal is... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Context:** The audience... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ (Full MICRO framework) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Mobile Layout (Stacked): โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Original Prompt โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ "Write a script about โ”‚ โ”‚ aperture" โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ Transformed into โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ **Message:** The script... โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal... โ”‚ โ”‚ โ”‚ โ”‚ (Full framework) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Visual Design: Original prompt: Light gray background, smaller text Professional version: White/highlighted background, larger text Copy button: Primary color, prominent placement Framework labels (Message, Intention, etc.): Bold, colored 3.7 Learning Mode Tooltips Implementation: Small (?) icon next to each question Hover on desktop = tooltip appears Click on mobile = tooltip expands Max 1-2 sentences per tooltip Example Tooltips: Question Tooltip Text Context (ICDF) "Context helps the AI understand your goals and prioritize what matters most in the analysis." Role (RCREOC) "The AI adopts this professional perspectiveโ€”a marketing expert thinks differently than a technical consultant." Intention (MICRO) "Knowing the goal (educate vs. persuade) changes word choice, tone, and structure entirely." Target Audience "Specific audiences need specific languageโ€”'beginners' get simpler explanations than 'experts'." Output Format "Format affects readabilityโ€”tables for comparisons, bullets for quick scanning, paragraphs for depth." 4. Technical Implementation 4.1 File Structure app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Inherits site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ WizardCards.tsx # 4 framework selection cards โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ””โ”€โ”€ CopyButton.tsx # Copy to clipboard lib/ โ”œโ”€โ”€ prompt-frameworks/ โ”‚ โ”œโ”€โ”€ detector.ts # Keyword-based detection โ”‚ โ”œโ”€โ”€ questions.ts # Question sets per framework โ”‚ โ”œโ”€โ”€ defaults.ts # Smart default values โ”‚ โ”œโ”€โ”€ assembler.ts # Prompt template engine โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ”œโ”€โ”€ tooltip.tsx # Learning mode tooltips โ””โ”€โ”€ (reuse existing buttons, cards, inputs) 4.2 Data Models TypeScript Interfaces: typescript // types.ts export type Framework = 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; export interface PromptSession { id: string; framework: Framework; originalPrompt: string; userAnswers: Record<string, string>; finalPrompt: string; timestamp: Date; } export interface Question { id: string; text: string; type: 'text' | 'multipleChoice'; options?: string[]; placeholder?: string; tooltip?: string; required: boolean; defaultValue?: string; } export interface ICDFAnswers { instruction: string; context?: string; dataType: string; dataDetails?: string; outputFormat?: string; } // Similar interfaces for RCREOC, MICRO, COSTAR 4.3 Analytics Tracking File: /lib/analytics/prompt-tracker.ts typescript interface AnalyticsEvent { event: 'framework_selected' | 'prompt_generated' | 'prompt_copied' | 'question_skipped'; framework?: Framework; questionId?: string; timestamp: Date; } // Use existing analytics setup (Google Analytics, Plausible, etc.) // Track: // 1. Framework selection distribution // 2. Question completion rates // 3. Copy button clicks // 4. Session duration Metrics to Track: Most popular framework Average questions answered per session Drop-off points in questionnaire Copy rate (% who copy the final prompt) 4.4 Component Specifications WizardCards Component tsx // components/WizardCards.tsx interface CardData { framework: Framework; icon: string; title: string; subtitle: string; useCases: string[]; } const CARDS: CardData[] = [ { framework: 'ICDF', icon: '๐Ÿ“Š', title: 'Analyze Data', subtitle: 'Get precise, analytical results', useCases: ['Review photos', 'Analyze metrics', 'Evaluate performance'] }, // ... other cards ]; export function WizardCards({ onSelect }: { onSelect: (framework: Framework) => void }) { return ( <div className="grid grid-cols-1 md:grid-cols-2 gap-6"> {CARDS.map(card => ( <Card key={card.framework} onClick={() => onSelect(card.framework)} className="cursor-pointer hover:shadow-lg transition-shadow" > <div className="text-6xl mb-4">{card.icon}</div> <h3 className="text-2xl font-bold">{card.title}</h3> <p className="text-gray-600">{card.subtitle}</p> <ul className="mt-4 text-sm text-gray-500"> {card.useCases.map(use => <li key={use}>โ€ข {use}</li>)} </ul> </Card> ))} </div> ); } QuestionFlow Component tsx // components/QuestionFlow.tsx export function QuestionFlow({ framework, onComplete }: { framework: Framework; onComplete: (answers: Record<string, string>) => void; }) { const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const questions = getQuestionsForFramework(framework); const handleNext = () => { if (currentQuestion < questions.length - 1) { setCurrentQuestion(prev => prev + 1); } else { onComplete(answers); } }; return ( <div className="max-w-2xl mx-auto"> <Progress value={(currentQuestion + 1) / questions.length * 100} /> <Question question={questions[currentQuestion]} value={answers[questions[currentQuestion].id]} onChange={(value) => setAnswers({...answers, [questions[currentQuestion].id]: value})} /> <div className="flex justify-between mt-6"> <Button variant="ghost" onClick={() => setCurrentQuestion(prev => prev - 1)} disabled={currentQuestion === 0} > Back </Button> <Button onClick={handleNext}> {currentQuestion === questions.length - 1 ? 'Generate Prompt' : 'Next'} </Button> </div> </div> ); } BeforeAfter Component tsx // components/BeforeAfter.tsx export function BeforeAfter({ original, enhanced }: { original: string; enhanced: string; }) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(enhanced); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-6xl mx-auto"> <h2 className="text-3xl font-bold mb-6">Your Transformation</h2> <div className="grid md:grid-cols-2 gap-6"> {/* Original */} <div className="bg-gray-50 p-6 rounded-lg"> <h3 className="text-lg font-semibold mb-4">Your Original Prompt</h3> <p className="text-gray-700 whitespace-pre-wrap">{original}</p> </div> {/* Enhanced */} <div className="bg-white border-2 border-primary p-6 rounded-lg"> <h3 className="text-lg font-semibold mb-4 flex items-center"> โœจ Professional Version </h3> <div className="text-gray-900 whitespace-pre-wrap font-mono text-sm"> {enhanced} </div> <Button onClick={handleCopy} className="w-full mt-6" > {copied ? 'โœ“ Copied!' : '๐Ÿ“‹ Copy to Clipboard'} </Button> </div> </div> <div className="mt-8 text-center"> <Button variant="outline" onClick={() => window.location.reload()}> Create Another Prompt </Button> </div> </div> ); } 5. Framework Icons/Visuals For the 4 wizard cards, use these visual identities: Framework Icon Color Accent Visual Style ICDF ๐Ÿ“Š Chart/Graph Blue (#3B82F6) Data-focused, analytical RCREOC ๐Ÿ‘” Professional Purple (#8B5CF6) Expert, authoritative MICRO โœ๏ธ Pen/Create Green (#10B981) Creative, content-focused COSTAR ๐Ÿ’ฐ Money/Target Orange (#F59E0B) Sales, conversion-focused Optional Enhancement: Create simple SVG icons or use an icon library (Lucide, Heroicons) matching these themes. 6. Example Prompts (For Testing) ICDF Example: User Input: "Analyze my photography website traffic" Generated Prompt: **Instruction:** Analyze the provided traffic and engagement data for my photography website. **Context:** I want to understand which pages and content types drive the most visitor engagement and contact form submissions. **Data:** Website analytics data including page views, bounce rates, time-on-page, and conversion rates. **Format:** Please provide the output as a clear table with three sections: 1. Top Performing Pages, 2. High Bounce Rate Pages, 3. Actionable Recommendations. RCREOC Example: User Input: "Get feedback on my portrait photos" Generated Prompt: **Role:** You are a Senior Art Director at a high-end portrait photography studio. **Context:** We are reviewing a photographer's portfolio to determine if their work meets our quality standards for client projects. **Request:** Review the attached portrait images and identify: 1. Technical strengths, 2. Areas for improvement, 3. Overall artistic direction. **Output:** Provide your response as a table with columns: 'Strength', 'Improvement Area', 'Specific Recommendation'. **Constraints:** Constructive and professional tone. Each recommendation must be actionable and specific. MICRO Example: User Input: "Write a blog post about golden hour photography" Generated Prompt: **Message:** Golden hour is the secret weapon for stunning outdoor portraitsโ€”it creates soft, flattering light that makes anyone look amazing. **Intention:** The goal is to educate beginner photographers and persuade them to shoot during golden hour instead of harsh midday sun. **Context:** The audience is beginner photographers (ages 25-40) reading the Modern Photo Tools blog. They want practical, actionable tips. **Rhythm:** The tone should be encouraging and conversational, with clear examples. Use a "myth vs. reality" structure to bust common lighting mistakes. **Output:** Create a blog post (5-minute read) with sections: 1. What is Golden Hour?, 2. Why It Works, 3. 3 Golden Hour Shooting Tips, 4. Common Mistakes to Avoid. COSTAR Example: User Input: "Write a sales email for my Lightroom presets" Generated Prompt: **Context:** Write a marketing email for the launch of my new "California Light" Lightroom preset pack. **Offer:** 25% off for the first 3 days only. **Style:** The tone should be elegant and warm, like a message from a trusted creative friendโ€”not a pushy salesperson. **Target:** This is for 25-45 year old lifestyle and wedding photographers who want to speed up their editing workflow and achieve a consistent aesthetic. **Action:** The reader should click the "Get 25% Off Now" button before the 3-day deadline. **Result:** The business goal is to drive immediate sales in the first 72 hours and convert new customers who will buy future products. 7. Implementation Roadmap Phase 1: Core Setup (Week 1) โœ… Create /prompt-generator route โœ… Build WizardCards landing page โœ… Implement framework detector logic โœ… Set up TypeScript interfaces Phase 2: Question System (Week 2) โœ… Build QuestionFlow component โœ… Create question sets for all 4 frameworks โœ… Implement adaptive question types (multiple choice + text) โœ… Add smart defaults system โœ… Build tooltip system for learning mode Phase 3: Prompt Generation (Week 3) โœ… Build prompt assembler templates โœ… Create BeforeAfter comparison component โœ… Implement copy-to-clipboard functionality โœ… Add mobile responsiveness โœ… Style matching existing site design Phase 4: Polish & Launch (Week 4) โœ… Add analytics tracking โœ… Create example prompts/use cases โœ… Write documentation โœ… SEO optimization โœ… User testing & refinement โœ… Launch! ๐Ÿš€ 8. Gap Analysis โœ… Use As-Is (From Boilerplate - 70%) Next.js routing & page structure UI components (Button, Card, Input, Textarea) Responsive layout system TypeScript setup Analytics infrastructure Site header/footer/navigation ๐Ÿ”ง Customize (15%) Create new route /prompt-generator Add framework-specific styling/colors Customize tooltip component for learning mode Adapt existing form components for questionnaire โœจ Build New (15%) Framework detection logic (detector.ts) Question sets and adaptive flow (questions.ts) Prompt assembly templates (assembler.ts) WizardCards component QuestionFlow component BeforeAfter comparison component Smart defaults system 9. Success Metrics Week 1: 100+ unique visitors 50+ prompts generated 30%+ copy rate Month 1: Code Snippet 1 Plain Textโ€ข 13 lines Landing Page (Quick-Start Wizard) โ†“ [4 Big Visual Cards - User Selects Goal] โ†“ Initial Prompt Input โ†“ Framework Auto-Detected (Rule-Based) โ†“ Adaptive Questionnaire (3-7 questions) โ†“ Before/After Comparison Display โ†“ Copy to Clipboard โ†’ Done Code Snippet 2 Plain Textโ€ข 25 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ [Site Header - Existing Component] โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ ๐ŸŽฏ AI Prompt Generator โ”‚ โ”‚ Transform simple ideas into โ”‚ โ”‚ professional AI prompts โ”‚ โ”‚ โ”‚ โ”‚ What do you want to create? โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ ๐Ÿ“Š ICDF โ”‚ โ”‚ ๐Ÿ‘” RCREOCโ”‚ โ”‚ โ”‚ โ”‚ Analyze โ”‚ โ”‚ Expert โ”‚ โ”‚ โ”‚ โ”‚ Data โ”‚ โ”‚ Advice โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โœ๏ธ MICRO โ”‚ โ”‚ ๐Ÿ’ฐ COSTARโ”‚ โ”‚ โ”‚ โ”‚ Create โ”‚ โ”‚ Marketingโ”‚ โ”‚ โ”‚ โ”‚ Content โ”‚ โ”‚ & Sales โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ [Not sure? Describe your goal โ†’] โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ TypeScript TypeScriptโ€ข 34 lines interface KeywordMap { framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; keywords: string[]; weight: number; } const DETECTION_RULES: KeywordMap[] = [ { framework: 'ICDF', keywords: ['analyze', 'review', 'evaluate', 'assess', 'data', 'metrics', 'performance', 'statistics', 'report', 'insights'], weight: 1 }, { framework: 'RCREOC', keywords: ['expert', 'professional', 'advice', 'consult', 'opinion', 'feedback', 'critique', 'recommend', 'specialist'], weight: 1 }, { framework: 'MICRO', keywords: ['write', 'create', 'content', 'blog', 'script', 'post', 'article', 'story', 'caption', 'image', 'photo', 'picture', 'generate'], weight: 1 }, { framework: 'COSTAR', keywords: ['sell', 'marketing', 'email', 'ad', 'promotion', 'sales', 'campaign', 'offer', 'discount', 'buy', 'customer'], weight: 1 } ]; function detectFramework(userInput: string): string { // Scoring logic: count keyword matches // Return framework with highest score // Default to MICRO if no clear match } TypeScript TypeScriptโ€ข 20 lines const SMART_DEFAULTS = { ICDF: { context: "For general analysis and insights", format: "Clear bullet points with key findings" }, RCREOC: { role: "Experienced professional consultant", tone: "Constructive and professional", output: "Organized list format" }, MICRO: { tone: "Professional and clear", audience: "General audience", length: "Medium-length content" }, COSTAR: { style: "Professional and trustworthy", goal: "Drive conversions" } }; TypeScript TypeScriptโ€ข 53 lines // ICDF Template const ICDFTemplate = (answers: ICDFAnswers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context || SMART_DEFAULTS.ICDF.context} **Data:** ${answers.dataType} data is provided. ${answers.dataDetails || ''} **Format:** Please provide the output as ${answers.outputFormat || SMART_DEFAULTS.ICDF.format}. `; // RCREOC Template const RCREOCTemplate = (answers: RCREOCAnswers) => ` **Role:** You are ${answers.role || SMART_DEFAULTS.RCREOC.role}. **Context:** ${answers.context} **Request:** ${answers.request} ${answers.examples ? `**Example:** ${answers.examples}` : ''} **Output:** Provide your response as ${answers.outputStructure || SMART_DEFAULTS.RCREOC.output}. **Constraints:** ${answers.tone || SMART_DEFAULTS.RCREOC.tone} tone. ${answers.additionalConstraints || ''} `; // MICRO Template const MICROTemplate = (answers: MICROAnswers) => ` **Message:** ${answers.message} **Intention:** The goal is to ${answers.intention}. **Context:** The audience is ${answers.targetAudience || SMART_DEFAULTS.MICRO.audience}. They will see this as ${answers.outputFormat}. **Rhythm:** The tone should be ${answers.rhythmTone || SMART_DEFAULTS.MICRO.tone}. ${answers.styleNotes || ''} **Output:** Create ${answers.outputFormat}${answers.contentLength ? ` (${answers.contentLength})` : ''}. `; // COSTAR Template const COSTARTemplate = (answers: COSTARAnswers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.styleTone || SMART_DEFAULTS.COSTAR.style}. **Target:** This is for ${answers.targetAudience}. **Action:** The reader should ${answers.desiredAction}. **Result:** The business goal is to ${answers.businessGoal || SMART_DEFAULTS.COSTAR.goal}. `; Code Snippet 6 Plain Textโ€ข 18 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Transformation โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Your Original Promptโ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ โ”‚ "Write a script โ”‚ **Message:** The script needs โ”‚ โ”‚ about aperture" โ”‚ to explain that aperture... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal is... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Context:** The audience... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ (Full MICRO framework) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Code Snippet 7 Plain Textโ€ข 20 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Original Prompt โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ "Write a script about โ”‚ โ”‚ aperture" โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ Transformed into โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ **Message:** The script... โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal... โ”‚ โ”‚ โ”‚ โ”‚ (Full framework) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Code Snippet 8 Plain Textโ€ข 23 lines app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Inherits site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ WizardCards.tsx # 4 framework selection cards โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ””โ”€โ”€ CopyButton.tsx # Copy to clipboard lib/ โ”œโ”€โ”€ prompt-frameworks/ โ”‚ โ”œโ”€โ”€ detector.ts # Keyword-based detection โ”‚ โ”œโ”€โ”€ questions.ts # Question sets per framework โ”‚ โ”œโ”€โ”€ defaults.ts # Smart default values โ”‚ โ”œโ”€โ”€ assembler.ts # Prompt template engine โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ”œโ”€โ”€ tooltip.tsx # Learning mode tooltips โ””โ”€โ”€ (reuse existing buttons, cards, inputs) TypeScript TypeScriptโ€ข 32 lines // types.ts export type Framework = 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; export interface PromptSession { id: string; framework: Framework; originalPrompt: string; userAnswers: Record<string, string>; finalPrompt: string; timestamp: Date; } export interface Question { id: string; text: string; type: 'text' | 'multipleChoice'; options?: string[]; placeholder?: string; tooltip?: string; required: boolean; defaultValue?: string; } export interface ICDFAnswers { instruction: string; context?: string; dataType: string; dataDetails?: string; outputFormat?: string; } // Similar interfaces for RCREOC, MICRO, COSTAR TypeScript TypeScriptโ€ข 13 lines interface AnalyticsEvent { event: 'framework_selected' | 'prompt_generated' | 'prompt_copied' | 'question_skipped'; framework?: Framework; questionId?: string; timestamp: Date; } // Use existing analytics setup (Google Analytics, Plausible, etc.) // Track: // 1. Framework selection distribution // 2. Question completion rates // 3. Copy button clicks // 4. Session duration TypeScript React React TSXโ€ข 40 lines // components/WizardCards.tsx interface CardData { framework: Framework; icon: string; title: string; subtitle: string; useCases: string[]; } const CARDS: CardData[] = [ { framework: 'ICDF', icon: '๐Ÿ“Š', title: 'Analyze Data', subtitle: 'Get precise, analytical results', useCases: ['Review photos', 'Analyze metrics', 'Evaluate performance'] }, // ... other cards ]; export function WizardCards({ onSelect }: { onSelect: (framework: Framework) => void }) { return ( <div className="grid grid-cols-1 md:grid-cols-2 gap-6"> {CARDS.map(card => ( <Card key={card.framework} onClick={() => onSelect(card.framework)} className="cursor-pointer hover:shadow-lg transition-shadow" > <div className="text-6xl mb-4">{card.icon}</div> <h3 className="text-2xl font-bold">{card.title}</h3> <p className="text-gray-600">{card.subtitle}</p> <ul className="mt-4 text-sm text-gray-500"> {card.useCases.map(use => <li key={use}>โ€ข {use}</li>)} </ul> </Card> ))} </div> ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 46 lines // components/QuestionFlow.tsx export function QuestionFlow({ framework, onComplete }: { framework: Framework; onComplete: (answers: Record<string, string>) => void; }) { const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const questions = getQuestionsForFramework(framework); const handleNext = () => { if (currentQuestion < questions.length - 1) { setCurrentQuestion(prev => prev + 1); } else { onComplete(answers); } }; return ( <div className="max-w-2xl mx-auto"> <Progress value={(currentQuestion + 1) / questions.length * 100} /> <Question question={questions[currentQuestion]} value={answers[questions[currentQuestion].id]} onChange={(value) => setAnswers({...answers, [questions[currentQuestion].id]: value})} /> <div className="flex justify-between mt-6"> <Button variant="ghost" onClick={() => setCurrentQuestion(prev => prev - 1)} disabled={currentQuestion === 0} > Back </Button> <Button onClick={handleNext}> {currentQuestion === questions.length - 1 ? 'Generate Prompt' : 'Next'} </Button> </div> </div> ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 52 lines // components/BeforeAfter.tsx export function BeforeAfter({ original, enhanced }: { original: string; enhanced: string; }) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(enhanced); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-6xl mx-auto"> <h2 className="text-3xl font-bold mb-6">Your Transformation</h2> <div className="grid md:grid-cols-2 gap-6"> {/* Original */} <div className="bg-gray-50 p-6 rounded-lg"> <h3 className="text-lg font-semibold mb-4">Your Original Prompt</h3> <p className="text-gray-700 whitespace-pre-wrap">{original}</p> </div> {/* Enhanced */} <div className="bg-white border-2 border-primary p-6 rounded-lg"> <h3 className="text-lg font-semibold mb-4 flex items-center"> โœจ Professional Version </h3> <div className="text-gray-900 whitespace-pre-wrap font-mono text-sm"> {enhanced} </div> <Button onClick={handleCopy} className="w-full mt-6" > {copied ? 'โœ“ Copied!' : '๐Ÿ“‹ Copy to Clipboard'} </Button> </div> </div> <div className="mt-8 text-center"> <Button variant="outline" onClick={() => window.location.reload()}> Create Another Prompt </Button> </div> </div> ); } This code can be executed in the preview sandbox Run Code Code Snippet 14 Plain Textโ€ข 7 lines **Instruction:** Analyze the provided traffic and engagement data for my photography website. **Context:** I want to understand which pages and content types drive the most visitor engagement and contact form submissions. **Data:** Website analytics data including page views, bounce rates, time-on-page, and conversion rates. **Format:** Please provide the output as a clear table with three sections: 1. Top Performing Pages, 2. High Bounce Rate Pages, 3. Actionable Recommendations. Code Snippet 15 Plain Textโ€ข 9 lines **Role:** You are a Senior Art Director at a high-end portrait photography studio. **Context:** We are reviewing a photographer's portfolio to determine if their work meets our quality standards for client projects. **Request:** Review the attached portrait images and identify: 1. Technical strengths, 2. Areas for improvement, 3. Overall artistic direction. **Output:** Provide your response as a table with columns: 'Strength', 'Improvement Area', 'Specific Recommendation'. **Constraints:** Constructive and professional tone. Each recommendation must be actionable and specific. Code Snippet 16 Plain Textโ€ข 9 lines **Message:** Golden hour is the secret weapon for stunning outdoor portraitsโ€”it creates soft, flattering light that makes anyone look amazing. **Intention:** The goal is to educate beginner photographers and persuade them to shoot during golden hour instead of harsh midday sun. **Context:** The audience is beginner photographers (ages 25-40) reading the Modern Photo Tools blog. They want practical, actionable tips. **Rhythm:** The tone should be encouraging and conversational, with clear examples. Use a "myth vs. reality" structure to bust common lighting mistakes. **Output:** Create a blog post (5-minute read) with sections: 1. What is Golden Hour?, 2. Why It Works, 3. 3 Golden Hour Shooting Tips, 4. Common Mistakes to Avoid. Code Snippet 17 Plain Textโ€ข 11 lines **Context:** Write a marketing email for the launch of my new "California Light" Lightroom preset pack. **Offer:** 25% off for the first 3 days only. **Style:** The tone should be elegant and warm, like a message from a trusted creative friendโ€”not a pushy salesperson. **Target:** This is for 25-45 year old lifestyle and wedding photographers who want to speed up their editing workflow and achieve a consistent aesthetic. **Action:** The reader should click the "Get 25% Off Now" button before the 3-day deadline. **Result:** The business goal is to drive immediate sales in the first 72 hours and convert new customers who will buy future products. Used 86 credits continue Used 0 credits continue Used 0 credits Landing Page (Quick-Start Wizard) โ†“ [4 Framework Cards with Icons] โ†“ User Selects Goal โ†’ Framework Auto-Selected โ†“ Initial Prompt Input "Describe what you need in your own words..." โ†“ Keyword Analysis (Rule-Based Detection) โ†“ Adaptive Questionnaire (3-7 questions) - Simple questions: Multiple choice buttons - Complex questions: Text fields - Learning tooltips on each question โ†“ Smart Defaults Applied (if user skips) โ†“ Before/After Comparison Page - Left: Original prompt - Right: Professional prompt (highlighted) - Copy button - Learning mode explanations โ†“ Success State "โœ“ Your professional prompt is ready!" [Copy to Clipboard] [Start Another] 3. Framework Detection Rules Keyword Mapping (Rule-Based Logic) javascript const frameworkDetection = { ICDF: { keywords: ['analyze', 'review', 'evaluate', 'assess', 'data', 'report', 'examine', 'study', 'metrics', 'statistics'], icon: '๐Ÿ“Š', // Analytics/Chart icon color: '#3B82F6', // Blue title: 'Analyze Data', subtitle: 'Get precise analytical insights' }, RCREOC: { keywords: ['expert', 'professional', 'advice', 'consult', 'opinion', 'recommend', 'specialist', 'coach', 'mentor', 'guide'], icon: '๐ŸŽฏ', // Target/Expert icon color: '#8B5CF6', // Purple title: 'Get Expert Advice', subtitle: 'AI becomes your specialist consultant' }, MICRO: { keywords: ['write', 'create', 'content', 'blog', 'script', 'article', 'post', 'story', 'copy', 'draft', 'compose'], icon: 'โœ๏ธ', // Writing icon color: '#10B981', // Green title: 'Create Content', subtitle: 'Generate engaging written content' }, COSTAR: { keywords: ['sell', 'marketing', 'email', 'ad', 'promotion', 'campaign', 'sales', 'advertise', 'pitch', 'convert'], icon: '๐Ÿš€', // Rocket/Growth icon color: '#F59E0B', // Orange title: 'Write Marketing Copy', subtitle: 'Craft persuasive sales messages' } }; Detection Algorithm javascript function detectFramework(userInput) { const input = userInput.toLowerCase(); const scores = {}; // Count keyword matches for each framework Object.keys(frameworkDetection).forEach(framework => { scores[framework] = frameworkDetection[framework].keywords .filter(keyword => input.includes(keyword)) .length; }); // Return framework with highest score const winner = Object.keys(scores).reduce((a, b) => scores[a] > scores[b] ? a : b ); // If no clear winner (all zeros), default to MICRO (most general) return scores[winner] > 0 ? winner : 'MICRO'; } 4. Question Sets by Framework ICDF Framework Questions javascript const icdfQuestions = [ { id: 'instruction', type: 'textarea', label: 'What specific task should the AI perform?', placeholder: 'e.g., Analyze traffic patterns and identify top-performing content', required: true, tooltip: 'Be specific about the action you wantโ€”this is your core instruction.' }, { id: 'context', type: 'textarea', label: 'What's the background or purpose?', placeholder: 'e.g., I run a photography blog and need to understand what content drives bookings', default: 'General business analysis', tooltip: 'Context helps AI understand WHY you need thisโ€”it tailors the analysis to your goals.' }, { id: 'data', type: 'textarea', label: 'What data will you provide to the AI?', placeholder: 'e.g., 3 months of Google Analytics data including traffic sources, bounce rates, and conversions', default: 'Standard dataset', tooltip: 'Specify what information the AI will work withโ€”this sets expectations.' }, { id: 'format', type: 'choice', label: 'How should the output be structured?', options: [ { value: 'table', label: '๐Ÿ“Š Table/Spreadsheet' }, { value: 'list', label: '๐Ÿ“ Bullet Points' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'summary', label: 'โšก Executive Summary' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], default: 'list', tooltip: 'Format determines how readable and actionable your results will be.' } ]; RCREOC Framework Questions javascript const rcreocQuestions = [ { id: 'role', type: 'choice', label: 'What expert role should the AI take?', options: [ { value: 'art-director', label: '๐ŸŽจ Senior Art Director' }, { value: 'photo-editor', label: '๐Ÿ“ธ Professional Photo Editor' }, { value: 'business-consultant', label: '๐Ÿ’ผ Business Consultant' }, { value: 'marketing-strategist', label: '๐Ÿ“ˆ Marketing Strategist' }, { value: 'technical-expert', label: 'โš™๏ธ Technical Specialist' }, { value: 'custom', label: 'โœ๏ธ Custom Role', hasInput: true } ], required: true, tooltip: 'The role shapes how the AI thinks and respondsโ€”choose the expert you need.' }, { id: 'context', type: 'textarea', label: 'Describe the situation this expert is working in', placeholder: 'e.g., You are reviewing portfolio submissions for a high-end fashion campaign', default: 'Professional consulting environment', tooltip: 'Context gives the "expert" the scenarioโ€”this makes advice more targeted.' }, { id: 'request', type: 'textarea', label: 'What specific task should this expert complete?', placeholder: 'e.g., Review these 10 images and identify technical issues and strengths', required: true, tooltip: 'The specific task the expert will performโ€”be clear and actionable.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output you want', placeholder: 'e.g., If you see underexposed images, note this as an issue and recommend using a light meter', default: 'Use professional industry standards', tooltip: 'Examples guide the AI's reasoning styleโ€”show what "good" looks like.' }, { id: 'output', type: 'choice', label: 'What format should the expert deliver?', options: [ { value: 'table', label: '๐Ÿ“Š Structured Table' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'checklist', label: 'โœ… Action Checklist' }, { value: 'recommendations', label: '๐Ÿ’ก Recommendation List' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], default: 'recommendations', tooltip: 'Output format determines how you'll use the expert's advice.' }, { id: 'constraints', type: 'choice', label: 'What tone and style should the expert use?', options: [ { value: 'professional-constructive', label: '๐ŸŽฏ Professional & Constructive' }, { value: 'direct-concise', label: 'โšก Direct & Concise' }, { value: 'detailed-educational', label: '๐Ÿ“š Detailed & Educational' }, { value: 'friendly-encouraging', label: '๐Ÿ˜Š Friendly & Encouraging' }, { value: 'custom', label: 'โœ๏ธ Custom Tone', hasInput: true } ], default: 'professional-constructive', tooltip: 'Constraints set boundariesโ€”tone, length, and style rules for the output.' } ]; MICRO Framework Questions javascript const microQuestions = [ { id: 'message', type: 'textarea', label: 'What's the core idea or thesis?', placeholder: 'e.g., Aperture controls both light and depth of fieldโ€”it's the most important camera setting to learn first', required: true, tooltip: 'Your message is the central pointโ€”what should the audience remember?' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after reading?', placeholder: 'e.g., Feel confident experimenting with aperture settings and excited to try it themselves', required: true, tooltip: 'Intention drives the emotional outcomeโ€”persuade, inspire, educate, or entertain?' }, { id: 'context', type: 'textarea', label: 'Who is the audience and where will they see this?', placeholder: 'e.g., Beginner photographers aged 25-40 watching on YouTube', default: 'General online audience', tooltip: 'Context shapes language, tone, and examplesโ€”know your reader.' }, { id: 'rhythm', type: 'choice', label: 'What tone and pace should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'calm-educational', label: '๐Ÿ“š Calm & Educational' }, { value: 'witty-conversational', label: '๐Ÿ˜„ Witty & Conversational' }, { value: 'professional-authoritative', label: '๐ŸŽฏ Professional & Authoritative' }, { value: 'inspiring-motivational', label: 'โœจ Inspiring & Motivational' }, { value: 'custom', label: 'โœ๏ธ Custom Rhythm', hasInput: true } ], default: 'calm-educational', tooltip: 'Rhythm is the voice and energyโ€”fast or slow, serious or playful?' }, { id: 'output', type: 'choice', label: 'What type of content are you creating?', options: [ { value: 'youtube-script', label: '๐ŸŽฅ YouTube Script' }, { value: 'blog-post', label: '๐Ÿ“ Blog Post' }, { value: 'social-media', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: '๐Ÿ“ง Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], required: true, tooltip: 'Output type determines structureโ€”scripts need hooks, blogs need SEO, etc.' } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What's the marketing situation?', placeholder: 'e.g., Launching a new Lightroom preset pack for wedding photographers', required: true, tooltip: 'Context sets the stageโ€”new product, seasonal sale, or re-engagement campaign?' }, { id: 'offer', type: 'textarea', label: 'What's the specific offer or product?', placeholder: 'e.g., "California Light" preset collection, 25% off for 3 days', required: true, tooltip: 'The offer is what you're sellingโ€”be specific about the deal and urgency.' }, { id: 'style', type: 'choice', label: 'What tone should the marketing copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimal' }, { value: 'urgent-exciting', label: 'โšก Urgent & Exciting' }, { value: 'friendly-warm', label: '๐Ÿ˜Š Friendly & Warm' }, { value: 'professional-trustworthy', label: '๐ŸŽฏ Professional & Trustworthy' }, { value: 'bold-provocative', label: '๐Ÿ”ฅ Bold & Provocative' }, { value: 'custom', label: 'โœ๏ธ Custom Style', hasInput: true } ], default: 'friendly-warm', tooltip: 'Style creates the emotional connectionโ€”match your brand voice.' }, { id: 'target', type: 'textarea', label: 'Who is your target customer?', placeholder: 'e.g., Wedding and lifestyle photographers aged 25-45 who want to speed up their editing workflow', required: true, tooltip: 'Target audience determines language, pain points, and benefits to highlight.' }, { id: 'action', type: 'choice', label: 'What's the primary call-to-action?', options: [ { value: 'buy-now', label: '๐Ÿ›’ Buy Now' }, { value: 'sign-up', label: '๐Ÿ“ Sign Up' }, { value: 'learn-more', label: '๐Ÿ“š Learn More' }, { value: 'download', label: 'โฌ‡๏ธ Download' }, { value: 'book-call', label: '๐Ÿ“ž Book a Call' }, { value: 'custom', label: 'โœ๏ธ Custom CTA', hasInput: true } ], required: true, tooltip: 'Action is the ONE thing you want them to doโ€”make it crystal clear.' }, { id: 'result', type: 'textarea', label: 'What's your business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build email list of potential customers', default: 'Increase conversions and revenue', tooltip: 'Result aligns the copy with your business objectiveโ€”sales, leads, or awareness?' } ]; 5. Prompt Assembly Logic Template Structure for Each Framework ICDF Template: javascript function assembleICDF(answers) { return `**Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data:** ${answers.data} **Format:** Please provide the output as ${answers.format === 'custom' ? answers.formatCustom : answers.format}. ${getFormatGuidance(answers.format)}`; } function getFormatGuidance(format) { const guidance = { 'table': 'Structure the information in clear columns with headers.', 'list': 'Use bullet points for easy scanning.', 'report': 'Write in paragraph form with clear sections and headers.', 'summary': 'Provide a concise executive summary highlighting key findings.' }; return guidance[format] || ''; } RCREOC Template: javascript function assembleRCREOC(answers) { const role = answers.role === 'custom' ? answers.roleCustom : getRoleTitle(answers.role); return `**Role:** You are a ${role}. **Context:** ${answers.context} **Request:** ${answers.request} **Examples:** ${answers.examples} **Output:** ${getOutputFormat(answers.output)} **Constraints:** ${getConstraints(answers.constraints)}`; } function getRoleTitle(roleKey) { const roles = { 'art-director': 'Senior Art Director at a high-fashion advertising agency', 'photo-editor': 'Professional Photo Editor with 10+ years experience', 'business-consultant': 'Senior Business Strategy Consultant', 'marketing-strategist': 'Marketing Strategy Director', 'technical-expert': 'Technical Specialist and Industry Expert' }; return roles[roleKey]; } MICRO Template: javascript function assembleMICRO(answers) { return `**Message:** ${answers.message} **Intention:** ${answers.intention} **Context:** ${answers.context} **Rhythm:** ${getRhythmDescription(answers.rhythm)} **Output:** Create a ${answers.output === 'custom' ? answers.outputCustom : getOutputType(answers.output)} that ${answers.intention}`; } function getRhythmDescription(rhythm) { const rhythms = { 'fast-exciting': 'Use a fast-paced, exciting tone with short sentences and dynamic language.', 'calm-educational': 'Maintain a calm, educational tone that explains concepts clearly.', 'witty-conversational': 'Write in a witty, conversational style that feels like talking to a friend.', 'professional-authoritative': 'Use a professional, authoritative voice that establishes credibility.', 'inspiring-motivational': 'Create an inspiring, motivational tone that energizes the reader.' }; return rhythm === 'custom' ? answers.rhythmCustom : rhythms[rhythm]; } COSTAR Template: javascript function assembleCOSTAR(answers) { return `**Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** ${getStyleDescription(answers.style)} **Target:** ${answers.target} **Action:** ${getActionCTA(answers.action)} **Result:** The goal is to ${answers.result}`; } function getStyleDescription(style) { const styles = { 'elegant-minimal': 'Write in an elegant, minimalist styleโ€”simple, sophisticated, and chic.', 'urgent-exciting': 'Create urgency and excitementโ€”make them feel they can't miss this.', 'friendly-warm': 'Use a friendly, warm tone like a message from a trusted friend.', 'professional-trustworthy': 'Maintain a professional, trustworthy voice that builds confidence.', 'bold-provocative': 'Be bold and provocativeโ€”challenge assumptions and grab attention.' }; return style === 'custom' ? answers.styleCustom : styles[style]; } 6. UI/UX Specifications Landing Page (/prompt-generator) Hero Section: jsx <section className="hero-section"> <h1>AI Prompt Generator</h1> <p className="subtitle"> Transform your simple idea into a professional AI prompt in 60 seconds </p> <div className="framework-wizard"> <h2>What do you want to do?</h2> <div className="framework-grid"> {/* 4 Framework Cards */} <FrameworkCard icon="๐Ÿ“Š" title="Analyze Data" subtitle="Get precise analytical insights" color="#3B82F6" onClick={() => selectFramework('ICDF')} /> <FrameworkCard icon="๐ŸŽฏ" title="Get Expert Advice" subtitle="AI becomes your specialist consultant" color="#8B5CF6" onClick={() => selectFramework('RCREOC')} /> <FrameworkCard icon="โœ๏ธ" title="Create Content" subtitle="Generate engaging written content" color="#10B981" onClick={() => selectFramework('MICRO')} /> <FrameworkCard icon="๐Ÿš€" title="Write Marketing Copy" subtitle="Craft persuasive sales messages" color="#F59E0B" onClick={() => selectFramework('COSTAR')} /> </div> </div> </section> Framework Card Component: jsx const FrameworkCard = ({ icon, title, subtitle, color, onClick }) => ( <button className="framework-card" style={{ borderColor: color }} onClick={onClick} > <div className="icon" style={{ color }}>{icon}</div> <h3>{title}</h3> <p>{subtitle}</p> <span className="arrow">โ†’</span> </button> ); Initial Prompt Input Screen jsx <section className="prompt-input-section"> <div className="back-button" onClick={goBack}> โ† Back to framework selection </div> <div className="selected-framework-badge" style={{ backgroundColor: frameworkColor }}> {frameworkIcon} {frameworkTitle} </div> <h2>Describe what you need</h2> <p className="helper-text"> Write in your own wordsโ€”we'll ask follow-up questions to make it perfect. </p> <textarea className="initial-prompt-input" placeholder="e.g., I need to analyze my website traffic to see which blog posts get the most engagement..." value={userPrompt} onChange={(e) => setUserPrompt(e.target.value)} rows={6} /> <button className="continue-btn" onClick={startQuestionnaire} disabled={userPrompt.length < 10} > Continue โ†’ </button> </section> Adaptive Questionnaire Screen jsx <section className="questionnaire-section"> {/* Progress indicator */} <div className="progress-bar"> <div className="progress-fill" style={{ width: `${(currentQuestion / totalQuestions) * 100}%` }} /> </div> <p className="progress-text"> Question {currentQuestion} of {totalQuestions} </p> {/* Question card */} <div className="question-card"> <label className="question-label"> {question.label} {question.tooltip && ( <Tooltip content={question.tooltip}> <span className="info-icon">โ„น๏ธ</span> </Tooltip> )} </label> {/* Render based on question type */} {question.type === 'choice' && ( <div className="choice-grid"> {question.options.map(option => ( <button key={option.value} className={`choice-btn ${selectedValue === option.value ? 'selected' : ''}`} onClick={() => handleChoice(option.value)} > {option.label} </button> ))} </div> )} {question.type === 'textarea' && ( <textarea className="question-textarea" placeholder={question.placeholder} value={answer} onChange={(e) => setAnswer(e.target.value)} rows={4} /> )} {/* Custom input for "Other" options */} {showCustomInput && ( <input type="text" className="custom-input" placeholder="Specify..." value={customValue} onChange={(e) => setCustomValue(e.target.value)} /> )} </div> {/* Navigation */} <div className="question-nav"> <button className="btn-secondary" onClick={previousQuestion} disabled={currentQuestion === 1} > โ† Previous </button> <button className="btn-skip" onClick={skipQuestion} > Skip (use default) </button> <button className="btn-primary" onClick={nextQuestion} > {currentQuestion === totalQuestions ? 'Generate Prompt' : 'Next โ†’'} </button> </div> </section> Before/After Comparison Screen jsx <section className="results-section"> <div className="success-header"> <span className="success-icon">โœ“</span> <h2>Your Professional Prompt is Ready!</h2> </div> {/* Desktop: Side-by-side, Mobile: Stacked */} <div className="comparison-container"> <div className="prompt-box original"> <div className="prompt-header"> <h3>Your Original Prompt</h3> <span className="badge amateur">Amateur</span> </div> <div className="prompt-content"> {originalPrompt} </div> </div> <div className="arrow-separator"> <span className="transform-arrow">โ†’</span> <span className="transform-text">Transformed into</span> </div> <div className="prompt-box enhanced"> <div className="prompt-header"> <h3>Professional Version</h3> <span className="badge pro">Pro</span> <button className="copy-btn" onClick={() => copyToClipboard(enhancedPrompt)} > {copied ? 'โœ“ Copied!' : '๐Ÿ“‹ Copy'} </button> </div> <div className="prompt-content highlighted"> {enhancedPrompt} </div> </div> </div> {/* Learning Mode Explanations */} <div className="learning-section"> <h3> <span className="icon">๐Ÿ’ก</span> Why This Works Better </h3> <div className="improvements-list"> {improvements.map((improvement, index) => ( <div key={index} className="improvement-item"> <span className="check">โœ“</span> <div> <strong>{improvement.title}</strong> <p>{improvement.explanation}</p> </div> </div> ))} </div> </div> {/* Actions */} <div className="results-actions"> <button className="btn-secondary" onClick={startOver}> โ† Create Another Prompt </button> <button className="btn-primary" onClick={() => copyToClipboard(enhancedPrompt)}> ๐Ÿ“‹ Copy Professional Prompt </button> </div> </section> Learning Mode Improvement Generator javascript function generateImprovements(framework, originalPrompt, answers) { const improvements = []; switch(framework) { case 'ICDF': improvements.push({ title: 'Added Clear Instruction', explanation: 'Instead of vague direction, we specified exactly what task the AI should perform.' }); if (answers.context !== 'General business analysis') { improvements.push({ title: 'Provided Context', explanation: 'Context helps the AI understand WHY you need this, leading to more relevant results.' }); } if (answers.data) { improvements.push({ title: 'Defined Data Scope', explanation: 'Telling the AI what data to work with sets clear expectations and boundaries.' }); } improvements.push({ title: 'Specified Output Format', explanation: `Requesting ${answers.format} format ensures the results are structured and actionable.` }); break; case 'RCREOC': improvements.push({ title: 'Assigned Expert Role', explanation: `Making the AI act as a ${answers.role} changes how it thinks and responds.` }); improvements.push({ title: 'Set Professional Context', explanation: 'Describing the work environment makes the AI\'s advice more targeted and realistic.' }); if (answers.examples) { improvements.push({ title: 'Provided Examples', explanation: 'Examples guide the AI\'s reasoning styleโ€”showing what "good" looks like.' }); } improvements.push({ title: 'Defined Constraints', explanation: 'Setting tone and style rules ensures the output matches your needs.' }); break; case 'MICRO': improvements.push({ title: 'Clarified Core Message', explanation: 'A clear thesis ensures the content stays focused on one main idea.' }); improvements.push({ title: 'Defined Intention', explanation: 'Specifying what the audience should feel or do drives the content\'s direction.' }); improvements.push({ title: 'Set Rhythm & Tone', explanation: `${answers.rhythm} creates the right energy and voice for your audience.` }); improvements.push({ title: 'Specified Content Type', explanation: `Different formats (${answers.output}) have different structuresโ€”scripts need hooks, blogs need SEO.` }); break; case 'COSTAR': improvements.push({ title: 'Defined Target Audience', explanation: 'Knowing WHO you\'re selling to shapes the language, pain points, and benefits.' }); improvements.push({ title: 'Clarified the Offer', explanation: 'Being specific about the deal and urgency increases conversion rates.' }); improvements.push({ title: 'Set Brand Style', explanation: `${answers.style} tone creates emotional connection and matches your brand voice.` }); improvements.push({ title: 'Added Clear CTA', explanation: 'A single, clear call-to-action tells people exactly what to do next.' }); break; } return improvements; } 7. Technical Implementation File Structure /app /prompt-generator /page.tsx # Main landing page /layout.tsx # Layout wrapper /components /FrameworkWizard.tsx # 4-card selection UI /PromptInput.tsx # Initial prompt textarea /Questionnaire.tsx # Adaptive question flow /ResultsComparison.tsx # Before/After display /Tooltip.tsx # Learning mode tooltips /lib /frameworkDetection.ts # Keyword matching logic /questionSets.ts # All framework questions /promptAssembly.ts # Template generation /improvements.ts # Learning explanations /types /index.ts # TypeScript interfaces /styles /prompt-generator.css # Component styles Core Types (TypeScript) typescript // types/index.ts export type Framework = 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; export interface FrameworkConfig { id: Framework; keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: 'choice' | 'textarea'; label: string; placeholder?: string; required: boolean; default?: string; tooltip?: string; options?: ChoiceOption[]; } export interface ChoiceOption { value: string; label: string; hasInput?: boolean; } export interface Answer { questionId: string; value: string; customValue?: string; } export interface PromptSession { framework: Framework; originalPrompt: string; Code Snippet 1 Plain Textโ€ข 27 lines Landing Page (Quick-Start Wizard) โ†“ [4 Framework Cards with Icons] โ†“ User Selects Goal โ†’ Framework Auto-Selected โ†“ Initial Prompt Input "Describe what you need in your own words..." โ†“ Keyword Analysis (Rule-Based Detection) โ†“ Adaptive Questionnaire (3-7 questions) - Simple questions: Multiple choice buttons - Complex questions: Text fields - Learning tooltips on each question โ†“ Smart Defaults Applied (if user skips) โ†“ Before/After Comparison Page - Left: Original prompt - Right: Professional prompt (highlighted) - Copy button - Learning mode explanations โ†“ Success State "โœ“ Your professional prompt is ready!" [Copy to Clipboard] [Start Another] JavaScript JavaScriptโ€ข 33 lines const frameworkDetection = { ICDF: { keywords: ['analyze', 'review', 'evaluate', 'assess', 'data', 'report', 'examine', 'study', 'metrics', 'statistics'], icon: '๐Ÿ“Š', // Analytics/Chart icon color: '#3B82F6', // Blue title: 'Analyze Data', subtitle: 'Get precise analytical insights' }, RCREOC: { keywords: ['expert', 'professional', 'advice', 'consult', 'opinion', 'recommend', 'specialist', 'coach', 'mentor', 'guide'], icon: '๐ŸŽฏ', // Target/Expert icon color: '#8B5CF6', // Purple title: 'Get Expert Advice', subtitle: 'AI becomes your specialist consultant' }, MICRO: { keywords: ['write', 'create', 'content', 'blog', 'script', 'article', 'post', 'story', 'copy', 'draft', 'compose'], icon: 'โœ๏ธ', // Writing icon color: '#10B981', // Green title: 'Create Content', subtitle: 'Generate engaging written content' }, COSTAR: { keywords: ['sell', 'marketing', 'email', 'ad', 'promotion', 'campaign', 'sales', 'advertise', 'pitch', 'convert'], icon: '๐Ÿš€', // Rocket/Growth icon color: '#F59E0B', // Orange title: 'Write Marketing Copy', subtitle: 'Craft persuasive sales messages' } }; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 19 lines function detectFramework(userInput) { const input = userInput.toLowerCase(); const scores = {}; // Count keyword matches for each framework Object.keys(frameworkDetection).forEach(framework => { scores[framework] = frameworkDetection[framework].keywords .filter(keyword => input.includes(keyword)) .length; }); // Return framework with highest score const winner = Object.keys(scores).reduce((a, b) => scores[a] > scores[b] ? a : b ); // If no clear winner (all zeros), default to MICRO (most general) return scores[winner] > 0 ? winner : 'MICRO'; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 40 lines const icdfQuestions = [ { id: 'instruction', type: 'textarea', label: 'What specific task should the AI perform?', placeholder: 'e.g., Analyze traffic patterns and identify top-performing content', required: true, tooltip: 'Be specific about the action you wantโ€”this is your core instruction.' }, { id: 'context', type: 'textarea', label: 'What's the background or purpose?', placeholder: 'e.g., I run a photography blog and need to understand what content drives bookings', default: 'General business analysis', tooltip: 'Context helps AI understand WHY you need thisโ€”it tailors the analysis to your goals.' }, { id: 'data', type: 'textarea', label: 'What data will you provide to the AI?', placeholder: 'e.g., 3 months of Google Analytics data including traffic sources, bounce rates, and conversions', default: 'Standard dataset', tooltip: 'Specify what information the AI will work withโ€”this sets expectations.' }, { id: 'format', type: 'choice', label: 'How should the output be structured?', options: [ { value: 'table', label: '๐Ÿ“Š Table/Spreadsheet' }, { value: 'list', label: '๐Ÿ“ Bullet Points' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'summary', label: 'โšก Executive Summary' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], default: 'list', tooltip: 'Format determines how readable and actionable your results will be.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 69 lines const rcreocQuestions = [ { id: 'role', type: 'choice', label: 'What expert role should the AI take?', options: [ { value: 'art-director', label: '๐ŸŽจ Senior Art Director' }, { value: 'photo-editor', label: '๐Ÿ“ธ Professional Photo Editor' }, { value: 'business-consultant', label: '๐Ÿ’ผ Business Consultant' }, { value: 'marketing-strategist', label: '๐Ÿ“ˆ Marketing Strategist' }, { value: 'technical-expert', label: 'โš™๏ธ Technical Specialist' }, { value: 'custom', label: 'โœ๏ธ Custom Role', hasInput: true } ], required: true, tooltip: 'The role shapes how the AI thinks and respondsโ€”choose the expert you need.' }, { id: 'context', type: 'textarea', label: 'Describe the situation this expert is working in', placeholder: 'e.g., You are reviewing portfolio submissions for a high-end fashion campaign', default: 'Professional consulting environment', tooltip: 'Context gives the "expert" the scenarioโ€”this makes advice more targeted.' }, { id: 'request', type: 'textarea', label: 'What specific task should this expert complete?', placeholder: 'e.g., Review these 10 images and identify technical issues and strengths', required: true, tooltip: 'The specific task the expert will performโ€”be clear and actionable.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output you want', placeholder: 'e.g., If you see underexposed images, note this as an issue and recommend using a light meter', default: 'Use professional industry standards', tooltip: 'Examples guide the AI's reasoning styleโ€”show what "good" looks like.' }, { id: 'output', type: 'choice', label: 'What format should the expert deliver?', options: [ { value: 'table', label: '๐Ÿ“Š Structured Table' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'checklist', label: 'โœ… Action Checklist' }, { value: 'recommendations', label: '๐Ÿ’ก Recommendation List' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], default: 'recommendations', tooltip: 'Output format determines how you'll use the expert's advice.' }, { id: 'constraints', type: 'choice', label: 'What tone and style should the expert use?', options: [ { value: 'professional-constructive', label: '๐ŸŽฏ Professional & Constructive' }, { value: 'direct-concise', label: 'โšก Direct & Concise' }, { value: 'detailed-educational', label: '๐Ÿ“š Detailed & Educational' }, { value: 'friendly-encouraging', label: '๐Ÿ˜Š Friendly & Encouraging' }, { value: 'custom', label: 'โœ๏ธ Custom Tone', hasInput: true } ], default: 'professional-constructive', tooltip: 'Constraints set boundariesโ€”tone, length, and style rules for the output.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 56 lines const microQuestions = [ { id: 'message', type: 'textarea', label: 'What's the core idea or thesis?', placeholder: 'e.g., Aperture controls both light and depth of fieldโ€”it's the most important camera setting to learn first', required: true, tooltip: 'Your message is the central pointโ€”what should the audience remember?' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after reading?', placeholder: 'e.g., Feel confident experimenting with aperture settings and excited to try it themselves', required: true, tooltip: 'Intention drives the emotional outcomeโ€”persuade, inspire, educate, or entertain?' }, { id: 'context', type: 'textarea', label: 'Who is the audience and where will they see this?', placeholder: 'e.g., Beginner photographers aged 25-40 watching on YouTube', default: 'General online audience', tooltip: 'Context shapes language, tone, and examplesโ€”know your reader.' }, { id: 'rhythm', type: 'choice', label: 'What tone and pace should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'calm-educational', label: '๐Ÿ“š Calm & Educational' }, { value: 'witty-conversational', label: '๐Ÿ˜„ Witty & Conversational' }, { value: 'professional-authoritative', label: '๐ŸŽฏ Professional & Authoritative' }, { value: 'inspiring-motivational', label: 'โœจ Inspiring & Motivational' }, { value: 'custom', label: 'โœ๏ธ Custom Rhythm', hasInput: true } ], default: 'calm-educational', tooltip: 'Rhythm is the voice and energyโ€”fast or slow, serious or playful?' }, { id: 'output', type: 'choice', label: 'What type of content are you creating?', options: [ { value: 'youtube-script', label: '๐ŸŽฅ YouTube Script' }, { value: 'blog-post', label: '๐Ÿ“ Blog Post' }, { value: 'social-media', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: '๐Ÿ“ง Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'custom', label: 'โœ๏ธ Custom Format', hasInput: true } ], required: true, tooltip: 'Output type determines structureโ€”scripts need hooks, blogs need SEO, etc.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 64 lines const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What's the marketing situation?', placeholder: 'e.g., Launching a new Lightroom preset pack for wedding photographers', required: true, tooltip: 'Context sets the stageโ€”new product, seasonal sale, or re-engagement campaign?' }, { id: 'offer', type: 'textarea', label: 'What's the specific offer or product?', placeholder: 'e.g., "California Light" preset collection, 25% off for 3 days', required: true, tooltip: 'The offer is what you're sellingโ€”be specific about the deal and urgency.' }, { id: 'style', type: 'choice', label: 'What tone should the marketing copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimal' }, { value: 'urgent-exciting', label: 'โšก Urgent & Exciting' }, { value: 'friendly-warm', label: '๐Ÿ˜Š Friendly & Warm' }, { value: 'professional-trustworthy', label: '๐ŸŽฏ Professional & Trustworthy' }, { value: 'bold-provocative', label: '๐Ÿ”ฅ Bold & Provocative' }, { value: 'custom', label: 'โœ๏ธ Custom Style', hasInput: true } ], default: 'friendly-warm', tooltip: 'Style creates the emotional connectionโ€”match your brand voice.' }, { id: 'target', type: 'textarea', label: 'Who is your target customer?', placeholder: 'e.g., Wedding and lifestyle photographers aged 25-45 who want to speed up their editing workflow', required: true, tooltip: 'Target audience determines language, pain points, and benefits to highlight.' }, { id: 'action', type: 'choice', label: 'What's the primary call-to-action?', options: [ { value: 'buy-now', label: '๐Ÿ›’ Buy Now' }, { value: 'sign-up', label: '๐Ÿ“ Sign Up' }, { value: 'learn-more', label: '๐Ÿ“š Learn More' }, { value: 'download', label: 'โฌ‡๏ธ Download' }, { value: 'book-call', label: '๐Ÿ“ž Book a Call' }, { value: 'custom', label: 'โœ๏ธ Custom CTA', hasInput: true } ], required: true, tooltip: 'Action is the ONE thing you want them to doโ€”make it crystal clear.' }, { id: 'result', type: 'textarea', label: 'What's your business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build email list of potential customers', default: 'Increase conversions and revenue', tooltip: 'Result aligns the copy with your business objectiveโ€”sales, leads, or awareness?' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 19 lines function assembleICDF(answers) { return `**Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data:** ${answers.data} **Format:** Please provide the output as ${answers.format === 'custom' ? answers.formatCustom : answers.format}. ${getFormatGuidance(answers.format)}`; } function getFormatGuidance(format) { const guidance = { 'table': 'Structure the information in clear columns with headers.', 'list': 'Use bullet points for easy scanning.', 'report': 'Write in paragraph form with clear sections and headers.', 'summary': 'Provide a concise executive summary highlighting key findings.' }; return guidance[format] || ''; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 26 lines function assembleRCREOC(answers) { const role = answers.role === 'custom' ? answers.roleCustom : getRoleTitle(answers.role); return `**Role:** You are a ${role}. **Context:** ${answers.context} **Request:** ${answers.request} **Examples:** ${answers.examples} **Output:** ${getOutputFormat(answers.output)} **Constraints:** ${getConstraints(answers.constraints)}`; } function getRoleTitle(roleKey) { const roles = { 'art-director': 'Senior Art Director at a high-fashion advertising agency', 'photo-editor': 'Professional Photo Editor with 10+ years experience', 'business-consultant': 'Senior Business Strategy Consultant', 'marketing-strategist': 'Marketing Strategy Director', 'technical-expert': 'Technical Specialist and Industry Expert' }; return roles[roleKey]; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 22 lines function assembleMICRO(answers) { return `**Message:** ${answers.message} **Intention:** ${answers.intention} **Context:** ${answers.context} **Rhythm:** ${getRhythmDescription(answers.rhythm)} **Output:** Create a ${answers.output === 'custom' ? answers.outputCustom : getOutputType(answers.output)} that ${answers.intention}`; } function getRhythmDescription(rhythm) { const rhythms = { 'fast-exciting': 'Use a fast-paced, exciting tone with short sentences and dynamic language.', 'calm-educational': 'Maintain a calm, educational tone that explains concepts clearly.', 'witty-conversational': 'Write in a witty, conversational style that feels like talking to a friend.', 'professional-authoritative': 'Use a professional, authoritative voice that establishes credibility.', 'inspiring-motivational': 'Create an inspiring, motivational tone that energizes the reader.' }; return rhythm === 'custom' ? answers.rhythmCustom : rhythms[rhythm]; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 24 lines function assembleCOSTAR(answers) { return `**Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** ${getStyleDescription(answers.style)} **Target:** ${answers.target} **Action:** ${getActionCTA(answers.action)} **Result:** The goal is to ${answers.result}`; } function getStyleDescription(style) { const styles = { 'elegant-minimal': 'Write in an elegant, minimalist styleโ€”simple, sophisticated, and chic.', 'urgent-exciting': 'Create urgency and excitementโ€”make them feel they can't miss this.', 'friendly-warm': 'Use a friendly, warm tone like a message from a trusted friend.', 'professional-trustworthy': 'Maintain a professional, trustworthy voice that builds confidence.', 'bold-provocative': 'Be bold and provocativeโ€”challenge assumptions and grab attention.' }; return style === 'custom' ? answers.styleCustom : styles[style]; } This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 41 lines <section className="hero-section"> <h1>AI Prompt Generator</h1> <p className="subtitle"> Transform your simple idea into a professional AI prompt in 60 seconds </p> <div className="framework-wizard"> <h2>What do you want to do?</h2> <div className="framework-grid"> {/* 4 Framework Cards */} <FrameworkCard icon="๐Ÿ“Š" title="Analyze Data" subtitle="Get precise analytical insights" color="#3B82F6" onClick={() => selectFramework('ICDF')} /> <FrameworkCard icon="๐ŸŽฏ" title="Get Expert Advice" subtitle="AI becomes your specialist consultant" color="#8B5CF6" onClick={() => selectFramework('RCREOC')} /> <FrameworkCard icon="โœ๏ธ" title="Create Content" subtitle="Generate engaging written content" color="#10B981" onClick={() => selectFramework('MICRO')} /> <FrameworkCard icon="๐Ÿš€" title="Write Marketing Copy" subtitle="Craft persuasive sales messages" color="#F59E0B" onClick={() => selectFramework('COSTAR')} /> </div> </div> </section> This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 12 lines const FrameworkCard = ({ icon, title, subtitle, color, onClick }) => ( <button className="framework-card" style={{ borderColor: color }} onClick={onClick} > <div className="icon" style={{ color }}>{icon}</div> <h3>{title}</h3> <p>{subtitle}</p> <span className="arrow">โ†’</span> </button> ); This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 30 lines <section className="prompt-input-section"> <div className="back-button" onClick={goBack}> โ† Back to framework selection </div> <div className="selected-framework-badge" style={{ backgroundColor: frameworkColor }}> {frameworkIcon} {frameworkTitle} </div> <h2>Describe what you need</h2> <p className="helper-text"> Write in your own wordsโ€”we'll ask follow-up questions to make it perfect. </p> <textarea className="initial-prompt-input" placeholder="e.g., I need to analyze my website traffic to see which blog posts get the most engagement..." value={userPrompt} onChange={(e) => setUserPrompt(e.target.value)} rows={6} /> <button className="continue-btn" onClick={startQuestionnaire} disabled={userPrompt.length < 10} > Continue โ†’ </button> </section> This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 85 lines <section className="questionnaire-section"> {/* Progress indicator */} <div className="progress-bar"> <div className="progress-fill" style={{ width: `${(currentQuestion / totalQuestions) * 100}%` }} /> </div> <p className="progress-text"> Question {currentQuestion} of {totalQuestions} </p> {/* Question card */} <div className="question-card"> <label className="question-label"> {question.label} {question.tooltip && ( <Tooltip content={question.tooltip}> <span className="info-icon">โ„น๏ธ</span> </Tooltip> )} </label> {/* Render based on question type */} {question.type === 'choice' && ( <div className="choice-grid"> {question.options.map(option => ( <button key={option.value} className={`choice-btn ${selectedValue === option.value ? 'selected' : ''}`} onClick={() => handleChoice(option.value)} > {option.label} </button> ))} </div> )} {question.type === 'textarea' && ( <textarea className="question-textarea" placeholder={question.placeholder} value={answer} onChange={(e) => setAnswer(e.target.value)} rows={4} /> )} {/* Custom input for "Other" options */} {showCustomInput && ( <input type="text" className="custom-input" placeholder="Specify..." value={customValue} onChange={(e) => setCustomValue(e.target.value)} /> )} </div> {/* Navigation */} <div className="question-nav"> <button className="btn-secondary" onClick={previousQuestion} disabled={currentQuestion === 1} > โ† Previous </button> <button className="btn-skip" onClick={skipQuestion} > Skip (use default) </button> <button className="btn-primary" onClick={nextQuestion} > {currentQuestion === totalQuestions ? 'Generate Prompt' : 'Next โ†’'} </button> </div> </section> This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 69 lines <section className="results-section"> <div className="success-header"> <span className="success-icon">โœ“</span> <h2>Your Professional Prompt is Ready!</h2> </div> {/* Desktop: Side-by-side, Mobile: Stacked */} <div className="comparison-container"> <div className="prompt-box original"> <div className="prompt-header"> <h3>Your Original Prompt</h3> <span className="badge amateur">Amateur</span> </div> <div className="prompt-content"> {originalPrompt} </div> </div> <div className="arrow-separator"> <span className="transform-arrow">โ†’</span> <span className="transform-text">Transformed into</span> </div> <div className="prompt-box enhanced"> <div className="prompt-header"> <h3>Professional Version</h3> <span className="badge pro">Pro</span> <button className="copy-btn" onClick={() => copyToClipboard(enhancedPrompt)} > {copied ? 'โœ“ Copied!' : '๐Ÿ“‹ Copy'} </button> </div> <div className="prompt-content highlighted"> {enhancedPrompt} </div> </div> </div> {/* Learning Mode Explanations */} <div className="learning-section"> <h3> <span className="icon">๐Ÿ’ก</span> Why This Works Better </h3> <div className="improvements-list"> {improvements.map((improvement, index) => ( <div key={index} className="improvement-item"> <span className="check">โœ“</span> <div> <strong>{improvement.title}</strong> <p>{improvement.explanation}</p> </div> </div> ))} </div> </div> {/* Actions */} <div className="results-actions"> <button className="btn-secondary" onClick={startOver}> โ† Create Another Prompt </button> <button className="btn-primary" onClick={() => copyToClipboard(enhancedPrompt)}> ๐Ÿ“‹ Copy Professional Prompt </button> </div> </section> This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 89 lines function generateImprovements(framework, originalPrompt, answers) { const improvements = []; switch(framework) { case 'ICDF': improvements.push({ title: 'Added Clear Instruction', explanation: 'Instead of vague direction, we specified exactly what task the AI should perform.' }); if (answers.context !== 'General business analysis') { improvements.push({ title: 'Provided Context', explanation: 'Context helps the AI understand WHY you need this, leading to more relevant results.' }); } if (answers.data) { improvements.push({ title: 'Defined Data Scope', explanation: 'Telling the AI what data to work with sets clear expectations and boundaries.' }); } improvements.push({ title: 'Specified Output Format', explanation: `Requesting ${answers.format} format ensures the results are structured and actionable.` }); break; case 'RCREOC': improvements.push({ title: 'Assigned Expert Role', explanation: `Making the AI act as a ${answers.role} changes how it thinks and responds.` }); improvements.push({ title: 'Set Professional Context', explanation: 'Describing the work environment makes the AI\'s advice more targeted and realistic.' }); if (answers.examples) { improvements.push({ title: 'Provided Examples', explanation: 'Examples guide the AI\'s reasoning styleโ€”showing what "good" looks like.' }); } improvements.push({ title: 'Defined Constraints', explanation: 'Setting tone and style rules ensures the output matches your needs.' }); break; case 'MICRO': improvements.push({ title: 'Clarified Core Message', explanation: 'A clear thesis ensures the content stays focused on one main idea.' }); improvements.push({ title: 'Defined Intention', explanation: 'Specifying what the audience should feel or do drives the content\'s direction.' }); improvements.push({ title: 'Set Rhythm & Tone', explanation: `${answers.rhythm} creates the right energy and voice for your audience.` }); improvements.push({ title: 'Specified Content Type', explanation: `Different formats (${answers.output}) have different structuresโ€”scripts need hooks, blogs need SEO.` }); break; case 'COSTAR': improvements.push({ title: 'Defined Target Audience', explanation: 'Knowing WHO you\'re selling to shapes the language, pain points, and benefits.' }); improvements.push({ title: 'Clarified the Offer', explanation: 'Being specific about the deal and urgency increases conversion rates.' }); improvements.push({ title: 'Set Brand Style', explanation: `${answers.style} tone creates emotional connection and matches your brand voice.` }); improvements.push({ title: 'Added Clear CTA', explanation: 'A single, clear call-to-action tells people exactly what to do next.' }); break; } return improvements; } This code can be executed in the preview sandbox Run Code Code Snippet 18 Plain Textโ€ข 19 lines /app /prompt-generator /page.tsx # Main landing page /layout.tsx # Layout wrapper /components /FrameworkWizard.tsx # 4-card selection UI /PromptInput.tsx # Initial prompt textarea /Questionnaire.tsx # Adaptive question flow /ResultsComparison.tsx # Before/After display /Tooltip.tsx # Learning mode tooltips /lib /frameworkDetection.ts # Keyword matching logic /questionSets.ts # All framework questions /promptAssembly.ts # Template generation /improvements.ts # Learning explanations /types /index.ts # TypeScript interfaces /styles /prompt-generator.css # Component styles Used 89 credits continue till the end Used 0 credits javascript const icdfQuestions = [ { id: 'instruction', type: 'textarea', label: 'What specific task should the AI perform?', placeholder: 'e.g., Analyze my website traffic and identify top-performing pages', required: true, tooltip: 'The clearer your instruction, the more precise the AI\'s response. Be specific about the action you want.' }, { id: 'context', type: 'textarea', label: 'What\'s the background or purpose?', placeholder: 'e.g., I\'m a wedding photographer trying to understand which blog posts drive the most inquiries', required: false, defaultValue: 'General analysis for decision-making purposes', tooltip: 'Context helps the AI understand WHY you need this analysis, leading to more relevant insights.' }, { id: 'data', type: 'textarea', label: 'What data or information should the AI work with?', placeholder: 'e.g., Traffic data from July-September including bounce rate, time-on-page, and conversions', required: false, defaultValue: 'Standard relevant data points', tooltip: 'Specify exactly what information the AI should analyze. The more specific, the better.' }, { id: 'format', type: 'multiple-choice', label: 'How should the output be structured?', options: [ { value: 'bullet-points', label: 'Bullet Points' }, { value: 'table', label: 'Table Format' }, { value: 'report', label: 'Detailed Report' }, { value: 'summary', label: 'Executive Summary' }, { value: 'custom', label: 'Custom...', hasTextField: true } ], required: false, defaultValue: 'Clear, organized summary with actionable insights', tooltip: 'Defining the output format ensures you get results in the exact structure you need.' } ]; RCREOC Framework Questions javascript const rcreocQuestions = [ { id: 'role', type: 'multiple-choice', label: 'What expert role should the AI assume?', options: [ { value: 'senior-photographer', label: '๐Ÿ“ธ Senior Photographer' }, { value: 'art-director', label: '๐ŸŽจ Art Director' }, { value: 'marketing-expert', label: '๐Ÿ“ˆ Marketing Strategist' }, { value: 'business-consultant', label: '๐Ÿ’ผ Business Consultant' }, { value: 'technical-expert', label: 'โš™๏ธ Technical Specialist' }, { value: 'custom', label: 'Other Expert...', hasTextField: true } ], required: true, tooltip: 'Assigning a specific role makes the AI respond with the expertise and perspective of that professional.' }, { id: 'context', type: 'textarea', label: 'Describe the situation or environment', placeholder: 'e.g., We\'re reviewing a photographer\'s portfolio for a potential high-fashion campaign', required: false, defaultValue: 'Professional consulting environment', tooltip: 'Context sets the stakes and helps the AI understand the real-world implications.' }, { id: 'request', type: 'textarea', label: 'What specific task should this expert complete?', placeholder: 'e.g., Review the portfolio and identify technical issues, strengths, and provide recommendations', required: true, tooltip: 'This is the core deliverable you need from your virtual expert.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output you want', placeholder: 'e.g., If you see underexposed images, note this under "Issues" and recommend "use a light meter"', required: false, defaultValue: 'Professional industry-standard analysis', tooltip: 'Examples guide the AI\'s reasoning process and output style.' }, { id: 'output', type: 'multiple-choice', label: 'What format should the deliverable take?', options: [ { value: 'table', label: '๐Ÿ“Š Table' }, { value: 'list', label: '๐Ÿ“ Numbered List' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'scorecard', label: 'โญ Scorecard' }, { value: 'custom', label: 'Custom Format...', hasTextField: true } ], required: false, defaultValue: 'Structured professional assessment', tooltip: 'The output format determines how easy it is to use the AI\'s advice.' }, { id: 'constraints', type: 'multiple-choice', label: 'What tone and style should the expert use?', options: [ { value: 'professional-constructive', label: 'Professional & Constructive' }, { value: 'direct-actionable', label: 'Direct & Actionable' }, { value: 'encouraging-supportive', label: 'Encouraging & Supportive' }, { value: 'formal-academic', label: 'Formal & Academic' }, { value: 'custom', label: 'Custom Tone...', hasTextField: true } ], required: false, defaultValue: 'Professional and clear', tooltip: 'Tone constraints ensure the AI communicates in a way that matches your needs.' } ]; MICRO Framework Questions javascript const microQuestions = [ { id: 'message', type: 'textarea', label: 'What\'s the core message or main idea?', placeholder: 'e.g., Aperture controls both light and depth of fieldโ€”it\'s the most important camera setting to master first', required: true, tooltip: 'Your message is the "thesis"โ€”the one key takeaway your audience should remember.' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after consuming this?', placeholder: 'e.g., Feel confident and motivated to experiment with aperture settings on their own camera', required: false, defaultValue: 'Inform and engage the audience', tooltip: 'Intention drives the emotional arc and call-to-action of your content.' }, { id: 'context-audience', type: 'textarea', label: 'Who is your audience and where will they see this?', placeholder: 'e.g., Beginner photographers aged 25-40, watching on YouTube during their learning journey', required: false, defaultValue: 'General audience on standard platforms', tooltip: 'Knowing your audience helps the AI match the complexity and references to their level.' }, { id: 'rhythm', type: 'multiple-choice', label: 'What tone and pacing should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'conversational-friendly', label: '๐Ÿ’ฌ Conversational & Friendly' }, { value: 'professional-authoritative', label: '๐ŸŽ“ Professional & Authoritative' }, { value: 'calm-educational', label: '๐Ÿ“š Calm & Educational' }, { value: 'witty-entertaining', label: '๐Ÿ˜„ Witty & Entertaining' }, { value: 'custom', label: 'Custom Rhythm...', hasTextField: true } ], required: false, defaultValue: 'Engaging and clear', tooltip: 'Rhythm defines the "voice" and energy level of your content.' }, { id: 'output-type', type: 'multiple-choice', label: 'What type of content are you creating?', options: [ { value: 'youtube-script', label: '๐ŸŽฅ YouTube Script' }, { value: 'blog-post', label: '๐Ÿ“ Blog Post' }, { value: 'social-media', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: '๐Ÿ“ง Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'instagram-carousel', label: '๐Ÿ“ธ Instagram Carousel' }, { value: 'custom', label: 'Other Format...', hasTextField: true } ], required: true, tooltip: 'Each content type has specific structural requirements the AI will follow.' }, { id: 'length', type: 'multiple-choice', label: 'How long should this content be?', options: [ { value: 'short', label: '30 seconds - 1 minute' }, { value: 'medium', label: '3-5 minutes' }, { value: 'long', label: '10+ minutes' }, { value: 'word-count', label: 'Specific word count...', hasTextField: true } ], required: false, defaultValue: 'Appropriate length for the format', tooltip: 'Length constraints help the AI pace the content appropriately.' } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What\'s the marketing situation or campaign?', placeholder: 'e.g., Launching a new Lightroom preset pack called "California Light"', required: true, tooltip: 'Context sets the stage for your marketing message.' }, { id: 'offer', type: 'textarea', label: 'What\'s the specific product, service, or deal?', placeholder: 'e.g., 25% off the preset pack for the first 3 days only', required: true, tooltip: 'Your offer is what you\'re sellingโ€”be crystal clear about value and urgency.' }, { id: 'style', type: 'multiple-choice', label: 'What tone and voice should the copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimal' }, { value: 'urgent-exciting', label: '๐Ÿ”ฅ Urgent & Exciting' }, { value: 'friendly-warm', label: '๐Ÿ˜Š Friendly & Warm' }, { value: 'professional-trustworthy', label: '๐Ÿค Professional & Trustworthy' }, { value: 'bold-confident', label: '๐Ÿ’ช Bold & Confident' }, { value: 'custom', label: 'Custom Style...', hasTextField: true } ], required: false, defaultValue: 'Professional and persuasive', tooltip: 'Style determines how your brand "sounds" to customers.' }, { id: 'target', type: 'textarea', label: 'Who is your ideal customer?', placeholder: 'e.g., 25-45 year old lifestyle and wedding photographers who want faster, more beautiful editing', required: false, defaultValue: 'Target customers interested in this offering', tooltip: 'The more specific your target audience, the more personalized and effective the copy.' }, { id: 'action', type: 'textarea', label: 'What\'s the ONE action you want them to take?', placeholder: 'e.g., Click "Buy Now" before the 3-day discount expires', required: true, tooltip: 'A clear, single call-to-action dramatically increases conversion rates.' }, { id: 'result', type: 'textarea', label: 'What\'s your business goal for this campaign?', placeholder: 'e.g., Generate 50 sales in the first 3 days and build momentum for future launches', required: false, defaultValue: 'Drive conversions and grow revenue', tooltip: 'Understanding the business goal helps craft copy that aligns with your strategy.' } ]; 5. Prompt Assembly Logic Template Structure Each framework has a template that combines user answers into a professional prompt: javascript // ICDF Template function assembleICDF(answers) { return `${answers.instruction} **Context:** ${answers.context} **Data to analyze:** ${answers.data} **Required output format:** ${answers.format} Please provide a ${answers.format} that directly addresses the instruction above, using the specified data and keeping the context in mind.`; } // RCREOC Template function assembleRCREOC(answers) { return `You are a ${answers.role}. **Context:** ${answers.context} **Your task:** ${answers.request} **Example of expected thinking:** ${answers.examples} **Required output format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as the assigned role, following the output format and constraints specified.`; } // MICRO Template function assembleMICRO(answers) { return `Create a ${answers.outputType} with the following specifications: **Core Message:** ${answers.message} **Intended audience impact:** ${answers.intention} **Target Audience & Platform:** ${answers.contextAudience} **Tone and Pacing:** ${answers.rhythm} **Length:** ${answers.length} The content should communicate the core message clearly while achieving the intended emotional impact and maintaining the specified tone throughout.`; } // COSTAR Template function assembleCOSTAR(answers) { return `Write marketing copy for the following campaign: **Campaign Context:** ${answers.context} **Offer/Product:** ${answers.offer} **Brand Voice & Style:** ${answers.style} **Target Customer:** ${answers.target} **Desired Action (CTA):** ${answers.action} **Business Goal:** ${answers.result} The copy should speak directly to the target customer, highlight the offer's value, maintain the brand voice, and drive the desired action while supporting the overall business goal.`; } 6. UI/UX Component Specifications Landing Page (Quick-Start Wizard) tsx // /app/prompt-generator/page.tsx import { FrameworkCard } from '@/components/prompt-generator/FrameworkCard'; export default function PromptGeneratorPage() { return ( <div className="container mx-auto px-4 py-12"> {/* Hero Section */} <div className="text-center mb-12"> <h1 className="text-4xl md:text-5xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> Transform your simple idea into a professional AI prompt in 60 seconds. No expertise required. </p> </div> {/* Framework Selection Cards */} <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto"> <FrameworkCard icon="๐Ÿ“Š" color="#3B82F6" title="Analyze Data" subtitle="Get precise analytical insights" framework="ICDF" examples={[ "Review website analytics", "Evaluate business metrics", "Assess survey results" ]} /> <FrameworkCard icon="๐ŸŽฏ" color="#8B5CF6" title="Get Expert Advice" subtitle="AI becomes your specialist" framework="RCREOC" examples={[ "Portfolio review", "Business consultation", "Technical guidance" ]} /> <FrameworkCard icon="โœ๏ธ" color="#10B981" title="Create Content" subtitle="Generate engaging content" framework="MICRO" examples={[ "YouTube scripts", "Blog posts", "Social media content" ]} /> <FrameworkCard icon="๐Ÿš€" color="#F59E0B" title="Write Marketing" subtitle="Craft persuasive copy" framework="COSTAR" examples={[ "Sales emails", "Ad campaigns", "Product descriptions" ]} /> </div> {/* Not Sure Option */} <div className="mt-8 text-center"> <p className="text-gray-600 mb-4">Not sure which one you need?</p> <button className="btn-secondary"> Describe Your Goal โ†’ </button> </div> </div> ); } Framework Card Component tsx // /components/prompt-generator/FrameworkCard.tsx interface FrameworkCardProps { icon: string; color: string; title: string; subtitle: string; framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; examples: string[]; } export function FrameworkCard({ icon, color, title, subtitle, framework, examples }: FrameworkCardProps) { return ( <div className="border-2 border-gray-200 rounded-lg p-6 hover:shadow-lg transition-all cursor-pointer group" onClick={() => window.location.href = `/prompt-generator/${framework.toLowerCase()}`} > {/* Icon */} <div className="text-5xl mb-4 transition-transform group-hover:scale-110" style={{ filter: `drop-shadow(0 0 8px ${color}40)` }} > {icon} </div> {/* Title */} <h3 className="text-xl font-bold mb-2">{title}</h3> <p className="text-gray-600 text-sm mb-4">{subtitle}</p> {/* Examples */} <div className="space-y-2"> <p className="text-xs font-semibold text-gray-500 uppercase">Examples:</p> {examples.map((example, idx) => ( <div key={idx} className="text-sm text-gray-700 flex items-start"> <span className="mr-2">โ€ข</span> <span>{example}</span> </div> ))} </div> {/* CTA */} <div className="mt-6 text-center py-2 rounded font-semibold text-white transition-colors" style={{ backgroundColor: color }} > Start โ†’ </div> </div> ); } 7. Question Flow Component tsx // /components/prompt-generator/QuestionFlow.tsx 'use client'; import { useState } from 'react'; import { Tooltip } from '@/components/ui/Tooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; options?: Array<{ value: string; label: string; hasTextField?: boolean }>; required: boolean; defaultValue: string; tooltip: string; } interface QuestionFlowProps { questions: Question[]; framework: string; onComplete: (answers: Record<string, string>) => void; } export function QuestionFlow({ questions, framework, onComplete }: QuestionFlowProps) { const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const [customInputs, setCustomInputs] = useState<Record<string, string>>({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleNext = () => { // Apply smart default if skipped if (!answers[currentQuestion.id]) { setAnswers(prev => ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentStep < questions.length - 1) { setCurrentStep(prev => prev + 1); } else { // Final step - assemble prompt onComplete(answers); } }; const handlePrevious = () => { if (currentStep > 0) { setCurrentStep(prev => prev - 1); } }; return ( <div className="max-w-3xl mx-auto"> {/* Progress Bar */} <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 mb-2"> <span>Question {currentStep + 1} of {questions.length}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full bg-gray-200 rounded-full h-2"> <div className="bg-blue-600 h-2 rounded-full transition-all duration-300" style={{ width: `${progress}%` }} /> </div> </div> {/* Question Card */} <div className="bg-white border-2 border-gray-200 rounded-lg p-8"> {/* Question Label with Tooltip */} <div className="flex items-start justify-between mb-4"> <label className="text-lg font-semibold text-gray-900"> {currentQuestion.label} {currentQuestion.required && <span className="text-red-500 ml-1">*</span>} </label> <Tooltip content={currentQuestion.tooltip}> <button className="text-gray-400 hover:text-gray-600"> <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> <path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" /> </svg> </button> </Tooltip> </div> {/* Input Field */} {currentQuestion.type === 'textarea' ? ( <textarea className="w-full border-2 border-gray-300 rounded-lg p-4 focus:border-blue-500 focus:outline-none resize-none" rows={4} placeholder={currentQuestion.placeholder} value={answers[currentQuestion.id] || ''} onChange={(e) => setAnswers(prev => ({ ...prev, [currentQuestion.id]: e.target.value }))} /> ) : ( <div className="space-y-3"> {currentQuestion.options?.map((option) => ( <div key={option.value}> <button className={`w-full text-left p-4 border-2 rounded-lg transition-all ${ answers[currentQuestion.id] === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-300 hover:border-gray-400' }`} onClick={() => { setAnswers(prev => ({ ...prev, [currentQuestion.id]: option.value })); }} > {option.label} </button> {/* Custom text field for "Other" options */} {option.hasTextField && answers[currentQuestion.id] === option.value && ( <input type="text" className="w-full mt-2 border-2 border-gray-300 rounded-lg p-3 focus:border-blue-500 focus:outline-none" placeholder="Specify..." value={customInputs[currentQuestion.id] || ''} onChange={(e) => { setCustomInputs(prev => ({ ...prev, [currentQuestion.id]: e.target.value })); setAnswers(prev => ({ ...prev, [currentQuestion.id]: e.target.value })); }} /> )} </div> ))} </div> )} {/* Skip Notice */} {!currentQuestion.required && !answers[currentQuestion.id] && ( <p className="mt-3 text-sm text-gray-500 italic"> ๐Ÿ’ก You can skip this. We'll use: "{currentQuestion.defaultValue}" </p> )} </div> {/* Navigation Buttons */} <div className="flex justify-between mt-6"> <button onClick={handlePrevious} disabled={currentStep === 0} className="px-6 py-3 border-2 border-gray-300 rounded-lg font-semibold disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50" > โ† Previous </button> <button onClick={handleNext} className="px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700" > {currentStep === questions.length - 1 ? 'Generate Prompt โœจ' : 'Next โ†’'} </button> </div> </div> ); } 8. Before/After Comparison Component tsx // /components/prompt-generator/PromptComparison.tsx 'use client'; import { useState } from 'react'; import { Tooltip } from '@/components/ui/Tooltip'; interface PromptComparisonProps { originalPrompt: string; professionalPrompt: string; framework: string; improvements: Array<{ component: string; explanation: string; }>; } export function PromptComparison({ originalPrompt, professionalPrompt, framework, improvements }: PromptComparisonProps) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(professionalPrompt); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-6xl mx-auto"> {/* Success Header */} <div className="text-center mb-8"> <div className="inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-4"> <svg className="w-8 h-8 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" /> </svg> </div> <h2 className="text-3xl font-bold mb-2">Your Professional Prompt is Ready!</h2> <p className="text-gray-600">Using the {framework} framework</p> </div> {/* Side-by-Side Comparison (Desktop) / Stacked (Mobile) */} <div className="grid md:grid-cols-2 gap-6 mb-8"> {/* Original Prompt */} <div className="border-2 border-gray-300 rounded-lg p-6 bg-gray-50"> <h3 className="text-lg font-semibold mb-3 text-gray-700"> ๐Ÿ“ Your Original Prompt </h3> <div className="bg-white rounded p-4 text-gray-600 italic"> "{originalPrompt}" </div> </div> {/* Professional Prompt */} <div className="border-2 border-green-500 rounded-lg p-6 bg-green-50"> <div className="flex items-center justify-between mb-3"> <h3 className="text-lg font-semibold text-green-700"> โœจ Professional Version </h3> <button onClick={handleCopy} className="flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors" > {copied ? ( <> <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" /> </svg> Copied! </> ) : ( <> <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /> </svg> Copy </> )} </button> </div> <div className="bg-white rounded p-4 text-gray-900 font-mono text-sm whitespace-pre-wrap"> {professionalPrompt} </div> </div> </div> {/* Learning Mode: What Changed? */} <div className="bg-blue-50 border-2 border-blue-200 rounded-lg p-6"> <h3 className="text-xl font-semibold mb-4 flex items-center gap-2"> <span>๐Ÿ“š</span> <span>What Makes This Professional?</span> </h3> <div className="space-y-4"> {improvements.map((improvement, idx) => ( <div key={idx} className="flex items-start gap-3"> <div className="flex-shrink-0 w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-bold"> {idx + 1} </div> <div> <h4 className="font-semibold text-gray-900 mb-1"> {improvement.component} </h4> <p className="text-gray-700 text-sm"> {improvement.explanation} </p> </div> </div> ))} </div> </div> JavaScript JavaScriptโ€ข 43 lines const icdfQuestions = [ { id: 'instruction', type: 'textarea', label: 'What specific task should the AI perform?', placeholder: 'e.g., Analyze my website traffic and identify top-performing pages', required: true, tooltip: 'The clearer your instruction, the more precise the AI\'s response. Be specific about the action you want.' }, { id: 'context', type: 'textarea', label: 'What\'s the background or purpose?', placeholder: 'e.g., I\'m a wedding photographer trying to understand which blog posts drive the most inquiries', required: false, defaultValue: 'General analysis for decision-making purposes', tooltip: 'Context helps the AI understand WHY you need this analysis, leading to more relevant insights.' }, { id: 'data', type: 'textarea', label: 'What data or information should the AI work with?', placeholder: 'e.g., Traffic data from July-September including bounce rate, time-on-page, and conversions', required: false, defaultValue: 'Standard relevant data points', tooltip: 'Specify exactly what information the AI should analyze. The more specific, the better.' }, { id: 'format', type: 'multiple-choice', label: 'How should the output be structured?', options: [ { value: 'bullet-points', label: 'Bullet Points' }, { value: 'table', label: 'Table Format' }, { value: 'report', label: 'Detailed Report' }, { value: 'summary', label: 'Executive Summary' }, { value: 'custom', label: 'Custom...', hasTextField: true } ], required: false, defaultValue: 'Clear, organized summary with actionable insights', tooltip: 'Defining the output format ensures you get results in the exact structure you need.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 73 lines const rcreocQuestions = [ { id: 'role', type: 'multiple-choice', label: 'What expert role should the AI assume?', options: [ { value: 'senior-photographer', label: '๐Ÿ“ธ Senior Photographer' }, { value: 'art-director', label: '๐ŸŽจ Art Director' }, { value: 'marketing-expert', label: '๐Ÿ“ˆ Marketing Strategist' }, { value: 'business-consultant', label: '๐Ÿ’ผ Business Consultant' }, { value: 'technical-expert', label: 'โš™๏ธ Technical Specialist' }, { value: 'custom', label: 'Other Expert...', hasTextField: true } ], required: true, tooltip: 'Assigning a specific role makes the AI respond with the expertise and perspective of that professional.' }, { id: 'context', type: 'textarea', label: 'Describe the situation or environment', placeholder: 'e.g., We\'re reviewing a photographer\'s portfolio for a potential high-fashion campaign', required: false, defaultValue: 'Professional consulting environment', tooltip: 'Context sets the stakes and helps the AI understand the real-world implications.' }, { id: 'request', type: 'textarea', label: 'What specific task should this expert complete?', placeholder: 'e.g., Review the portfolio and identify technical issues, strengths, and provide recommendations', required: true, tooltip: 'This is the core deliverable you need from your virtual expert.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output you want', placeholder: 'e.g., If you see underexposed images, note this under "Issues" and recommend "use a light meter"', required: false, defaultValue: 'Professional industry-standard analysis', tooltip: 'Examples guide the AI\'s reasoning process and output style.' }, { id: 'output', type: 'multiple-choice', label: 'What format should the deliverable take?', options: [ { value: 'table', label: '๐Ÿ“Š Table' }, { value: 'list', label: '๐Ÿ“ Numbered List' }, { value: 'report', label: '๐Ÿ“„ Written Report' }, { value: 'scorecard', label: 'โญ Scorecard' }, { value: 'custom', label: 'Custom Format...', hasTextField: true } ], required: false, defaultValue: 'Structured professional assessment', tooltip: 'The output format determines how easy it is to use the AI\'s advice.' }, { id: 'constraints', type: 'multiple-choice', label: 'What tone and style should the expert use?', options: [ { value: 'professional-constructive', label: 'Professional & Constructive' }, { value: 'direct-actionable', label: 'Direct & Actionable' }, { value: 'encouraging-supportive', label: 'Encouraging & Supportive' }, { value: 'formal-academic', label: 'Formal & Academic' }, { value: 'custom', label: 'Custom Tone...', hasTextField: true } ], required: false, defaultValue: 'Professional and clear', tooltip: 'Tone constraints ensure the AI communicates in a way that matches your needs.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 74 lines const microQuestions = [ { id: 'message', type: 'textarea', label: 'What\'s the core message or main idea?', placeholder: 'e.g., Aperture controls both light and depth of fieldโ€”it\'s the most important camera setting to master first', required: true, tooltip: 'Your message is the "thesis"โ€”the one key takeaway your audience should remember.' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after consuming this?', placeholder: 'e.g., Feel confident and motivated to experiment with aperture settings on their own camera', required: false, defaultValue: 'Inform and engage the audience', tooltip: 'Intention drives the emotional arc and call-to-action of your content.' }, { id: 'context-audience', type: 'textarea', label: 'Who is your audience and where will they see this?', placeholder: 'e.g., Beginner photographers aged 25-40, watching on YouTube during their learning journey', required: false, defaultValue: 'General audience on standard platforms', tooltip: 'Knowing your audience helps the AI match the complexity and references to their level.' }, { id: 'rhythm', type: 'multiple-choice', label: 'What tone and pacing should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'conversational-friendly', label: '๐Ÿ’ฌ Conversational & Friendly' }, { value: 'professional-authoritative', label: '๐ŸŽ“ Professional & Authoritative' }, { value: 'calm-educational', label: '๐Ÿ“š Calm & Educational' }, { value: 'witty-entertaining', label: '๐Ÿ˜„ Witty & Entertaining' }, { value: 'custom', label: 'Custom Rhythm...', hasTextField: true } ], required: false, defaultValue: 'Engaging and clear', tooltip: 'Rhythm defines the "voice" and energy level of your content.' }, { id: 'output-type', type: 'multiple-choice', label: 'What type of content are you creating?', options: [ { value: 'youtube-script', label: '๐ŸŽฅ YouTube Script' }, { value: 'blog-post', label: '๐Ÿ“ Blog Post' }, { value: 'social-media', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: '๐Ÿ“ง Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'instagram-carousel', label: '๐Ÿ“ธ Instagram Carousel' }, { value: 'custom', label: 'Other Format...', hasTextField: true } ], required: true, tooltip: 'Each content type has specific structural requirements the AI will follow.' }, { id: 'length', type: 'multiple-choice', label: 'How long should this content be?', options: [ { value: 'short', label: '30 seconds - 1 minute' }, { value: 'medium', label: '3-5 minutes' }, { value: 'long', label: '10+ minutes' }, { value: 'word-count', label: 'Specific word count...', hasTextField: true } ], required: false, defaultValue: 'Appropriate length for the format', tooltip: 'Length constraints help the AI pace the content appropriately.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 60 lines const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What\'s the marketing situation or campaign?', placeholder: 'e.g., Launching a new Lightroom preset pack called "California Light"', required: true, tooltip: 'Context sets the stage for your marketing message.' }, { id: 'offer', type: 'textarea', label: 'What\'s the specific product, service, or deal?', placeholder: 'e.g., 25% off the preset pack for the first 3 days only', required: true, tooltip: 'Your offer is what you\'re sellingโ€”be crystal clear about value and urgency.' }, { id: 'style', type: 'multiple-choice', label: 'What tone and voice should the copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimal' }, { value: 'urgent-exciting', label: '๐Ÿ”ฅ Urgent & Exciting' }, { value: 'friendly-warm', label: '๐Ÿ˜Š Friendly & Warm' }, { value: 'professional-trustworthy', label: '๐Ÿค Professional & Trustworthy' }, { value: 'bold-confident', label: '๐Ÿ’ช Bold & Confident' }, { value: 'custom', label: 'Custom Style...', hasTextField: true } ], required: false, defaultValue: 'Professional and persuasive', tooltip: 'Style determines how your brand "sounds" to customers.' }, { id: 'target', type: 'textarea', label: 'Who is your ideal customer?', placeholder: 'e.g., 25-45 year old lifestyle and wedding photographers who want faster, more beautiful editing', required: false, defaultValue: 'Target customers interested in this offering', tooltip: 'The more specific your target audience, the more personalized and effective the copy.' }, { id: 'action', type: 'textarea', label: 'What\'s the ONE action you want them to take?', placeholder: 'e.g., Click "Buy Now" before the 3-day discount expires', required: true, tooltip: 'A clear, single call-to-action dramatically increases conversion rates.' }, { id: 'result', type: 'textarea', label: 'What\'s your business goal for this campaign?', placeholder: 'e.g., Generate 50 sales in the first 3 days and build momentum for future launches', required: false, defaultValue: 'Drive conversions and grow revenue', tooltip: 'Understanding the business goal helps craft copy that aligns with your strategy.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 65 lines // ICDF Template function assembleICDF(answers) { return `${answers.instruction} **Context:** ${answers.context} **Data to analyze:** ${answers.data} **Required output format:** ${answers.format} Please provide a ${answers.format} that directly addresses the instruction above, using the specified data and keeping the context in mind.`; } // RCREOC Template function assembleRCREOC(answers) { return `You are a ${answers.role}. **Context:** ${answers.context} **Your task:** ${answers.request} **Example of expected thinking:** ${answers.examples} **Required output format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as the assigned role, following the output format and constraints specified.`; } // MICRO Template function assembleMICRO(answers) { return `Create a ${answers.outputType} with the following specifications: **Core Message:** ${answers.message} **Intended audience impact:** ${answers.intention} **Target Audience & Platform:** ${answers.contextAudience} **Tone and Pacing:** ${answers.rhythm} **Length:** ${answers.length} The content should communicate the core message clearly while achieving the intended emotional impact and maintaining the specified tone throughout.`; } // COSTAR Template function assembleCOSTAR(answers) { return `Write marketing copy for the following campaign: **Campaign Context:** ${answers.context} **Offer/Product:** ${answers.offer} **Brand Voice & Style:** ${answers.style} **Target Customer:** ${answers.target} **Desired Action (CTA):** ${answers.action} **Business Goal:** ${answers.result} The copy should speak directly to the target customer, highlight the offer's value, maintain the brand voice, and drive the desired action while supporting the overall business goal.`; } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 83 lines // /app/prompt-generator/page.tsx import { FrameworkCard } from '@/components/prompt-generator/FrameworkCard'; export default function PromptGeneratorPage() { return ( <div className="container mx-auto px-4 py-12"> {/* Hero Section */} <div className="text-center mb-12"> <h1 className="text-4xl md:text-5xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> Transform your simple idea into a professional AI prompt in 60 seconds. No expertise required. </p> </div> {/* Framework Selection Cards */} <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto"> <FrameworkCard icon="๐Ÿ“Š" color="#3B82F6" title="Analyze Data" subtitle="Get precise analytical insights" framework="ICDF" examples={[ "Review website analytics", "Evaluate business metrics", "Assess survey results" ]} /> <FrameworkCard icon="๐ŸŽฏ" color="#8B5CF6" title="Get Expert Advice" subtitle="AI becomes your specialist" framework="RCREOC" examples={[ "Portfolio review", "Business consultation", "Technical guidance" ]} /> <FrameworkCard icon="โœ๏ธ" color="#10B981" title="Create Content" subtitle="Generate engaging content" framework="MICRO" examples={[ "YouTube scripts", "Blog posts", "Social media content" ]} /> <FrameworkCard icon="๐Ÿš€" color="#F59E0B" title="Write Marketing" subtitle="Craft persuasive copy" framework="COSTAR" examples={[ "Sales emails", "Ad campaigns", "Product descriptions" ]} /> </div> {/* Not Sure Option */} <div className="mt-8 text-center"> <p className="text-gray-600 mb-4">Not sure which one you need?</p> <button className="btn-secondary"> Describe Your Goal โ†’ </button> </div> </div> ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 52 lines // /components/prompt-generator/FrameworkCard.tsx interface FrameworkCardProps { icon: string; color: string; title: string; subtitle: string; framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; examples: string[]; } export function FrameworkCard({ icon, color, title, subtitle, framework, examples }: FrameworkCardProps) { return ( <div className="border-2 border-gray-200 rounded-lg p-6 hover:shadow-lg transition-all cursor-pointer group" onClick={() => window.location.href = `/prompt-generator/${framework.toLowerCase()}`} > {/* Icon */} <div className="text-5xl mb-4 transition-transform group-hover:scale-110" style={{ filter: `drop-shadow(0 0 8px ${color}40)` }} > {icon} </div> {/* Title */} <h3 className="text-xl font-bold mb-2">{title}</h3> <p className="text-gray-600 text-sm mb-4">{subtitle}</p> {/* Examples */} <div className="space-y-2"> <p className="text-xs font-semibold text-gray-500 uppercase">Examples:</p> {examples.map((example, idx) => ( <div key={idx} className="text-sm text-gray-700 flex items-start"> <span className="mr-2">โ€ข</span> <span>{example}</span> </div> ))} </div> {/* CTA */} <div className="mt-6 text-center py-2 rounded font-semibold text-white transition-colors" style={{ backgroundColor: color }} > Start โ†’ </div> </div> ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 173 lines // /components/prompt-generator/QuestionFlow.tsx 'use client'; import { useState } from 'react'; import { Tooltip } from '@/components/ui/Tooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; options?: Array<{ value: string; label: string; hasTextField?: boolean }>; required: boolean; defaultValue: string; tooltip: string; } interface QuestionFlowProps { questions: Question[]; framework: string; onComplete: (answers: Record<string, string>) => void; } export function QuestionFlow({ questions, framework, onComplete }: QuestionFlowProps) { const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const [customInputs, setCustomInputs] = useState<Record<string, string>>({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleNext = () => { // Apply smart default if skipped if (!answers[currentQuestion.id]) { setAnswers(prev => ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentStep < questions.length - 1) { setCurrentStep(prev => prev + 1); } else { // Final step - assemble prompt onComplete(answers); } }; const handlePrevious = () => { if (currentStep > 0) { setCurrentStep(prev => prev - 1); } }; return ( <div className="max-w-3xl mx-auto"> {/* Progress Bar */} <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 mb-2"> <span>Question {currentStep + 1} of {questions.length}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full bg-gray-200 rounded-full h-2"> <div className="bg-blue-600 h-2 rounded-full transition-all duration-300" style={{ width: `${progress}%` }} /> </div> </div> {/* Question Card */} <div className="bg-white border-2 border-gray-200 rounded-lg p-8"> {/* Question Label with Tooltip */} <div className="flex items-start justify-between mb-4"> <label className="text-lg font-semibold text-gray-900"> {currentQuestion.label} {currentQuestion.required && <span className="text-red-500 ml-1">*</span>} </label> <Tooltip content={currentQuestion.tooltip}> <button className="text-gray-400 hover:text-gray-600"> <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> <path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" /> </svg> </button> </Tooltip> </div> {/* Input Field */} {currentQuestion.type === 'textarea' ? ( <textarea className="w-full border-2 border-gray-300 rounded-lg p-4 focus:border-blue-500 focus:outline-none resize-none" rows={4} placeholder={currentQuestion.placeholder} value={answers[currentQuestion.id] || ''} onChange={(e) => setAnswers(prev => ({ ...prev, [currentQuestion.id]: e.target.value }))} /> ) : ( <div className="space-y-3"> {currentQuestion.options?.map((option) => ( <div key={option.value}> <button className={`w-full text-left p-4 border-2 rounded-lg transition-all ${ answers[currentQuestion.id] === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-300 hover:border-gray-400' }`} onClick={() => { setAnswers(prev => ({ ...prev, [currentQuestion.id]: option.value })); }} > {option.label} </button> {/* Custom text field for "Other" options */} {option.hasTextField && answers[currentQuestion.id] === option.value && ( <input type="text" className="w-full mt-2 border-2 border-gray-300 rounded-lg p-3 focus:border-blue-500 focus:outline-none" placeholder="Specify..." value={customInputs[currentQuestion.id] || ''} onChange={(e) => { setCustomInputs(prev => ({ ...prev, [currentQuestion.id]: e.target.value })); setAnswers(prev => ({ ...prev, [currentQuestion.id]: e.target.value })); }} /> )} </div> ))} </div> )} {/* Skip Notice */} {!currentQuestion.required && !answers[currentQuestion.id] && ( <p className="mt-3 text-sm text-gray-500 italic"> ๐Ÿ’ก You can skip this. We'll use: "{currentQuestion.defaultValue}" </p> )} </div> {/* Navigation Buttons */} <div className="flex justify-between mt-6"> <button onClick={handlePrevious} disabled={currentStep === 0} className="px-6 py-3 border-2 border-gray-300 rounded-lg font-semibold disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50" > โ† Previous </button> <button onClick={handleNext} className="px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700" > {currentStep === questions.length - 1 ? 'Generate Prompt โœจ' : 'Next โ†’'} </button> </div> </div> ); } This code can be executed in the preview sandbox Run Code Used 94 credits continue Used 0 credits javascript tooltip: 'This is the core task. Be specific about what deliverables you expect from the expert.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output style you want', placeholder: 'e.g., If you see underexposed images, note this under "Issues" and recommend "use a light meter"', required: false, defaultValue: 'Professional industry-standard analysis', tooltip: 'Examples guide the AI\'s reasoning process and output style. Even one example dramatically improves results.' }, { id: 'output', type: 'multiple-choice', label: 'What format should the expert deliver?', options: [ { value: 'table', label: '๐Ÿ“‹ Table/Spreadsheet' }, { value: 'numbered-list', label: '๐Ÿ”ข Numbered List' }, { value: 'report', label: '๐Ÿ“„ Formal Report' }, { value: 'action-plan', label: 'โœ… Action Plan' }, { value: 'custom', label: 'Custom Format...', hasTextField: true } ], required: false, defaultValue: 'Clear, professional summary', tooltip: 'Defining the deliverable format ensures you get organized, actionable results.' }, { id: 'constraints', type: 'multiple-choice', label: 'What constraints or rules should apply?', options: [ { value: 'concise', label: 'Keep it concise (under 3 sentences per point)' }, { value: 'detailed', label: 'Provide detailed explanations' }, { value: 'formal', label: 'Use formal, professional tone' }, { value: 'actionable', label: 'Focus on actionable recommendations only' }, { value: 'custom', label: 'Custom constraints...', hasTextField: true } ], required: false, defaultValue: 'Professional, constructive, and actionable', tooltip: 'Constraints ensure the expert stays focused and delivers exactly what you need.' } ]; MICRO Framework Questions javascript const microQuestions = [ { id: 'message', type: 'textarea', label: 'What\'s the core message or main idea?', placeholder: 'e.g., Aperture controls both light and depth of field in a simple, practical way', required: true, tooltip: 'Your message is the thesisโ€”the one key takeaway you want your audience to remember.' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after reading/watching?', placeholder: 'e.g., Feel confident that aperture is the most important camera setting to learn first', required: true, tooltip: 'Intention drives the emotional tone and call-to-action. Be specific about the desired outcome.' }, { id: 'audience', type: 'multiple-choice', label: 'Who is your target audience?', options: [ { value: 'beginners', label: '๐ŸŒฑ Complete Beginners' }, { value: 'intermediate', label: '๐Ÿ“š Intermediate Learners' }, { value: 'professionals', label: 'โญ Professionals' }, { value: 'general', label: '๐Ÿ‘ฅ General Public' }, { value: 'custom', label: 'Specific Audience...', hasTextField: true } ], required: false, defaultValue: 'General audience interested in the topic', tooltip: 'Knowing your audience shapes vocabulary, tone, and complexity level.' }, { id: 'platform', type: 'multiple-choice', label: 'Where will this content be published?', options: [ { value: 'youtube', label: '๐Ÿ“บ YouTube' }, { value: 'blog', label: '๐Ÿ“ Blog Post' }, { value: 'instagram', label: '๐Ÿ“ธ Instagram' }, { value: 'twitter', label: '๐Ÿฆ Twitter/X' }, { value: 'linkedin', label: '๐Ÿ’ผ LinkedIn' }, { value: 'email', label: '๐Ÿ“ง Email Newsletter' }, { value: 'custom', label: 'Other Platform...', hasTextField: true } ], required: false, defaultValue: 'General web content', tooltip: 'Platform dictates format constraints (character limits, visual elements, pacing).' }, { id: 'rhythm', type: 'multiple-choice', label: 'What tone and pacing should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'calm-educational', label: '๐ŸŽ“ Calm & Educational' }, { value: 'witty-entertaining', label: '๐Ÿ˜„ Witty & Entertaining' }, { value: 'professional-formal', label: '๐Ÿ‘” Professional & Formal' }, { value: 'conversational', label: '๐Ÿ’ฌ Conversational & Friendly' }, { value: 'custom', label: 'Custom Tone...', hasTextField: true } ], required: false, defaultValue: 'Clear, engaging, and accessible', tooltip: 'Rhythm and tone shape how your message is delivered and received.' }, { id: 'output-type', type: 'multiple-choice', label: 'What type of content are you creating?', options: [ { value: 'video-script', label: '๐ŸŽฌ Video Script' }, { value: 'blog-article', label: '๐Ÿ“„ Blog Article' }, { value: 'social-post', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: 'โœ‰๏ธ Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'custom', label: 'Other Format...', hasTextField: true } ], required: false, defaultValue: 'Written content piece', tooltip: 'Content type determines structure, length, and formatting requirements.' } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What\'s the marketing situation or campaign?', placeholder: 'e.g., Launching a new Lightroom preset pack for wedding photographers', required: true, tooltip: 'Context sets the stageโ€”what\'s happening that requires this marketing message?' }, { id: 'offer', type: 'textarea', label: 'What\'s the specific offer or product?', placeholder: 'e.g., "California Light" preset pack with 25% early-bird discount', required: true, tooltip: 'Be crystal clear about what you\'re selling and any special deals or incentives.' }, { id: 'style', type: 'multiple-choice', label: 'What tone and style should the copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimalist' }, { value: 'urgent-bold', label: '๐Ÿ”ฅ Urgent & Bold' }, { value: 'friendly-warm', label: '๐Ÿค— Friendly & Warm' }, { value: 'professional-corporate', label: '๐Ÿ’ผ Professional & Corporate' }, { value: 'playful-creative', label: '๐ŸŽจ Playful & Creative' }, { value: 'custom', label: 'Custom Style...', hasTextField: true } ], required: false, defaultValue: 'Professional and persuasive', tooltip: 'Style must align with your brand voice and resonate with your target audience.' }, { id: 'target', type: 'textarea', label: 'Who is your target customer? (demographics, psychographics)', placeholder: 'e.g., 25-45 year old wedding and lifestyle photographers who want faster editing workflows', required: true, tooltip: 'The more specific your target audience, the more personalized and effective your copy will be.' }, { id: 'action', type: 'multiple-choice', label: 'What\'s the primary call-to-action?', options: [ { value: 'buy-now', label: '๐Ÿ›’ Buy Now' }, { value: 'sign-up', label: 'โœ๏ธ Sign Up / Subscribe' }, { value: 'download', label: 'โฌ‡๏ธ Download' }, { value: 'learn-more', label: '๐Ÿ“– Learn More' }, { value: 'book-call', label: '๐Ÿ“ž Book a Call' }, { value: 'custom', label: 'Custom CTA...', hasTextField: true } ], required: true, tooltip: 'Every marketing message needs one clear action you want the reader to take.' }, { id: 'result', type: 'textarea', label: 'What\'s the ultimate business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build email list of potential customers', required: false, defaultValue: 'Increase conversions and revenue', tooltip: 'Knowing the business goal helps craft copy that\'s strategically aligned with your objectives.' } ]; 5. Prompt Assembly Logic Template Structure Each framework has a template that combines user answers into a professional prompt: javascript const promptTemplates = { ICDF: (answers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that addresses the instruction above, taking into account the context and working with the specified data. `.trim(), RCREOC: (answers) => ` **Your Role:** You are a ${answers.role}. **Context:** ${answers.context} **Your Task:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Required Output Format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as a ${answers.role} would, following the example thinking pattern and adhering to all constraints. `.trim(), MICRO: (answers) => ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Medium:** ${answers.platform} **Tone & Pacing:** ${answers.rhythm} **Content Type:** Create a ${answers['output-type']} Please write content that delivers the core message with the specified intention, tailored for the target audience, optimized for the platform, and matching the desired tone and pacing. `.trim(), COSTAR: (answers) => ` **Marketing Context:** ${answers.context} **The Offer:** ${answers.offer} **Brand Voice & Style:** ${answers.style} **Target Customer:** ${answers.target} **Call-to-Action:** ${answers.action} **Business Goal:** ${answers.result} Please write persuasive marketing copy that presents the offer to the target customer in the specified style, with a clear call-to-action that drives toward the business goal. `.trim() }; 6. Page Structure & Components 6.1 Landing Page (/prompt-generator) Components Needed: typescript // app/prompt-generator/page.tsx import QuickStartWizard from '@/components/prompt-generator/QuickStartWizard'; import HeroSection from '@/components/prompt-generator/HeroSection'; export default function PromptGeneratorPage() { return ( <div className="container mx-auto px-4 py-12"> <HeroSection /> <QuickStartWizard /> </div> ); } HeroSection Component: typescript // components/prompt-generator/HeroSection.tsx export default function HeroSection() { return ( <div className="text-center mb-12"> <h1 className="text-4xl md:text-5xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 dark:text-gray-400 mb-2"> Transform your simple AI ideas into professional prompts </p> <p className="text-gray-500 dark:text-gray-500"> Using proven frameworks: ICDF, RCREOC, MICRO, and COSTAR </p> </div> ); } QuickStartWizard Component: typescript // components/prompt-generator/QuickStartWizard.tsx 'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; const frameworks = [ { id: 'ICDF', icon: '๐Ÿ“Š', color: 'bg-blue-500', title: 'Analyze Data', subtitle: 'Get precise analytical insights', description: 'Perfect for reviewing data, reports, metrics, or analytics' }, { id: 'RCREOC', icon: '๐ŸŽฏ', color: 'bg-purple-500', title: 'Get Expert Advice', subtitle: 'AI becomes your specialist consultant', description: 'Get professional opinions, recommendations, or expert reviews' }, { id: 'MICRO', icon: 'โœ๏ธ', color: 'bg-green-500', title: 'Create Content', subtitle: 'Generate engaging written content', description: 'Write blog posts, scripts, articles, or social media content' }, { id: 'COSTAR', icon: '๐Ÿš€', color: 'bg-orange-500', title: 'Write Marketing Copy', subtitle: 'Craft persuasive sales messages', description: 'Create ads, emails, sales pages, or promotional content' } ]; export default function QuickStartWizard() { const router = useRouter(); const handleFrameworkSelect = (frameworkId: string) => { router.push(`/prompt-generator/build?framework=${frameworkId}`); }; return ( <div className="max-w-5xl mx-auto"> <h2 className="text-2xl font-semibold text-center mb-8"> What do you want to do? </h2> <div className="grid grid-cols-1 md:grid-cols-2 gap-6"> {frameworks.map((framework) => ( <button key={framework.id} onClick={() => handleFrameworkSelect(framework.id)} className="group p-6 border-2 border-gray-200 dark:border-gray-700 rounded-xl hover:border-gray-400 dark:hover:border-gray-500 transition-all text-left hover:shadow-lg" > <div className="flex items-start gap-4"> <div className={`text-4xl ${framework.color} bg-opacity-10 p-3 rounded-lg`}> {framework.icon} </div> <div className="flex-1"> <h3 className="text-xl font-semibold mb-1"> {framework.title} </h3> <p className="text-sm text-gray-600 dark:text-gray-400 mb-2"> {framework.subtitle} </p> <p className="text-sm text-gray-500 dark:text-gray-500"> {framework.description} </p> </div> <div className="text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"> โ†’ </div> </div> </button> ))} </div> <div className="mt-8 text-center"> <p className="text-gray-500 dark:text-gray-500 mb-4"> Not sure which to choose? </p> <button onClick={() => router.push('/prompt-generator/build')} className="text-blue-600 dark:text-blue-400 hover:underline" > Describe your goal and we'll suggest the best framework โ†’ </button> </div> </div> ); } 6.2 Build Page (/prompt-generator/build) This is where the magic happensโ€”the adaptive questionnaire. typescript // app/prompt-generator/build/page.tsx 'use client'; import { useState, useEffect } from 'react'; import { useSearchParams } from 'next/navigation'; import PromptBuilder from '@/components/prompt-generator/PromptBuilder'; import FrameworkDetector from '@/components/prompt-generator/FrameworkDetector'; export default function BuildPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams.get('framework'); const [framework, setFramework] = useState<string | null>(preselectedFramework); const [initialPrompt, setInitialPrompt] = useState(''); if (!framework) { return ( <FrameworkDetector onFrameworkDetected={(fw, prompt) => { setFramework(fw); setInitialPrompt(prompt); }} /> ); } return ( <PromptBuilder framework={framework} initialPrompt={initialPrompt} /> ); } FrameworkDetector Component: typescript // components/prompt-generator/FrameworkDetector.tsx 'use client'; import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/framework-detection'; interface Props { onFrameworkDetected: (framework: string, prompt: string) => void; } export default function FrameworkDetector({ onFrameworkDetected }: Props) { const [userInput, setUserInput] = useState(''); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const detected = detectFramework(userInput); onFrameworkDetected(detected, userInput); }; return ( <div className="container mx-auto px-4 py-12 max-w-3xl"> <div className="text-center mb-8"> <h1 className="text-3xl font-bold mb-4"> Describe what you need </h1> <p className="text-gray-600 dark:text-gray-400"> Tell us in your own words, and we'll guide you to create the perfect prompt </p> </div> <form onSubmit={handleSubmit} className="space-y-4"> <textarea value={userInput} onChange={(e) => setUserInput(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are most popular..." className="w-full h-40 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none" autoFocus /> <button type="submit" disabled={!userInput.trim()} className="w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors" > Continue โ†’ </button> </form> <div className="mt-8 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg"> <p className="text-sm text-blue-800 dark:text-blue-200"> <strong>๐Ÿ’ก Tip:</strong> Just describe your goal naturally. We'll automatically detect whether you need to analyze data, get expert advice, create content, or write marketing copy. </p> </div> </div> ); } PromptBuilder Component (Main Interactive Form): typescript // components/prompt-generator/PromptBuilder.tsx 'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { getQuestionSet } from '@/lib/prompt-generator/questions'; import QuestionCard from './QuestionCard'; import ProgressBar from './ProgressBar'; interface Props { framework: string; initialPrompt?: string; } export default function PromptBuilder({ framework, initialPrompt }: Props) { const router = useRouter(); const questions = getQuestionSet(framework); const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) => { setAnswers(prev => ({ ...prev, [questionId]: value })); }; const handleNext = () => { if (currentStep < questions.length - 1) { setCurrentStep(prev => prev + 1); } else { // All questions answered - go to results const queryParams = new URLSearchParams({ framework, original: initialPrompt || '', ...answers }); router.push(`/prompt-generator/result?${queryParams.toString()}`); } }; const handleBack = () => { if (currentStep > 0) { setCurrentStep(prev => prev - 1); } }; const canProceed = currentQuestion.required ? !!answers[currentQuestion.id] : true; return ( <div className="container mx-auto px-4 py-12 max-w-3xl"> <ProgressBar progress={progress} currentStep={currentStep + 1} totalSteps={questions.length} /> <div className="mb-8"> <div className="inline-block px-3 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 rounded-full text-sm font-medium mb-4"> {framework} Framework </div> </div> <QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || ''} onChange={(value) => handleAnswer(currentQuestion.id, value)} /> <div className="flex gap-4 mt-8"> {currentStep > 0 && ( <button onClick={handleBack} className="px-6 py-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg font-semibold hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors" > โ† Back </button> )} <button onClick={handleNext} disabled={!canProceed} className="flex-1 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors" > {currentStep < questions.length - 1 ? 'Next โ†’' : 'Generate Prompt โœจ'} </button> </div> {!currentQuestion.required && !answers[currentQuestion.id] && ( <p className="text-sm text-gray-500 dark:text-gray-400 mt-4 text-center"> This question is optional. We'll use a smart default if you skip it. </p> )} </div> ); } QuestionCard Component: typescript // components/prompt-generator/QuestionCard.tsx 'use client'; import { useState } from 'react'; import type { Question } from '@/lib/prompt-generator/types'; interface Props { question: Question; value: string; onChange: (value: string) => void; } export default function QuestionCard({ question, value, onChange }: Props) { const [showTooltip, setShowTooltip] = useState(false); return ( <div className="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700"> <div className="flex items-start justify-between mb-4"> <h2 className="text-xl font-semibold flex-1"> {question.label} {question.required && <span className="text-red-500 ml-1">*</span>} </h2> <button onMouseEnter={() => setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)} className="text-blue-500 hover:text-blue-600 ml-2" aria-label="Help" > <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> <path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" /> </svg> </button> </div> {showTooltip && ( <div className="mb-4 p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg text-sm text-blue-800 dark:text-blue-200"> ๐Ÿ’ก {question.tooltip} </div> )} {question.type === 'textarea' && ( <textarea value={value} onChange={(e) => onChange(e.target.value)} placeholder={question.placeholder} className="w-full h-32 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none" /> )} {question.type === 'multiple-choice' && ( <div className="space-y-2"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => onChange(option.value)} className={`w-full p-4 text-left rounded-lg border-2 transition-all ${ value === option.value ? 'border-blue-500 bg-blue-50 dark:bg-blue-900/20' : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600' }`} > <div className="flex items-center gap-3"> <div className={`w-5 h-5 rounded-full border-2 flex items-center justify-center ${ value === option.value ? 'border-blue-500 bg-blue-500' : 'border-gray-300 dark:border-gray-600' }`}> {value === option.value && ( <div className="w-2 h-2 bg-white rounded-full" /> )} </div> <span className="font-medium">{option.label}</span> </div> </button> {option.hasTextField && value === option.value && ( <input type="text" placeholder="Specify..." className="w-full mt-2 p-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 outline-none" onChange={(e) => onChange(`custom:${e.target.value}`)} /> )} </div> ))} </div> )} </div> ); } ProgressBar Component: typescript // components/prompt-generator/ProgressBar.tsx interface Props { progress: number; currentStep: number; totalSteps: number; } export default function ProgressBar({ progress, currentStep, totalSteps }: Props) { return ( <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-2"> <span>Step {currentStep} of {totalSteps}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"> <div className="h-full bg-blue-600 transition-all duration-300 ease-out" style={{ width: `${progress}%` }} /> </div> </div> ); } 6.3 Result Page (/prompt-generator/result) Before/After Comparison with Copy & Learning Mode typescript // app/prompt-generator/result/page.tsx 'use client'; import { useSearchParams } from 'next/navigation'; import { useState } from 'react'; import { assemblePrompt } from '@/lib/prompt-generator/prompt-assembly'; import { trackPromptGeneration } from '@/lib/analytics'; export default function ResultPage() { const searchParams = useSearchParams(); const framework = searchParams.get('framework') || ''; const originalPrompt = searchParams.get('original') || ''; // Extract all answers from query params const answers: Record<string, string> = {}; searchParams.forEach((value, key) => { if (key !== 'framework' && key !== 'original') { answers[key] = value; } }); const professionalPrompt = assemblePrompt(framework, answers); const [copied, setCopied] = useState(false); const [showLearning, setShowLearning] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(professionalPrompt); setCopied(true); setTimeout(() => setCopied(false), 2000); // Track analytics trackPromptGeneration(framework); }; return ( <div className="container mx-auto px-4 py-12 max-w-6xl"> <div className="text-center mb-8"> <div className="inline-block px-4 py-2 bg-green-100 dark:bg-green-900/30 JavaScript JavaScriptโ€ข 42 lines tooltip: 'This is the core task. Be specific about what deliverables you expect from the expert.' }, { id: 'examples', type: 'textarea', label: 'Provide an example of the thinking or output style you want', placeholder: 'e.g., If you see underexposed images, note this under "Issues" and recommend "use a light meter"', required: false, defaultValue: 'Professional industry-standard analysis', tooltip: 'Examples guide the AI\'s reasoning process and output style. Even one example dramatically improves results.' }, { id: 'output', type: 'multiple-choice', label: 'What format should the expert deliver?', options: [ { value: 'table', label: '๐Ÿ“‹ Table/Spreadsheet' }, { value: 'numbered-list', label: '๐Ÿ”ข Numbered List' }, { value: 'report', label: '๐Ÿ“„ Formal Report' }, { value: 'action-plan', label: 'โœ… Action Plan' }, { value: 'custom', label: 'Custom Format...', hasTextField: true } ], required: false, defaultValue: 'Clear, professional summary', tooltip: 'Defining the deliverable format ensures you get organized, actionable results.' }, { id: 'constraints', type: 'multiple-choice', label: 'What constraints or rules should apply?', options: [ { value: 'concise', label: 'Keep it concise (under 3 sentences per point)' }, { value: 'detailed', label: 'Provide detailed explanations' }, { value: 'formal', label: 'Use formal, professional tone' }, { value: 'actionable', label: 'Focus on actionable recommendations only' }, { value: 'custom', label: 'Custom constraints...', hasTextField: true } ], required: false, defaultValue: 'Professional, constructive, and actionable', tooltip: 'Constraints ensure the expert stays focused and delivers exactly what you need.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 82 lines const microQuestions = [ { id: 'message', type: 'textarea', label: 'What\'s the core message or main idea?', placeholder: 'e.g., Aperture controls both light and depth of field in a simple, practical way', required: true, tooltip: 'Your message is the thesisโ€”the one key takeaway you want your audience to remember.' }, { id: 'intention', type: 'textarea', label: 'What should the audience feel or do after reading/watching?', placeholder: 'e.g., Feel confident that aperture is the most important camera setting to learn first', required: true, tooltip: 'Intention drives the emotional tone and call-to-action. Be specific about the desired outcome.' }, { id: 'audience', type: 'multiple-choice', label: 'Who is your target audience?', options: [ { value: 'beginners', label: '๐ŸŒฑ Complete Beginners' }, { value: 'intermediate', label: '๐Ÿ“š Intermediate Learners' }, { value: 'professionals', label: 'โญ Professionals' }, { value: 'general', label: '๐Ÿ‘ฅ General Public' }, { value: 'custom', label: 'Specific Audience...', hasTextField: true } ], required: false, defaultValue: 'General audience interested in the topic', tooltip: 'Knowing your audience shapes vocabulary, tone, and complexity level.' }, { id: 'platform', type: 'multiple-choice', label: 'Where will this content be published?', options: [ { value: 'youtube', label: '๐Ÿ“บ YouTube' }, { value: 'blog', label: '๐Ÿ“ Blog Post' }, { value: 'instagram', label: '๐Ÿ“ธ Instagram' }, { value: 'twitter', label: '๐Ÿฆ Twitter/X' }, { value: 'linkedin', label: '๐Ÿ’ผ LinkedIn' }, { value: 'email', label: '๐Ÿ“ง Email Newsletter' }, { value: 'custom', label: 'Other Platform...', hasTextField: true } ], required: false, defaultValue: 'General web content', tooltip: 'Platform dictates format constraints (character limits, visual elements, pacing).' }, { id: 'rhythm', type: 'multiple-choice', label: 'What tone and pacing should the content have?', options: [ { value: 'fast-exciting', label: 'โšก Fast-paced & Exciting' }, { value: 'calm-educational', label: '๐ŸŽ“ Calm & Educational' }, { value: 'witty-entertaining', label: '๐Ÿ˜„ Witty & Entertaining' }, { value: 'professional-formal', label: '๐Ÿ‘” Professional & Formal' }, { value: 'conversational', label: '๐Ÿ’ฌ Conversational & Friendly' }, { value: 'custom', label: 'Custom Tone...', hasTextField: true } ], required: false, defaultValue: 'Clear, engaging, and accessible', tooltip: 'Rhythm and tone shape how your message is delivered and received.' }, { id: 'output-type', type: 'multiple-choice', label: 'What type of content are you creating?', options: [ { value: 'video-script', label: '๐ŸŽฌ Video Script' }, { value: 'blog-article', label: '๐Ÿ“„ Blog Article' }, { value: 'social-post', label: '๐Ÿ“ฑ Social Media Post' }, { value: 'email-newsletter', label: 'โœ‰๏ธ Email Newsletter' }, { value: 'podcast-script', label: '๐ŸŽ™๏ธ Podcast Script' }, { value: 'custom', label: 'Other Format...', hasTextField: true } ], required: false, defaultValue: 'Written content piece', tooltip: 'Content type determines structure, length, and formatting requirements.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 66 lines const costarQuestions = [ { id: 'context', type: 'textarea', label: 'What\'s the marketing situation or campaign?', placeholder: 'e.g., Launching a new Lightroom preset pack for wedding photographers', required: true, tooltip: 'Context sets the stageโ€”what\'s happening that requires this marketing message?' }, { id: 'offer', type: 'textarea', label: 'What\'s the specific offer or product?', placeholder: 'e.g., "California Light" preset pack with 25% early-bird discount', required: true, tooltip: 'Be crystal clear about what you\'re selling and any special deals or incentives.' }, { id: 'style', type: 'multiple-choice', label: 'What tone and style should the copy have?', options: [ { value: 'elegant-minimal', label: 'โœจ Elegant & Minimalist' }, { value: 'urgent-bold', label: '๐Ÿ”ฅ Urgent & Bold' }, { value: 'friendly-warm', label: '๐Ÿค— Friendly & Warm' }, { value: 'professional-corporate', label: '๐Ÿ’ผ Professional & Corporate' }, { value: 'playful-creative', label: '๐ŸŽจ Playful & Creative' }, { value: 'custom', label: 'Custom Style...', hasTextField: true } ], required: false, defaultValue: 'Professional and persuasive', tooltip: 'Style must align with your brand voice and resonate with your target audience.' }, { id: 'target', type: 'textarea', label: 'Who is your target customer? (demographics, psychographics)', placeholder: 'e.g., 25-45 year old wedding and lifestyle photographers who want faster editing workflows', required: true, tooltip: 'The more specific your target audience, the more personalized and effective your copy will be.' }, { id: 'action', type: 'multiple-choice', label: 'What\'s the primary call-to-action?', options: [ { value: 'buy-now', label: '๐Ÿ›’ Buy Now' }, { value: 'sign-up', label: 'โœ๏ธ Sign Up / Subscribe' }, { value: 'download', label: 'โฌ‡๏ธ Download' }, { value: 'learn-more', label: '๐Ÿ“– Learn More' }, { value: 'book-call', label: '๐Ÿ“ž Book a Call' }, { value: 'custom', label: 'Custom CTA...', hasTextField: true } ], required: true, tooltip: 'Every marketing message needs one clear action you want the reader to take.' }, { id: 'result', type: 'textarea', label: 'What\'s the ultimate business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build email list of potential customers', required: false, defaultValue: 'Increase conversions and revenue', tooltip: 'Knowing the business goal helps craft copy that\'s strategically aligned with your objectives.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 61 lines const promptTemplates = { ICDF: (answers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that addresses the instruction above, taking into account the context and working with the specified data. `.trim(), RCREOC: (answers) => ` **Your Role:** You are a ${answers.role}. **Context:** ${answers.context} **Your Task:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Required Output Format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as a ${answers.role} would, following the example thinking pattern and adhering to all constraints. `.trim(), MICRO: (answers) => ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Medium:** ${answers.platform} **Tone & Pacing:** ${answers.rhythm} **Content Type:** Create a ${answers['output-type']} Please write content that delivers the core message with the specified intention, tailored for the target audience, optimized for the platform, and matching the desired tone and pacing. `.trim(), COSTAR: (answers) => ` **Marketing Context:** ${answers.context} **The Offer:** ${answers.offer} **Brand Voice & Style:** ${answers.style} **Target Customer:** ${answers.target} **Call-to-Action:** ${answers.action} **Business Goal:** ${answers.result} Please write persuasive marketing copy that presents the offer to the target customer in the specified style, with a clear call-to-action that drives toward the business goal. `.trim() }; This code can be executed in the preview sandbox Run Code TypeScript TypeScriptโ€ข 13 lines // app/prompt-generator/page.tsx import QuickStartWizard from '@/components/prompt-generator/QuickStartWizard'; import HeroSection from '@/components/prompt-generator/HeroSection'; export default function PromptGeneratorPage() { return ( <div className="container mx-auto px-4 py-12"> <HeroSection /> <QuickStartWizard /> </div> ); } TypeScript TypeScriptโ€ข 17 lines // components/prompt-generator/HeroSection.tsx export default function HeroSection() { return ( <div className="text-center mb-12"> <h1 className="text-4xl md:text-5xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 dark:text-gray-400 mb-2"> Transform your simple AI ideas into professional prompts </p> <p className="text-gray-500 dark:text-gray-500"> Using proven frameworks: ICDF, RCREOC, MICRO, and COSTAR </p> </div> ); } TypeScript TypeScriptโ€ข 99 lines // components/prompt-generator/QuickStartWizard.tsx 'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; const frameworks = [ { id: 'ICDF', icon: '๐Ÿ“Š', color: 'bg-blue-500', title: 'Analyze Data', subtitle: 'Get precise analytical insights', description: 'Perfect for reviewing data, reports, metrics, or analytics' }, { id: 'RCREOC', icon: '๐ŸŽฏ', color: 'bg-purple-500', title: 'Get Expert Advice', subtitle: 'AI becomes your specialist consultant', description: 'Get professional opinions, recommendations, or expert reviews' }, { id: 'MICRO', icon: 'โœ๏ธ', color: 'bg-green-500', title: 'Create Content', subtitle: 'Generate engaging written content', description: 'Write blog posts, scripts, articles, or social media content' }, { id: 'COSTAR', icon: '๐Ÿš€', color: 'bg-orange-500', title: 'Write Marketing Copy', subtitle: 'Craft persuasive sales messages', description: 'Create ads, emails, sales pages, or promotional content' } ]; export default function QuickStartWizard() { const router = useRouter(); const handleFrameworkSelect = (frameworkId: string) => { router.push(`/prompt-generator/build?framework=${frameworkId}`); }; return ( <div className="max-w-5xl mx-auto"> <h2 className="text-2xl font-semibold text-center mb-8"> What do you want to do? </h2> <div className="grid grid-cols-1 md:grid-cols-2 gap-6"> {frameworks.map((framework) => ( <button key={framework.id} onClick={() => handleFrameworkSelect(framework.id)} className="group p-6 border-2 border-gray-200 dark:border-gray-700 rounded-xl hover:border-gray-400 dark:hover:border-gray-500 transition-all text-left hover:shadow-lg" > <div className="flex items-start gap-4"> <div className={`text-4xl ${framework.color} bg-opacity-10 p-3 rounded-lg`}> {framework.icon} </div> <div className="flex-1"> <h3 className="text-xl font-semibold mb-1"> {framework.title} </h3> <p className="text-sm text-gray-600 dark:text-gray-400 mb-2"> {framework.subtitle} </p> <p className="text-sm text-gray-500 dark:text-gray-500"> {framework.description} </p> </div> <div className="text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"> โ†’ </div> </div> </button> ))} </div> <div className="mt-8 text-center"> <p className="text-gray-500 dark:text-gray-500 mb-4"> Not sure which to choose? </p> <button onClick={() => router.push('/prompt-generator/build')} className="text-blue-600 dark:text-blue-400 hover:underline" > Describe your goal and we'll suggest the best framework โ†’ </button> </div> </div> ); } TypeScript TypeScriptโ€ข 34 lines // app/prompt-generator/build/page.tsx 'use client'; import { useState, useEffect } from 'react'; import { useSearchParams } from 'next/navigation'; import PromptBuilder from '@/components/prompt-generator/PromptBuilder'; import FrameworkDetector from '@/components/prompt-generator/FrameworkDetector'; export default function BuildPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams.get('framework'); const [framework, setFramework] = useState<string | null>(preselectedFramework); const [initialPrompt, setInitialPrompt] = useState(''); if (!framework) { return ( <FrameworkDetector onFrameworkDetected={(fw, prompt) => { setFramework(fw); setInitialPrompt(prompt); }} /> ); } return ( <PromptBuilder framework={framework} initialPrompt={initialPrompt} /> ); } TypeScript TypeScriptโ€ข 57 lines // components/prompt-generator/FrameworkDetector.tsx 'use client'; import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/framework-detection'; interface Props { onFrameworkDetected: (framework: string, prompt: string) => void; } export default function FrameworkDetector({ onFrameworkDetected }: Props) { const [userInput, setUserInput] = useState(''); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const detected = detectFramework(userInput); onFrameworkDetected(detected, userInput); }; return ( <div className="container mx-auto px-4 py-12 max-w-3xl"> <div className="text-center mb-8"> <h1 className="text-3xl font-bold mb-4"> Describe what you need </h1> <p className="text-gray-600 dark:text-gray-400"> Tell us in your own words, and we'll guide you to create the perfect prompt </p> </div> <form onSubmit={handleSubmit} className="space-y-4"> <textarea value={userInput} onChange={(e) => setUserInput(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are most popular..." className="w-full h-40 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none" autoFocus /> <button type="submit" disabled={!userInput.trim()} className="w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors" > Continue โ†’ </button> </form> <div className="mt-8 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg"> <p className="text-sm text-blue-800 dark:text-blue-200"> <strong>๐Ÿ’ก Tip:</strong> Just describe your goal naturally. We'll automatically detect whether you need to analyze data, get expert advice, create content, or write marketing copy. </p> </div> </div> ); } TypeScript TypeScriptโ€ข 96 lines // components/prompt-generator/PromptBuilder.tsx 'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { getQuestionSet } from '@/lib/prompt-generator/questions'; import QuestionCard from './QuestionCard'; import ProgressBar from './ProgressBar'; interface Props { framework: string; initialPrompt?: string; } export default function PromptBuilder({ framework, initialPrompt }: Props) { const router = useRouter(); const questions = getQuestionSet(framework); const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) => { setAnswers(prev => ({ ...prev, [questionId]: value })); }; const handleNext = () => { if (currentStep < questions.length - 1) { setCurrentStep(prev => prev + 1); } else { // All questions answered - go to results const queryParams = new URLSearchParams({ framework, original: initialPrompt || '', ...answers }); router.push(`/prompt-generator/result?${queryParams.toString()}`); } }; const handleBack = () => { if (currentStep > 0) { setCurrentStep(prev => prev - 1); } }; const canProceed = currentQuestion.required ? !!answers[currentQuestion.id] : true; return ( <div className="container mx-auto px-4 py-12 max-w-3xl"> <ProgressBar progress={progress} currentStep={currentStep + 1} totalSteps={questions.length} /> <div className="mb-8"> <div className="inline-block px-3 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 rounded-full text-sm font-medium mb-4"> {framework} Framework </div> </div> <QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || ''} onChange={(value) => handleAnswer(currentQuestion.id, value)} /> <div className="flex gap-4 mt-8"> {currentStep > 0 && ( <button onClick={handleBack} className="px-6 py-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg font-semibold hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors" > โ† Back </button> )} <button onClick={handleNext} disabled={!canProceed} className="flex-1 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors" > {currentStep < questions.length - 1 ? 'Next โ†’' : 'Generate Prompt โœจ'} </button> </div> {!currentQuestion.required && !answers[currentQuestion.id] && ( <p className="text-sm text-gray-500 dark:text-gray-400 mt-4 text-center"> This question is optional. We'll use a smart default if you skip it. </p> )} </div> ); } TypeScript TypeScriptโ€ข 92 lines // components/prompt-generator/QuestionCard.tsx 'use client'; import { useState } from 'react'; import type { Question } from '@/lib/prompt-generator/types'; interface Props { question: Question; value: string; onChange: (value: string) => void; } export default function QuestionCard({ question, value, onChange }: Props) { const [showTooltip, setShowTooltip] = useState(false); return ( <div className="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700"> <div className="flex items-start justify-between mb-4"> <h2 className="text-xl font-semibold flex-1"> {question.label} {question.required && <span className="text-red-500 ml-1">*</span>} </h2> <button onMouseEnter={() => setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)} className="text-blue-500 hover:text-blue-600 ml-2" aria-label="Help" > <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> <path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" /> </svg> </button> </div> {showTooltip && ( <div className="mb-4 p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg text-sm text-blue-800 dark:text-blue-200"> ๐Ÿ’ก {question.tooltip} </div> )} {question.type === 'textarea' && ( <textarea value={value} onChange={(e) => onChange(e.target.value)} placeholder={question.placeholder} className="w-full h-32 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none" /> )} {question.type === 'multiple-choice' && ( <div className="space-y-2"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => onChange(option.value)} className={`w-full p-4 text-left rounded-lg border-2 transition-all ${ value === option.value ? 'border-blue-500 bg-blue-50 dark:bg-blue-900/20' : 'border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600' }`} > <div className="flex items-center gap-3"> <div className={`w-5 h-5 rounded-full border-2 flex items-center justify-center ${ value === option.value ? 'border-blue-500 bg-blue-500' : 'border-gray-300 dark:border-gray-600' }`}> {value === option.value && ( <div className="w-2 h-2 bg-white rounded-full" /> )} </div> <span className="font-medium">{option.label}</span> </div> </button> {option.hasTextField && value === option.value && ( <input type="text" placeholder="Specify..." className="w-full mt-2 p-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 outline-none" onChange={(e) => onChange(`custom:${e.target.value}`)} /> )} </div> ))} </div> )} </div> ); } TypeScript TypeScriptโ€ข 24 lines // components/prompt-generator/ProgressBar.tsx interface Props { progress: number; currentStep: number; totalSteps: number; } export default function ProgressBar({ progress, currentStep, totalSteps }: Props) { return ( <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-2"> <span>Step {currentStep} of {totalSteps}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"> <div className="h-full bg-blue-600 transition-all duration-300 ease-out" style={{ width: `${progress}%` }} /> </div> </div> ); } Used 98 credits continue Used 0 credits javascript label: 'Who is your target audience?', placeholder: 'e.g., 25-45 year old wedding and lifestyle photographers who want to speed up their editing workflow', required: true, tooltip: 'The more specific your audience definition, the more targeted and effective your copy will be.' }, { id: 'action', type: 'textarea', label: 'What specific action do you want them to take?', placeholder: 'e.g., Click "Buy Now" before the 3-day discount expires', required: true, tooltip: 'Every marketing message needs ONE clear call-to-action. What\'s the next step?' }, { id: 'result', type: 'textarea', label: 'What\'s the ultimate business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build customer base for future products', required: false, defaultValue: 'Generate conversions and revenue', tooltip: 'Understanding the business objective helps craft copy that aligns with your strategy.' }, { id: 'urgency', type: 'multiple-choice', label: 'Is there a time-sensitive element?', options: [ { value: 'limited-time', label: 'โฐ Limited Time Offer' }, { value: 'limited-quantity', label: '๐Ÿ“ฆ Limited Quantity' }, { value: 'early-bird', label: '๐Ÿฆ Early Bird Special' }, { value: 'seasonal', label: '๐ŸŽ„ Seasonal/Event-Based' }, { value: 'none', label: 'No Urgency' }, { value: 'custom', label: 'Custom Urgency...', hasTextField: true } ], required: false, defaultValue: 'Standard marketing timeframe', tooltip: 'Urgency drives immediate action. Use it authentically to boost conversions.' } ]; 5. Prompt Assembly Logic Template Structure javascript const promptTemplates = { ICDF: (answers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that is clear, actionable, and directly addresses the instruction within the given context. `.trim(), RCREOC: (answers) => ` **Role:** You are a ${answers.role}. **Context:** ${answers.context} **Request:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Output Format:** Deliver your analysis as ${answers.output}. **Constraints:** ${answers.constraints} Provide professional, expert-level guidance that is constructive and actionable. `.trim(), MICRO: (answers) => ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Context:** This content will be published on ${answers.platform} **Tone & Rhythm:** ${answers.rhythm} **Content Type:** Create a ${answers['output-type']} Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.style} **Target Audience:** ${answers.target} **Desired Action:** The reader should ${answers.action} **Business Result:** The ultimate goal is to ${answers.result} **Urgency Element:** ${answers.urgency} Write persuasive copy that speaks directly to the target audience, clearly presents the offer, and motivates immediate action while maintaining the specified style. `.trim() }; 6. Database Schema Analytics Tracking (No User Data) prisma model PromptGeneration { id String @id @default(cuid()) createdAt DateTime @default(now()) // Framework used framework String // 'ICDF', 'RCREOC', 'MICRO', 'COSTAR' // User journey tracking initialPromptLength Int // Character count of original input questionsAnswered Int // How many questions user answered questionsSkipped Int // How many used smart defaults timeToComplete Int // Seconds from start to finish // Outcome completed Boolean @default(false) copiedToClipboard Boolean @default(false) // Anonymous session (for rate limiting) sessionHash String // Hashed IP + User Agent @@index([framework, createdAt]) @@index([sessionHash, createdAt]) } model FrameworkUsage { id String @id @default(cuid()) date DateTime @default(now()) framework String count Int @default(1) @@unique([date, framework]) @@index([date]) } 7. File Structure src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”œโ”€โ”€ InitialPromptInput.tsx # First text input โ”‚ โ”œโ”€โ”€ AdaptiveQuestionnaire.tsx # Dynamic question renderer โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover/click tooltip โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ””โ”€โ”€ SuccessActions.tsx # Copy button + restart โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword matching logic โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”œโ”€โ”€ smartDefaults.ts # Default values โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ track/ โ”‚ โ””โ”€โ”€ route.ts # POST - Log analytics โ””โ”€โ”€ rate-limit/ โ””โ”€โ”€ route.ts # GET - Check usage limits 8. Component Specifications 8.1 QuickStartWizard.tsx typescript 'use client'; import { useState } from 'react'; import { frameworkDetection } from '@/lib/prompt-generator/frameworkDetection'; interface QuickStartWizardProps { onFrameworkSelect: (framework: string) => void; } export default function QuickStartWizard({ onFrameworkSelect }: QuickStartWizardProps) { return ( <div className="max-w-6xl mx-auto px-4 py-12"> <div className="text-center mb-12"> <h1 className="text-4xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600"> Transform your simple idea into a professional AI prompt in 60 seconds </p> </div> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> {Object.entries(frameworkDetection).map(([key, framework]) => ( <button key={key} onClick={() => onFrameworkSelect(key)} className="group relative p-8 bg-white rounded-2xl border-2 border-gray-200 hover:border-current hover:shadow-xl transition-all duration-300" style={{ '--hover-color': framework.color, color: 'inherit' } as React.CSSProperties} > {/* Icon */} <div className="text-6xl mb-4 transition-transform group-hover:scale-110" style={{ color: framework.color }} > {framework.icon} </div> {/* Title */} <h3 className="text-xl font-bold mb-2"> {framework.title} </h3> {/* Subtitle */} <p className="text-gray-600 text-sm"> {framework.subtitle} </p> {/* Hover indicator */} <div className="absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transition-opacity"> <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </button> ))} </div> {/* Example prompts section */} <div className="mt-16 text-center"> <p className="text-gray-500 text-sm mb-4"> Popular examples: </p> <div className="flex flex-wrap justify-center gap-3"> {[ { text: 'Analyze my website traffic', framework: 'ICDF' }, { text: 'Review my photography portfolio', framework: 'RCREOC' }, { text: 'Write a YouTube script about lighting', framework: 'MICRO' }, { text: 'Create a sales email for presets', framework: 'COSTAR' } ].map((example, idx) => ( <button key={idx} onClick={() => onFrameworkSelect(example.framework)} className="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition-colors" > "{example.text}" </button> ))} </div> </div> </div> ); } 8.2 InitialPromptInput.tsx typescript 'use client'; import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/frameworkDetection'; interface InitialPromptInputProps { selectedFramework: string; onSubmit: (prompt: string, detectedFramework: string) => void; onBack: () => void; } export default function InitialPromptInput({ selectedFramework, onSubmit, onBack }: InitialPromptInputProps) { const [prompt, setPrompt] = useState(''); const [isAnalyzing, setIsAnalyzing] = useState(false); const handleSubmit = () => { if (!prompt.trim()) return; setIsAnalyzing(true); // Simulate brief analysis delay for UX setTimeout(() => { const detected = detectFramework(prompt); onSubmit(prompt, detected); }, 500); }; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Back button */} <button onClick={onBack} className="flex items-center text-gray-600 hover:text-gray-900 mb-8" > <svg className="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> Back to framework selection </button> {/* Header */} <div className="text-center mb-8"> <h2 className="text-3xl font-bold mb-3"> Describe what you need </h2> <p className="text-gray-600"> Write your idea in plain language. We'll ask follow-up questions to make it professional. </p> </div> {/* Input area */} <div className="bg-white rounded-2xl border-2 border-gray-200 p-6 shadow-sm"> <textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder="Example: I want to analyze my photography website traffic to see which blog posts get the most engagement..." className="w-full min-h-[200px] text-lg border-none focus:outline-none resize-none" autoFocus /> <div className="flex items-center justify-between mt-4 pt-4 border-t border-gray-200"> <span className="text-sm text-gray-500"> {prompt.length} characters </span> <button onClick={handleSubmit} disabled={!prompt.trim() || isAnalyzing} className="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors" > {isAnalyzing ? ( <span className="flex items-center"> <svg className="animate-spin -ml-1 mr-3 h-5 w-5 text-white" fill="none" viewBox="0 0 24 24"> <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle> <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> Analyzing... </span> ) : ( 'Continue โ†’' )} </button> </div> </div> {/* Tips */} <div className="mt-8 p-6 bg-blue-50 rounded-xl"> <h4 className="font-semibold mb-2 flex items-center"> <svg className="w-5 h-5 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> Pro tip </h4> <p className="text-sm text-gray-700"> Don't worry about being perfect. Just describe your goal naturallyโ€”we'll ask the right questions to fill in the details. </p> </div> </div> ); } 8.3 AdaptiveQuestionnaire.tsx typescript 'use client'; import { useState, useEffect } from 'react'; import QuestionCard from './QuestionCard'; import { getQuestionSet } from '@/lib/prompt-generator/questionSets'; import { getSmartDefault } from '@/lib/prompt-generator/smartDefaults'; interface AdaptiveQuestionnaireProps { framework: string; initialPrompt: string; onComplete: (answers: Record<string, string>) => void; onBack: () => void; } export default function AdaptiveQuestionnaire({ framework, initialPrompt, onComplete, onBack }: AdaptiveQuestionnaireProps) { const questions = getQuestionSet(framework); const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const [skippedQuestions, setSkippedQuestions] = useState<string[]>([]); const currentQuestion = questions[currentQuestionIndex]; const progress = ((currentQuestionIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, answer: string) => { setAnswers(prev => ({ ...prev, [questionId]: answer })); if (currentQuestionIndex < questions.length - 1) { setCurrentQuestionIndex(prev => prev + 1); } else { // Last question answered - finalize finalizeAnswers({ ...answers, [questionId]: answer }); } }; const handleSkip = (questionId: string) => { const defaultValue = getSmartDefault(framework, questionId); setAnswers(prev => ({ ...prev, [questionId]: defaultValue })); setSkippedQuestions(prev => [...prev, questionId]); if (currentQuestionIndex < questions.length - 1) { setCurrentQuestionIndex(prev => prev + 1); } else { finalizeAnswers({ ...answers, [questionId]: defaultValue }); } }; const finalizeAnswers = (finalAnswers: Record<string, string>) => { // Track analytics fetch('/api/prompt-generator/track', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ framework, questionsAnswered: questions.length - skippedQuestions.length, questionsSkipped: skippedQuestions.length, initialPromptLength: initialPrompt.length }) }); onComplete(finalAnswers); }; return ( <div className="max-w-4xl mx-auto px-4 py-12"> {/* Progress bar */} <div className="mb-8"> <div className="flex items-center justify-between mb-2"> <button onClick={onBack} className="text-gray-600 hover:text-gray-900 flex items-center" > <svg className="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> Back </button> <span className="text-sm text-gray-600"> Question {currentQuestionIndex + 1} of {questions.length} </span> </div> <div className="w-full h-2 bg-gray-200 rounded-full overflow-hidden"> <div className="h-full bg-blue-600 transition-all duration-300" style={{ width: `${progress}%` }} /> </div> </div> {/* Current question */} <QuestionCard question={currentQuestion} onAnswer={(answer) => handleAnswer(currentQuestion.id, answer)} onSkip={() => handleSkip(currentQuestion.id)} /> {/* Framework indicator */} <div className="mt-8 text-center text-sm text-gray-500"> Using <span className="font-semibold">{framework}</span> framework </div> </div> ); } 8.4 QuestionCard.tsx typescript 'use client'; import { useState } from 'react'; import LearningTooltip from './LearningTooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; options?: Array<{ value: string; label: string; hasTextField?: boolean }>; required: boolean; defaultValue?: string; tooltip: string; } interface QuestionCardProps { question: Question; onAnswer: (answer: string) => void; onSkip: () => void; } export default function QuestionCard({ question, onAnswer, onSkip }: QuestionCardProps) { const [answer, setAnswer] = useState(''); const [selectedOption, setSelectedOption] = useState(''); const [customText, setCustomText] = useState(''); const handleSubmit = () => { if (question.type === 'textarea') { if (answer.trim()) { onAnswer(answer); } } else { // Multiple choice const finalAnswer = selectedOption === 'custom' ? customText : selectedOption; if (finalAnswer) { onAnswer(finalAnswer); } } }; const canSubmit = question.type === 'textarea' ? answer.trim().length > 0 : selectedOption && (selectedOption !== 'custom' || customText.trim().length > 0); return ( <div className="bg-white rounded-2xl border-2 border-gray-200 p-8 shadow-sm"> {/* Question label with tooltip */} <div className="flex items-start justify-between mb-6"> <h3 className="text-2xl font-bold pr-4"> {question.label} {!question.required && ( <span className="ml-2 text-sm font-normal text-gray-500">(Optional)</span> )} </h3> <LearningTooltip content={question.tooltip} /> </div> {/* Input based on type */} {question.type === 'textarea' ? ( <textarea value={answer} onChange={(e) => setAnswer(e.target.value)} placeholder={question.placeholder} className="w-full min-h-[150px] p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:outline-none text-lg resize-none" autoFocus /> ) : ( <div className="space-y-3"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => setSelectedOption(option.value)} className={`w-full p-4 text-left rounded-xl border-2 transition-all ${ selectedOption === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-200 hover:border-gray-300' }`} > <div className="flex items-center"> <div className={`w-5 h-5 rounded-full border-2 mr-3 flex items-center justify-center ${ selectedOption === option.value ? 'border-blue-500 bg-blue-500' : 'border-gray-300' }`}> {selectedOption === option.value && ( <div className="w-2 h-2 bg-white rounded-full" /> )} </div> <span className="font-medium">{option.label}</span> </div> </button> {/* Custom text field for "Other" options */} {option.hasTextField && selectedOption === option.value && ( <input type="text" value={customText} onChange={(e) => setCustomText(e.target.value)} placeholder="Please specify..." className="w-full mt-2 p-3 border-2 border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none" autoFocus /> )} </div> ))} </div> )} {/* Action buttons */} <div className="flex items-center justify-between mt-6 pt-6 border-t border-gray-200"> {!question.required ? ( <button onClick={onSkip} className="text-gray-600 hover:text-gray-900 font-medium" > Skip question โ†’ </button> ) : ( <div /> )} <button onClick={handleSubmit} disabled={!canSubmit} className="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors" > {question.required ? 'Continue โ†’' : 'Answer & Continue โ†’'} </button> </div> </div> ); } 8.5 LearningTooltip.tsx typescript 'use client'; import { useState } from 'react'; interface LearningTooltipProps { content: string; } export default function LearningTooltip({ content }: LearningTooltipProps) { const [isVisible, setIsVisible] = useState(false); return ( <div className="relative"> <button onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)} onClick={() => setIsVisible(!isVisible)} className="flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center hover:bg-blue-200 transition-colors" aria-label="Learn why this matters" > <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </button> {/* Tooltip content */} {isVisible && ( <div className="absolute right-0 top-8 z-10 w-80 p-4 bg-gray-900 text-white text-sm rounded-lg shadow-xl"> <div className="absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45" /> <div className="relative"> <div className="flex items-start mb-2"> <svg className="w-5 h-5 mr-2 flex-shrink-0 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /> </svg> <strong className="text-blue-400">Why this matters:</strong> </div> <p className="leading-relaxed">{content}</p> </div> </div> )} </div> ); } 8.6 BeforeAfterComparison.tsx typescript 'use client'; import { useState } from 'react'; interface BeforeAfterComparisonProps { originalPrompt: string; enhancedPrompt: string; framework: string; onRestart: () => void; } export default function BeforeAfterComparison({ originalPrompt, enhancedPrompt, framework, onRestart }: BeforeAfterComparisonProps) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(enhancedPrompt); setCopied(true); // Track copy event fetch('/api/prompt-generator/track', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ event: 'copy', framework }) }); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-7xl mx-auto px-4 py-12"> {/* Success header */} <div className="text-center mb-12"> <div className="inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-4"> <svg className="w-8 h-8 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" /> </svg> </div> <h2 className="text-3xl font-bold mb-2"> Your Professional Prompt is Ready! </h2> <p className="text-gray-600"> See how we transformed your idea using the {framework} framework </p> </div> {/* Before/After Comparison */} <div className="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8"> {/* BEFORE */} <div className="bg-gray-50 rounded-2xl p-6 border-2 border-gray-200"> <div className="flex items-center mb-4"> <div className="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center mr-3"> <span className="text-sm font-bold text-gray-600">1</span> </div> <h3 className="text-lg font-bold text-gray-700">Your Original Prompt</h3> </div> <div className="bg-white rounded-xl p-4 min-h-[200px] text-gray-700 leading-relaxed"> {originalPrompt} </div> </div> {/* AFTER */} <div className="bg-gradient-to-br from-blue-50 to-purple-50 rounded-2xl p-6 border-2 border-blue-200"> <div className="flex items-center mb-4"> <div className="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center mr-3"> <svg className="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" /> </svg> </div> <h3 className="text-lg font-bold text-blue-900">Professional Version</h JavaScript JavaScriptโ€ข 39 lines label: 'Who is your target audience?', placeholder: 'e.g., 25-45 year old wedding and lifestyle photographers who want to speed up their editing workflow', required: true, tooltip: 'The more specific your audience definition, the more targeted and effective your copy will be.' }, { id: 'action', type: 'textarea', label: 'What specific action do you want them to take?', placeholder: 'e.g., Click "Buy Now" before the 3-day discount expires', required: true, tooltip: 'Every marketing message needs ONE clear call-to-action. What\'s the next step?' }, { id: 'result', type: 'textarea', label: 'What\'s the ultimate business goal?', placeholder: 'e.g., Drive 100 sales in the first 3 days and build customer base for future products', required: false, defaultValue: 'Generate conversions and revenue', tooltip: 'Understanding the business objective helps craft copy that aligns with your strategy.' }, { id: 'urgency', type: 'multiple-choice', label: 'Is there a time-sensitive element?', options: [ { value: 'limited-time', label: 'โฐ Limited Time Offer' }, { value: 'limited-quantity', label: '๐Ÿ“ฆ Limited Quantity' }, { value: 'early-bird', label: '๐Ÿฆ Early Bird Special' }, { value: 'seasonal', label: '๐ŸŽ„ Seasonal/Event-Based' }, { value: 'none', label: 'No Urgency' }, { value: 'custom', label: 'Custom Urgency...', hasTextField: true } ], required: false, defaultValue: 'Standard marketing timeframe', tooltip: 'Urgency drives immediate action. Use it authentically to boost conversions.' } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 63 lines const promptTemplates = { ICDF: (answers) => ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that is clear, actionable, and directly addresses the instruction within the given context. `.trim(), RCREOC: (answers) => ` **Role:** You are a ${answers.role}. **Context:** ${answers.context} **Request:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Output Format:** Deliver your analysis as ${answers.output}. **Constraints:** ${answers.constraints} Provide professional, expert-level guidance that is constructive and actionable. `.trim(), MICRO: (answers) => ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Context:** This content will be published on ${answers.platform} **Tone & Rhythm:** ${answers.rhythm} **Content Type:** Create a ${answers['output-type']} Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.style} **Target Audience:** ${answers.target} **Desired Action:** The reader should ${answers.action} **Business Result:** The ultimate goal is to ${answers.result} **Urgency Element:** ${answers.urgency} Write persuasive copy that speaks directly to the target audience, clearly presents the offer, and motivates immediate action while maintaining the specified style. `.trim() }; This code can be executed in the preview sandbox Run Code PRISMA Code PRISMAโ€ข 33 lines model PromptGeneration { id String @id @default(cuid()) createdAt DateTime @default(now()) // Framework used framework String // 'ICDF', 'RCREOC', 'MICRO', 'COSTAR' // User journey tracking initialPromptLength Int // Character count of original input questionsAnswered Int // How many questions user answered questionsSkipped Int // How many used smart defaults timeToComplete Int // Seconds from start to finish // Outcome completed Boolean @default(false) copiedToClipboard Boolean @default(false) // Anonymous session (for rate limiting) sessionHash String // Hashed IP + User Agent @@index([framework, createdAt]) @@index([sessionHash, createdAt]) } model FrameworkUsage { id String @id @default(cuid()) date DateTime @default(now()) framework String count Int @default(1) @@unique([date, framework]) @@index([date]) } Code Snippet 4 Plain Textโ€ข 28 lines src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”œโ”€โ”€ InitialPromptInput.tsx # First text input โ”‚ โ”œโ”€โ”€ AdaptiveQuestionnaire.tsx # Dynamic question renderer โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover/click tooltip โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ””โ”€โ”€ SuccessActions.tsx # Copy button + restart โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword matching logic โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”œโ”€โ”€ smartDefaults.ts # Default values โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ track/ โ”‚ โ””โ”€โ”€ route.ts # POST - Log analytics โ””โ”€โ”€ rate-limit/ โ””โ”€โ”€ route.ts # GET - Check usage limits TypeScript TypeScriptโ€ข 85 lines 'use client'; import { useState } from 'react'; import { frameworkDetection } from '@/lib/prompt-generator/frameworkDetection'; interface QuickStartWizardProps { onFrameworkSelect: (framework: string) => void; } export default function QuickStartWizard({ onFrameworkSelect }: QuickStartWizardProps) { return ( <div className="max-w-6xl mx-auto px-4 py-12"> <div className="text-center mb-12"> <h1 className="text-4xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-gray-600"> Transform your simple idea into a professional AI prompt in 60 seconds </p> </div> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> {Object.entries(frameworkDetection).map(([key, framework]) => ( <button key={key} onClick={() => onFrameworkSelect(key)} className="group relative p-8 bg-white rounded-2xl border-2 border-gray-200 hover:border-current hover:shadow-xl transition-all duration-300" style={{ '--hover-color': framework.color, color: 'inherit' } as React.CSSProperties} > {/* Icon */} <div className="text-6xl mb-4 transition-transform group-hover:scale-110" style={{ color: framework.color }} > {framework.icon} </div> {/* Title */} <h3 className="text-xl font-bold mb-2"> {framework.title} </h3> {/* Subtitle */} <p className="text-gray-600 text-sm"> {framework.subtitle} </p> {/* Hover indicator */} <div className="absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transition-opacity"> <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </button> ))} </div> {/* Example prompts section */} <div className="mt-16 text-center"> <p className="text-gray-500 text-sm mb-4"> Popular examples: </p> <div className="flex flex-wrap justify-center gap-3"> {[ { text: 'Analyze my website traffic', framework: 'ICDF' }, { text: 'Review my photography portfolio', framework: 'RCREOC' }, { text: 'Write a YouTube script about lighting', framework: 'MICRO' }, { text: 'Create a sales email for presets', framework: 'COSTAR' } ].map((example, idx) => ( <button key={idx} onClick={() => onFrameworkSelect(example.framework)} className="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition-colors" > "{example.text}" </button> ))} </div> </div> </div> ); } TypeScript TypeScriptโ€ข 104 lines 'use client'; import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/frameworkDetection'; interface InitialPromptInputProps { selectedFramework: string; onSubmit: (prompt: string, detectedFramework: string) => void; onBack: () => void; } export default function InitialPromptInput({ selectedFramework, onSubmit, onBack }: InitialPromptInputProps) { const [prompt, setPrompt] = useState(''); const [isAnalyzing, setIsAnalyzing] = useState(false); const handleSubmit = () => { if (!prompt.trim()) return; setIsAnalyzing(true); // Simulate brief analysis delay for UX setTimeout(() => { const detected = detectFramework(prompt); onSubmit(prompt, detected); }, 500); }; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Back button */} <button onClick={onBack} className="flex items-center text-gray-600 hover:text-gray-900 mb-8" > <svg className="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> Back to framework selection </button> {/* Header */} <div className="text-center mb-8"> <h2 className="text-3xl font-bold mb-3"> Describe what you need </h2> <p className="text-gray-600"> Write your idea in plain language. We'll ask follow-up questions to make it professional. </p> </div> {/* Input area */} <div className="bg-white rounded-2xl border-2 border-gray-200 p-6 shadow-sm"> <textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder="Example: I want to analyze my photography website traffic to see which blog posts get the most engagement..." className="w-full min-h-[200px] text-lg border-none focus:outline-none resize-none" autoFocus /> <div className="flex items-center justify-between mt-4 pt-4 border-t border-gray-200"> <span className="text-sm text-gray-500"> {prompt.length} characters </span> <button onClick={handleSubmit} disabled={!prompt.trim() || isAnalyzing} className="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors" > {isAnalyzing ? ( <span className="flex items-center"> <svg className="animate-spin -ml-1 mr-3 h-5 w-5 text-white" fill="none" viewBox="0 0 24 24"> <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle> <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> Analyzing... </span> ) : ( 'Continue โ†’' )} </button> </div> </div> {/* Tips */} <div className="mt-8 p-6 bg-blue-50 rounded-xl"> <h4 className="font-semibold mb-2 flex items-center"> <svg className="w-5 h-5 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> Pro tip </h4> <p className="text-sm text-gray-700"> Don't worry about being perfect. Just describe your goal naturallyโ€”we'll ask the right questions to fill in the details. </p> </div> </div> ); } TypeScript TypeScriptโ€ข 109 lines 'use client'; import { useState, useEffect } from 'react'; import QuestionCard from './QuestionCard'; import { getQuestionSet } from '@/lib/prompt-generator/questionSets'; import { getSmartDefault } from '@/lib/prompt-generator/smartDefaults'; interface AdaptiveQuestionnaireProps { framework: string; initialPrompt: string; onComplete: (answers: Record<string, string>) => void; onBack: () => void; } export default function AdaptiveQuestionnaire({ framework, initialPrompt, onComplete, onBack }: AdaptiveQuestionnaireProps) { const questions = getQuestionSet(framework); const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const [skippedQuestions, setSkippedQuestions] = useState<string[]>([]); const currentQuestion = questions[currentQuestionIndex]; const progress = ((currentQuestionIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, answer: string) => { setAnswers(prev => ({ ...prev, [questionId]: answer })); if (currentQuestionIndex < questions.length - 1) { setCurrentQuestionIndex(prev => prev + 1); } else { // Last question answered - finalize finalizeAnswers({ ...answers, [questionId]: answer }); } }; const handleSkip = (questionId: string) => { const defaultValue = getSmartDefault(framework, questionId); setAnswers(prev => ({ ...prev, [questionId]: defaultValue })); setSkippedQuestions(prev => [...prev, questionId]); if (currentQuestionIndex < questions.length - 1) { setCurrentQuestionIndex(prev => prev + 1); } else { finalizeAnswers({ ...answers, [questionId]: defaultValue }); } }; const finalizeAnswers = (finalAnswers: Record<string, string>) => { // Track analytics fetch('/api/prompt-generator/track', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ framework, questionsAnswered: questions.length - skippedQuestions.length, questionsSkipped: skippedQuestions.length, initialPromptLength: initialPrompt.length }) }); onComplete(finalAnswers); }; return ( <div className="max-w-4xl mx-auto px-4 py-12"> {/* Progress bar */} <div className="mb-8"> <div className="flex items-center justify-between mb-2"> <button onClick={onBack} className="text-gray-600 hover:text-gray-900 flex items-center" > <svg className="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> Back </button> <span className="text-sm text-gray-600"> Question {currentQuestionIndex + 1} of {questions.length} </span> </div> <div className="w-full h-2 bg-gray-200 rounded-full overflow-hidden"> <div className="h-full bg-blue-600 transition-all duration-300" style={{ width: `${progress}%` }} /> </div> </div> {/* Current question */} <QuestionCard question={currentQuestion} onAnswer={(answer) => handleAnswer(currentQuestion.id, answer)} onSkip={() => handleSkip(currentQuestion.id)} /> {/* Framework indicator */} <div className="mt-8 text-center text-sm text-gray-500"> Using <span className="font-semibold">{framework}</span> framework </div> </div> ); } TypeScript TypeScriptโ€ข 134 lines 'use client'; import { useState } from 'react'; import LearningTooltip from './LearningTooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; options?: Array<{ value: string; label: string; hasTextField?: boolean }>; required: boolean; defaultValue?: string; tooltip: string; } interface QuestionCardProps { question: Question; onAnswer: (answer: string) => void; onSkip: () => void; } export default function QuestionCard({ question, onAnswer, onSkip }: QuestionCardProps) { const [answer, setAnswer] = useState(''); const [selectedOption, setSelectedOption] = useState(''); const [customText, setCustomText] = useState(''); const handleSubmit = () => { if (question.type === 'textarea') { if (answer.trim()) { onAnswer(answer); } } else { // Multiple choice const finalAnswer = selectedOption === 'custom' ? customText : selectedOption; if (finalAnswer) { onAnswer(finalAnswer); } } }; const canSubmit = question.type === 'textarea' ? answer.trim().length > 0 : selectedOption && (selectedOption !== 'custom' || customText.trim().length > 0); return ( <div className="bg-white rounded-2xl border-2 border-gray-200 p-8 shadow-sm"> {/* Question label with tooltip */} <div className="flex items-start justify-between mb-6"> <h3 className="text-2xl font-bold pr-4"> {question.label} {!question.required && ( <span className="ml-2 text-sm font-normal text-gray-500">(Optional)</span> )} </h3> <LearningTooltip content={question.tooltip} /> </div> {/* Input based on type */} {question.type === 'textarea' ? ( <textarea value={answer} onChange={(e) => setAnswer(e.target.value)} placeholder={question.placeholder} className="w-full min-h-[150px] p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:outline-none text-lg resize-none" autoFocus /> ) : ( <div className="space-y-3"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => setSelectedOption(option.value)} className={`w-full p-4 text-left rounded-xl border-2 transition-all ${ selectedOption === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-200 hover:border-gray-300' }`} > <div className="flex items-center"> <div className={`w-5 h-5 rounded-full border-2 mr-3 flex items-center justify-center ${ selectedOption === option.value ? 'border-blue-500 bg-blue-500' : 'border-gray-300' }`}> {selectedOption === option.value && ( <div className="w-2 h-2 bg-white rounded-full" /> )} </div> <span className="font-medium">{option.label}</span> </div> </button> {/* Custom text field for "Other" options */} {option.hasTextField && selectedOption === option.value && ( <input type="text" value={customText} onChange={(e) => setCustomText(e.target.value)} placeholder="Please specify..." className="w-full mt-2 p-3 border-2 border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none" autoFocus /> )} </div> ))} </div> )} {/* Action buttons */} <div className="flex items-center justify-between mt-6 pt-6 border-t border-gray-200"> {!question.required ? ( <button onClick={onSkip} className="text-gray-600 hover:text-gray-900 font-medium" > Skip question โ†’ </button> ) : ( <div /> )} <button onClick={handleSubmit} disabled={!canSubmit} className="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors" > {question.required ? 'Continue โ†’' : 'Answer & Continue โ†’'} </button> </div> </div> ); } TypeScript TypeScriptโ€ข 43 lines 'use client'; import { useState } from 'react'; interface LearningTooltipProps { content: string; } export default function LearningTooltip({ content }: LearningTooltipProps) { const [isVisible, setIsVisible] = useState(false); return ( <div className="relative"> <button onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)} onClick={() => setIsVisible(!isVisible)} className="flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center hover:bg-blue-200 transition-colors" aria-label="Learn why this matters" > <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </button> {/* Tooltip content */} {isVisible && ( <div className="absolute right-0 top-8 z-10 w-80 p-4 bg-gray-900 text-white text-sm rounded-lg shadow-xl"> <div className="absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45" /> <div className="relative"> <div className="flex items-start mb-2"> <svg className="w-5 h-5 mr-2 flex-shrink-0 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /> </svg> <strong className="text-blue-400">Why this matters:</strong> </div> <p className="leading-relaxed">{content}</p> </div> </div> )} </div> ); } Used 109 credits javascript Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The copy should have a ${answers.style} tone and style. **Target Audience:** ${answers.target} **Action:** The primary call-to-action is: ${answers.action} **Result:** The business goal is to ${answers.result} ${answers.urgency !== 'none' ? `**Urgency Factor:** ${answers.urgency}\n` : ''} Write persuasive marketing copy that speaks directly to the target audience, clearly presents the offer, and drives them to take action. `.trim() }; Before/After Comparison Generator javascript function generateComparison(originalPrompt, framework, answers) { const professionalPrompt = promptTemplates[framework](answers); return { original: originalPrompt, professional: professionalPrompt, improvements: generateImprovements(framework, answers), framework: framework, frameworkName: getFrameworkName(framework) }; } function generateImprovements(framework, answers) { const improvements = []; // Framework-specific improvement explanations const explanations = { ICDF: [ { added: 'Instruction', why: 'Clearly defines the specific task, eliminating ambiguity' }, { added: 'Context', why: 'Provides background so the AI understands the purpose and stakes' }, { added: 'Data', why: 'Specifies exactly what information to analyze' }, { added: 'Format', why: 'Ensures you get results in the exact structure you need' } ], RCREOC: [ { added: 'Role', why: 'AI responds with the expertise and perspective of a professional' }, { added: 'Context', why: 'Sets the real-world environment and stakes' }, { added: 'Request', why: 'Defines specific deliverables expected from the expert' }, { added: 'Examples', why: 'Guides the AI\'s reasoning process and output style' }, { added: 'Output Format', why: 'Structures the response for maximum usability' }, { added: 'Constraints', why: 'Keeps the expert focused on what matters most' } ], MICRO: [ { added: 'Message', why: 'Establishes the core thesis and key takeaway' }, { added: 'Intention', why: 'Drives the emotional tone and desired outcome' }, { added: 'Audience', why: 'Shapes vocabulary, tone, and complexity level' }, { added: 'Platform', why: 'Dictates format constraints and optimal structure' }, { added: 'Rhythm', why: 'Determines pacing and delivery style' } ], COSTAR: [ { added: 'Context', why: 'Sets the campaign stage and market situation' }, { added: 'Offer', why: 'Crystal clear value proposition and deal' }, { added: 'Style', why: 'Aligns with brand voice and audience expectations' }, { added: 'Target', why: 'Enables hyper-relevant, personalized messaging' }, { added: 'Action', why: 'Provides one clear, compelling call-to-action' }, { added: 'Result', why: 'Aligns copy with business objectives' } ] }; return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: 'ICDF Framework (Analytical)', RCREOC: 'RCREOC Framework (Expert Consultation)', MICRO: 'MICRO Framework (Content Creation)', COSTAR: 'COSTAR Framework (Marketing & Sales)' }; return names[framework]; } 6. File Structure & Implementation Directory Structure app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page (Quick-start wizard) โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout (uses site header/footer) โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”‚ โ”œโ”€โ”€ MultipleChoice.tsx # Button-based choices โ”‚ โ”‚ โ”œโ”€โ”€ TextInput.tsx # Text field with placeholder โ”‚ โ”‚ โ”œโ”€โ”€ Tooltip.tsx # Learning mode tooltips โ”‚ โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ”‚ โ”œโ”€โ”€ ImprovementsList.tsx # "Why this matters" explanations โ”‚ โ”‚ โ””โ”€โ”€ CopyButton.tsx # One-click copy functionality โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword analysis logic โ”‚ โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ types/ โ”‚ โ””โ”€โ”€ index.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ””โ”€โ”€ (reuse existing components: Button, Card, Input, Textarea, etc.) Key Component Implementations 1. QuickStartWizard.tsx typescript 'use client'; import { useState } from 'react'; import { Card } from '@/components/ui/card'; import { frameworkDetection } from '../lib/frameworkDetection'; export default function QuickStartWizard({ onSelect }: { onSelect: (framework: string) => void }) { return ( <div className="max-w-6xl mx-auto px-4 py-12"> <div className="text-center mb-12"> <h1 className="text-4xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-muted-foreground"> Transform your simple idea into a professional AI prompt in 60 seconds </p> </div> <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6"> {Object.entries(frameworkDetection).map(([key, framework]) => ( <Card key={key} className="p-6 cursor-pointer hover:shadow-lg transition-all hover:scale-105" style={{ borderTop: `4px solid ${framework.color}` }} onClick={() => onSelect(key)} > <div className="text-5xl mb-4">{framework.icon}</div> <h3 className="text-xl font-semibold mb-2">{framework.title}</h3> <p className="text-sm text-muted-foreground">{framework.subtitle}</p> </Card> ))} </div> <div className="mt-12 text-center"> <p className="text-sm text-muted-foreground mb-4"> Not sure which one? Describe your goal and we'll guide you. </p> </div> </div> ); } 2. PromptInput.tsx typescript 'use client'; import { useState } from 'react'; import { Textarea } from '@/components/ui/textarea'; import { Button } from '@/components/ui/button'; import { detectFramework } from '../lib/frameworkDetection'; interface PromptInputProps { selectedFramework?: string; onSubmit: (prompt: string, detectedFramework: string) => void; } export default function PromptInput({ selectedFramework, onSubmit }: PromptInputProps) { const [prompt, setPrompt] = useState(''); const handleSubmit = () => { const framework = selectedFramework || detectFramework(prompt); onSubmit(prompt, framework); }; return ( <div className="max-w-3xl mx-auto px-4 py-8"> <div className="mb-6"> <label className="block text-lg font-medium mb-2"> Describe what you need in your own words </label> <Textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are performing best..." rows={6} className="text-base" /> </div> <Button onClick={handleSubmit} disabled={prompt.trim().length < 10} size="lg" className="w-full" > Continue โ†’ </Button> {selectedFramework && ( <p className="text-sm text-muted-foreground mt-4 text-center"> Using {frameworkDetection[selectedFramework].title} framework </p> )} </div> ); } 3. QuestionFlow.tsx typescript 'use client'; import { useState } from 'react'; import { questionSets } from '../lib/questionSets'; import QuestionCard from './QuestionCard'; import { Button } from '@/components/ui/button'; import { Progress } from '@/components/ui/progress'; interface QuestionFlowProps { framework: string; onComplete: (answers: Record<string, string>) => void; } export default function QuestionFlow({ framework, onComplete }: QuestionFlowProps) { const questions = questionSets[framework]; const [currentIndex, setCurrentIndex] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const currentQuestion = questions[currentIndex]; const progress = ((currentIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) => { setAnswers(prev => ({ ...prev, [questionId]: value })); }; const handleNext = () => { // Apply smart default if skipped if (!answers[currentQuestion.id] && currentQuestion.defaultValue) { setAnswers(prev => ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentIndex < questions.length - 1) { setCurrentIndex(prev => prev + 1); } else { // Apply defaults to any remaining unanswered questions const finalAnswers = { ...answers }; questions.forEach(q => { if (!finalAnswers[q.id] && q.defaultValue) { finalAnswers[q.id] = q.defaultValue; } }); onComplete(finalAnswers); } }; const handleBack = () => { if (currentIndex > 0) { setCurrentIndex(prev => prev - 1); } }; return ( <div className="max-w-3xl mx-auto px-4 py-8"> <Progress value={progress} className="mb-8" /> <div className="mb-4 text-sm text-muted-foreground"> Question {currentIndex + 1} of {questions.length} </div> <QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || ''} onChange={(value) => handleAnswer(currentQuestion.id, value)} /> <div className="flex gap-4 mt-8"> {currentIndex > 0 && ( <Button variant="outline" onClick={handleBack} className="flex-1" > โ† Back </Button> )} <Button onClick={handleNext} className="flex-1" > {currentIndex < questions.length - 1 ? 'Next โ†’' : 'Generate Prompt โœจ'} </Button> </div> {!answers[currentQuestion.id] && currentQuestion.defaultValue && ( <p className="text-sm text-muted-foreground mt-4 text-center"> ๐Ÿ’ก Tip: Skip this if unsureโ€”we'll use a smart default </p> )} </div> ); } 4. QuestionCard.tsx typescript 'use client'; import { Textarea } from '@/components/ui/textarea'; import MultipleChoice from './MultipleChoice'; import Tooltip from './Tooltip'; interface QuestionCardProps { question: any; value: string; onChange: (value: string) => void; } export default function QuestionCard({ question, value, onChange }: QuestionCardProps) { return ( <div className="bg-card rounded-lg border p-6"> <div className="flex items-start justify-between mb-4"> <label className="text-lg font-medium"> {question.label} {question.required && <span className="text-destructive ml-1">*</span>} </label> <Tooltip content={question.tooltip} /> </div> {question.type === 'textarea' ? ( <Textarea value={value} onChange={(e) => onChange(e.target.value)} placeholder={question.placeholder} rows={4} className="text-base" /> ) : question.type === 'multiple-choice' ? ( <MultipleChoice options={question.options} value={value} onChange={onChange} /> ) : null} </div> ); } 5. BeforeAfter.tsx typescript 'use client'; import { Card } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Copy, Check } from 'lucide-react'; import { useState } from 'react'; import ImprovementsList from './ImprovementsList'; interface BeforeAfterProps { original: string; professional: string; improvements: Array<{ added: string; why: string }>; frameworkName: string; onStartNew: () => void; } export default function BeforeAfter({ original, professional, improvements, frameworkName, onStartNew }: BeforeAfterProps) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-7xl mx-auto px-4 py-12"> <div className="text-center mb-8"> <div className="inline-block bg-green-100 text-green-800 px-4 py-2 rounded-full mb-4"> โœ“ Your professional prompt is ready! </div> <h2 className="text-3xl font-bold mb-2">Before & After</h2> <p className="text-muted-foreground">Using {frameworkName}</p> </div> {/* Desktop: Side by side */} <div className="hidden md:grid md:grid-cols-2 gap-6 mb-8"> <Card className="p-6"> <h3 className="text-lg font-semibold mb-4 text-muted-foreground"> Your Original Prompt </h3> <div className="text-sm whitespace-pre-wrap bg-muted p-4 rounded"> {original} </div> </Card> <Card className="p-6 border-2 border-primary"> <div className="flex items-center justify-between mb-4"> <h3 className="text-lg font-semibold text-primary"> โœจ Professional Version </h3> <Button onClick={handleCopy} size="sm" variant="outline" > {copied ? <Check className="w-4 h-4 mr-2" /> : <Copy className="w-4 h-4 mr-2" />} {copied ? 'Copied!' : 'Copy'} </Button> </div> <div className="text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium"> {professional} </div> </Card> </div> {/* Mobile: Stacked */} <div className="md:hidden space-y-6 mb-8"> <Card className="p-6"> <h3 className="text-lg font-semibold mb-4 text-muted-foreground"> Your Original Prompt </h3> <div className="text-sm whitespace-pre-wrap bg-muted p-4 rounded"> {original} </div> </Card> <Card className="p-6 border-2 border-primary"> <div className="flex items-center justify-between mb-4"> <h3 className="text-lg font-semibold text-primary"> โœจ Professional Version </h3> <Button onClick={handleCopy} size="sm" variant="outline" > {copied ? <Check className="w-4 h-4 mr-2" /> : <Copy className="w-4 h-4 mr-2" />} {copied ? 'Copied!' : 'Copy'} </Button> </div> <div className="text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium"> {professional} </div> </Card> </div> {/* Learning Mode: Improvements */} <ImprovementsList improvements={improvements} /> {/* Action Buttons */} <div className="flex flex-col sm:flex-row gap-4 justify-center mt-8"> <Button onClick={onStartNew} size="lg"> Create Another Prompt </Button> <Button onClick={handleCopy} variant="outline" size="lg"> {copied ? 'Copied!' : 'Copy to Clipboard'} </Button> </div> </div> ); } 6. ImprovementsList.tsx typescript 'use client'; import { Card } from '@/components/ui/card'; import { Lightbulb } from 'lucide-react'; interface ImprovementsListProps { improvements: Array<{ added: string; why: string }>; } export default function ImprovementsList({ improvements }: ImprovementsListProps) { return ( <Card className="p-6 bg-blue-50 border-blue-200"> <div className="flex items-center gap-2 mb-4"> <Lightbulb className="w-5 h-5 text-blue-600" /> <h3 className="text-lg font-semibold text-blue-900"> What Makes This Prompt Professional? </h3> </div> <div className="space-y-3"> {improvements.map((item, index) => ( <div key={index} className="flex gap-3"> <div className="flex-shrink-0 w-6 h-6 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm font-bold"> {index + 1} </div> <div> <div className="font-medium text-blue-900">{item.added}</div> <div className="text-sm text-blue-700">{item.why}</div> </div> </div> ))} </div> </Card> ); } 7. Analytics Implementation lib/analytics.ts typescript 'use client'; interface AnalyticsEvent { event: string; framework?: string; completed?: boolean; timestamp: number; } export function trackFrameworkSelection(framework: string) { if (typeof window === 'undefined') return; // Send to your analytics service (Google Analytics, Plausible, etc.) if (window.gtag) { window.gtag('event', 'framework_selected', { framework: framework, page: '/prompt-generator' }); } // Also store locally for admin dashboard saveToLocalAnalytics({ event: 'framework_selected', framework, timestamp: Date.now() }); } export function trackPromptCompleted(framework: string) { if (typeof window === 'undefined') return; if (window.gtag) { window.gtag('event', 'prompt_completed', { framework: framework, page: '/prompt-generator' }); } saveToLocalAnalytics({ event: 'prompt_completed', framework, completed: true, timestamp: Date.now() }); } export function trackPromptCopied(framework: string) { if (typeof window === 'undefined') return; if (window.gtag) { window.gtag('event', 'prompt_copied', { framework: framework, page: '/prompt-generator' }); } } function saveToLocalAnalytics(event: AnalyticsEvent) { // Store in localStorage for simple analytics dashboard const key = 'prompt_generator_analytics'; const existing = localStorage.getItem(key); const data = existing ? JSON.parse(existing) : []; data.push(event); // Keep only last 1000 events if (data.length > 1000) { data.shift(); } localStorage.setItem(key, JSON.stringify(data)); } // Admin dashboard helper export function getAnalyticsSummary() { if (typeof window === 'undefined') return null; const key = 'prompt_generator_analytics'; const data = localStorage.getItem(key); if (!data) return null; const events = JSON.parse(data); const summary = { totalSessions: events.filter(e => e.event === 'framework_selected').length, completedPrompts: events.filter(e => e.event === 'prompt_completed').length, frameworkUsage: { ICDF: events.filter(e => e.framework === 'ICDF').length, RCREOC: events.filter(e => e.framework === 'RCREOC').length, MICRO: events.filter(e => e.framework === 'MICRO').length, COSTAR: events.filter(e => e.framework === 'COSTAR').length }, completionRate: 0 }; summary.completionRate = summary.totalSessions > 0 ? (summary.completedPrompts / summary.totalSessions) * 100 : 0; return summary; } 8. Main Page Implementation app/prompt-generator/page.tsx typescript 'use client'; import { useState } from 'react'; import QuickStartWizard from './components/QuickStartWizard'; import PromptInput from './components/PromptInput'; import QuestionFlow from './components/QuestionFlow'; import BeforeAfter from './components/BeforeAfter'; import { generateComparison } from './lib/promptTemplates'; import { trackFrameworkSelection, trackPromptCompleted } from './lib/analytics'; type Step = 'wizard' | 'input' | 'questions' | 'result'; export default function PromptGeneratorPage() { const [step, setStep] = useState<Step>('wizard'); const [selectedFramework, setSelectedFramework] = useState<string | null>(null); const [originalPrompt, setOriginalPrompt] = useState(''); const [answers, setAnswers] = useState<Record<string, string>>({}); const [result, setResult] = useState<any>(null); const handleFrameworkSelect = (framework: string) => { setSelectedFramework(framework); setStep('input'); trackFrameworkSelection(framework); }; const handlePromptSubmit = (prompt: string, detectedFramework: string) => { setOriginalPrompt(prompt); setSelectedFramework(detectedFramework); setStep('questions'); }; const handleQuestionsComplete = (questionAnswers: Record<string, string>) => { setAnswers(questionAnswers); const comparison = generateComparison( originalPrompt, selectedFramework!, questionAnswers ); setResult(comparison); setStep('result'); trackPromptCompleted(selectedFramework!); }; const handleStartNew = () => { setStep('wizard'); setSelectedFramework(null); setOriginalPrompt(''); setAnswers({}); setResult(null); }; return ( <div className="min-h-screen bg-background"> {step === 'wizard' && ( <QuickStartWizard onSelect={handleFrameworkSelect} /> )} {step === 'input' && ( <PromptInput selectedFramework={selectedFramework || undefined} onSubmit={handlePromptSubmit} /> )} {step === 'questions' && selectedFramework && ( <QuestionFlow framework={selectedFramework} onComplete={handleQuestionsComplete} /> )} {step === 'result' && result && ( <BeforeAfter original={result.original} professional={result.professional} improvements={result.improvements} frameworkName={result.frameworkName} onStartNew={handleStartNew} /> )} </div> ); } 9. TypeScript Interfaces app/prompt-generator/types/index.ts typescript export interface Framework { keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: QuestionOption[]; } export interface QuestionOption { value: string; label: string; hasTextField?: boolean; } export interface PromptComparison { original: string; professional: string; improvements: Improvement[]; framework: string; frameworkName: string; } export interface Improvement { added: string; why: string; } export interface AnalyticsSummary { totalSessions: number; completedPrompts: number; frameworkUsage: { ICDF: number; RCREOC: number; MICRO: number; COSTAR: number; }; completionRate: number; } 10. Integration with Existing Site Navigation Update Add to your main navigation: typescript // In your navigation component const navItems = [ { name: 'Photo Tools', href: '/' }, { name: 'AI Prompt Generator', href: '/prompt-generator' }, // NEW { name: 'Blog', href: '/blog' }, // ... other items ]; SEO & Metadata typescript // app/prompt-generator/layout.tsx import type { Metadata } from 'next'; export const metadata: Metadata = { title: 'AI Prompt Generator | Modern Photo Tools', description: 'Transform your simple AI ideas into professional prompts using proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Free tool for better AI results.', keywords: ['AI prompts', 'prompt engineering', 'ChatGPT prompts', 'Midjourney prompts', 'AI tools'], openGraph: { title: 'AI Prompt Generator - Get Professional Results', description: 'Free tool that transforms amateur prompts into professional-grade AI instructions', type: 'website', } }; export default function PromptGeneratorLayout({ children, }: { children: React.ReactNode; }) { return <>{children}</>; } 11. Testing Checklist Functional Testing Framework detection works correctly for all 4 types All question types render properly (textarea, multiple-choice) Smart defaults apply when questions are skipped Before/After displays correctly on desktop and mobile Copy button works and shows feedback "Start Another" resets the flow completely Tooltips display on hover/click Analytics events fire correctly UX Testing Wizard cards are visually distinct and clickable Questions flow smoothly with back/next buttons Progress bar updates accurately Mobile experience is smooth (stacked layout) Loading states (if any) are clear Error states handled gracefully Content Testing All tooltips are helpful and concise Framework explanations are accurate Example placeholders are realistic Improvement explanations make sense Generated prompts are well-formatted 12. Launch Checklist Pre-Launch Test on multiple browsers (Chrome, Safari, Firefox) Test on mobile devices (iOS, Android) Verify analytics tracking works Add Google Analytics / Plausible event tracking Create social media preview images Write launch blog post explaining the tool Set up simple admin dashboard to view analytics Post-Launch Monitor analytics for usage patterns Collect user feedback Identify most-used frameworks Track completion rates Iterate on question sets based on data Consider adding more frameworks if needed 13. Future Enhancements (Optional) Phase 2 Features Prompt Templates Library Pre-built prompts users can customize "Photography prompt templates" "Marketing email templates" Save & Share Generate shareable links to prompts "Share this prompt" button No login required, just URL-based AI Provider Optimization Toggle: "Optimize for ChatGPT / Claude / Gemini / Midjourney" Slight variations in prompt structure Prompt History (LocalStorage) Save last 10 prompts in browser Quick access to previous work Still no login required Advanced Mode "Show all questions" toggle Manual framework selection override Custom framework creation 14. Cost Analysis Development Time Estimate Setup & Configuration: 2-3 hours Core Components: 8-10 hours Question Sets & Logic: 4-5 hours Before/After UI: 3-4 hours Analytics Integration: 2-3 hours Testing & Polish: 4-5 hours Total: 23-30 hours Ongoing Costs Hosting: $0 (uses existing Next.js deployment) API Calls: $0 (rule-based, JavaScript JavaScriptโ€ข 20 lines Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) => ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The copy should have a ${answers.style} tone and style. **Target Audience:** ${answers.target} **Action:** The primary call-to-action is: ${answers.action} **Result:** The business goal is to ${answers.result} ${answers.urgency !== 'none' ? `**Urgency Factor:** ${answers.urgency}\n` : ''} Write persuasive marketing copy that speaks directly to the target audience, clearly presents the offer, and drives them to take action. `.trim() }; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 60 lines function generateComparison(originalPrompt, framework, answers) { const professionalPrompt = promptTemplates[framework](answers); return { original: originalPrompt, professional: professionalPrompt, improvements: generateImprovements(framework, answers), framework: framework, frameworkName: getFrameworkName(framework) }; } function generateImprovements(framework, answers) { const improvements = []; // Framework-specific improvement explanations const explanations = { ICDF: [ { added: 'Instruction', why: 'Clearly defines the specific task, eliminating ambiguity' }, { added: 'Context', why: 'Provides background so the AI understands the purpose and stakes' }, { added: 'Data', why: 'Specifies exactly what information to analyze' }, { added: 'Format', why: 'Ensures you get results in the exact structure you need' } ], RCREOC: [ { added: 'Role', why: 'AI responds with the expertise and perspective of a professional' }, { added: 'Context', why: 'Sets the real-world environment and stakes' }, { added: 'Request', why: 'Defines specific deliverables expected from the expert' }, { added: 'Examples', why: 'Guides the AI\'s reasoning process and output style' }, { added: 'Output Format', why: 'Structures the response for maximum usability' }, { added: 'Constraints', why: 'Keeps the expert focused on what matters most' } ], MICRO: [ { added: 'Message', why: 'Establishes the core thesis and key takeaway' }, { added: 'Intention', why: 'Drives the emotional tone and desired outcome' }, { added: 'Audience', why: 'Shapes vocabulary, tone, and complexity level' }, { added: 'Platform', why: 'Dictates format constraints and optimal structure' }, { added: 'Rhythm', why: 'Determines pacing and delivery style' } ], COSTAR: [ { added: 'Context', why: 'Sets the campaign stage and market situation' }, { added: 'Offer', why: 'Crystal clear value proposition and deal' }, { added: 'Style', why: 'Aligns with brand voice and audience expectations' }, { added: 'Target', why: 'Enables hyper-relevant, personalized messaging' }, { added: 'Action', why: 'Provides one clear, compelling call-to-action' }, { added: 'Result', why: 'Aligns copy with business objectives' } ] }; return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: 'ICDF Framework (Analytical)', RCREOC: 'RCREOC Framework (Expert Consultation)', MICRO: 'MICRO Framework (Content Creation)', COSTAR: 'COSTAR Framework (Marketing & Sales)' }; return names[framework]; } This code can be executed in the preview sandbox Run Code Code Snippet 3 Plain Textโ€ข 26 lines app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page (Quick-start wizard) โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout (uses site header/footer) โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”‚ โ”œโ”€โ”€ MultipleChoice.tsx # Button-based choices โ”‚ โ”‚ โ”œโ”€โ”€ TextInput.tsx # Text field with placeholder โ”‚ โ”‚ โ”œโ”€โ”€ Tooltip.tsx # Learning mode tooltips โ”‚ โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ”‚ โ”œโ”€โ”€ ImprovementsList.tsx # "Why this matters" explanations โ”‚ โ”‚ โ””โ”€โ”€ CopyButton.tsx # One-click copy functionality โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword analysis logic โ”‚ โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ types/ โ”‚ โ””โ”€โ”€ index.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ””โ”€โ”€ (reuse existing components: Button, Card, Input, Textarea, etc.) TypeScript TypeScriptโ€ข 41 lines 'use client'; import { useState } from 'react'; import { Card } from '@/components/ui/card'; import { frameworkDetection } from '../lib/frameworkDetection'; export default function QuickStartWizard({ onSelect }: { onSelect: (framework: string) => void }) { return ( <div className="max-w-6xl mx-auto px-4 py-12"> <div className="text-center mb-12"> <h1 className="text-4xl font-bold mb-4"> AI Prompt Generator </h1> <p className="text-xl text-muted-foreground"> Transform your simple idea into a professional AI prompt in 60 seconds </p> </div> <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6"> {Object.entries(frameworkDetection).map(([key, framework]) => ( <Card key={key} className="p-6 cursor-pointer hover:shadow-lg transition-all hover:scale-105" style={{ borderTop: `4px solid ${framework.color}` }} onClick={() => onSelect(key)} > <div className="text-5xl mb-4">{framework.icon}</div> <h3 className="text-xl font-semibold mb-2">{framework.title}</h3> <p className="text-sm text-muted-foreground">{framework.subtitle}</p> </Card> ))} </div> <div className="mt-12 text-center"> <p className="text-sm text-muted-foreground mb-4"> Not sure which one? Describe your goal and we'll guide you. </p> </div> </div> ); } TypeScript TypeScriptโ€ข 52 lines 'use client'; import { useState } from 'react'; import { Textarea } from '@/components/ui/textarea'; import { Button } from '@/components/ui/button'; import { detectFramework } from '../lib/frameworkDetection'; interface PromptInputProps { selectedFramework?: string; onSubmit: (prompt: string, detectedFramework: string) => void; } export default function PromptInput({ selectedFramework, onSubmit }: PromptInputProps) { const [prompt, setPrompt] = useState(''); const handleSubmit = () => { const framework = selectedFramework || detectFramework(prompt); onSubmit(prompt, framework); }; return ( <div className="max-w-3xl mx-auto px-4 py-8"> <div className="mb-6"> <label className="block text-lg font-medium mb-2"> Describe what you need in your own words </label> <Textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are performing best..." rows={6} className="text-base" /> </div> <Button onClick={handleSubmit} disabled={prompt.trim().length < 10} size="lg" className="w-full" > Continue โ†’ </Button> {selectedFramework && ( <p className="text-sm text-muted-foreground mt-4 text-center"> Using {frameworkDetection[selectedFramework].title} framework </p> )} </div> ); } TypeScript TypeScriptโ€ข 95 lines 'use client'; import { useState } from 'react'; import { questionSets } from '../lib/questionSets'; import QuestionCard from './QuestionCard'; import { Button } from '@/components/ui/button'; import { Progress } from '@/components/ui/progress'; interface QuestionFlowProps { framework: string; onComplete: (answers: Record<string, string>) => void; } export default function QuestionFlow({ framework, onComplete }: QuestionFlowProps) { const questions = questionSets[framework]; const [currentIndex, setCurrentIndex] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const currentQuestion = questions[currentIndex]; const progress = ((currentIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) => { setAnswers(prev => ({ ...prev, [questionId]: value })); }; const handleNext = () => { // Apply smart default if skipped if (!answers[currentQuestion.id] && currentQuestion.defaultValue) { setAnswers(prev => ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentIndex < questions.length - 1) { setCurrentIndex(prev => prev + 1); } else { // Apply defaults to any remaining unanswered questions const finalAnswers = { ...answers }; questions.forEach(q => { if (!finalAnswers[q.id] && q.defaultValue) { finalAnswers[q.id] = q.defaultValue; } }); onComplete(finalAnswers); } }; const handleBack = () => { if (currentIndex > 0) { setCurrentIndex(prev => prev - 1); } }; return ( <div className="max-w-3xl mx-auto px-4 py-8"> <Progress value={progress} className="mb-8" /> <div className="mb-4 text-sm text-muted-foreground"> Question {currentIndex + 1} of {questions.length} </div> <QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || ''} onChange={(value) => handleAnswer(currentQuestion.id, value)} /> <div className="flex gap-4 mt-8"> {currentIndex > 0 && ( <Button variant="outline" onClick={handleBack} className="flex-1" > โ† Back </Button> )} <Button onClick={handleNext} className="flex-1" > {currentIndex < questions.length - 1 ? 'Next โ†’' : 'Generate Prompt โœจ'} </Button> </div> {!answers[currentQuestion.id] && currentQuestion.defaultValue && ( <p className="text-sm text-muted-foreground mt-4 text-center"> ๐Ÿ’ก Tip: Skip this if unsureโ€”we'll use a smart default </p> )} </div> ); } TypeScript TypeScriptโ€ข 42 lines 'use client'; import { Textarea } from '@/components/ui/textarea'; import MultipleChoice from './MultipleChoice'; import Tooltip from './Tooltip'; interface QuestionCardProps { question: any; value: string; onChange: (value: string) => void; } export default function QuestionCard({ question, value, onChange }: QuestionCardProps) { return ( <div className="bg-card rounded-lg border p-6"> <div className="flex items-start justify-between mb-4"> <label className="text-lg font-medium"> {question.label} {question.required && <span className="text-destructive ml-1">*</span>} </label> <Tooltip content={question.tooltip} /> </div> {question.type === 'textarea' ? ( <Textarea value={value} onChange={(e) => onChange(e.target.value)} placeholder={question.placeholder} rows={4} className="text-base" /> ) : question.type === 'multiple-choice' ? ( <MultipleChoice options={question.options} value={value} onChange={onChange} /> ) : null} </div> ); } TypeScript TypeScriptโ€ข 118 lines 'use client'; import { Card } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Copy, Check } from 'lucide-react'; import { useState } from 'react'; import ImprovementsList from './ImprovementsList'; interface BeforeAfterProps { original: string; professional: string; improvements: Array<{ added: string; why: string }>; frameworkName: string; onStartNew: () => void; } export default function BeforeAfter({ original, professional, improvements, frameworkName, onStartNew }: BeforeAfterProps) { const [copied, setCopied] = useState(false); const handleCopy = async () => { await navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-7xl mx-auto px-4 py-12"> <div className="text-center mb-8"> <div className="inline-block bg-green-100 text-green-800 px-4 py-2 rounded-full mb-4"> โœ“ Your professional prompt is ready! </div> <h2 className="text-3xl font-bold mb-2">Before & After</h2> <p className="text-muted-foreground">Using {frameworkName}</p> </div> {/* Desktop: Side by side */} <div className="hidden md:grid md:grid-cols-2 gap-6 mb-8"> <Card className="p-6"> <h3 className="text-lg font-semibold mb-4 text-muted-foreground"> Your Original Prompt </h3> <div className="text-sm whitespace-pre-wrap bg-muted p-4 rounded"> {original} </div> </Card> <Card className="p-6 border-2 border-primary"> <div className="flex items-center justify-between mb-4"> <h3 className="text-lg font-semibold text-primary"> โœจ Professional Version </h3> <Button onClick={handleCopy} size="sm" variant="outline" > {copied ? <Check className="w-4 h-4 mr-2" /> : <Copy className="w-4 h-4 mr-2" />} {copied ? 'Copied!' : 'Copy'} </Button> </div> <div className="text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium"> {professional} </div> </Card> </div> {/* Mobile: Stacked */} <div className="md:hidden space-y-6 mb-8"> <Card className="p-6"> <h3 className="text-lg font-semibold mb-4 text-muted-foreground"> Your Original Prompt </h3> <div className="text-sm whitespace-pre-wrap bg-muted p-4 rounded"> {original} </div> </Card> <Card className="p-6 border-2 border-primary"> <div className="flex items-center justify-between mb-4"> <h3 className="text-lg font-semibold text-primary"> โœจ Professional Version </h3> <Button onClick={handleCopy} size="sm" variant="outline" > {copied ? <Check className="w-4 h-4 mr-2" /> : <Copy className="w-4 h-4 mr-2" />} {copied ? 'Copied!' : 'Copy'} </Button> </div> <div className="text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium"> {professional} </div> </Card> </div> {/* Learning Mode: Improvements */} <ImprovementsList improvements={improvements} /> {/* Action Buttons */} <div className="flex flex-col sm:flex-row gap-4 justify-center mt-8"> <Button onClick={onStartNew} size="lg"> Create Another Prompt </Button> <Button onClick={handleCopy} variant="outline" size="lg"> {copied ? 'Copied!' : 'Copy to Clipboard'} </Button> </div> </div> ); } TypeScript TypeScriptโ€ข 35 lines 'use client'; import { Card } from '@/components/ui/card'; import { Lightbulb } from 'lucide-react'; interface ImprovementsListProps { improvements: Array<{ added: string; why: string }>; } export default function ImprovementsList({ improvements }: ImprovementsListProps) { return ( <Card className="p-6 bg-blue-50 border-blue-200"> <div className="flex items-center gap-2 mb-4"> <Lightbulb className="w-5 h-5 text-blue-600" /> <h3 className="text-lg font-semibold text-blue-900"> What Makes This Prompt Professional? </h3> </div> <div className="space-y-3"> {improvements.map((item, index) => ( <div key={index} className="flex gap-3"> <div className="flex-shrink-0 w-6 h-6 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm font-bold"> {index + 1} </div> <div> <div className="font-medium text-blue-900">{item.added}</div> <div className="text-sm text-blue-700">{item.why}</div> </div> </div> ))} </div> </Card> ); } TypeScript TypeScriptโ€ข 100 lines 'use client'; interface AnalyticsEvent { event: string; framework?: string; completed?: boolean; timestamp: number; } export function trackFrameworkSelection(framework: string) { if (typeof window === 'undefined') return; // Send to your analytics service (Google Analytics, Plausible, etc.) if (window.gtag) { window.gtag('event', 'framework_selected', { framework: framework, page: '/prompt-generator' }); } // Also store locally for admin dashboard saveToLocalAnalytics({ event: 'framework_selected', framework, timestamp: Date.now() }); } export function trackPromptCompleted(framework: string) { if (typeof window === 'undefined') return; if (window.gtag) { window.gtag('event', 'prompt_completed', { framework: framework, page: '/prompt-generator' }); } saveToLocalAnalytics({ event: 'prompt_completed', framework, completed: true, timestamp: Date.now() }); } export function trackPromptCopied(framework: string) { if (typeof window === 'undefined') return; if (window.gtag) { window.gtag('event', 'prompt_copied', { framework: framework, page: '/prompt-generator' }); } } function saveToLocalAnalytics(event: AnalyticsEvent) { // Store in localStorage for simple analytics dashboard const key = 'prompt_generator_analytics'; const existing = localStorage.getItem(key); const data = existing ? JSON.parse(existing) : []; data.push(event); // Keep only last 1000 events if (data.length > 1000) { data.shift(); } localStorage.setItem(key, JSON.stringify(data)); } // Admin dashboard helper export function getAnalyticsSummary() { if (typeof window === 'undefined') return null; const key = 'prompt_generator_analytics'; const data = localStorage.getItem(key); if (!data) return null; const events = JSON.parse(data); const summary = { totalSessions: events.filter(e => e.event === 'framework_selected').length, completedPrompts: events.filter(e => e.event === 'prompt_completed').length, frameworkUsage: { ICDF: events.filter(e => e.framework === 'ICDF').length, RCREOC: events.filter(e => e.framework === 'RCREOC').length, MICRO: events.filter(e => e.framework === 'MICRO').length, COSTAR: events.filter(e => e.framework === 'COSTAR').length }, completionRate: 0 }; summary.completionRate = summary.totalSessions > 0 ? (summary.completedPrompts / summary.totalSessions) * 100 : 0; return summary; } TypeScript TypeScriptโ€ข 85 lines 'use client'; import { useState } from 'react'; import QuickStartWizard from './components/QuickStartWizard'; import PromptInput from './components/PromptInput'; import QuestionFlow from './components/QuestionFlow'; import BeforeAfter from './components/BeforeAfter'; import { generateComparison } from './lib/promptTemplates'; import { trackFrameworkSelection, trackPromptCompleted } from './lib/analytics'; type Step = 'wizard' | 'input' | 'questions' | 'result'; export default function PromptGeneratorPage() { const [step, setStep] = useState<Step>('wizard'); const [selectedFramework, setSelectedFramework] = useState<string | null>(null); const [originalPrompt, setOriginalPrompt] = useState(''); const [answers, setAnswers] = useState<Record<string, string>>({}); const [result, setResult] = useState<any>(null); const handleFrameworkSelect = (framework: string) => { setSelectedFramework(framework); setStep('input'); trackFrameworkSelection(framework); }; const handlePromptSubmit = (prompt: string, detectedFramework: string) => { setOriginalPrompt(prompt); setSelectedFramework(detectedFramework); setStep('questions'); }; const handleQuestionsComplete = (questionAnswers: Record<string, string>) => { setAnswers(questionAnswers); const comparison = generateComparison( originalPrompt, selectedFramework!, questionAnswers ); setResult(comparison); setStep('result'); trackPromptCompleted(selectedFramework!); }; const handleStartNew = () => { setStep('wizard'); setSelectedFramework(null); setOriginalPrompt(''); setAnswers({}); setResult(null); }; return ( <div className="min-h-screen bg-background"> {step === 'wizard' && ( <QuickStartWizard onSelect={handleFrameworkSelect} /> )} {step === 'input' && ( <PromptInput selectedFramework={selectedFramework || undefined} onSubmit={handlePromptSubmit} /> )} {step === 'questions' && selectedFramework && ( <QuestionFlow framework={selectedFramework} onComplete={handleQuestionsComplete} /> )} {step === 'result' && result && ( <BeforeAfter original={result.original} professional={result.professional} improvements={result.improvements} frameworkName={result.frameworkName} onStartNew={handleStartNew} /> )} </div> ); } TypeScript TypeScriptโ€ข 49 lines export interface Framework { keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: QuestionOption[]; } export interface QuestionOption { value: string; label: string; hasTextField?: boolean; } export interface PromptComparison { original: string; professional: string; improvements: Improvement[]; framework: string; frameworkName: string; } export interface Improvement { added: string; why: string; } export interface AnalyticsSummary { totalSessions: number; completedPrompts: number; frameworkUsage: { ICDF: number; RCREOC: number; MICRO: number; COSTAR: number; }; completionRate: number; } TypeScript TypeScriptโ€ข 7 lines // In your navigation component const navItems = [ { name: 'Photo Tools', href: '/' }, { name: 'AI Prompt Generator', href: '/prompt-generator' }, // NEW { name: 'Blog', href: '/blog' }, // ... other items ]; TypeScript TypeScriptโ€ข 21 lines // app/prompt-generator/layout.tsx import type { Metadata } from 'next'; export const metadata: Metadata = { title: 'AI Prompt Generator | Modern Photo Tools', description: 'Transform your simple AI ideas into professional prompts using proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Free tool for better AI results.', keywords: ['AI prompts', 'prompt engineering', 'ChatGPT prompts', 'Midjourney prompts', 'AI tools'], openGraph: { title: 'AI Prompt Generator - Get Professional Results', description: 'Free tool that transforms amateur prompts into professional-grade AI instructions', type: 'website', } }; export default function PromptGeneratorLayout({ children, }: { children: React.ReactNode; }) { return <>{children}</>; } Used 113 credits javascript return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: 'ICDF Framework (Instruction, Context, Data, Format)', RCREOC: 'RCREOC Framework (Role, Context, Request, Examples, Output, Constraints)', MICRO: 'MICRO Framework (Message, Intention, Context, Rhythm, Output)', COSTAR: 'COSTAR Framework (Context, Offer, Style, Target, Action, Result)' }; return names[framework]; } 6. Database Schema Since this is a no-login, free tool, we only need minimal tracking for analytics. prisma // Add to your existing schema.prisma model PromptGeneration { id String @id @default(cuid()) // Analytics data framework String // ICDF, RCREOC, MICRO, COSTAR completed Boolean @default(false) // Anonymized tracking sessionId String // Browser fingerprint or session ID ipHash String? // Hashed IP for rate limiting // Metadata createdAt DateTime @default(now()) userAgent String? @@index([framework]) @@index([createdAt]) @@index([ipHash]) } model PromptAnalytics { id String @id @default(cuid()) date DateTime @default(now()) // Daily aggregates totalGenerations Int @default(0) icdfCount Int @default(0) rcreocCount Int @default(0) microCount Int @default(0) costarCount Int @default(0) completionRate Float @default(0) // Percentage who completed vs abandoned @@unique([date]) } 7. File Structure src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page with wizard โ”‚ โ”œโ”€โ”€ layout.tsx # Shares main site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-button framework selector โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionnaireFlow.tsx # Adaptive question system โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover tooltip component โ”‚ โ””โ”€โ”€ FrameworkIcon.tsx # Visual icons for each framework โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworks.ts # Framework definitions & questions โ”‚ โ”œโ”€โ”€ detection.ts # Keyword detection logic โ”‚ โ”œโ”€โ”€ templates.ts # Prompt assembly templates โ”‚ โ”œโ”€โ”€ analytics.ts # Analytics tracking functions โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ generate/ โ”‚ โ””โ”€โ”€ route.ts # POST: Generate professional prompt โ””โ”€โ”€ analytics/ โ””โ”€โ”€ route.ts # POST: Track usage (anonymous) 8. Component Specifications 8.1 QuickStartWizard Component tsx // src/app/prompt-generator/components/QuickStartWizard.tsx import { frameworkDetection } from '@/lib/prompt-generator/frameworks'; interface WizardCardProps { framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; onSelect: (framework: string) => void; } const WizardCard: React.FC<WizardCardProps> = ({ framework, onSelect }) => { const config = frameworkDetection[framework]; return ( <button onClick={() => onSelect(framework)} className="group relative p-8 rounded-xl border-2 border-gray-200 hover:border-blue-500 transition-all duration-300 hover:shadow-xl bg-white" style={{ '--accent-color': config.color } as React.CSSProperties} > {/* Icon */} <div className="text-6xl mb-4 group-hover:scale-110 transition-transform"> {config.icon} </div> {/* Title */} <h3 className="text-2xl font-bold mb-2 text-gray-900"> {config.title} </h3> {/* Subtitle */} <p className="text-gray-600 mb-4"> {config.subtitle} </p> {/* Framework Badge */} <div className="inline-block px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-700"> {framework} Framework </div> {/* Hover Effect */} <div className="absolute inset-0 rounded-xl bg-gradient-to-br from-blue-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" /> </button> ); }; export const QuickStartWizard: React.FC = () => { const frameworks: Array<'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'> = ['ICDF', 'RCREOC', 'MICRO', 'COSTAR']; return ( <div className="max-w-6xl mx-auto px-4 py-16"> {/* Header */} <div className="text-center mb-12"> <h1 className="text-5xl font-bold mb-4 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> Transform your simple AI ideas into professional-grade prompts in 60 seconds </p> </div> {/* Wizard Cards Grid */} <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> {frameworks.map(framework => ( <WizardCard key={framework} framework={framework} onSelect={(fw) => { // Navigate to questionnaire with selected framework window.location.href = `/prompt-generator?framework=${fw}`; }} /> ))} </div> {/* Alternative: "Not Sure?" Option */} <div className="mt-12 text-center"> <p className="text-gray-600 mb-4">Not sure which framework to use?</p> <button className="px-6 py-3 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors font-medium" onClick={() => { // Show prompt input for auto-detection window.location.href = '/prompt-generator?mode=auto'; }} > Describe your goal and we'll suggest the best framework </button> </div> </div> ); }; 8.2 PromptInput Component tsx // src/app/prompt-generator/components/PromptInput.tsx import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/detection'; import { frameworkDetection } from '@/lib/prompt-generator/frameworks'; interface PromptInputProps { preselectedFramework?: string; onSubmit: (prompt: string, framework: string) => void; } export const PromptInput: React.FC<PromptInputProps> = ({ preselectedFramework, onSubmit }) => { const [prompt, setPrompt] = useState(''); const [detectedFramework, setDetectedFramework] = useState<string | null>(null); const handlePromptChange = (value: string) => { setPrompt(value); // Auto-detect framework as user types (if not preselected) if (!preselectedFramework && value.length > 20) { const detected = detectFramework(value); setDetectedFramework(detected); } }; const handleSubmit = () => { const framework = preselectedFramework || detectedFramework || 'MICRO'; onSubmit(prompt, framework); }; const config = frameworkDetection[detectedFramework || preselectedFramework || 'MICRO']; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Framework Badge (if detected) */} {detectedFramework && !preselectedFramework && ( <div className="mb-4 p-4 bg-blue-50 rounded-lg border border-blue-200"> <div className="flex items-center gap-3"> <span className="text-3xl">{config.icon}</span> <div> <p className="font-semibold text-blue-900"> Detected: {config.title} </p> <p className="text-sm text-blue-700"> We'll use the {detectedFramework} framework for your prompt </p> </div> </div> </div> )} {/* Prompt Textarea */} <div className="mb-6"> <label className="block text-lg font-semibold mb-3 text-gray-900"> {preselectedFramework ? `Describe what you need (${config.title})` : 'Describe what you need in your own words'} </label> <textarea value={prompt} onChange={(e) => handlePromptChange(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are most popular..." className="w-full h-40 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none text-lg" autoFocus /> <p className="mt-2 text-sm text-gray-500"> {prompt.length} characters โ€ข Be as specific as possible </p> </div> {/* Submit Button */} <button onClick={handleSubmit} disabled={prompt.length < 10} className="w-full py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg text-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all shadow-lg hover:shadow-xl" > Continue to Questions โ†’ </button> </div> ); }; 8.3 QuestionnaireFlow Component tsx // src/app/prompt-generator/components/QuestionnaireFlow.tsx import { useState } from 'react'; import { QuestionCard } from './QuestionCard'; import { getQuestions } from '@/lib/prompt-generator/frameworks'; interface QuestionnaireFlowProps { framework: string; initialPrompt: string; onComplete: (answers: Record<string, string>) => void; } export const QuestionnaireFlow: React.FC<QuestionnaireFlowProps> = ({ framework, initialPrompt, onComplete }) => { const questions = getQuestions(framework); const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const handleAnswer = (questionId: string, answer: string) => { const newAnswers = { ...answers, [questionId]: answer }; setAnswers(newAnswers); // Auto-advance to next question if (currentQuestion < questions.length - 1) { setTimeout(() => setCurrentQuestion(currentQuestion + 1), 300); } else { // All questions answered onComplete(newAnswers); } }; const handleSkip = (questionId: string) => { const question = questions[currentQuestion]; const defaultAnswer = question.defaultValue || ''; handleAnswer(questionId, defaultAnswer); }; const progress = ((currentQuestion + 1) / questions.length) * 100; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Progress Bar */} <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 mb-2"> <span>Question {currentQuestion + 1} of {questions.length}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full h-2 bg-gray-200 rounded-full overflow-hidden"> <div className="h-full bg-gradient-to-r from-blue-600 to-purple-600 transition-all duration-500" style={{ width: `${progress}%` }} /> </div> </div> {/* Current Question */} <QuestionCard question={questions[currentQuestion]} onAnswer={handleAnswer} onSkip={handleSkip} /> {/* Navigation */} {currentQuestion > 0 && ( <button onClick={() => setCurrentQuestion(currentQuestion - 1)} className="mt-6 text-blue-600 hover:text-blue-700 font-medium" > โ† Previous Question </button> )} </div> ); }; 8.4 QuestionCard Component tsx // src/app/prompt-generator/components/QuestionCard.tsx import { useState } from 'react'; import { LearningTooltip } from './LearningTooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: Array<{ value: string; label: string; hasTextField?: boolean; }>; } interface QuestionCardProps { question: Question; onAnswer: (questionId: string, answer: string) => void; onSkip: (questionId: string) => void; } export const QuestionCard: React.FC<QuestionCardProps> = ({ question, onAnswer, onSkip }) => { const [answer, setAnswer] = useState(''); const [selectedOption, setSelectedOption] = useState(''); const [customText, setCustomText] = useState(''); const handleSubmit = () => { let finalAnswer = answer; if (question.type === 'multiple-choice') { const selected = question.options?.find(opt => opt.value === selectedOption); if (selected?.hasTextField && customText) { finalAnswer = customText; } else { finalAnswer = selected?.label || selectedOption; } } if (finalAnswer.trim()) { onAnswer(question.id, finalAnswer); } }; return ( <div className="bg-white rounded-xl shadow-lg p-8 border border-gray-200"> {/* Question Label with Tooltip */} <div className="flex items-start justify-between mb-6"> <h3 className="text-2xl font-bold text-gray-900 flex-1"> {question.label} {!question.required && ( <span className="ml-2 text-sm font-normal text-gray-500"> (Optional) </span> )} </h3> <LearningTooltip content={question.tooltip} /> </div> {/* Question Input */} {question.type === 'textarea' ? ( <textarea value={answer} onChange={(e) => setAnswer(e.target.value)} placeholder={question.placeholder} className="w-full h-32 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none" autoFocus /> ) : ( <div className="space-y-3"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => setSelectedOption(option.value)} className={`w-full p-4 rounded-lg border-2 text-left transition-all ${selectedOption === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-300 hover:border-gray-400' }`} > {option.label} </button> {/* Custom Text Field */} {option.hasTextField && selectedOption === option.value && ( <input type="text" value={customText} onChange={(e) => setCustomText(e.target.value)} placeholder="Specify..." className="mt-2 w-full p-3 border-2 border-gray-300 rounded-lg focus:border-blue-500" autoFocus /> )} </div> ))} </div> )} {/* Action Buttons */} <div className="flex gap-4 mt-6"> <button onClick={handleSubmit} disabled={ question.type === 'textarea' ? !answer.trim() : !selectedOption || ( question.options?.find(o => o.value === selectedOption)?.hasTextField && !customText ) } className="flex-1 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all" > {question.required ? 'Continue' : 'Continue'} </button> {!question.required && ( <button onClick={() => onSkip(question.id)} className="px-6 py-3 border-2 border-gray-300 rounded-lg hover:bg-gray-50 transition-colors font-medium" > Skip </button> )} </div> </div> ); }; 8.5 LearningTooltip Component tsx // src/app/prompt-generator/components/LearningTooltip.tsx import { useState } from 'react'; interface LearningTooltipProps { content: string; } export const LearningTooltip: React.FC<LearningTooltipProps> = ({ content }) => { const [isVisible, setIsVisible] = useState(false); return ( <div className="relative"> <button onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)} onClick={() => setIsVisible(!isVisible)} className="w-6 h-6 rounded-full bg-blue-100 text-blue-600 hover:bg-blue-200 transition-colors flex items-center justify-center text-sm font-bold" aria-label="Learn more" > ? </button> {isVisible && ( <div className="absolute right-0 top-8 w-72 p-4 bg-gray-900 text-white rounded-lg shadow-xl z-50 text-sm leading-relaxed"> <div className="absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45" /> {content} </div> )} </div> ); }; 8.6 BeforeAfterComparison Component tsx // src/app/prompt-generator/components/BeforeAfterComparison.tsx import { useState } from 'react'; import { Copy, Check, RotateCcw } from 'lucide-react'; interface BeforeAfterComparisonProps { original: string; professional: string; improvements: Array<{ added: string; why: string }>; frameworkName: string; onStartNew: () => void; } export const BeforeAfterComparison: React.FC<BeforeAfterComparisonProps> = ({ original, professional, improvements, frameworkName, onStartNew }) => { const [copied, setCopied] = useState(false); const handleCopy = () => { navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-7xl mx-auto px-4 py-12"> {/* Success Header */} <div className="text-center mb-12"> <div className="inline-block p-3 bg-green-100 rounded-full mb-4"> <Check className="w-8 h-8 text-green-600" /> </div> <h2 className="text-4xl font-bold mb-2"> Your Professional Prompt is Ready! </h2> <p className="text-gray-600"> Using the {frameworkName} </p> </div> {/* Before/After Comparison */} <div className="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-12"> {/* Before (Original) */} <div className="bg-gray-50 rounded-xl p-6 border border-gray-200"> <div className="flex items-center gap-2 mb-4"> <div className="w-3 h-3 rounded-full bg-gray-400" /> <h3 className="font-bold text-gray-700">Your Original Prompt</h3> </div> <div className="bg-white p-4 rounded-lg border border-gray-300 text-gray-600 whitespace-pre-wrap font-mono text-sm"> {original} </div> </div> {/* After (Professional) */} <div className="bg-gradient-to-br from-blue-50 to-purple-50 rounded-xl p-6 border-2 border-blue-300"> <div className="flex items-center justify-between mb-4"> <div className="flex items-center gap-2"> <div className="w-3 h-3 rounded-full bg-blue-500" /> <h3 className="font-bold text-blue-900">Professional Version</h3> </div> <button onClick={handleCopy} className="flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" > {copied ? ( <> <Check className="w-4 h-4" /> Copied! </> ) : ( <> <Copy className="w-4 h-4" /> Copy </> )} </button> </div> <div className="bg-white p-4 rounded-lg border border-blue-200 text-gray-900 whitespace-pre-wrap font-mono text-sm"> {professional} </div> </div> </div> {/* Learning Mode: What Improved */} <div className="bg-white rounded-xl p-8 border border-gray-200 mb-8"> <h3 className="text-2xl font-bold mb-6 flex items-center gap-2"> <span className="text-2xl">๐Ÿ’ก</span> What Makes This Prompt Professional? </h3> <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> {improvements.map((improvement, index) => ( <div key={index} className="p-4 bg-blue-50 rounded-lg border border-blue-200" > <div className="font-bold text-blue-900 mb-2"> โœ“ Added: {improvement.added} </div> <div className="text-sm text-blue-700"> {improvement.why} </div> </div> ))} </div> </div> {/* Action Buttons */} <div className="flex flex-col sm:flex-row gap-4 justify-center"> <button onClick={onStartNew} className="flex items-center justify-center gap-2 px-8 py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg" > <RotateCcw className="w-5 h-5" /> Create Another Prompt </button> <button onClick={handleCopy} className="px-8 py-4 border-2 border-blue-600 text-blue-600 font-bold rounded-lg hover:bg-blue-50 transition-colors" > Copy and Close </button> </div> </div> ); }; 9. API Routes 9.1 Generate Prompt API typescript // src/app/api/prompt-generator/generate/route.ts import { NextRequest, NextResponse } from 'next/server'; import { generateComparison } from '@/lib/prompt-generator/templates'; import { trackGeneration } from '@/lib/prompt-generator/analytics'; export async function POST(req: NextRequest) { try { const { originalPrompt, framework, answers } = await req.json(); // Validate input if (!originalPrompt || !framework || !answers) { return NextResponse.json( { error: 'Missing required fields' }, { status: 400 } ); } // Generate the professional prompt const result = generateComparison(originalPrompt, framework, answers); // Track analytics (anonymous) await trackGeneration({ framework, completed: true, ipHash: hashIP(req.ip || 'unknown'), userAgent: req.headers.get('user-agent') || undefined }); return NextResponse.json(result); } catch (error) { console.error('Prompt generation error:', error); return NextResponse.json( { error: 'Failed to generate prompt' }, { status: 500 } ); } } function hashIP(ip: string): string { // Simple hash for privacy (use crypto in production) return Buffer.from(ip).toString('base64'); } 9.2 Analytics API typescript // src/app/api/prompt-generator/analytics/route.ts import { NextRequest, NextResponse } from 'next/server'; import { prisma } from '@/lib/prisma'; export async function POST(req: NextRequest) { try { const { framework, completed } = await req.json(); // Rate limiting check const ipHash = hashIP(req.ip || 'unknown'); const recentGenerations = await prisma.promptGeneration.count({ where: { ipHash, createdAt: { gte: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours } } }); if (recentGenerations >= 20) { return NextResponse.json( { error: 'Rate limit exceeded. Please try again tomorrow.' }, { status: 429 } ); } // Track generation await prisma.promptGeneration.create({ data: { framework, completed, ipHash, sessionId: req.cookies.get('session')?.value || 'unknown', userAgent: req.headers.get('user-agent') } }); // Update daily aggregates const today = new Date(); today.setHours(0, 0, 0, 0); await prisma.promptAnalytics.upsert({ where: { date: today }, update: { totalGenerations: { increment: 1 }, [`${framework.toLowerCase()}Count`]: { increment: 1 } }, create: { date: today, totalGenerations: 1, [`${framework.toLowerCase()}Count`]: 1 } }); return NextResponse.json({ success: true }); } catch (error) { console.error('Analytics tracking error:', error); return NextResponse.json( { error: 'Failed to track analytics' }, { status: 500 } ); } } function hashIP(ip: string): string { return Buffer.from(ip).toString('base64'); } 10. Main Page Implementation tsx // src/app/prompt-generator/page.tsx 'use client'; import { useState } from 'react'; import { useSearchParams } from 'next/navigation'; import { QuickStartWizard } from './components/QuickStartWizard'; import { PromptInput } from './components/PromptInput'; import { QuestionnaireFlow } from './components/QuestionnaireFlow'; import { BeforeAfterComparison } from './components/BeforeAfterComparison'; type Step = 'wizard' | 'input' | 'questionnaire' | 'result'; export default function PromptGeneratorPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams?.get('framework'); const mode = searchParams?.get('mode'); const [step, setStep] = useState<Step>( preselectedFramework ? 'input' : mode === 'auto' ? 'input' : 'wizard' ); const [framework, setFramework] = useState<string>(preselectedFramework || ''); const [originalPrompt, setOriginalPrompt] = useState(''); const [result, setResult] = useState<any>(null); const handlePromptSubmit = (prompt: string, detectedFramework: string) => { setOrig JavaScript JavaScriptโ€ข 12 lines return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: 'ICDF Framework (Instruction, Context, Data, Format)', RCREOC: 'RCREOC Framework (Role, Context, Request, Examples, Output, Constraints)', MICRO: 'MICRO Framework (Message, Intention, Context, Rhythm, Output)', COSTAR: 'COSTAR Framework (Context, Offer, Style, Target, Action, Result)' }; return names[framework]; } This code can be executed in the preview sandbox Run Code PRISMA Code PRISMAโ€ข 37 lines // Add to your existing schema.prisma model PromptGeneration { id String @id @default(cuid()) // Analytics data framework String // ICDF, RCREOC, MICRO, COSTAR completed Boolean @default(false) // Anonymized tracking sessionId String // Browser fingerprint or session ID ipHash String? // Hashed IP for rate limiting // Metadata createdAt DateTime @default(now()) userAgent String? @@index([framework]) @@index([createdAt]) @@index([ipHash]) } model PromptAnalytics { id String @id @default(cuid()) date DateTime @default(now()) // Daily aggregates totalGenerations Int @default(0) icdfCount Int @default(0) rcreocCount Int @default(0) microCount Int @default(0) costarCount Int @default(0) completionRate Float @default(0) // Percentage who completed vs abandoned @@unique([date]) } Code Snippet 3 Plain Textโ€ข 28 lines src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page with wizard โ”‚ โ”œโ”€โ”€ layout.tsx # Shares main site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-button framework selector โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionnaireFlow.tsx # Adaptive question system โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover tooltip component โ”‚ โ””โ”€โ”€ FrameworkIcon.tsx # Visual icons for each framework โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworks.ts # Framework definitions & questions โ”‚ โ”œโ”€โ”€ detection.ts # Keyword detection logic โ”‚ โ”œโ”€โ”€ templates.ts # Prompt assembly templates โ”‚ โ”œโ”€โ”€ analytics.ts # Analytics tracking functions โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ generate/ โ”‚ โ””โ”€โ”€ route.ts # POST: Generate professional prompt โ””โ”€โ”€ analytics/ โ””โ”€โ”€ route.ts # POST: Track usage (anonymous) TypeScript React React TSXโ€ข 94 lines // src/app/prompt-generator/components/QuickStartWizard.tsx import { frameworkDetection } from '@/lib/prompt-generator/frameworks'; interface WizardCardProps { framework: 'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'; onSelect: (framework: string) => void; } const WizardCard: React.FC<WizardCardProps> = ({ framework, onSelect }) => { const config = frameworkDetection[framework]; return ( <button onClick={() => onSelect(framework)} className="group relative p-8 rounded-xl border-2 border-gray-200 hover:border-blue-500 transition-all duration-300 hover:shadow-xl bg-white" style={{ '--accent-color': config.color } as React.CSSProperties} > {/* Icon */} <div className="text-6xl mb-4 group-hover:scale-110 transition-transform"> {config.icon} </div> {/* Title */} <h3 className="text-2xl font-bold mb-2 text-gray-900"> {config.title} </h3> {/* Subtitle */} <p className="text-gray-600 mb-4"> {config.subtitle} </p> {/* Framework Badge */} <div className="inline-block px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-700"> {framework} Framework </div> {/* Hover Effect */} <div className="absolute inset-0 rounded-xl bg-gradient-to-br from-blue-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" /> </button> ); }; export const QuickStartWizard: React.FC = () => { const frameworks: Array<'ICDF' | 'RCREOC' | 'MICRO' | 'COSTAR'> = ['ICDF', 'RCREOC', 'MICRO', 'COSTAR']; return ( <div className="max-w-6xl mx-auto px-4 py-16"> {/* Header */} <div className="text-center mb-12"> <h1 className="text-5xl font-bold mb-4 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> AI Prompt Generator </h1> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> Transform your simple AI ideas into professional-grade prompts in 60 seconds </p> </div> {/* Wizard Cards Grid */} <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> {frameworks.map(framework => ( <WizardCard key={framework} framework={framework} onSelect={(fw) => { // Navigate to questionnaire with selected framework window.location.href = `/prompt-generator?framework=${fw}`; }} /> ))} </div> {/* Alternative: "Not Sure?" Option */} <div className="mt-12 text-center"> <p className="text-gray-600 mb-4">Not sure which framework to use?</p> <button className="px-6 py-3 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors font-medium" onClick={() => { // Show prompt input for auto-detection window.location.href = '/prompt-generator?mode=auto'; }} > Describe your goal and we'll suggest the best framework </button> </div> </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 90 lines // src/app/prompt-generator/components/PromptInput.tsx import { useState } from 'react'; import { detectFramework } from '@/lib/prompt-generator/detection'; import { frameworkDetection } from '@/lib/prompt-generator/frameworks'; interface PromptInputProps { preselectedFramework?: string; onSubmit: (prompt: string, framework: string) => void; } export const PromptInput: React.FC<PromptInputProps> = ({ preselectedFramework, onSubmit }) => { const [prompt, setPrompt] = useState(''); const [detectedFramework, setDetectedFramework] = useState<string | null>(null); const handlePromptChange = (value: string) => { setPrompt(value); // Auto-detect framework as user types (if not preselected) if (!preselectedFramework && value.length > 20) { const detected = detectFramework(value); setDetectedFramework(detected); } }; const handleSubmit = () => { const framework = preselectedFramework || detectedFramework || 'MICRO'; onSubmit(prompt, framework); }; const config = frameworkDetection[detectedFramework || preselectedFramework || 'MICRO']; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Framework Badge (if detected) */} {detectedFramework && !preselectedFramework && ( <div className="mb-4 p-4 bg-blue-50 rounded-lg border border-blue-200"> <div className="flex items-center gap-3"> <span className="text-3xl">{config.icon}</span> <div> <p className="font-semibold text-blue-900"> Detected: {config.title} </p> <p className="text-sm text-blue-700"> We'll use the {detectedFramework} framework for your prompt </p> </div> </div> </div> )} {/* Prompt Textarea */} <div className="mb-6"> <label className="block text-lg font-semibold mb-3 text-gray-900"> {preselectedFramework ? `Describe what you need (${config.title})` : 'Describe what you need in your own words'} </label> <textarea value={prompt} onChange={(e) => handlePromptChange(e.target.value)} placeholder="e.g., I need to analyze my website traffic to see which blog posts are most popular..." className="w-full h-40 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none text-lg" autoFocus /> <p className="mt-2 text-sm text-gray-500"> {prompt.length} characters โ€ข Be as specific as possible </p> </div> {/* Submit Button */} <button onClick={handleSubmit} disabled={prompt.length < 10} className="w-full py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg text-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all shadow-lg hover:shadow-xl" > Continue to Questions โ†’ </button> </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 78 lines // src/app/prompt-generator/components/QuestionnaireFlow.tsx import { useState } from 'react'; import { QuestionCard } from './QuestionCard'; import { getQuestions } from '@/lib/prompt-generator/frameworks'; interface QuestionnaireFlowProps { framework: string; initialPrompt: string; onComplete: (answers: Record<string, string>) => void; } export const QuestionnaireFlow: React.FC<QuestionnaireFlowProps> = ({ framework, initialPrompt, onComplete }) => { const questions = getQuestions(framework); const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState<Record<string, string>>({}); const handleAnswer = (questionId: string, answer: string) => { const newAnswers = { ...answers, [questionId]: answer }; setAnswers(newAnswers); // Auto-advance to next question if (currentQuestion < questions.length - 1) { setTimeout(() => setCurrentQuestion(currentQuestion + 1), 300); } else { // All questions answered onComplete(newAnswers); } }; const handleSkip = (questionId: string) => { const question = questions[currentQuestion]; const defaultAnswer = question.defaultValue || ''; handleAnswer(questionId, defaultAnswer); }; const progress = ((currentQuestion + 1) / questions.length) * 100; return ( <div className="max-w-3xl mx-auto px-4 py-12"> {/* Progress Bar */} <div className="mb-8"> <div className="flex justify-between text-sm text-gray-600 mb-2"> <span>Question {currentQuestion + 1} of {questions.length}</span> <span>{Math.round(progress)}% Complete</span> </div> <div className="w-full h-2 bg-gray-200 rounded-full overflow-hidden"> <div className="h-full bg-gradient-to-r from-blue-600 to-purple-600 transition-all duration-500" style={{ width: `${progress}%` }} /> </div> </div> {/* Current Question */} <QuestionCard question={questions[currentQuestion]} onAnswer={handleAnswer} onSkip={handleSkip} /> {/* Navigation */} {currentQuestion > 0 && ( <button onClick={() => setCurrentQuestion(currentQuestion - 1)} className="mt-6 text-blue-600 hover:text-blue-700 font-medium" > โ† Previous Question </button> )} </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 143 lines // src/app/prompt-generator/components/QuestionCard.tsx import { useState } from 'react'; import { LearningTooltip } from './LearningTooltip'; interface Question { id: string; type: 'textarea' | 'multiple-choice'; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: Array<{ value: string; label: string; hasTextField?: boolean; }>; } interface QuestionCardProps { question: Question; onAnswer: (questionId: string, answer: string) => void; onSkip: (questionId: string) => void; } export const QuestionCard: React.FC<QuestionCardProps> = ({ question, onAnswer, onSkip }) => { const [answer, setAnswer] = useState(''); const [selectedOption, setSelectedOption] = useState(''); const [customText, setCustomText] = useState(''); const handleSubmit = () => { let finalAnswer = answer; if (question.type === 'multiple-choice') { const selected = question.options?.find(opt => opt.value === selectedOption); if (selected?.hasTextField && customText) { finalAnswer = customText; } else { finalAnswer = selected?.label || selectedOption; } } if (finalAnswer.trim()) { onAnswer(question.id, finalAnswer); } }; return ( <div className="bg-white rounded-xl shadow-lg p-8 border border-gray-200"> {/* Question Label with Tooltip */} <div className="flex items-start justify-between mb-6"> <h3 className="text-2xl font-bold text-gray-900 flex-1"> {question.label} {!question.required && ( <span className="ml-2 text-sm font-normal text-gray-500"> (Optional) </span> )} </h3> <LearningTooltip content={question.tooltip} /> </div> {/* Question Input */} {question.type === 'textarea' ? ( <textarea value={answer} onChange={(e) => setAnswer(e.target.value)} placeholder={question.placeholder} className="w-full h-32 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none" autoFocus /> ) : ( <div className="space-y-3"> {question.options?.map((option) => ( <div key={option.value}> <button onClick={() => setSelectedOption(option.value)} className={`w-full p-4 rounded-lg border-2 text-left transition-all ${selectedOption === option.value ? 'border-blue-500 bg-blue-50' : 'border-gray-300 hover:border-gray-400' }`} > {option.label} </button> {/* Custom Text Field */} {option.hasTextField && selectedOption === option.value && ( <input type="text" value={customText} onChange={(e) => setCustomText(e.target.value)} placeholder="Specify..." className="mt-2 w-full p-3 border-2 border-gray-300 rounded-lg focus:border-blue-500" autoFocus /> )} </div> ))} </div> )} {/* Action Buttons */} <div className="flex gap-4 mt-6"> <button onClick={handleSubmit} disabled={ question.type === 'textarea' ? !answer.trim() : !selectedOption || ( question.options?.find(o => o.value === selectedOption)?.hasTextField && !customText ) } className="flex-1 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all" > {question.required ? 'Continue' : 'Continue'} </button> {!question.required && ( <button onClick={() => onSkip(question.id)} className="px-6 py-3 border-2 border-gray-300 rounded-lg hover:bg-gray-50 transition-colors font-medium" > Skip </button> )} </div> </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 36 lines // src/app/prompt-generator/components/LearningTooltip.tsx import { useState } from 'react'; interface LearningTooltipProps { content: string; } export const LearningTooltip: React.FC<LearningTooltipProps> = ({ content }) => { const [isVisible, setIsVisible] = useState(false); return ( <div className="relative"> <button onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)} onClick={() => setIsVisible(!isVisible)} className="w-6 h-6 rounded-full bg-blue-100 text-blue-600 hover:bg-blue-200 transition-colors flex items-center justify-center text-sm font-bold" aria-label="Learn more" > ? </button> {isVisible && ( <div className="absolute right-0 top-8 w-72 p-4 bg-gray-900 text-white rounded-lg shadow-xl z-50 text-sm leading-relaxed"> <div className="absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45" /> {content} </div> )} </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 137 lines // src/app/prompt-generator/components/BeforeAfterComparison.tsx import { useState } from 'react'; import { Copy, Check, RotateCcw } from 'lucide-react'; interface BeforeAfterComparisonProps { original: string; professional: string; improvements: Array<{ added: string; why: string }>; frameworkName: string; onStartNew: () => void; } export const BeforeAfterComparison: React.FC<BeforeAfterComparisonProps> = ({ original, professional, improvements, frameworkName, onStartNew }) => { const [copied, setCopied] = useState(false); const handleCopy = () => { navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( <div className="max-w-7xl mx-auto px-4 py-12"> {/* Success Header */} <div className="text-center mb-12"> <div className="inline-block p-3 bg-green-100 rounded-full mb-4"> <Check className="w-8 h-8 text-green-600" /> </div> <h2 className="text-4xl font-bold mb-2"> Your Professional Prompt is Ready! </h2> <p className="text-gray-600"> Using the {frameworkName} </p> </div> {/* Before/After Comparison */} <div className="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-12"> {/* Before (Original) */} <div className="bg-gray-50 rounded-xl p-6 border border-gray-200"> <div className="flex items-center gap-2 mb-4"> <div className="w-3 h-3 rounded-full bg-gray-400" /> <h3 className="font-bold text-gray-700">Your Original Prompt</h3> </div> <div className="bg-white p-4 rounded-lg border border-gray-300 text-gray-600 whitespace-pre-wrap font-mono text-sm"> {original} </div> </div> {/* After (Professional) */} <div className="bg-gradient-to-br from-blue-50 to-purple-50 rounded-xl p-6 border-2 border-blue-300"> <div className="flex items-center justify-between mb-4"> <div className="flex items-center gap-2"> <div className="w-3 h-3 rounded-full bg-blue-500" /> <h3 className="font-bold text-blue-900">Professional Version</h3> </div> <button onClick={handleCopy} className="flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" > {copied ? ( <> <Check className="w-4 h-4" /> Copied! </> ) : ( <> <Copy className="w-4 h-4" /> Copy </> )} </button> </div> <div className="bg-white p-4 rounded-lg border border-blue-200 text-gray-900 whitespace-pre-wrap font-mono text-sm"> {professional} </div> </div> </div> {/* Learning Mode: What Improved */} <div className="bg-white rounded-xl p-8 border border-gray-200 mb-8"> <h3 className="text-2xl font-bold mb-6 flex items-center gap-2"> <span className="text-2xl">๐Ÿ’ก</span> What Makes This Prompt Professional? </h3> <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> {improvements.map((improvement, index) => ( <div key={index} className="p-4 bg-blue-50 rounded-lg border border-blue-200" > <div className="font-bold text-blue-900 mb-2"> โœ“ Added: {improvement.added} </div> <div className="text-sm text-blue-700"> {improvement.why} </div> </div> ))} </div> </div> {/* Action Buttons */} <div className="flex flex-col sm:flex-row gap-4 justify-center"> <button onClick={onStartNew} className="flex items-center justify-center gap-2 px-8 py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg" > <RotateCcw className="w-5 h-5" /> Create Another Prompt </button> <button onClick={handleCopy} className="px-8 py-4 border-2 border-blue-600 text-blue-600 font-bold rounded-lg hover:bg-blue-50 transition-colors" > Copy and Close </button> </div> </div> ); }; This code can be executed in the preview sandbox Run Code TypeScript TypeScriptโ€ข 44 lines // src/app/api/prompt-generator/generate/route.ts import { NextRequest, NextResponse } from 'next/server'; import { generateComparison } from '@/lib/prompt-generator/templates'; import { trackGeneration } from '@/lib/prompt-generator/analytics'; export async function POST(req: NextRequest) { try { const { originalPrompt, framework, answers } = await req.json(); // Validate input if (!originalPrompt || !framework || !answers) { return NextResponse.json( { error: 'Missing required fields' }, { status: 400 } ); } // Generate the professional prompt const result = generateComparison(originalPrompt, framework, answers); // Track analytics (anonymous) await trackGeneration({ framework, completed: true, ipHash: hashIP(req.ip || 'unknown'), userAgent: req.headers.get('user-agent') || undefined }); return NextResponse.json(result); } catch (error) { console.error('Prompt generation error:', error); return NextResponse.json( { error: 'Failed to generate prompt' }, { status: 500 } ); } } function hashIP(ip: string): string { // Simple hash for privacy (use crypto in production) return Buffer.from(ip).toString('base64'); } TypeScript TypeScriptโ€ข 69 lines // src/app/api/prompt-generator/analytics/route.ts import { NextRequest, NextResponse } from 'next/server'; import { prisma } from '@/lib/prisma'; export async function POST(req: NextRequest) { try { const { framework, completed } = await req.json(); // Rate limiting check const ipHash = hashIP(req.ip || 'unknown'); const recentGenerations = await prisma.promptGeneration.count({ where: { ipHash, createdAt: { gte: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours } } }); if (recentGenerations >= 20) { return NextResponse.json( { error: 'Rate limit exceeded. Please try again tomorrow.' }, { status: 429 } ); } // Track generation await prisma.promptGeneration.create({ data: { framework, completed, ipHash, sessionId: req.cookies.get('session')?.value || 'unknown', userAgent: req.headers.get('user-agent') } }); // Update daily aggregates const today = new Date(); today.setHours(0, 0, 0, 0); await prisma.promptAnalytics.upsert({ where: { date: today }, update: { totalGenerations: { increment: 1 }, [`${framework.toLowerCase()}Count`]: { increment: 1 } }, create: { date: today, totalGenerations: 1, [`${framework.toLowerCase()}Count`]: 1 } }); return NextResponse.json({ success: true }); } catch (error) { console.error('Analytics tracking error:', error); return NextResponse.json( { error: 'Failed to track analytics' }, { status: 500 } ); } } function hashIP(ip: string): string { return Buffer.from(ip).toString('base64'); }
๐Ÿ“„ README.md
photobybolt_0
๐Ÿ“„ ai image2image.txt
AI Image to Image Overview Welcome to the LightX AI Image to Image API Documentation. The AI Image to Image API transforms your input images into completely new versions. You can adjust features like style, composition, or details while keeping the original image's key elements intact. Itโ€™s perfect for creative projects, marketing visuals, or reimagining photos with a fresh perspective. Discover the Full Guide to Begin! note In strength, the Higher style strength makes the generated image look more like your imageUrl, reducing the strength makes it appear less similar. In styleStrength, the Higher style strength makes the generated image look more like your styleImageUrl, while lower strength makes it look less similar. AI Image to Image API Rollout To access your AI Image to Image API, you need to generate an API key. Visit the LightX API to retrieve your key. Insert your image URL, strength and text prompt or add a style image to generate images. Each generation will cost you 1 credit with the output delivered in JPEG format. note Make sure to use the public image URL for the imageUrl and styleImageUrl to prevent any failure status. Quick Steps to Generate with Your API Going Forward, use cURL along with x-api-key and your API key (as given below) to generate images with AI. Next, proceed to the "Body" tab to configure the request payload according to the required format and input data as required. Finally, click "Send" to submit the request. cURL Method- Post curl --location 'https://api.lightxeditor.com/external/api/v1/image2image' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <Insert your API Key>' \ --data '{ "imageUrl": "https://example.com/your-image.jpg", // Replace with the URL of your input image "strength" : 0.5, // Keep it between 0.0 to 1 "textPrompt": "YourInputPrompt", // Replace with your specific input prompt "styleImageUrl": "https://example.com/your-style-image.jpg", // Replace with the URL of your input style image "styleStrength" : 0.9 // Keep it between 0.0 to 1 }' Once your request is completed, visualize the "Response" to verify that the API call is executed successfully (as given below). Response { "statusCode": 2000, "message": "SUCCESS", "body": { "orderId": "7906da5353b504162db5199d6", "maxRetriesAllowed": 5, "avgResponseTimeInSec": 15, "status": "init" } } orderId: This key is the unique identifier for the order. maxRetriesAllowed: The number of retries a user can attempt when the status is "init". avgResponseTimeInSec: This is the average time the machine can take to generate the output. status: There are three scenarios: "init" = proccessing, "failed" = error. Once your order Id is generated, input it into the status check system to retrieve and review the results of your API Tool (mentioned below). Check Status cURL curl --location --request POST 'https://api.lightxeditor.com/external/api/v1/order-status' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <Insert your API Key>' \ --data '{ "orderId": "insert your Order ID" }' After hitting orderId as request payload in your check status make sure you make a subsequent API call which means, in every 3 seconds you can hit until you get "status": "active" note The maximum time for receiving output is 15 seconds. You are allowed up to 5 retries for checking the status, with each API call being made every 3 seconds. You need to repeatedly call this API up to 5 times until you receive a status of as active/failed. In case of failed status, no credit will be deducted. When the status is "active," the relevant output will be included in the output attribute of the response. Output { "statusCode": 2000, "message": "SUCCESS", "body": { "orderId": "7906da5353b504162db5199d6", "status": "active", "output": "https://example.com/your-outputimage.jpg" } }
๐Ÿ“„ blog.txt
The problem isn't the AI. It's how you're talking to it. Why Your Prompts Fail An AI can't read your mind. It understands what you *write*, not what you *think*. A vague question gets a vague answer. A specific, detailed prompt gets a specific, detailed result. This is the entire secret to "prompt engineering." The Vague Prompt You ask a coworker, "How's it going?" Prompt: "Analyze this sales data." Result: A generic, unhelpful summary. You get a list of numbers, but no insights and no direction. The Pro Prompt You ask, "Where are we on the Q3 report for the exec meeting tomorrow?" Prompt: "Analyze the attached Q3 sales data for our marketing meeting. I need to identify the top-performing product and the product with the sharpest decline. Format the analysis as a 3-section email..." Result: A detailed, actionable report in the exact format you need. Use a Framework, Not a Guess Professionals don't guess. They use frameworksโ€”structured templatesโ€”to ensure every prompt contains all the information an AI needs. Here are the four frameworks you can use to get expert results, every time. Secret 1: The ICDF Framework This is the perfect framework for daily tasks and data analysis. It ensures you provide a complete request. Most users only provide the "Instruction," leading to incomplete results. I - Instruction: What is the core task? (e.g., "Analyze...") C - Context: Why do you need this? Who is it for? (e.g., "For a marketing meeting...") D - Data: What data should it use? (e.g., "Use the attached file...") F - Format: How should it be presented? (e.g., "As a 3-section email...") Example: Analyzing Sales Data [Instruction] Analyze the attached sales data. [Context] I need to present a monthly summary to my manager for our marketing team meeting. The goal is to identify our top-performing product and the product with the most significant drop. [Data] The data includes product names, units sold, and revenue for July, August, and September. [Format] Present the analysis as a clean, bulleted list with three clear sections: 1. Top Performing Products, 2. Underperforming Products, and 3. Short Recommendations. Secret 2: The RCREOC Framework Use this to turn the AI from a simple tool into an expert "AI Agent" that works for you by giving it a specific job. The "AI Agent" Workflow Role โ†’ Context โ†’ Request โ†’ Examples โ†’ Output โ†’ Constraints R - Role: Who is the AI? (e.g., "You are an expert Assistant Project Manager...") C - Context: What is the situation? (e.g., "You review weekly reports...") R - Request: What is the specific task? (e.g., "Extract recurring problems...") E - Examples: Show it what a good answer looks like. O - Output: What is the final format? (e.g., "A table with 3 columns...") C - Constraints: What are the rules? (e.g., "Each entry must be less than 3 lines...") Example: Analyzing Team Reports [Role] You are an Assistant Project Manager on a tech team. [Context] Your job is to review weekly reports to find problems and solutions. [Request] Review this report and extract: 1. Recurring issues, 2. Team suggestions, 3. Your recommendations. [Output] Format as a 3-column table: 'Issue', 'Proposed Solution', 'Recommendation'. [Constraints] Each entry must be under 3 lines. Secret 3: The MICRO Framework This is the ultimate framework for all content creation, from blog posts to video scripts. A great piece of content balances all axes. M - Message: What is the core takeaway? I - Intention: What is the goal? (Persuade, inform, motivate...) C - Context (Audience): Who is this for? R - Rhythm (Tone): What is the style? (Formal, funny, motivational...) O - Output: What is the final format? (Blog post, 5-min video script...) Example: Writing a YouTube Script [Output] Write a 5-minute YouTube script with an intro, body, and conclusion. [Message] Help college students organize their study time effectively. [Intention] Persuade students that AI is a tool for success, not for cutting corners. [Context/Audience] US college students who are stressed and want realistic solutions. [Rhythm/Tone] Fast-paced, encouraging, and motivational. Secret 4: The COSTAR Framework This framework makes the AI think like a professional marketer. Perfect for emails, ads, and landing pages. The Marketing Funnel Workflow Context โ†’ Offer โ†’ Style โ†’ Target โ†’ Action โ†’ Result C - Context: What is this for? (e.g., "A marketing email...") O - Offer: What is the promotion? (e.g., "25% off for 72 hours...") S - Style: What is the tone? (e.g., "Simple, warm, and helpful...") T - Target: Who is the audience? (e.g., "Busy homeowners 25-45...") A - Action: What should they do? (e.g., "Click the 'Shop Now' link...") R - Result: What is the business goal? (e.g., "Boost sales...") Example: Writing a Promo Email [Context] Write a marketing email for a new promotion on smart home cleaning products. [Offer] 25% off all smart cleaning tools, online only for 72 hours. [Style] Simple, warm, and helpful. Like a friendly tip, not a sales pitch. [Target] Busy homeowners (25-45) who value their free time. [Action] Click the 'Shop Now' link before the sale ends. [Result] Boost sales and attract new customers. Stop Guessing. Start Directing. The difference between an amateur and a pro is structure. Use these frameworks to provide the clarity, context, and constraints the AI needs to deliver exceptional results. OR this, 4 Secrets to Writing AI Prompts Like a Pro Introduction: From "Good Enough" to "Unbelievable" Youโ€™ve been there. You have a crystal-clear image in your mindโ€”a striking portrait, a dynamic product shot, a breathtaking landscape. You turn to an AI image generator, type in your idea, and the result isโ€ฆ flat. Generic. Plastic-looking. It's a "cool car photo" that looks like a 10-year-old video game render, or a "sad man" that looks like a rejected stock photo. This frustration is the single biggest barrier for modern creatives. The gap between the idea in your head and the image on the screen feels vast. But what if that gap wasn't a failure of the AI, but simply a failure of communication? Welcome to the world of prompt engineering. If "prompt engineering" sounds like a technical term for coders, it's time to reframe it. For creatives, photographers, and artists, prompt engineering is simply the art of creative direction. It's the new literacy for a modern artist, no different than learning how to dial in a strobe, choose the right lens, or post-process a raw file. Your prompt is your creative brief, your shot list, and your lighting diagram, all in one. The difference between an amateur's AI results and a professional's is not luck. Itโ€™s a methodology. This article will deliver four powerful, professional frameworksโ€”ICDF, RCREOC, MICRO, and COSTARโ€”that will transform you from a passive AI user into an active AI director. The core mindset shift is this: Amateurs treat AI as a vending machineโ€”one input, one output, and you hope for the best. Professionals treat AI as a creative collaboratorโ€”an infinitely skilled, lightning-fast, but extremely literal assistant that requires precise, expert direction. It's time to become the director. Secret #1: The ICDF Framework (Instruction, Context, Data, Format) The ICDF framework is a simple, powerful structure for getting a precise, analytical result. Most amateurs only provide the "Instruction," but the AI's "Context," "Data," and "Format" are what create a professional-grade response. I - Instruction: The specific task you want the AI to perform. C - Context: The background, purpose, or "why" behind the instruction. D - Data: The specific information or inputs the AI should work with. F - Format: The shape and structure of the desired output. Let's see how a pro uses this to analyze business data. Prompt Transformation: The ICDF Effect Vague Prompt (Amateur) Pro-Prompt (ICDF Framework) "Analyze my website traffic data." (I) Instruction: "Analyze the provided traffic and engagement data for my photography portfolio website." (C) Context: "I am a professional wedding photographer. My goal is to understand which blog posts and gallery pages drive the most 'Contact Form' submissions. I need to know what content to create next." (D) Data: "The data includes traffic source, bounce rate, time-on-page, and conversion rate for July-September." (F) Format: "Provide the analysis in three clear sections: 1. Top 3 Performing Blog Posts, 2. Most-Viewed Gallery Pages, 3. Actionable recommendations for two new blog post ideas. The tone should be professional and concise." Actionable Takeaway: By providing all four elements, you've taken the guesswork out of it. You've told the AI what to do (Instruction), why (Context), what to use (Data), and how to deliver it (Format). Secret #2: The RCREOC Framework (Role, Context, Request, Examples, Output, Constraints) This is the "AI Agent" framework. This technique stops treating the AI as a simple tool and starts treating it as an expert employee. You give it a Role and a complete "work environment" to operate within. R - Role: Assign it a job title (e.g., "You are a senior photo editor"). C - Context: Describe the situation and the world the "Role" lives in. R - Request: The specific task for the "Role" to complete. E - Examples: Provide a sample of the thinking or output you want. O - Output: Define the structure of the final deliverable (e.g., "a table," "a list"). C - Constraints: Set the "rules" (e.g., "under 3 sentences," "use a formal tone"). Prompt Transformation: The RCREOC Effect Vague Prompt (Amateur) Pro-Prompt (RCREOC Framework) "Review these new photos I took." (R) Role: "You are a senior Art Director at a high-fashion advertising agency." (C) Context: "We are reviewing a new photographer's test shoot for a potential campaign. Your job is to review their weekly reports and identify recurring problems and strengths." (R) Request: "Review the attached portfolio images and extract: 1. Recurring technical issues, 2. Key compositional strengths, 3. Your professional recommendations for improvement." (E) Example: "e.g., If you see 'underexposed images,' note this under 'Issues' and recommend 'use a light meter' under 'Recommendations'." (O) Output: "The output must be a table with three columns: 'Identified Issue', 'Observed Strength', and 'Director's Recommendation'." (C) Constraints: "Each recommendation must be a single, actionable sentence. The tone must be professional, constructive, and clear." Actionable Takeaway: With RCREOC, you've built a virtual expert. The AI now understands who it is, what the stakes are, what to do, and how to do it. The results will be dramatically more targeted and useful. Secret #3: The MICRO Framework (Message, Intention, Context, Rhythm, Output) This is the ultimate framework for creative content generation. If you write blog posts, scripts, or social media updates, MICRO ensures your "voice" and purpose are not lost in translation. M - Message: The core idea or "thesis" you want to communicate. I - Intention: The purpose of the content. What do you want the audience to feel or do? C - Context: Who is the audience? Where are they seeing this? R - Rhythm: The tone, style, and pace of the content (e.g., "fast-paced," "academic," "witty"). O - Output: The final deliverable (e.g., "YouTube script," "Instagram carousel"). Prompt Transformation: The MICRO Effect Vague Prompt (Amateur) Pro-Prompt (MICRO Framework) "Write a script for a YouTube video about aperture." (M) Message: "The script needs to explain that aperture controls both light and depth of field in a simple, practical way." (I) Intention: "The goal is to persuade beginner photographers that aperture is the most important setting to learn first, and to make them feel confident, not intimidated." (C) Context: "The audience is for the 'Modern Photo Tools' blog; they are tech-savvy beginners who are new to camera fundamentals. They are watching on YouTube." (R) Rhythm: "The tone should be fast-paced, encouraging, and simple. Use a 'myth vs. fact' comparison. Keep it exciting and avoid overly technical jargon." (O) Output: "A 5-minute YouTube script, complete with an intro hook, main body, and a strong Call-to-Action (CTA) to 'try this at home and share your results'." Actionable Takeaway: MICRO forces the AI to think like a writer. It's no longer just "writing about aperture"; it's persuading a specific audience with a specific tone to achieve a specific goal. Secret #4: The COSTAR Framework (Context, Offer, Style, Target, Action, Result) This is the professional's framework for marketing and persuasion. Whether you're writing a sales email, a product description, or an ad, COSTAR guides the AI to think like a seasoned marketer. C - Context: What is the situation? (e.g., "launching a new product"). O - Offer: What is the specific deal or product? (e.g., "25% off"). S - Style: The tone and voice (e.g., "elegant," "urgent," "friendly"). T - Target: Who is this for? (e.g., "25-45 year old women"). A - Action: What is the one thing you want the reader to do? R - Result: What is the ultimate business goal? Prompt Transformation: The COSTAR Effect Vague Prompt (Amateur) Pro-Prompt (COSTAR Framework) "Write a sales email for my new photo presets." (C) Context: "Write a marketing email for the launch of my new 'California Light' Lightroom preset pack." (O) Offer: "The offer is a 25% discount for the first 3 days." (S) Style: "The style should be simple, elegant, and warm. Like a message from a trusted friend, not a pushy salesperson. Minimalist and chic." (T) Target:** "The audience is 25-45 year old lifestyle and wedding photographers who want to improve their editing speed and aesthetics." (A) Action: "The required action is to 'Click to buy before the offer expires'." (R) Result: "The goal is to drive sales in the first 3 days and encourage new customers to try the presets." Actionable Takeaway: The amateur prompt gets a generic, salesy email. The COSTAR prompt gets a targeted, on-brand message that speaks directly to a specific audience, with a clear call to action, all aligned with a business goal. Conclusion: Your New Creative Partner The four secrets to writing prompts like a pro are not "hacks." They are a methodology: ICDF (For clear, analytical tasks) RCREOC (For creating an expert "AI Agent") MICRO (For high-impact creative content) COSTAR (For powerful, targeted marketing) AI is not a replacement for your creative vision; it is a multiplier for it. It is an assistant that can execute your most complex ideas at the speed of thought, but only if you give it the high-quality direction it needs. The photographer, the artist, the directorโ€”that's you. You are, and always will be, the creative force. The AI is just the most powerful and versatile camera you've ever owned. You have the framework. You have the professional techniques. Now, go create. What's the first 'pro' prompt you're going to try? Share which framework you're most excited to use in the comments below!
๐Ÿ“ content
๐Ÿ“ blog
๐Ÿ“„ ai-background-generators-2025.md
--- id: ai-background-generators-2025 title: "Best AI Background Generators in 2025: Top Tools Compared" excerpt: Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly. publishDate: 2025-02-19 readTime: 12 min read category: tools featuredImage: \images\tools images\AI Background Generator Tool.jpg relatedTool: ai-background-generator keywords: ["AI background generators", "AI background tools", "background generation", "AI photo editing", "background replacement"] metaTitle: "Best AI Background Generators in 2025: Top Tools Compared" metaDescription: "Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly." faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "How important is integration with my existing workflow?", "acceptedAnswer": { "@type": "Answer", "text": "If you're already invested in specific ecosystems (like Adobe), tools that integrate seamlessly (like Firefly) may be worth prioritizing even if standalone alternatives offer more features. Consider the time saved through smooth integration." } }, { "@type": "Question", "name": "Do I need background generation, replacement, or both?", "acceptedAnswer": { "@type": "Answer", "text": "Some tools excel at creating new backgrounds from prompts (DALL-E 3, Midjourney) while others specialize in replacing backgrounds in existing images (ModernPhotoTools, Adobe Firefly). For comprehensive needs, choose tools that handle both effectively." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>Best AI Background Generators in 2025: Transform Your Visuals Instantly</h1> <p class="article-intro">Creating the perfect background for your photos <strong>best photo background editors</strong> , designs, or marketing materials has never been easier thanks to AI background generators. These innovative tools are revolutionizing how photographers, designers, and content creators work by eliminating hours of manual editing and unleashing new creative possibilities.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Background Generators Tool</h3> <p class="cta-block-text">Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!</p> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >Generate AI Background Now</a> </div> </div> <p>In 2025, AI background technology has reached impressive new heights, offering photorealistic results, incredible customization options, and seamless integration with existing workflows. Whether you're looking to replace dull backgrounds in product photos, create fantasy landscapes for creative projects, or generate consistent branded backdrops for your marketing campaigns, the right AI tool can transform your process.</p> <p>This comprehensive guide examines the best AI background generators available in 2025, comparing their features, pricing, strengths, and ideal use cases to help you find the perfect tool for your specific needs.</p> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#what-are-ai-background-generators">What Are AI Background Generators and Why Use Them?</a></li> <li><a href="#comparison-table">Comparison of the Best AI Background Generators in 2025</a></li> <li><a href="#modernphototools">ModernPhotoTools AI Background Generator - Professional-Grade Results</a></li> <li><a href="#dall-e">DALL-E 3 - Unparalleled Detail and Creative Interpretation</a></li> <li><a href="#midjourney">Midjourney - Artistic Excellence for Stunning Visual Backgrounds</a></li> <li><a href="#adobe-firefly">Adobe Firefly - Seamless Creative Cloud Integration</a></li> <li><a href="#canva">Canva - User-Friendly Background Generation for Quick Results</a></li> <li><a href="#other-tools">Other Notable AI Background Generators in 2025</a></li> <li><a href="#use-cases">Industry-Specific Use Cases for AI Background Generators</a></li> <li><a href="#future-trends">Future Trends in AI Background Generation for 2025 and Beyond</a></li> <li><a href="#how-to-choose">How to Choose the Right AI Background Generator for Your Needs</a></li> <li><a href="#conclusion">Conclusion: The Future of Backgrounds is AI-Powered</a></li> </ul> </div> <img src="/images/blog/Modern-Phototools-AI-Background-Generator.webp" alt="Collection of AI-generated backgrounds showing various styles from photorealistic to abstract"> </section> <section id="what-are-ai-background-generators"> <h2>What Are AI Background Generators and Why Use Them?</h2> <p>AI background generators are specialized tools that use artificial intelligence and machine learning algorithms to create, modify, or replace image backgrounds. These sophisticated systems can generate entirely new backgrounds from text descriptions, seamlessly replace existing backgrounds in photos, or intelligently extend image boundaries beyond their original frame.</p> <div class="two-columns"> <div> <h3>Key Benefits of AI Background Generators</h3> <div class="custom-list"> <li><strong>Time Efficiency:</strong> Create professional backgrounds in seconds instead of hours of manual design work</li> <li><strong>Cost Savings:</strong> Eliminate the need for expensive photo shoots, studio rentals, or purchasing stock images</li> <li><strong>Creative Freedom:</strong> Generate unlimited background variations to find the perfect match for your subject</li> <li><strong>Accessibility:</strong> Create professional-quality backgrounds without advanced design skills</li> <li><strong>Consistency:</strong> Maintain visual cohesion across product lines or marketing campaigns</li> <li><strong>Flexibility:</strong> Easily adapt backgrounds for different platforms, formats, and purposes</li> </div> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/fb74f267-3dd8-4c93-98b6-d244062c2784.jpg" alt="Before and after comparison of AI background generation"> </div> </div> <h3>Who Benefits Most from AI Background Generators?</h3> <div class="three-columns"> <div class="column-card"> <h4>Photographers</h4> <p>Professional photographers use AI background tools to offer clients more options without additional shoots, create composite images, and rescue otherwise unusable photos with background replacement.</p> </div> <div class="column-card"> <h4>E-commerce Businesses</h4> <p>Online retailers leverage AI backgrounds to create consistent product imagery, quickly adapt product photos for seasonal campaigns, and reduce photography costs while maintaining visual quality.</p> </div> <div class="column-card"> <h4>Marketers &amp; Content Creators</h4> <p>Digital marketers and content creators use these tools to produce engaging social media graphics, create branded content at scale, and maintain visual consistency across campaigns.</p> </div> </div> <p>As we explore the best AI background generators of 2025, we'll evaluate each tool based on output quality, ease of use, customization options, integration capabilities, and value for money to help you find the perfect match for your specific needs.</p> </section> <section id="comparison-table"> <h2>Comparison of the Best AI Background Generators in 2025</h2> <p>Before diving into detailed reviews, let's compare the top AI background generators side by side to help you quickly identify which tools might best suit your needs:</p> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <td data-row="head">Tool</td> <td data-row="head">Best For</td> <td data-row="head">Key Features</td> <td data-row="head">Pricing</td> <td data-row="head">Output Quality</td> <td data-row="head">Ease of Use</td> </tr> </thead> <tbody> <tr> <td data-label="Tool">ModernPhotoTools AI Background Generator</td> <td data-label="Best For">Professional photographers and designers needing precision and customization</td> <td data-label="Key Features">Advanced style control, seamless background blending, batch processing, custom prompt library</td> <td data-label="Pricing">Totally Free </td> <td data-label="Output Quality">5/5</td> <td data-label="Ease of Use">5/5</td> </tr> <tr> <td data-label="Tool">DALL-E 3</td> <td data-label="Best For">Creative professionals needing highly detailed custom backgrounds</td> <td data-label="Key Features">Exceptional detail, creative interpretation, style variety</td> <td data-label="Pricing">$20/month (ChatGPT Plus)</td> <td data-label="Output Quality">5/5</td> <td data-label="Ease of Use">4/5</td> </tr> <tr> <td data-label="Tool">Midjourney</td> <td data-label="Best For">Artists and designers seeking aesthetic backgrounds</td> <td data-label="Key Features">Artistic quality, style consistency, community features</td> <td data-label="Pricing">$10-$60/month</td> <td data-label="Output Quality">4.8/5</td> <td data-label="Ease of Use">3.5/5</td> </tr> <tr> <td data-label="Tool">Adobe Firefly</td> <td data-label="Best For">Adobe users needing seamless Creative Cloud integration</td> <td data-label="Key Features">Generative fill, background extension, Creative Cloud integration</td> <td data-label="Pricing">$9.99/month</td> <td data-label="Output Quality">4.7/5</td> <td data-label="Ease of Use">4.5/5</td> </tr> <tr> <td data-label="Tool">Canva</td> <td data-label="Best For">Marketing teams and beginners needing quick results</td> <td data-label="Key Features">Template library, intuitive interface, multi-format export</td> <td data-label="Pricing">Free tier with Pro at $12.99/month</td> <td data-label="Output Quality">4/5</td> <td data-label="Ease of Use">5/5</td> </tr> <tr> <td data-label="Tool">Fotor</td> <td data-label="Best For">Casual users needing simple background solutions</td> <td data-label="Key Features">One-click background removal, template library, basic editing</td> <td data-label="Pricing">Free tier with Pro at $8.99/month</td> <td data-label="Output Quality">3.8/5</td> <td data-label="Ease of Use">4.8/5</td> </tr> <tr> <td data-label="Tool">Picsart</td> <td data-label="Best For">Social media content creators</td> <td data-label="Key Features">Mobile-friendly, quick generation, social media templates</td> <td data-label="Pricing">Free tier with Premium from $9/month</td> <td data-label="Output Quality">3.7/5</td> <td data-label="Ease of Use">4.7/5</td> </tr> <tr> <td data-label="Tool">Artbreeder</td> <td data-label="Best For">Experimental artists seeking unique backgrounds</td> <td data-label="Key Features">Image blending, collaborative creation, style mixing</td> <td data-label="Pricing">Free tier with Premium options</td> <td data-label="Output Quality">4.2/5</td> <td data-label="Ease of Use">3.5/5</td> </tr> <tr> <td data-label="Tool">Videoleap</td> <td data-label="Best For">Video content creators</td> <td data-label="Key Features">Video background replacement, motion tracking, effects library</td> <td data-label="Pricing">Free tier with Pro at $7.99/month</td> <td data-label="Output Quality">4/5</td> <td data-label="Ease of Use">4.2/5</td> </tr> <tr> <td data-label="Tool">Deep Dream Generator</td> <td data-label="Best For">Abstract and artistic background creation</td> <td data-label="Key Features">Surreal effects, pattern enhancement, style transfer</td> <td data-label="Pricing">Free tier with Premium options</td> <td data-label="Output Quality">4.3/5</td> <td data-label="Ease of Use">3.8/5</td> </tr> </tbody> </table> </div> <p>Now let's explore each of these powerful AI background generators in detail to help you determine which one best fits your specific needs and workflow.</p> </section> <section id="modernphototools"> <h2>ModernPhotoTools AI Background Generator: Professional-Grade Results with Unmatched Control</h2> <div class="two-columns"> <div> <p>ModernPhotoTools AI Background Generator stands out in 2025 as one of the most versatile and powerful options for photographers, designers, and content creators who demand precision and customization. This tool combines cutting-edge AI technology with an intuitive interface to deliver exceptional background generation capabilities.</p> <p>What sets ModernPhotoTools apart is its unique approach to background generation that prioritizes both quality and control. Unlike many competitors that offer limited customization options, this tool provides granular control over every aspect of your generated backgrounds while maintaining an accessible user experience.</p> </div> <div> <img src="/images/blog/Modern-Phototools-AI-Background-Generator.webp"> </div> </div> <div class="rating-container"> <div class="rating-overall"> <div class="rating-score">4.8</div> <div class="rating-stars"></div> <div class="rating-label">Overall Rating</div> </div> <div class="rating-details"> <div class="rating-item"> <div class="rating-name">Output Quality</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 96%"></div> </div> <div class="rating-value">4.8/5</div> </div> <div class="rating-item"> <div class="rating-name">Ease of Use</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 90%"></div> </div> <div class="rating-value">4.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Customization Options</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 98%"></div> </div> <div class="rating-value">4.9/5</div> </div> <div class="rating-item"> <div class="rating-name">Integration Capabilities</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 92%"></div> </div> <div class="rating-value">4.6/5</div> </div> <div class="rating-item"> <div class="rating-name">Value for Money</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 94%"></div> </div> <div class="rating-value">4.7/5</div> </div> </div> </div> <h3>Key Features of ModernPhotoTools AI Background Generator</h3> <div class="custom-list"> <li><strong>Advanced Style Control:</strong> Fine-tune every aspect of your generated backgrounds with precise controls for lighting, texture, depth, and color harmony</li> <li><strong>Seamless Background Blending:</strong> Proprietary AI algorithms ensure subjects blend naturally with new backgrounds, maintaining realistic lighting and shadows</li> <li><strong>Batch Processing:</strong> Generate consistent backgrounds across multiple images simultaneously, perfect for product catalogs or marketing campaigns</li> <li><strong>Custom Prompt Library:</strong> Save and organize your favorite prompts and settings for quick access to your most successful background styles</li> <li><strong>Background Extension:</strong> Intelligently expand existing backgrounds beyond their original boundaries for more composition flexibility</li> <li><strong>Multi-Format Export:</strong> Export your creations in various formats and resolutions optimized for different platforms and purposes</li> </div> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Pros</h4> <ul> <li>Exceptional output quality with photorealistic results</li> <li>Intuitive interface balancing power with accessibility</li> <li>Unmatched customization options for precise control</li> <li>Generous free tier with substantial features</li> <li>Regular updates with new features and improvements</li> </ul> </div> <div class="cons"> <h4 class="cons-title">Cons</h4> <ul> <li>Some specialized industry-specific templates still in development</li> </ul> </div> </div> <h3>Pricing</h3> <div class="list-comparison"> <ul class="list-comparison-column list-comparison-primary"> <h4 class="list-comparison-title">Totally Free </h4> <li>Unlimited </li> <li>Access to basic style controls</li> <li>Export in standard resolution</li> </ul> </div> <h3>Ideal Use Cases</h3> <div class="three-columns"> <div class="column-card"> <h4>Professional Photography</h4> <p>Perfect for portrait photographers who need to offer clients multiple background options or product photographers requiring consistent, high-quality backgrounds across entire catalogs.</p> </div> <div class="column-card"> <h4>E-commerce</h4> <p>Ideal for online retailers who need to maintain visual consistency across product lines or quickly update product backgrounds for seasonal campaigns without reshooting.</p> </div> <div class="column-card"> <h4>Digital Marketing</h4> <p>Excellent for marketing teams creating cohesive visual content across multiple platforms, allowing for quick adaptation of imagery to different formats and contexts.</p> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Experience Professional-Grade AI Background Generation</h3> <p class="cta-block-text">Transform your creative workflow with ModernPhotoTools AI Background Generator. Start creating stunning, customized backgrounds in minutes with our powerful yet intuitive platform.</p> <div class="cta-block-buttons"> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn">Try For Free</a> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn cta-btn-secondary">View Examples</a> </div> </div> </section> <section id="dall-e"> <h2>DALL-E 3: Unparalleled Detail and Creative Interpretation</h2> <div class="two-columns"> <div> <p>DALL-E 3, integrated with ChatGPT Plus, represents the pinnacle of AI-generated imagery in 2025. This powerful model excels at transforming detailed text descriptions into stunning, highly detailed backgrounds with remarkable accuracy and creative interpretation.</p> <p>What makes DALL-E 3 stand out is its exceptional understanding of complex prompts and ability to generate backgrounds with intricate details, consistent lighting, and coherent themes. The integration with ChatGPT provides a conversational interface that helps refine prompts for optimal results.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b0bd8cf9-c5d7-4fbe-85d0-e81a8a996251.jpg" alt="DALL-E 3 generated backgrounds showing exceptional detail and creative interpretation"> </div> </div> <div class="rating-container"> <div class="rating-overall"> <div class="rating-score">4.7</div> <div class="rating-stars"></div> <div class="rating-label">Overall Rating</div> </div> <div class="rating-details"> <div class="rating-item"> <div class="rating-name">Output Quality</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 98%"></div> </div> <div class="rating-value">4.9/5</div> </div> <div class="rating-item"> <div class="rating-name">Ease of Use</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 80%"></div> </div> <div class="rating-value">4.0/5</div> </div> <div class="rating-item"> <div class="rating-name">Customization Options</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 90%"></div> </div> <div class="rating-value">4.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Integration Capabilities</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 84%"></div> </div> <div class="rating-value">4.2/5</div> </div> <div class="rating-item"> <div class="rating-name">Value for Money</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 88%"></div> </div> <div class="rating-value">4.4/5</div> </div> </div> </div> <h3>Key Features</h3> <div class="custom-list"> <li><strong>Exceptional Detail:</strong> Creates backgrounds with remarkable intricacy and coherence, capturing subtle elements described in prompts</li> <li><strong>Creative Interpretation:</strong> Intelligently fills in details not explicitly mentioned, creating cohesive and imaginative scenes</li> <li><strong>Style Versatility:</strong> Excels at generating backgrounds in various styles, from photorealistic to artistic or stylized</li> <li><strong>Conversational Refinement:</strong> Leverages ChatGPT to help refine prompts through natural conversation</li> <li><strong>High Resolution:</strong> Generates backgrounds at 1792ร—1024 pixels, suitable for most professional applications</li> <li><strong>Multiple Variations:</strong> Produces four different interpretations of each prompt, offering creative options</li> </div> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Pros</h4> <ul> <li>Unmatched detail and realism in generated backgrounds</li> <li>Excellent understanding of complex prompts</li> <li>Consistent lighting and perspective across the image</li> <li>Helpful conversational interface for prompt refinement</li> <li>Regular model improvements and updates</li> </ul> </div> <div class="cons"> <h4 class="cons-title">Cons</h4> <ul> <li>Requires ChatGPT Plus subscription ($20/month)</li> <li>Limited post-generation editing capabilities</li> <li>No batch processing for multiple backgrounds</li> <li>Cannot directly edit existing images or replace backgrounds</li> </ul> </div> </div> <h3>Pricing</h3> <p>DALL-E 3 is available exclusively through a ChatGPT Plus subscription, priced at $20 per month. This subscription includes access to GPT-4, DALL-E 3, and other premium features.</p> <h3>Ideal Use Cases</h3> <div class="three-columns"> <div class="column-card"> <h4>Concept Art</h4> <p>Perfect for artists and designers who need detailed background concepts for illustrations, games, or film projects, allowing quick visualization of complex scenes.</p> </div> <div class="column-card"> <h4>Marketing Visuals</h4> <p>Excellent for creating unique, eye-catching backgrounds for advertising campaigns, social media content, and brand materials that stand out from stock imagery.</p> </div> <div class="column-card"> <h4>Editorial Content</h4> <p>Ideal for publishers and content creators who need custom backgrounds for articles, blog posts, and digital publications with specific thematic requirements.</p> </div> </div> <p>While DALL-E 3 excels at generating highly detailed, creative backgrounds from text prompts, it's important to note that it doesn't offer background replacement or editing features for existing images. For those specific needs, tools like ModernPhotoTools AI Background Generator provide more comprehensive solutions.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/73888f78-82ef-4d15-a4fb-b06e5d776ff7.jpg" alt="Comparison of DALL-E 3 outputs from different prompts showing style versatility"> </section> <section id="midjourney"> <h2>Midjourney: Artistic Excellence for Stunning Visual Backgrounds</h2> <div class="two-columns"> <div> <p>Midjourney has established itself as a premier choice for artists and designers seeking aesthetically pleasing, artistic backgrounds. In 2025, it continues to stand out for its exceptional ability to generate visually striking imagery with a distinctive artistic quality that many creators find irresistible.</p> <p>What distinguishes Midjourney is its remarkable aesthetic sensibilityโ€”backgrounds created with this tool often have a painterly quality with beautiful composition, lighting, and color harmony that feels intentionally crafted rather than algorithmically generated.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ed9a2214-4b10-42a7-8f1c-3948aca4e2a3.jpg" alt="Midjourney generated artistic backgrounds showing its distinctive aesthetic quality"> </div> </div> <div class="rating-container"> <div class="rating-overall"> <div class="rating-score">4.6</div> <div class="rating-stars"></div> <div class="rating-label">Overall Rating</div> </div> <div class="rating-details"> <div class="rating-item"> <div class="rating-name">Output Quality</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 96%"></div> </div> <div class="rating-value">4.8/5</div> </div> <div class="rating-item"> <div class="rating-name">Ease of Use</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 70%"></div> </div> <div class="rating-value">3.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Customization Options</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 88%"></div> </div> <div class="rating-value">4.4/5</div> </div> <div class="rating-item"> <div class="rating-name">Integration Capabilities</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 76%"></div> </div> <div class="rating-value">3.8/5</div> </div> <div class="rating-item"> <div class="rating-name">Value for Money</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 84%"></div> </div> <div class="rating-value">4.2/5</div> </div> </div> </div> <h3>Key Features</h3> <div class="custom-list"> <li><strong>Artistic Quality:</strong> Creates backgrounds with exceptional aesthetic appeal and artistic coherence</li> <li><strong>Style Consistency:</strong> Maintains consistent artistic style across different prompts when using similar parameters</li> <li><strong>Parameter Control:</strong> Offers advanced parameters for fine-tuning aspects like stylization, chaos, quality, and aspect ratio</li> <li><strong>Variation Commands:</strong> Generates multiple variations of a concept with simple commands</li> <li><strong>Community Features:</strong> Provides inspiration through a vibrant community of creators sharing their work</li> <li><strong>Discord Integration:</strong> Operates primarily through Discord, allowing for collaborative creation and feedback</li> </div> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Pros</h4> <ul> <li>Exceptional artistic quality and aesthetic appeal</li> <li>Strong community for inspiration and learning</li> <li>Regular model updates improving capabilities</li> <li>Ability to create unique, distinctive backgrounds</li> <li>High-resolution output options</li> </ul> </div> <div class="cons"> <h4 class="cons-title">Cons</h4> <ul> <li>Discord-based interface may be unfamiliar to some users</li> <li>Steeper learning curve for optimal results</li> <li>Limited background replacement capabilities</li> <li>Higher-tier subscriptions needed for private mode</li> </ul> </div> </div> <h3>Pricing</h3> <div class="list-comparison"> <ul class="list-comparison-column list-comparison-primary"> <h4 class="list-comparison-title">Basic Plan ($10/month)</h4> <li>3.3 hours of GPU time per month</li> <li>Standard generation speed</li> <li>Community features</li> <li>Basic resolution options</li> </ul> <ul class="list-comparison-column list-comparison-success"> <h4 class="list-comparison-title">Standard Plan ($30/month)</h4> <li>15 hours of GPU time per month</li> <li>Faster generation speed</li> <li>Community features</li> <li>Higher resolution options</li> <li>Relaxed usage limits</li> </ul> <ul class="list-comparison-column list-comparison-warning"> <h4 class="list-comparison-title">Pro Plan ($60/month)</h4> <li>30 hours of GPU time per month</li> <li>Maximum generation speed</li> <li>Community features</li> <li>Highest resolution options</li> <li>Stealth/private mode</li> <li>Priority support</li> </ul> </div> <h3>Ideal Use Cases</h3> <div class="three-columns"> <div class="column-card"> <h4>Creative Projects</h4> <p>Perfect for artists, illustrators, and designers seeking unique, aesthetically pleasing backgrounds with artistic flair for creative projects and portfolios.</p> </div> <div class="column-card"> <h4>Concept Development</h4> <p>Excellent for quickly visualizing concepts for film, gaming, or illustration projects with consistent artistic style and mood.</p> </div> <div class="column-card"> <h4>Artistic Marketing</h4> <p>Ideal for brands with an artistic aesthetic who want distinctive, eye-catching backgrounds for campaigns that stand out from typical commercial imagery.</p> </div> </div> <p>Midjourney excels at creating beautiful, artistic backgrounds from text prompts, but like DALL-E 3, it doesn't offer background replacement features for existing images. For comprehensive background generation and replacement capabilities, consider ModernPhotoTools AI Background Generator, which combines artistic quality with practical editing features.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/9e0fbe4e-09cd-4d86-ae7f-b8e6f8d7d814.jpg" alt="Examples of Midjourney parameter variations showing how different settings affect the same basic prompt"> </section> <section id="adobe-firefly"> <h2>Adobe Firefly: Seamless Creative Cloud Integration with Powerful Generation</h2> <div class="two-columns"> <div> <p>Adobe Firefly has evolved into a formidable AI background generation tool in 2025, particularly for professionals already embedded in the Adobe ecosystem. Its tight integration with Creative Cloud applications like Photoshop and Illustrator makes it an efficient choice for designers and creative professionals.</p> <p>What sets Firefly apart is its focus on commercial safety and seamless workflow integration. Trained on licensed content and public domain imagery, Firefly provides peace of mind for commercial projects while offering powerful features like generative fill and background extension that work directly within familiar Adobe interfaces.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/406dd4bc-6703-4ce9-a83d-d1fe477099ec.jpg" alt="Adobe Firefly interface showing background generation and integration with Photoshop"> </div> </div> <div class="rating-container"> <div class="rating-overall"> <div class="rating-score">4.6</div> <div class="rating-stars"></div> <div class="rating-label">Overall Rating</div> </div> <div class="rating-details"> <div class="rating-item"> <div class="rating-name">Output Quality</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 90%"></div> </div> <div class="rating-value">4.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Ease of Use</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 90%"></div> </div> <div class="rating-value">4.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Customization Options</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 88%"></div> </div> <div class="rating-value">4.4/5</div> </div> <div class="rating-item"> <div class="rating-name">Integration Capabilities</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 98%"></div> </div> <div class="rating-value">4.9/5</div> </div> <div class="rating-item"> <div class="rating-name">Value for Money</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 86%"></div> </div> <div class="rating-value">4.3/5</div> </div> </div> </div> <h3>Key Features</h3> <div class="custom-list"> <li><strong>Generative Fill:</strong> Intelligently fills selected areas with AI-generated content that matches the surrounding context</li> <li><strong>Background Extension:</strong> Seamlessly extends backgrounds beyond their original boundaries with contextually appropriate content</li> <li><strong>Creative Cloud Integration:</strong> Works directly within Photoshop, Illustrator, and other Adobe applications</li> <li><strong>Commercial Safety:</strong> Trained on licensed content, providing confidence for commercial usage</li> <li><strong>Text-to-Image Generation:</strong> Creates backgrounds from text descriptions with style controls</li> <li><strong>Bulk Processing:</strong> Applies consistent background modifications across multiple images</li> </div> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Pros</h4> <ul> <li>Seamless integration with Adobe Creative Cloud</li> <li>Commercially safe content generation</li> <li>Powerful in-context editing capabilities</li> <li>Familiar interface for Adobe users</li> <li>Regular updates aligned with Creative Cloud</li> </ul> </div> <div class="cons"> <h4 class="cons-title">Cons</h4> <ul> <li>Requires Adobe subscription for full functionality</li> <li>Limited standalone capabilities outside Adobe ecosystem</li> <li>Fewer artistic style options than specialized tools</li> <li>Higher combined cost when factoring in Creative Cloud</li> </ul> </div> </div> <h3>Pricing</h3> <p>Adobe Firefly is available as part of Adobe's Creative Cloud subscription or as a standalone service:</p> <ul> <li><strong>Standalone Firefly:</strong> $9.99/month</li> <li><strong>Creative Cloud Single App (with Firefly):</strong> Starting at $20.99/month</li> <li><strong>Creative Cloud All Apps (with Firefly):</strong> Starting at $54.99/month</li> </ul> <h3>Ideal Use Cases</h3> <div class="three-columns"> <div class="column-card"> <h4>Professional Design</h4> <p>Perfect for designers already working in the Adobe ecosystem who need to seamlessly integrate AI background generation into their established workflows.</p> </div> <div class="column-card"> <h4>Commercial Projects</h4> <p>Ideal for agencies and businesses requiring commercially safe content generation with proper licensing for client work and marketing materials.</p> </div> <div class="column-card"> <h4>Complex Edits</h4> <p>Excellent for projects requiring sophisticated background manipulation within existing images, leveraging Photoshop's editing capabilities enhanced by AI.</p> </div> </div> <p>Adobe Firefly offers powerful background generation capabilities, especially for those already invested in the Adobe ecosystem. However, for users seeking a standalone solution with more specialized background generation features, ModernPhotoTools AI Background Generator provides a more focused and cost-effective alternative.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/92f5bb56-41a5-4a03-b58f-a01a495cfde8.jpg" alt="Before and after examples of Adobe Firefly's background extension and generative fill capabilities"> </section> <section id="canva"> <h2>Canva: User-Friendly Background Generation for Quick Results</h2> <div class="two-columns"> <div> <p>Canva has solidified its position as one of the most accessible AI background generators in 2025, particularly for marketing teams, social media managers, and users without extensive design experience. Its intuitive interface and template-based approach make it exceptionally easy to create professional-looking backgrounds quickly.</p> <p>What makes Canva stand out is its all-in-one approach that combines AI background generation with a comprehensive design platform. Users can not only create backgrounds but also immediately incorporate them into designs with text, graphics, and other elements, streamlining the entire creative process.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b6ab490a-a3f2-475d-9220-babc2733d65c.jpg" alt="Canva's AI background generator interface showing template options and customization tools"> </div> </div> <div class="rating-container"> <div class="rating-overall"> <div class="rating-score">4.5</div> <div class="rating-stars"></div> <div class="rating-label">Overall Rating</div> </div> <div class="rating-details"> <div class="rating-item"> <div class="rating-name">Output Quality</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 80%"></div> </div> <div class="rating-value">4.0/5</div> </div> <div class="rating-item"> <div class="rating-name">Ease of Use</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 98%"></div> </div> <div class="rating-value">4.9/5</div> </div> <div class="rating-item"> <div class="rating-name">Customization Options</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 82%"></div> </div> <div class="rating-value">4.1/5</div> </div> <div class="rating-item"> <div class="rating-name">Integration Capabilities</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 90%"></div> </div> <div class="rating-value">4.5/5</div> </div> <div class="rating-item"> <div class="rating-name">Value for Money</div> <div class="rating-bar-container"> <div class="rating-bar" style="width: 92%"></div> </div> <div class="rating-value">4.6/5</div> </div> </div> </div> <h3>Key Features</h3> <div class="custom-list"> <li><strong>Text-to-Background Generation:</strong> Creates backgrounds from simple text prompts with style presets</li> <li><strong>Background Removal:</strong> Automatically removes backgrounds from uploaded images</li> <li><strong>Template Library:</strong> Offers thousands of templates with customizable backgrounds</li> <li><strong>Style Controls:</strong> Provides sliders for adjusting colors, gradients, and patterns</li> <li><strong>Multi-Format Export:</strong> Exports designs in various formats optimized for different platforms</li> <li><strong>Collaboration Tools:</strong> Enables team collaboration on background designs</li> </div> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Pros</h4> <ul> <li>Exceptionally intuitive interface requiring minimal learning</li> <li>All-in-one platform for background creation and design</li> <li>Extensive template library for quick starting points</li> <li>Strong free tier with substantial features</li> <li>Excellent mobile app for on-the-go creation</li> </ul> </div> <div class="cons"> <h4 class="cons-title">Cons</h4> <ul> <li>Less detailed output compared to specialized AI tools</li> <li>Limited fine control over generation parameters</li> <li>Advanced features require Pro subscription</li> <li>Occasional rendering delays with complex designs</li> </ul> </div> </div> <h3>Pricing</h3> <div class="list-comparison"> <ul class="list-comparison-column list-comparison-primary"> <h4 class="list-comparison-title">Free Plan</h4> <li>Basic AI background generation</li> <li>250,000+ free templates</li> <li>5GB cloud storage</li> <li>Limited background removal</li> <li>Basic collaboration</li> </ul> <ul class="list-comparison-column list-comparison-success"> <h4 class="list-comparison-title">Pro Plan ($12.99/month)</h4> <li>Advanced AI background generation</li> <li>100+ million premium stock photos</li> <li>100GB cloud storage</li> <li>Background remover tool</li> <li>Magic resize for multiple formats</li> <li>Brand kit for consistent designs</li> </ul> <ul class="list-comparison-column list-comparison-warning"> <h4 class="list-comparison-title">Teams ($14.99/user/month)</h4> <li>All Pro features</li> <li>Team templates and folders</li> <li>Team collaboration tools</li> <li>Approval workflows</li> <li>Unlimited storage</li> <li>Single sign-on</li> </ul> </div> <h3>Ideal Use Cases</h3> <div class="three-columns"> <div class="column-card"> <h4>Social Media Marketing</h4> <p>Perfect for social media managers who need to quickly create and adapt background designs for multiple platforms and campaigns with consistent branding.</p> </div> <div class="column-card"> <h4>Small Business Marketing</h4> <p>Ideal for small business owners without design teams who need professional-looking backgrounds for marketing materials, websites, and social media.</p> </div> <div class="column-card"> <h4>Content Creation</h4> <p>Excellent for content creators, bloggers, and YouTubers who need attractive backgrounds for thumbnails, featured images, and presentation graphics.</p> </div> </div> <p>Canva offers a user-friendly approach to AI background generation that's perfect for quick results and all-in-one design needs. However, for users requiring more specialized background generation with greater control and higher-quality outputs, ModernPhotoTools AI Background Generator provides a more focused solution with professional-grade results.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/c99ef565-d8d5-41c5-ae54-ce39c4e7b846.jpg" alt="Examples of Canva's AI-generated backgrounds used in different design contexts"> </section> <section id="other-tools"> <h2>Other Notable AI Background Generators in 2025</h2> <p>Beyond our top five picks, several other AI background generators offer unique features and capabilities worth considering depending on your specific needs:</p> <div class="two-columns"> <div> <h3>Fotor: Intuitive Background Generation for Casual Users</h3> <p>Fotor has evolved into a reliable AI background generator that balances simplicity with effective results. Its straightforward interface makes it accessible to users with minimal technical expertise, while still delivering quality backgrounds for everyday use.</p> <div class="custom-list"> <li><strong>Key Features:</strong> One-click background removal, text-to-image generation, template library</li> <li><strong>Best For:</strong> Casual users needing simple background solutions</li> <li><strong>Pricing:</strong> Free tier with Pro at $8.99/month</li> </div> <div class="rating-container compact"> <div class="rating-overall"> <div class="rating-score">4.2</div> <div class="rating-stars"></div> </div> </div> </div> <div> <h3>Picsart: Mobile-First Background Generation</h3> <p>Picsart excels as a mobile-centric AI background generator, perfect for content creators who work primarily on smartphones and tablets. Its touch-optimized interface and social media focus make it particularly valuable for influencers and social media managers.</p> <div class="custom-list"> <li><strong>Key Features:</strong> Mobile-optimized interface, quick generation, social templates</li> <li><strong>Best For:</strong> Social media content creators working on mobile</li> <li><strong>Pricing:</strong> Free tier with Premium from $9/month</li> </div> <div class="rating-container compact"> <div class="rating-overall"> <div class="rating-score">4.1</div> <div class="rating-stars"></div> </div> </div> </div> </div> <div class="two-columns"> <div> <h3>Artbreeder: Experimental Background Blending</h3> <p>Artbreeder offers a unique approach to AI background generation through its collaborative breeding system. By blending existing images and controlling their genetic attributes, users can create truly unique backgrounds that evolve through iterative refinement.</p> <div class="custom-list"> <li><strong>Key Features:</strong> Image blending, collaborative creation, style mixing</li> <li><strong>Best For:</strong> Experimental artists seeking unique backgrounds</li> <li><strong>Pricing:</strong> Free tier with Premium options</li> </div> <div class="rating-container compact"> <div class="rating-overall"> <div class="rating-score">4.0</div> <div class="rating-stars"></div> </div> </div> </div> <div> <h3>Videoleap: Video Background Generation</h3> <p>Videoleap specializes in AI background generation for video content, filling an important niche for content creators working with motion rather than still images. Its ability to replace video backgrounds without green screens makes it invaluable for video producers.</p> <div class="custom-list"> <li><strong>Key Features:</strong> Video background replacement, motion tracking, effects library</li> <li><strong>Best For:</strong> Video content creators</li> <li><strong>Pricing:</strong> Free tier with Pro at $7.99/month</li> </div> <div class="rating-container compact"> <div class="rating-overall"> <div class="rating-score">4.1</div> <div class="rating-stars"></div> </div> </div> </div> </div> <div class="two-columns"> <div> <h3>Deep Dream Generator: Abstract Artistic Backgrounds</h3> <p>Deep Dream Generator creates distinctively surreal and abstract backgrounds by enhancing and exaggerating patterns within images. This unique approach makes it perfect for artistic projects requiring dreamlike, psychedelic, or highly stylized backgrounds.</p> <div class="custom-list"> <li><strong>Key Features:</strong> Surreal effects, pattern enhancement, style transfer</li> <li><strong>Best For:</strong> Abstract and artistic background creation</li> <li><strong>Pricing:</strong> Free tier with Premium options</li> </div> <div class="rating-container compact"> <div class="rating-overall"> <div class="rating-score">3.9</div> <div class="rating-stars"></div> </div> </div> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/f869219d-351f-4937-993d-dd12176a2590.jpg" alt="Collage of backgrounds created with various specialized AI background generators"> </div> </div> <p>While these tools offer valuable specialized features, they generally provide more focused functionality compared to our top recommendations. For users seeking the most comprehensive and versatile AI background generation solution, ModernPhotoTools AI Background Generator combines the best aspects of these specialized tools with an intuitive interface and professional-grade results.</p> </section> <section id="use-cases"> <h2>Industry-Specific Use Cases for AI Background Generators</h2> <p>AI background generators are transforming workflows across numerous industries. Here's how different professionals are leveraging these tools in 2025:</p> <div class="three-columns"> <div class="column-card"> <h3>Photography</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/0c316758-21a1-419d-80dd-7005a52aa420.jpg" alt="Professional photographer using AI background generator to offer client multiple background options"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Portrait Enhancement:</strong> Offering clients multiple background options without additional shoots</li> <li><strong>Product Photography:</strong> Creating consistent backgrounds across product lines</li> <li><strong>Composite Creation:</strong> Combining subjects from different shoots into cohesive scenes</li> <li><strong>Portfolio Diversification:</strong> Showcasing versatility with varied background styles</li> </div> <p><strong>Recommended Tool:</strong> ModernPhotoTools AI Background Generator excels for photographers with its precise control and professional-quality outputs.</p> </div> <div class="column-card"> <h3>E-commerce</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b854b716-b096-4cbd-b546-a85a87bcb6e2.jpg" alt="E-commerce product lineup with consistent AI-generated backgrounds"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Product Catalog Consistency:</strong> Maintaining visual cohesion across entire product lines</li> <li><strong>Seasonal Updates:</strong> Quickly adapting product imagery for holiday or seasonal campaigns</li> <li><strong>Cost Reduction:</strong> Eliminating expensive photo shoots for background variations</li> <li><strong>Marketplace Optimization:</strong> Creating backgrounds that increase conversion on specific platforms</li> </div> <p><strong>Recommended Tool:</strong> ModernPhotoTools AI Background Generator's batch processing makes it ideal for e-commerce businesses managing large product catalogs.</p> </div> <div class="column-card"> <h3>Digital Marketing</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/6eeacdbd-9211-40a1-9f06-294798a3ffbd.jpg" alt="Marketing team creating campaign materials with consistent AI backgrounds across different formats"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Multi-Platform Campaigns:</strong> Creating consistent visuals across different marketing channels</li> <li><strong>A/B Testing:</strong> Quickly generating background variations to test audience response</li> <li><strong>Content Calendars:</strong> Producing background templates for ongoing content needs</li> <li><strong>Ad Personalization:</strong> Tailoring backgrounds to specific audience segments</li> </div> <p><strong>Recommended Tool:</strong> Canva works well for marketing teams needing quick results across multiple formats, while ModernPhotoTools offers higher quality for premium campaigns.</p> </div> </div> <div class="three-columns"> <div class="column-card"> <h3>Game Development</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/cab5b35e-9a03-4b00-8e5b-baf0da861fe7.jpg" alt="Game development team using AI background generators for concept art and environment design"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Concept Art:</strong> Rapidly generating environment concepts for review</li> <li><strong>Texture Creation:</strong> Developing unique textures and patterns for game assets</li> <li><strong>Level Design:</strong> Creating background variations for different game levels</li> <li><strong>Marketing Assets:</strong> Producing promotional imagery for game marketing</li> </div> <p><strong>Recommended Tool:</strong> Midjourney's artistic quality makes it excellent for game concept art, while DALL-E 3 excels at detailed environment concepts.</p> </div> <div class="column-card"> <h3>Real Estate</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/59f0b9e3-4e2d-499a-8834-a40d354bf9f9.jpg" alt="Real estate professional using AI to stage virtual properties with different background styles"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Virtual Staging:</strong> Digitally furnishing empty properties with different styles</li> <li><strong>View Enhancement:</strong> Improving window views or outdoor spaces</li> <li><strong>Season Adaptation:</strong> Showing properties in different seasons or times of day</li> <li><strong>Renovation Visualization:</strong> Demonstrating potential renovation outcomes</li> </div> <p><strong>Recommended Tool:</strong> Adobe Firefly's generative fill and realistic outputs work well for real estate applications requiring subtle, believable enhancements.</p> </div> <div class="column-card"> <h3>Education</h3> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ed419ca0-5e0e-4cef-8eb8-b5732736ba23.jpg" alt="Educator creating engaging learning materials with AI-generated historical or scientific backgrounds"> <h4>Key Applications:</h4> <div class="custom-list"> <li><strong>Historical Visualization:</strong> Creating period-accurate backgrounds for history lessons</li> <li><strong>Scientific Illustration:</strong> Generating backgrounds that visualize scientific concepts</li> <li><strong>Interactive Learning:</strong> Developing engaging visual contexts for educational content</li> <li><strong>Presentation Enhancement:</strong> Improving the visual appeal of educational presentations</li> </div> <p><strong>Recommended Tool:</strong> DALL-E 3's detailed outputs and educational accuracy make it valuable for creating instructional backgrounds.</p> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Find the Perfect AI Background Solution for Your Industry</h3> <p class="cta-block-text">Whether you're a photographer, marketer, educator, or e-commerce professional, ModernPhotoTools AI Background Generator offers the versatility, quality, and control you need to transform your visual content.</p> <div class="cta-block-buttons"> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn">Try ModernPhotoTools Now</a> </div> </div> </section> <section id="future-trends"> <h2>Future Trends in AI Background Generation for 2025 and Beyond</h2> <p>The field of AI background generation continues to evolve rapidly. Here are the key trends shaping the future of this technology in 2025 and beyond:</p> <div class="two-columns"> <div> <h3>Hyper-Personalization</h3> <p>AI background generators are becoming increasingly capable of creating highly personalized backgrounds tailored to specific brand identities, individual preferences, and target audiences. This trend is enabling unprecedented levels of customization without requiring extensive manual design work.</p> <div class="custom-list"> <li><strong>Brand DNA Analysis:</strong> AI systems analyzing brand assets to generate perfectly matched backgrounds</li> <li><strong>Audience-Adaptive Backgrounds:</strong> Backgrounds that automatically adjust based on viewer demographics or preferences</li> <li><strong>Personal Style Learning:</strong> Systems that learn individual creative preferences over time</li> </div> <p>Tools like ModernPhotoTools AI Background Generator are leading this trend with advanced customization options and style controls that allow for precise alignment with specific visual identities.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/21bb8fcf-9856-4c72-96a6-535d394b48e4.jpg" alt="Futuristic interface showing AI analyzing brand elements to create perfectly matched backgrounds"> </div> </div> <div class="two-columns"> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/e35265c0-f0cd-47cc-bd96-f9302603f094.jpg" alt="Demonstration of AI-generated video backgrounds with consistent style across motion sequences"> </div> <div> <h3>Video Background Generation</h3> <p>While still image background generation has matured, video background generation is emerging as the next frontier. AI systems are now beginning to generate consistent, high-quality animated backgrounds or replace backgrounds in video content without requiring green screens.</p> <div class="custom-list"> <li><strong>Temporal Consistency:</strong> Maintaining perfect style and element consistency across frames</li> <li><strong>Motion Generation:</strong> Creating natural movement within generated backgrounds</li> <li><strong>Real-Time Processing:</strong> Enabling live background replacement for streaming and video calls</li> </div> <p>Videoleap is currently pioneering in this space, but we expect to see more comprehensive solutions emerging from leaders like ModernPhotoTools as the technology matures.</p> </div> </div> <div class="two-columns"> <div> <h3>3D and Immersive Backgrounds</h3> <p>The line between 2D background generation and 3D environment creation is blurring. Next-generation AI tools are beginning to generate three-dimensional, navigable spaces from simple prompts, opening new possibilities for virtual reality, augmented reality, and interactive media.</p> <div class="custom-list"> <li><strong>Depth Map Generation:</strong> Creating accurate spatial information for immersive experiences</li> <li><strong>Multi-Angle Consistency:</strong> Generating backgrounds that maintain coherence when viewed from different angles</li> <li><strong>Interactive Elements:</strong> Including responsive elements within generated backgrounds</li> </div> <p>This trend represents a significant evolution beyond traditional background generation, potentially transforming how we create and interact with virtual environments.</p> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/2af146ce-3cf8-43b9-8ff7-2a49d6595c03.jpg" alt="3D environment generated from a simple text prompt showing depth and spatial coherence"> </div> </div> <div class="two-columns"> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ce9a1ee5-bccd-424c-8ed8-951f77731170.jpg" alt="Collaborative AI background generation with multiple users contributing to a shared creative process"> </div> <div> <h3>Collaborative Creation</h3> <p>AI background generators are evolving to support collaborative workflows, allowing multiple users to contribute to and refine generated backgrounds in real-time. This trend is particularly valuable for creative teams working remotely or across different disciplines.</p> <div class="custom-list"> <li><strong>Multi-User Editing:</strong> Simultaneous contribution to background generation by team members</li> <li><strong>Role-Based Controls:</strong> Specialized interfaces for different team roles (art director, designer, client)</li> <li><strong>Version History:</strong> Tracking the evolution of generated backgrounds through iterations</li> </div> <p>Tools with strong collaboration features like Canva are expanding in this direction, while specialized platforms like ModernPhotoTools are adding team-oriented capabilities to their professional toolsets.</p> </div> </div> <h3>Ethical and Sustainable AI</h3> <p>As AI background generation becomes more widespread, ethical considerations and sustainability are emerging as important factors in tool selection and development:</p> <div class="two-columns"> <div> <h4>Ethical Considerations</h4> <div class="custom-list"> <li><strong>Transparent Training:</strong> Clear disclosure of what data was used to train AI models</li> <li><strong>Artist Attribution:</strong> Systems that acknowledge artistic influences or compensate artists</li> <li><strong>Content Safeguards:</strong> Preventing the generation of harmful or inappropriate content</li> <li><strong>Authenticity Indicators:</strong> Clear marking of AI-generated content to prevent misrepresentation</li> </div> </div> <div> <h4>Sustainability Focus</h4> <div class="custom-list"> <li><strong>Energy Efficiency:</strong> Optimized models that require less computational power</li> <li><strong>Local Processing:</strong> On-device generation to reduce cloud server demands</li> <li><strong>Resource Optimization:</strong> Smarter caching and processing to minimize environmental impact</li> <li><strong>Longevity Design:</strong> Creating timeless backgrounds that reduce the need for frequent regeneration</li> </div> </div> </div> <p>Leaders in the space like Adobe Firefly (with its focus on commercially licensed training data) and ModernPhotoTools (with its efficient processing algorithms) are setting standards for responsible AI background generation that others are likely to follow.</p> <div class="highlight-box"> <p><strong>Expert Insight:</strong> "The future of AI background generation isn't just about more realistic imagesโ€”it's about creating intelligent environments that understand context, adapt to needs, and integrate seamlessly with human creativity. The tools that will lead in 2026 and beyond are those that augment rather than replace the creative process."</p> </div> </section> <section id="how-to-choose"> <h2>How to Choose the Right AI Background Generator for Your Needs</h2> <p>With so many options available, selecting the ideal AI background generator requires careful consideration of your specific requirements. Here's a framework to help you make the right choice:</p> <div class="three-columns"> <div class="column-card"> <h3>Assess Your Primary Use Case</h3> <div class="custom-list"> <li><strong>Content Creation:</strong> Focus on tools with diverse style options and quick generation</li> <li><strong>Professional Photography:</strong> Prioritize output quality and precise control</li> <li><strong>E-commerce:</strong> Look for batch processing and consistent results</li> <li><strong>Marketing:</strong> Consider multi-format support and brand consistency features</li> <li><strong>Concept Art:</strong> Emphasize creative interpretation and artistic quality</li> </div> <p><strong>Best Match:</strong> For professional photography and precision, ModernPhotoTools AI Background Generator offers unmatched control and quality.</p> </div> <div class="column-card"> <h3>Evaluate Technical Requirements</h3> <div class="custom-list"> <li><strong>Output Resolution:</strong> Higher resolution needs may require premium tools</li> <li><strong>Processing Speed:</strong> Consider how quickly you need results</li> <li><strong>Integration Needs:</strong> Assess compatibility with your existing workflow</li> <li><strong>Batch Capabilities:</strong> Essential for processing multiple images</li> <li><strong>Export Formats:</strong> Ensure support for your required file types</li> </div> <p><strong>Best Match:</strong> For Adobe users, Firefly offers seamless integration, while ModernPhotoTools provides excellent standalone capabilities with robust export options.</p> </div> <div class="column-card"> <h3>Consider Practical Factors</h3> <div class="custom-list"> <li><strong>Budget:</strong> Balance features against cost constraints</li> <li><strong>Learning Curve:</strong> Assess time available to master new tools</li> <li><strong>Usage Volume:</strong> Match subscription tier to your generation needs</li> <li><strong>Support Quality:</strong> Consider available help resources</li> <li><strong>Future-Proofing:</strong> Look for tools with regular updates</li> </div> <p><strong>Best Match:</strong> For beginners, Canva offers an easy entry point, while ModernPhotoTools balances accessibility with professional features at competitive pricing.</p> </div> </div> <h3>Questions to Ask Before Choosing</h3> <div class="faq-container"> <div class="faq-item"> <h4 class="faq-question">What level of quality do I absolutely require?</h4> <div class="faq-answer"> <p>Be honest about your quality needs. For professional client work or premium brands, invest in tools with superior output like ModernPhotoTools or DALL-E 3. For social media or internal use, more accessible options like Canva may suffice.</p> </div> </div> <div class="faq-item"> <h4 class="faq-question">How important is integration with my existing workflow?</h4> <div class="faq-answer"> <p>If you're already invested in specific ecosystems (like Adobe), tools that integrate seamlessly (like Firefly) may be worth prioritizing even if standalone alternatives offer more features. Consider the time saved through smooth integration.</p> </div> </div> <div class="faq-item"> <h4 class="faq-question">Do I need background generation, replacement, or both?</h4> <div class="faq-answer"> <p>Some tools excel at creating new backgrounds from prompts (DALL-E 3, Midjourney) while others specialize in replacing backgrounds in existing images (ModernPhotoTools, Adobe Firefly). For comprehensive needs, choose tools that handle both effectively.</p> </div> </div> <div class="faq-item"> <h4 class="faq-question">What's my volume of background generation?</h4> <div class="faq-answer"> <p>For high-volume needs like e-commerce product catalogs, prioritize tools with robust batch processing and favorable pricing for high usage. ModernPhotoTools and Canva offer strong options for different volume requirements.</p> </div> </div> <div class="faq-item"> <h4 class="faq-question">How much control do I need over the generation process?</h4> <div class="faq-answer"> <p>If you need precise control over every aspect of your backgrounds, tools like ModernPhotoTools and Midjourney offer extensive parameters. If you prefer simplicity, Canva and Fotor provide more streamlined experiences.</p> </div> </div> </div> <div class="blockquote"> <p>The best AI background generator isn't necessarily the one with the most features or highest price tagโ€”it's the one that aligns most closely with your specific workflow, quality requirements, and creative objectives.</p> <p class="blockquote-author">โ€” Professional Photographer and AI Consultant</p> </div> <div class="cta-block"> <h3 class="cta-block-title">Try the Most Versatile AI Background Generator Today</h3> <p class="cta-block-text">ModernPhotoTools AI Background Generator offers the perfect balance of professional quality, intuitive controls, and flexible features to meet the needs of photographers, designers, and content creators.</p> <div class="cta-block-buttons"> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn">Start Creating Beautiful Backgrounds</a> </div> </div> </section> <section id="conclusion"> <h2>Conclusion: The Future of Backgrounds is AI-Powered</h2> <p>As we've explored throughout this comprehensive guide to the best AI background generators in 2025, artificial intelligence has fundamentally transformed how we create, edit, and conceptualize visual backgrounds. What once required expensive photo shoots, complex manual editing, or limited stock image libraries can now be accomplished in minutes with the right AI tools.</p> <p>The landscape of AI background generation continues to evolve rapidly, with tools becoming increasingly specialized, powerful, and accessible. From the artistic excellence of Midjourney to the intuitive simplicity of Canva, from the professional precision of ModernPhotoTools to the ecosystem integration of Adobe Firefly, there's now a solution for virtually every background generation need.</p> <div class="two-columns"> <div> <h3>Key Takeaways</h3> <div class="custom-list"> <li><strong>Quality Matters:</strong> The gap between professional and consumer-grade AI background tools has narrowed, but significant differences remain in output quality and control</li> <li><strong>Specialization Continues:</strong> Tools are increasingly focusing on specific use cases rather than trying to be all-in-one solutions</li> <li><strong>Integration is Key:</strong> The most effective tools work seamlessly with existing creative workflows</li> <li><strong>Ethical Considerations Growing:</strong> Transparency about AI training data and usage rights is becoming a critical factor in tool selection</li> <li><strong>Democratization of Creation:</strong> AI background generators are making professional-quality visual creation accessible to everyone</li> </div> </div> <div> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/bdf7dd76-af6e-4f71-a6e7-1822468e7d61.jpg" alt="Visual representation of the evolution of AI background generation from basic to advanced capabilities"> </div> </div> <h3>Our Top Recommendations</h3> <div class="three-columns"> <div class="column-card"> <h4>Best Overall: ModernPhotoTools AI Background Generator</h4> <p>Combining professional-grade output quality with an intuitive interface and comprehensive feature set, ModernPhotoTools offers the most balanced solution for serious creators who demand both quality and efficiency.</p> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn cta-btn-small">Try It Free</a> </div> </div> <div class="column-card"> <h4>Best for Artistic Quality: Midjourney</h4> <p>For creators who prioritize aesthetic excellence and artistic coherence in their backgrounds, Midjourney's distinctive style and powerful parameter controls make it the standout choice.</p> </div> <div class="column-card"> <h4>Best for Beginners: Canva</h4> <p>With its unmatched ease of use and all-in-one design capabilities, Canva remains the most accessible entry point for those new to AI background generation.</p> </div> </div> <p>As AI background generation technology continues to advance, we can expect even more impressive capabilities, greater specialization, and more seamless integration with creative workflows. The tools that will lead the field will be those that balance technological innovation with user-centered design and ethical considerations.</p> <p>Whether you're a professional photographer looking to expand your client offerings, an e-commerce business seeking to streamline product imagery, or a content creator wanting to elevate your visual storytelling, there's never been a better time to incorporate AI background generation into your creative process.</p> <div class="cta-block"> <h3 class="cta-block-title">Experience the Future of Background Creation Today</h3> <p class="cta-block-text">Join thousands of photographers, designers, and content creators who are transforming their visual content with ModernPhotoTools AI Background Generator.</p> <div class="cta-block-buttons"> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn cta-btn-large">Get Started Now</a> </div> </div> </section></div> <style>.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating="0"]{--rating: 0}.styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5}.styled-container .rating-stars[data-rating="1"]{--rating: 1}.styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5}.styled-container .rating-stars[data-rating="2"]{--rating: 2}.styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5}.styled-container .rating-stars[data-rating="3"]{--rating: 3}.styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5}.styled-container .rating-stars[data-rating="4"]{--rating: 4}.styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1}.styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2}.styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3}.styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4}.styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5}.styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6}.styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7}.styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8}.styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9}.styled-container .rating-stars[data-rating="5"]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""}.styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype="https://schema.org/FAQPage"]{margin-bottom:20px}.styled-container section[itemtype="https://schema.org/FAQPage"] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns>div:not([class]),.styled-container .three-columns>div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}</style>
๐Ÿ“„ ai-image-enhancement-guide.md
--- id: ai-image-enhancement-guide title: "AI Image Enhancement: Transform Your Photos with AI Technology" excerpt: "Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools' AI Image Upscaler for professional-quality results." publishDate: "2025-03-14" readTime: "16 min read" category: tools featuredImage: "https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg" relatedTool: "ai-image-enhancer" keywords: ["AI image enhancement", "photo enhancement", "image upscaler", "AI photo editor", "image quality improvement"] metaTitle: "AI Image Enhancement: Transform Your Photos with AI Technology" metaDescription: "Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools' AI Image Upscaler for professional-quality results." faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Can AI really improve low-quality images?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, AI image enhancement can significantly improve low-quality images by reducing noise, sharpening details, and even reconstructing missing information based on trained patterns. While it can't create details that don't exist in some form in the original, modern AI is remarkably effective at bringing out hidden details and improving overall quality." } }, { "@type": "Question", "name": "Is AI enhancement better than professional manual editing?", "acceptedAnswer": { "@type": "Answer", "text": "AI enhancement and professional manual editing serve different purposes. AI excels at speed, consistency, and accessibility, making it ideal for batch processing or users without editing expertise. Professional manual editing offers more precise control and creative direction. Many professionals now use AI as a starting point before applying manual finishing touches." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>AI Image Enhancement: Transform Your Photos with AI Technology</h1> <p class="article-intro">Have you ever taken what should have been a perfect photo, only to find it blurry, pixelated, or lacking detail? Or perhaps you've discovered old family photos that have faded with time? <strong>AI image enhancement</strong> is revolutionizing how we restore, improve, and transform digital images. This cutting-edge technology can breathe new life into your photos with just a few clicks, delivering results that once required hours of expert editing.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Image Upscaler</h3> <p class="cta-block-text">Transform your photos with professional-quality AI enhancement in seconds. No signup required!</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" rel="nofollow">Enhance Images Now</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#what-is-ai-image-enhancement">What Is AI Image Enhancement?</a></li> <li><a href="#how-ai-image-enhancement-works">How AI Image Enhancement Works</a></li> <li><a href="#benefits">Benefits of AI Image Enhancement</a></li> <li><a href="#use-cases">Common Use Cases for AI Image Enhancement</a></li> <li><a href="#comparison-table">Comparing AI Enhancement Approaches</a></li> <li><a href="#how-to-use">How to Use Modern Photo Tools' AI Image Upscaler</a></li> <li><a href="#best-practices">Best Practices for Optimal Results</a></li> <li><a href="#future-trends">Future Trends in AI Image Enhancement</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> </ul> </div> <section id="what-is-ai-image-enhancement"> <h2>What Is AI Image Enhancement?</h2> <p>AI image enhancement uses artificial intelligence algorithms to automatically improve digital images by reducing noise, increasing resolution, sharpening details, and correcting various quality issues. Unlike traditional photo editing that requires manual adjustments, AI enhancement analyzes your image and applies sophisticated improvements based on patterns learned from millions of high-quality images.</p> <div class="img-container"> <img alt="Before and after comparison showing AI image enhancement results" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg" class="responsive-image"> <p class="image-caption">AI enhancement can dramatically improve image quality with a single click</p> </div> <p>The technology works by training neural networks on vast datasets of image pairsโ€”low-quality images matched with their high-quality counterparts. This training enables the AI to "understand" what a sharp, clear version of a blurry or pixelated image should look like.</p> </section> <section id="how-ai-image-enhancement-works"> <h2>How AI Image Enhancement Works</h2> <p>Understanding the technology behind AI image enhancement helps you make the most of these powerful tools. Here's how the process works:</p> <div class="feature-grid"> <div class="feature-card"> <h3>Machine Learning</h3> <p>AI models are trained on millions of image pairs to learn patterns of degradation and restoration. This training enables them to recognize and correct common image problems automatically.</p> </div> <div class="feature-card"> <h3>Pattern Recognition</h3> <p>The AI analyzes your image to identify specific issues like noise, blur, or low resolution, then applies the most appropriate enhancement techniques for each problem area.</p> </div> <div class="feature-card"> <h3>Super-Resolution Technology</h3> <p>Advanced algorithms can intelligently predict and generate new pixels when upscaling images, creating detail that looks natural and maintains image integrity.</p> </div> </div> <div class="img-container"> <img alt="Diagram showing AI image enhancement process workflow" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9725f897-d086-454c-81f7-e8d4e13d5a2b.jpg" class="responsive-image"> <p class="image-caption">The AI enhancement process: from analysis to intelligent improvement</p> </div> <div class="cta-block"> <h3 class="cta-block-title">Experience AI Enhancement</h3> <p class="cta-block-text">See how our AI technology can transform your images with intelligent, automatic improvements.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="2" rel="nofollow">Try AI Enhancement</a> </div> </section> <section id="benefits"> <h2>Benefits of AI Image Enhancement</h2> <p>AI image enhancement offers numerous advantages over traditional editing methods. Understanding these benefits helps explain why this technology has become so popular among photographers, content creators, and businesses.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/3cbdaf46-cb5e-49e5-8f6d-6aca5de18800.jpg" alt="Photographer reviewing enhanced images on computer screen" class="article-image"> <div class="two-columns"> <div class="benefits-section"> <h3>โœ… Advantages of AI Enhancement</h3> <ul class="custom-list"> <li>Saves hours of manual editing time</li> <li>Recovers details in low-quality or damaged photos</li> <li>Increases resolution without losing quality</li> <li>Maintains natural-looking results</li> <li>Works with various image types (portraits, landscapes, products)</li> <li>Accessible to non-professionals</li> <li>Consistent results across multiple images</li> </ul> </div> <div class="limitations-section"> <h3>โŒ Limitations of Traditional Editing</h3> <ul class="custom-list"> <li>Requires technical expertise</li> <li>Time-consuming manual adjustments</li> <li>Limited ability to recover lost details</li> <li>Inconsistent results between images</li> <li>Enlarging images causes quality loss</li> <li>Steep learning curve for software</li> <li>Often requires expensive software</li> </ul> </div> </div> <div class="feature-grid"> <div class="feature-card"> <h4>โšก Time Efficiency</h4> <p>Perhaps the most significant advantage of AI enhancement is time savings. What might take an expert editor 30 minutes to an hour can be accomplished in seconds with AI. This efficiency is particularly valuable for photographers, content creators, and businesses that need to process multiple images quickly.</p> </div> <div class="feature-card"> <h4>๐ŸŽฏ Quality Improvement</h4> <p>AI enhancers can dramatically improve image quality by reducing noise, sharpening details, and optimizing colors. The technology is particularly effective at recovering details in underexposed or overexposed areas, fixing blurriness, and enhancing textures.</p> </div> <div class="feature-card"> <h4>๐ŸŒŸ Accessibility</h4> <p>You don't need to be a Photoshop expert to achieve professional results with AI enhancement tools. The technology democratizes high-quality image editing, making it accessible to everyone from casual photographers to business owners managing their own content.</p> </div> </div> </section> <section id="use-cases"> <h2>Common Use Cases for AI Image Enhancement</h2> <p>AI image enhancement has applications across numerous fields and scenarios. Here are some of the most common ways people are using this technology:</p> <div class="use-case-grid"> <div class="use-case-item"> <div class="img-container"> <img alt="Old family photo being restored with AI" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/2766a62e-9c48-4e3e-b53a-f555d6855805.jpg" class="responsive-image"> </div> <h3>Restoring Old Photos</h3> <p>Breathe new life into faded family photos, fix scratches and damage, and even colorize black and white images. AI restoration preserves precious memories that might otherwise be lost to time.</p> </div> <div class="use-case-item"> <div class="img-container"> <img alt="Product photography enhancement for e-commerce" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/c6b37a5a-dd14-46cb-af32-2f1ea8f31bf4.jpg" class="responsive-image"> </div> <h3>E-Commerce Product Images</h3> <p>Online retailers use AI enhancement to create professional-looking product photos that drive sales. Enhanced images show greater detail, better color accuracy, and more appealing presentation.</p> </div> <div class="use-case-item"> <div class="img-container"> <img alt="Social media content being enhanced for better engagement" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d790bc37-0cba-4b81-877d-ba6339e9cc49.jpg" class="responsive-image"> </div> <h3>Social Media Content</h3> <p>Content creators enhance images to stand out in crowded social feeds. AI tools help create eye-catching posts that generate higher engagement without requiring professional photography equipment.</p> </div> <div class="use-case-item"> <div class="img-container"> <img alt="Real estate photography enhanced to showcase property features" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/130ba461-4d2a-4bc9-aeb8-dfcb2435a86c.jpg" class="responsive-image"> </div> <h3>Real Estate Photography</h3> <p>Real estate professionals use AI enhancement to make property listings more attractive. Enhanced photos can highlight architectural details, improve lighting, and make spaces appear more inviting.</p> </div> <div class="use-case-item"> <div class="img-container"> <img alt="Professional photographer editing portfolio images" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/56d62bc3-113a-4a3e-af8f-9aa3fbaa4c5f.jpg" class="responsive-image"> </div> <h3>Professional Photography</h3> <p>Even professional photographers use AI enhancement to refine their work, fix minor issues, and save time in post-processing. It's becoming an essential tool in modern photography workflows.</p> </div> <div class="use-case-item"> <div class="img-container"> <img alt="Digital art being upscaled and enhanced" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/e2308c97-59c7-4b55-ad55-5389515bd93d.jpg" class="responsive-image"> </div> <h3>Digital Art Enhancement</h3> <p>Artists and designers use AI upscaling to enhance digital artwork, illustrations, and graphics. This allows for larger prints and displays without quality loss.</p> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Have photos that need enhancement?</h3> <p class="cta-block-text">Whether you're restoring old memories or preparing images for professional use, our AI Image Upscaler can help.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="3" rel="nofollow">Try AI Image Upscaler</a> </div> </section> <section id="comparison-table"> <h2>Comparing AI Enhancement Approaches</h2> <p>Not all AI image enhancers are created equal. Different tools use various approaches and algorithms, each with their own strengths. Let's compare some of the leading approaches to AI image enhancement:</p> <div class="table-container"> <table class="responsive-table"> <thead> <tr> <th>Enhancement Approach</th> <th>Best For</th> <th>Processing Speed</th> <th>Quality Results</th> <th>Ease of Use</th> </tr> </thead> <tbody> <tr> <td data-label="Enhancement Approach">General AI Enhancement</td> <td data-label="Best For">All-purpose photo improvement</td> <td data-label="Processing Speed">Fast</td> <td data-label="Quality Results">Good</td> <td data-label="Ease of Use">Very Easy</td> </tr> <tr> <td data-label="Enhancement Approach">Super-Resolution</td> <td data-label="Best For">Enlarging small images</td> <td data-label="Processing Speed">Medium</td> <td data-label="Quality Results">Excellent</td> <td data-label="Ease of Use">Easy</td> </tr> <tr> <td data-label="Enhancement Approach">Noise Reduction AI</td> <td data-label="Best For">Low-light photos</td> <td data-label="Processing Speed">Medium</td> <td data-label="Quality Results">Very Good</td> <td data-label="Ease of Use">Easy</td> </tr> <tr> <td data-label="Enhancement Approach">Portrait Enhancement</td> <td data-label="Best For">Face and skin improvement</td> <td data-label="Processing Speed">Medium</td> <td data-label="Quality Results">Excellent</td> <td data-label="Ease of Use">Medium</td> </tr> <tr> <td data-label="Enhancement Approach">Photo Restoration</td> <td data-label="Best For">Damaged or old photos</td> <td data-label="Processing Speed">Slow</td> <td data-label="Quality Results">Very Good</td> <td data-label="Ease of Use">Medium</td> </tr> </tbody> </table> </div> <div class="modern-tools-section"> <h3>Modern Photo Tools' Approach</h3> <div class="img-container"> <img alt="AI Image Upscaler Tool - Modern Phototools" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/346bac7e-dc27-4799-8eac-c6e559453cb7.jpg" class="responsive-image"> </div> <p>Modern Photo Tools' AI Image Upscaler combines multiple AI enhancement technologies to deliver optimal results across various image types. Our approach balances processing speed with quality results, focusing on creating natural-looking enhancements rather than over-processed images.</p> <p>The tool uses advanced neural networks trained on millions of high-quality images to recognize patterns, textures, and details that should be present in your photos. This allows it to intelligently enhance images without the artificial look that can come from traditional filters.</p> </div> </section> <section id="how-to-use"> <h2>How to Use Modern Photo Tools' AI Image Upscaler</h2> <p>Enhancing your images with our AI tool is quick and straightforward. Follow these simple steps to transform your photos in seconds:</p> <div class="steps-container"> <ol class="step-list"> <li><strong>Visit Our AI Image Upscaler tool</strong> at <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" rel="nofollow">Image Upscaler</a></li> <li><strong>Upload your image</strong> by dragging and dropping it onto the page or clicking the upload button</li> <li><strong>Select your enhancement options</strong> based on your needs 2X Or 4X (resolution increase, noise reduction, etc.)</li> <li><strong>Click "Enhance"</strong> and wait a few seconds for the AI to process your image</li> <li><strong>Preview the results</strong> and make any adjustments if needed</li> <li><strong>Download your enhanced image</strong> in your preferred format</li> </ol> </div> <div class="img-container"> <img alt="Step-by-step process of using Modern Photo Tools' AI Image Upscaler" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/1b8d36cb-0a8c-42dd-93ca-4141aed561b2.jpg" class="responsive-image"> </div> <div class="supported-formats"> <h3>Supported Image Formats</h3> <p>Our AI Image Upscaler supports all common image formats, including:</p> <ul class="format-list"> <li>JPEG/JPG</li> <li>PNG</li> <li>WEBP</li> <li>HEIC</li> <li>BMP</li> </ul> </div> <div class="tip-box"> <h4>๐Ÿ’ก Pro Tip</h4> <p>For best results, start with the highest quality original image available. While our AI can work wonders, beginning with a better source image will always yield superior results.</p> </div> </section> <section id="best-practices"> <h2>Best Practices for Optimal Results</h2> <p>To get the most out of AI image enhancement, follow these expert recommendations:</p> <div class="two-columns"> <div class="dos-section"> <h3>โœ… Do's</h3> <ul class="custom-list"> <li><strong>Start with the best original possible</strong> - Use the highest resolution version of your image</li> <li><strong>Be selective with enhancement levels</strong> - Sometimes subtle enhancement looks more natural than maximum settings</li> <li><strong>Compare before and after</strong> - Check that the enhancement preserves the important details and character of your image</li> <li><strong>Use specific enhancement types for specific problems</strong> - Target noise reduction for grainy photos, super-resolution for small images</li> <li><strong>Save in high-quality formats</strong> - Use PNG for graphics or JPG at 90%+ quality for photos</li> </ul> </div> <div class="donts-section"> <h3>โŒ Don'ts</h3> <ul class="custom-list"> <li><strong>Don't over-enhance</strong> - Excessive enhancement can create unnatural results</li> <li><strong>Don't expect miracles from extremely poor sources</strong> - Even AI has limits with severely damaged or tiny images</li> <li><strong>Don't ignore artifacts</strong> - Check enhanced images for any unusual patterns or distortions</li> <li><strong>Don't compress heavily after enhancement</strong> - This defeats the purpose of enhancement</li> <li><strong>Don't use a one-size-fits-all approach</strong> - Different image types benefit from different enhancement settings</li> </ul> </div> </div> <div class="img-container"> <img alt="Before and after comparison showing proper enhancement versus over-enhancement" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/edc260b9-c44c-49cb-b907-f6f109c62128.jpg" class="responsive-image"> <p class="image-caption">Comparison showing original image (left), proper enhancement (center), and over-enhancement (right)</p> </div> </section> <section id="future-trends"> <h2>Future Trends in AI Image Enhancement</h2> <p>The field of AI image enhancement continues to evolve rapidly. Here are the key trends shaping the future:</p> <div class="feature-grid"> <div class="feature-card"> <h3>Context-Aware Enhancement</h3> <p>Future AI systems will better understand image content, applying different enhancement techniques to faces, landscapes, text, and objects within the same image for more intelligent processing.</p> </div> <div class="feature-card"> <h3>Video Enhancement</h3> <p>Real-time video enhancement is becoming more accessible, allowing for live streaming improvements and batch processing of video content with temporal consistency.</p> </div> <div class="feature-card"> <h3>Real-Time Processing</h3> <p>Mobile devices and web browsers are gaining the capability to perform AI enhancement in real-time, making professional-quality enhancement available instantly.</p> </div> </div> </section> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-container"> <div class="faq-item"> <h3>Can AI really improve low-quality images?</h3> <p>Yes, AI can significantly improve low-quality images by reducing noise, enhancing details, and increasing resolution. However, the results depend on the original image quality and the specific AI algorithms used. While AI can work wonders, it cannot create detail that was never there in the first place.</p> </div> <div class="faq-item"> <h3>How does AI enhancement compare to manual photo editing?</h3> <p>AI enhancement is much faster and more consistent than manual editing, making it ideal for batch processing and quick improvements. Manual editing offers more creative control and can achieve specific artistic effects that AI might not replicate. The best approach often combines both methods.</p> </div> <div class="faq-item"> <h3>Will AI-enhanced images look artificial?</h3> <p>Modern AI enhancement tools are designed to produce natural-looking results. However, over-enhancement or using inappropriate settings can create artificial appearances. The key is using the right level of enhancement for your specific image and purpose.</p> </div> <div class="faq-item"> <h3>Can AI upscale images without losing quality?</h3> <p>AI upscaling can increase image size while maintaining and often improving quality, especially compared to traditional interpolation methods. AI can intelligently predict and reconstruct details, making enlarged images look sharper and more detailed than conventional upscaling methods.</p> </div> <div class="faq-item"> <h3>Is my data safe when using online AI enhancement tools?</h3> <p>Reputable AI enhancement services prioritize data security and privacy. Look for tools that process images securely, don't store your images permanently, and have clear privacy policies. Modern Photo Tools, for example, processes images securely and doesn't retain your personal photos.</p> </div> </div> </section> <div class="cta-block"> <h2>Transform Your Photos Today</h2> <p>Ready to experience the power of AI image enhancement? Try our advanced AI Image Upscaler and see the difference intelligent enhancement can make to your photos.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="4" rel="nofollow">Enhance Your Images Now</a> </div> </div>
๐Ÿ“„ best-photo-background-editors-2025.md
--- id: "best-photo-background-editors-2025" title: "10 Best Photo Background Editors for Perfect Images in 2025" excerpt: "Discover the best photo background editors of 2025! Compare top tools for removing, replacing, and enhancing backgrounds. Try our free online editor to transform your images instantly." publishDate: "2025-10-01" readTime: "18 min read" category: "tools" featuredImage: "https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg" relatedTool: "remove-background" keywords: ["best photo background editors", "background removal tools", "photo editing software", "image background editor", "AI background removal"] metaTitle: "10 Best Photo Background Editors for Perfect Images in 2025" metaDescription: "Discover the best photo background editors of 2025! Compare top tools for removing, replacing, and enhancing backgrounds. Try our free online editor to transform your images instantly." faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What are the best photo background editors in 2025?", "acceptedAnswer": { "@type": "Answer", "text": "The best photo background editors in 2025 include Modern Photo Tools, PhotoRoom, Remove.bg, Canva, Adobe Photoshop, PicsArt, Fotor, GIMP, Photoshop Express, and Affinity Photo. Each offers unique features for different user needs and skill levels." } }, { "@type": "Question", "name": "Which photo background editor is best for beginners?", "acceptedAnswer": { "@type": "Answer", "text": "Modern Photo Tools and Remove.bg are the best photo background editors for beginners, offering one-click background removal with AI technology. They require no technical skills and provide instant results." } }, { "@type": "Question", "name": "Are there free photo background editors available?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, several free photo background editors are available including Modern Photo Tools (completely free), GIMP (open-source), and free versions of PhotoRoom, Canva, and PicsArt with some limitations." } }, { "@type": "Question", "name": "What should I look for in a photo background editor?", "acceptedAnswer": { "@type": "Answer", "text": "When choosing the best photo background editors, consider accuracy of background removal, ease of use, processing speed, supported file formats, pricing, and additional editing features like background replacement and object removal." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>10 Best Photo Background Editors for Perfect Images in 2025</h1> <p class="article-intro">Finding the perfect <strong>best photo background editors</strong> can transform your photography workflow and dramatically improve your image quality. Whether you're a professional photographer, e-commerce seller, or social media enthusiast, having the right background editing tool is essential for creating stunning visuals that stand out.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free Background Removal Tool</h3> <p class="cta-block-text">Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!</p> <a href="https://modernphototools.com/tools/remove-background" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >Remove Background Now</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#why-you-need-background-editor">Why You Need a Quality Background Editor</a></li> <li><a href="#comparison-table">Quick Comparison: Top Background Editors</a></li> <li><a href="#modern-photo-tools">1. Modern Photo Tools - Best All-Around Background Editor</a></li> <li><a href="#photoroom">2. PhotoRoom - Best for E-commerce Product Photos</a></li> <li><a href="#remove-bg">3. Remove.bg - Best for One-Click Background Removal</a></li> <li><a href="#canva">4. Canva - Best for Design Integration</a></li> <li><a href="#adobe-photoshop">5. Adobe Photoshop - Best for Professional Editing</a></li> <li><a href="#picsart">6. PicsArt - Best Mobile Background Editor</a></li> <li><a href="#fotor">7. Fotor - Best for Batch Processing</a></li> <li><a href="#gimp">8. GIMP - Best Free Desktop Alternative</a></li> <li><a href="#photoshop-express">9. Photoshop Express - Best Quick Mobile Editor</a></li> <li><a href="#affinity-photo">10. Affinity Photo - Best One-Time Purchase</a></li> <li><a href="#how-to-choose">How to Choose the Right Background Editor</a></li> <li><a href="#tips-tricks">Tips for Better Background Removal</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> <li><a href="#conclusion">Conclusion</a></li> </ul> </div> <section id="why-you-need-background-editor"> <h2>Why You Need a Quality Background Editor</h2> <div class="img-container"> <img alt="Before and after comparison of product photo with background removed" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg" class="responsive-image"> </div> <p>Background editing has become an essential skill for anyone working with digital images. Here's why investing in a quality background editor is worth your time:</p> <div class="two-columns"> <div> <h3>For E-commerce Sellers</h3> <ul class="custom-list"> <li>Create consistent product photos with clean white backgrounds</li> <li>Increase conversion rates with professional-looking listings</li> <li>Meet marketplace requirements (like Amazon's white background policy)</li> <li>Easily create seasonal promotional images by swapping backgrounds</li> </ul> </div> <div> <h3>For Content Creators</h3> <ul class="custom-list"> <li>Remove distractions from portrait and profile photos</li> <li>Create consistent branding across social media platforms</li> <li>Produce professional-looking content without a studio setup</li> <li>Save time with batch processing for multiple images</li> </ul> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free Background Removal Tool</h3> <p class="cta-block-text">Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!</p> <a href="https://modernphototools.com/tools/remove-background" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >Remove Background Now</a> </div> </section> <section id="comparison-table"> <h2>Quick Comparison: Top Background Editors</h2> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <td data-row="head">Tool</td> <td data-row="head">Best For</td> <td data-row="head">Free Option</td> <td data-row="head">AI-Powered</td> <td data-row="head">Platforms</td> </tr> </thead> <tbody> <tr> <td data-label="Tool">Modern Photo Tools</td> <td data-label="Best For">All-purpose, quick edits</td> <td data-label="Free Option">Yes</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">Web</td> </tr> <tr> <td data-label="Tool">PhotoRoom</td> <td data-label="Best For">E-commerce products</td> <td data-label="Free Option">Limited</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">iOS, Android</td> </tr> <tr> <td data-label="Tool">Remove.bg</td> <td data-label="Best For">One-click removal</td> <td data-label="Free Option">Limited</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">Web, API</td> </tr> <tr> <td data-label="Tool">Canva</td> <td data-label="Best For">Design integration</td> <td data-label="Free Option">No (Pro feature)</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">Web, iOS, Android</td> </tr> <tr> <td data-label="Tool">Adobe Photoshop</td> <td data-label="Best For">Professional editing</td> <td data-label="Free Option">No</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">Windows, Mac</td> </tr> <tr> <td data-label="Tool">PicsArt</td> <td data-label="Best For">Mobile background editing</td> <td data-label="Free Option">Limited (with watermarks)</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">iOS, Android, Web</td> </tr> <tr> <td data-label="Tool">Fotor</td> <td data-label="Best For">Batch processing</td> <td data-label="Free Option">Limited</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">Web, iOS, Android</td> </tr> <tr> <td data-label="Tool">GIMP</td> <td data-label="Best For">Free desktop alternative</td> <td data-label="Free Option">Yes (completely free)</td> <td data-label="AI-Powered">No (manual tools)</td> <td data-label="Platforms">Windows, Mac, Linux</td> </tr> <tr> <td data-label="Tool">Photoshop Express</td> <td data-label="Best For">Quick mobile editing</td> <td data-label="Free Option">Limited</td> <td data-label="AI-Powered">Yes</td> <td data-label="Platforms">iOS, Android</td> </tr> <tr> <td data-label="Tool">Affinity Photo</td> <td data-label="Best For">One-time purchase</td> <td data-label="Free Option">No</td> <td data-label="AI-Powered">No (manual tools)</td> <td data-label="Platforms">Windows, Mac, iPad</td> </tr> </tbody> </table> </div> <p>Now let's dive deeper into each of these tools to help you find the perfect match for your background editing needs.</p> </section> <section id="modern-photo-tools"> <h2>1. Modern Photo Tools - Best All-Around Background Editor</h2> <div class="img-container"> <img alt="Modern Photo Tools interface showing advanced background removal capabilities" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/8620e47a-f327-4c8f-aeff-ebeec96d90ad.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.9"></div> <span class="rating-text">4.9/5 - Excellent</span> </div> <p>Modern Photo Tools stands out as the <strong>best photo background editor</strong> for 2025, offering a perfect combination of advanced AI technology, user-friendly interface, and completely free access. This tool has revolutionized background removal by making professional-quality editing accessible to everyone.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Completely free with no limitations</li> <li>Advanced AI technology for precise edge detection</li> <li>Handles complex subjects like hair and fur excellently</li> <li>Fast processing (under 5 seconds)</li> <li>No watermarks or signup required</li> <li>Privacy-focused - images not stored</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Web-based only (no desktop app)</li> <li>Limited advanced editing features</li> <li>Requires internet connection</li> </ul> </div> </div> <div class="feature-grid"> <div class="feature-card"> <h4>๐Ÿค– AI Technology</h4> <p>State-of-the-art machine learning algorithms that accurately detect and remove backgrounds from complex images</p> </div> <div class="feature-card"> <h4>โšก Lightning Fast</h4> <p>Process images in under 5 seconds with exceptional quality results</p> </div> <div class="feature-card"> <h4>๐Ÿ”’ Privacy First</h4> <p>All processing happens securely without storing your images on our servers</p> </div> <div class="feature-card"> <h4>๐Ÿ’ฐ Completely Free</h4> <p>No hidden costs, subscriptions, or limitations on your final images</p> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Try Modern Photo Tools Now</h3> <p class="cta-block-text">Experience the fastest and most accurate background removal tool available online - completely free!</p> <a href="https://modernphototools.com/tools/remove-background" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="2" >Remove Backgrounds Instantly</a> </div> </section> <section id="photoroom"> <h2>2. PhotoRoom - Best for E-commerce Product Photos</h2> <div class="img-container"> <img alt="PhotoRoom app interface showing product photography editing" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/aaffc191-1822-453a-af38-349874b14c96.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.7"></div> <span class="rating-text">4.7/5 - Very Good</span> </div> <p>PhotoRoom has carved out a niche as the go-to background editor for e-commerce sellers and product photographers. With specialized templates and features designed specifically for product photography, it's an excellent choice for online retailers.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Specialized e-commerce templates</li> <li>Excellent product photo optimization</li> <li>Mobile-first design</li> <li>Batch processing capabilities</li> <li>Professional product backgrounds</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Limited free version</li> <li>Subscription required for full features</li> <li>Mobile app only</li> <li>Can struggle with complex backgrounds</li> </ul> </div> </div> <div class="pricing-card"> <h4>๐Ÿ’ฐ Pricing</h4> <ul> <li><strong>Free:</strong> 40 images/month with watermark</li> <li><strong>Pro:</strong> $9.99/month - Unlimited images, no watermark</li> <li><strong>Team:</strong> $19.99/month - Multiple users, advanced features</li> </ul> </div> </section> <section id="remove-bg"> <h2>3. Remove.bg - Best for One-Click Background Removal</h2> <div class="img-container"> <img alt="Remove.bg interface showing one-click background removal" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/462244b9-c856-4b37-a265-abab02c62742.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.6"></div> <span class="rating-text">4.6/5 - Very Good</span> </div> <p>Remove.bg pioneered the one-click background removal concept and remains one of the most popular tools in this category. It's particularly effective for portraits and people photography.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Extremely simple to use</li> <li>Excellent for portraits</li> <li>API available for developers</li> <li>Consistent results</li> <li>Fast processing</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Limited free credits</li> <li>Struggles with complex objects</li> <li>No manual editing tools</li> <li>Expensive for high volume</li> </ul> </div> </div> </section> <section id="canva"> <h2>4. Canva - Best for Design Integration</h2> <div class="img-container"> <img alt="Canva background remover integrated with design tools at Modern Phototools" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/f6ed16fe-6875-4799-bd57-3d88384ef62b.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.5"></div> <span class="rating-text">4.5/5 - Good</span> </div> <p>Canva's background remover is part of their comprehensive design platform, making it ideal for users who need background removal as part of a larger design workflow.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Integrated with design tools</li> <li>Extensive template library</li> <li>Easy to use interface</li> <li>Good for social media content</li> <li>Collaborative features</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Requires Canva Pro subscription</li> <li>Limited to Canva ecosystem</li> <li>Not as accurate as specialized tools</li> <li>Can be slow with large images</li> </ul> </div> </div> </section> <section id="adobe-photoshop"> <h2>5. Adobe Photoshop - Best for Professional Editing</h2> <div class="img-container"> <img alt="Adobe Photoshop advanced background removal tools" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/6159469b-2a19-4228-95e0-ec1247142735.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.8"></div> <span class="rating-text">4.8/5 - Excellent</span> </div> <p>Adobe Photoshop remains the gold standard for professional image editing, offering the most advanced and precise background removal tools available.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Most advanced editing capabilities</li> <li>Perfect precision control</li> <li>Professional-grade tools</li> <li>Extensive plugin ecosystem</li> <li>Industry standard</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Steep learning curve</li> <li>Expensive subscription</li> <li>Overkill for simple tasks</li> <li>Resource intensive</li> </ul> </div> </div> </section> <section id="picsart"> <h2>6. PicsArt - Best Mobile Background Editor</h2> <div class="img-container"> <img alt="PicsArt background removal interface" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/b008104c-0f4a-40cd-b3ba-c874e93eb849.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.3"></div> <span class="rating-text">4.3/5 - Good</span> </div> <p>PicsArt is a popular mobile-first editor with strong social media integration, offering AI background removal, replacement, and effects. It's particularly well-suited for creative content creators and social media enthusiasts.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Excellent mobile interface</li> <li>Strong social media integration</li> <li>Creative effects and filters</li> <li>Active community features</li> <li>Regular updates and new features</li> <li>Good AI background removal</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Free version includes watermarks</li> <li>Subscription required for best features</li> <li>Can be overwhelming for beginners</li> <li>Limited desktop functionality</li> </ul> </div> </div> </section> <section id="fotor"> <h2>7. Fotor - Best for Batch Processing</h2> <div class="img-container"> <img alt="Fotor background editing tools" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/83d8f480-ccc1-4c3b-b5f5-370a4de262bd.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.2"></div> <span class="rating-text">4.2/5 - Good</span> </div> <p>Fotor is a web-based editor with AI background removal and extensive photo enhancement tools. It offers a good balance between features and accessibility, making it ideal for users who need to process multiple images efficiently.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Excellent batch processing capabilities</li> <li>User-friendly web interface</li> <li>Good AI background removal</li> <li>Comprehensive editing tools</li> <li>Template library included</li> <li>Cross-platform availability</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Limited free features</li> <li>Requires subscription for advanced tools</li> <li>Can be slow with large files</li> <li>Internet connection required</li> </ul> </div> </div> </section> <section id="gimp"> <h2>8. GIMP - Best Free Desktop Alternative</h2> <div class="img-container"> <img alt="GIMP with background removal plugins" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/c96fc9eb-d654-40fe-a458-65d9d45496c8.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.0"></div> <span class="rating-text">4.0/5 - Good</span> </div> <p>GIMP (GNU Image Manipulation Program) is a free, open-source alternative to Photoshop. While it requires more manual work for background removal, it offers powerful tools for those willing to learn and invest time in mastering the software.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Completely free and open-source</li> <li>Powerful professional-grade tools</li> <li>Extensive plugin ecosystem</li> <li>Cross-platform compatibility</li> <li>No subscription fees ever</li> <li>Active community support</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Steep learning curve</li> <li>No built-in AI background removal</li> <li>Interface can be confusing</li> <li>Requires manual selection techniques</li> <li>Time-consuming for beginners</li> </ul> </div> </div> </section> <section id="photoshop-express"> <h2>9. Photoshop Express - Best Quick Mobile Editor</h2> <div class="img-container"> <img alt="Photoshop Express mobile app background removal" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/e010a5f9-d568-4c1a-b5e1-856f496f693e.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.1"></div> <span class="rating-text">4.1/5 - Good</span> </div> <p>Adobe's mobile app offers simplified background removal tools perfect for quick edits on the go. While it lacks the precision of desktop Photoshop, it provides reliable results for mobile photography and social media content.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>Adobe's trusted technology</li> <li>Optimized for mobile devices</li> <li>Quick and easy to use</li> <li>Good integration with Adobe ecosystem</li> <li>Regular updates and improvements</li> <li>Free basic features</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>Limited compared to desktop Photoshop</li> <li>Premium features require subscription</li> <li>Mobile-only interface limitations</li> <li>Less precise than specialized tools</li> </ul> </div> </div> </section> <section id="affinity-photo"> <h2>10. Affinity Photo - Best One-Time Purchase</h2> <div class="img-container"> <img alt="Affinity Photo background removal tools" src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/0e5ddecd-5d43-4843-95a4-5caf4ef0a999.jpg" class="responsive-image"> </div> <div class="rating-container"> <div class="rating-stars" data-rating="4.6"></div> <span class="rating-text">4.6/5 - Excellent</span> </div> <p>Affinity Photo is a professional alternative to Photoshop with excellent selection tools for background removal. It offers a one-time purchase model with no subscription required, making it an attractive option for budget-conscious professionals.</p> <div class="two-columns"> <div class="pros-cons"> <h3>โœ… Pros</h3> <ul class="pros"> <li>One-time purchase, no subscription</li> <li>Professional-grade selection tools</li> <li>Excellent performance and speed</li> <li>Clean, modern interface</li> <li>Regular free updates</li> <li>Cross-platform compatibility</li> </ul> </div> <div class="pros-cons"> <h3>โŒ Cons</h3> <ul class="cons"> <li>No built-in AI background removal</li> <li>Learning curve for new users</li> <li>Manual selection techniques required</li> <li>Smaller plugin ecosystem than Photoshop</li> </ul> </div> </div> </section> <section id="how-to-choose"> <h2>How to Choose the Right Background Editor</h2> <p>Selecting the best photo background editor depends on your specific needs, skill level, and budget. Here are the key factors to consider:</p> <div class="feature-grid"> <div class="feature-card"> <h4>๐ŸŽฏ Accuracy</h4> <p>Look for tools that handle complex edges, hair, and transparent objects well</p> </div> <div class="feature-card"> <h4>โšก Speed</h4> <p>Consider processing time, especially if you need to edit many images</p> </div> <div class="feature-card"> <h4>๐Ÿ’ฐ Cost</h4> <p>Evaluate free options vs. paid features based on your usage volume</p> </div> <div class="feature-card"> <h4>๐Ÿ› ๏ธ Features</h4> <p>Determine if you need basic removal or advanced editing capabilities</p> </div> </div> </section> <section id="tips-tricks"> <h2>Tips for Better Background Removal</h2> <div class="two-columns"> <div> <h3>Before You Start</h3> <ul class="custom-list"> <li>Use high-contrast backgrounds when possible</li> <li>Ensure good lighting on your subject</li> <li>Avoid shadows falling on the background</li> <li>Keep the subject away from the background</li> </ul> </div> <div> <h3>During Editing</h3> <ul class="custom-list"> <li>Start with the highest resolution image available</li> <li>Use manual refinement tools for complex areas</li> <li>Pay special attention to hair and fine details</li> <li>Preview your results at 100% zoom</li> </ul> </div> </div> </section> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-container"> <div class="faq-item"> <h3 class="faq-question">What are the best photo background editors in 2025?</h3> <div class="faq-answer"> <p>The best photo background editors in 2025 include Modern Photo Tools, PhotoRoom, Remove.bg, Canva, Adobe Photoshop, PicsArt, Fotor, GIMP, Photoshop Express, and Affinity Photo. Each offers unique features for different user needs and skill levels.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Which photo background editor is best for beginners?</h3> <div class="faq-answer"> <p>Modern Photo Tools and Remove.bg are the best photo background editors for beginners, offering one-click background removal with AI technology. They require no technical skills and provide instant results.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Are there free photo background editors available?</h3> <div class="faq-answer"> <p>Yes, several free photo background editors are available including Modern Photo Tools (completely free), GIMP (open-source), and free versions of PhotoRoom, Canva, and PicsArt with some limitations.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">What should I look for in a photo background editor?</h3> <div class="faq-answer"> <p>When choosing the best photo background editors, consider accuracy of background removal, ease of use, processing speed, supported file formats, pricing, and additional editing features like background replacement and object removal.</p> </div> </div> </div> </section> <section id="conclusion"> <h2>Conclusion</h2> <p>Choosing the right background editor can significantly impact your image quality and workflow efficiency. For most users, <strong>Modern Photo Tools</strong> offers the best combination of accuracy, speed, and value with its completely free, AI-powered background removal.</p> <p>For specialized needs like e-commerce, PhotoRoom excels, while professionals may prefer the advanced capabilities of Adobe Photoshop. Whatever your choice, the tools listed in this guide represent the best photo background editors available in 2025.</p> <div class="cta-block"> <h3 class="cta-block-title">Ready to Transform Your Images?</h3> <p class="cta-block-text">Start with our free background removal tool and see the difference professional editing can make!</p> <a href="https://modernphototools.com/tools/remove-background" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="3" >Try Our Modern Tool Free</a> </div> </section> </div> <style> .styled-container { max-width: 1200px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6; color: #333; } .article-header { text-align: center; margin-bottom: 40px; padding: 40px 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 12px; } .article-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); } .article-intro { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; } .table-of-contents { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin: 30px 0; } .table-of-contents h2 { color: #495057; font-size: 1.5rem; margin-bottom: 20px; border-bottom: 2px solid #3498db; padding-bottom: 10px; } .toc-list { list-style: none; padding: 0; margin: 0; } .toc-list li { margin-bottom: 8px; padding-left: 20px; position: relative; } .toc-list li:before { content: "โ†’"; position: absolute; left: 0; color: #3498db; font-weight: bold; } .toc-list a { color: #495057; text-decoration: none; font-weight: 500; transition: color 0.3s ease; } .toc-list a:hover { color: #3498db; text-decoration: underline; } .two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px 0; } @media (max-width: 768px) { .two-columns { grid-template-columns: 1fr; gap: 20px; } } .custom-list { list-style: none; padding: 0; } .custom-list li { position: relative; padding-left: 25px; margin-bottom: 10px; } .custom-list li:before { content: "โœ“"; position: absolute; left: 0; color: #28a745; font-weight: bold; } .cta-block { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 30px; border-radius: 12px; text-align: center; margin: 40px 0; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); } .cta-block-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; } .cta-block-text { font-size: 1.1rem; margin-bottom: 25px; opacity: 0.95; } .cta-btn { display: inline-block; background: white; color: #28a745; padding: 15px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); color: #1e7e34; } .table-container { overflow-x: auto; margin: 30px 0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .responsive-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; } .responsive-table thead tr { background-color: #3498db; color: #fff; text-align: left; } .responsive-table td { padding: 12px 15px; border-bottom: 1px solid #dddddd; overflow-wrap: break-word; } .responsive-table tbody tr { border-bottom: 1px solid #dddddd; background-color: #fff; transition: background-color .3s ease; } .responsive-table tbody tr:nth-of-type(2n) { background-color: #f8f9fa; } .responsive-table tbody tr:hover { background-color: #e3f2fd; } .img-container { margin: 30px 0; text-align: center; } .responsive-image { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } .rating-container { display: flex; align-items: center; gap: 15px; margin: 20px 0; } .rating-stars { position: relative; display: inline-block; font-size: 20px; color: #ddd; } .rating-stars:before { content: "โ˜…โ˜…โ˜…โ˜…โ˜…"; position: absolute; top: 0; left: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: #ffc107; } .rating-stars:after { content: "โ˜…โ˜…โ˜…โ˜…โ˜…"; } .rating-text { font-weight: 600; color: #495057; } .pros-cons h3 { font-size: 1.2rem; margin-bottom: 15px; } .pros, .cons { list-style: none; padding: 0; } .pros li, .cons li { position: relative; padding-left: 25px; margin-bottom: 8px; line-height: 1.5; } .pros li:before { content: "โœ“"; position: absolute; left: 0; color: #28a745; font-weight: bold; } .cons li:before { content: "โœ—"; position: absolute; left: 0; color: #dc3545; font-weight: bold; } .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 30px 0; } .feature-card { background: white; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; } .feature-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); } .feature-card h4 { color: #3498db; font-size: 1.1rem; margin-bottom: 10px; } .pricing-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin: 20px 0; } .pricing-card h4 { color: #495057; margin-bottom: 15px; } .pricing-card ul { list-style: none; padding: 0; } .pricing-card li { padding: 8px 0; border-bottom: 1px solid #dee2e6; } .pricing-card li:last-child { border-bottom: none; } .faq-container { margin: 30px 0; } .faq-item { background: white; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 15px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } .faq-question { padding: 20px; background-color: #f8f9fa; font-weight: 600; margin: 0; border-bottom: 1px solid #e0e0e0; cursor: pointer; transition: background-color 0.3s ease; } .faq-question:hover { background-color: #e9ecef; } .faq-answer { padding: 20px; background-color: #fff; } .faq-answer p { margin: 0; line-height: 1.6; } section { margin: 50px 0; } section h2 { color: #2c3e50; font-size: 2rem; font-weight: 700; margin-bottom: 25px; border-bottom: 3px solid #3498db; padding-bottom: 10px; } section h3 { color: #34495e; font-size: 1.4rem; font-weight: 600; margin: 25px 0 15px 0; } section p { font-size: 1.1rem; line-height: 1.7; margin-bottom: 20px; color: #555; } @media (max-width: 768px) { .styled-container { padding: 15px; } .article-header h1 { font-size: 2rem; } .article-intro { font-size: 1.1rem; } .feature-grid { grid-template-columns: 1fr; } .table-container { font-size: 14px; } } </style>
๐Ÿ“„ easter-card-messages-2025.md
--- id: easter-card-messages-2025 title: 100+ Easter Card Message Ideas in 2025 | Modern PhotoTools excerpt: Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs. publishDate: 2025-02-30 readTime: 18 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/43b3a8d0-02da-49a5-91b1-4a27d9f12e48.jpg keywords: ["Easter card messages", "Easter greetings", "Easter card ideas", "holiday card messages", "Easter wishes", "religious Easter messages", "funny Easter messages"] metaTitle: 100+ Easter Card Message Ideas in 2025 | Modern PhotoTools metaDescription: Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs. faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What makes a good Easter card message?", "acceptedAnswer": { "@type": "Answer", "text": "A good Easter card message should match the tone of your relationship with the recipient and reflect the spirit of Easter. Consider religious messages for faith-based celebrations, funny puns for lighthearted relationships, and heartfelt personal messages for close family and friends. The best messages are sincere and appropriate for the occasion." } }, { "@type": "Question", "name": "How do I choose the right Easter message for different people?", "acceptedAnswer": { "@type": "Answer", "text": "Choose Easter messages based on your relationship and the recipient's preferences. Use religious messages for those who celebrate Easter's spiritual significance, funny messages for children or close friends who enjoy humor, professional messages for colleagues, and heartfelt personal messages for family members. Consider the recipient's age, beliefs, and your relationship when selecting the perfect message." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>100+ Easter Card Message Ideas in 2025 | Modern PhotoTools</h1> <p class="article-intro">Easter is a time of renewal, hope, and celebration. Whether you're honoring the religious significance of the holiday or simply enjoying the arrival of spring, the right message can transform your Easter cards into meaningful keepsakes. From heartfelt religious blessings to playful puns that bring smiles, we've compiled over 100 Easter card message ideas to help you express your feelings perfectly.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Image Generator Tool</h3> <p class="cta-block-text">Creating the perfect Easter card goes beyond just choosing beautiful imageryโ€”it's about pairing that visual appeal with words that resonate. Whether you're sending cards to family members, friends, colleagues, or children, you'll find the ideal message in our comprehensive collection below.</p> <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >Create your Imaginary perfect Easter</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="custom-list"> <li><a href="#religious-easter-messages">Religious Easter Messages</a></li> <li><a href="#funny-easter-messages">Funny Easter Messages & Puns</a></li> <li><a href="#heartfelt-easter-messages">Heartfelt Easter Messages for Family</a></li> <li><a href="#short-easter-messages">Short & Sweet Easter Messages</a></li> <li><a href="#professional-easter-messages">Professional Easter Card Message Ideas</a></li> <li><a href="#photo-tips">Tips for Pairing Easter Messages with Photos</a></li> <li><a href="#conclusion">Create Memorable Easter Cards in 2025</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> </ul> </div> <section id="religious-easter-messages"> <h2>Religious Easter Messages</h2> <p>For those celebrating Easter's spiritual significance, these religious messages honor the resurrection of Jesus Christ and the hope it brings to believers worldwide.</p> <h3>Traditional Religious Easter Greetings</h3> <ul class="custom-list"> <li>"He is risen! May the miracle of Easter fill your heart with joy and your life with blessings."</li> <li>"Celebrating the resurrection of our Lord and the promise of eternal life. Happy Easter!"</li> <li>"May the hope of Easter morning shine brightly in your heart today and always."</li> <li>"Rejoicing in Christ's victory over death and the new life He offers us all."</li> <li>"May God's love surround you this Easter and His peace fill your heart."</li> <li>"The tomb is empty, our hearts are full. Wishing you a blessed Easter celebration."</li> <li>"May the joy of the resurrection bring you comfort, hope, and endless blessings."</li> <li>"Christ has risen! May this Easter bring you closer to God's infinite love."</li> <li>"Celebrating the greatest love story ever told. May Easter bless you abundantly."</li> <li>"May the light of Christ's resurrection illuminate your path this Easter and beyond."</li> </ul> <h3>Easter Blessings for Family</h3> <ul class="custom-list"> <li>"May our family be blessed with God's grace, love, and the joy of Easter."</li> <li>"Praying that Easter brings our family closer together in faith and love."</li> <li>"May the Lord's blessings be upon our family this Easter season."</li> <li>"Celebrating Easter with grateful hearts for the family God has given us."</li> <li>"May God's love bind our family together this Easter and always."</li> <li>"Blessed to celebrate the resurrection with the family I love most."</li> <li>"May Easter remind us of God's greatest giftโ€”His love and our family."</li> <li>"Praying for continued blessings on our family this Easter season."</li> <li>"May the peace of Easter fill our home and hearts with joy."</li> <li>"Celebrating God's love through the blessing of our family this Easter."</li> </ul> <div class="cta-block"> <h4 class="cta-block-title">Create Beautiful Religious Easter Cards</h4> <p class="cta-block-text">Design meaningful Easter cards that honor your faith with our religious-themed templates and photo editing tools.</p> <a href="https://modernphototools.com/tools/ai-image-generator" class="cta-btn" target="_blank">Create Religious Templates By AI Image Tool</a> </div> </section> <section id="funny-easter-messages"> <h2>Funny Easter Messages & Puns</h2> <p>Bring smiles and laughter to your Easter celebrations with these playful messages and clever puns that are perfect for friends, family, and anyone who enjoys a good laugh.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/d68e3503-86c5-4760-a8bc-4811946c2d71.jpg" alt="Funny Easter bunny card with colorful eggs and playful design"> </div> <h3>Easter Puns and Wordplay</h3> <ul class="custom-list"> <li>"Have an egg-stra special Easter!"</li> <li>"Some bunny loves you very much!"</li> <li>"Hoppy Easter to some-bunny special!"</li> <li>"You're egg-cellent in every way!"</li> <li>"Don't worry, be hoppyโ€”it's Easter!"</li> <li>"Easter: the only time it's okay to put all your eggs in one basket!"</li> <li>"Wishing you an egg-straordinary Easter celebration!"</li> <li>"Hope your Easter is filled with egg-citement!"</li> <li>"You crack me up! Happy Easter!"</li> <li>"Having a good hare day? Happy Easter!"</li> </ul> <h3>Funny Easter Messages for Kids</h3> <ul class="custom-list"> <li>"The Easter Bunny told me you've been egg-stra good this year!"</li> <li>"Hoppy Easter! May your basket be full of treats and your day full of fun!"</li> <li>"Some bunny thinks you're the best! Happy Easter!"</li> <li>"Easter hugs and bunny kisses coming your way!"</li> <li>"Hope the Easter Bunny brings you everything on your wish list!"</li> <li>"You're one cool chick! Happy Easter!"</li> <li>"Wishing you a basket full of joy and chocolate this Easter!"</li> <li>"May your Easter be as sweet as chocolate and as colorful as Easter eggs!"</li> <li>"Hippity hoppity, Easter's on its way with treats for you today!"</li> <li>"You make every day brighter, just like Easter morning!"</li> </ul> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/df734811-d074-45aa-8176-b8d481ffe256.jpg" alt="Children enjoying Easter egg hunt with colorful baskets and smiling faces"> </div> <h3>Lighthearted Easter Greetings for Adults</h3> <ul class="custom-list"> <li>"Age is just a number, but chocolate is eternal. Happy Easter!"</li> <li>"May your Easter be filled with more chocolate than calories count!"</li> <li>"Easter: the one day when eating chocolate for breakfast is socially acceptable."</li> <li>"Wishing you an Easter that's sweeter than a Peeps marshmallow!"</li> <li>"Hope your Easter is as bright as your smile and as sweet as chocolate!"</li> <li>"May your Easter basket be full and your heart be fuller!"</li> <li>"Easter calories don't count, right? Asking for a friend..."</li> <li>"Wishing you a spring-time of happiness and chocolate abundance!"</li> <li>"May your Easter be filled with beautiful moments and zero diet guilt!"</li> <li>"Hope your Easter is egg-actly what you need to brighten your spring!"</li> </ul> <div class="cta-block"> <h4 class="cta-block-title">Design Fun Easter Cards</h4> <p class="cta-block-text">Create playful Easter cards that bring smiles with our fun templates and easy-to-use design tools. Perfect for kids and the young at heart!</p> <a href="https://modernphototools.com/tools/ai-image-generator" class="cta-btn" target="_blank">Create Fun Cards By AI Image Tool</a> </div> </section> <section id="heartfelt-easter-messages"> <h2>Heartfelt Easter Messages for Family</h2> <p>Express your deepest feelings with these sincere and touching Easter messages designed to strengthen family bonds and share genuine love during this special season.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b3656dfb-4d92-41ed-8976-ad8f3153689a.jpg" alt="Family gathering around Easter dinner table with warm lighting and happy faces"> </div> <h3>Messages for Parents and Grandparents</h3> <ul class="custom-list"> <li>"Thank you for filling my childhood Easters with magic and my adult Easters with meaning. Happy Easter!"</li> <li>"Your love has been the greatest Easter gift of my life. Wishing you joy and blessings."</li> <li>"May this Easter bring you the same happiness you've brought to our family for years."</li> <li>"Grateful for parents who taught me the true meaning of Easter and unconditional love."</li> <li>"Your wisdom and love have been my guiding light. Happy Easter to the best parents ever!"</li> <li>"May your Easter be filled with the love and joy you've given us throughout the years."</li> <li>"Thank you for creating Easter memories that I'll treasure forever. Love you always."</li> <li>"Your faith and love have shaped who I am today. Wishing you a blessed Easter."</li> <li>"May this Easter remind you of how much you mean to our entire family."</li> <li>"Celebrating Easter with gratitude for parents who made every holiday special."</li> </ul> <h3>Messages for Children and Grandchildren</h3> <ul class="custom-list"> <li>"Watching you grow brings me more joy than any Easter morning. Happy Easter, my dear!"</li> <li>"You are the sunshine that makes every Easter brighter. Love you to the moon and back!"</li> <li>"May your Easter be filled with wonder, joy, and all the love in my heart."</li> <li>"You make every day feel like Easter morningโ€”full of hope and happiness."</li> <li>"Wishing my precious child an Easter as beautiful and special as you are."</li> <li>"May this Easter bring you dreams as colorful as Easter eggs and as sweet as chocolate."</li> <li>"You are God's greatest gift to our family. Happy Easter, my beloved child!"</li> <li>"May your Easter be filled with laughter, love, and all your favorite things."</li> <li>"Watching you discover the world fills my heart with Easter joy every day."</li> <li>"You are the reason every Easter feels like a celebration of new beginnings."</li> </ul> <h3>Messages for Siblings</h3> <ul class="custom-list"> <li>"From childhood Easter egg hunts to adult celebrations, you've made every Easter special."</li> <li>"Lucky to have a sibling who makes life brighter every day, especially at Easter!"</li> <li>"May your Easter be as wonderful as the memories we've created together."</li> <li>"Thank you for being my partner in Easter mischief and my friend for life."</li> <li>"Wishing my amazing sibling an Easter filled with love, laughter, and chocolate!"</li> <li>"From fighting over Easter candy to sharing Easter blessingsโ€”we've come so far!"</li> <li>"May this Easter bring you all the happiness you've brought to my life."</li> <li>"Grateful for a sibling who makes every holiday feel like home. Happy Easter!"</li> <li>"You're not just my sibling, you're my lifelong Easter buddy. Love you!"</li> <li>"May your Easter be as bright and beautiful as our childhood memories together."</li> </ul> <div class="cta-block"> <h4 class="cta-block-title">Create Heartfelt Family Easter Cards</h4> <p class="cta-block-text">Design meaningful Easter cards for your family with our heartfelt templates and personalization options. Show your loved ones how much they mean to you.</p> <a href="https://modernphototools.com/tools/ai-image-generator" class="cta-btn" target="_blank">Design Family Cards By Our Tool</a> </div> </section> <section id="short-easter-messages"> <h2>Short & Sweet Easter Messages</h2> <p>Sometimes the most powerful messages are the simplest ones. These concise Easter greetings pack maximum impact in minimal words, perfect for social media, quick notes, or when space is limited.</p> <h3>Quick Easter Greetings</h3> <ul class="custom-list"> <li>"Happy Easter!"</li> <li>"Easter blessings to you!"</li> <li>"Wishing you joy this Easter!"</li> <li>"May Easter bring you peace."</li> <li>"Hoppy Easter!"</li> <li>"Easter love and hugs!"</li> <li>"Blessed Easter to you!"</li> <li>"Spring joy and Easter cheer!"</li> <li>"Easter wishes your way!"</li> <li>"Celebrating Easter with you in heart!"</li> </ul> <h3>One-Line Easter Messages</h3> <ul class="custom-list"> <li>"May your Easter be as bright as spring flowers."</li> <li>"Sending you Easter sunshine and smiles."</li> <li>"Hope your Easter basket overflows with joy."</li> <li>"Wishing you an Easter filled with love and laughter."</li> <li>"May Easter bring renewal to your heart and home."</li> <li>"Easter joy is coming your way!"</li> <li>"Celebrating new beginnings this Easter."</li> <li>"May your Easter be sweet and bright."</li> <li>"Sending Easter love across the miles."</li> <li>"Hope your Easter is egg-stra wonderful!"</li> </ul> <h3>Social Media Easter Messages</h3> <ul class="custom-list"> <li>"Easter vibes: renewal, hope, chocolate. ๐Ÿฐ๐Ÿฅš"</li> <li>"Grateful hearts and Easter starts! ๐Ÿ’•"</li> <li>"Some bunny loves you! Happy Easter! ๐Ÿฐ"</li> <li>"Easter joy in every moment. โœจ"</li> <li>"Hoppy Easter from our family to yours! ๐ŸŒธ"</li> <li>"Easter blessings and spring feelings! ๐ŸŒท"</li> <li>"Celebrating life, love, and Easter! ๐Ÿ’"</li> <li>"Easter magic is in the air! ๐ŸŒˆ"</li> <li>"New season, new blessings, Happy Easter! ๐ŸŒฑ"</li> <li>"Easter joy: simple, sweet, perfect. ๐Ÿฅš"</li> </ul> <div class="cta-block"> <h4 class="cta-block-title">Create Quick Easter Cards</h4> <p class="cta-block-text">Short on time? Our quick Easter card templates let you create beautiful cards in minutes. Add a short message and you're ready to share!</p> <a href="https://modernphototools.com/tools/ai-image-generator" class="cta-btn" target="_blank">Make Quick Cards Now</a> </div> </section> <section id="professional-easter-messages"> <h2>Professional Easter Card Message Ideas</h2> <p>Maintain professional relationships while sharing Easter greetings with these appropriate messages for colleagues, clients, and business associates.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/a0d5be55-efa0-43b2-bccc-b25a88db2309.jpg" alt="Professional Easter card for business associates and clients"> </div> <h3>Easter Messages for Colleagues</h3> <ul class="custom-list"> <li>"Wishing you and your family a wonderful Easter weekend. Enjoy the well-deserved break!"</li> <li>"Happy Easter! May this season bring renewed energy and inspiration."</li> <li>"Sending Easter greetings to a valued colleague. Enjoy the holiday!"</li> <li>"Wishing you a refreshing Easter weekend and a productive spring ahead."</li> <li>"Happy Easter! Thank you for being such a great team member."</li> <li>"May your Easter be relaxing and rejuvenating. See you back at work refreshed!"</li> <li>"Enjoy your Easter weekend! Looking forward to our continued collaboration."</li> <li>"Wishing you a pleasant Easter holiday with your loved ones."</li> <li>"Happy Easter to a colleague who makes work more enjoyable every day."</li> <li>"May this Easter bring you joy and the spring season bring new opportunities."</li> </ul> <h3>Easter Wishes for Clients and Business Partners</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/633cb66b-10ea-4712-a1e5-75bc8660504a.jpg" alt="Business Easter cards being prepared for clients with professional messages"> </div> <ul class="custom-list"> <li>"Wishing you and your organization a Happy Easter and continued success this spring."</li> <li>"Happy Easter from all of us at [Your Company]. We value our partnership."</li> <li>"May this Easter bring renewed prosperity and growth to your business."</li> <li>"Sending Easter greetings and appreciation for our business relationship."</li> <li>"Wishing you a joyful Easter season and a successful second quarter."</li> <li>"Happy Easter! Thank you for your continued trust in our services."</li> <li>"May the spring season bring fresh opportunities for our continued collaboration."</li> <li>"Wishing you and your team a wonderful Easter and successful spring ahead."</li> <li>"Happy Easter from our business family to yours. We appreciate your partnership."</li> <li>"Sending Easter greetings and looking forward to our continued success together."</li> </ul> <section id="photo-tips"> <h2>Tips for Pairing Easter Messages with Photos</h2> <p>The perfect Easter card combines the right message with complementary imagery. Here are some tips for creating cohesive, beautiful Easter cards that recipients will treasure.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/9618b433-471d-429e-a8e9-fb0a5c370ceb.jpg" alt="Easter card creation process showing message and photo pairing"> </div> <div class="two-columns"> <div> <h3>Message and Photo Alignment Tips</h3> <ul class="custom-list"> <li><strong>Match the tone:</strong> Pair funny messages with lighthearted photos, and religious messages with more solemn or symbolic imagery.</li> <li><strong>Consider color harmony:</strong> Choose message colors that complement your photo's color palette.</li> <li><strong>Balance space:</strong> Leave enough room for your message to be readable without overwhelming the image.</li> <li><strong>Use appropriate fonts:</strong> Select fonts that match the moodโ€”playful for children's cards, elegant for formal greetings.</li> <li><strong>Create visual flow:</strong> Position your message so it naturally guides the eye through the entire card.</li> </ul> </div> <div> <h3>Photo Selection for Easter Cards</h3> <ul class="custom-list"> <li><strong>Family photos:</strong> Recent family gatherings work beautifully with heartfelt messages.</li> <li><strong>Spring scenes:</strong> Flowers, green landscapes, and sunny skies pair well with messages about renewal.</li> <li><strong>Easter symbols:</strong> Eggs, bunnies, and baskets complement traditional Easter greetings.</li> <li><strong>Religious imagery:</strong> Crosses, lilies, and sunrise scenes enhance spiritual messages.</li> <li><strong>Children's photos:</strong> Pictures of kids with Easter baskets or on egg hunts work perfectly with playful messages.</li> </ul> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/38e69b62-9a0c-4a1b-bd5b-cd43269a6ea2.jpg" alt="Examples of Easter cards with well-paired messages and photos"> </div> </section> <section id="conclusion"> <h2>Create Memorable Easter Cards in 2025</h2> <p>Easter is a time to connect with loved ones and share messages of hope, renewal, and joy. Whether you prefer traditional religious greetings, funny puns, or heartfelt personal messages, the perfect Easter card message can make someone's day special.</p> <p>With over 100 Easter card message ideas to choose from, you're now equipped to create cards that perfectly express your feelings. Remember that the most meaningful cards combine thoughtful words with beautiful imagery that reflects the spirit of your message.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b1c3fa49-c0ca-4dd0-9fb8-10e5b1b3083c.jpg" alt="Beautiful Easter card display showing various styles and messages for Easter card ideas"> </div> <p>At ModernPhotoTools.com, we're dedicated to helping you create Easter cards that stand out. Our easy-to-use photo editing tools and card templates make it simple to pair your chosen Easter message with the perfect design.</p> <div class="cta-block"> <h4 class="cta-block-title">Start Creating Your Easter Cards Today</h4> <p class="cta-block-text">Turn these Easter message ideas into beautiful cards with our easy-to-use tools. No design experience needed!</p> <a href="https://modernphototools.com/tools/ai-image-generator" class="cta-btn cta-btn-large" target="_blank">Create Your Easter Cards</a> </div> </section> <section id="faq" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/FAQPage"> <h2>Frequently Asked Questions</h2> <div class="faq-container"> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">What makes a good Easter card message?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <div itemprop="text"> <p>A good Easter card message should match the tone of your relationship with the recipient and reflect the spirit of Easter. Consider religious messages for faith-based celebrations, funny puns for lighthearted relationships, and heartfelt personal messages for close family and friends. The best messages are sincere and appropriate for the occasion.</p> </div> </div> </div> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">How do I choose the right Easter message for different people?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <div itemprop="text"> <p>Choose Easter messages based on your relationship and the recipient's preferences. Use religious messages for those who celebrate Easter's spiritual significance, funny messages for children or close friends who enjoy humor, professional messages for colleagues, and heartfelt personal messages for family members. Consider the recipient's age, beliefs, and your relationship when selecting the perfect message.</p> </div> </div> </div> </div> </section> </div>
๐Ÿ“„ free-watermark-remover-easy-ai-tool-for-perfect-results.md
--- id: free-watermark-remover-easy-ai-tool-for-perfect-results title: "Free Watermark Remover: Easy AI Tool for Perfect Results" excerpt: Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds. publishDate: 2025-11-15 readTime: 12 min read category: tools featuredImage: /images/tools images/AI Watermark Remover Tool.jpg relatedTool: watermark-remover keywords: ["watermark remover", "remove watermark", "TikTok watermark remover", "Free Watermark remover", "remover watermarks images"] metaTitle: "Free Watermark Remover: Easy AI Tool for Perfect Results" metaDescription: "Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds." --- <div class="styled-container"> <style> .styled-container *{box-sizing:border-box} .styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff} .styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700} .styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)} .styled-container h1{font-size:32px;margin-bottom:16px} .styled-container h2{font-size:28px;margin-bottom:12px} .styled-container h3{font-size:24px;margin-bottom:12px} .styled-container h4{font-size:20px;margin-bottom:8px} .styled-container h5{font-size:18px;margin-bottom:8px} .styled-container h6{font-size:16px;margin-bottom:8px} .styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em} .styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s} .styled-container a:not([class]):hover{color:#2980b9} .styled-container img{max-width:100%;height:auto} .styled-container .section-gap{margin:60px 0} .styled-container .section-gap-small{margin:30px 0} .styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0} .styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)} .styled-container .cta-btn-secondary{background-color:#27ae60} .styled-container .cta-btn-secondary:hover{background-color:#219653} .styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c} .styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b} .styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center} .styled-container .elementor-element.cta-block{display:flow} .styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333} .styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555} .styled-container .cta-btn-small{padding:8px 16px;font-size:14px} .styled-container .cta-btn-large{padding:16px 32px;font-size:18px} .styled-container .cta-btn-full{display:block;width:100%} .styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative} .styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease} .styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)} .styled-container form{width:100%} .styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden} .styled-container .form-group{margin-bottom:20px;width:100%} .styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333} .styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s} .styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff} .styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)} .styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s} .styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)} .styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto} .styled-container .form-btn:hover{background-color:#2980b9} .styled-container .form-help{margin-top:12px} .styled-container .cta-block .cta-block-buttons{margin:0} .styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden} .styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden} .styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden} .styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2} @media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}} .styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s} .styled-container .card.elementor-element{padding-bottom:0} .styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none} .styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)} .styled-container .card-img{width:100%;height:auto;display:block} .styled-container .card-content{flex-grow:1;padding:0} .styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word} .styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5} .styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px} .styled-container .card-footer.e-con{--width: auto} .styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow} .styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex} .styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0} .styled-container .card-grid .card{margin:0;height:100%} .styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0} .styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px} .styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3} .styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1} .styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center} .styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold} .styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold} .styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px} .styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px} .styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5} .styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px} .styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%} .styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0} .styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px} .styled-container .rating-stars[data-rating="0"]{--rating: 0} .styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5} .styled-container .rating-stars[data-rating="1"]{--rating: 1} .styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5} .styled-container .rating-stars[data-rating="2"]{--rating: 2} .styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5} .styled-container .rating-stars[data-rating="3"]{--rating: 3} .styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5} .styled-container .rating-stars[data-rating="4"]{--rating: 4} .styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1} .styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2} .styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3} .styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4} .styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5} .styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6} .styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7} .styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8} .styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9} .styled-container .rating-stars[data-rating="5"]{--rating: 5} .styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""} .styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden} .styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc} .styled-container .rating-label{font-size:14px;color:#666} .styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px} .styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px} .styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word} .styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%} .styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block} .styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap} @media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}} .styled-container .rating-container.vertical{flex-direction:column} .styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%} .styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px} .styled-container .rating-container.compact .rating-bar-container{height:6px} .styled-container .rating-container.expanded .rating-details{max-width:none} .styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2} .styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c} .styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f} .styled-container .custom-list{list-style:none;padding:0;margin:20px 0} .styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee} .styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat} .styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0} .styled-container [dir=rtl] .custom-list li:before{left:initial;right:0} .styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0} .styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px} .styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold} .styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0} .styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0} .styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0} .styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)} .styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0} .styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff} .styled-container .list-comparison-column li:last-child{border-bottom:none} .styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat} .styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px} .styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px} .styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db} .styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')} .styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60} .styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')} .styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12} .styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')} .styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c} .styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')} @media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}} .styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px} .styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none} .styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff} .styled-container table tr:first-child th:first-child{border-top-left-radius:8px} .styled-container table tr:first-child th:last-child{border-top-right-radius:8px} .styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px} .styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px} .styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left} .styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word} .styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0} .styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease} .styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa} .styled-container table tbody tr:hover{background-color:#edf2f7} .styled-container table span{display:contents} @media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}} @media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}} .styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative} .styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1} .styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333} /* Three-column grid for step cards and use cases */ .styled-container .three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;align-items:stretch;margin:20px 0} @media(max-width: 1024px){.styled-container .three-columns{grid-template-columns:repeat(2,1fr)}} @media(max-width: 640px){.styled-container .three-columns{grid-template-columns:1fr}} .styled-container .column-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:16px;box-shadow:0 2px 10px rgba(0,0,0,.08);height:100%} .styled-container .column-card h4,.styled-container .column-card h3{margin-top:0;font-weight:700} .styled-container .column-card .img-container{margin-top:12px} .styled-container .column-card .img-container img{width:100%;height:auto;border-radius:6px;display:block} /* Simple TOC styling */ .styled-container .toc{border:1px solid #e0e0e0;background:#fafafa;border-radius:8px;padding:16px;margin:20px 0} .styled-container .toc h3{margin:0 0 8px} .styled-container .toc ul{list-style:none;padding:0;margin:0} .styled-container .toc li{margin:6px 0} .styled-container .toc a{color:#3498db} </style> <section id="introduction"> <h1>Free Watermark Remover: Easy AI Tool for Perfect Results</h1> <p>Struggling with unwanted watermarks on your photos and videos? Whether it's a stock image logo, TikTok branding, or any other watermark, our free AI-powered watermark remover tool makes it simple to get clean, professional results in seconds. No technical skills required, no software to install, and best of all โ€“ it's completely free to use.</p> </section> <!-- Table of Contents --> <section class="table-of-contents"> <h2>Table of Contents</h2> <ul> <li><a href="#tool-overview">Why You Need a Free Watermark Remover</a></li> <li><a href="#how-it-works">How Our Free Watermark Remover Works</a></li> <li><a href="#tiktok-watermark">How to Remove TikTok Watermark in Seconds</a></li> <li><a href="#benefits">Benefits of Using Our Free Watermark Remover</a></li> <li><a href="#comparison">How Our Tool Compares to Other Methods</a></li> <li><a href="#best-practices">Best Practices for Watermark Removal</a></li> <li><a href="#use-cases">Common Use Cases</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> <li><a href="#testimonials">What Our Users Say</a></li> <li><a href="#conclusion">Start Removing Watermarks for Free Today</a></li> </ul> </section> <section id="tool-overview"> <div class="img-container"> <img src="/images/tools images/AI Watermark Remover Tool.jpg" alt="AI Watermark Remover Tool" data-method="insert" /> </div> <h2>Why You Need a Free Watermark Remover</h2> <p>Watermarks can ruin otherwise perfect images and videos. Whether you're working with stock photos, screenshots, or social media content, watermarks create distractions that detract from your visual message. Our free watermark remover tool gives you the power to:</p> <div class="custom-list"> <ul> <li>Remove logos, text, and watermarks from any image</li> <li>Clean up TikTok videos by removing the platform's watermark</li> <li>Preserve image quality during the watermark removal process</li> <li>Process photos in seconds with AI-powered technology</li> <li>Use a professional solution without any cost</li> </ul> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Remove Watermarks?</h3> <p class="cta-block-text">Try our free AI watermark remover tool now โ€“ no signup required!</p> <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" class="cta-btn" rel="nofollow">Remove Watermarks Now</a> </div> </section> <section id="how-it-works"> <h2>How Our Free Watermark Remover Works</h2> <p>Our AI-powered watermark remover uses advanced machine learning algorithms to detect and remove watermarks while preserving the original image quality. The technology identifies the watermark pattern and intelligently reconstructs the area underneath, resulting in clean, natural-looking images.</p> <style> .styled-container .video-embed { display: flex; justify-content: center; align-items: center; margin: 24px auto; } .styled-container .video-embed video { width: 100%; max-width: 480px; aspect-ratio: 2 / 3; height: auto; max-height: 80vh; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); background: #000; } @media (max-width: 640px) { .styled-container .video-embed video { max-width: 360px; } } </style> <div class="video-embed"> <video controls playsinline autoplay muted preload="auto" aria-label="Watermark Remover demo video"> <source src="/tools%20videos/Watermark%20Remover.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </div> <h3>Simple 3-Step Process</h3> <div class="three-columns"> <div class="column-card"> <h4>1. Upload Your Image</h4> <p>Select any image with a watermark or drag and drop it directly into our tool. We support all common formats including JPG, PNG, and WEBP.</p> </div> <div class="column-card"> <h4>2. AI Processing</h4> <p>Our advanced AI automatically detects and removes the watermark, reconstructing the image with remarkable accuracy in just seconds.</p> </div> <div class="column-card"> <h4>3. Download Result</h4> <p>Preview your watermark-free image and download it immediately. No quality loss, no registration required.</p> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/a3f5da97-9cf5-4c41-9fb6-4fa013123764.jpg" alt="Before and after comparison of watermark removal on a landscape photo" data-method="insert" /> </div> </section> <section id="tiktok-watermark"> <h2>How to Remove TikTok Watermark in Seconds</h2> <p>TikTok videos always come with the platform's watermark, which can be distracting when sharing content across different platforms. Our tool makes TikTok watermark removal quick and simple:</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/7518a168-550c-4017-9a29-d58e9b42637d.jpg" alt="TikTok watermark removal process showing before and after results" data-method="insert" /> </div> <div class="list-numbers"> <ol> <li>Save the TikTok video to your device</li> <li>Upload the video to our <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" rel="nofollow">tiktok watermark remover</a></li> <li>Wait a few seconds for the AI to process the video</li> <li>Download your watermark-free TikTok video</li> </ol> </div> <div class="blockquote"> <p>"I needed to use TikTok content for a client presentation but the watermarks were unprofessional. This tool removed them perfectly without any quality loss!"</p> <p class="blockquote-author">โ€” Sarah K., Marketing Consultant</p> </div> <div class="cta-block"> <h3 class="cta-block-title">Remove TikTok Watermarks Now</h3> <p class="cta-block-text">Get clean, professional videos for cross-platform sharing</p> <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" class="cta-btn" rel="nofollow">Remove TikTok Watermark</a> </div> </section> <section id="benefits"> <h2>Benefits of Using Our Free Watermark Remover</h2> <p>When it comes to removing watermarks from photos and videos, our tool offers several advantages over other methods:</p> <div class="two-columns"> <div> <h3>Completely Free</h3> <p>Unlike expensive photo editing software or subscription services, our watermark remover is 100% free to use. No hidden fees, no premium upgrades required to access core functionality.</p> <h3>No Installation Required</h3> <p>Access our tool directly in your browser without downloading or installing any software. This saves disk space and eliminates security concerns associated with installing third-party applications.</p> <h3>Preserves Image Quality</h3> <p>Our AI technology ensures that image quality remains intact during the watermark removal process. No blurry patches or obvious editing marks โ€“ just clean, professional results.</p> </div> <div> <h3>Works on Any Device</h3> <p>Whether you're using a desktop computer, laptop, tablet, or smartphone, our free watermark remover works seamlessly across all devices with an internet connection.</p> <h3>Fast Processing</h3> <p>Get results in seconds rather than spending minutes or hours manually editing images. Our AI processes watermark removal quickly and efficiently.</p> <h3>No Technical Skills Needed</h3> <p>You don't need to be a Photoshop expert to remove watermarks effectively. Our intuitive interface makes it easy for anyone to achieve professional results.</p> </div> </div> <div class="img-container"> <img src="\images\blog\Modern PhotoTools Watermark remover.webp" /> </div> </section> <section id="comparison"> <h2>How Our Free Watermark Remover Compares to Other Methods</h2> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <td data-row="head">Feature</td> <td data-row="head">Our Free AI Tool</td> <td data-row="head">Manual Editing</td> <td data-row="head">Paid Software</td> </tr> </thead> <tbody> <tr> <td data-label="Feature">Cost</td> <td data-label="Our Free AI Tool">Free</td> <td data-label="Manual Editing">Free (time cost)</td> <td data-label="Paid Software">$10-50/month</td> </tr> <tr> <td data-label="Feature">Ease of Use</td> <td data-label="Our Free AI Tool">Very Easy</td> <td data-label="Manual Editing">Difficult</td> <td data-label="Paid Software">Moderate</td> </tr> <tr> <td data-label="Feature">Processing Time</td> <td data-label="Our Free AI Tool">Seconds</td> <td data-label="Manual Editing">10-30 minutes</td> <td data-label="Paid Software">1-5 minutes</td> </tr> <tr> <td data-label="Feature">Quality of Results</td> <td data-label="Our Free AI Tool">Excellent</td> <td data-label="Manual Editing">Varies with skill</td> <td data-label="Paid Software">Good</td> </tr> <tr> <td data-label="Feature">Technical Skills Required</td> <td data-label="Our Free AI Tool">None</td> <td data-label="Manual Editing">Advanced</td> <td data-label="Paid Software">Moderate</td> </tr> <tr> <td data-label="Feature">Installation Needed</td> <td data-label="Our Free AI Tool">No</td> <td data-label="Manual Editing">Yes</td> <td data-label="Paid Software">Yes</td> </tr> </tbody> </table> </div> <div class="cta-block"> <h3 class="cta-block-title">Why Struggle with Complicated Methods?</h3> <p class="cta-block-text">Our free watermark remover gives you professional results without the hassle.</p> <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" class="cta-btn" rel="nofollow">Try Our Free Tool Now</a> </div> </section> <section id="best-practices"> <h2>Best Practices for Watermark Removal</h2> <p>To get the best results when using our free watermark remover, follow these expert tips:</p> <div class="two-columns"> <div> <h3>Choose High-Quality Images</h3> <p>Starting with higher resolution images gives the AI more data to work with, resulting in cleaner watermark removal. Whenever possible, use the highest quality version of your image.</p> <h3>Consider Watermark Placement</h3> <p>Images with watermarks on solid backgrounds or less detailed areas tend to yield better results. If you have multiple versions of an image, choose the one where the watermark interferes least with important details.</p> <h3>Check Legal Considerations</h3> <p>Always ensure you have the right to use the image after removing the watermark. Our tool is designed for removing watermarks from your own content or images you have permission to modify.</p> </div> <div> <h3>Preview Before Downloading</h3> <p>Always check the preview of your watermark-free image before downloading. This allows you to verify the quality of the result and make any necessary adjustments.</p> <h3>Process in Batches</h3> <p>If you have multiple images that need watermark removal, consider processing them in batches to save time. Our tool is optimized for efficient processing of multiple files.</p> <h3>Save in the Right Format</h3> <p>For photos and images with many colors, save as JPG. For graphics with text or transparent elements, choose PNG format for the best quality.</p> </div> </div> <div class="highlight-box"> <p><strong>Pro Tip:</strong> For complex watermarks that cover large portions of an image, try processing the image twice. First to remove the main watermark, then a second pass to clean up any remaining artifacts.</p> </div> </section> <section id="use-cases"> <h2>Common Use Cases for Our Free Watermark Remover</h2> <div class="three-columns"> <div class="column-card"> <h3>Content Creators</h3> <p>Remove watermarks from stock images and videos to create clean, professional content for blogs, social media, and marketing materials.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/1a5ee4b4-65f7-4a0d-ae10-2629a61b963d.jpg" alt="Content creator working with watermark-free images" data-method="text-to-image" /> </div> </div> <div class="column-card"> <h3>Social Media Managers</h3> <p>Clean up TikTok videos by removing watermarks for cross-platform sharing on Instagram, YouTube, and other social networks.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/60a28b85-2f34-4407-ae69-23281ef56307.jpg" alt="Social media manager removing TikTok watermark from video" data-method="text-to-image" /> </div> </div> <div class="column-card"> <h3>Photographers</h3> <p>Remove watermarks from preview images to see how final photos will look before making a purchase decision.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/f05afd51-dbfc-4729-bdbb-219afdaa644c.jpg" alt="Photographer reviewing watermark-free preview images" data-method="text-to-image" /> </div> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Transform Your Images?</h3> <p class="cta-block-text">Join thousands of users who trust our free watermark remover for professional results.</p> <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" class="cta-btn cta-btn-large" rel="nofollow">Remove Watermarks Now</a> </div> </section> <section id="faq" itemscope itemprop="mainEntity" itemtype="https://schema.org/FAQPage"> <h2>Frequently Asked Questions</h2> <div class="faq-item" itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Is this watermark remover really free?</h3> <div class="faq-answer" itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Yes, our watermark remover is completely free to use. There are no hidden fees, subscriptions, or premium features that limit core functionality. We believe in providing accessible tools for everyone.</p> </div> </div> <div class="faq-item" itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">How do I remove a watermark from a photo?</h3> <div class="faq-answer" itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Simply visit our <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" rel="nofollow">free watermark remover</a> tool, upload your image, wait a few seconds for the AI to process it, and download your watermark-free result. The entire process takes less than a minute.</p> </div> </div> <div class="faq-item" itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Can I remove TikTok watermarks from videos?</h3> <div class="faq-answer" itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Yes, our tool specifically supports TikTok watermark removal. Upload your saved TikTok video to our tool, and our AI will remove the watermark while preserving video quality.</p> </div> </div> <div class="faq-item" itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Will removing watermarks affect image quality?</h3> <div class="faq-answer" itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">No, our AI-powered watermark remover is designed to preserve image quality during the removal process. Unlike manual editing which can leave obvious marks, our tool intelligently reconstructs the area under the watermark for natural-looking results.</p> </div> </div> </section> <!-- FAQ JSON-LD Schema --> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Is this watermark remover really free?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, our watermark remover is completely free to use. There are no hidden fees, subscriptions, or premium features that limit core functionality. We believe in providing accessible tools for everyone." } }, { "@type": "Question", "name": "How do I remove a watermark from a photo?", "acceptedAnswer": { "@type": "Answer", "text": "Simply visit our free watermark remover tool, upload your image, wait a few seconds for the AI to process it, and download your watermark-free result. The entire process takes less than a minute." } }, { "@type": "Question", "name": "Can I remove TikTok watermarks from videos?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, our tool specifically supports TikTok watermark removal. Upload your saved TikTok video to our tool, and our AI will remove the watermark while preserving video quality." } }, { "@type": "Question", "name": "Will removing watermarks affect image quality?", "acceptedAnswer": { "@type": "Answer", "text": "No, our AI-powered watermark remover is designed to preserve image quality during the removal process. Unlike manual editing which can leave obvious marks, our tool intelligently reconstructs the area under the watermark for natural-looking results." } } ] } </script> <section id="testimonials"> <h2>What Our Users Say</h2> <div class="three-columns"> <div class="column-card"> <div class="blockquote"> <p>"I needed to remove watermarks from stock photos for my small business website. This tool saved me hundreds of dollars in design costs and worked perfectly!"</p> <p class="blockquote-author">โ€” Michael T., Small Business Owner</p> </div> </div> <div class="column-card"> <div class="blockquote"> <p>"As a content creator, I often need to remove TikTok watermarks for cross-posting. This free watermark remover is now an essential part of my workflow."</p> <p class="blockquote-author">โ€” Jamie L., Content Creator</p> </div> </div> <div class="column-card"> <div class="blockquote"> <p>"I was skeptical about a free tool, but the results are amazing! It removed complex watermarks from my photos with no quality loss. Highly recommended!"</p> <p class="blockquote-author">โ€” Rebecca A., Photographer</p> </div> </div> </div> </section> <section id="conclusion"> <h2>Start Removing Watermarks for Free Today</h2> <p>Don't let watermarks ruin your perfect images and videos. Our free AI watermark remover gives you professional-quality results in seconds, with no technical skills required. Whether you need to remove watermarks from photos or clean up TikTok videos, our tool makes the process simple, fast, and effective.</p> <div class="cta-block"> <h3 class="cta-block-title">Transform Your Images Now</h3> <p class="cta-block-text">Join thousands of satisfied users who trust our free watermark remover</p> <a href="https://modernphototools.com/tools/watermark-remove" target="_blank" class="cta-btn cta-btn-large" rel="nofollow">Try Our Free Watermark Remover</a> </div> <div class="info-box"> <p><strong>Note:</strong> While our free watermark remover is powerful, please ensure you have the right to modify images before removing watermarks. Our tool is intended for use with your own content or images you have permission to edit.</p> </div> </section> </div>
๐Ÿ“„ holi-photoshoot-ideas-2025.md
--- id: holi-photoshoot-ideas-2025 title: 15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks excerpt: Discover creative Holi photoshoot ideas to capture the festival's vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools. publishDate: 2025-08-07 readTime: 14 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg keywords: ["Holi photoshoot ideas", "festival photography", "color powder photography", "Holi portrait ideas", "AI photo enhancement", "creative photography"] metaTitle: 15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks metaDescription: Discover creative Holi photoshoot ideas to capture the festival's vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools. faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What camera settings work best for Holi photography?", "acceptedAnswer": { "@type": "Answer", "text": "For Holi photography, use a fast shutter speed (1/1000s or faster) to freeze powder in mid-air, shoot in burst mode for action shots, use a wide aperture (f/1.8-f/2.8) for portraits with shallow depth of field, and protect your camera with weather sealing or plastic covers." } }, { "@type": "Question", "name": "How can I enhance my Holi photos with AI tools?", "acceptedAnswer": { "@type": "Answer", "text": "AI tools can significantly enhance Holi photos by boosting color saturation and vibrancy, removing unwanted background elements, upscaling image resolution for better detail, replacing cluttered backgrounds with clean alternatives, and applying artistic filters while maintaining natural skin tones." } } ] } --- <div class="article-header"> <h1>15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks</h1> <p class="article-intro"><strong>Holi, the festival of colors, offers photographers a canvas of vibrant hues, joyful expressions, and dynamic moments.</strong> Capturing the essence of this lively celebration requires both creative vision and technical skill. In this guide, we'll explore unique Holi photoshoot ideas that will help you create stunning images filled with color, emotion, and festive spirit.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Tools</h3> <p class="cta-block-text">Experience professional-quality AI Images with Modern Photo Tools. No signup required!</p> <a href="https://modernphototools.com/tools/" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >Explore All AI Tools</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#outdoor-ideas">Outdoor Holi Photoshoot Ideas</a></li> <li><a href="#portrait-ideas">Creative Holi Portrait Ideas</a></li> <li><a href="#group-ideas">Group Holi Photoshoot Ideas</a></li> <li><a href="#indoor-ideas">Indoor Holi Photoshoot Ideas</a></li> <li><a href="#creative-concepts">Creative Concept Holi Photoshoot Ideas</a></li> <li><a href="#equipment-protection">Protecting Your Camera During Holi Photography</a></li> <li><a href="#editing-tips">Enhancing Your Holi Photos with AI Tools</a></li> <li><a href="#conclusion">Capturing the Spirit of Holi</a></li> </ul> </div> </section> <section id="outdoor-ideas"> <h2>Outdoor Holi Photoshoot Ideas</h2> <p>The natural light and open spaces of outdoor settings create the perfect backdrop for vibrant Holi photography. Here are some creative ideas to capture the festival's energy in outdoor environments.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/58f5fccd-f68c-4d53-b51f-4c5d2fdab3c8.jpg" alt="Person throwing colorful Holi powder against blue sky"> </div> <h3>1. Color Powder Explosion</h3> <p>One of the most iconic Holi photoshoot ideas involves capturing the moment colored powder explodes into the air. Position your subject against the sky and ask them to throw or blow Holi powder upward. Use a fast shutter speed (1/1000s or faster) to freeze the powder in mid-air, creating a dramatic explosion of color.</p> <p>For the best results, shoot during the golden hour when the sunlight is soft and warm. This natural lighting will make the colors appear more vibrant and create a magical glow around your subject.</p> <div class="cta-block"> <h4 class="cta-block-title">Enhance Your Color Explosions</h4> <p class="cta-block-text">Sometimes unwanted elements can distract from your perfect powder shot. Our AI Cleanup tool can remove photobombers, distracting background elements, or imperfections while preserving the vibrant colors of your Holi photos.</p> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn">Try AI Cleanup Tool</a> </div> <h3>2. Action Shots with Water Balloons</h3> <p>Capture the playful spirit of Holi by photographing the moment colorful water balloons burst. This creates dynamic splashes that look spectacular in photos. Use burst mode to take multiple shots in quick succession, increasing your chances of capturing the perfect splash moment.</p> <p>To freeze the water droplets in mid-air, use a shutter speed of at least 1/2000s. Position yourself at a safe distance to protect your equipment while still getting close enough to capture the details of the splash.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg" alt="Water balloon bursting with colorful water during Holi celebration"> </div> <h3>3. Golden Hour Portraits</h3> <p>The soft, warm light during the golden hour (shortly after sunrise or before sunset) creates a magical atmosphere for Holi portraits. Position your subject with the sun behind them to create a beautiful backlit effect that makes the colored powder particles glow.</p> <p>Ask your subject to gently toss powder into the air above them while you capture the moment the particles catch the sunlight. This creates a dreamy, ethereal effect that enhances the festive mood of your Holi photos.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/2e985803-caa6-4833-8e59-a6ca111e976f.jpg" alt="Golden hour portrait with Holi colors glowing in backlight"> </div> <h3>4. Aerial Perspective</h3> <p>Capture the full scale and vibrancy of Holi celebrations by shooting from an elevated position. This could be from a balcony, rooftop, or using a drone if available. This perspective allows you to photograph patterns of color created by groups of people and the colorful chaos of the festival from above.</p> <p>Look for interesting formations or moments when multiple people throw colors simultaneously. The resulting image will showcase the collective joy and energy of the celebration in a unique way.</p> </section> <section id="portrait-ideas"> <h2>Creative Holi Portrait Ideas</h2> <p>Portraits during Holi can capture the personal joy and vibrant spirit of participants. Here are some creative approaches to Holi portrait photography that will result in stunning, memorable images.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/573ac44f-d645-4752-83af-940819d6d6f9.jpg" alt="Close-up portrait of face covered with colorful Holi powder"> </div> <h3>5. Colorful Close-Up Portraits</h3> <p>Create striking portraits by focusing on close-up shots of faces covered in Holi colors. Use a portrait lens (85mm or 50mm) with a wide aperture (f/1.8-f/2.8) to create a shallow depth of field that blurs the background while keeping the subject's face in sharp focus.</p> <p>Direct your subject to look directly into the camera to create an emotional connection with viewers. The contrast between their eyes and the colorful powder on their face creates a powerful visual impact.</p> <div class="cta-block"> <h4 class="cta-block-title">Perfect Your Portraits</h4> <p class="cta-block-text">Turn good portraits into stunning ones with our AI Portrait tool. Enhance facial features, balance colors, and create professional-quality portraits with just a few clicks.</p> <a href="https://modernphototools.com/tools/ai-portrait" target="_blank" class="cta-btn">Enhance With AI Portrait</a> </div> <h3>6. Hands Full of Colors</h3> <p>Sometimes the most expressive Holi photos focus on hands covered in colorful powder. Ask your subject to hold their hands out, palms up, filled with different colored powders. Capture the moment they blow the powder or let it slip through their fingers.</p> <p>Use a macro lens if available to capture the fine details and textures of the powder. This creates an intimate perspective that highlights the tactile nature of the Holi celebration.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/64bc670d-0e95-47c1-a314-d8693b55e768.jpg" alt="Close-up of hands holding colorful Holi powder"> </div> <h3>7. Contrast Portraits</h3> <p>Create dramatic portraits by photographing subjects against a dark background. The contrast between the vibrant Holi colors and the dark backdrop makes the colors pop and creates a striking visual effect.</p> <p>For indoor shoots, use a black backdrop or find a dark wall. For outdoor shoots, position your subject in front of a shadowed area or use a portable black backdrop. Add a single light source from the side to create dimension and highlight the colored powder.</p> </section> <section id="group-ideas"> <h2>Group Holi Photoshoot Ideas</h2> <p>Holi is a festival of community and togetherness, making group photos an essential part of capturing its spirit. Here are some creative ideas for photographing groups during Holi celebrations.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/031e0b7b-50d1-4549-a25b-adb5b7ed2702.jpg" alt="Group of friends throwing Holi colors simultaneously"> </div> <h3>8. Synchronized Color Throw</h3> <p>Arrange a group in a circle or line and coordinate a simultaneous color throw. Count down and capture the moment everyone throws their powder into the air. This creates a spectacular explosion of multiple colors and showcases the collective joy of the celebration.</p> <p>Use a wide-angle lens to capture the entire group and the full effect of the color cloud. Position yourself at a slight distance to include all participants and the colorful powder in your frame.</p> <div class="cta-block"> <h4 class="cta-block-title">Expand Your Group Shots</h4> <p class="cta-block-text">Did your group photo cut off someone important? Our AI Expand tool can extend your image canvas to include everyone in the frame without awkward cropping.</p> <a href="https://modernphototools.com/tools/ai-expand" target="_blank" class="cta-btn">Try AI Expand Now</a> </div> <h3>9. Candid Interaction Shots</h3> <p>Some of the most authentic Holi photos capture unposed moments of friends and family playing with colors. Move around the celebration and look for genuine moments of laughter, surprise, and joy as people apply colors to each other.</p> <p>Use a zoom lens to capture these moments without interrupting the natural flow of interactions. Focus on capturing authentic emotions rather than perfectly composed shots.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/5042787f-1129-4477-a0a8-80926e2c84cf.jpg" alt="Candid shot of friends laughing while playing with Holi colors"> </div> </section> <section id="indoor-ideas"> <h2>Indoor Holi Photoshoot Ideas</h2> <p>Indoor settings offer controlled environments for creative Holi photography. Here are some ideas that work well in studios or home settings while minimizing mess.</p> <h3>10. Controlled Lighting with Powder</h3> <p>In a studio or well-lit indoor space, create dramatic Holi photos by controlling both the lighting and the powder throw. Use side lighting or backlighting to highlight the particles of powder in the air, creating a three-dimensional effect.</p> <p>Place a light source behind the subject and have them throw powder toward the camera (being careful to protect your equipment). This creates a magical effect as the light passes through the colored particles.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f650fae6-02ec-4183-9035-7aa3f3f2edbe.jpg" alt="Indoor studio shot with controlled lighting and Holi powder"> </div> <h3>11. Creative Backgrounds</h3> <p>For indoor Holi photoshoots, experiment with different backgrounds to complement the colorful powder. White backgrounds create a clean, bright look, while black backgrounds make the colors pop dramatically. You can also use colored backdrops that complement or contrast with your Holi powder colors.</p> <p>Consider using textured backgrounds like fabric or paper for added visual interest. The contrast between the smooth powder and textured background creates depth in your images.</p> <div class="cta-block"> <h4 class="cta-block-title">Create Perfect Backgrounds</h4> <p class="cta-block-text">Need a specific background for your Holi portraits? Our AI Background Generator can create custom backgrounds that perfectly complement your Holi colors.</p> <a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" class="cta-btn">Generate Custom Backgrounds</a> </div> <h3>12. UV Reactive Holi Colors</h3> <p>Create a unique twist on traditional Holi photography by using UV-reactive colors and blacklight. In a darkened room with UV lights, these special colors will glow vibrantly, creating a surreal, otherworldly effect in your photos.</p> <p>Experiment with different poses and movements under the blacklight. The glowing colors against the dark background create dramatic, artistic images unlike traditional Holi photos.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/b399f9bf-2528-4d2a-8601-6edfbc6bf6c1.jpg" alt="Portrait with UV-reactive Holi colors under blacklight"> </div> </section> <section id="creative-concepts"> <h2>Creative Concept Holi Photoshoot Ideas</h2> <p>Take your Holi photography to the next level with these creative conceptual ideas that produce unique, artistic images.</p> <h3>13. Holi Color Silhouettes</h3> <p>Create artistic silhouette photos by positioning your subject between the camera and a bright light source (like the sun or a studio light). Have them throw Holi powder while you expose for the background, turning your subject into a dark silhouette surrounded by colorful powder.</p> <p>This technique creates a dramatic, artistic effect that highlights the shape and movement of both the subject and the colored powder. Experiment with different poses and powder throws to create unique silhouettes.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a0562a14-b4a8-4213-96df-26aeae1218ff.jpg" alt="Silhouette of person throwing Holi powder against bright background"> </div> <h3>14. Slow Motion Effect</h3> <p>While traditional photography freezes motion, you can create artistic Holi photos by intentionally capturing motion blur. Use a slower shutter speed (1/15s to 1/60s) and ask your subject to move while throwing or blowing powder.</p> <p>This technique creates dreamy, abstract images where the colors blend and streak across the frame. The result is a dynamic representation of the festival's energy and movement.</p> <div class="cta-block"> <h4 class="cta-block-title">Enhance Image Quality</h4> <p class="cta-block-text">Motion blur shots sometimes lose detail. Our AI Image Upscaler can enhance resolution and bring back clarity to your creative Holi photos.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn">Upscale Your Images</a> </div> <h3>15. Holi Face as Art</h3> <p>Transform Holi makeup into artistic face painting by applying colors in intentional patterns rather than the usual random application. Create geometric designs, gradients, or other artistic patterns using Holi colors on the face.</p> <p>Photograph these artistic creations as portraits, focusing on the detailed application of color and the expression of the subject. This approach combines traditional Holi elements with contemporary body art concepts.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/edb740b0-5ab9-4963-b580-53c5c58d54f3.jpg" alt="Artistic Holi face painting with intentional color patterns"> </div> </section> <section id="equipment-protection"> <h2>Protecting Your Camera During Holi Photography</h2> <p>Holi's colorful powders and water can damage camera equipment if proper precautions aren't taken. Here are essential tips to protect your gear while capturing the festival.</p> <div class="two-columns"> <div> <h3>Essential Protection Tips</h3> <ul class="custom-list"> <li>Use a weather-sealed camera if available</li> <li>Cover your camera with a clear plastic bag or dedicated rain cover</li> <li>Apply UV filters to protect your lenses</li> <li>Avoid changing lenses in dusty environments</li> <li>Keep lens caps on when not shooting</li> <li>Use a lens hood for additional protection</li> <li>Clean equipment thoroughly after the shoot</li> </ul> </div> <div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/136c584c-46e0-4d7a-85f6-4011e231e008.jpg" alt="Camera protected with plastic cover during Holi festival"> </div> </div> </div> <div class="cta-block"> <h4 class="cta-block-title">Rescue Imperfect Photos</h4> <p class="cta-block-text">If your photos didn't turn out perfect due to equipment issues or challenging conditions, our AI tools can help rescue and enhance your Holi memories.</p> <a href="https://modernphototools.com/tools/ai-filter" target="_blank" class="cta-btn">Enhance With AI Filters</a> </div> </section> <section id="editing-tips"> <h2>Enhancing Your Holi Photos with AI Tools</h2> <p>Even with perfect shooting techniques, Holi photos often benefit from post-processing to bring out their full potential. Here's how our AI tools can transform your Holi photography.</p> <div class="three-columns"> <div class="column-card"> <h3>Color Enhancement</h3> <p>Holi photos should pop with vibrant colors. Our AI Filter tool can automatically enhance color saturation and contrast while maintaining natural skin tones.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/6cfe45f4-4827-4c9f-8855-395c3eeefd5c.jpg" alt="Before and after of Holi photo with enhanced colors"> </div> </div> <div class="column-card"> <h3>Background Replacement</h3> <p>Remove distracting backgrounds from your Holi portraits with our AI Replace tool. Swap cluttered backgrounds with clean, complementary alternatives.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a1d26bbd-f38d-4b03-bd65-c5103c93cb81.jpg" alt="Holi portrait with background replaced using AI"> </div> </div> <div class="column-card"> <h3>Detail Enhancement</h3> <p>Bring out the fine details of powder particles and expressions with our AI Image Upscaler, which enhances resolution without introducing artifacts.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/602f86b8-f6ce-4d07-9f86-5bb520ac93a4.jpg" alt="Close-up of Holi powder details enhanced with AI upscaling"> </div> </div> </div> <div class="cta-block"> <h4 class="cta-block-title">Transform Your Holi Photos</h4> <p class="cta-block-text">Ready to take your Holi photography to the next level? Our complete suite of AI photo editing tools can help you create stunning, professional-quality images from your Holi celebration.</p> <a href="https://modernphototools.com/tools" target="_blank" class="cta-btn cta-btn-large">Explore All AI Tools</a> </div> </section> <section id="conclusion"> <h2>Capturing the Spirit of Holi</h2> <p>Holi photography offers a unique opportunity to capture vibrant colors, genuine emotions, and cultural traditions. With the right techniques and creative approaches, you can create stunning images that preserve the joy and energy of this colorful festival.</p> <p>Remember that the best Holi photos often come from a balance of technical skill and spontaneity. Be prepared with the right equipment protection, but also be ready to capture unplanned moments of joy and celebration.</p> <p>Whether you're shooting outdoors in natural light or creating controlled studio setups, these Holi photoshoot ideas will help you create memorable images. And with our powerful AI editing tools, you can enhance your photos to truly capture the vibrant spirit of the festival of colors.</p> <div class="cta-block"> <h4 class="cta-block-title">Start Creating Stunning Holi Photos Today</h4> <p class="cta-block-text">Explore our complete suite of AI photo editing tools and transform your Holi photography from ordinary to extraordinary.</p> <a href="https://modernphototools.com/tools" target="_blank" class="cta-btn cta-btn-large cta-btn-accent">Get Started Now</a> </div> </section></div> <style>.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating="0"]{--rating: 0}.styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5}.styled-container .rating-stars[data-rating="1"]{--rating: 1}.styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5}.styled-container .rating-stars[data-rating="2"]{--rating: 2}.styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5}.styled-container .rating-stars[data-rating="3"]{--rating: 3}.styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5}.styled-container .rating-stars[data-rating="4"]{--rating: 4}.styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1}.styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2}.styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3}.styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4}.styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5}.styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6}.styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7}.styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8}.styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9}.styled-container .rating-stars[data-rating="5"]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""}.styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype="https://schema.org/FAQPage"]{margin-bottom:20px}.styled-container section[itemtype="https://schema.org/FAQPage"] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns>div:not([class]),.styled-container .three-columns>div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}</style>
๐Ÿ“„ how-to-create-professional-product-photos-with-ai.md
--- id: how-to-create-professional-product-photos-with-ai title: "How to Create Professional Product Photos with AI | Modern Photo Tools" excerpt: "Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills." publishDate: oct 27, 2025 readTime: 14 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg keywords: ["AI product photography", "product photos","e-commerce images"] metaTitle: "How to Create Professional Product Photos with AI | Modern Photo Tools" metaDescription: "Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills." --- <style> :root { --bg: #ffffff; --text: #1f2937; --muted: #6b7280; --primary: #2563eb; --primary-dark: #1d4ed8; --accent: #7c3aed; --card: #f9fafb; --border: #e5e7eb; --success: #16a34a; } body { background: var(--bg); color: var(--text); } .container { max-width: 1100px; margin: 0 auto; padding: 24px; } h1 { font-size: 2.2rem; line-height: 1.2; margin: 24px 0; color: #0f172a; } h2 { font-size: 1.6rem; margin: 24px 0 16px; color: #111827; } h3 { font-size: 1.2rem; margin: 18px 0 10px; color: #1f2937; } p { font-size: 1rem; line-height: 1.75; color: var(--text); margin: 12px 0; } a { color: var(--primary); text-decoration: none; } a:hover { color: var(--primary-dark); text-decoration: underline; } ul.custom-list { list-style: disc; padding-left: 20px; } li { margin: 6px 0; } .img-container { border-radius: 12px; overflow: hidden; background: #f3f4f6; border: 1px solid var(--border); margin: 12px 0 18px; } .img-container img { width: 100%; display: block; object-fit: cover; } .hero-intro { background: linear-gradient(135deg, #eef2ff, #faf5ff); border: 1px solid var(--border); border-radius: 16px; padding: 20px; } .two-columns { display: grid; grid-template-columns: 1fr; gap: 18px; } @media (min-width: 768px) { .two-columns { grid-template-columns: 1fr 1fr; } } .three-columns { display: grid; grid-template-columns: 1fr; gap: 18px; } @media (min-width: 900px) { .three-columns { grid-template-columns: repeat(3, 1fr); } } .column-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; } .cta-block { background: linear-gradient(135deg, #eff6ff, #f5f3ff); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 24px 0; text-align: center; } .cta-block-title { font-size: 1.3rem; margin-bottom: 6px; } .cta-block-text { color: var(--muted); margin-bottom: 12px; } .cta-btn { display: inline-block; padding: 10px 16px; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; font-weight: 600; } .cta-btn:hover { filter: brightness(1.05); } .cta-btn-large { padding: 12px 18px; } .table-container { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: #fff; } table.responsive-table { width: 100%; border-collapse: collapse; } table.responsive-table td { border-bottom: 1px solid var(--border); padding: 12px; text-align: left; } .responsive-table-striped tbody tr:nth-child(odd) { background: #f9fafb; } td[data-row="head"] { font-weight: 700; color: #111827; background: #f3f4f6; } .toc { border: 1px solid var(--border); background: #fafafa; border-radius: 12px; padding: 16px; margin: 16px 0 24px; } .toc h2 { margin-top: 0; } .toc ul { list-style: none; padding: 0; } .toc li { margin: 8px 0; } .toc a { font-weight: 600; } .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: #000; } .video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; } .faq-question { font-size: 1.05rem; font-weight: 700; } .faq-answer p { color: var(--muted); } </style> <div class="container"> <h1>How to Create Professional Product Photos with AI | ModernPhoto Tools</h1> <!-- Featured Image --> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg" alt="AI-generated professional product photo on desire background"> </div> <!-- Intro --> <section class="hero-intro"> <p>Want studio-quality product photos without hiring photographers or buying expensive lighting gear? With AI, you can turn simple product shots into polished, professional visuals in minutes. This guide shows you how to create modern, high-impact product photos using accessible AI toolsโ€”perfect for e-commerce, social media, and marketing.</p> </section> <!-- Table of Contents --> <section class="toc" aria-label="Table of Contents"> <h2>Table of Contents</h2> <ul> <li><a href="#benefits">Why Use AI for Product Photography?</a></li> <li><a href="#how-it-works">How AI Product Photography Works</a></li> <li><a href="#getting-started">Getting Started with AI Product Photography</a></li> <li><a href="#tips">Pro Tips for Better AI Product Photos</a></li> <li><a href="#use-cases">Creative Use Cases for AI Product Photos</a></li> <li><a href="#tool-introduction">Introducing Our AI Product Photoshoot Tool</a></li> <li><a href="#comparison">AI vs. Traditional Product Photography</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> <li><a href="#conclusion">Transform Your Product Photography Today</a></li> </ul> </section> <!-- Why Use AI --> <section id="benefits"> <h2>Why Use AI for Product Photography?</h2> <div class="two-columns"> <div> <p>AI makes professional product photography accessible to everyone. Instead of building a studio, you can capture basic product shots on a phone and let AI handle backgrounds, lighting, and the scene.</p> <ul class="custom-list"> <li>Save costโ€”no studio gear or expensive sessions</li> <li>Create polished results in minutes, not days</li> <li>Generate unlimited variations and consistent branding</li> <li>Scale content across catalogs and campaigns easily</li> </ul> </div> </div> </section> <!-- How It Works --> <section id="how-it-works"> <h2>How AI Product Photography Works</h2> <div> <div class="video-container" aria-label="AI Product Photography video"> <iframe src="https://www.youtube.com/embed/gTKpgCNS3V8" title="AI Product Photography Overview" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> </div> <p>Watch how AI turns simple product shots into professional visuals suitable for eโ€‘commerce, ads, and social media.</p> </div> <div class="three-columns"> <div class="column-card"> <h3>Background Removal</h3> <p>Precisely removes the original background while preserving product edges and fine details.</p> </div> <div class="column-card"> <h3>Scene Generation</h3> <p>Builds photorealistic environments from simple text prompts, aligned to your brand style.</p> </div> <div class="column-card"> <h3>Lighting & Enhancement</h3> <p>Applies studio-quality lighting, natural shadows, and clarity adjustments for a premium look.</p> </div> </div> </section> <!-- Getting Started --> <section id="getting-started"> <h2>Getting Started with AI Product Photography</h2> <ul class="custom-list"> <li>Capture a clear product photo in soft, even light</li> <li>Upload the image to your AI product photography tool</li> <li>Choose a clean background or generate a lifestyle scene</li> <li>Adjust lighting, shadows, and composition if needed</li> <li>Export high-resolution images ready for web or print</li> </ul> </section> <!-- Pro Tips --> <section id="tips"> <h2>Pro Tips for Better AI Product Photos</h2> <div class="two-columns"> <div> <h3>Optimize Your Input Image</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/14aad0f8-8e68-4e43-aa56-804854ef29ef.jpg" alt="Comparison showing poor vs good input images"> </div> <ul class="custom-list"> <li>Use diffused light to avoid harsh shadows</li> <li>Shoot against a simple, contrasting background</li> <li>Keep the product fully in frame and in focus</li> <li>Clean surfaces to remove dust and fingerprints</li> </ul> </div> <div> <h3>Craft Effective Text Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/130ce90a-8df3-4f0d-8135-deb20972db8d.jpg" alt="Examples of effective prompts for product scenes"> </div> <ul class="custom-list"> <li>Specify materials: โ€œmarble countertopโ€, โ€œoak tableโ€, etc.</li> <li>Describe lighting: โ€œsoft natural light from the leftโ€</li> <li>Add mood: โ€œminimalist kitchen setting, morning lightโ€</li> <li>Include brand cues: โ€œluxury bathroom with gold accentsโ€</li> </ul> </div> </div> </section> <!-- Use Cases --> <section id="use-cases"> <h2>Creative Use Cases for AI Product Photography</h2> <div class="three-columns"> <div class="column-card"> <h3>E-commerce Product Listings</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c3d1a62d-831d-4f52-96c5-5d98622d8f09.jpg" alt="Consistent AI product listing images"> </div> <p>Maintain consistent backgrounds and lighting across hundreds of SKUsโ€”without reshoots.</p> </div> <div class="column-card"> <h3>Social Media Content</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/786dd410-14d2-4a38-a8bf-4169f03b1c54.jpg" alt="Lifestyle product photos for social media"> </div> <p>Generate on-brand lifestyle images for seasonal campaigns and high engagement posts.</p> </div> <div class="column-card"> <h3>Marketing Campaigns</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/1cdb328b-cc6c-4f96-97b3-18372a3e368b.jpg" alt="AI product photos for campaigns"> </div> <p>Produce campaign-specific visuals fast. Test multiple concepts without costly production.</p> </div> </div> </section> <!-- Tool Introduction --> <section id="tool-introduction"> <h2>Introducing Our AI Product Photoshoot Tool</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/a75d28c5-5d79-4a08-b3ac-217358d9a03b.jpg" alt="Modern Photo Tools AI Product Photoshoot interface"> </div> <p>Combine powerful AI with an intuitive interface to create studio-quality product photos in minutes.</p> <div class="three-columns"> <div class="column-card"><h3>Intelligent Background Removal</h3><p>Exceptional accuracy, even for complex edges and textures.</p></div> <div class="column-card"><h3>Realistic Scene Generation</h3><p>Limitless variations from simple prompts for brand-aligned visuals.</p></div> <div class="column-card"><h3>Professional Lighting Effects</h3><p>Natural shadows, reflections, and balanced highlights.</p></div> </div> <div class="three-columns"> <div class="column-card"><h3>Batch Processing</h3><p>Create consistent visuals across your full catalog at once.</p></div> <div class="column-card"><h3>High-Resolution Exports</h3><p>Ready for websites, marketplaces, print, and ads.</p></div> <div class="column-card"><h3>User-Friendly Interface</h3><p>No technical skills requiredโ€”accessible to everyone.</p></div> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Transform Your Product Photos?</h3> <p class="cta-block-text">Join thousands using our AI Product Photoshoot Tool to create professional images fast.</p> <a href="https://modernphototools.com/tools/ai-product-photoshoot" target="_blank" class="cta-btn cta-btn-large" rel="nofollow">Create professional product photos with AI</a> </div> </section> <!-- Comparison --> <section id="comparison"> <h2>AI vs. Traditional Product Photography</h2> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <td data-row="head">Feature</td> <td data-row="head">AI Product Photography</td> <td data-row="head">Traditional Photography</td> </tr> </thead> <tbody> <tr> <td data-label="Feature">Cost</td> <td data-label="AI Product Photography">$10โ€“50/month subscription</td> <td data-label="Traditional Photography">$200โ€“500+ per product/session</td> </tr> <tr> <td data-label="Feature">Time Required</td> <td data-label="AI Product Photography">Minutes per product</td> <td data-label="Traditional Photography">Hours to days per session</td> </tr> <tr> <td data-label="Feature">Equipment Needed</td> <td data-label="AI Product Photography">Basic smartphone camera</td> <td data-label="Traditional Photography">Pro camera, lighting, studio</td> </tr> <tr> <td data-label="Feature">Skill Level</td> <td data-label="AI Product Photography">Beginnerโ€‘friendly</td> <td data-label="Traditional Photography">Professional expertise required</td> </tr> <tr> <td data-label="Feature">Revisions</td> <td data-label="AI Product Photography">Unlimited, instant</td> <td data-label="Traditional Photography">Limited, requires reshoots</td> </tr> <tr> <td data-label="Feature">Scaling</td> <td data-label="AI Product Photography">Scale to hundreds of products easily</td> <td data-label="Traditional Photography">Linear cost increase with more products</td> </tr> </tbody> </table> </div> </section> <!-- FAQ --> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-item"> <h3 class="faq-question">Will AI-generated product photos look realistic?</h3> <div class="faq-answer"> <p>Yes. Modern AI tools create highly realistic product photos that often look indistinguishable from traditional studio photography. Quality depends on your input image and the tool used; our approach ensures natural lighting, shadows, and reflections.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Do I need any special equipment to get started?</h3> <div class="faq-answer"> <p>No special equipment is required. A smartphone in natural light is enough to capture a solid input image. AI handles backgrounds, lighting, and scene creation to produce professional results.</p> </div> </div> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Will AI-generated product photos look realistic?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. Modern AI tools create highly realistic product photos that often look indistinguishable from traditional studio photography. Quality depends on your input image and the tool used; our approach ensures natural lighting, shadows, and reflections." } }, { "@type": "Question", "name": "Do I need any special equipment to get started?", "acceptedAnswer": { "@type": "Answer", "text": "No special equipment is required. A smartphone in natural light is enough to capture a solid input image. AI handles backgrounds, lighting, and scene creation to produce professional results." } } ] } </script> </section> <!-- Conclusion --> <section id="conclusion"> <h2>Transform Your Product Photography Today</h2> <p>AI product photography is changing how brands create visuals. With the right tool, you can produce professional, consistent, and on-brand images quicklyโ€”without the cost of studio production.</p> <p>Whether you run an online store, post on social media, or build ad campaigns, AI helps you scale high-quality product imagery with minimal effort.</p> <div class="cta-block"> <h3 class="cta-block-title">Start Creating Professional Product Photos Now</h3> <p class="cta-block-text">No photography skills needed. No expensive equipment required. Just upload your product and let AI do the magic.</p> <a href="https://modernphototools.com/tools/ai-product-photoshoot" target="_blank" class="cta-btn cta-btn-large" rel="nofollow">Create professional product photos with AI</a> </div> </section> </div>
๐Ÿ“„ how-to-restore-old-family-photos.md
--- id: how-to-restore-old-family-photos title: "How to Restore Old Family Photos: A Step-by-Step AI Guide" excerpt: "Learn how to breathe new life into damaged family photos with AI photo restoration. Our step-by-step guide shows you how to fix scratches, enhance details, and preserve precious memories." publishDate: "2025-010-18" readTime: "12 min read" category: tutorial featuredImage: "https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg" relatedTool: "ai-image-upscaler" keywords: ["AI photo restoration", "restore old photos", "family photo restoration", "AI image upscaler", "photo repair", "digital photo restoration"] metaTitle: "How to Restore Old Family Photos: A Step-by-Step AI Guide" metaDescription: "Learn how to breathe new life into damaged family photos with AI photo restoration. Our step-by-step guide shows you how to fix scratches, enhance details, and preserve precious memories." faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Can AI restore any damaged photo?", "acceptedAnswer": { "@type": "Answer", "text": "AI can restore most damaged photos, but results vary based on damage severity. Our tool works best with photos that have scratches, tears, fading, and blurriness. Extremely damaged photos with large missing sections may have limitations, but you'll be surprised by what modern AI can accomplish." } }, { "@type": "Question", "name": "Will AI photo restoration change how people look in my photos?", "acceptedAnswer": { "@type": "Answer", "text": "Our AI is designed to enhance while preserving authenticity. It improves clarity and detail but maintains the original appearance and expressions of people in your photos. The goal is restoration, not alteration." } }, { "@type": "Question", "name": "How accurate is AI colorization for black and white photos?", "acceptedAnswer": { "@type": "Answer", "text": "AI colorization has become remarkably accurate. The algorithm analyzes context clues and historical data to apply natural, period-appropriate colors. While not 100% historically accurate in every detail, the results are usually very convincing and bring new life to black and white photos." } }, { "@type": "Question", "name": "Is my data safe when using your AI photo restoration tool?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, we take privacy seriously. Your uploaded photos are processed securely and are not stored permanently on our servers. All uploads are automatically deleted after processing, and we never use your personal photos for AI training without explicit consent." } } ] } --- <title>How to Restore Old Family Photos: A Step-by-Step AI Guide</title> <style>.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating="0"]{--rating: 0}.styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5}.styled-container .rating-stars[data-rating="1"]{--rating: 1}.styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5}.styled-container .rating-stars[data-rating="2"]{--rating: 2}.styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5}.styled-container .rating-stars[data-rating="3"]{--rating: 3}.styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5}.styled-container .rating-stars[data-rating="4"]{--rating: 4}.styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1}.styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2}.styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3}.styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4}.styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5}.styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6}.styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7}.styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8}.styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9}.styled-container .rating-stars[data-rating="5"]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""}.styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype="https://schema.org/FAQPage"]{margin-bottom:20px}.styled-container section[itemtype="https://schema.org/FAQPage"] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns>div:not([class]),.styled-container .three-columns>div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}</style> <div class="styled-container"><section id="introduction"> <h1>How to Restore Old Family Photos: A Step-by-Step AI Guide</h1> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#why-restore">Why Restore Your Old Family Photos?</a></li> <li><a href="#how-ai-works">How AI Photo Restoration Works</a></li> <li><a href="#preparation">Preparing Your Photos for AI Restoration</a></li> <li><a href="#step-by-step">Step-by-Step Guide to AI Photo Restoration</a></li> <li><a href="#advanced-techniques">Advanced AI Photo Restoration Techniques</a></li> <li><a href="#tips-tricks">Tips and Tricks for Better Results</a></li> <li><a href="#faq">Frequently Asked Questions About AI Photo Restoration</a></li> <li><a href="#conclusion">Conclusion</a></li> </ul> </div> <p>Those faded, scratched, and torn family photographs tucked away in albums and shoeboxes hold irreplaceable memories. Until recently, restoring these treasured images required expensive professional services or complex photo editing skills. Today, AI photo restoration technology has made it possible for anyone to breathe new life into damaged photos with just a few clicks. This guide will walk you through the simple process of transforming your deteriorating family photos into vibrant, clear images that can be preserved for generations to come.</p> </section> <section id="why-restore"> <h2>Why Restore Your Old Family Photos?</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg" alt="Before and after comparison of AI photo restoration showing a damaged family photo transformed into a clear, vibrant image" data-method="text-to-image"> </div> <p>Old photographs are more than just imagesโ€”they're irreplaceable windows into your family's history. Unfortunately, time takes its toll on physical photos. Colors fade, paper deteriorates, and handling causes scratches and tears. Restoring these photos preserves your family legacy and brings forgotten memories back to life.</p> <div class="two-columns"> <div> <h3>Common Issues with Old Photos</h3> <ul class="custom-list"> <li>Fading and color shifts</li> <li>Scratches, creases, and tears</li> <li>Water damage and stains</li> <li>Blurriness and loss of detail</li> <li>Yellowing and sepia toning</li> </ul> </div> <div> <h3>Benefits of AI Photo Restoration</h3> <ul class="custom-list"> <li>Restore damaged photos in seconds</li> <li>Enhance facial details and expressions</li> <li>Revive faded colors or colorize black and white photos</li> <li>Improve overall clarity and sharpness</li> <li>Preserve precious memories for future generations</li> </ul> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Bring Your Old Photos Back to Life?</h3> <p class="cta-block-text">Our AI Image Upscaler tool can help restore your precious memories in just a few clicks.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="1" rel="nofollow">Restore Your Photos Now</a> </div> </section> <section id="how-ai-works"> <h2>How AI Photo Restoration Works</h2> <p>Before diving into the restoration process, it helps to understand how AI photo restoration actually works. Unlike traditional photo editing that requires manual adjustments, AI-powered tools use machine learning algorithms trained on millions of images to automatically identify and fix damage.</p> <div class="video-embed"> <iframe src="https://www.youtube.com/embed/u317ockLJ44" width="100%" height="450" frameborder="0" allowfullscreen></iframe> </div> <div class="three-columns"> <div class="column-card"> <h3>Pattern Recognition</h3> <p>AI analyzes your photo to identify patterns of damage like scratches, tears, and stains, distinguishing them from the actual image content.</p> </div> <div class="column-card"> <h3>Detail Reconstruction</h3> <p>Using what it's learned from millions of images, the AI fills in missing details, restores faded areas, and enhances facial features.</p> </div> <div class="column-card"> <h3>Color Enhancement</h3> <p>AI algorithms can revive faded colors or even intelligently colorize black and white photos based on contextual understanding.</p> </div> </div> </section> <section id="preparation"> <h2>Preparing Your Photos for AI Restoration</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/665e2d19-22b0-4558-9544-af49c4906d05.jpg" alt="Person scanning an old damaged family photo using a flatbed scanner for AI photo restoration" data-method="text-to-image"> </div> <p>Before you can restore old photos with AI, you'll need to digitize them. The quality of your digital scan directly impacts the restoration results, so follow these steps for the best outcome:</p> <div class="two-columns"> <div> <h3>Digitizing Options</h3> <ul class="list-numbers"> <li>Use a flatbed scanner at 300-600 DPI for best results</li> <li>If you don't have a scanner, use a smartphone with good lighting</li> <li>For valuable photos, consider professional scanning services</li> <li>Ensure the entire photo is captured, including edges</li> </ul> </div> <div> <h3>Scanning Tips</h3> <ul class="custom-list"> <li>Clean the scanner glass thoroughly before scanning</li> <li>Place photos flat to avoid additional shadows or distortion</li> <li>Scan in color even for black and white photos</li> <li>Save files as uncompressed TIFF or high-quality JPG</li> <li>Create a backup of original scans before restoration</li> </ul> </div> </div> <div class="blockquote"> <p>"The better your initial scan quality, the better your restoration results will be. Take time to properly digitize your photos before starting the AI restoration process."</p> </div> </section> <section id="step-by-step"> <h2>Step-by-Step Guide to AI Photo Restoration</h2> <p>Now that you understand how AI photo restoration works and have digitized your photos, let's walk through the restoration process using our AI Image Upscaler tool.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/8d03fae9-f7c9-4eb2-b078-dddc3f2e60fb.jpg" alt="ModernPhotoTools AI Image Upscaler interface showing the upload Process" data-method="text-to-image"> </div> <ol class="list-numbers"> <li> <h3>Upload Your Photo</h3> <p>Visit our <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" data-link="true" data-id="2" rel="nofollow">AI Image Upscaler tool</a> and click the "Upload Image" button. You can drag and drop your photo or browse to select it from your computer.</p> </li> <li> <h3>Select Restoration Options</h3> <p>Once your photo is uploaded, you'll see several restoration options. For old family photos, we recommend selecting:</p> <ul class="custom-list"> <li><strong>Fix Scratches &amp; Damage:</strong> Removes physical imperfections</li> <li><strong>Enhance Faces:</strong> Improves facial details and expressions</li> <li><strong>Color Correction:</strong> Restores natural colors or colorizes B&amp;W photos</li> <li><strong>Upscale:</strong> Increases resolution for better printing quality</li> </ul> </li> <li> <h3>Start the Restoration Process</h3> <p>Click the "Restore Photo" button to begin the AI restoration process. The advanced algorithms will analyze your photo and apply the selected enhancements automatically.</p> <div class="highlight-box"> <p>The restoration process typically takes 30-60 seconds depending on the photo size and selected options. Larger photos or more extensive damage may take slightly longer to process.</p> </div> </li> <li> <h3>Review and Adjust</h3> <p>After processing, you'll see a side-by-side comparison of your original and restored photo. Use the slider to compare the differences and see the improvements.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/73041e80-c93c-4f1a-9a6e-4604609189ed.jpg" alt="Side-by-side comparison of original damaged photo and AI-restored version with comparison slider" data-method="text-to-image"> </div> </li> <li> <h3>Fine-tune Results (Optional)</h3> <p>If needed, you can adjust specific settings to fine-tune the restoration:</p> <ul class="custom-list"> <li><strong>Detail Enhancement:</strong> Adjust the level of detail recovery</li> <li><strong>Color Intensity:</strong> Control how vibrant the restored colors appear</li> <li><strong>Sharpness:</strong> Fine-tune the overall sharpness of the image</li> </ul> </li> <li> <h3>Download Your Restored Photo</h3> <p>Once you're satisfied with the results, click the "Download" button to save your restored photo. We recommend saving in high-quality JPG or PNG format for the best balance of quality and file size.</p> </li> </ol> <div class="cta-block"> <h3 class="cta-block-title">Ready to Try It Yourself?</h3> <p class="cta-block-text">Restore your precious family photos in just a few clicks with our powerful AI technology.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="3" rel="nofollow">Start Restoring Your Photos</a> </div> </section> <section id="advanced-techniques"> <h2>Advanced AI Photo Restoration Techniques</h2> <p>While our AI Image Upscaler tool handles most restoration needs automatically, here are some advanced techniques for specific photo issues:</p> <div class="three-columns"> <div class="column-card"> <h3>Fixing Severely Damaged Photos</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/b8054665-ddb8-493a-8aea-7656aac8bf8a.jpg" alt="Before and after of a severely damaged photo restored with AI photo restoration" data-method="text-to-image"> </div> <p>For photos with extensive damage, try multiple restoration passes. First, focus on fixing structural damage (tears, missing pieces), then enhance details and colors in a second pass.</p> </div> <div class="column-card"> <h3>Enhancing Facial Details</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/ead2a21b-8baf-43a4-a709-0a6f7f605f94.jpg" alt="Close-up comparison of facial details before and after AI photo restoration" data-method="text-to-image"> </div> <p>Our AI is specially trained to recognize and enhance facial features. For family portraits, select the "Enhance Faces" option for the best results in recovering expressions and details.</p> </div> <div class="column-card"> <h3>Colorizing Black &amp; White Photos</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/ceb353d2-ba50-40a9-a53f-ab0b5aaf44a5.jpg" alt="Black and white family photo colorized using AI photo restoration" data-method="text-to-image"> </div> <p>Our AI can add natural-looking color to black and white photos. The algorithm analyzes the image context to apply historically accurate colors to clothing, skin tones, and backgrounds.</p> </div> </div> <div class="blockquote"> <p>"AI photo restoration isn't just about fixing damageโ€”it's about bringing memories back to life with enhanced details and colors that make the past feel present again."</p> </div> <div class="cta-block"> <h3 class="cta-block-title">Tackle Even the Most Challenging Photos</h3> <p class="cta-block-text">Our advanced AI can handle severely damaged photos, enhance facial details, and add natural color to black and white images.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn" data-link="true" data-id="4" rel="nofollow">Restore Challenging Photos</a> </div> </section> <section id="tips-tricks"> <h2>Tips and Tricks for Better Results</h2> <p>Get the most out of AI photo restoration with these expert tips:</p> <div class="two-columns"> <div> <h3>Before Restoration</h3> <ul class="custom-list"> <li><strong>Clean physical photos</strong> gently with a soft cloth before scanning</li> <li><strong>Scan at high resolution</strong> (at least 300 DPI, preferably 600 DPI)</li> <li><strong>Crop out borders and frames</strong> unless they're part of the photo you want to preserve</li> <li><strong>Adjust brightness and contrast</strong> of your scan if the original is extremely faded</li> </ul> </div> <div> <h3>After Restoration</h3> <ul class="custom-list"> <li><strong>Compare multiple restoration attempts</strong> with different settings</li> <li><strong>Save in high-quality formats</strong> like PNG or TIFF for archiving</li> <li><strong>Print on acid-free paper</strong> if creating physical copies</li> <li><strong>Create digital backups</strong> of both original scans and restored versions</li> </ul> </div> </div> <div class="img-container"> </div> <div class="info-box"> <p><strong>Pro Tip:</strong> For precious family photos, consider creating a restoration project. Organize photos by decade or family member, restore them systematically, and create a digital family archive to share with relatives.</p> </div> </section> <section id="faq" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/FAQPage"> <h2>Frequently Asked Questions About AI Photo Restoration</h2> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Can AI restore any damaged photo?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">AI can restore most damaged photos, but results vary based on damage severity. Our tool works best with photos that have scratches, tears, fading, and blurriness. Extremely damaged photos with large missing sections may have limitations, but you'll be surprised by what modern AI can accomplish.</p> </div> </div> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Will AI photo restoration change how people look in my photos?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Our AI is designed to enhance while preserving authenticity. It improves clarity and detail but maintains the original appearance and expressions of people in your photos. The goal is restoration, not alteration.</p> </div> </div> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">How accurate is AI colorization for black and white photos?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">AI colorization has become remarkably accurate. The algorithm analyzes context clues and historical data to apply natural, period-appropriate colors. While not 100% historically accurate in every detail, the results are usually very convincing and bring new life to black and white photos.</p> </div> </div> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Is my data safe when using your AI photo restoration tool?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Yes, we take privacy seriously. Your uploaded photos are processed securely and are not stored permanently on our servers. All uploads are automatically deleted after processing, and we never use your personal photos for AI training without explicit consent.</p> </div> </div> <div class="faq-item" itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question"> <h3 class="faq-question" itemprop="name">Can I restore multiple photos at once?</h3> <div class="faq-answer" itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"> <p itemprop="text">Yes, our AI Image Upscaler tool allows batch processing. You can upload multiple photos and restore them in sequence, saving you time when working with large family photo collections.</p> </div> </div> </section> <section id="conclusion"> <h2>Conclusion: Preserve Your Family Legacy with AI Photo Restoration</h2> <p>Old family photos are irreplaceable treasures that connect us to our past. With AI photo restoration technology, you now have the power to rescue these memories from the ravages of time. Our easy-to-use tools make it possible for anyoneโ€”regardless of technical skillโ€”to restore clarity, color, and life to damaged photos.</p> <p>Don't let your precious family memories fade away. Start your restoration journey today and create a digital legacy that can be shared with generations to come.</p> <div class="cta-block"> <h3 class="cta-block-title">Ready to Bring Your Family Memories Back to Life?</h3> <p class="cta-block-text">Our AI Image Upscaler tool makes photo restoration simple, fast, and accessible to everyone.</p> <a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="5" rel="nofollow">Start Restoring Your Family Photos Now</a> </div> </section></div>
๐Ÿ“„ how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator.md
--- id: how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator title: "How to Test a New Hairstyle with an AI Hairstyle Generator" excerpt: "Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!" publishDate: nov 5, 2025 readTime: 12 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp relatedTool: ai-hairstyle keywords: ["ai hairstyle generator", "virtual hairstyle try-on", "test a new hairstyle", "try hairstyles online", "hair color preview"] metaTitle: "How to Test a New Hairstyle with an AI Hairstyle Generator" metaDescription: "Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!" --- <style> .styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating="0"]{--rating: 0}.styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5}.styled-container .rating-stars[data-rating="1"]{--rating: 1}.styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5}.styled-container .rating-stars[data-rating="2"]{--rating: 2}.styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5}.styled-container .rating-stars[data-rating="3"]{--rating: 3}.styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5}.styled-container .rating-stars[data-rating="4"]{--rating: 4}.styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1}.styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2}.styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3}.styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4}.styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5}.styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6}.styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7}.styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8}.styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9}.styled-container .rating-stars[data-rating="5"]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""}.styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333} </style> <div class="styled-container"> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp" alt="AI hairstyle generator featured preview image" /> </div> <h1>How to Test a New Hairstyle with an AI Hairstyle Generator</h1> <section class="table-of-contents"> <h2>Table of Contents</h2> <ul> <li><a href="#why-change">Why People Hesitate to Change Their Hairstyle</a></li> <li><a href="#ai-solution">How AI Technology Solves the Hairstyle Dilemma</a></li> <li><a href="#tool-guide">How to Use ModernPhotoTools' AI Hairstyle Generator</a></li> <li><a href="#interface-navigation">Navigating the Interface</a></li> <li><a href="#benefits">Benefits of Using an AI Hairstyle Generator</a></li> <li><a href="#best-practices">Tips for Getting the Best Results</a></li> <li><a href="#extreme-styles">Exploring Extreme Styles Without Commitment</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> <li><a href="#conclusion">Transform Your Look with Confidence</a></li> </ul> </section> <section id="why-change"> <h2>Why People Hesitate to Change Their Hairstyle</h2> <p>Changing your hairstyle is one of the most impactful ways to transform your appearance. Yet, it's also one of the decisions people struggle with the most. The fear of regret after cutting off inches of hair or trying a bold new color can be paralyzing. Unlike clothing or makeup that can be easily changed, a haircut requires months to grow back if you're unhappy with the results.</p> <p>This hesitation is completely normal. Your hair is a significant part of your identity, and making changes to it can feel like a big risk. Traditional methods of previewing new hairstylesโ€”like holding up magazine pictures or using primitive photo editing appsโ€”often fall short of providing realistic previews.</p> <div class="cta-block"> <h3 class="cta-block-title">Ready to See Your New Look?</h3> <p class="cta-block-text">Stop wondering and start seeing! Try our AI Hairstyle Generator and visualize your new look in seconds.</p> <a href="https://modernphototools.com/tools/ai-hairstyle" class="cta-btn cta-btn-large" data-link="true" data-id="1" rel="nofollow">Try Different Hairstyles Now</a> </div> </section> <section id="ai-solution"> <h2>How AI Technology Solves the Hairstyle Dilemma</h2> <p>Artificial intelligence has transformed the way we approach hairstyle changes. Unlike traditional visualization methods, AI hairstyle generators use advanced algorithms to analyze your facial features, head shape, and existing hair to create remarkably realistic previews of different styles on your actual photo.</p> <div class="two-columns"> <div> <h3>Traditional Methods</h3> <ul class="custom-list"> <li>Magazine cutouts that don't show how the style looks on you</li> <li>Basic photo editing that looks obviously fake</li> <li>Verbal descriptions to stylists that get misinterpreted</li> <li>Trying on wigs that don't match your hairline</li> </ul> </div> <div> <h3>AI Hairstyle Generator</h3> <ul class="custom-list"> <li>Realistic visualization on your actual photo</li> <li>Adapts styles to your unique face shape</li> <li>Shows accurate hair texture and color</li> <li>Creates natural-looking results in seconds</li> </ul> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/e455aefd-93bb-431e-9bcf-b7a154cc3610.webp" alt="Side-by-side comparison of traditional hairstyle visualization vs AI hairstyle generator results" data-method="text-to-image"> </div> </section> <section id="tool-guide"> <h2>How to Use ModernPhotoTools' AI Hairstyle Generator</h2> <p>Our AI Hairstyle Generator makes it incredibly easy to visualize yourself with a new look. Follow these simple steps to see yourself transformed:</p> <!-- Local vertical video embed (2:3) --> <style> .styled-container .video-embed { display: flex; justify-content: center; align-items: center; margin: 24px auto; } .styled-container .video-embed video { width: 100%; max-width: 480px; aspect-ratio: 2 / 3; height: auto; max-height: 80vh; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); background: #000; } @media (max-width: 640px) { .styled-container .video-embed video { max-width: 360px; } } </style> <div class="video-embed"> <video controls playsinline autoplay muted preload="auto" aria-label="AI Hairstyle vertical demo video"> <source src="/tools%20videos/AI%20Hairstyle.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </div> <div class="list-comparison"> <ul class="list-comparison-column list-comparison-primary"> <h3 class="list-comparison-title">Step 1: Upload Your Photo</h3> <li>Visit the <a href="https://modernphototools.com/tools/ai-hairstyle" data-link="true" data-id="2" rel="nofollow">AI Hairstyle Tool</a></li> <li>Click the "Upload" button or drag and drop your photo</li> <li>Choose a clear, front-facing photo with good lighting</li> <li>Make sure your current hairstyle is visible</li> </ul> <ul class="list-comparison-column list-comparison-success"> <h3 class="list-comparison-title">Step 2: Select Hairstyle Options</h3> <li>Browse through available hairstyle categories</li> <li>Filter by length, style, or color if desired</li> <li>Click on styles that interest you to preview</li> <li>Adjust settings for more personalized results</li> </ul> <ul class="list-comparison-column list-comparison-warning"> <h3 class="list-comparison-title">Step 3: View &amp; Save Results</h3> <li>See your transformation in real-time</li> <li>Compare different styles side by side</li> <li>Download your favorite looks</li> <li>Share directly with your stylist or on social media</li> </ul> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/b97564ba-00b7-464a-b6be-526f5182c64c.jpg" alt="ModernPhotoTools' AI Hairstyle Generator" data-method="insert"> </div> </section> <section id="interface-navigation"> <h2>Navigating the Interface</h2> <p>Once you've uploaded your photo, you'll be presented with an intuitive interface designed to make hairstyle exploration fun and easy. Here's what you'll find:</p> <div class="three-columns"> <div class="column-card"> <h3>Style Categories</h3> <p>Browse through organized categories including short cuts, medium styles, long hairstyles, and color options. Each category contains multiple variations to explore.</p> </div> <div class="column-card"> <h3>Customization Panel</h3> <p>Fine-tune your selected hairstyle with adjustments for volume, texture, and positioning to get the most realistic and flattering result possible.</p> </div> <div class="column-card"> <h3>Comparison View</h3> <p>See your original photo alongside the transformed version for easy comparison. Toggle between different styles you've tried to find your favorite.</p> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/a09f07a3-b830-4dad-ae10-c30254595cf6.jpg" alt="Close-up of the AI Hairstyle Generator interface showing the customization options and style selection panel" data-method="text-to-image"> </div> <div class="highlight-box"> <p><strong>Pro Tip:</strong> Save multiple styles you like to your account gallery so you can revisit them later or show them to your stylist for a more accurate consultation.</p> </div> </section> <section id="benefits"> <h2>Benefits of Using an AI Hairstyle Generator</h2> <p>Using our AI Hairstyle Generator offers numerous advantages beyond simple curiosity. Here's how this technology can transform your approach to hair changes:</p> <div class="two-columns"> <div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/09315ad2-caa7-4a0e-98ef-db8337793f8b.jpg" alt="Person smiling confidently after seeing their AI hairstyle preview" data-method="text-to-image"> </div> </div> <div> <h3>Risk-Free Experimentation</h3> <p>Try bold, dramatic styles you might never have considered without any commitment. Always wondered how you'd look with a pixie cut or vibrant red hair? Now you can see it before making any permanent changes.</p> <h3>Time and Cost Savings</h3> <p>Avoid costly hair mistakes and the time spent correcting them. By visualizing the end result first, you can confidently choose styles that work for you, saving both time and money on salon visits.</p> <h3>Better Communication with Stylists</h3> <p>Show your stylist exactly what you want by bringing your AI-generated images to your appointment. This eliminates miscommunication and ensures you get precisely the look you're hoping for.</p> </div> </div> <div class="blockquote"> <p>"I was terrified to cut my long hair into a bob, but after seeing how it would look using the AI Hairstyle Generator, I felt confident enough to go for it. My stylist was impressed with how accurately the AI predicted the final result!"</p> <div class="blockquote-author">- Sarah, ModernPhotoTools user</div> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Transform Your Look?</h3> <p class="cta-block-text">Join thousands of users who have found their perfect hairstyle with our AI tool.</p> <a href="https://modernphototools.com/tools/ai-hairstyle" class="cta-btn" data-link="true" data-id="3" rel="nofollow">Try the AI Hairstyle Generator</a> </div> </section> <section id="best-practices"> <h2>Tips for Getting the Best Results</h2> <p>To ensure the most accurate and realistic previews from our AI Hairstyle Generator, follow these expert recommendations:</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/54a32c54-8255-4e15-b592-66e1ec93815f.jpg" alt="Comparison of poor quality photo input versus ideal photo input for AI hairstyle generation" data-method="text-to-image"> </div> <div class="three-columns"> <div class="column-card"> <h3>Photo Quality</h3> <ul class="custom-list"> <li>Use a recent, high-resolution photo</li> <li>Ensure your face is clearly visible and well-lit</li> <li>Choose a photo where your hair is visible and not covered</li> <li>Avoid extreme filters or heavy makeup that might interfere with AI analysis</li> </ul> </div> <div class="column-card"> <h3>Lighting Considerations</h3> <ul class="custom-list"> <li>Front-facing photos provide the most accurate results</li> <li>Keep your head straight, not tilted</li> <li>Maintain a neutral expression</li> <li>Position yourself at eye level with the camera</li> </ul> </div> <div class="column-card"> <h3>Pose &amp; Angle</h3> <ul class="custom-list"> <li>Take photos in natural lighting for best color accuracy</li> <li>Avoid shadows across your face</li> <li>Ensure the background isnโ€™t too bright or dark</li> <li>Use consistent lighting across multiple photos for comparisons</li> </ul> </div> </div> <div class="info-box"> <p><strong>Did you know?</strong> Our AI Hairstyle Generator can also account for different face shapes and suggest styles that are particularly flattering for your specific features.</p> </div> </section> <section id="extreme-styles"> <h2>Exploring Extreme Styles Without Commitment</h2> <p>One of the most exciting aspects of our AI Hairstyle Generator is the ability to try styles you might never dare to attempt in real life without seeing them first. From dramatic color changes to bold cuts, you can explore the full spectrum of possibilities.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/ec413c4e-8b8c-4c92-aff7-302102de3a7e.jpg" alt="Before and after comparison showing a dramatic hairstyle transformation using the AI Hairstyle Generator" data-method="text-to-image"> </div> <div class="two-columns"> <div> <h3>Bold Color Transformations</h3> <p>Ever wondered how you'd look with platinum blonde, vibrant purple, or fiery red hair? Our AI tool lets you try these dramatic color changes without the commitment of bleach or dye. See how different shades complement your skin tone and eye color before making a decision.</p> </div> <div> <h3>Dramatic Length Changes</h3> <p>Considering chopping off your long locks for a pixie cut? Or growing out your short style into flowing waves? Visualize these dramatic length changes and see how they frame your face. This can help you decide if you're ready for a big change or if you'd prefer a more gradual transition.</p> </div> </div> <div class="gallery"> <div class="gallery-item"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/3a26ef85-376f-4bdf-89d6-a38ff9309cdf.jpg" alt="AI-generated image showing a person with a bold pixie cut hairstyle" data-method="text-to-image"> </div> <div class="gallery-item"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/17da87c4-abba-4ed2-a448-b10e2c310459.jpg" alt="AI-generated image showing a person with vibrant blue hair" data-method="text-to-image"> </div> <div class="gallery-item"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/71003609-9417-4b8d-8ac9-2128441df73b.jpg" alt="AI-generated image showing a person with a dramatic long layered hairstyle" data-method="text-to-image"> </div> </div> </section> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-item"> <h3 class="faq-question">How accurate are the AI hairstyle previews?</h3> <div class="faq-answer"> <p>Our AI Hairstyle Generator creates highly realistic previews by analyzing your facial features, head shape, and existing hair. While no simulation is perfect, users report that the results are remarkably close to their actual appearance after getting the hairstyle. The accuracy depends partly on the quality of your uploaded photo and how well you follow our photo guidelines.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Can I try different hair colors as well as styles?</h3> <div class="faq-answer"> <p>Absolutely! Our AI Hairstyle Generator allows you to experiment with both styles and colors. You can try everything from natural shades to vibrant fashion colors to see what complements your skin tone and personal style best.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Is the AI Hairstyle Generator free to use?</h3> <div class="faq-answer"> <p>Yes, our basic AI Hairstyle Generator features are free to use. You can upload your photo and try multiple hairstyles without any cost. We also offer premium features for users who want additional options and higher-resolution downloads.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Can men use this tool too?</h3> <div class="faq-answer"> <p>Definitely! Our AI Hairstyle Generator works for all genders and includes a wide variety of men's hairstyles, from classic cuts to trendy styles. The same photo quality guidelines apply for optimal results.</p> </div> </div> </section> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "How accurate are the AI hairstyle previews?", "acceptedAnswer": { "@type": "Answer", "text": "Our AI Hairstyle Generator creates highly realistic previews by analyzing your facial features, head shape, and existing hair. While no simulation is perfect, users report that the results are remarkably close to their actual appearance after getting the hairstyle. The accuracy depends partly on the quality of your uploaded photo and how well you follow our photo guidelines." } }, { "@type": "Question", "name": "Can I try different hair colors as well as styles?", "acceptedAnswer": { "@type": "Answer", "text": "Absolutely! Our AI Hairstyle Generator allows you to experiment with both styles and colors. You can try everything from natural shades to vibrant fashion colors to see what complements your skin tone and personal style best." } }, { "@type": "Question", "name": "Is the AI Hairstyle Generator free to use?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, our basic AI Hairstyle Generator features are free to use. You can upload your photo and try multiple hairstyles without any cost. We also offer premium features for users who want additional options and higher-resolution downloads." } }, { "@type": "Question", "name": "Can men use this tool too?", "acceptedAnswer": { "@type": "Answer", "text": "Definitely! Our AI Hairstyle Generator works for all genders and includes a wide variety of men's hairstyles, from classic cuts to trendy styles. The same photo quality guidelines apply for optimal results." } } ] } </script> <section id="conclusion"> <h2>Transform Your Look with Confidence</h2> <p>Changing your hairstyle doesn't have to be a leap of faith anymore. With ModernPhotoTools' AI Hairstyle Generator, you can see exactly how you'll look with a new style before making any commitments. This technology empowers you to make confident decisions about your appearance and communicate effectively with your stylist.</p> <p>Whether you're contemplating a subtle change or a dramatic transformation, our tool provides the visual preview you need to move forward with confidence. No more post-haircut regrets or wondering "what if" โ€“ just clear visualization and better hair decisions.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/7063e946-75d7-4c92-934a-2efcde6178c7.jpg" alt="Person showing their stylist an AI-generated hairstyle image on their phone at a salon" data-method="text-to-image"> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to See Your New Look?</h3> <p class="cta-block-text">Join thousands of satisfied users who have found their perfect hairstyle with our AI tool.</p> <a href="https://modernphototools.com/tools/ai-hairstyle" class="cta-btn cta-btn-large cta-btn-full" data-link="true" data-id="4" rel="nofollow">Try Different Hairstyles with AI Now</a> </div> </section> </div>
๐Ÿ“„ master-ai-photo-editing-prompts.md
--- id: master-ai-photo-editing-prompts title: "Master AI Photo Editing Prompts: Create Stunning Images" excerpt: Learn how to craft perfect AI prompts for photo editing. Discover advanced techniques, tool-specific prompts, and practical examples to transform your images with AI. publishDate: 2025-10-04 readTime: 15 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg relatedTool: ai-image-generator keywords: - ai photo editing prompts - ai image prompts - photo editing ai - ai photography prompts - image enhancement ai seoTitle: "Master AI Photo Editing Prompts: Create Stunning Images | ModernPhotoTools" seoDescription: Learn to craft perfect AI photo editing prompts. Get advanced techniques, tool-specific examples, and practical tips to create stunning images with AI. faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Cinematic Effects Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Create a cinematic double exposure of me in profile, with a post-apocalyptic cityscape inside my silhouette. The inner scene shows me walking through a destroyed urban street, with dramatic lighting and warm tones, in 8K resolution." } }, { "@type": "Question", "name": "High-Fashion Portrait Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Edit this photo to give it a luxury fashion magazine vibe, with dramatic lighting emphasizing facial structure. The background should be minimal, and the composition should be symmetrical." } }, { "@type": "Question", "name": "Resolution Enhancements Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Enhance this photo to 16K resolution, ensuring clarity and color fidelity." } }, { "@type": "Question", "name": "Character Transformations Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Turn my pet into a human character, preserving its personality while removing all animal features. Focus on capturing the expression and emotional vibe." } }, { "@type": "Question", "name": "Thematic Edits Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Edit this photo to give it a cyberpunk aesthetic, with neon colors and futuristic elements." } }, { "@type": "Question", "name": "Artistic Transformations Prompt", "acceptedAnswer": { "@type": "Answer", "text": "Make this image look like a watercolor painting, focusing on soft edges and vibrant colors." } } ] } --- <style>.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con>.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:"โœ“";color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:"โœ—";color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating="0"]{--rating: 0}.styled-container .rating-stars[data-rating="0.5"]{--rating: 0.5}.styled-container .rating-stars[data-rating="1"]{--rating: 1}.styled-container .rating-stars[data-rating="1.5"]{--rating: 1.5}.styled-container .rating-stars[data-rating="2"]{--rating: 2}.styled-container .rating-stars[data-rating="2.5"]{--rating: 2.5}.styled-container .rating-stars[data-rating="3"]{--rating: 3}.styled-container .rating-stars[data-rating="3.5"]{--rating: 3.5}.styled-container .rating-stars[data-rating="4"]{--rating: 4}.styled-container .rating-stars[data-rating="4.1"]{--rating: 4.1}.styled-container .rating-stars[data-rating="4.2"]{--rating: 4.2}.styled-container .rating-stars[data-rating="4.3"]{--rating: 4.3}.styled-container .rating-stars[data-rating="4.4"]{--rating: 4.4}.styled-container .rating-stars[data-rating="4.5"]{--rating: 4.5}.styled-container .rating-stars[data-rating="4.6"]{--rating: 4.6}.styled-container .rating-stars[data-rating="4.7"]{--rating: 4.7}.styled-container .rating-stars[data-rating="4.8"]{--rating: 4.8}.styled-container .rating-stars[data-rating="4.9"]{--rating: 4.9}.styled-container .rating-stars[data-rating="5"]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:""}.styled-container .rating-stars::after{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:"โ˜…โ˜…โ˜…โ˜…โ˜…";color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:"";position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><circle cx="12" cy="12" r="6"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:"";position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f39c12"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>')}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:"";position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype="https://schema.org/FAQPage"]{margin-bottom:20px}.styled-container section[itemtype="https://schema.org/FAQPage"] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns>div:not([class]),.styled-container .three-columns>div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}</style> <div class="article-header"> <h1>Mastering AI Photo Editing Prompts: The Ultimate Guide to Transforming Your Images</h1> <p class="article-intro">AI photo editing tools become more sophisticated, learning how to communicate effectively with these intelligent systems is becoming an essential skill for photographers, designers, and content creators. In this comprehensive guide, we'll explore <strong>how to craft powerful AI photo editing prompts</strong> that will help you achieve remarkable results with ModernPhotoTools' suite of AI-powered editing tools.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Image Generator Tool</h3> <p class="cta-block-text">The difference between an ordinary AI-generated image and a stunning masterpiece often comes down to one thing: the quality of your prompts.</p> <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1" >AI Photo Editing Prompts</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="custom-list"> <li><a href="#understanding-ai-prompts">Understanding AI Photo Editing Prompts: The Basics</a></li> <li><a href="#prompt-structure">The Anatomy of a Perfect AI Photo Editing Prompt</a></li> <li><a href="#tool-specific-prompts">Tool-Specific AI Photo Editing Prompts</a></li> <li><a href="#advanced-techniques">Advanced AI Prompt Techniques</a></li> <li><a href="#use-cases">Practical Use Cases for AI Photo Editing Prompts</a></li> <li><a href="#common-mistakes">Common AI Photo Editing Prompt Mistakes to Avoid</a></li> <li><a href="#tool-recommendations">Recommended Tools for Different Prompt Types</a></li> <li><a href="#prompt-library">AI Photo Editing Prompt Library</a></li> <li><a href="#conclusion">Mastering the Art of AI Photo Editing Prompts</a></li> </ul> </div> <section id="understanding-ai-prompts"> <h2>Understanding AI Photo Editing Prompts: The Basics</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg" alt="How to create effective prompts" data-method="text-to-image"> <p class="img-caption">The dramatic difference between basic and detailed AI photo editing prompts</p> </div> <p>AI photo editing prompts are specific instructions you give to AI tools to achieve desired modifications or enhancements to your images. Unlike traditional editing where you manually adjust settings, AI editing relies on your ability to clearly communicate what you want through text prompts.</p> <p>The quality of your results depends directly on how well you can articulate your vision. Vague prompts like "make this better" will yield unpredictable results, while detailed instructions that specify style, mood, lighting, and specific changes will guide the AI toward your desired outcome.</p> <h3>Key Elements of Effective AI Photo Editing Prompts</h3> <div class="two-columns"> <div> <ul class="custom-list"> <li><strong>Specificity:</strong> Clearly describe what you want changed or enhanced</li> <li><strong>Context:</strong> Provide information about the image type and purpose</li> <li><strong>Style references:</strong> Mention specific artistic styles or visual aesthetics</li> <li><strong>Technical details:</strong> Include lighting, color, texture preferences</li> </ul> </div> <div> <ul class="custom-list"> <li><strong>Composition guidance:</strong> Specify framing, focus, or perspective changes</li> <li><strong>Mood indicators:</strong> Describe the emotional tone you want to convey</li> <li><strong>Negative prompts:</strong> Mention what you want to avoid</li> <li><strong>Reference examples:</strong> Refer to specific visual examples when possible</li> </ul> </div> </div> </section> <section id="prompt-structure"> <h2>The Anatomy of a Perfect AI Photo Editing Prompt</h2> <p>Creating effective prompts follows a structure that helps AI tools understand exactly what you want. Here's a formula that consistently delivers excellent results:</p> <div class="blockquote"> <p>[Action/Modification] + [Subject/Element] + [Style/Aesthetic] + [Technical Specifications] + [Reference/Example] + [Avoid/Negative]</p> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/468344a1-cab9-4ca3-9ad9-6114ede3614b.jpg" alt="Diagram showing the structure of an effective AI photo editing prompt with each component labeled" data-method="text-to-image"> <p class="img-caption">Breaking down the components of an effective AI photo editing prompt</p> </div> <h3>Example Breakdown</h3> <div class="card"> <div class="card-content"> <p><strong>Basic prompt:</strong> "Remove the background from this product photo."</p> <p><strong>Enhanced prompt:</strong> "Remove the background from this leather handbag product photo, creating a clean transparent background with subtle drop shadow. Maintain precise edge detail around stitching and hardware. Style should be professional e-commerce ready. Reference high-end fashion websites. Avoid any artifacts or blurry edges."</p> <ul class="custom-list"> <li><strong>Action:</strong> Remove the background</li> <li><strong>Subject:</strong> Leather handbag product photo</li> <li><strong>Style:</strong> Professional e-commerce ready</li> <li><strong>Technical:</strong> Clean transparent background with subtle drop shadow, precise edge detail</li> <li><strong>Reference:</strong> High-end fashion websites</li> <li><strong>Avoid:</strong> Artifacts or blurry edges</li> </ul> </div> </div> </section> <section id="tool-specific-prompts"> <h2>Tool-Specific AI Photo Editing Prompts</h2> <p>Different editing tasks require different approaches to prompting. Let's explore specific prompt strategies for some of ModernPhotoTools' most popular AI editing tools.</p> <h3>AI Background Removal Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/05c3a3f6-526c-468c-93dd-0280b3134148.jpg" alt="Before and after comparison of AI background removal with transparent result" data-method="text-to-image"> <p class="img-caption">Before and after: AI background removal with a well-crafted prompt</p> </div> <p>The <a href="https://modernphototools.com/tools/remove-background" target="_blank" data-link="true" data-id="1" rel="nofollow">Remove Background</a> tool uses AI to precisely separate subjects from their backgrounds. While the tool is powerful on its own, the right prompts can help you achieve perfect results, especially with complex subjects.</p> <div class="card"> <div class="card-content"> <h4>Effective Background Removal Prompt Templates:</h4> <ul class="custom-list"> <li>"Remove background from [subject type] maintaining precise edge detail around [specific challenging areas]. Create [transparent/solid color] background. Preserve [shadows/reflections/hair detail] for natural appearance."</li> <li>"Extract [subject] from background with professional precision. Retain all fine details in [specific areas]. Output with [transparent background/specific color] background for [intended use]."</li> </ul> <h4>Real-World Examples:</h4> <ul class="custom-list"> <li>"Remove background from this product photo of a glass vase, maintaining precise edge detail around transparent areas. Create clean transparent background with no shadows. Preserve reflections on the glass for natural appearance."</li> <li>"Extract this portrait subject from background with professional precision. Retain all fine details in hair and clothing edges. Output with soft white background for professional headshot use."</li> </ul> </div> <div class="card-footer"> <a href="https://modernphototools.com/tools/remove-background" target="_blank" class="cta-btn" data-link="true" data-id="2" rel="nofollow">Try AI Background Removal</a> </div> </div> <h3>AI Cleanup Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/bd4a981d-870f-4a12-8cb2-90066b20e515.jpg" alt="Before and after comparison of AI photo cleanup showing removal of imperfections" data-method="text-to-image"> <p class="img-caption">AI Cleanup transforms photos by removing imperfections while maintaining natural appearance</p> </div> <p>The <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" data-link="true" data-id="3" rel="nofollow">AI Cleanup</a> tool excels at removing unwanted elements and enhancing image quality. Effective prompts help the AI understand exactly what to fix while preserving the natural look of your photos.</p> <div class="card"> <div class="card-content"> <h4>Effective Cleanup Prompt Templates:</h4> <ul class="custom-list"> <li>"Remove [specific imperfections] from [subject/area] while maintaining natural texture and appearance. Enhance [specific elements] subtly without creating artificial look."</li> <li>"Clean up [specific elements] in this [image type]. Remove [unwanted elements] and improve [specific aspects] while preserving authentic [specific qualities]."</li> </ul> <h4>Real-World Examples:</h4> <ul class="custom-list"> <li>"Remove dust spots and sensor marks from this landscape photo while maintaining natural texture and appearance. Enhance cloud detail subtly without creating artificial look."</li> <li>"Clean up skin imperfections in this portrait. Remove temporary blemishes and reduce shine while preserving authentic skin texture and natural features. Maintain subject's age appearance and characteristic features."</li> </ul> </div> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn" data-link="true" data-id="4" rel="nofollow">Try AI Cleanup</a> </div> </div> <h3>AI Expand Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/cc630c68-b48b-4b38-a6a8-1958f49d206d.jpg" alt="Demonstration of AI image expansion showing original cropped image and expanded version" data-method="text-to-image"> <p class="img-caption">AI Expand seamlessly extends images beyond their original boundaries</p> </div> <p>The <a href="https://modernphototools.com/tools/ai-expand" target="_blank" data-link="true" data-id="5" rel="nofollow">AI Expand</a> tool allows you to extend your images beyond their original boundaries. Detailed prompts help ensure the expanded areas match the style and content of your original image.</p> <div class="card"> <div class="card-content"> <h4>Effective Expansion Prompt Templates:</h4> <ul class="custom-list"> <li>"Expand [direction/all sides] of image by [amount] maintaining consistent [lighting/style/perspective]. Add [specific elements] that match existing scene. Ensure seamless transition between original and expanded areas."</li> <li>"Extend [specific area] of this [image type] to create more [specific purpose]. Continue existing [elements/patterns/textures] naturally. Match original [lighting/color palette/mood]."</li> </ul> <h4>Real-World Examples:</h4> <ul class="custom-list"> <li>"Expand top and sides of this landscape photo by 30% maintaining consistent early morning lighting. Add more sky with similar cloud patterns and extend mountain range that matches existing scene. Ensure seamless transition between original and expanded areas."</li> <li>"Extend bottom of this product photo to create more negative space for text overlay. Continue existing white marble surface naturally. Match original lighting and subtle shadow patterns for a cohesive look."</li> </ul> </div> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-expand" target="_blank" class="cta-btn" data-link="true" data-id="6" rel="nofollow">Try AI Expand</a> </div> </div> <h3>AI Replace Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/ece97c8e-b1a0-4349-a7fd-66f0ed1162d8.jpg" alt="Example of AI object replacement showing before and after versions" data-method="text-to-image"> <p class="img-caption">AI Replace allows you to swap objects while maintaining lighting and perspective</p> </div> <p>The <a href="https://modernphototools.com/tools/ai-replace" target="_blank" data-link="true" data-id="7" rel="nofollow">AI Replace</a> tool lets you swap objects or areas in your images. Detailed prompts ensure replacements blend naturally with the surrounding image.</p> <div class="card"> <div class="card-content"> <h4>Effective Replacement Prompt Templates:</h4> <ul class="custom-list"> <li>"Replace [original object/area] with [new object/element] maintaining consistent [lighting/perspective/scale]. Match surrounding [specific aspects] for natural integration. Ensure [specific details] appear realistic."</li> <li>"Swap [specific element] for [new element] in this [image type]. Maintain original [lighting conditions/shadows/reflections]. Ensure replacement appears [specific quality] and fits naturally in the scene."</li> </ul> <h4>Real-World Examples:</h4> <ul class="custom-list"> <li>"Replace cloudy sky with vibrant sunset sky maintaining consistent lighting on landscape elements. Match surrounding color temperature for natural integration. Ensure cloud patterns appear realistic and light direction matches shadows in the original image."</li> <li>"Swap empty coffee table for wooden coffee table with decorative books in this interior photo. Maintain original room lighting conditions and shadows. Ensure replacement appears correctly scaled and fits naturally in the scene with appropriate perspective."</li> </ul> </div> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-replace" target="_blank" class="cta-btn" data-link="true" data-id="8" rel="nofollow">Try AI Replace</a> </div> </div> <h3>AI Image Generator Prompts</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a0403204-16f9-4435-827e-2a898ef3f381.jpg" alt="Collection of AI-generated images created with different prompt styles" data-method="text-to-image"> <p class="img-caption">Diverse images created with the AI Image Generator using varied prompt styles</p> </div> <p>The <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" data-link="true" data-id="9" rel="nofollow">AI Image Generator</a> creates unique images from text descriptions. Mastering prompts for this tool opens unlimited creative possibilities.</p> <div class="card"> <div class="card-content"> <h4>Effective Image Generation Prompt Templates:</h4> <ul class="custom-list"> <li>"Create [image type] of [subject] in [style/aesthetic]. Include [specific elements/details]. Lighting should be [lighting description]. [Composition details]. [Technical specifications]."</li> <li>"Generate [style] image depicting [scene/subject] with [specific qualities]. Use [color palette/mood] and [specific artistic influence]. Include details like [specific elements] for visual interest."</li> </ul> <h4>Real-World Examples:</h4> <ul class="custom-list"> <li>"Create cinematic portrait of a young photographer in a modern studio. Include professional lighting equipment and digital cameras in background. Lighting should be dramatic with blue and orange color contrast. Shallow depth of field with subject in sharp focus. 4K resolution, photorealistic style."</li> <li>"Generate watercolor-style image depicting coastal Italian village at sunset with terracotta rooftops. Use warm golden palette and loose brushstroke aesthetic. Include details like small boats in harbor, flowering vines on buildings, and narrow winding streets for visual interest."</li> </ul> </div> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" class="cta-btn" data-link="true" data-id="10" rel="nofollow">Try AI Image Generator</a> </div> </div> </section> <section id="advanced-techniques"> <h2>Advanced AI Prompt Techniques</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/991b8764-f9f8-4f36-9a64-04ede29cd90b.jpg" alt="Visual representation of advanced AI prompt techniques with examples" data-method="text-to-image"> <p class="img-caption">Advanced techniques to elevate your AI photo editing prompts</p> </div> <h3>Style Mixing</h3> <p>Combine multiple artistic styles or aesthetics to create unique results. This technique works particularly well with the <a href="https://modernphototools.com/tools/ai-image-to-image" target="_blank" data-link="true" data-id="11" rel="nofollow">AI Image to Image</a> and <a href="https://modernphototools.com/tools/ai-filter" target="_blank" data-link="true" data-id="12" rel="nofollow">AI Filter</a> tools.</p> <div class="blockquote"> <p>"Transform portrait using mix of [style 1] and [style 2], with [percentage/ratio] balance. Maintain [specific elements] from original while applying stylistic elements including [specific style characteristics]."</p> </div> <h3>Negative Prompting</h3> <p>Specify what you don't want to see in your results. This helps the AI avoid common issues or unwanted elements.</p> <div class="blockquote"> <p>"[Main prompt]. Avoid [unwanted element 1], [unwanted element 2], and [unwanted element 3]. Do not include [specific problematic features]."</p> </div> <h3>Weighted Keywords</h3> <p>Emphasize certain aspects of your prompt by indicating their importance. This works especially well with the <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" data-link="true" data-id="13" rel="nofollow">AI Image Generator</a>.</p> <div class="blockquote"> <p>"Create [image type] with (important element:1.5) as focal point. Include (secondary element:1.2) and (background element:0.8)."</p> </div> <h3>Reference Images</h3> <p>Use existing images as style references to guide the AI. This is particularly effective with the <a href="https://modernphototools.com/tools/ai-image-to-image" target="_blank" data-link="true" data-id="14" rel="nofollow">AI Image to Image</a> tool.</p> <div class="blockquote"> <p>"Transform image using the style reference provided. Maintain [specific elements] from original while adopting [specific aspects] from reference image."</p> </div> </section> <section id="use-cases"> <h2>Practical Use Cases for AI Photo Editing Prompts</h2> <div class="three-columns"> <div class="column-card"> <h3>Professional</h3> <ul class="custom-list"> <li>Product photography enhancement</li> <li>Real estate image optimization</li> <li>Corporate headshot retouching</li> <li>Marketing material creation</li> <li>E-commerce catalog preparation</li> </ul> </div> <div class="column-card"> <h3>Creative</h3> <ul class="custom-list"> <li>Digital art creation</li> <li>Concept visualization</li> <li>Book cover design</li> <li>Album artwork generation</li> <li>Character design development</li> </ul> </div> <div class="column-card"> <h3>Personal</h3> <ul class="custom-list"> <li>Family photo restoration</li> <li>Social media content creation</li> <li>Travel photo enhancement</li> <li>Custom greeting card design</li> <li>Personal avatar creation</li> </ul> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/801be7a6-55a0-47fd-9124-99abed33a11b.jpg" alt="Collection of before/after examples showing AI photo editing for different use cases" data-method="text-to-image"> <p class="img-caption">Real-world applications of AI photo editing across different domains</p> </div> <h3>Case Study: Product Photography Enhancement</h3> <div class="card"> <div class="card-content"> <p>A small business owner needed professional-looking product images but lacked professional photography equipment. Using ModernPhotoTools' <a href="https://modernphototools.com/tools/ai-product-photoshoot" target="_blank" data-link="true" data-id="15" rel="nofollow">AI Product Photoshoot</a> and <a href="https://modernphototools.com/tools/remove-background" target="_blank" data-link="true" data-id="16" rel="nofollow">Remove Background</a> tools with carefully crafted prompts, they transformed basic smartphone photos into studio-quality product images.</p> <h4>The Process:</h4> <ol class="list-numbers"> <li>Remove original background: "Remove background from ceramic mug product photo with perfect edge detection. Create transparent background with no artifacts around handle or rim."</li> <li>Generate professional setting: "Create professional product photography setup for ceramic mug with soft gradient background in brand colors (light blue to white). Add subtle shadow beneath product for grounding. Use professional product lighting with soft highlights that accentuate glazed ceramic texture."</li> </ol> <p>The result was a collection of professional-looking product images that helped increase online sales by 32% in the first month.</p> </div> </div> </section> <section id="common-mistakes"> <h2>Common AI Photo Editing Prompt Mistakes to Avoid</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/df8d23d8-7525-42b6-b62e-b1d1493a9c14.jpg" alt="Illustration showing common AI prompt mistakes and their results" data-method="text-to-image"> <p class="img-caption">Learning from common mistakes can dramatically improve your results</p> </div> <div class="pros-cons"> <div class="pros"> <h3 class="pros-title">Effective Practices</h3> <ul> <li>Being specific about desired changes</li> <li>Providing context about the image</li> <li>Using clear, descriptive language</li> <li>Including technical details when relevant</li> <li>Specifying style and aesthetic preferences</li> <li>Mentioning what to avoid or preserve</li> </ul> </div> <div class="cons"> <h3 class="cons-title">Common Mistakes</h3> <ul> <li>Using vague instructions ("make it better")</li> <li>Providing contradictory directions</li> <li>Overloading with too many requirements</li> <li>Using technical jargon the AI may misinterpret</li> <li>Forgetting to specify what to preserve</li> <li>Neglecting to mention the intended use</li> </ul> </div> </div> <h3>Before and After: Improving Your Prompts</h3> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <td data-row="head">Weak Prompt</td> <td data-row="head">Improved Prompt</td> <td data-row="head">Why It's Better</td> </tr> </thead> <tbody> <tr> <td data-label="Weak Prompt">"Make this portrait look better"</td> <td data-label="Improved Prompt">"Enhance this portrait by improving skin tone evenness, brightening eyes, and adding subtle background blur while maintaining natural skin texture and original lighting mood"</td> <td data-label="Why It's Better">Specifies exactly what "better" means and what to preserve</td> </tr> <tr> <td data-label="Weak Prompt">"Remove background"</td> <td data-label="Improved Prompt">"Remove background from this product image creating perfect transparent background. Maintain precise edge detail around reflective surfaces and fine elements like straps and zippers"</td> <td data-label="Why It's Better">Addresses specific challenges and desired outcome</td> </tr> <tr> <td data-label="Weak Prompt">"Make it look professional"</td> <td data-label="Improved Prompt">"Transform this casual photo into professional corporate headshot with neutral gray background, balanced lighting, professional color grading, and subtle vignette. Maintain natural skin tones and authentic expression"</td> <td data-label="Why It's Better">Defines what "professional" means in this context</td> </tr> </tbody> </table> </div> </section> <section id="tool-recommendations"> <h2>Recommended Tools for Different Prompt Types</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/d64b8586-5fb6-4b93-add3-923ff18014c8.jpg" alt="Visual guide showing which ModernPhotoTools to use for different editing tasks" data-method="text-to-image"> <p class="img-caption">Matching your editing needs with the right ModernPhotoTools</p> </div> <div class="three-columns"> <div class="column-card"> <h3>Object &amp; Background Manipulation</h3> <ul class="custom-list"> <li><a href="https://modernphototools.com/tools/remove-background" target="_blank" data-link="true" data-id="17" rel="nofollow">Remove Background</a> - For isolating subjects</li> <li><a href="https://modernphototools.com/tools/ai-replace" target="_blank" data-link="true" data-id="18" rel="nofollow">AI Replace</a> - For swapping objects</li> <li><a href="https://modernphototools.com/tools/ai-expand" target="_blank" data-link="true" data-id="19" rel="nofollow">AI Expand</a> - For extending canvas</li> <li><a href="https://modernphototools.com/tools/ai-background-generator" target="_blank" data-link="true" data-id="20" rel="nofollow">AI Background Generator</a> - For creating new backgrounds</li> </ul> </div> <div class="column-card"> <h3>Creative Transformations</h3> <ul class="custom-list"> <li><a href="https://modernphototools.com/tools/ai-cartoon" target="_blank" data-link="true" data-id="21" rel="nofollow">AI Cartoon</a> - For stylized illustrations</li> <li><a href="https://modernphototools.com/tools/ai-caricature" target="_blank" data-link="true" data-id="22" rel="nofollow">AI Caricature</a> - For exaggerated portraits</li> <li><a href="https://modernphototools.com/tools/ai-avatar" target="_blank" data-link="true" data-id="23" rel="nofollow">AI Avatar</a> - For personalized avatars</li> <li><a href="https://modernphototools.com/tools/ai-image-to-image" target="_blank" data-link="true" data-id="24" rel="nofollow">AI Image to Image</a> - For style transfers</li> </ul> </div> <div class="column-card"> <h3>Enhancement &amp; Refinement</h3> <ul class="custom-list"> <li><a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" data-link="true" data-id="25" rel="nofollow">AI Cleanup</a> - For removing imperfections</li> <li><a href="https://modernphototools.com/tools/ai-portrait" target="_blank" data-link="true" data-id="26" rel="nofollow">AI Portrait</a> - For portrait enhancement</li> <li><a href="https://modernphototools.com/tools/ai-image-upscaler" target="_blank" data-link="true" data-id="27" rel="nofollow">AI Image Upscaler</a> - For increasing resolution</li> <li><a href="https://modernphototools.com/tools/ai-filter" target="_blank" data-link="true" data-id="28" rel="nofollow">AI Filter</a> - For applying artistic effects</li> </ul> </div> </div> </section> <section id="prompt-library"> <h2>AI Photo Editing Prompt Library</h2> <p>Here's a collection of ready-to-use prompts for various editing scenarios. Feel free to copy, customize, and experiment with these templates to achieve your desired results.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/eb9f05ad-ab2d-4927-b3f9-b3bc116a084d.jpg" alt="Collection of prompt templates organized by editing category" data-method="text-to-image"> <p class="img-caption">A library of proven prompt templates to jumpstart your AI photo editing</p> </div> <div class="faq-container"> <div class="faq-item"> <h3 class="faq-question">Portrait Enhancement Prompts</h3> <div class="faq-answer"> <ul class="custom-list"> <li>"Enhance this portrait with professional retouching. Improve skin texture while maintaining natural appearance, brighten eyes subtly, enhance hair definition, and add slight background blur for depth. Preserve original lighting mood and authentic expression."</li> <li>"Transform this casual selfie into professional headshot. Create neutral studio background, improve lighting with soft key light from 45-degree angle, enhance facial features subtly, and adjust framing to proper headshot composition while maintaining natural skin texture and authentic appearance."</li> </ul> <p><em>Best with: <a href="https://modernphototools.com/tools/ai-portrait" target="_blank" data-link="true" data-id="29" rel="nofollow">AI Portrait</a>, <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" data-link="true" data-id="30" rel="nofollow">AI Cleanup</a></em></p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Product Photography Prompts</h3> <div class="faq-answer"> <ul class="custom-list"> <li>"Create professional product photo of this [product type] with clean white background, soft shadow beneath for grounding, and subtle reflection. Use professional product lighting setup with main light from upper right and fill light from left to highlight product features and texture. Ensure accurate color representation and sharp detail throughout."</li> <li>"Transform this casual product photo into lifestyle product image showing [product] in natural home setting. Create warm, inviting atmosphere with soft natural lighting from nearby window. Add contextual elements like [relevant props] that complement product without distracting. Maintain focus on product while creating aspirational scene."</li> </ul> <p><em>Best with: <a href="https://modernphototools.com/tools/ai-product-photoshoot" target="_blank" data-link="true" data-id="31" rel="nofollow">AI Product Photoshoot</a>, <a href="https://modernphototools.com/tools/remove-background" target="_blank" data-link="true" data-id="32" rel="nofollow">Remove Background</a></em></p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Landscape Enhancement Prompts</h3> <div class="faq-answer"> <ul class="custom-list"> <li>"Enhance this landscape photo with dramatic sky. Replace current sky with vibrant sunset featuring rich oranges and purples. Add subtle sun rays filtering through clouds. Maintain natural appearance of landscape elements while adjusting lighting to match new sky. Enhance color vibrance and contrast slightly for more impactful image."</li> <li>"Transform this daytime landscape into magical blue hour scene. Adjust lighting to deep blue twilight with remaining warm glow on horizon. Enhance water reflections, add subtle mist in valley, and bring out detail in shadow areas. Maintain natural landscape appearance while creating serene evening atmosphere."</li> </ul> <p><em>Best with: <a href="https://modernphototools.com/tools/ai-replace" target="_blank" data-link="true" data-id="33" rel="nofollow">AI Replace</a>, <a href="https://modernphototools.com/tools/ai-expand" target="_blank" data-link="true" data-id="34" rel="nofollow">AI Expand</a></em></p> </div> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to Transform Your Photos?</h3> <p class="cta-block-text">Access our complete library of AI photo editing prompts and start creating stunning images today.</p> <a href="https://modernphototools.com/tools" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="35" rel="nofollow">Explore All Tools</a> </div> </section> <section id="conclusion"> <h2>Mastering the Art of AI Photo Editing Prompts</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg" alt="How to create effective prompts" data-method="insert"> <p class="img-caption">The journey from basic to masterful AI photo editing through prompt crafting</p> </div> <p>The art of crafting effective AI photo editing prompts is a skill that develops with practice and experimentation. As you've seen throughout this guide, the difference between basic and exceptional results often comes down to how well you communicate with the AI through your prompts.</p> <p>Remember these key principles as you continue your AI photo editing journey:</p> <ul class="custom-list"> <li>Be specific about what you want to achieve</li> <li>Provide context about your image and its purpose</li> <li>Include technical details when relevant</li> <li>Specify what to preserve or avoid</li> <li>Experiment with different prompt structures</li> <li>Learn from both successes and failures</li> </ul> <p>With ModernPhotoTools' suite of AI-powered editing tools and the prompt techniques you've learned in this guide, you're well-equipped to transform ordinary photos into extraordinary images. Whether you're enhancing portraits, creating product photography, or generating entirely new visuals, the power of AI is at your fingertips.</p> <div class="cta-block"> <h3 class="cta-block-title">Start Creating Amazing Images Today</h3> <p class="cta-block-text">Put your new prompt skills to work with ModernPhotoTools' powerful AI editing suite.</p> <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="36" rel="nofollow">Try AI Image Generator</a> </div> </section></div>
๐Ÿ“„ nano-banana-ai-image-generator-with-modern-phototools.md
--- id: nano-banana-ai-image-generator-with-modern-phototools title: Nano Banana - AI Image Generator with Modern Phototools excerpt: Discover how Nano Banana AI image generator revolutionizes digital art creation with Modern Phototools. Learn advanced techniques, features, and step-by-step guides for stunning AI-generated images. publishDate: 2025-10-09 readTime: 8 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg relatedTool: ai-image-generator keywords: [nano banana ai, ai image generator, modern phototools, artificial intelligence photography, image editing software, digital art creation, ai art tools] seoTitle: Nano Banana AI Image Generator with Modern Phototools - Complete Guide 2025 seoDescription: Master Nano Banana AI image generator with Modern Phototools. Create stunning AI art with our comprehensive guide, tips, and advanced techniques for 2025. faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What is Nano Banana AI image generator?", "acceptedAnswer": { "@type": "Answer", "text": "Nano Banana is an innovative AI image generator tool integrated with Modern Phototools that allows users to create stunning visuals with advanced AI technology. It offers intuitive interface, various style options, and professional-grade image generation capabilities." } }, { "@type": "Question", "name": "How does Nano Banana work with Modern Phototools?", "acceptedAnswer": { "@type": "Answer", "text": "Nano Banana integrates seamlessly with Modern Phototools platform, providing users with an intuitive interface to create and edit images using AI-powered tools. The combination offers advanced features like resolution settings, style customization, and efficient generation speed." } }, { "@type": "Question", "name": "Is Nano Banana suitable for beginners?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, Nano Banana is designed to be user-friendly and accessible to artists of all skill levels. Its intuitive interface makes it easy for beginners to navigate and create professional-grade images without extensive technical knowledge." } }, { "@type": "Question", "name": "What types of projects can I create with Nano Banana?", "acceptedAnswer": { "@type": "Answer", "text": "With Nano Banana, you can work on various projects including product photography, social media content, interior design, fashion design, digital marketing materials, and graphic design projects. It's versatile for both professional and personal use." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>Nano Banana - AI Image Generator with Modern Phototools</h1> <p class="article-intro">Discover how <strong>Nano Banana AI image generator</strong> revolutionizes digital art creation with Modern Phototools. This comprehensive guide explores advanced techniques, powerful features, and step-by-step instructions for creating stunning AI-generated images that elevate your creative projects.</p> <div class="cta-block"> <h3 class="cta-block-title">Try Our Free AI Image Generator</h3> <p class="cta-block-text">Experience the power of Nano Banana AI with Modern Photo Tools. Create professional-quality images in seconds!</p> <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank" class="cta-btn cta-btn-large" data-link="true" data-id="1">Generate Images Now</a> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#ai-revolution-art">The AI Revolution in Art Creation</a></li> <li><a href="#modern-phototools-platform">Introducing Modern Phototools Platform</a></li> <li><a href="#nano-banana-overview">Nano Banana - AI Image Generator Overview</a></li> <li><a href="#powerful-features">Powerful Features</a></li> <li><a href="#technical-capabilities">Technical Capabilities</a></li> <li><a href="#integration-options">Integration Options</a></li> <li><a href="#step-by-step-guide">Step-by-Step Guide to Creating Stunning Images</a></li> <li><a href="#accessing-tool">Accessing the Tool</a></li> <li><a href="#mastering-prompts">Mastering Prompt Writing</a></li> <li><a href="#customizing-output">Customizing Your Output</a></li> <li><a href="#elevate-projects">Elevate Your Projects with Nano Banana</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> </ul> </div> <section id="ai-revolution-art"> <h2>The AI Revolution in Art Creation</h2> <p>The world of <strong>digital art creation</strong> has been transformed by artificial intelligence, opening up new possibilities for artists and creators. AI-powered tools are revolutionizing how we approach image generation, making it possible to create stunning visuals with unprecedented ease and efficiency.</p> <p>This technological advancement has democratized art creation, allowing both professionals and beginners to produce high-quality images. The integration of AI in creative workflows has not only streamlined the process but also expanded the creative possibilities beyond traditional boundaries.</p> </section> <section id="ai-image-revolution"> <a href="https://www.youtube.com/watch?v=S2TAa4P2IuY"> <h2>AI Image Generation Revolution</h2> <img src="\images\blog\7 best free & paid ai image generator.jpg"> </a> </section> <section id="modern-phototools-platform"> <h2>Introducing Modern Phototools Platform</h2> <p>The <strong>Modern Phototools</strong> platform is at the forefront of this innovation, providing users with an intuitive interface to create and edit images using AI-powered tools. This platform has made it possible for artists to generate high-quality images with minimal effort.</p> <p>By leveraging the power of <strong>artificial intelligence photography</strong>, the Modern Phototools platform enables users to produce professional-grade images. The platform's <strong>image editing software</strong> is designed to be user-friendly, making it accessible to artists of all skill levels.</p> </section> <section id="nano-banana-overview"> <h2>Nano Banana - AI Image Generator with Modern Phototools</h2> <p>Nano Banana, combined with Modern Phototools, offers a robust solution for image generation and editing needs. This powerful combination is designed to cater to a wide range of users, from professionals to beginners, by providing an array of tools and features that simplify the image editing process.</p> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg" alt="Nano Banana AI Image Generator Interface" class="featured-image"> </section> <section id="powerful-features"> <h3>Powerful Features</h3> <p>Nano Banana boasts an impressive set of features that make it an ideal choice for image generation and editing. Some of the key features include:</p> <ul> <li><strong>Intuitive User Interface</strong>: Designed to be user-friendly, making it easy for users to navigate and utilize the tool's capabilities.</li> <li><strong>Style and Aesthetic Options</strong>: Offers a variety of styles and aesthetics, allowing users to customize their images according to their preferences.</li> <li><strong>Advanced AI Algorithms</strong>: Utilizes cutting-edge artificial intelligence to generate high-quality, realistic images.</li> <li><strong>Real-time Processing</strong>: Provides instant results with minimal waiting time.</li> </ul> </section> <section id="technical-capabilities"> <h3>Technical Capabilities</h3> <p>The technical capabilities of Nano Banana are enhanced by Modern Phototools, providing advanced functionalities such as:</p> <ol> <li><strong>Resolution and Quality Settings</strong>: Enables users to adjust the resolution and quality of their generated images, ensuring they meet the required standards.</li> <li><strong>Generation Speed and Efficiency</strong>: Ensures quick turnaround times without compromising on the quality of the output.</li> <li><strong>Format Compatibility</strong>: Supports multiple image formats for versatile usage across different platforms.</li> <li><strong>Batch Processing</strong>: Allows users to generate multiple images simultaneously for increased productivity.</li> </ol> </section> <section id="integration-options"> <h3>Integration Options</h3> <p>Nano Banana, when integrated with Modern Phototools, offers versatile integration options that allow users to seamlessly incorporate the generated images into various platforms and projects. This flexibility makes it a valuable tool for a wide range of applications, from digital marketing to graphic design.</p> </section> <section id="step-by-step-guide"> <h2>Step-by-Step Guide to Creating Stunning Images</h2> <p>With Nano Banana and Modern Phototools, you can unlock a world of creative possibilities. This guide will walk you through the process of accessing the tool, mastering prompt writing, and customizing your output to create breathtaking images.</p> </section> <section id="accessing-tool"> <h3>Accessing the Tool</h3> <p>To start using Nano Banana, you need to access it through the Modern Phototools platform. Simply navigate to the platform, sign in or create an account, and you're ready to begin your creative journey.</p> <div id="ai-image-generator-image"> <img src="\images\blog\Ai Image Generation - Modern phototools.jpg" alt"Ai Image Generation - Modern phototools"> </div> <div class="step-guide"> <ol> <li>Visit <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank">Modern Phototools AI Image Generator</a></li> <li>Create a good descriptin</li> <li>Select the proper Image Resolution</li> <li>Start creating your first AI-generated image</li> </ol> </div> </section> <section id="mastering-prompts"> <h3>Mastering Prompt Writing</h3> <p>Effective prompt writing is crucial to getting the most out of Nano Banana. A well-crafted prompt can make all the difference in the quality of the generated image.</p> <h4>Characteristics of Effective Prompts</h4> <p>Effective prompts are clear, concise, and descriptive. They provide the AI with enough information to understand your vision and create an image that meets your expectations.</p> <ul> <li>Be specific about the content and style you want</li> <li>Use descriptive language to paint a vivid picture</li> <li>Avoid ambiguity and ensure clarity</li> <li>Include style references and artistic techniques</li> </ul> <h4>Example Prompts That Work</h4> <p>Here are a few examples of effective prompts:</p> <table class="prompt-examples"> <thead> <tr> <th>Prompt</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>A futuristic cityscape at sunset</td> <td>A detailed, high-resolution image of a cityscape with sleek skyscrapers and a vibrant orange sky</td> </tr> <tr> <td>A fantasy landscape with rolling hills and a dragon</td> <td>A whimsical, dreamlike scene featuring rolling green hills, a majestic dragon, and a bright blue sky</td> </tr> <tr> <td>Portrait of a woman in Renaissance style</td> <td>Classical portrait with Renaissance painting techniques, soft lighting, and period-appropriate clothing</td> </tr> </tbody> </table> </section> <section id="customizing-output"> <h3>Customizing Your Output</h3> <p>Once you've mastered prompt writing, you can take your image creation to the next level by customizing your output using advanced settings.</p> <h4>Working with Advanced Settings</h4> <p>Nano Banana offers a range of advanced settings that allow you to fine-tune your image generation. Experiment with different settings to achieve the desired effect.</p> <p><strong>Key features to explore:</strong></p> <ul> <li>Image resolution and aspect ratio</li> <li>Color palette and texture</li> <li>Style transfer and effects</li> <li>Lighting and composition adjustments</li> </ul> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/aaeffd7f-371d-4095-83de-c2b0d89f6120.jpg" alt="AI Image Generator Advanced Settings" class="content-image"> </section> <section id="elevate-projects"> <h2>Elevate Your Projects with Nano Banana Today</h2> <p>I am excited to explore the possibilities that Nano Banana, an <strong>innovative photography software</strong>, brings to the table. As an <strong><a href="https://modernphototools.com/tools/ai-image-generator" target="_blank">AI image generator</a></strong> integrated with Modern Phototools, Nano Banana is revolutionizing the way we approach image editing and creation.</p> <p>Nano Banana is driving efficiency across various industries, including product photography, social photos, interior design, and fashion design. Its advanced features and ease of use make it an ideal tool for professionals looking to elevate their projects.</p> <p>By incorporating Nano Banana into your workflow, you can unlock new creative potential. Whether you're creating social media content or designing interiors, this <strong>nano banana ai image generator</strong> offers the tools you need to succeed. With its powerful <strong>image editing software</strong> capabilities, you can achieve high-quality results with minimal effort.</p> <p>Start exploring the possibilities with Nano Banana today and discover a new world of creative potential. As a cutting-edge <strong>image editing software</strong>, Nano Banana is poised to transform the way you work on your projects.</p> </section> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-item"> <h3>What is Nano Banana, and how does it work with Modern Phototools?</h3> <p>Nano Banana is an innovative AI image generator tool integrated with Modern Phototools, allowing users to create stunning visuals with just a few clicks. You can leverage this powerful tool to enhance your image editing experience with advanced AI technology.</p> </div> <div class="faq-item"> <h3>What are the benefits of using Nano Banana with Modern Phototools?</h3> <p>By using Nano Banana with Modern Phototools, you can generate high-quality images with an intuitive interface, various style and aesthetic options, and advanced technical capabilities, including resolution and quality settings, and generation speed.</p> </div> <div class="faq-item"> <h3>How do I access the Nano Banana AI image generator tool?</h3> <p>You can access the free AI image generator tool at <a href="https://modernphototools.com/tools/ai-image-generator" target="_blank">modernphototools.com/tools/ai-image-generator</a> and start creating amazing images today with Modern Phototools.</p> </div> <div class="faq-item"> <h3>What kind of projects can I work on with Nano Banana and Modern Phototools?</h3> <p>With Nano Banana and Modern Phototools, you can work on various projects, such as product photography, creating social media content, or designing interiors, and elevate them to new heights with the tools you need to succeed.</p> </div> <div class="faq-item"> <h3>Do I need to have extensive technical knowledge to use Nano Banana with Modern Phototools?</h3> <p>No, Nano Banana with Modern Phototools is designed to be user-friendly, making it accessible to both professionals and beginners, allowing you to create breathtaking images that meet your creative vision.</p> </div> <div class="faq-item"> <h3>Can I customize the output of the AI image generator?</h3> <p>Yes, you can customize your output by mastering prompt writing and working with advanced settings, unlocking the full potential of Nano Banana and creating images that meet your needs.</p> </div> <div class="faq-item"> <h3>How does Nano Banana contribute to the evolution of AI in art creation?</h3> <p>Nano Banana is at the forefront of the innovation in AI art creation, and by integrating it with Modern Phototools, you can be part of this revolution, pushing the boundaries of what's possible in image editing and creation.</p> </div> </section> </div>
๐Ÿ“„ remove-people-from-photos-without-photoshop.md
--- id: 'remove-people-from-photos-without-photoshop' title: 'How to Remove People from Photos Without Photoshop | Modern Tools' excerpt: 'Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.' publishDate: '2025-10-14' readTime: '12 min read' category: 'tools' featuredImage: '\images\tools images\AI Cleanup Tool.jpg' relatedTool: 'ai-cleanup' keywords: ['remove people from photos', 'AI photo editing', 'photo cleanup', 'remove objects from photos', 'AI replace tool', 'photo editing without Photoshop'] seoTitle: 'How to Remove People from Photos Without Photoshop | AI Tools 2025' seoDescription: 'Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.' faqSchema: [ { question: "Will the background look natural after removing people?", answer: "Yes! Our AI Cleanup Tool uses advanced algorithms to analyze the surrounding textures, patterns, and lighting to create a natural-looking fill for the removed areas. The result is typically indistinguishable from the original background, especially in natural settings like landscapes, beaches, or architectural photos." }, { question: "Do I need any technical skills to use these tools?", answer: "Not at all. Both our AI Cleanup and AI Replace tools are designed for users of all skill levels. The intuitive interface guides you through the process, and the AI handles all the complex work behind the scenes. If you can use a smartphone app, you can use our tools." }, { question: "How does AI Replace differ from basic object removal?", answer: "While object removal (like our AI Cleanup Tool) focuses on erasing unwanted elements and filling in the background, AI Replace takes this a step further by allowing you to substitute the removed element with something new. This gives you creative control to enhance your photos rather than just cleaning them up." }, { question: "What types of photos work best with these tools?", answer: "Both tools work well with most photo types, but you'll get the best results when: the person to be removed doesn't overlap with your main subject, the background has consistent patterns or textures, the lighting is even across the image, and the photo has good resolution and clarity. That said, our advanced AI can handle challenging scenarios too, including complex backgrounds." }, { question: "Is there a limit to how many people I can remove?", answer: "There's no technical limit to how many people you can remove from a photo. However, for best results, we recommend removing people in smaller groups rather than all at once if your photo contains many people. This gives the AI more surrounding context to work with for each removal." } ] styled-container: true table-of-contents: [ { id: "introduction", title: "Introduction" }, { id: "ai-solutions-overview", title: "AI-Powered Solutions Overview" }, { id: "ai-cleanup-tool", title: "AI Cleanup Tool" }, { id: "ai-replace-tool", title: "AI Replace Tool" }, { id: "comparison", title: "Tool Comparison" }, { id: "use-cases", title: "Common Use Cases" }, { id: "tips", title: "Pro Tips" }, { id: "faq", title: "FAQ" }, { id: "conclusion", title: "Conclusion" } ] --- <div class="styled-container"> <div class="article-header"> <h1>How to Remove People from Photos Without Photoshop</h1> <div class="article-meta"> <span class="read-time">12 min read</span> <span class="category">Tools</span> <span class="publish-date">October 14, 2025</span> </div> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul> <li><a href="#introduction">Introduction</a></li> <li><a href="#ai-solutions-overview">AI-Powered Solutions Overview</a></li> <li><a href="#ai-cleanup-tool">AI Cleanup Tool</a></li> <li><a href="#ai-replace-tool">AI Replace Tool</a></li> <li><a href="#comparison">Tool Comparison</a></li> <li><a href="#use-cases">Common Use Cases</a></li> <li><a href="#tips">Pro Tips</a></li> <li><a href="#faq">FAQ</a></li> <li><a href="#conclusion">Conclusion</a></li> </ul> </div> <section id="introduction"> <h2>Introduction</h2> <p>We've all been there โ€“ you capture the perfect vacation shot of a beautiful landmark, only to find random strangers photobombing your otherwise perfect image. Or perhaps you have a great group photo where one person blinked or looked away. Traditionally, removing unwanted people from photos required Photoshop skills, patience, and time. But what if you could achieve professional-looking results in seconds without complex software?</p> <p>Modern AI technology has revolutionized photo editing, making it possible for anyone to remove people from photos quickly and easily. In this guide, we'll show you how to achieve clean, natural-looking results using powerful AI tools that require zero Photoshop knowledge.</p> </section> <section id="ai-solutions-overview"> <h2>AI-Powered Solutions for Removing People from Photos</h2> <div class="img-container"> <img src="\images\tools images\AI Cleanup Tool.jpg" alt="Before and after comparison of a beach photo with people removed using AI"> </div> <p>AI photo editing has advanced dramatically in recent years. Instead of manually selecting and cloning areas to cover unwanted elements, AI algorithms can now intelligently analyze your image, remove people, and fill in the background naturally โ€“ all with minimal input from you.</p> <p>At Modern Photo Tools, we offer two specialized AI solutions that make removing people from photos incredibly simple:</p> <div class="two-columns"> <div class="column-card"> <h3>AI Cleanup Tool</h3> <p>Perfect for removing unwanted people and objects while preserving the natural background. Our advanced AI intelligently fills in the removed areas with realistic textures and patterns.</p> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn">Try AI Cleanup Free</a> </div> </div> <div class="column-card"> <h3>AI Replace Tool</h3> <p>Goes beyond simple removal by allowing you to replace people with new elements of your choice. Want to replace a stranger with a beautiful tree or landscape feature? This tool makes it possible.</p> <div class="card-footer"> <a href="https://modernphototools.com/tools/ai-replace" target="_blank" class="cta-btn">Try AI Replace Free</a> </div> </div> </div> </section> <section id="ai-cleanup-tool"> <h2>Remove People Instantly with AI Cleanup Tool</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/e16a7d95-5833-40dc-bd5c-7a4a22c26a02.jpg" alt="Screenshot of the AI Cleanup Tool interface showing a photo with a person being removed"> </div> <p>Our AI Cleanup Tool is designed specifically for removing unwanted elements from photos while maintaining a natural look. Unlike Photoshop, which requires layers, masks, and clone stamping, our tool needs just a few clicks to achieve professional results.</p> <h3>How to Remove People Using AI Cleanup Tool</h3> <ol class="list-numbers"> <li>Upload your photo to the <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank">AI Cleanup Tool</a></li> <li>Use the brush tool to mark the person or people you want to remove</li> <li>Click "Remove" and watch as our AI intelligently erases the selected elements</li> <li>Fine-tune the results if needed with our adjustment tools</li> <li>Download your clean, people-free photo in high resolution</li> </ol> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/03de3378-aaab-4ddf-b2fb-792ace5f8b57.jpg" alt="Before and after comparison showing tourists removed from a landmark photo"> </div> <div class="cta-block"> <h3 class="cta-block-title">Ready to clean up your photos?</h3> <p class="cta-block-text">Remove unwanted people from your images in seconds - no Photoshop skills required.</p> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn cta-btn-large">Try AI Cleanup Now</a> </div> </section> <section id="ai-replace-tool"> <h2>Replace People with New Elements Using AI Replace Tool</h2> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/77923853-3801-444e-a781-810305d28e6e.jpg" alt="Screenshot of the AI Replace Tool interface showing a person being replaced with a tree"> </div> <p>Sometimes, simply removing people isn't enough โ€“ you might want to replace them with something that enhances your photo. Our AI Replace Tool takes photo editing to the next level by allowing you to substitute unwanted people with new elements that blend seamlessly with the environment.</p> <h3>Creative Ways to Use AI Replace Tool</h3> <div class="two-columns"> <div> <h4>Replace with Natural Elements</h4> <p>Substitute photobombers with trees, rocks, flowers, or other natural elements that complement your landscape.</p> </div> <div> <h4>Add Artistic Objects</h4> <p>Replace unwanted people with statues, fountains, or decorative elements that enhance the composition.</p> </div> </div> <div class="two-columns"> <div> <h4>Create Empty Space</h4> <p>Replace people with extended background elements to create more breathing room in crowded photos.</p> </div> <div> <h4>Add Animals</h4> <p>Substitute people with birds, pets, or wildlife that add interest to your scene.</p> </div> </div> <h3>How to Replace People Using AI Replace Tool</h3> <ol class="list-numbers"> <li>Upload your photo to the <a href="https://modernphototools.com/tools/ai-replace" target="_blank">AI Replace Tool</a></li> <li>Select the person or people you want to replace</li> <li>Choose what you'd like to replace them with (or describe it in text)</li> <li>Click "Replace" and watch the AI transform your image</li> <li>Make adjustments if needed and download your enhanced photo</li> </ol> <div class="img-container"> <img src="\images\tools images\AI Replace tool.jpg" alt="Before and after comparison showing a person replaced with a decorative fountain in a garden photo"> </div> <div class="cta-block"> <h3 class="cta-block-title">Transform your photos creatively</h3> <p class="cta-block-text">Don't just remove unwanted people - replace them with something better!</p> <a href="https://modernphototools.com/tools/ai-replace" target="_blank" class="cta-btn cta-btn-large">Try AI Replace Now</a> </div> </section> <section id="comparison"> <h2>How Our Tools Compare to Other Solutions</h2> <p>While there are several options for removing people from photos without Photoshop, not all solutions are created equal. We've analyzed the top alternatives to show you why Modern Photo Tools offers superior results.</p> <div class="table-container"> <table class="responsive-table responsive-table-striped"> <thead> <tr> <th>Feature</th> <th>Modern Photo Tools</th> <th>Picsart</th> <th>Fotor</th> <th>Other AI Tools</th> </tr> </thead> <tbody> <tr> <td data-label="Feature">Processing Speed</td> <td data-label="Modern Photo Tools">2-5 seconds</td> <td data-label="Picsart">10-15 seconds</td> <td data-label="Fotor">15-20 seconds</td> <td data-label="Other AI Tools">20+ seconds</td> </tr> <tr> <td data-label="Feature">Natural Background Fill</td> <td data-label="Modern Photo Tools">Advanced AI with texture matching</td> <td data-label="Picsart">Basic AI fill</td> <td data-label="Fotor">Basic AI fill</td> <td data-label="Other AI Tools">Variable quality</td> </tr> <tr> <td data-label="Feature">Replacement Options</td> <td data-label="Modern Photo Tools">Unlimited AI-generated options</td> <td data-label="Picsart">Limited templates</td> <td data-label="Fotor">Not available</td> <td data-label="Other AI Tools">Limited or none</td> </tr> <tr> <td data-label="Feature">Edge Detection</td> <td data-label="Modern Photo Tools">Precise</td> <td data-label="Picsart">Good</td> <td data-label="Fotor">Basic</td> <td data-label="Other AI Tools">Variable</td> </tr> <tr> <td data-label="Feature">Free Usage</td> <td data-label="Modern Photo Tools">Generous free tier</td> <td data-label="Picsart">Limited free version</td> <td data-label="Fotor">Very limited free version</td> <td data-label="Other AI Tools">Usually limited</td> </tr> </tbody> </table> </div> <h3>Key Advantages of Modern Photo Tools</h3> <div class="pros-cons"> <div class="pros"> <h4 class="pros-title">Why Choose Our Tools</h4> <ul class="custom-list"> <li>Faster processing than competitors (2-5 seconds vs 10-20+ seconds)</li> <li>More natural background reconstruction with advanced texture matching</li> <li>Unique replacement capabilities not found in most competitors</li> <li>Intuitive interface designed for beginners</li> <li>Higher resolution output without quality loss</li> <li>More generous free usage allowance</li> </ul> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/463695cf-f580-47e4-9010-e9073db7715a.jpg" alt="Comparison of results from different AI tools removing people from the same photo"> </div> </section> <section id="use-cases"> <h2>Common Scenarios for Removing People from Photos</h2> <div class="three-columns"> <div class="column-card"> <h3>Travel Photography</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/7e811703-b188-4956-939e-7e8e2249bb6d.jpg" alt="Tourist landmark with crowds removed using AI Cleanup Tool"> </div> <p>Remove tourists from landmark photos to capture clean, postcard-worthy travel memories.</p> </div> <div class="column-card"> <h3>Real Estate Photography</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/b5c6d53a-71c2-4411-bed3-91534616f544.jpg" alt="Real estate interior photo with people removed for cleaner presentation"> </div> <p>Create clean, professional property listings by removing occupants or visitors.</p> </div> <div class="column-card"> <h3>Event Photography</h3> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6c6833a6-9b86-4c52-90fa-eaf44f0531ee.jpg" alt="Wedding photo with unwanted guest removed using AI Cleanup Tool"> </div> <p>Perfect group shots by removing photobombers or combining the best elements from multiple photos.</p> </div> </div> <div class="cta-block"> <h3 class="cta-block-title">Perfect your photos today</h3> <p class="cta-block-text">Join thousands of photographers who are creating cleaner, more professional images with our AI tools.</p> <div class="two-columns"> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn">Try AI Cleanup</a> <a href="https://modernphototools.com/tools/ai-replace" target="_blank" class="cta-btn">Try AI Replace</a> </div> </div> </section> <section id="tips"> <h2>Pro Tips for Best Results When Removing People</h2> <div class="two-columns"> <div> <h3>For Simple Removals</h3> <ul class="custom-list"> <li>Choose photos where people don't overlap with important subjects</li> <li>Make sure the background behind the person is relatively uniform</li> <li>Use the brush tool with appropriate size for precise selection</li> <li>Start with smaller areas if removing multiple people</li> <li>Use the zoom feature for detailed work around edges</li> </ul> </div> <div> <h3>For Replacement Effects</h3> <ul class="custom-list"> <li>Consider the lighting and perspective when choosing replacement elements</li> <li>Be specific in your replacement descriptions for better results</li> <li>Try multiple variations to find the perfect match</li> <li>Use the adjustment tools to fine-tune size and positioning</li> <li>Consider the overall composition when adding new elements</li> </ul> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/802eda96-6cbc-4542-b038-c3d27c42543e.jpg" alt="Demonstration of selection techniques for removing people from complex backgrounds"> </div> </section> <section id="faq"> <h2>Frequently Asked Questions</h2> <div class="faq-item"> <h3 class="faq-question">Will the background look natural after removing people?</h3> <div class="faq-answer"> <p>Yes! Our AI Cleanup Tool uses advanced algorithms to analyze the surrounding textures, patterns, and lighting to create a natural-looking fill for the removed areas. The result is typically indistinguishable from the original background, especially in natural settings like landscapes, beaches, or architectural photos.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Do I need any technical skills to use these tools?</h3> <div class="faq-answer"> <p>Not at all. Both our AI Cleanup and AI Replace tools are designed for users of all skill levels. The intuitive interface guides you through the process, and the AI handles all the complex work behind the scenes. If you can use a smartphone app, you can use our tools.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">How does AI Replace differ from basic object removal?</h3> <div class="faq-answer"> <p>While object removal (like our AI Cleanup Tool) focuses on erasing unwanted elements and filling in the background, AI Replace takes this a step further by allowing you to substitute the removed element with something new. This gives you creative control to enhance your photos rather than just cleaning them up.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">What types of photos work best with these tools?</h3> <div class="faq-answer"> <p>Both tools work well with most photo types, but you'll get the best results when:</p> <ul> <li>The person to be removed doesn't overlap with your main subject</li> <li>The background has consistent patterns or textures</li> <li>The lighting is even across the image</li> <li>The photo has good resolution and clarity</li> </ul> <p>That said, our advanced AI can handle challenging scenarios too, including complex backgrounds.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Is there a limit to how many people I can remove?</h3> <div class="faq-answer"> <p>There's no technical limit to how many people you can remove from a photo. However, for best results, we recommend removing people in smaller groups rather than all at once if your photo contains many people. This gives the AI more surrounding context to work with for each removal.</p> </div> </div> </section> <section id="conclusion"> <h2>Transform Your Photos Today</h2> <p>Removing people from photos no longer requires expensive software or technical expertise. With Modern Photo Tools' AI-powered solutions, you can clean up your images in seconds and achieve professional results that once required hours of skilled Photoshop work.</p> <p>Whether you need to remove photobombers from your vacation shots, clean up real estate photos, or perfect your portfolio images, our AI Cleanup and AI Replace tools give you the power to create flawless photos with just a few clicks.</p> <div class="cta-block"> <h3 class="cta-block-title">Ready to perfect your photos?</h3> <p class="cta-block-text">Join thousands of photographers who have discovered the power of AI photo editing.</p> <div class="two-columns"> <a href="https://modernphototools.com/tools/ai-cleanup" target="_blank" class="cta-btn cta-btn-large">Try AI Cleanup Free</a> <a href="https://modernphototools.com/tools/ai-replace" target="_blank" class="cta-btn cta-btn-large">Try AI Replace Free</a> </div> </div> </section> </div>
๐Ÿ“„ studio-ghibli-ai-art-guide.md
--- id: studio-ghibli-ai-art-guide title: "How to Make Studio Ghibli AI Art: Step-by-Step Guide" excerpt: "Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!" publishDate: "2025-04-27" readTime: "8 min read" category: general featuredImage: "https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg" keywords: ["Studio Ghibli AI art", "AI art generator", "Ghibli style filter", "AI photo transformation", "anime art AI", "digital art creation"] metaTitle: "How to Make Studio Ghibli AI Art: Step-by-Step Guide | ModernPhotoTools" metaDescription: "Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!" faqSchema: { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What is Studio Ghibli AI art?", "acceptedAnswer": { "@type": "Answer", "text": "Studio Ghibli AI art refers to images that have been transformed using artificial intelligence to mimic the distinctive animation style of Studio Ghibli films. These transformations capture the characteristic soft colors, detailed backgrounds, and whimsical elements that make Ghibli films so recognizable." } }, { "@type": "Question", "name": "Do I need artistic skills to create Studio Ghibli AI art?", "acceptedAnswer": { "@type": "Answer", "text": "Not at all! Our AI Filter tool handles all the artistic work for you. You simply upload a photo, select the Ghibli style, and the AI transforms it automatically. No drawing, painting, or design skills required." } } ] } --- <div class="styled-container"> <div class="article-header"> <h1>How to Make Studio Ghibli AI Art: Step-by-Step Guide</h1> <p class="intro-text">Transform your photos into magical Studio Ghibli-style artwork using AI technology. Our comprehensive guide shows you how to create enchanting Ghibli art without any artistic skills required.</p> </div> <div class="cta-block"> <h2>Transform Your Photos into Ghibli Magic</h2> <p>Ready to create stunning Studio Ghibli AI art? Try our free AI Filter tool and watch your photos transform into magical Ghibli masterpieces in seconds.</p> <a href="https://modernphototools.com/tools/ai-filter" class="cta-button">Start Creating Ghibli Art โ†’</a> </div> <div class="table-of-contents"> <h2>Table of Contents</h2> <ul class="toc-list"> <li><a href="#introduction">Introduction to Studio Ghibli AI Art</a></li> <li><a href="#what-is-ghibli-style">What Makes Studio Ghibli Style Unique?</a></li> <li><a href="#tools-needed">Tools and Requirements</a></li> <li><a href="#step-by-step-guide">Step-by-Step Guide to Creating Studio Ghibli AI Art</a></li> <li><a href="#tips-best-practices">Tips and Best Practices</a></li> <li><a href="#examples-inspiration">Examples and Inspiration</a></li> <li><a href="#faq">Frequently Asked Questions</a></li> </ul> </div> <section id="introduction"> <h2>Introduction to Studio Ghibli AI Art</h2> <p>Studio Ghibli has enchanted audiences worldwide with its distinctive animation style, characterized by dreamy landscapes, soft color palettes, and magical atmospheres. Now, thanks to advances in artificial intelligence, you can transform your own photos into beautiful Studio Ghibli-inspired artwork without any artistic training.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg" alt="Studio Ghibli AI art transformation example" class="responsive-image"> <div class="image-caption">Transform any photo into magical Studio Ghibli-style artwork with AI</div> </div> <p>Our AI Filter tool makes it incredibly easy to create Studio Ghibli AI art. Whether you want to transform portraits, landscapes, or everyday photos, our advanced AI technology captures the essence of Ghibli's artistic style and applies it to your images seamlessly.</p> <div class="cta-block"> <h3>Ready to Get Started?</h3> <p>Transform your photos into Studio Ghibli masterpieces with our free AI Filter tool.</p> <a href="https://modernphototools.com/tools/ai-filter" class="cta-button">Try AI Filter Now โ†’</a> </div> </section> <section id="what-is-ghibli-style"> <h2>What Makes Studio Ghibli Style Unique?</h2> <p>Studio Ghibli's art style is instantly recognizable and beloved worldwide. Understanding these key characteristics will help you appreciate how our AI Filter captures and recreates this magical aesthetic:</p> <div class="feature-grid"> <div class="feature-card"> <h3>Soft Color Palettes</h3> <p>Ghibli films use muted, earthy tones with warm greens, soft blues, and golden lighting that creates a dreamy, nostalgic atmosphere.</p> </div> <div class="feature-card"> <h3>Detailed Backgrounds</h3> <p>Intricate landscapes with lush vegetation, rolling hills, and architectural elements that feel both realistic and fantastical.</p> </div> <div class="feature-card"> <h3>Whimsical Elements</h3> <p>Magical touches like floating objects, spirits, and otherworldly phenomena that add wonder to everyday scenes.</p> </div> </div> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/1062b9b9-3d2c-4b45-aaf7-f3cb3d29f3b5.jpg" alt="Studio Ghibli style characteristics" class="responsive-image"> <div class="image-caption">Key visual elements that define Studio Ghibli's distinctive art style</div> </div> <p>Our AI Filter has been trained to recognize and recreate these distinctive elements, ensuring your transformed images capture the true essence of Studio Ghibli's magical world.</p> </section> <section id="tools-needed"> <h2>Tools and Requirements</h2> <p>Creating Studio Ghibli AI art is surprisingly simple. Here's everything you need to get started:</p> <div class="three-columns"> <div class="column-card"> <h3>Your Photo</h3> <p>Any digital image you'd like to transform - portraits, landscapes, pets, or everyday scenes work beautifully.</p> <h3 class="snipcss0-7-107-134">AI Filter Tool</h3> <p>Our free online AI Filter tool that transforms your photos into Ghibli-style artwork.</p> <h3>Internet Connection</h3> <p>A stable internet connection to access our online AI Filter tool.</p> </div> </div> <div class="highlight-box"> <p><strong>No artistic skills required!</strong> Our AI Filter tool handles all the creative work, transforming your photos into Studio Ghibli masterpieces with just a few clicks.</p> </div> </section> <section id="step-by-step-guide"> <h2>Step-by-Step Guide to Creating Studio Ghibli AI Art</h2> <p>Follow these simple steps to transform your photos into magical Ghibli-style artwork:</p> <div class="steps-container"> <ol class="custom-list"> <li> <h3>Choose the Right Photo</h3> <p>Select a high-quality image with good lighting and clear subjects. Portraits, landscapes, pets, and nature scenes work particularly well with the Ghibli style.</p> </li> <li> <h3>Visit ModernPhotoTools AI Filter</h3> <p>Navigate to <a href="https://modernphototools.com/tools/ai-filter" target="_blank">our free AI Filter tool</a>. No registration or download required - it works directly in your browser.</p> <div class="img-container"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/a98c300a-be0b-4253-9fa5-994b386f4fdd.jpg" alt="ModernPhotoTools AI Filter interface" class="responsive-image"> </div> </li> <li> <h3>Upload Your Image Or Upload Your Own Style</h3> <p>Click the upload button or drag and drop your photo into the designated area. The tool accepts most common image formats (JPG, PNG, WEBP).</p> </li> <li> <h3>Select the Ghibli Style</h3> <p>From the style options, choose "Studio Ghibli" to apply the distinctive Ghibli aesthetic to your image.</p> <div class="img-container"> <img src="\images\blog\Ghibli-Style.webp" alt="Selecting Studio Ghibli style in AI Filter" class="responsive-image"> </div> </li> <li> <h3>Process & Download and Share</h3> <p>Click "Generate" and wait 5-10 seconds for the AI to work its magic. Once complete, download your transformed Studio Ghibli artwork!</p> </li> </ol> </div> </section> <section id="tips-best-practices"> <h2>Tips and Best Practices</h2> <p>Maximize your Studio Ghibli AI art results with these expert tips:</p> <div class="two-columns"> <div class="dos-section"> <h3>โœ… Do This</h3> <ul class="custom-list"> <li>Use high-resolution images for better detail</li> <li>Choose photos with natural lighting</li> <li>Experiment with different types of subjects</li> <li>Try landscape and nature photos for stunning results</li> <li>Use portraits with clear facial features</li> </ul> </div> <div class="donts-section"> <h3>โŒ Avoid This</h3> <ul class="custom-list"> <li>Very dark or poorly lit images</li> <li>Extremely busy or cluttered compositions</li> <li>Images with heavy digital filters already applied</li> <li>Very low resolution or pixelated photos</li> <li>Images with copyright watermarks</li> </ul> </div> </div> <div class="img-container"> <img src="\images\blog\DO&AVOID.webp" alt="Tips and Best Practices" class="responsive-image"> </div> </section> <section id="examples-inspiration"> <h2>Examples and Inspiration</h2> <p>See the incredible transformations possible with our Studio Ghibli AI Filter:</p> <div class="feature-grid"> <div class="feature-card"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/b6cc6629-5c2b-4330-a9ef-c2b3a9277b83.jpg" alt="Studio Ghibli Portrait Transformation" class="responsive-image"> <h3>Portrait Transformations</h3> <p>Turn everyday portraits into magical Ghibli characters with soft features and dreamy backgrounds.</p> </div> <div class="feature-card"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/440a3d51-8ebd-42ca-ac42-548ae7096ee3.jpg" alt="Studio Ghibli Landscape Transformation" class="responsive-image"> <h3>Landscape Magic</h3> <p>Transform scenic photos into enchanting Ghibli-style landscapes with rolling hills and mystical atmospheres.</p> </div> <div class="feature-card"> <img src="https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/3f73abc7-a748-4ea6-80a1-9b59806d4c73.jpg" alt="Studio Ghibli Pet Adventures" class="responsive-image"> <h3>Pet Adventures</h3> <p>Give your furry friends the Ghibli treatment, creating adorable anime-style pet portraits.</p> </div> </div> <div class="cta-block"> <h3>Ready to Create Your Own Ghibli Masterpiece?</h3> <p>Join thousands of users who have already transformed their photos into magical Studio Ghibli artwork.</p> <a href="https://modernphototools.com/tools/ai-filter" class="cta-button">Start Creating Now โ†’</a> </div> </section> <section id="faq"> <h2>Frequently Asked Questions About Studio Ghibli AI Art</h2> <div class="faq-container"> <div class="faq-item"> <h3 class="faq-question">What is Studio Ghibli AI art?</h3> <div class="faq-answer"> <p>Studio Ghibli AI art refers to images that have been transformed using artificial intelligence to mimic the distinctive animation style of Studio Ghibli films. These transformations capture the characteristic soft colors, detailed backgrounds, and whimsical elements that make Ghibli films so recognizable.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Do I need artistic skills to create Studio Ghibli AI art?</h3> <div class="faq-answer"> <p>Not at all! Our AI Filter tool handles all the artistic work for you. You simply upload a photo, select the Ghibli style, and the AI transforms it automatically. No drawing, painting, or design skills required.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Is your Studio Ghibli AI Filter tool really free?</h3> <div class="faq-answer"> <p>Yes! Our AI Filter tool is completely free to use. There are no hidden fees, subscriptions, or limitations on the number of images you can transform.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">What types of images work best with the Ghibli AI Filter?</h3> <div class="faq-answer"> <p>While our AI Filter works with virtually any image, certain subjects tend to produce more stunning results. Portraits, landscapes, nature scenes, pets, and architectural photos typically transform beautifully into the Ghibli style.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">How long does it take to transform an image into Ghibli style?</h3> <div class="faq-answer"> <p>The transformation process typically takes just 5-10 seconds, depending on your internet connection and the size of your image. You'll have your Ghibli-style artwork ready to download almost instantly.</p> </div> </div> <div class="faq-item"> <h3 class="faq-question">Can I use my Ghibli AI art commercially?</h3> <div class="faq-answer"> <p>Yes, you can use your transformed images for personal and commercial purposes. However, please note that while you own the rights to your transformed images, the Studio Ghibli style itself is inspired by copyrighted work, so use discretion when commercializing.</p> </div> </div> </div> </section> <div class="cta-block"> <h2>Start Creating Your Studio Ghibli AI Art Today</h2> <p>Transform your photos into magical Studio Ghibli masterpieces with our free AI Filter tool. No artistic skills required - just upload, select the Ghibli style, and watch the magic happen!</p> <a href="https://modernphototools.com/tools/ai-filter" class="cta-button">Try AI Filter Free โ†’</a> </div> </div>
๐Ÿ“„ copy.py
import os from html import escape EXCLUDED_FILES = {"package-lock.json", ".gitignore", "webpack-runtime.js", "trace"} EXCLUDED_FOLDERS = {"node_modules", ".git", ".astro", ".vscode", ".DS_Store", "cache", "app", "static", "server", "build", ".next", "docs", "dist", "public"} def generate_file_tree_html(base_dir): html_content = ["<html><head><style>"] html_content.append(""" body { font-family: Arial, sans-serif; margin: 20px; } .folder { font-weight: bold; margin-top: 10px; } .file { margin-left: 20px; color: blue; font-weight: bold; } .content { margin-left: 40px; white-space: pre-wrap; font-family: monospace; color: black; border-left: 2px solid #ddd; padding-left: 10px; } </style></head><body><h1>Project Files</h1> """) def process_folder(folder, depth=0): nonlocal html_content for item in sorted(os.listdir(folder)): item_path = os.path.join(folder, item) if item in EXCLUDED_FOLDERS or item in EXCLUDED_FILES or item.endswith(".zip"): continue if os.path.isdir(item_path): html_content.append(f'<div class="folder" style="margin-left: {depth * 20}px;">๐Ÿ“ {escape(item)}</div>') process_folder(item_path, depth + 1) else: html_content.append(f'<div class="file" style="margin-left: {depth * 20}px;">๐Ÿ“„ {escape(item)}</div>') try: with open(item_path, 'r', encoding='utf-8') as f: file_content = f.read() html_content.append(f'<div class="content">{escape(file_content)}</div>') except Exception as e: html_content.append(f'<div class="content">[Error reading file: {e}]</div>') process_folder(base_dir) html_content.append("</body></html>") return "\n".join(html_content) if __name__ == "__main__": base_dir = os.getcwd() html_output = generate_file_tree_html(base_dir) output_file = os.path.join(base_dir, "project_code.html") try: with open(output_file, "w", encoding="utf-8") as f: f.write(html_output) print(f"โœ… HTML file generated: {output_file}") except Exception as e: print(f"โŒ Error writing file: {e}")
๐Ÿ“ dist-ssr
๐Ÿ“ .vite
๐Ÿ“„ manifest.json
{ "src/entry-server.tsx": { "file": "entry-server.js", "name": "entry-server", "src": "src/entry-server.tsx", "isEntry": true } }
๐Ÿ“„ entry-server.js
import { jsxs, jsx, Fragment } from "react/jsx-runtime"; import ReactDOMServer from "react-dom/server"; import { StaticRouter } from "react-router-dom/server.mjs"; import { Link, useParams, Navigate, Routes, Route } from "react-router-dom"; import { Helmet, HelmetProvider } from "react-helmet-async"; import React, { useState, useCallback, useRef, useEffect } from "react"; import * as LucideIcons from "lucide-react"; import { Image as Image$1, X, Menu, ArrowRight, Upload, XCircle, Brush, HelpCircle, Loader, Download, Mail, Send, Home, Search } from "lucide-react"; const Header = () => { const [isMenuOpen, setIsMenuOpen] = React.useState(false); const toggleMenu = () => { setIsMenuOpen(!isMenuOpen); }; return /* @__PURE__ */ jsxs("header", { className: "sticky top-0 z-50 bg-white shadow-sm", children: [ /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-4 flex justify-between items-center", children: [ /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center space-x-2", children: [ /* @__PURE__ */ jsx(Image$1, { className: "w-8 h-8 text-blue-600" }), /* @__PURE__ */ jsx("span", { className: "text-xl font-bold text-gray-900", children: "ModernPhotoTools" }) ] }), /* @__PURE__ */ jsxs("nav", { className: "hidden md:flex space-x-8", children: [ /* @__PURE__ */ jsx(Link, { to: "/", className: "text-gray-700 hover:text-blue-600 transition-colors", children: "Home" }), /* @__PURE__ */ jsx(Link, { to: "/tools", className: "text-gray-700 hover:text-blue-600 transition-colors", children: "All Tools" }), /* @__PURE__ */ jsx(Link, { to: "/blog", className: "text-gray-700 hover:text-blue-600 transition-colors", children: "Blog" }), /* @__PURE__ */ jsx(Link, { to: "/about", className: "text-gray-700 hover:text-blue-600 transition-colors", children: "About" }), /* @__PURE__ */ jsx(Link, { to: "/contact", className: "text-gray-700 hover:text-blue-600 transition-colors", children: "Contact" }) ] }), /* @__PURE__ */ jsx( "button", { className: "md:hidden p-2 rounded-md text-gray-700 hover:bg-gray-100", onClick: toggleMenu, "aria-label": isMenuOpen ? "Close menu" : "Open menu", children: isMenuOpen ? /* @__PURE__ */ jsx(X, { size: 24 }) : /* @__PURE__ */ jsx(Menu, { size: 24 }) } ) ] }), isMenuOpen && /* @__PURE__ */ jsx("div", { className: "md:hidden bg-white shadow-md", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-4 flex flex-col space-y-4", children: [ /* @__PURE__ */ jsx( Link, { to: "/", className: "text-gray-700 hover:text-blue-600 transition-colors py-2", onClick: () => setIsMenuOpen(false), children: "Home" } ), /* @__PURE__ */ jsx( Link, { to: "/tools", className: "text-gray-700 hover:text-blue-600 transition-colors py-2", onClick: () => setIsMenuOpen(false), children: "All Tools" } ), /* @__PURE__ */ jsx( Link, { to: "/blog", className: "text-gray-700 hover:text-blue-600 transition-colors py-2", onClick: () => setIsMenuOpen(false), children: "Blog" } ), /* @__PURE__ */ jsx( Link, { to: "/about", className: "text-gray-700 hover:text-blue-600 transition-colors py-2", onClick: () => setIsMenuOpen(false), children: "About" } ), /* @__PURE__ */ jsx( Link, { to: "/contact", className: "text-gray-700 hover:text-blue-600 transition-colors py-2", onClick: () => setIsMenuOpen(false), children: "Contact" } ) ] }) }) ] }); }; const Footer = () => { const currentYear = (/* @__PURE__ */ new Date()).getFullYear(); return /* @__PURE__ */ jsx("footer", { className: "bg-gray-100 pt-12 pb-8", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4", children: [ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-8", children: [ /* @__PURE__ */ jsxs("div", { className: "col-span-1", children: [ /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center space-x-2 mb-4", children: [ /* @__PURE__ */ jsx(Image$1, { className: "w-8 h-8 text-blue-600" }), /* @__PURE__ */ jsx("span", { className: "text-xl font-bold text-gray-900", children: "ModernPhotoTools" }) ] }), /* @__PURE__ */ jsx("p", { className: "text-gray-600 mb-4", children: "Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds." }) ] }), /* @__PURE__ */ jsxs("div", { className: "col-span-1", children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Quick Links" }), /* @__PURE__ */ jsxs("ul", { className: "space-y-2", children: [ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Home" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "All Tools" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/blog", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Blog" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/about", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "About" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/contact", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Contact" }) }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "col-span-1", children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Popular Tools" }), /* @__PURE__ */ jsxs("ul", { className: "space-y-2", children: [ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools/remove-background", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Remove Background" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools/ai-image-generator", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "AI Image Generator" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools/ai-portrait", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "AI Portrait" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools/ai-image-upscaler", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "AI Image Upscaler" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/tools/ai-face-swap", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "AI Face Swap" }) }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "col-span-1", children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-4", children: "Legal" }), /* @__PURE__ */ jsxs("ul", { className: "space-y-2", children: [ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/privacy-policy", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Privacy Policy" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/terms-of-use", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Terms of Use" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/dmca", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "DMCA" }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/cookies-policy", className: "text-gray-600 hover:text-blue-600 transition-colors", children: "Cookies Policy" }) }) ] }) ] }) ] }), /* @__PURE__ */ jsx("div", { className: "border-t border-gray-200 mt-8 pt-8 text-center", children: /* @__PURE__ */ jsxs("p", { className: "text-gray-600", children: [ "ยฉ ", currentYear, " ModernPhotoTools.com. All rights reserved." ] }) }) ] }) }); }; const faceSwapStyles = [ // --- Male Faces --- { gender: "male", name: "Classic Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg" }, { gender: "male", name: "Handsome Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg" }, { gender: "male", name: "Young Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg" }, { gender: "male", name: "Professional Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg" }, { gender: "male", name: "Mature Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg" }, { gender: "male", name: "Athletic Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820555898.jpg" }, { gender: "male", name: "Casual Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820557168.jpg" }, { gender: "male", name: "Stylish Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg" }, { gender: "male", name: "Confident Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg" }, { gender: "male", name: "Distinguished Male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg" }, // --- Female Faces --- { gender: "female", name: "Classic Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg" }, { gender: "female", name: "Beautiful Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg" }, { gender: "female", name: "Elegant Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg" }, { gender: "female", name: "Young Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg" }, { gender: "female", name: "Stylish Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg" }, { gender: "female", name: "Modern Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg" }, { gender: "female", name: "Professional Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg" }, { gender: "female", name: "Sophisticated Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg" }, { gender: "female", name: "Confident Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg" }, { gender: "female", name: "Glamorous Female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg" } ]; const SITE_TITLE = "ModernPhotoTools.com"; const SITE_DESCRIPTION = "Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds."; const MAX_FILE_SIZE = 5 * 1024 * 1024; const ACCEPTED_IMAGE_TYPES = ["image/jpeg", "image/png", "image/webp"]; const SEO = ({ title = SITE_TITLE, description = SITE_DESCRIPTION, canonicalUrl }) => { const formattedTitle = title === SITE_TITLE ? title : `${title} | ${SITE_TITLE}`; return /* @__PURE__ */ jsxs(Helmet, { children: [ /* @__PURE__ */ jsx("title", { children: formattedTitle }), /* @__PURE__ */ jsx("meta", { name: "description", content: description }), /* @__PURE__ */ jsx("meta", { property: "og:type", content: "website" }), /* @__PURE__ */ jsx("meta", { property: "og:title", content: formattedTitle }), /* @__PURE__ */ jsx("meta", { property: "og:description", content: description }), /* @__PURE__ */ jsx("meta", { property: "og:site_name", content: SITE_TITLE }), /* @__PURE__ */ jsx("meta", { name: "twitter:card", content: "summary_large_image" }), /* @__PURE__ */ jsx("meta", { name: "twitter:title", content: formattedTitle }), /* @__PURE__ */ jsx("meta", { name: "twitter:description", content: description }), canonicalUrl && /* @__PURE__ */ jsx("link", { rel: "canonical", href: canonicalUrl }) ] }); }; const ToolCard = ({ tool }) => { const getIconComponent = (iconName) => { const pascalCaseName = iconName.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(""); const IconComponent2 = LucideIcons[pascalCaseName] || LucideIcons[iconName.charAt(0).toUpperCase() + iconName.slice(1)] || LucideIcons.Image; return IconComponent2; }; const IconComponent = getIconComponent(tool.icon); return /* @__PURE__ */ jsx( Link, { to: tool.path, className: "bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300", children: /* @__PURE__ */ jsxs("div", { className: "p-6", children: [ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(IconComponent, { className: "w-6 h-6 text-blue-600" }) }), /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: tool.name }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: tool.description }) ] }) } ); }; const Button = ({ children, variant = "primary", size = "md", fullWidth = false, isLoading = false, leftIcon, rightIcon, className = "", disabled, ...props }) => { const baseStyles = "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2"; const variantStyles = { primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500", secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500", outline: "bg-transparent text-gray-900 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500" }; const sizeStyles = { sm: "text-sm px-3 py-1.5", md: "text-base px-4 py-2", lg: "text-lg px-6 py-3" }; const widthStyles = fullWidth ? "w-full" : ""; const disabledStyles = disabled || isLoading ? "opacity-60 cursor-not-allowed" : "cursor-pointer"; return /* @__PURE__ */ jsxs( "button", { className: `${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${widthStyles} ${disabledStyles} ${className}`, disabled: disabled || isLoading, ...props, children: [ isLoading && /* @__PURE__ */ jsxs("svg", { className: "animate-spin -ml-1 mr-2 h-4 w-4 text-current", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" }) ] }), leftIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "mr-2", children: leftIcon }), children, rightIcon && /* @__PURE__ */ jsx("span", { className: "ml-2", children: rightIcon }) ] } ); }; const tools = [ { id: "remove-background", name: "Remove Background", description: "Remove the background from any image with AI precision", icon: "scissors", path: "/tools/remove-background", apiEndpoint: "/api/external/api/v2/remove-background" }, { id: "ai-cleanup", name: "AI Cleanup", description: "Clean up imperfections and enhance your photos", icon: "sparkles", path: "/tools/ai-cleanup", apiEndpoint: "/api/external/api/v2/cleanup-picture" }, { id: "ai-expand", name: "AI Expand", description: "Expand your images beyond their original boundaries", icon: "maximize", path: "/tools/ai-expand", apiEndpoint: "/api/external/api/v2/ai-expand" }, { id: "ai-replace", name: "AI Replace", description: "Replace objects or areas in your images with AI", icon: "replace-all", path: "/tools/ai-replace", apiEndpoint: "/api/external/api/v2/ai-replace" }, { id: "ai-cartoon", name: "AI Cartoon", description: "Transform photos into cartoon-style artwork", icon: "palette", path: "/tools/ai-cartoon", apiEndpoint: "/api/external/api/v2/ai-cartoon-generator" }, { id: "ai-caricature", name: "AI Caricature", description: "Create fun caricatures from portrait photos", icon: "smile", path: "/tools/ai-caricature", apiEndpoint: "/api/external/api/v2/ai-caricature-generator" }, { id: "ai-avatar", name: "AI Avatar", description: "Generate personalized avatars from your photos", icon: "user", path: "/tools/ai-avatar", apiEndpoint: "/api/external/api/v2/ai-avatar" }, { id: "ai-product-photoshoot", name: "AI Product Photoshoot", description: "Create professional product photos with AI", icon: "shopping-bag", path: "/tools/ai-product-photoshoot", apiEndpoint: "/api/external/api/v2/ai-product-photoshoot" }, { id: "ai-background-generator", name: "AI Background Generator", description: "Generate custom backgrounds for your images", icon: "image", path: "/tools/ai-background-generator", apiEndpoint: "/api/external/api/v2/ai-background-generator" }, { id: "ai-image-generator", name: "AI Image Generator", description: "Generate unique images from text descriptions", icon: "bot", path: "/tools/ai-image-generator", apiEndpoint: "/api/external/api/v2/ai-image-generator" }, { id: "ai-portrait", name: "AI Portrait", description: "Create professional portrait photos with AI enhancement", icon: "user-check", path: "/tools/ai-portrait", apiEndpoint: "/api/external/api/v2/ai-portrait" }, { id: "ai-face-swap", name: "AI Face Swap", description: "Swap faces between images with AI precision", icon: "refresh-cw", path: "/tools/ai-face-swap", apiEndpoint: "/api/external/api/v2/ai-face-swap" }, { id: "ai-outfit", name: "AI Outfit", description: "Change outfits in photos with AI technology", icon: "shirt", path: "/tools/ai-outfit", apiEndpoint: "/api/external/api/v2/ai-outfit" }, { id: "ai-image-to-image", name: "AI Image to Image", description: "Transform images with AI style transfer", icon: "image-plus", path: "/tools/ai-image-to-image", apiEndpoint: "/api/external/api/v2/ai-image-to-image" }, { id: "ai-sketch-to-image", name: "AI Sketch to Image", description: "Convert sketches into detailed images", icon: "pencil", path: "/tools/ai-sketch-to-image", apiEndpoint: "/api/external/api/v2/ai-sketch-to-image" }, { id: "ai-hairstyle", name: "AI Hairstyle", description: "Try different hairstyles with AI visualization", icon: "scissors", path: "/tools/ai-hairstyle", apiEndpoint: "/api/external/api/v2/ai-hairstyle" }, { id: "ai-image-upscaler", name: "AI Image Upscaler", description: "Enhance image resolution without losing quality", icon: "zoom-in", path: "/tools/ai-image-upscaler", apiEndpoint: "/api/external/api/v2/ai-image-upscaler" }, { id: "ai-filter", name: "AI Filter", description: "Apply AI-powered filters to enhance your photos", icon: "sliders", path: "/tools/ai-filter", apiEndpoint: "/api/external/api/v2/ai-filter" } ]; const HomePage = () => { const featuredTools = tools.slice(0, 6); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(SEO, {}), /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsxs("h1", { className: "text-4xl md:text-5xl font-bold text-gray-900 mb-6", children: [ "Professional Photo Editing Tools, ", /* @__PURE__ */ jsx("span", { className: "text-blue-600", children: "Powered by AI" }) ] }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-700 mb-8", children: "Transform your photos with our free, powerful AI-powered editing tools. No design skills required." }), /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row justify-center gap-4", children: [ /* @__PURE__ */ jsx(Link, { to: "/tools", children: /* @__PURE__ */ jsx(Button, { size: "lg", rightIcon: /* @__PURE__ */ jsx(ArrowRight, { size: 20 }), children: "Explore All Tools" }) }), /* @__PURE__ */ jsx(Link, { to: "/tools/remove-background", children: /* @__PURE__ */ jsx(Button, { size: "lg", variant: "outline", children: "Remove Background" }) }) ] }) ] }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-white", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4", children: [ /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center mb-12", children: [ /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold text-gray-900 mb-4", children: "Our Popular Photo Editing Tools" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Discover our most popular AI-powered tools to enhance your photos in seconds." }) ] }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: featuredTools.map((tool) => /* @__PURE__ */ jsx(ToolCard, { tool }, tool.id)) }), /* @__PURE__ */ jsx("div", { className: "text-center mt-12", children: /* @__PURE__ */ jsx(Link, { to: "/tools", children: /* @__PURE__ */ jsx(Button, { variant: "outline", rightIcon: /* @__PURE__ */ jsx(ArrowRight, { size: 18 }), children: "View All Tools" }) }) }) ] }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-gray-50", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4", children: [ /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center mb-12", children: [ /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold text-gray-900 mb-4", children: "How It Works" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Edit your photos in three simple steps" }) ] }), /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8", children: [ /* @__PURE__ */ jsxs("div", { className: "bg-white p-6 rounded-lg shadow-md text-center", children: [ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ jsx("span", { className: "text-blue-600 font-bold", children: "1" }) }), /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Upload Your Image" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Select or drag and drop the image you want to edit. We support JPEG, PNG, and WebP formats." }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-white p-6 rounded-lg shadow-md text-center", children: [ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ jsx("span", { className: "text-blue-600 font-bold", children: "2" }) }), /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Apply AI Magic" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Our AI automatically processes your image with the selected tool. No manual editing required." }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-white p-6 rounded-lg shadow-md text-center", children: [ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ jsx("span", { className: "text-blue-600 font-bold", children: "3" }) }), /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-2", children: "Download Result" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Download your professionally edited image and use it anywhere you want." }) ] }) ] }) ] }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-blue-600", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold text-white mb-6", children: "Start Editing Your Photos Today" }), /* @__PURE__ */ jsx("p", { className: "text-blue-100 mb-8", children: "Join thousands of users who transform their photos with our AI-powered tools every day." }), /* @__PURE__ */ jsx(Link, { to: "/tools", children: /* @__PURE__ */ jsx(Button, { size: "lg", variant: "secondary", children: "Get Started Now" }) }) ] }) }) }) ] }); }; const ToolsPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "All Photo Editing Tools", description: "Explore our complete collection of AI-powered photo editing tools. Transform, enhance, and perfect your images with professional results in seconds." } ), /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-12", children: [ /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center mb-12", children: [ /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-4xl font-bold text-gray-900 mb-4", children: "All Photo Editing Tools" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Discover our complete collection of AI-powered tools to transform your photos" }) ] }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: tools.map((tool) => /* @__PURE__ */ jsx(ToolCard, { tool }, tool.id)) }) ] }) ] }); }; const ImageDropzone = ({ onImageSelect, selectedImage }) => { const [isDragging, setIsDragging] = useState(false); const [error, setError] = useState(null); const handleDragEnter = useCallback((e) => { e.preventDefault(); e.stopPropagation(); setIsDragging(true); }, []); const handleDragLeave = useCallback((e) => { e.preventDefault(); e.stopPropagation(); setIsDragging(false); }, []); const handleDragOver = useCallback((e) => { e.preventDefault(); e.stopPropagation(); }, []); const validateFile = (file) => { if (!ACCEPTED_IMAGE_TYPES.includes(file.type)) { return "File type not supported. Please upload a JPEG, PNG, or WebP image."; } if (file.size > MAX_FILE_SIZE) { return "File size exceeds 5MB limit. Please upload a smaller image."; } return null; }; const handleDrop = useCallback((e) => { e.preventDefault(); e.stopPropagation(); setIsDragging(false); if (e.dataTransfer.files && e.dataTransfer.files[0]) { const file = e.dataTransfer.files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () => { onImageSelect({ file, preview: reader.result }); }; reader.readAsDataURL(file); } }, [onImageSelect]); const handleFileSelect = useCallback((e) => { if (e.target.files && e.target.files[0]) { const file = e.target.files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () => { onImageSelect({ file, preview: reader.result }); }; reader.readAsDataURL(file); } }, [onImageSelect]); const handleRemoveImage = useCallback(() => { onImageSelect({ file: null, preview: null }); setError(null); }, [onImageSelect]); return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [ !selectedImage.preview ? /* @__PURE__ */ jsxs( "div", { className: `border-2 border-dashed rounded-lg p-8 flex flex-col items-center justify-center cursor-pointer transition-colors ${isDragging ? "border-blue-500 bg-blue-50" : "border-gray-300 hover:border-gray-400"}`, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, onClick: () => { var _a; return (_a = document.getElementById("file-input")) == null ? void 0 : _a.click(); }, children: [ /* @__PURE__ */ jsx(Upload, { className: "w-10 h-10 text-gray-400 mb-4" }), /* @__PURE__ */ jsx("p", { className: "text-gray-700 font-medium mb-1", children: "Drag and drop your image here" }), /* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm mb-4", children: "or click to browse" }), /* @__PURE__ */ jsx("p", { className: "text-gray-400 text-xs", children: "Supported formats: JPEG, PNG, WebP (max 5MB)" }), /* @__PURE__ */ jsx( "input", { id: "file-input", type: "file", className: "hidden", accept: "image/jpeg,image/png,image/webp", onChange: handleFileSelect } ) ] } ) : /* @__PURE__ */ jsxs("div", { className: "relative border rounded-lg overflow-hidden", children: [ /* @__PURE__ */ jsx( "img", { src: selectedImage.preview, alt: "Selected", className: "w-full h-auto object-contain" } ), /* @__PURE__ */ jsx( "button", { className: "absolute top-2 right-2 p-1 bg-white rounded-full shadow-md hover:bg-gray-100 transition-colors", onClick: handleRemoveImage, "aria-label": "Remove image", children: /* @__PURE__ */ jsx(X, { className: "w-5 h-5 text-gray-700" }) } ) ] }), error && /* @__PURE__ */ jsx("div", { className: "mt-2 text-red-500 text-sm", children: error }) ] }); }; async function convertUrlToBlob(url) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch image from URL: ${url}`); } const blob = await response.blob(); return blob; } async function uploadImageAndGetUrl(file) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const uploadUrlResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v2/uploadImageUrl", body: { uploadType: "imageUrl", // <--- THIS IS THE CORRECTED LINE size: file.size, contentType: file.type } }) }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; const uploadImageResponse = await fetch(uploadImage, { method: "PUT", headers: { "Content-Type": file.type }, body: file }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } const cleanImageUrl = imageUrl.trim().replace(/[\`\s'"]/g, ""); console.log("DEBUG: Original imageUrl from upload:", JSON.stringify(imageUrl)); console.log("DEBUG: Original imageUrl length:", imageUrl.length); console.log("DEBUG: Cleaned imageUrl from upload:", JSON.stringify(cleanImageUrl)); console.log("DEBUG: Cleaned imageUrl length:", cleanImageUrl.length); return cleanImageUrl; } catch (error) { console.error("Error uploading image:", error); throw error; } } async function startCleanupJob({ originalImageUrl, maskedImageUrl }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/cleanup-picture", // NOTE: Endpoint is v1 for job submission as per some docs, changed from v2 body: { imageUrl: originalImageUrl, maskedImageUrl } }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cleanup job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cleanup job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting cleanup job:", error); throw error; } } async function pollJobUntilComplete(orderId) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; let resultUrl = ""; let retries = 0; const maxRetries = 20; const basePollInterval = 3e3; while (!resultUrl && retries < maxRetries) { if (retries > 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15e3); console.log(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) => setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/order-status", body: { orderId } }) }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); console.log("Order status response:", JSON.stringify(orderStatus)); if (orderStatus.status === "FAIL") { const errorMessage = orderStatus.message || "Unknown error"; const errorDescription = orderStatus.description || ""; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = "The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later."; } console.error("LightX API Error:", { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : ""}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } console.log("Checking exit condition:", { status: orderStatus.body.status, output: orderStatus.body.output, statusCheck: orderStatus.body.status === "active", outputCheck: !!orderStatus.body.output, bothConditions: orderStatus.body.status === "active" && orderStatus.body.output }); if (orderStatus.body.status === "active" && orderStatus.body.output) { console.log("Exit condition met! Setting resultUrl and breaking..."); resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === "failed") { const errorMessage = orderStatus.body.message || "Unknown error"; const errorDescription = orderStatus.body.description || ""; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ""}`); } retries++; } if (!resultUrl) { throw new Error("Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later."); } console.log("Image processing completed successfully:", resultUrl); return resultUrl; } catch (error) { console.error("Error polling job status:", error); throw error; } } async function processImage(toolApiEndpoint, imageFile) { try { const maxFileSize = 10 * 1024 * 1024; const supportedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"]; if (imageFile.size > maxFileSize) { throw new Error("Image file is too large. Please use an image smaller than 10MB."); } if (!supportedTypes.includes(imageFile.type.toLowerCase())) { throw new Error("Unsupported image format. Please use JPG, PNG, or WebP."); } console.log("Image validation passed:", { size: `${(imageFile.size / 1024 / 1024).toFixed(2)}MB`, type: imageFile.type, name: imageFile.name }); const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; console.log("Environment detection:", { hostname: window.location.hostname, origin: window.location.origin, isProduction, PROXY_BASE_URL }); console.log("Starting image processing..."); const uploadUrlResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v2/uploadImageUrl", body: { uploadType: "imageUrl", size: imageFile.size, contentType: imageFile.type } }) }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; console.log("Upload successful, imageUrl: ", imageUrl); const uploadImageResponse = await fetch(uploadImage, { method: "PUT", headers: { "Content-Type": imageFile.type, "Content-Length": imageFile.size.toString() }, body: imageFile }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } console.log("S3 upload successful, waiting for image to be available..."); await new Promise((resolve) => setTimeout(resolve, 2e3)); let removeBackgroundResponse; let backgroundRemovalData; let bgRetries = 0; const maxBgRetries = 3; while (bgRetries < maxBgRetries) { try { removeBackgroundResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/remove-background", body: { imageUrl } }) }); if (!removeBackgroundResponse.ok) { const errorText = await removeBackgroundResponse.text(); throw new Error(`Failed to remove background: ${removeBackgroundResponse.status} - ${errorText}`); } backgroundRemovalData = await removeBackgroundResponse.json(); break; } catch (error) { bgRetries++; if (bgRetries >= maxBgRetries) { throw error; } console.log(`Remove background attempt ${bgRetries} failed, retrying in 2 seconds...`); await new Promise((resolve) => setTimeout(resolve, 2e3)); } } if (!backgroundRemovalData || !backgroundRemovalData.body || !backgroundRemovalData.body.orderId) { throw new Error(`Invalid remove background response: ${JSON.stringify(backgroundRemovalData)}`); } const { orderId } = backgroundRemovalData.body; let resultUrl = ""; let retries = 0; const maxRetries = 20; const basePollInterval = 3e3; while (!resultUrl && retries < maxRetries) { if (retries > 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15e3); console.log(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) => setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/order-status", body: { orderId } }) }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); console.log("Order status response:", JSON.stringify(orderStatus)); if (orderStatus.status === "FAIL") { const errorMessage = orderStatus.message || "Unknown error"; const errorDescription = orderStatus.description || ""; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = "The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later."; } console.error("LightX API Error:", { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : ""}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === "active" && orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === "failed") { const errorMessage = orderStatus.body.message || "Unknown error"; const errorDescription = orderStatus.body.description || ""; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ""}`); } retries++; } if (!resultUrl) { throw new Error("Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later."); } console.log("Image processing completed successfully:", resultUrl); return resultUrl; } catch (error) { console.error("Error processing image:", error); throw error; } } async function startExpandJob({ imageUrl, padding }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/expand-photo", // The correct endpoint for this tool body: { imageUrl, topPadding: padding.top, leftPadding: padding.left, bottomPadding: padding.bottom, rightPadding: padding.right } }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start expand job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid expand job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting expand job:", error); throw error; } } async function startReplaceJob({ originalImageUrl, maskedImageUrl, prompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const requestPayload = { endpoint: "v1/replace", body: { imageUrl: originalImageUrl, maskedImageUrl, textPrompt: prompt } }; console.log("Final payload being sent to proxy:", JSON.stringify(requestPayload, null, 2)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, // USE THE VARIABLE HERE body: JSON.stringify(requestPayload) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start replace job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid replace job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting replace job:", error); throw error; } } async function startProductPhotoshootJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/product-photoshoot", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start product photoshoot job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid product photoshoot job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting product photoshoot job:", error); throw error; } } async function startCartoonJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl }; if (styleImageUrl && styleImageUrl.trim() !== "") { jobBody.styleImageUrl = styleImageUrl; console.log("Using styleImageUrl, skipping textPrompt due to API constraint"); } if (textPrompt && textPrompt.trim() !== "") { jobBody.textPrompt = textPrompt; console.log("Using textPrompt (no styleImageUrl provided)"); } console.log("DEBUGGING (Final Attempt): Payload being sent:", JSON.stringify({ endpoint: "v1/cartoon", body: jobBody }, null, 2)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/cartoon", body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cartoon job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cartoon job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting cartoon job:", error); throw error; } } async function startCaricatureJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl }; if (styleImageUrl && styleImageUrl.trim() !== "") { jobBody.styleImageUrl = styleImageUrl; console.log("Using styleImageUrl, skipping textPrompt due to API constraint"); } if (textPrompt && textPrompt.trim() !== "") { jobBody.textPrompt = textPrompt; console.log("Using textPrompt (no styleImageUrl provided)"); } const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/caricature", body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start caricature job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid caricature job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting caricature job:", error); throw error; } } async function startAvatarJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl }; if (styleImageUrl && styleImageUrl.trim() !== "") { jobBody.styleImageUrl = styleImageUrl; console.log("Using styleImageUrl, skipping textPrompt due to API constraint"); } if (textPrompt && textPrompt.trim() !== "") { jobBody.textPrompt = textPrompt; console.log("Using textPrompt (no styleImageUrl provided)"); } const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/avatar", body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start avatar job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid avatar job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting avatar job:", error); throw error; } } async function startBackgroundGeneratorJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/background-generator", body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start background generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid background generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting background generator job:", error); throw error; } } async function startImageGeneratorJob({ textPrompt, width, height }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { textPrompt }; if (width && height) { jobBody.width = width; jobBody.height = height; console.log(`Setting image resolution: ${width}x${height}`); } console.log("Image Generator Job Body:", jobBody); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/text2image", body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting image generator job:", error); throw error; } } async function startPortraitJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/portrait", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start portrait job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid portrait job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting portrait job:", error); throw error; } } async function startFaceSwapJob({ imageUrl, styleImageUrl }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, // Target image styleImageUrl // Source face image }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/face-swap", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start face swap job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid face swap job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting face swap job:", error); throw error; } } async function startOutfitJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/outfit", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start outfit job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid outfit job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting outfit job:", error); throw error; } } async function startImageToImageJob(params) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s'"]/g, ""); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s'"]/g, "") : void 0; console.log("DEBUG: Original imageUrl:", JSON.stringify(params.imageUrl)); console.log("DEBUG: Original imageUrl length:", params.imageUrl.length); console.log("DEBUG: Cleaned imageUrl:", JSON.stringify(cleanImageUrl)); console.log("DEBUG: Cleaned imageUrl length:", cleanImageUrl.length); if (params.styleImageUrl) { console.log("DEBUG: Original styleImageUrl:", JSON.stringify(params.styleImageUrl)); console.log("DEBUG: Original styleImageUrl length:", params.styleImageUrl.length); console.log("DEBUG: Cleaned styleImageUrl:", JSON.stringify(cleanStyleImageUrl)); console.log("DEBUG: Cleaned styleImageUrl length:", cleanStyleImageUrl == null ? void 0 : cleanStyleImageUrl.length); } const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; if (params.strength !== void 0) jobBody.strength = params.strength; if (params.styleStrength !== void 0) jobBody.styleStrength = params.styleStrength; console.log("DEBUG: Final jobBody in startImageToImageJob:", jobBody); console.log("DEBUG: JSON.stringify(jobBody):", JSON.stringify(jobBody)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/image2image", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting image-to-image job:", error); throw error; } } async function startSketchToImageJob(params) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s'"]/g, ""); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s'"]/g, "") : void 0; const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (params.strength !== void 0) jobBody.strength = params.strength; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; if (params.styleStrength !== void 0) jobBody.styleStrength = params.styleStrength; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/sketch2image", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start sketch-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid sketch-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting sketch-to-image job:", error); throw error; } } async function startHairstyleJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v1/hairstyle", // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start hairstyle job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid hairstyle job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting hairstyle job:", error); throw error; } } async function startUpscaleJob({ imageUrl, quality }) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const jobBody = { imageUrl, quality }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v2/upscale", // IMPORTANT: This is a v2 endpoint body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start upscale job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid upscale job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting upscale job:", error); throw error; } } async function startAIFilterJob(params) { try { const isProduction = window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1"; const PROXY_BASE_URL = isProduction ? window.location.origin : "http://localhost:3001"; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s'"]/g, ""); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s'"]/g, "") : void 0; const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ endpoint: "v2/aifilter", // The correct endpoint for AI Filter body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start AI filter job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid AI filter job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error("Error starting AI filter job:", error); throw error; } } const maleCartoonStyles = [ // Male Styles { name: "Woody", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg" }, { name: "Tarzaan", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg" }, { name: "Suley", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421731.jpg" }, { name: "Shrekk", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421575.jpg" }, { name: "Russel", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421409.jpg" }, { name: "Moanna", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421257.jpg" }, { name: "Incredibel", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421110.jpg" }, { name: "Herculess", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420963.jpg" }, { name: "Hattre", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420807.jpg" }, { name: "Fro-zone", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420615.jpg" }, { name: "Rider", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420451.jpg" }, { name: "Eric", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420276.jpg" }, { name: "Miguelle", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420124.jpg" }, { name: "Fredrickson", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419880.jpg" }, { name: "Hook", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419739.jpg" }, { name: "Lightyear", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419579.jpg" }, { name: "Alladin", gender: "male", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419379.jpg" } ]; const femaleCartoonStyles = [ // Female Styles { name: "Snow", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859655.jpg" }, { name: "Sleeping", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859518.jpg" }, { name: "Princess", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859374.jpg" }, { name: "Nordic", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859223.jpg" }, { name: "Mulan", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859046.jpg" }, { name: "Mermaid", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858882.jpg" }, { name: "Iceland", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858702.jpg" }, { name: "Fairy", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858521.jpg" }, { name: "Cinderella", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858381.jpg" }, { name: "Princess", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858207.jpg" }, { name: "Alice", gender: "female", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858002.jpg" } ]; const caricatureStyles = [ { name: "Diva", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/ff03468d-2a81-4a7b-b1a1-243eab68c3f0.jpg", prompt: "glamorous diva with exaggerated features, dramatic makeup, and confident pose" }, { name: "Superhero", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dd04d470-fa29-4039-b1e8-8e22dc965d96.jpg", prompt: "heroic superhero caricature with bold features, strong jawline, and determined expression" }, { name: "Nurse", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fbec18f3-7348-4402-a105-023da24cf27c.jpg", prompt: "caring nurse caricature with kind eyes, gentle smile, and professional appearance" }, { name: "Rockstar", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/0d756d9c-0d36-41a4-a7b4-d7718f8a8406.jpg", prompt: "edgy rockstar caricature with wild hair, intense expression, and rebellious attitude" }, { name: "Corporate", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a8ff8c9a-13ec-4fe2-9a06-72c9570872d9.jpg", prompt: "professional business executive caricature with sharp features, confident smile, and formal attire" }, { name: "Politician", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7a12a146-a906-490b-8801-2cf7f3f565a5.jpg", prompt: "charismatic politician caricature with persuasive expression, prominent features, and authoritative presence" }, { name: "Wonder Woman", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f984a6af-689d-4cee-a087-139740d1533d.jpg", prompt: "powerful Wonder Woman caricature with strong features, heroic pose, and Amazonian warrior spirit" }, { name: "Doctor", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bbd0f925-171d-4184-b457-01466c2cb84c.jpg", prompt: "wise doctor caricature with intelligent eyes, caring expression, and medical professional demeanor" }, { name: "Superwoman", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/70d86058-dbab-451e-a938-d69ff32af14f.jpg", prompt: "mighty superwoman caricature with bold features, confident stance, and superhero strength" }, { name: "Chef", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/baf9d0fe-cb2a-48ca-a442-8df670142841.jpg", prompt: "passionate chef caricature with expressive face, culinary expertise, and creative cooking spirit" }, { name: "Engineer", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5bee0616-5f9e-4958-8978-b379a8028717.jpg", prompt: "innovative engineer caricature with analytical expression, technical precision, and problem-solving mindset" }, { name: "Firefighter", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/44696ea2-49ae-477c-a654-b6647ad52bfc.jpg", prompt: "brave firefighter caricature with heroic features, determined expression, and life-saving courage" }, { name: "Air hostess", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fc2eb43c-2d66-4461-a79d-d9fe850c0f10.jpg", prompt: "elegant air hostess caricature with welcoming smile, professional grace, and friendly demeanor" }, { name: "Architect", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d61d8442-4d37-40fa-a416-1d31f76b950d.jpg", prompt: "creative architect caricature with visionary expression, artistic flair, and design expertise" }, { name: "Ballet", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/3c75bc92-f9d5-48f4-9219-fb980d5ad42e.jpg", prompt: "graceful ballet dancer caricature with elegant features, artistic expression, and dance sophistication" }, { name: "Athlete", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d03852f6-081d-49af-85da-709add60982d.jpg", prompt: "athletic champion caricature with strong features, competitive spirit, and peak physical condition" } ]; const avatarStyles = [ // Male Styles { name: "Action Figure", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922035468.jpg", gender: "male", prompt: "A photorealistic portrait of a male as an Action Figure, dynamic pose, plastic texture, cinematic lighting." }, { name: "Celebrity", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/7966a18a3de743c3b899e8ef13db2563/8a2d11fcfc2041209dbf40df261096f6", gender: "male", prompt: "A high-fashion portrait of a male celebrity, magazine cover style, sharp focus, glamorous." }, { name: "Superhero", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/superhero.jpg", gender: "male", prompt: "A cinematic portrait of a male superhero, dramatic lighting, detailed costume, powerful expression." }, { name: "Warrior", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/warrior.jpg", gender: "male", prompt: "A gritty portrait of a male warrior, ancient armor, battle-worn, epic fantasy style." }, { name: "Muscular", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/mascular.jpg", gender: "male", prompt: "A fitness portrait of a muscular male, strong physique, dramatic shadows, powerful stance." }, { name: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/anime.jpg", gender: "male", prompt: "A portrait of a male in a vibrant Japanese anime style, sharp lines, expressive eyes." }, { name: "Fantasy", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/fantasy.jpg", gender: "male", prompt: "A portrait of a male in a high-fantasy style, elven or magical elements, ethereal lighting." }, { name: "Vintage", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/vintage.jpg", gender: "male", prompt: "A portrait of a male in a vintage, old-fashioned photograph style, sepia tones, classic attire." }, { name: "Sci-Fi", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sci_fi.jpg", gender: "male", prompt: "A futuristic portrait of a male in a sci-fi setting, neon lights, advanced technology, space explorer." }, { name: "Cyberpunk", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyberpunk.jpg", gender: "male", prompt: "A portrait of a male in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future." }, { name: "Steampunk", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/steampunk.jpg", gender: "male", prompt: "A portrait of a male in a steampunk style, victorian clothing with brass gears and clockwork." }, { name: "Medieval", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/medieval.jpg", gender: "male", prompt: "A portrait of a male knight in a medieval style, shining armor, castle background." }, { name: "Celeb", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg", gender: "male", prompt: "A portrait of a male as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous." }, { name: "Doll", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/doll.jpg", gender: "male", prompt: "A portrait of a male as a polished, porcelain doll, perfectly crafted features." }, { name: "Astronaut", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/astronaut.jpg", gender: "male", prompt: "A portrait of a male astronaut in a spacesuit, reflection of stars in the helmet visor." }, { name: "Cartoon", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cartoon.jpg", gender: "male", prompt: "A portrait of a male in a modern 3D cartoon style, like a character from an animated movie." }, { name: "Sculpture", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sculpture.jpg", gender: "male", prompt: "A portrait of a male as a classical marble sculpture, detailed stone texture, dramatic lighting." }, { name: "Alien", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/alien.jpg", gender: "male", prompt: "A portrait of a male as a friendly or mysterious alien being, otherworldly features." }, { name: "Cyborg", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyborg.jpg", gender: "male", prompt: "A portrait of a male as a cyborg, blending human and machine, glowing circuits." }, { name: "Zombie", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/zombie.jpg", gender: "male", prompt: "A stylized portrait of a male as a zombie, post-apocalyptic theme." }, { name: "Spooky", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/spooky.jpg", gender: "male", prompt: "A spooky, gothic horror portrait of a male, dark atmosphere, mysterious shadows." }, { name: "Clown", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Clown.jpg", gender: "male", prompt: "A portrait of a male as a friendly circus clown, colorful makeup and costume." }, { name: "Halloween", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/male.png", gender: "male", prompt: "A portrait of a male in a fun Halloween costume, jack-o-lanterns and spooky decorations." }, { name: "Diwali", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/002.png", gender: "male", prompt: "A portrait of a male celebrating Diwali, traditional Indian attire, festive lights (diyas)." }, { name: "Christmas", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Christmas_male512.png", gender: "male", prompt: "A festive portrait of a male in a Christmas setting, wearing a Santa hat or ugly sweater." }, { name: "Surprises", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/29.jpg", gender: "male", prompt: "A fun, surprising portrait of a male, maybe with confetti or a pop art background." }, // Female Styles { name: "Action Figure", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922059362.png", gender: "female", prompt: "A photorealistic portrait of a female as an Action Figure, dynamic pose, plastic texture, cinematic lighting." }, { name: "Celebrity", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745233095138.jpg", gender: "female", prompt: "A high-fashion portrait of a female celebrity, magazine cover style, sharp focus, glamorous." }, { name: "Doll", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/doll.jpg", gender: "female", prompt: "A portrait of a female as a beautiful, polished doll with perfect features, vibrant outfit." }, { name: "Warrior", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/warrior.jpg", gender: "female", prompt: "A gritty portrait of a female warrior, ornate armor, determined expression, epic fantasy style." }, { name: "Muscular", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/mascular.jpg", gender: "female", prompt: "A fitness portrait of a muscular female, strong and toned physique, dramatic shadows, athletic stance." }, { name: "Superhero", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/superhero.jpg", gender: "female", prompt: "A cinematic portrait of a female superhero, dramatic lighting, detailed costume, powerful expression." }, { name: "Vintage", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/vintage.jpg", gender: "female", prompt: "A portrait of a female in a vintage, old-fashioned photograph style, sepia tones, classic 1920s glamour." }, { name: "Fantasy", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/fantasy.jpg", gender: "female", prompt: "A portrait of a female in a high-fantasy style, as an elegant elf or powerful sorceress, ethereal lighting." }, { name: "Medieval", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/medieval.jpg", gender: "female", prompt: "A portrait of a female queen or princess in a medieval style, elegant gown, castle background." }, { name: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/anime.jpg", gender: "female", prompt: "A portrait of a female in a vibrant Japanese anime style, sharp lines, large expressive eyes." }, { name: "Steampunk", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/steampunk.jpg", gender: "female", prompt: "A portrait of a female in a steampunk style, victorian dress with brass goggles and clockwork details." }, { name: "Sci-Fi", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sci_fi.jpg", gender: "female", prompt: "A futuristic portrait of a female in a sci-fi setting, sleek armor, neon lights, space explorer." }, { name: "Spooky", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/spooky.jpg", gender: "female", prompt: "A spooky, gothic horror portrait of a female, ghostly appearance, dark and mysterious atmosphere." }, { name: "Cyberpunk", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyberpunk.jpg", gender: "female", prompt: "A portrait of a female in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future." }, { name: "Celeb", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg", gender: "female", prompt: "A portrait of a female as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous gown." }, { name: "Astronaut", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/astronaut.jpg", gender: "female", prompt: "A portrait of a female astronaut in a spacesuit, reflection of Earth in the helmet visor." }, { name: "Alien", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/alien.jpg", gender: "female", prompt: "A portrait of a female as a beautiful and mysterious alien queen, otherworldly features." }, { name: "Cartoon", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cartoon.jpg", gender: "female", prompt: "A portrait of a female in a modern 3D cartoon style, like a character from a Disney or Pixar movie." }, { name: "Cyborg", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyborg.jpg", gender: "female", prompt: "A portrait of a female as a cyborg, elegant blend of human and machine, glowing circuits." }, { name: "Zombie", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/zombie.jpg", gender: "female", prompt: "A stylized portrait of a female as a zombie, post-apocalyptic survivor theme." }, { name: "Clown", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Clown.jpg", gender: "female", prompt: "A portrait of a female as a charming circus clown or pierrot, colorful and friendly makeup." }, { name: "Sculpture", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sculpture.jpg", gender: "female", prompt: "A portrait of a female as a graceful classical marble sculpture, detailed stone texture, museum lighting." }, { name: "Halloween", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/female.png", gender: "female", prompt: "A portrait of a female in a fun Halloween costume, like a witch or vampire, with spooky decorations." }, { name: "Diwali", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/001.png", gender: "female", prompt: "A portrait of a female celebrating Diwali, wearing a beautiful traditional saree, festive lights (diyas)." }, { name: "Christmas", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Christmas_female512.png", gender: "female", prompt: "A festive portrait of a female in a Christmas setting, warm cozy sweater, by a decorated tree." }, { name: "Valentine's Day", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/36.jpg", gender: "female", prompt: "A romantic portrait of a female for Valentine's Day, surrounded by hearts and roses, soft lighting." } ]; const productStyles = [ { name: "Cherry Blossoms", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020929.jpg", prompt: "A product placed amidst delicate cherry blossoms, soft pink background, professional product photography, cinematic lighting." }, { name: "Lavenders", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020705.jpg", prompt: "A product displayed in a field of lavenders, rustic and natural setting, calm and soothing atmosphere, product photoshoot." }, { name: "Winter", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089570.jpg", prompt: "Professional apparel photoshoot, winter theme, snowy background, warm clothing, fashion shot." }, { name: "Wedding", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089011.jpg", prompt: "Elegant wedding apparel photoshoot, soft lighting, romantic setting, bridal theme, high fashion." }, { name: "Urban", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604088380.jpg", prompt: "Urban streetwear apparel photoshoot, city background with a graffiti wall, edgy and modern style." }, { name: "Summer", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087821.jpg", prompt: "Summer fashion apparel photoshoot on a bright sunny day, beach or poolside setting, vibrant colors." }, { name: "Red Carpet", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087214.jpg", prompt: "Red carpet apparel photoshoot, glamorous evening gown, flashing lights, celebrity style." }, { name: "Party", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086601.jpg", prompt: "Festive party apparel photoshoot with confetti and balloons, celebratory mood, dynamic and fun." }, { name: "Business", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086039.jpg", prompt: "Professional business apparel photoshoot in a modern office setting, clean and sharp look, corporate attire." }, { name: "Athleisure", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604085478.jpg", prompt: "Athleisure apparel photoshoot with a sporty and comfortable look, in an urban park or gym setting." }, { name: "Adventure", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604084689.jpg", prompt: "Adventure and outdoor apparel photoshoot, mountain or forest background, rugged and durable clothing." }, { name: "Rosebed", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a0ca0330-f483-4c55-8a2f-18ce0db0c39e.jpg", prompt: "A cherished product, like jewelry or perfume, displayed on a bed of fresh red roses, romantic and luxurious." }, { name: "Ribbons", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bd2b6d55-4709-4a1a-90de-0f48e73f68d7.jpg", prompt: "A product artfully arranged with flowing silk ribbons, elegant and delicate presentation, studio shot." }, { name: "River", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119732.jpg", prompt: "Product photoshoot set by a clear mountain river, on natural stones, in a serene and pristine environment." }, { name: "Waterfall", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119524.jpg", prompt: "Product photoshoot with a majestic waterfall in the background, misty and powerful nature scene." }, { name: "Tree Stump", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244508.jpg", prompt: "A rustic product displayed on an old tree stump in a forest, natural and earthy mood." }, { name: "Mountain", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244245.jpg", prompt: "Product photoshoot on a mountain peak, dramatic sky, expansive and adventurous mood." }, { name: "Kitchen", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842034380.jpg", prompt: "Product placement in a modern, clean kitchen setting, lifestyle photoshoot, natural light." }, { name: "Bathroom", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842033958.jpg", prompt: "Cosmetic product displayed in a luxurious, spa-like bathroom, clean and fresh aesthetic." }, { name: "Sneakers", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509574349.jpg", prompt: "Dynamic photoshoot of sneakers, urban street setting, motion blur, product in action." }, { name: "Sandals", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/206c0e5fc3f54894a3add602580c195a", prompt: "Lifestyle photoshoot of sandals on a sunny beach, sand and waves in the background, relaxed summer vibe." }, { name: "Rose Pink", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982317.jpg", prompt: "Product placed on a solid rose pink surface, minimalist and clean, top-down studio shot." }, { name: "Light Coral", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982080.jpg", prompt: "Product displayed on a light coral colored background, soft and warm aesthetic, studio product shot." }, { name: "Storage", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509555427.jpg", prompt: "A piece of storage furniture in a well-decorated room, lifestyle shot showing its use and style." }, { name: "Sofa", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509554980.jpg", prompt: "A stylish sofa featured in a modern living room, highlighting its texture and comfort." }, { name: "Pilea", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995995.jpg", prompt: "Product photoshoot with a Pilea plant, creating a green and fresh atmosphere in a minimalist interior." }, { name: "Hoya", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995739.jpg", prompt: "Product displayed next to a beautiful Hoya plant, biophilic design, natural and calming." }, { name: "Ring", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988340.jpg", prompt: "Macro shot of a ring on a luxurious surface, focused on details and sparkle, elegant lighting." }, { name: "Pendant", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988007.jpg", prompt: "An elegant pendant necklace display, soft focus background, highlighting the craftsmanship." }, { name: "Marble Table", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062430.jpg", prompt: "Product photoshoot on a white marble table, luxurious and clean aesthetic, top-down view." }, { name: "Liquid Surface", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062164.jpg", prompt: "Product placed on a surface with realistic liquid ripples, creative and dynamic studio shot." }, { name: "Graffiti", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006896.jpg", prompt: "Product photoshoot against a vibrant graffiti wall, urban and edgy style." }, { name: "Fireworks", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006566.jpg", prompt: "Product displayed with a background of colorful fireworks, celebratory and exciting mood." }, { name: "Berries", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696919338904.jpg", prompt: "A cosmetic or food product surrounded by fresh berries, vibrant and natural." }, { name: "Coffee Beans", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842044157.jpg", prompt: "A product surrounded by aromatic roasted coffee beans, warm and rich atmosphere." } ]; const suggestedPrompts$1 = [ "an object on a marble counter", "an object on water-rippling water", "an object surrounded by rose petals", "an object on a mountain", "an object on a kitchen counter", "an object on a rock", "waterfall in background", "an object on top of a lotus flower", "an object on snowy mountain", "an object with golden light", "an object in the sky", "cloudy sky" ]; const imageResolutions = [ { id: "square", name: "Square", aspectRatio: "1:1", dimensions: "1024x1024 px", width: 1024, height: 1024 }, { id: "portrait-9-16", name: "Portrait", aspectRatio: "9:16", dimensions: "768x1360 px", width: 768, height: 1360 }, { id: "landscape-16-9", name: "Landscape", aspectRatio: "16:9", dimensions: "1360x768 px", width: 1360, height: 768 }, { id: "portrait-3-4", name: "Portrait", aspectRatio: "3:4", dimensions: "880x1168 px", width: 880, height: 1168 }, { id: "landscape-4-3", name: "Landscape", aspectRatio: "4:3", dimensions: "1168x880 px", width: 1168, height: 880 }, { id: "portrait-2-3", name: "Portrait", aspectRatio: "2:3", dimensions: "832x1248 px", width: 832, height: 1248 }, { id: "landscape-3-2", name: "Landscape", aspectRatio: "3:2", dimensions: "1248x832 px", width: 1248, height: 832 } ]; const suggestedPrompts = [ "generate cute fawn cartoon character enjoying springtime flowers in highly detailed", "create an (old cartoon illustration) of an abandoned boat on the beach surrounded by seagulls and starfish, stormy clouds", "generate a serpent with a hypnotic gaze in a magical wonderland, best quality, masterpiece, ultra sharp, hyper-realistic", "generate an 8k ultra-realistic image of a beautiful unicorn in heaven, high quality with rich vibrant vivid colors", "design a character in the style of Amy Judd blending with Andre Kohn style:1.1), ((neo-figurative fantasy:1.2)), a young woman made of smoke and fog and delicate misty wisps sitting with her side.", "knight fighting a giant fantasy dragon, a burned village in the background, highly detailed, dark fantasy, (morning dawn epic scene of dense smoke by Kim Keever)", "generate a (glowing eyes:1. 2) smiling medusa with pale white cracked skin, snakes growing out of her head, dramatic with the best quality", "generate a realistic (batman:1.3) holding a powerful magical electric thunder ball spellbook with detailed eyes, cinematic", "create a photo of the artistic stone cup with 3D carvings of a muscular teenage ninja turtle in vibrant colors body, decorated with amber accents in dark mountain", "generate a feudal ninja fighting bravely against a giant colossus straw puppet boss, hyper-detailed, ultra-detailed", "create a pixar character of a bull terrier smiling, high resolution, best quality, ((pixar style))", "a dzungarian hamster in an adventurer's hat with slimy tentacles made of blue and white porcelain in wonderland, fantasy art concept, best quality, masterpiece", "create an ethereal beauty of mystical trees with sparkling blossoms illuminated by a red radiant moon casting its glow upon a tree and large landscape", "pixar style of transparent king seahorse with a crown (((luminous))) in the ocean covered with bubbles, high detailed, photorealistic, 8k", "Alice fighting a Oompa Loompa with a large sword, hyper detailed, high quality", "pixar style of lobster, as a cartoon business man character, tinny cute, ((( luminous))), carring a little suitcase, in the ocean, bubbles, smile, high detailed, photorealistic, 8k , smooth, simple", "generate a ((leprechaun)) dancing on a big cauldron full of shiny golden coins in front of a dark cave, (evil laugh), ((clover bushes in the foreground)), god rays of rim light from the small cleft, dense dust, dark fantasy art", "pixar style of a chubby giraffe with a big tummy like a ball doing yoga poses in yoga pants, smiling, highly detailed, photorealistic" ]; const portraitStyles = [ // --- Male Styles --- { gender: "male", name: "Wizard", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg", prompt: "A selfie of a male as a powerful Wizard, wearing magical robes, in a fantasy library setting." }, { gender: "male", name: "Trench Coat", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg", prompt: "A cinematic selfie of a male wearing a stylish Trench Coat on a rainy city street at night." }, { gender: "male", name: "Sweater", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg", prompt: "A cozy selfie of a male in a warm, knitted sweater, autumn vibes, soft lighting." }, { gender: "male", name: "Grinch", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a7b8a481-8776-4589-b1bb-9c021da759f5.jpg", prompt: "A selfie of a male transformed into the Grinch, with green fur and a mischievous smile, festive theme." }, { gender: "male", name: "Superhero", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg", prompt: "A dynamic selfie of a male as a powerful Superhero, wearing a modern costume, with a city skyline in the background." }, { gender: "male", name: "Post Imp", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg", prompt: "A selfie of a male in a Post-Impressionist art style, with bold colors and expressive brushstrokes." }, { gender: "male", name: "Abstract", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891373055.jpg", prompt: "A selfie of a male in a vibrant abstract art style, using geometric shapes and non-realistic colors." }, { gender: "male", name: "Wooden", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777377.jpg", prompt: "A selfie of a male reimagined as a detailed Wooden sculpture, showing wood grain and texture." }, { gender: "male", name: "Stone", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777195.jpg", prompt: "A selfie of a male reimagined as a classical Stone sculpture, with a marble or granite texture." }, { gender: "male", name: "Thriller", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg", prompt: "A selfie of a male in a classic thriller movie style, dramatic shadows, intense expression." }, { gender: "male", name: "Suave", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg", prompt: "A selfie of a suave male in a tailored suit, looking confident and charming, like a secret agent." }, { gender: "male", name: "Officer", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890916035.jpg", prompt: "A professional selfie of a male as a respectable military Officer in a formal uniform." }, { gender: "male", name: "Cop", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890915894.jpg", prompt: "A selfie of a male as a police Cop, wearing a uniform, looking serious and dedicated." }, { gender: "male", name: "Cyber Warrior", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823784962.jpg", prompt: "A selfie of a male as a futuristic Cyber Warrior, with high-tech armor and a glowing energy sword." }, { gender: "male", name: "Viking", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823787503.jpg", prompt: "A selfie of a male as a fierce Viking warrior, with braided hair, beard, and traditional armor." }, { gender: "male", name: "Legacy", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197112042.jpg", prompt: "A selfie of a male with Day of the Dead face paint, celebrating a vibrant legacy with flowers and patterns." }, { gender: "male", name: "Ancestor", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197109686.jpg", prompt: "A selfie of a male in the style of a revered Ancestor, with traditional Day of the Dead sugar skull makeup." }, { gender: "male", name: "Mohawk", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397418.jpg", prompt: "A selfie of a male with a cool Mohawk hairstyle, punk rock aesthetic." }, { gender: "male", name: "Gray", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg", prompt: "A selfie of a male with distinguished gray hair, looking handsome and sophisticated." }, { gender: "male", name: "Sultan", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654277.jpg", prompt: "A royal selfie of a male as a powerful Sultan, wearing ornate robes and a majestic turban." }, { gender: "male", name: "Ottoman", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654139.jpg", prompt: "A royal selfie of a male in traditional Ottoman empire attire, rich fabrics and intricate details." }, { gender: "male", name: "Mughal", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653999.jpg", prompt: "A royal selfie of a male as a Mughal emperor, adorned with jewels and fine silks." }, { gender: "male", name: "Mayan", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653860.jpg", prompt: "A royal selfie of a male as a Mayan king, with traditional headdress and intricate carvings." }, { gender: "male", name: "Heian", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653726.jpg", prompt: "A royal selfie of a male in the style of the Japanese Heian period, elegant and artistic." }, { gender: "male", name: "European", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653548.jpg", prompt: "A selfie of a male as classic European royalty, wearing a crown and regal attire." }, { gender: "male", name: "Chinese", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653334.jpg", prompt: "A selfie of a male as a historical Chinese emperor, in traditional silk robes." }, { gender: "male", name: "Byzantine", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653170.jpg", prompt: "A selfie of a male in the opulent style of a Byzantine noble, with rich mosaics and gold." }, { gender: "male", name: "African", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887652980.jpg", prompt: "A selfie of a male as a proud African king, wearing vibrant traditional attire and beads." }, { gender: "male", name: "Woody", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg", prompt: "A selfie of a male transformed into the cartoon character Woody from Toy Story, 3D animated style." }, { gender: "male", name: "Tarzaan", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg", prompt: "A selfie of a male as the cartoon character Tarzan, in a lush jungle, animated style." }, { gender: "male", name: "Waist-coat", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890156866.jpg", prompt: "A selfie of a male celebrating Diwali, wearing a traditional Kurta with a stylish waist-coat." }, { gender: "male", name: "Contemporary", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890157076.jpg", prompt: "A selfie of a male in a contemporary outfit for Diwali, modern and festive." }, { gender: "male", name: "Adorable", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443497129.jpg", prompt: "An adorable selfie of a male for Valentine's Day, with a sweet smile and a background of hearts." }, { gender: "male", name: "Charming", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443499416.jpg", prompt: "A charming selfie of a male on Valentine's Day, holding a rose, looking romantic." }, { gender: "male", name: "Vibrant", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581601035.jpg", prompt: "A selfie of a male celebrating Holi, face covered in vibrant colored powders." }, { gender: "male", name: "Phoolrang", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581602870.jpg", prompt: "A selfie of a male celebrating Holi with Phoolrang, surrounded by flower petals and colors." }, { gender: "male", name: "Santa", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851564.jpg", prompt: "A festive selfie of a male dressed as Santa Claus, with a white beard and red hat." }, { gender: "male", name: "Snow", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851805.jpg", prompt: "A selfie of a male in a winter wonderland, with snow falling gently around him, Christmas theme." }, { gender: "male", name: "Vibrant", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/28ad386a-6665-46f5-8e87-9e6d9fd2a036.jpg", prompt: "A selfie of a male at a vibrant New Year's party, with confetti and bright lights." }, { gender: "male", name: "Stylish", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7cd237c1-9274-46e1-bddb-c1953d00f075.jpg", prompt: "A stylish selfie of a male dressed up for a New Year's celebration, looking sharp in a suit." }, // --- Female Styles --- { gender: "female", name: "Woolen Coat", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg", prompt: "A chic selfie of a female in an elegant Woolen Coat, winter fashion in the city." }, { gender: "female", name: "Tropical", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg", prompt: "A selfie of a female in a vibrant Tropical dress, on a sunny beach with palm trees." }, { gender: "female", name: "Trench Coat", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg", prompt: "A selfie of a female wearing a classic Trench Coat, sophisticated and timeless look, autumn setting." }, { gender: "female", name: "Sweater", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg", prompt: "A cozy selfie of a female wearing a soft, warm sweater, holding a cup of coffee." }, { gender: "female", name: "Stylish", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg", prompt: "A selfie of a very stylish female in a high-fashion outfit, looking ready for a magazine cover." }, { gender: "female", name: "Street Style", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg", prompt: "A selfie of a female with an edgy Street Style look, in a cool urban environment." }, { gender: "female", name: "Poncho", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg", prompt: "A selfie of a female wearing a fashionable, patterned Poncho, bohemian and chic." }, { gender: "female", name: "Nightdress", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg", prompt: "A selfie of a female in an elegant silk Nightdress, soft and dreamy bedroom setting." }, { gender: "female", name: "Jacket", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg", prompt: "A selfie of a female in a cool leather Jacket, exuding confidence and style." }, { gender: "female", name: "Cocktail", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg", prompt: "A selfie of a female in a stunning Cocktail dress, ready for an evening event." }, { gender: "female", name: "Classic Black", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570192.jpg", prompt: "A selfie of a female in a timeless, classic black dress, sophisticated and elegant." }, { gender: "female", name: "Boho", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570025.jpg", prompt: "A selfie of a female with a Boho-chic style, flowy dress, and earthy accessories." }, { gender: "female", name: "Bodysuit", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569859.jpg", prompt: "A selfie of a female in a sleek and stylish Bodysuit, modern and fashionable." }, { gender: "female", name: "Blazer", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569709.jpg", prompt: "A selfie of a female looking sharp and professional in a well-fitted Blazer." }, { gender: "female", name: "Athleisure", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569494.jpg", prompt: "A selfie of a female in trendy Athleisure wear, sporty, comfortable, and stylish." }, { gender: "female", name: "Aesthetic", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893290344.jpg", prompt: "A selfie of a female with a soft, dreamy aesthetic, pastel colors, and artistic flair." }, { gender: "female", name: "Goddess", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893291279.jpg", prompt: "A selfie of a female transformed into a divine Goddess, with ethereal light and a powerful aura." }, { gender: "female", name: "Romanticism", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822384442.jpg", prompt: "A selfie of a female in the style of a Romanticism painting, dramatic, emotional, and beautiful." }, { gender: "female", name: "Abstract", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822382528.jpg", prompt: "A selfie of a female rendered in a colorful abstract painting style, bold shapes and lines." }, { gender: "female", name: "Goddess", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721893611671.jpg", prompt: "A fantasy selfie of a female as a celestial Goddess, surrounded by stars and cosmic energy." }, { gender: "female", name: "Viking", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733226.jpg", prompt: "A selfie of a female as a strong Viking warrior, with intricate braids and leather armor." }, { gender: "female", name: "Tribal", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733082.jpg", prompt: "A selfie of a female with beautiful tribal face paint and traditional accessories, proud and powerful." }, { gender: "female", name: "Soulful", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197129378.jpg", prompt: "A soulful selfie of a female with artistic Day of the Dead makeup, celebrating life and memory." }, { gender: "female", name: "Sacred", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197131255.jpg", prompt: "A selfie of a female with sacred Day of the Dead sugar skull art, adorned with marigolds." }, { gender: "female", name: "Black Stone", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721880887150.jpg", prompt: "A selfie of a female reimagined as an elegant Black Stone sculpture, polished and dramatic." }, { gender: "female", name: "Stone", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721825362271.jpg", prompt: "A selfie of a female as a graceful Greco-Roman stone sculpture, timeless beauty." }, { gender: "female", name: "Wavy", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770675.jpg", prompt: "A selfie of a female with beautiful, long wavy hair, looking natural and effortless." }, { gender: "female", name: "Victoria Roll", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770509.jpg", prompt: "A selfie of a female with an elegant Victoria Roll hairstyle, classic and sophisticated." }, { gender: "female", name: "Clothes", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882293628.jpg", prompt: "A selfie of a female in futuristic clothes with glowing neon accents, cyberpunk fashion." }, { gender: "female", name: "Space Explorer", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882294348.jpg", prompt: "A selfie of a female as a neon Space Explorer, with a futuristic suit and helmet." }, { gender: "female", name: "Spain", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885286031.jpg", prompt: "A selfie of a female as Spanish royalty, wearing a traditional, elegant gown." }, { gender: "female", name: "Queen", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885285866.jpg", prompt: "A royal selfie of a female as a powerful Queen, wearing a crown and regal jewelry." } ]; const suggestedPortraitPrompts = [ "Professional headshot with soft lighting", "Artistic portrait with dramatic shadows", "Vintage style with warm tones", "Modern minimalist portrait", "Fantasy character transformation", "Cinematic movie poster style", "Oil painting classical portrait", "Digital art cyberpunk style" ]; const presetOutfitStyles = [ // Category: Wedding { category: "Wedding", name: "2-Piece", prompt: "A model wearing a modern and elegant 2-piece wedding outfit, professional studio photoshoot." }, { category: "Wedding", name: "Jacket", prompt: "A model in a sophisticated wedding jacket, suitable for a chic and formal ceremony." }, { category: "Wedding", name: "A-Line", prompt: "A model wearing a classic A-Line wedding gown, timeless and graceful, full-length view." }, { category: "Wedding", name: "3 Piece Suit", prompt: "A model looking dapper in a perfectly tailored 3-piece wedding suit, formal and sharp." }, { category: "Wedding", name: "Gown", prompt: "A model in a breathtaking, floor-length wedding gown, romantic and elegant." }, { category: "Wedding", name: "Classic Suit", prompt: "A model wearing a timeless classic suit for a wedding, sophisticated and elegant." }, // Category: Smart Casual { category: "Smart Casual", name: "Jacket", prompt: "A model wearing a stylish jacket, embodying a perfect smart casual look for an urban setting." }, { category: "Smart Casual", name: "Jacket", prompt: "A model in a fashionable smart casual jacket, effortlessly chic for a day out." }, { category: "Smart Casual", name: "Cardigan", prompt: "A model looking cozy and stylish in a layered smart casual cardigan." }, { category: "Smart Casual", name: "Cardigan", prompt: "A model in a comfortable knit cardigan, the essence of smart casual fashion." }, { category: "Smart Casual", name: "Blouse shirt", prompt: "A model in an elegant blouse shirt, perfect for a smart casual office look or evening." }, { category: "Smart Casual", name: "Button-up", prompt: "A model wearing a crisp button-up shirt, a versatile staple of smart casual style." }, // Category: Athleisure { category: "Athleisure", name: "Sports Bra", prompt: "A model in a trendy and supportive sports bra, athleisure style, in a fitness studio." }, { category: "Athleisure", name: "Basketball", prompt: "A model wearing basketball-inspired athleisure wear on an urban court, sporty and cool." }, { category: "Athleisure", name: "Hoodie", prompt: "A model in a comfortable athleisure hoodie, perfect for a casual, sporty look." }, { category: "Athleisure", name: "Hoodie", prompt: "A model showcasing a different style of athleisure hoodie, street style fashion." }, { category: "Athleisure", name: "Tank Top", prompt: "A model in a breathable athleisure tank top, looking ready for a workout." }, { category: "Athleisure", name: "Polo", prompt: "A model in a classic polo shirt, styled for a sophisticated athleisure look." }, // Category: Jackets (Inferred) { category: "Jackets", name: "Denim Jacket", prompt: "A model in a timeless denim jacket, casual street style photoshoot." }, { category: "Jackets", name: "Denim Jacket", prompt: "A model showcasing a fashionable denim jacket against an urban background." }, // Category: Sweaters (Inferred) { category: "Sweaters", name: "Sweater", prompt: "A model wearing a cozy knit sweater, perfect for a warm and stylish autumn look." }, { category: "Sweaters", name: "Turtleneck", prompt: "A model in a chic turtleneck sweater, exuding sophistication and warmth." }, // Category: Traditional (Inferred) { category: "Traditional", name: "Kebaya", prompt: "A model wearing a beautiful, intricate traditional Kebaya blouse, celebrating cultural heritage." }, { category: "Traditional", name: "Highland", prompt: "A model dressed in Scottish Highland attire, featuring traditional tartan patterns." }, // Category: Bohemian (Inferred) { category: "Bohemian", name: "Bohemian", prompt: "A model with a free-spirited bohemian look, featuring flowing fabrics and earthy tones." }, { category: "Bohemian", name: "Funky", prompt: "A model in a funky, eclectic outfit with bold colors and unique patterns, expressing individuality." } ]; const suggestedOutfitPrompts = [ "Vibrant balloons", "Urban brick wall", "Lush garden scene", "Serene ocean view", "Abstract painting", "Graffiti-covered wall", "Rustic barn", "City skyline", "Enchanting forest landscape", "Majestic mountain range" ]; const suggestedHairstylePrompts = [ "long, wavy blonde hair", "short spiky blue hair", "elegant braided updo", "modern curly pixie cut", "fiery red bob with bangs", "sleek high ponytail", "cool dreadlocks with beads", "classic silver gentleman cut", "voluminous afro hairstyle", "platinum blonde buzz cut", "pastel pink shoulder-length hair", "dark hair with subtle highlights" ]; const aiFilterStyles = [ // Ghibli Category { id: "ghibli-1", name: "Inari", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/97040181-69e1-440d-9c44-45944dd8b8cd.jpg", prompt: "A character portrait in the whimsical Ghibli art style, reminiscent of Inari shrines, detailed and enchanting." }, { id: "ghibli-2", name: "Shade", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5d3e262d-c4f0-45f6-a350-47552640cf03.png", prompt: "A character portrait in the Ghibli art style, with dramatic shading and a mysterious atmosphere." }, { id: "ghibli-3", name: "Zenya", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/962a4918-202c-4a71-a27e-953807d1fd5c.jpg", prompt: "A serene character portrait in the Ghibli art style, peaceful and elegant, with a Zen-like quality." }, { id: "ghibli-4", name: "Storm", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f80b85ab-ea22-40d0-9e91-3793b24d605c.jpg", prompt: "A dynamic character portrait in the Ghibli art style, set during a dramatic storm, emotional and powerful." }, { id: "ghibli-5", name: "Noon", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b7497ed5-0d04-4334-9ca7-ec842cd4cdbb.jpg", prompt: "A bright, sunlit character portrait in the Ghibli art style, capturing the warmth of noon." }, { id: "ghibli-6", name: "Luma", category: "Ghibli", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dc63ecdf-c3f3-458a-ac3b-64c37a0b5a1e.jpg", prompt: "A luminous character portrait in the Ghibli art style, with a soft, glowing light." }, // Accessories Category { id: "accessories-1", name: "Floral Crown", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294968955.jpg", prompt: "A portrait of a person wearing a beautiful and delicate Floral Crown, bohemian and ethereal style." }, { id: "accessories-2", name: "Scarf", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294969683.jpg", prompt: "A portrait of a person wearing a stylish Scarf, adding a touch of elegance or coziness." }, { id: "accessories-3", name: "Beanie", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967692.jpg", prompt: "A portrait of a person wearing a cozy Beanie, casual and cool street style." }, { id: "accessories-4", name: "Bandana", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294966391.jpg", prompt: "A portrait of a person wearing a cool Bandana, with a retro or edgy vibe." }, { id: "accessories-5", name: "Necklace", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294969331.jpg", prompt: "A close-up portrait focusing on a person wearing an elegant Necklace." }, { id: "accessories-6", name: "Baseball Cap", category: "Accessories", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967301.jpg", prompt: "A portrait of a person wearing a sporty Baseball Cap, casual and relaxed." }, // Anime Category { id: "anime-1", name: "Gintocki", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531622371.jpg", prompt: "A person transformed into the anime character Gintoki Sakata, with silver hair and samurai attire." }, { id: "anime-2", name: "H X H", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531620868.jpg", prompt: "A person in the distinct art style of the anime Hunter x Hunter." }, { id: "anime-3", name: "Saitaama", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531619290.jpg", prompt: "A person transformed into the anime character Saitama from One-Punch Man, bald and wearing his hero suit." }, { id: "anime-4", name: "Erren", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531617759.jpg", prompt: "A person transformed into the anime character Eren Yeager from Attack on Titan, with intense eyes." }, { id: "anime-5", name: "Leloch", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531616067.jpg", prompt: "A person transformed into the anime character Lelouch Lamperouge from Code Geass, with his Geass eye." }, { id: "anime-6", name: "Light", category: "Anime", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531614532.jpg", prompt: "A person transformed into the anime character Light Yagami from Death Note, with a cunning expression." }, // Vintage Category { id: "vintage-1", name: "1990s", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0d3d215d0cf645769449223588572076", prompt: "A portrait in the style of the 1990s, with grunge or pop fashion and a film grain look." }, { id: "vintage-2", name: "Victorian", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/1a415a7a51bb436c841068395131c43e", prompt: "An elegant portrait in the Victorian era style, with elaborate clothing and a formal setting." }, { id: "vintage-3", name: "1980s", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/9fe8f49883e548f88cf1364c52036685", prompt: "A portrait with a vibrant 1980s aesthetic, big hair, neon colors, and retro vibes." }, { id: "vintage-4", name: "1950s", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/f99d72dbe94c498fb060d466a66b43f7", prompt: "A classic portrait in the style of the 1950s, with pin-up or rockabilly fashion." }, { id: "vintage-5", name: "1920s", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/ab593ec4339f439195d1a139e7a967ad", prompt: "A glamorous portrait in the style of the Roaring 1920s, with flapper dresses and art deco elements." }, { id: "vintage-6", name: "1990s", category: "Vintage", imageUrl: "https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d47960ae2f8a4116aaebe364430cfa0d", prompt: "A portrait with a distinct 1990s vibe, featuring baggy clothes and a cool, casual attitude." }, // Lights Category { id: "lights-1", name: "Sunset", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/964ca646-31ad-4e72-9768-5dd1ea831880.jpg", prompt: "A portrait with beautiful sunset lighting, warm golden hour glow, dramatic colors." }, { id: "lights-2", name: "Laser", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f9a577ed-e548-4e61-a66d-352f023b35c1.jpg", prompt: "A futuristic portrait with dramatic laser light effects, vibrant and energetic." }, { id: "lights-3", name: "Fireworks", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f0a43cd7-6541-4f75-bed7-972b9e0820e7.jpg", prompt: "A celebratory portrait with a background of exploding fireworks, bright and colorful." }, { id: "lights-4", name: "Northern", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/4fc40ddf-2df9-4063-bce3-1c675b614a3a.jpg", prompt: "A magical portrait with the Northern Lights (Aurora Borealis) in the sky." }, { id: "lights-5", name: "Bokeh", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/6574b9b8-188d-40c9-9835-6369f42403e5.jpg", prompt: "A portrait with a beautiful bokeh effect, soft, out-of-focus lights in the background." }, { id: "lights-6", name: "Cinematic", category: "Lights", imageUrl: "https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b08cd6bc-d8cc-4d33-a47f-57eb57dd3b6b.jpg", prompt: "A portrait with dramatic cinematic lighting, high contrast and moody atmosphere." } ]; const filterCategories = ["Ghibli", "Accessories", "Anime", "Vintage", "Lights"]; const ToolPage = () => { const { toolId } = useParams(); const [selectedImage, setSelectedImage] = useState({ file: null, preview: null }); const [processedImage, setProcessedImage] = useState({ url: null, isLoading: false, error: null }); const imageRef = useRef(null); const visibleCanvasRef = useRef(null); const dataMaskCanvasRef = useRef(null); const [isDrawing, setIsDrawing] = useState(false); const [cleanupBrushSize, setCleanupBrushSize] = useState(20); const [canvasInitialized, setCanvasInitialized] = useState(false); const [isMaskDrawn, setIsMaskDrawn] = useState(false); const [padding, setPadding] = useState({ top: 50, left: 50, bottom: 50, right: 50 }); const replaceImageRef = useRef(null); const replaceVisibleCanvasRef = useRef(null); const replaceDataMaskCanvasRef = useRef(null); const [isReplaceDrawing, setIsReplaceDrawing] = useState(false); const [replaceBrushSize, setReplaceBrushSize] = useState(20); const [replaceCanvasInitialized, setReplaceCanvasInitialized] = useState(false); const [textPrompt, setTextPrompt] = useState(""); const [cartoonTextPrompt, setCartoonTextPrompt] = useState(""); const [cartoonStyleImage, setCartoonStyleImage] = useState(null); const [selectedGender, setSelectedGender] = useState("female"); const [selectedPresetUrl, setSelectedPresetUrl] = useState(null); const [caricatureSelectedStyle, setCaricatureSelectedStyle] = useState(null); const [caricatureCustomStyleImage, setCaricatureCustomStyleImage] = useState(null); const [caricatureTextPrompt, setCaricatureTextPrompt] = useState(""); const [avatarSelectedGender, setAvatarSelectedGender] = useState("male"); const [avatarSelectedStyle, setAvatarSelectedStyle] = useState(null); const [avatarCustomStyleImage, setAvatarCustomStyleImage] = useState(null); const [avatarTextPrompt, setAvatarTextPrompt] = useState(""); const [selectedProductStyle, setSelectedProductStyle] = useState(null); const [productCustomStyleImage, setProductCustomStyleImage] = useState(null); const [productTextPrompt, setProductTextPrompt] = useState(""); const [backgroundTextPrompt, setBackgroundTextPrompt] = useState(""); const [imageGeneratorTextPrompt, setImageGeneratorTextPrompt] = useState(""); const [selectedResolution, setSelectedResolution] = useState(imageResolutions[0]); const [portraitSelectedGender, setPortraitSelectedGender] = useState("female"); const [portraitSelectedStyle, setPortraitSelectedStyle] = useState(null); const [portraitCustomStyleImage, setPortraitCustomStyleImage] = useState(null); const [portraitTextPrompt, setPortraitTextPrompt] = useState(""); const [faceSwapTargetImage, setFaceSwapTargetImage] = useState({ file: null, preview: null }); const [faceSwapSourceImage, setFaceSwapSourceImage] = useState({ file: null, preview: null }); const [selectedFaceSwapPreset, setSelectedFaceSwapPreset] = useState(null); const [outfitTextPrompt, setOutfitTextPrompt] = useState(""); const [i2iMainImage, setI2iMainImage] = useState({ file: null, preview: null }); const [i2iStyleImage, setI2iStyleImage] = useState({ file: null, preview: null }); const [i2iTextPrompt, setI2iTextPrompt] = useState(""); const [i2iStrength, setI2iStrength] = useState(0.5); const [i2iStyleStrength, setI2iStyleStrength] = useState(0.9); const [s2iInputMode, setS2iInputMode] = useState("upload"); const [s2iSketchImage, setS2iSketchImage] = useState({ file: null, preview: null }); const [s2iStyleImage, setS2iStyleImage] = useState({ file: null, preview: null }); const [s2iTextPrompt, setS2iTextPrompt] = useState(""); const [s2iStrength, setS2iStrength] = useState(0.8); const [s2iStyleStrength, setS2iStyleStrength] = useState(0.5); const drawingCanvasRef = useRef(null); const [isDrawingSketch, setIsDrawingSketch] = useState(false); const [s2iBrushSize, setS2iBrushSize] = useState(5); const [s2iBrushColor, setS2iBrushColor] = useState("#000000"); const [hairstyleTextPrompt, setHairstyleTextPrompt] = useState(""); const [upscaleFactor, setUpscaleFactor] = useState(2); const [imageDimensions, setImageDimensions] = useState(null); const [availableUpscaleOptions, setAvailableUpscaleOptions] = useState([2, 4]); const [filterSelectedCategory, setFilterSelectedCategory] = useState("Ghibli"); const [filterSelectedStyle, setFilterSelectedStyle] = useState(null); const [filterCustomStyleImage, setFilterCustomStyleImage] = useState(null); const [filterTextPrompt, setFilterTextPrompt] = useState(""); const [filterUseCustom, setFilterUseCustom] = useState(false); const tool = tools.find((t) => t.id === toolId); if (!tool) { return /* @__PURE__ */ jsx(Navigate, { to: "/tools", replace: true }); } const handleImageSelect = (imageFile) => { setSelectedImage(imageFile); setProcessedImage({ url: null, isLoading: false, error: null }); setCanvasInitialized(false); setReplaceCanvasInitialized(false); setIsMaskDrawn(false); setImageDimensions(null); if (imageFile.file && imageFile.preview) { const img = new Image(); img.onload = () => { const dimensions = { width: img.naturalWidth, height: img.naturalHeight }; console.log("Image dimensions:", dimensions); setImageDimensions(dimensions); const longestSide = Math.max(dimensions.width, dimensions.height); if (longestSide > 2048) { setAvailableUpscaleOptions([]); setProcessedImage({ url: null, isLoading: false, error: "Image is too large (max 2048px on longest side) and cannot be upscaled." }); } else if (longestSide > 1024) { setAvailableUpscaleOptions([2]); setUpscaleFactor(2); } else { setAvailableUpscaleOptions([2, 4]); setUpscaleFactor(2); } }; img.src = imageFile.preview; } }; const handleAIFaceSwapGenerate = async () => { if (!faceSwapTargetImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload a target image." }); return; } if (!selectedFaceSwapPreset && !faceSwapSourceImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please select a preset face or upload a source face image." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const targetImageUrl = await uploadImageAndGetUrl(faceSwapTargetImage.file); let sourceImageUrl; if (selectedFaceSwapPreset) { const sourceImageBlob = await convertUrlToBlob(selectedFaceSwapPreset.imageUrl); sourceImageUrl = await uploadImageAndGetUrl(new File([sourceImageBlob], "source-face.jpeg", { type: "image/jpeg" })); } else { sourceImageUrl = await uploadImageAndGetUrl(faceSwapSourceImage.file); } const orderId = await startFaceSwapJob({ imageUrl: targetImageUrl, styleImageUrl: sourceImageUrl }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during face swap generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleCleanupImageLoad = (event) => { const image = event.target; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; const dataCtx = dataCanvas.getContext("2d"); if (dataCtx) { dataCtx.fillStyle = "#000000"; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } const visibleCtx = visibleCanvas.getContext("2d"); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setCanvasInitialized(true); }; const startDrawing = (e) => { if ((tool == null ? void 0 : tool.id) !== "ai-cleanup") return; setIsDrawing(true); draw(e); }; const draw = (e) => { if (!isDrawing || (tool == null ? void 0 : tool.id) !== "ai-cleanup") return; const { x, y } = getCoordinatesFromEvent(e.nativeEvent); drawAtPoint(x, y); }; const clearCanvas = () => { const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext("2d"); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext("2d"); if (dataCtx) { dataCtx.fillStyle = "#000000"; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } setIsMaskDrawn(false); }; const getCoordinatesFromEvent = (event) => { const canvas = visibleCanvasRef.current; if (!canvas) return { x: 0, y: 0 }; const rect = canvas.getBoundingClientRect(); return { x: event.clientX - rect.left, y: event.clientY - rect.top }; }; const drawAtPoint = (x, y) => { if (!visibleCanvasRef.current || !dataMaskCanvasRef.current || (tool == null ? void 0 : tool.id) !== "ai-cleanup") return; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext("2d"); const dataCtx = dataCanvas.getContext("2d"); if (!visibleCtx || !dataCtx) return; if (!isMaskDrawn) { setIsMaskDrawn(true); } visibleCtx.globalCompositeOperation = "source-over"; visibleCtx.fillStyle = "rgba(255, 0, 0, 0.5)"; visibleCtx.beginPath(); visibleCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); dataCtx.globalCompositeOperation = "source-over"; dataCtx.fillStyle = "#FFFFFF"; dataCtx.beginPath(); dataCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const handleDrawStart = (event) => { setIsDrawing(true); event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawMove = (event) => { if (!isDrawing) return; event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawEnd = () => { setIsDrawing(false); }; const handleCartoonClearSelection = () => { setSelectedPresetUrl(null); }; const handleCaricatureClearSelection = () => { setCaricatureSelectedStyle(null); }; const handleAvatarClearSelection = () => { setAvatarSelectedStyle(null); }; const handleFilterClearSelection = () => { setFilterSelectedStyle(null); }; const handleProductClearSelection = () => { setSelectedProductStyle(null); }; const handleReplaceImageLoad = (event) => { const image = event.target; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; const dataCtx = dataCanvas.getContext("2d"); if (dataCtx) { dataCtx.fillStyle = "#000000"; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } const visibleCtx = visibleCanvas.getContext("2d"); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setReplaceCanvasInitialized(true); }; const startReplaceDrawing = (e) => { if ((tool == null ? void 0 : tool.id) !== "ai-replace") return; setIsReplaceDrawing(true); drawReplace(e); }; const drawReplace = (e) => { if (!isReplaceDrawing || !replaceVisibleCanvasRef.current || !replaceDataMaskCanvasRef.current || (tool == null ? void 0 : tool.id) !== "ai-replace") return; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext("2d"); const dataCtx = dataCanvas.getContext("2d"); if (!visibleCtx || !dataCtx) return; const rect = visibleCanvas.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; visibleCtx.globalCompositeOperation = "source-over"; visibleCtx.fillStyle = "rgba(255, 0, 0, 0.5)"; visibleCtx.beginPath(); visibleCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); dataCtx.globalCompositeOperation = "source-over"; dataCtx.fillStyle = "#FFFFFF"; dataCtx.beginPath(); dataCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const clearReplaceCanvas = () => { const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext("2d"); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext("2d"); if (dataCtx) { dataCtx.fillStyle = "#000000"; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } }; const replaceCanvasToFile = () => { return new Promise((resolve, reject) => { if (!replaceDataMaskCanvasRef.current) { reject(new Error("Canvas not found")); return; } replaceDataMaskCanvasRef.current.toBlob((blob) => { if (!blob) { reject(new Error("Failed to create blob from canvas")); return; } const file = new File([blob], "mask.png", { type: "image/png" }); resolve(file); }, "image/png"); }); }; const canvasToFile = () => { return new Promise((resolve, reject) => { if (!dataMaskCanvasRef.current) { reject(new Error("Canvas not available")); return; } dataMaskCanvasRef.current.toBlob((blob) => { if (!blob) { reject(new Error("Failed to convert canvas to blob")); return; } const file = new File([blob], "mask.png", { type: "image/png" }); resolve(file); }, "image/png"); }); }; const handleAICleanupGenerate = async () => { if (!selectedImage.file) return; if (!isMaskDrawn) { setProcessedImage({ url: null, isLoading: false, error: "Error: Please paint over the area you want to clean up before generating." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalImageFile = selectedImage.file; const maskFile = await canvasToFile(); const originalFinalUrl = await uploadImageAndGetUrl(originalImageFile); const maskFinalUrl = await uploadImageAndGetUrl(maskFile); const orderId = await startCleanupJob({ originalImageUrl: originalFinalUrl, maskedImageUrl: maskFinalUrl }); if (!orderId) { throw new Error("Failed to start cleanup job"); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("AI Cleanup error:", error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : "An unexpected error occurred" }); } }; const handleAIExpandGenerate = async () => { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startExpandJob({ imageUrl, padding }); if (!orderId) { throw new Error("Failed to start expand job"); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("AI Expand error:", error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : "An unexpected error occurred" }); } }; const handleAIReplaceGenerate = async () => { if (!selectedImage.file || !textPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please provide both an image and a text prompt" }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalImageUrl = await uploadImageAndGetUrl(selectedImage.file); const maskFile = await replaceCanvasToFile(); const maskedImageUrl = await uploadImageAndGetUrl(maskFile); console.log("Submitting to API with this prompt:", textPrompt); const orderId = await startReplaceJob({ originalImageUrl, maskedImageUrl, prompt: textPrompt }); if (!orderId) { throw new Error("Failed to start replace job"); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("AI Replace error:", error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : "An unexpected error occurred" }); } }; const handleAICartoonGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ ...processedImage, error: "Please select an image first." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleImageUrl = void 0; let finalPrompt = ""; if (selectedPresetUrl) { finalPrompt = "cartoon style transformation"; console.log(`Processing preset style from URL: ${selectedPresetUrl}`); const styleImageBlob = await convertUrlToBlob(selectedPresetUrl); finalStyleImageUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpg", { type: "image/jpeg" })); } else if (cartoonStyleImage) { finalPrompt = cartoonTextPrompt; console.log("Processing CUSTOM uploaded style image."); finalStyleImageUrl = await uploadImageAndGetUrl(cartoonStyleImage); } else { finalPrompt = cartoonTextPrompt; } console.log("Main URL:", mainImageUrl); console.log("Style URL:", finalStyleImageUrl); console.log("Text Prompt:", finalPrompt); const orderId = await startCartoonJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleImageUrl, textPrompt: finalPrompt || "cartoon style transformation" // ALWAYS send the prompt, never undefined }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAICaricatureGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } if (!caricatureSelectedStyle && !caricatureCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: "Please select a style image before generating." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = ""; if (caricatureSelectedStyle) { finalPrompt = caricatureSelectedStyle.prompt; console.log(`Processing PRESET style: ${caricatureSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(caricatureSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: "image/jpeg" })); } else if (caricatureCustomStyleImage) { finalPrompt = caricatureTextPrompt; console.log("Processing CUSTOM uploaded style image."); finalStyleUrl = await uploadImageAndGetUrl(caricatureCustomStyleImage); } const orderId = await startCaricatureJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "humorous artistic caricature" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during caricature generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAIAvatarGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } if (!avatarSelectedStyle && !avatarCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: "Please select a style before generating." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = ""; if (avatarSelectedStyle) { finalPrompt = avatarSelectedStyle.prompt; console.log(`Processing PRESET style: ${avatarSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(avatarSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: "image/jpeg" })); } else if (avatarCustomStyleImage) { finalPrompt = avatarTextPrompt; console.log("Processing CUSTOM uploaded style image."); finalStyleUrl = await uploadImageAndGetUrl(avatarCustomStyleImage); } const orderId = await startAvatarJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "A high-quality avatar" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during avatar generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAIPortraitGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } if (!portraitSelectedStyle && !portraitCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: "Please select a style before generating." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = ""; if (portraitSelectedStyle) { finalPrompt = portraitSelectedStyle.prompt; console.log(`Processing PRESET style: ${portraitSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(portraitSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: "image/jpeg" })); } else if (portraitCustomStyleImage) { finalPrompt = portraitTextPrompt; console.log("Processing CUSTOM uploaded style image."); finalStyleUrl = await uploadImageAndGetUrl(portraitCustomStyleImage); } const orderId = await startPortraitJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "A high-quality portrait" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during portrait generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAIProductPhotoshootGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } if (!selectedProductStyle && !productCustomStyleImage && !productTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: "Please select a style, upload a style image, or enter a text prompt." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = ""; if (selectedProductStyle) { finalPrompt = selectedProductStyle.prompt; console.log(`Processing PRESET style: ${selectedProductStyle.name}`); const styleImageBlob = await convertUrlToBlob(selectedProductStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: "image/jpeg" })); } else if (productCustomStyleImage) { finalPrompt = productTextPrompt; console.log("Processing CUSTOM uploaded style image."); finalStyleUrl = await uploadImageAndGetUrl(productCustomStyleImage); } else { finalPrompt = productTextPrompt; } const orderId = await startProductPhotoshootJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during product photo generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAIBackgroundGeneratorGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please select an image first." }); return; } if (!backgroundTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a text prompt describing the background you want." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startBackgroundGeneratorJob({ imageUrl: mainImageUrl, textPrompt: backgroundTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during background generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const resizeImageToResolution = async (imageUrl, targetWidth, targetHeight) => { return new Promise((resolve) => { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); const img = new Image(); img.onload = () => { canvas.width = targetWidth; canvas.height = targetHeight; ctx.drawImage(img, 0, 0, targetWidth, targetHeight); resolve(canvas.toDataURL("image/png")); }; img.crossOrigin = "anonymous"; img.src = imageUrl; }); }; const handleAIImageGeneratorGenerate = async () => { if (!imageGeneratorTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a text prompt describing the image you want to generate." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const orderId = await startImageGeneratorJob({ textPrompt: imageGeneratorTextPrompt, width: selectedResolution.width, height: selectedResolution.height }); const resultUrl = await pollJobUntilComplete(orderId); const resizedUrl = await resizeImageToResolution( resultUrl, selectedResolution.width, selectedResolution.height ); setProcessedImage({ url: resizedUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during image generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message || "An unknown error occurred." }); } }; const handleAIOutfitGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload an image." }); return; } if (!outfitTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a text prompt describing the outfit you want." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startOutfitJob({ imageUrl, textPrompt: outfitTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during outfit generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIImageToImageGenerate = async () => { if (!i2iMainImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload a main image." }); return; } if (!i2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a text prompt describing the transformation you want." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(i2iMainImage.file); console.log("DEBUG: mainImageUrl after upload:", mainImageUrl); let styleImageUrl; if (i2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(i2iStyleImage.file); console.log("DEBUG: styleImageUrl after upload:", styleImageUrl); } const jobParams = { imageUrl: mainImageUrl, textPrompt: i2iTextPrompt, styleImageUrl, strength: i2iStrength, styleStrength: i2iStyleImage.file ? i2iStyleStrength : void 0 }; console.log("DEBUG: jobParams before API call:", jobParams); const orderId = await startImageToImageJob(jobParams); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during image-to-image generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAISketchToImageGenerate = async () => { if (s2iInputMode === "upload" && !s2iSketchImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload a sketch image." }); return; } if (s2iInputMode === "draw") { const canvas = drawingCanvasRef.current; if (!canvas) { setProcessedImage({ url: null, isLoading: false, error: "Drawing canvas not available." }); return; } const ctx = canvas.getContext("2d"); if (!ctx) { setProcessedImage({ url: null, isLoading: false, error: "Cannot access drawing canvas." }); return; } const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const data = imageData.data; let hasDrawing = false; for (let i = 0; i < data.length; i += 4) { if (data[i] !== 255 || data[i + 1] !== 255 || data[i + 2] !== 255) { hasDrawing = true; break; } } if (!hasDrawing) { setProcessedImage({ url: null, isLoading: false, error: "Please draw something on the canvas first." }); return; } } if (!s2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a text prompt describing the final image you want." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { let sketchImageUrl; if (s2iInputMode === "upload") { sketchImageUrl = await uploadImageAndGetUrl(s2iSketchImage.file); } else { const canvas = drawingCanvasRef.current; const blob = await new Promise((resolve) => { canvas.toBlob((blob2) => resolve(blob2), "image/png"); }); sketchImageUrl = await uploadImageAndGetUrl(blob); } console.log("DEBUG: sketchImageUrl after upload:", sketchImageUrl); let styleImageUrl; if (s2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(s2iStyleImage.file); console.log("DEBUG: styleImageUrl after upload:", styleImageUrl); } const jobParams = { imageUrl: sketchImageUrl, textPrompt: s2iTextPrompt, strength: s2iStrength, styleImageUrl, styleStrength: s2iStyleImage.file ? s2iStyleStrength : void 0 }; console.log("DEBUG: sketch-to-image jobParams before API call:", jobParams); const orderId = await startSketchToImageJob(jobParams); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during sketch-to-image generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIHairstyleGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload an image." }); return; } if (!hairstyleTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: "Please enter a hairstyle description." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startHairstyleJob({ imageUrl, textPrompt: hairstyleTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during hairstyle generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIUpscalerGenerate = async () => { if (!selectedImage.file) { return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startUpscaleJob({ imageUrl: mainImageUrl, quality: upscaleFactor }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during image upscaling:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIFilterGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload an image first." }); return; } if (!filterSelectedStyle && !filterCustomStyleImage && !filterTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: "Please select a preset style, upload a custom style, or enter a text prompt." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = ""; if (filterSelectedStyle) { finalPrompt = filterSelectedStyle.name; const styleImageBlob = await convertUrlToBlob(filterSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: "image/jpeg" })); } else if (filterCustomStyleImage) { finalPrompt = filterTextPrompt; finalStyleUrl = await uploadImageAndGetUrl(filterCustomStyleImage); } else { finalPrompt = filterTextPrompt; } const orderId = await startAIFilterJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during AI filter generation:", error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleProcessImage = async () => { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const resultUrl = await processImage(tool.apiEndpoint, selectedImage.file); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("Processing error:", error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : "An unexpected error occurred while processing the image" }); } }; const handleDownload = () => { if (!processedImage.url) return; const link = document.createElement("a"); link.href = processedImage.url; link.download = `${tool.id}-result.png`; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; useEffect(() => { return () => { if (processedImage.url) { URL.revokeObjectURL(processedImage.url); } }; }, [processedImage.url]); useEffect(() => { if (tool.id === "ai-sketch-to-image" && s2iInputMode === "draw" && drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const ctx = canvas.getContext("2d"); if (ctx) { canvas.width = 512; canvas.height = 512; ctx.fillStyle = "white"; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.lineCap = "round"; ctx.lineJoin = "round"; } } }, [tool.id, s2iInputMode]); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: tool.name, description: `${tool.description}. Free online tool with instant results.` } ), /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-12", children: /* @__PURE__ */ jsxs("div", { className: "max-w-4xl mx-auto", children: [ /* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [ /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-4xl font-bold text-gray-900 mb-4", children: tool.name }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600 max-w-2xl mx-auto", children: tool.description }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6", children: [ /* @__PURE__ */ jsxs("h2", { className: "text-xl font-semibold mb-4", children: [ "How to use ", tool.name ] }), /* @__PURE__ */ jsx("ol", { className: "list-decimal list-inside space-y-2 text-gray-700", children: tool.id === "ai-cleanup" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Use the brush tool to paint over areas you want to remove" }), /* @__PURE__ */ jsx("li", { children: "Adjust brush size as needed for precision" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI intelligently fill the painted areas' }), /* @__PURE__ */ jsx("li", { children: "Download your enhanced image when processing is complete" }) ] }) : tool.id === "ai-expand" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Adjust the padding values to specify how much to expand each side" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI expand your image with new content' }), /* @__PURE__ */ jsx("li", { children: "Download your expanded image when processing is complete" }) ] }) : tool.id === "ai-replace" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Use the brush tool to paint over areas you want to replace" }), /* @__PURE__ */ jsx("li", { children: "Enter a text prompt describing what you want in the painted areas" }), /* @__PURE__ */ jsx("li", { children: "Adjust brush size as needed for precision" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI replace the painted areas with your prompt' }), /* @__PURE__ */ jsx("li", { children: "Download your enhanced image when processing is complete" }) ] }) : tool.id === "ai-cartoon" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your photo using the tool below (works best with human faces)" }), /* @__PURE__ */ jsx("li", { children: "Choose your stylization method: describe a style with text OR upload a style image" }), /* @__PURE__ */ jsx("li", { children: 'If using text: describe the cartoon style you want (e.g., "anime style", "Disney cartoon")' }), /* @__PURE__ */ jsx("li", { children: "If using a style image: upload a reference image with the desired artistic style" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to transform your photo into cartoon artwork' }), /* @__PURE__ */ jsx("li", { children: "Download your cartoonized image when processing is complete" }) ] }) : tool.id === "ai-avatar" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a clear photo of a human face using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Select your gender to see appropriate avatar styles" }), /* @__PURE__ */ jsx("li", { children: "Choose from preset professional avatar styles OR upload your own style image" }), /* @__PURE__ */ jsx("li", { children: "Optionally add a text prompt to customize the avatar further" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to create your professional avatar' }), /* @__PURE__ */ jsx("li", { children: "Download your avatar when processing is complete" }) ] }) : tool.id === "ai-portrait" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a clear photo of a person's face using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Select your gender to see appropriate portrait styles" }), /* @__PURE__ */ jsx("li", { children: "Choose from preset realistic portrait styles OR upload your own style image" }), /* @__PURE__ */ jsx("li", { children: "Use suggested prompts or add your own text prompt to customize the portrait" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to create your realistic portrait' }), /* @__PURE__ */ jsx("li", { children: "Download your portrait when processing is complete" }) ] }) : tool.id === "ai-face-swap" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a target image (the photo you want to modify) using the first dropzone" }), /* @__PURE__ */ jsx("li", { children: "Either choose a preset face from the gallery OR upload your own source face image" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to swap the faces' }), /* @__PURE__ */ jsx("li", { children: "Download your face-swapped image when processing is complete" }) ] }) : tool.id === "ai-product-photoshoot" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a clear photo of your product using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Choose from preset professional photoshoot styles OR upload your own style image" }), /* @__PURE__ */ jsx("li", { children: "Optionally add a text prompt to describe the desired scene or background" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to create your professional product photo' }), /* @__PURE__ */ jsx("li", { children: "Download your enhanced product photo when processing is complete" }) ] }) : tool.id === "ai-background-generator" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Enter a text prompt describing the background you want to generate" }), /* @__PURE__ */ jsx("li", { children: "Be specific about scenes, settings, colors, textures, and style preferences" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI create a custom background for your image' }), /* @__PURE__ */ jsx("li", { children: "Download your enhanced image when processing is complete" }) ] }) : tool.id === "ai-image-generator" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Select your desired image resolution from the available options" }), /* @__PURE__ */ jsx("li", { children: "Enter a detailed text prompt describing the image you want to create" }), /* @__PURE__ */ jsx("li", { children: "Use suggested prompts for inspiration or create your own custom description" }), /* @__PURE__ */ jsx("li", { children: "Be specific about style, colors, composition, and artistic elements" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI create your unique image' }), /* @__PURE__ */ jsx("li", { children: "Download your generated image when processing is complete" }) ] }) : tool.id === "ai-outfit" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a clear photo of a person using the tool below" }), /* @__PURE__ */ jsx("li", { children: "Choose from preset outfit styles organized by category OR use suggested prompts" }), /* @__PURE__ */ jsx("li", { children: "Enter a detailed text prompt describing the outfit you want to apply" }), /* @__PURE__ */ jsx("li", { children: "Be specific about clothing type, style, colors, and materials" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI change the outfit in your photo' }), /* @__PURE__ */ jsx("li", { children: "Download your transformed image when processing is complete" }) ] }) : tool.id === "ai-image-to-image" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your main image that you want to transform" }), /* @__PURE__ */ jsx("li", { children: "Optionally upload a style reference image for visual guidance" }), /* @__PURE__ */ jsx("li", { children: "Adjust the Image Strength slider to control how much the result resembles your main image" }), /* @__PURE__ */ jsx("li", { children: "Adjust the Style Strength slider to control how much the result follows your style image" }), /* @__PURE__ */ jsx("li", { children: "Enter a detailed text prompt describing the transformation you want" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to let AI transform your image based on your prompt and settings' }), /* @__PURE__ */ jsx("li", { children: "Download your transformed image when processing is complete" }) ] }) : tool.id === "ai-sketch-to-image" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Choose to either draw your sketch or upload an existing sketch image" }), /* @__PURE__ */ jsx("li", { children: "If drawing: Use the canvas to create your sketch with the drawing tools" }), /* @__PURE__ */ jsx("li", { children: "If uploading: Select your sketch image file" }), /* @__PURE__ */ jsx("li", { children: "Enter a detailed text prompt describing the final image you want to create" }), /* @__PURE__ */ jsx("li", { children: "Optionally upload a style reference image for visual guidance" }), /* @__PURE__ */ jsx("li", { children: "Adjust the Sketch Adherence slider to control how closely AI follows your sketch" }), /* @__PURE__ */ jsx("li", { children: "Adjust the Style Strength slider if using a style image" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to transform your sketch into a rendered image' }), /* @__PURE__ */ jsx("li", { children: "Download your transformed image when processing is complete" }) ] }) : tool.id === "ai-hairstyle" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload a clear, front-facing photo of yourself or someone else" }), /* @__PURE__ */ jsx("li", { children: "Describe the hairstyle you want to try on in the text box" }), /* @__PURE__ */ jsx("li", { children: "Or click on one of the suggested hairstyle prompts for inspiration" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to see the new hairstyle applied to your photo' }), /* @__PURE__ */ jsx("li", { children: "Download your result when processing is complete" }) ] }) : tool.id === "ai-image-upscaler" ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below (max 2048px on longest side)" }), /* @__PURE__ */ jsx("li", { children: "Select an upscale factor (2x or 4x) based on your image size" }), /* @__PURE__ */ jsx("li", { children: 'Click "Generate" to enhance your image with AI upscaling' }), /* @__PURE__ */ jsx("li", { children: "Download your high-resolution result when processing is complete" }) ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("li", { children: "Upload your image using the tool below" }), /* @__PURE__ */ jsxs("li", { children: [ 'Click the "', tool.name, '" button to process your image' ] }), /* @__PURE__ */ jsx("li", { children: "Wait for the AI to work its magic" }), /* @__PURE__ */ jsx("li", { children: "Download your result when processing is complete" }) ] }) }) ] }), /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8", children: [ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ tool.id !== "ai-image-generator" && tool.id !== "ai-face-swap" && tool.id !== "ai-image-to-image" && tool.id !== "ai-sketch-to-image" && /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: handleImageSelect, selectedImage } ), tool.id === "ai-face-swap" && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium mb-2", children: "1. Upload Target Image" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "The photo you want to modify" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setFaceSwapTargetImage(imageFile), selectedImage: faceSwapTargetImage } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium mb-2", children: "2. Upload Source Face Image" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "The face you want to use (disabled if preset selected)" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setFaceSwapSourceImage(imageFile), selectedImage: faceSwapSourceImage, disabled: !!selectedFaceSwapPreset } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium mb-2", children: "Or Choose a Preset Source Face" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4", children: faceSwapStyles.map((style) => { const isSelected = (selectedFaceSwapPreset == null ? void 0 : selectedFaceSwapPreset.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( "div", { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, onClick: () => { setSelectedFaceSwapPreset(style); setFaceSwapSourceImage({ file: null, preview: null }); }, children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); setSelectedFaceSwapPreset(null); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx("img", { src: style.imageUrl, alt: style.name, className: "w-full h-auto object-cover" }), /* @__PURE__ */ jsx("p", { className: "text-center text-xs p-1 bg-gray-100", children: style.name }) ] }, style.imageUrl ); }) }) ] }) ] }), tool.id === "ai-cleanup" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [ /* @__PURE__ */ jsx(Brush, { className: "w-4 h-4" }), /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Brush Size:" }) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "5", max: "50", value: cleanupBrushSize, onChange: (e) => setCleanupBrushSize(Number(e.target.value)), className: "flex-1" } ), /* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-600 w-8", children: [ cleanupBrushSize, "px" ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden", style: { display: "inline-block" }, children: [ /* @__PURE__ */ jsx( "img", { ref: imageRef, src: selectedImage.preview, alt: "Selected", className: "w-full h-auto", draggable: false, onLoad: handleCleanupImageLoad, style: { maxWidth: "100%", display: "block" } } ), /* @__PURE__ */ jsx( "canvas", { ref: visibleCanvasRef, className: "absolute top-0 left-0 cursor-crosshair", onMouseDown: startDrawing, onMouseMove: draw, onMouseUp: () => setIsDrawing(false), onMouseLeave: () => setIsDrawing(false), onTouchStart: handleDrawStart, onTouchMove: handleDrawMove, onTouchEnd: handleDrawEnd, style: { zIndex: 10 } } ), /* @__PURE__ */ jsx( "canvas", { ref: dataMaskCanvasRef, style: { display: "none" } } ) ] }), /* @__PURE__ */ jsx( Button, { variant: "outline", onClick: clearCanvas, className: "w-full", children: "Clear Mask" } ) ] }), tool.id === "ai-expand" && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium", children: "Padding Settings" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600", children: "Specify how many pixels to add to each side of your image." }), /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Top Padding" }), /* @__PURE__ */ jsx( "input", { type: "number", min: "0", max: "500", value: padding.top, onChange: (e) => setPadding((prev) => ({ ...prev, top: Number(e.target.value) })), className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Bottom Padding" }), /* @__PURE__ */ jsx( "input", { type: "number", min: "0", max: "500", value: padding.bottom, onChange: (e) => setPadding((prev) => ({ ...prev, bottom: Number(e.target.value) })), className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Left Padding" }), /* @__PURE__ */ jsx( "input", { type: "number", min: "0", max: "500", value: padding.left, onChange: (e) => setPadding((prev) => ({ ...prev, left: Number(e.target.value) })), className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Right Padding" }), /* @__PURE__ */ jsx( "input", { type: "number", min: "0", max: "500", value: padding.right, onChange: (e) => setPadding((prev) => ({ ...prev, right: Number(e.target.value) })), className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" } ) ] }) ] }) ] }), tool.id === "ai-background-generator" && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Background Description" }), /* @__PURE__ */ jsx( "textarea", { value: backgroundTextPrompt, onChange: (e) => setBackgroundTextPrompt(e.target.value), placeholder: "Describe the background you want to generate (e.g., 'sunset beach with palm trees', 'modern office interior', 'mountain landscape with snow')...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 4 } ) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-xs text-blue-700 space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "โ€ข Be specific about the scene or setting you want" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Include details about lighting, colors, and mood" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Mention the style (realistic, artistic, vintage, etc.)" }), /* @__PURE__ */ jsx("li", { children: 'โ€ข Example: "Professional studio with soft lighting and neutral background"' }) ] }) ] }) ] }), tool.id === "ai-replace" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [ /* @__PURE__ */ jsx(Brush, { className: "w-4 h-4" }), /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Brush Size:" }) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "5", max: "50", value: replaceBrushSize, onChange: (e) => setReplaceBrushSize(Number(e.target.value)), className: "flex-1" } ), /* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-600 w-8", children: [ replaceBrushSize, "px" ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Text Prompt" }), /* @__PURE__ */ jsx( "textarea", { value: textPrompt, onChange: (e) => setTextPrompt(e.target.value), placeholder: "Describe what you want to replace the painted areas with...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 3 } ), /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [ /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600 mb-2 block", children: "Try an example:" }), /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [ /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setTextPrompt("A beautiful cherry blossom tree"), className: "px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors", children: "Cherry Blossom Tree" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setTextPrompt("Sunglasses with a futuristic design, cyberpunk style"), className: "px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors", children: "Futuristic Sunglasses" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setTextPrompt("A classic red brick wall"), className: "px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors", children: "Red Brick Wall" } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden", style: { display: "inline-block" }, children: [ /* @__PURE__ */ jsx( "img", { ref: replaceImageRef, src: selectedImage.preview, alt: "Selected", className: "w-full h-auto", draggable: false, onLoad: handleReplaceImageLoad, style: { maxWidth: "100%", display: "block" } } ), /* @__PURE__ */ jsx( "canvas", { ref: replaceVisibleCanvasRef, className: "absolute top-0 left-0 cursor-crosshair", onMouseDown: startReplaceDrawing, onMouseMove: drawReplace, onMouseUp: () => setIsReplaceDrawing(false), onMouseLeave: () => setIsReplaceDrawing(false), style: { zIndex: 10, opacity: 0.5 } } ), /* @__PURE__ */ jsx( "canvas", { ref: replaceDataMaskCanvasRef, style: { display: "none" } } ) ] }), /* @__PURE__ */ jsx( Button, { variant: "outline", onClick: clearReplaceCanvas, className: "w-full", children: "Clear Mask" } ), /* @__PURE__ */ jsxs("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsxs("p", { className: "text-sm text-yellow-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Important Note:" }), " This tool generates a new image from your text. For best results:" ] }), /* @__PURE__ */ jsxs("ul", { className: "text-sm text-yellow-800 mt-2 ml-4 list-disc space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: `Describe what you want to see, don't give commands. (e.g., say "a tall sunflower," not "replace this with a sunflower").` }), /* @__PURE__ */ jsx("li", { children: "The AI works best on images containing human faces. Results on objects or landscapes may vary." }) ] }) ] }) ] }), tool.id === "ai-cartoon" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Select Persona" }), /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [ /* @__PURE__ */ jsx( Button, { variant: selectedGender === "female" ? "primary" : "outline", onClick: () => setSelectedGender("female"), children: "Female" } ), /* @__PURE__ */ jsx( Button, { variant: selectedGender === "male" ? "primary" : "outline", onClick: () => setSelectedGender("male"), children: "Male" } ) ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Choose a Preset Style" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4", children: (selectedGender === "female" ? femaleCartoonStyles : maleCartoonStyles).map((style) => { const isSelected = selectedPresetUrl === style.imageUrl; return /* @__PURE__ */ jsxs( "div", { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, onClick: () => setSelectedPresetUrl(style.imageUrl), children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); handleCartoonClearSelection(); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx("img", { src: style.imageUrl, alt: style.name, className: "w-full h-auto object-cover" }), /* @__PURE__ */ jsx("p", { className: "text-center text-xs p-1 bg-gray-100", children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700 text-center", children: "Or Use a Custom Style" }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Upload a Style Image" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; return setCartoonStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", disabled: !!selectedPresetUrl } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Describe a Style with Text" }), /* @__PURE__ */ jsx( "textarea", { value: cartoonTextPrompt, onChange: (e) => setCartoonTextPrompt(e.target.value), placeholder: "e.g., 'anime style', 'Disney cartoon'...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 2, disabled: !!selectedPresetUrl } ) ] }) ] }) ] }), tool.id === "ai-caricature" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-yellow-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " This tool works best with clear photos of human faces. Results on other subjects may vary." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Choose a Preset Style" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4", children: caricatureStyles.map((style) => { const isSelected = (caricatureSelectedStyle == null ? void 0 : caricatureSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( "div", { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, onClick: () => setCaricatureSelectedStyle(style), children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); handleCaricatureClearSelection(); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx("img", { src: style.imageUrl, alt: style.name, className: "w-full h-auto object-cover" }), /* @__PURE__ */ jsx("p", { className: "text-center text-xs p-1 bg-gray-100", children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700 text-center", children: "Or Use a Custom Style" }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Upload a Style Image" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; return setCaricatureCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", disabled: !!caricatureSelectedStyle } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Describe a Style with Text" }), /* @__PURE__ */ jsx( "textarea", { value: caricatureTextPrompt, onChange: (e) => setCaricatureTextPrompt(e.target.value), placeholder: "Optional: Add descriptive text to modify your chosen style...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 2, disabled: !!caricatureSelectedStyle } ) ] }) ] }) ] }), tool.id === "ai-avatar" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-blue-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " This tool generates the best avatars from a single, clear photo of a human face." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Select Gender" }), /* @__PURE__ */ jsxs("div", { className: "flex space-x-4", children: [ /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setAvatarSelectedGender("male"), className: `px-4 py-2 rounded-md border ${avatarSelectedGender === "male" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Male" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setAvatarSelectedGender("female"), className: `px-4 py-2 rounded-md border ${avatarSelectedGender === "female" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Female" } ) ] }) ] }), avatarSelectedGender && /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Choose a Preset Style" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4", children: avatarStyles.filter((style) => style.gender === avatarSelectedGender).map((style) => { const isSelected = (avatarSelectedStyle == null ? void 0 : avatarSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( "div", { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, onClick: () => setAvatarSelectedStyle(style), children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); handleAvatarClearSelection(); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx("img", { src: style.imageUrl, alt: style.name, className: "w-full h-auto object-cover" }), /* @__PURE__ */ jsx("p", { className: "text-center text-xs p-1 bg-gray-100", children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700 text-center", children: "Or Use a Custom Style" }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Upload a Style Image" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; return setAvatarCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", disabled: !!avatarSelectedStyle } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Text Prompt (Optional)" }), /* @__PURE__ */ jsx( "textarea", { value: avatarTextPrompt, onChange: (e) => setAvatarTextPrompt(e.target.value), placeholder: "Optional: Describe the avatar style you want...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 2 } ) ] }) ] }) ] }), tool.id === "ai-portrait" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-purple-50 border border-purple-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-purple-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " For best results, use a clear photo of a person's face." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Select Gender" }), /* @__PURE__ */ jsxs("div", { className: "flex space-x-4", children: [ /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setPortraitSelectedGender("female"), className: `px-4 py-2 rounded-md border ${portraitSelectedGender === "female" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Female" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setPortraitSelectedGender("male"), className: `px-4 py-2 rounded-md border ${portraitSelectedGender === "male" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Male" } ) ] }) ] }), portraitSelectedGender && /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Choose a Preset Style" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4", children: portraitStyles.filter((style) => style.gender === portraitSelectedGender).map((style) => { const isSelected = (portraitSelectedStyle == null ? void 0 : portraitSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( "div", { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, onClick: () => setPortraitSelectedStyle(style), children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); setPortraitSelectedStyle(null); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx("img", { src: style.imageUrl, alt: style.name, className: "w-full h-auto object-cover" }), /* @__PURE__ */ jsx("p", { className: "text-center text-xs p-1 bg-gray-100", children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Suggested Prompts" }), /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mb-4", children: suggestedPortraitPrompts.map((prompt) => /* @__PURE__ */ jsx( "button", { onClick: () => setPortraitTextPrompt(prompt), className: "px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors", children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-700 text-center", children: "Or Use a Custom Style" }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Upload a Style Image" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; return setPortraitCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", disabled: !!portraitSelectedStyle } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Text Prompt" }), /* @__PURE__ */ jsx( "textarea", { value: portraitTextPrompt, onChange: (e) => setPortraitTextPrompt(e.target.value), placeholder: "Describe the portrait style you want...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 2, disabled: !!portraitSelectedStyle } ) ] }) ] }) ] }), tool.id === "ai-product-photoshoot" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-green-50 border border-green-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-green-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " This tool works best with clear product photos on neutral backgrounds." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Choose a Style" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 max-h-96 overflow-y-auto", children: productStyles.map((style) => { const isSelected = (selectedProductStyle == null ? void 0 : selectedProductStyle.name) === style.name; return /* @__PURE__ */ jsxs( "div", { onClick: () => { setSelectedProductStyle(style); setProductCustomStyleImage(null); }, className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? "border-blue-500 shadow-lg" : "border-transparent hover:border-gray-300"}`, children: [ isSelected && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); handleProductClearSelection(); }, className: "absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform", "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx( "img", { src: style.imageUrl, alt: style.name, className: "w-full h-24 object-cover" } ), /* @__PURE__ */ jsx("div", { className: "p-2 bg-gray-50", children: /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-center", children: style.name }) }) ] }, style.name ); }) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Or Upload a Custom Style Image" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; const file = ((_a = e.target.files) == null ? void 0 : _a[0]) || null; setProductCustomStyleImage(file); if (file) { setSelectedProductStyle(null); } }, className: "block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" } ), productCustomStyleImage && /* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-green-600", children: [ "Custom style image selected: ", productCustomStyleImage.name ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Don't have a style? Try these prompts" }), /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mb-4", children: suggestedPrompts$1.map((prompt) => /* @__PURE__ */ jsx( "button", { onClick: () => setProductTextPrompt(prompt), className: "px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors", children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Text Prompt (Optional)" }), /* @__PURE__ */ jsx( "textarea", { value: productTextPrompt, onChange: (e) => setProductTextPrompt(e.target.value), placeholder: "Describe the style or setting you want for your product photo...", className: "w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent", rows: 3 } ) ] }) ] }), tool.id === "ai-background-generator" && selectedImage.preview && /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Background Description" }), /* @__PURE__ */ jsx( "textarea", { value: backgroundTextPrompt, onChange: (e) => setBackgroundTextPrompt(e.target.value), placeholder: "Describe the background you want to generate...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 3 } ), /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [ /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600 mb-2 block", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-sm text-gray-600 ml-4 list-disc space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "Be specific about scenes, settings, colors, and textures" }), /* @__PURE__ */ jsx("li", { children: "Mention lighting conditions (bright, soft, dramatic, etc.)" }), /* @__PURE__ */ jsx("li", { children: "Include style preferences (realistic, artistic, vintage, etc.)" }), /* @__PURE__ */ jsx("li", { children: 'Example: "Professional studio with soft lighting and neutral background"' }) ] }) ] }) ] }) }), tool.id === "ai-image-generator" && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-3", children: "Image Resolution" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3", children: imageResolutions.map((resolution) => /* @__PURE__ */ jsxs( "div", { className: `cursor-pointer p-3 border-2 rounded-lg transition-colors ${selectedResolution.width === resolution.width && selectedResolution.height === resolution.height ? "border-blue-500 bg-blue-50" : "border-gray-200 hover:border-gray-300"}`, onClick: () => setSelectedResolution(resolution), children: [ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: resolution.name }), /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500", children: resolution.aspectRatio }), /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-400", children: [ resolution.width, "x", resolution.height, " px" ] }) ] }, `${resolution.width}x${resolution.height}` )) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Image Description" }), /* @__PURE__ */ jsx( "textarea", { value: imageGeneratorTextPrompt, onChange: (e) => setImageGeneratorTextPrompt(e.target.value), placeholder: "Describe the image you want to generate in detail (e.g., 'a majestic mountain landscape at sunset', 'portrait of a cat wearing sunglasses', 'abstract digital art with vibrant colors')...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 4 } ), /* @__PURE__ */ jsxs("div", { className: "mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-xs text-blue-700 space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "โ€ข Be specific about style, colors, composition, and artistic elements" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Include details about lighting, mood, and atmosphere" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Mention art styles (realistic, cartoon, anime, oil painting, etc.)" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Add quality descriptors (high quality, detailed, masterpiece, etc.)" }) ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-3", children: "Suggested Prompts" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-2 max-h-64 overflow-y-auto", children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setImageGeneratorTextPrompt(prompt), className: "text-left px-3 py-2 text-sm bg-gray-50 hover:bg-gray-100 rounded-md border transition-colors", children: prompt }, index )) }) ] }) ] }), tool.id === "ai-outfit" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-purple-50 border border-purple-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-purple-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " This tool works best with clear photos of people wearing clothing." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Choose an Outfit Style" }), Object.entries( presetOutfitStyles.reduce((acc, style) => { if (!acc[style.category]) acc[style.category] = []; acc[style.category].push(style); return acc; }, {}) ).map(([category, styles]) => /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [ /* @__PURE__ */ jsx("h4", { className: "text-md font-medium text-gray-700 mb-3", children: category }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3", children: styles.map((style) => /* @__PURE__ */ jsx( "button", { onClick: () => setOutfitTextPrompt(style.prompt), className: "p-3 text-left bg-gray-50 hover:bg-gray-100 rounded-lg border transition-colors", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: style.name }) }, style.name )) }) ] }, category)) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Suggested Outfit Ideas" }), /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mb-4", children: suggestedOutfitPrompts.map((prompt) => /* @__PURE__ */ jsx( "button", { onClick: () => setOutfitTextPrompt(prompt), className: "px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors", children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Outfit Description" }), /* @__PURE__ */ jsx( "textarea", { value: outfitTextPrompt, onChange: (e) => setOutfitTextPrompt(e.target.value), placeholder: "Describe the outfit you want to apply (e.g., 'elegant black evening dress', 'casual denim jacket and jeans', 'professional business suit')...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 4 } ), /* @__PURE__ */ jsxs("div", { className: "mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-xs text-blue-700 space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "โ€ข Be specific about clothing type, style, colors, and materials" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Include details about fit and silhouette (loose, fitted, flowing, etc.)" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Mention specific garments (dress, shirt, pants, jacket, etc.)" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Add style descriptors (casual, formal, vintage, modern, etc.)" }) ] }) ] }) ] }) ] }), tool.id === "ai-image-to-image" && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-blue-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " Upload a main image to transform and optionally a style reference image for visual guidance." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "1. Main Image" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "The image you want to transform" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setI2iMainImage(imageFile), selectedImage: i2iMainImage } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "2. Style Reference Image (Optional)" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "Upload an image to use as style guidance" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setI2iStyleImage(imageFile), selectedImage: i2iStyleImage } ) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: [ "Image Strength: ", i2iStrength.toFixed(1) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "0", max: "1", step: "0.1", value: i2iStrength, onChange: (e) => setI2iStrength(Number(e.target.value)), className: "w-full" } ), /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Higher strength makes the result look more like your main image" }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-gray-700", children: [ "Style Strength: ", i2iStyleStrength.toFixed(1) ] }), /* @__PURE__ */ jsxs("div", { className: "relative group", children: [ /* @__PURE__ */ jsx(HelpCircle, { className: "w-4 h-4 text-gray-400 cursor-help" }), /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10", children: [ "Slider is disabled if no style image has been uploaded", /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800" }) ] }) ] }) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "0", max: "1", step: "0.1", value: i2iStyleStrength, onChange: (e) => setI2iStyleStrength(Number(e.target.value)), disabled: !i2iStyleImage.file, className: "w-full disabled:opacity-50 disabled:cursor-not-allowed" } ), /* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [ "Higher strength makes the result look more like your style image", !i2iStyleImage.file && " (disabled - upload a style image first)" ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Enter Prompt *" }), /* @__PURE__ */ jsx( "textarea", { value: i2iTextPrompt, onChange: (e) => setI2iTextPrompt(e.target.value), placeholder: "Describe the final image you want to create (e.g., 'turn this into a watercolor painting', 'make it look like a vintage photograph', 'transform into a cyberpunk scene')...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 4, required: true } ), /* @__PURE__ */ jsxs("div", { className: "mt-3 bg-green-50 border border-green-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-green-800 mb-2", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-xs text-green-700 space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "โ€ข Be specific about the style, mood, or transformation you want" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Mention artistic styles (watercolor, oil painting, digital art, etc.)" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Include lighting and atmosphere details (dramatic, soft, bright, etc.)" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Use the Image Strength slider to control how much of the original to keep" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Use the Style Strength slider to control style reference influence" }) ] }) ] }) ] }) ] }), tool.id === "ai-sketch-to-image" && /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [ /* @__PURE__ */ jsx("div", { className: "bg-purple-50 border border-purple-200 rounded-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-purple-800", children: [ /* @__PURE__ */ jsx("strong", { children: "Note:" }), " Create or upload a sketch, then describe the final image you want to generate." ] }) }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-3", children: "1. Choose Input Method" }), /* @__PURE__ */ jsxs("div", { className: "flex space-x-4", children: [ /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setS2iInputMode("upload"), className: `px-4 py-2 rounded-md border ${s2iInputMode === "upload" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Upload Sketch" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setS2iInputMode("draw"), className: `px-4 py-2 rounded-md border ${s2iInputMode === "draw" ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: "Draw Sketch" } ) ] }) ] }), s2iInputMode === "upload" ? /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "2. Upload Your Sketch" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "Upload an existing sketch or drawing" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setS2iSketchImage(imageFile), selectedImage: s2iSketchImage } ) ] }) : /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "2. Draw Your Sketch" }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "Use the canvas below to draw your sketch" }), /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /* @__PURE__ */ jsx("label", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Brush Size:" }) }), /* @__PURE__ */ jsx( "input", { type: "range", min: "1", max: "20", value: s2iBrushSize, onChange: (e) => setS2iBrushSize(Number(e.target.value)), className: "flex-1" } ), /* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-600 w-8", children: [ s2iBrushSize, "px" ] }), /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2", children: [ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Color:" }), /* @__PURE__ */ jsx( "input", { type: "color", value: s2iBrushColor, onChange: (e) => setS2iBrushColor(e.target.value), className: "w-8 h-8 rounded border" } ) ] }), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => { const canvas = drawingCanvasRef.current; if (canvas) { const ctx = canvas.getContext("2d"); if (ctx) { ctx.fillStyle = "white"; ctx.fillRect(0, 0, canvas.width, canvas.height); } } }, className: "px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded border", children: "Clear" } ) ] }), /* @__PURE__ */ jsx("div", { className: "border-2 border-gray-300 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsx( "canvas", { ref: drawingCanvasRef, width: 400, height: 400, className: "w-full h-auto cursor-crosshair bg-white", onMouseDown: (e) => { setIsDrawingSketch(true); const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext("2d"); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }, onMouseMove: (e) => { if (!isDrawingSketch) return; const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext("2d"); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = "round"; ctx.stroke(); } } }, onMouseUp: () => setIsDrawingSketch(false), onMouseLeave: () => setIsDrawingSketch(false) } ) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "3. Describe the Final Image *" }), /* @__PURE__ */ jsx( "textarea", { value: s2iTextPrompt, onChange: (e) => setS2iTextPrompt(e.target.value), placeholder: "Describe the final image you want to create from your sketch (e.g., 'a realistic portrait of a woman', 'a fantasy castle in a magical forest', 'a modern car design')...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 4, required: true } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "4. Style Reference Image " }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-3", children: "Upload an image to use as style guidance" }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) => setS2iStyleImage(imageFile), selectedImage: s2iStyleImage } ) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: [ "Sketch Adherence: ", s2iStrength.toFixed(1) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "0", max: "1", step: "0.1", value: s2iStrength, onChange: (e) => setS2iStrength(Number(e.target.value)), className: "w-full" } ), /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Higher values make the result follow your sketch more closely" }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-gray-700", children: [ "Style Strength: ", s2iStyleStrength.toFixed(1) ] }), /* @__PURE__ */ jsxs("div", { className: "relative group", children: [ /* @__PURE__ */ jsx(HelpCircle, { className: "w-4 h-4 text-gray-400 cursor-help" }), /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10", children: [ "This slider is disabled if no style image is present", /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800" }) ] }) ] }) ] }), /* @__PURE__ */ jsx( "input", { type: "range", min: "0", max: "1", step: "0.1", value: s2iStyleStrength, onChange: (e) => setS2iStyleStrength(Number(e.target.value)), disabled: !s2iStyleImage.file, className: "w-full disabled:opacity-50 disabled:cursor-not-allowed" } ), /* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [ "Higher values make the result look more like your style image", !s2iStyleImage.file && " (disabled - upload a style image first)" ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-green-50 border border-green-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-green-800 mb-2", children: "๐Ÿ’ก Tips for better results:" }), /* @__PURE__ */ jsxs("ul", { className: "text-xs text-green-700 space-y-1", children: [ /* @__PURE__ */ jsx("li", { children: "โ€ข Use clear, simple sketches with defined shapes and lines" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Be specific in your text prompt about style, colors, and details" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Higher sketch adherence preserves your drawing structure" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Style images help guide the artistic direction" }), /* @__PURE__ */ jsx("li", { children: "โ€ข Try different combinations of sketch and style strength" }) ] }) ] }) ] }), tool.id === "ai-hairstyle" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Describe the hairstyle you want to try on" }), /* @__PURE__ */ jsx( "textarea", { value: hairstyleTextPrompt, onChange: (e) => setHairstyleTextPrompt(e.target.value), placeholder: "Describe the hairstyle you want to try on...", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none", rows: 3 } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-700 mb-3", children: "Or choose from suggested prompts:" }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-2", children: suggestedHairstylePrompts.map((prompt, index) => /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setHairstyleTextPrompt(prompt), className: "px-3 py-2 text-xs bg-gray-100 hover:bg-blue-100 border border-gray-300 rounded-md transition-colors duration-200 text-left", children: prompt }, index )) }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tip:" }), /* @__PURE__ */ jsx("p", { className: "text-xs text-blue-700", children: "For best results, use a clear, front-facing photo with good lighting." }) ] }) ] }), tool.id === "ai-image-upscaler" && selectedImage.preview && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ imageDimensions && /* @__PURE__ */ jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-gray-800 mb-1", children: "Current Image Size:" }), /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-600", children: [ imageDimensions.width, " x ", imageDimensions.height, "px" ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-3", children: "Select Upscale Factor" }), /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [ /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setUpscaleFactor(2), disabled: !availableUpscaleOptions.includes(2), className: `px-4 py-2 rounded-md border transition-colors ${upscaleFactor === 2 ? "bg-blue-500 text-white border-blue-500" : availableUpscaleOptions.includes(2) ? "bg-white text-gray-700 border-gray-300 hover:bg-gray-50" : "bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed"}`, children: "2X" } ), /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => setUpscaleFactor(4), disabled: !availableUpscaleOptions.includes(4), className: `px-4 py-2 rounded-md border transition-colors ${upscaleFactor === 4 ? "bg-blue-500 text-white border-blue-500" : availableUpscaleOptions.includes(4) ? "bg-white text-gray-700 border-gray-300 hover:bg-gray-50" : "bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed"}`, children: "4X" } ) ] }), availableUpscaleOptions.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-red-600 mt-2", children: "Image is too large for upscaling. Maximum size is 2048px on the longest side." }), availableUpscaleOptions.length === 1 && availableUpscaleOptions[0] === 2 && /* @__PURE__ */ jsx("p", { className: "text-sm text-amber-600 mt-2", children: "Only 2X upscaling is available for images larger than 1024px on the longest side." }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tip:" }), /* @__PURE__ */ jsx("p", { className: "text-xs text-blue-700", children: "AI upscaling works best on photos and detailed images. The larger the upscale factor, the longer the processing time." }) ] }) ] }), tool.id === "ai-filter" && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-3", children: "Filter Category" }), /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: filterCategories.map((category) => /* @__PURE__ */ jsx( "button", { type: "button", onClick: () => { setFilterSelectedCategory(category); setFilterSelectedStyle(null); }, className: `px-3 py-2 rounded-md border text-sm transition-colors ${filterSelectedCategory === category ? "bg-blue-500 text-white border-blue-500" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`, children: category }, category )) }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700", children: "Choose Style" }), filterSelectedStyle && /* @__PURE__ */ jsxs( "button", { type: "button", onClick: handleFilterClearSelection, className: "flex items-center space-x-1 text-xs text-gray-500 hover:text-gray-700 transition-colors", children: [ /* @__PURE__ */ jsx(X, { className: "w-3 h-3" }), /* @__PURE__ */ jsx("span", { children: "Clear Selection" }) ] } ) ] }), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3", children: aiFilterStyles.filter((style) => style.category === filterSelectedCategory).map((style) => /* @__PURE__ */ jsxs( "div", { onClick: () => { setFilterSelectedStyle(style); setFilterUseCustom(false); }, className: `cursor-pointer border-2 rounded-lg overflow-hidden transition-all relative group ${(filterSelectedStyle == null ? void 0 : filterSelectedStyle.id) === style.id ? "border-blue-500 ring-2 ring-blue-200" : "border-gray-200 hover:border-gray-300"}`, children: [ /* @__PURE__ */ jsx( "img", { src: style.imageUrl, alt: style.name, className: "w-full h-24 object-cover", onError: (e) => { const target = e.target; target.src = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2Y3ZjdmNyIvPjx0ZXh0IHg9IjUwIiB5PSI1NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmaWxsPSIjOTk5IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5TdHlsZTwvdGV4dD48L3N2Zz4="; } } ), (filterSelectedStyle == null ? void 0 : filterSelectedStyle.id) === style.id && /* @__PURE__ */ jsx( "button", { type: "button", onClick: (e) => { e.stopPropagation(); handleFilterClearSelection(); }, className: "absolute top-1 right-1 p-1 bg-white rounded-full shadow-md hover:bg-gray-50 transition-colors", title: "Clear Selection", children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-xcircle text-gray-600", children: [ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ jsx("path", { d: "m15 9-6 6" }), /* @__PURE__ */ jsx("path", { d: "m9 9 6 6" }) ] }) } ), /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-gray-800 truncate", children: style.name }) }) ] }, style.id )) }) ] }), /* @__PURE__ */ jsxs("div", { className: "border-t pt-4", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 mb-3", children: [ /* @__PURE__ */ jsx( "input", { type: "checkbox", id: "use-custom-filter", checked: filterUseCustom, onChange: (e) => { setFilterUseCustom(e.target.checked); if (e.target.checked) { setFilterSelectedStyle(null); } }, className: "rounded border-gray-300 text-blue-600 focus:ring-blue-500" } ), /* @__PURE__ */ jsx("label", { htmlFor: "use-custom-filter", className: "text-sm font-medium text-gray-700", children: "Use Custom Style" }) ] }), filterUseCustom && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Upload Style Image (Optional)" }), /* @__PURE__ */ jsx( "input", { type: "file", accept: "image/*", onChange: (e) => { var _a; const file = (_a = e.target.files) == null ? void 0 : _a[0]; setFilterCustomStyleImage(file || null); }, className: "block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" } ) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Text Prompt" }), /* @__PURE__ */ jsx( "textarea", { value: filterTextPrompt, onChange: (e) => setFilterTextPrompt(e.target.value), placeholder: "Describe the style you want to apply...", rows: 3, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3", children: [ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-blue-800 mb-2", children: "๐Ÿ’ก Tip:" }), /* @__PURE__ */ jsx("p", { className: "text-xs text-blue-700", children: "Choose from preset styles for quick results, or use custom style with text prompts for unique artistic effects." }) ] }) ] }), /* @__PURE__ */ jsx( Button, { onClick: tool.id === "ai-cleanup" ? handleAICleanupGenerate : tool.id === "ai-expand" ? handleAIExpandGenerate : tool.id === "ai-replace" ? handleAIReplaceGenerate : tool.id === "ai-cartoon" ? handleAICartoonGenerate : tool.id === "ai-caricature" ? handleAICaricatureGenerate : tool.id === "ai-avatar" ? handleAIAvatarGenerate : tool.id === "ai-portrait" ? handleAIPortraitGenerate : tool.id === "ai-face-swap" ? handleAIFaceSwapGenerate : tool.id === "ai-product-photoshoot" ? handleAIProductPhotoshootGenerate : tool.id === "ai-background-generator" ? handleAIBackgroundGeneratorGenerate : tool.id === "ai-image-generator" ? handleAIImageGeneratorGenerate : tool.id === "ai-outfit" ? handleAIOutfitGenerate : tool.id === "ai-image-to-image" ? handleAIImageToImageGenerate : tool.id === "ai-sketch-to-image" ? handleAISketchToImageGenerate : tool.id === "ai-hairstyle" ? handleAIHairstyleGenerate : tool.id === "ai-image-upscaler" ? handleAIUpscalerGenerate : tool.id === "ai-filter" ? handleAIFilterGenerate : handleProcessImage, disabled: processedImage.isLoading || tool.id !== "ai-image-generator" && tool.id !== "ai-face-swap" && tool.id !== "ai-image-to-image" && tool.id !== "ai-sketch-to-image" && !selectedImage.file || tool.id === "ai-replace" && !textPrompt.trim() || tool.id === "ai-background-generator" && !backgroundTextPrompt.trim() || tool.id === "ai-image-generator" && !imageGeneratorTextPrompt.trim() || tool.id === "ai-cartoon" && !(selectedPresetUrl || (cartoonStyleImage == null ? void 0 : cartoonStyleImage.name)) || tool.id === "ai-caricature" && !caricatureSelectedStyle && !caricatureCustomStyleImage || tool.id === "ai-avatar" && !avatarSelectedStyle && !avatarCustomStyleImage || tool.id === "ai-portrait" && !portraitSelectedStyle && !portraitCustomStyleImage || tool.id === "ai-face-swap" && (!faceSwapTargetImage.file || !selectedFaceSwapPreset && !faceSwapSourceImage.file) || tool.id === "ai-product-photoshoot" && !selectedProductStyle && !productCustomStyleImage && !productTextPrompt || tool.id === "ai-outfit" && (!selectedImage.file || !outfitTextPrompt.trim()) || tool.id === "ai-image-to-image" && (!i2iMainImage.file || !i2iTextPrompt.trim()) || tool.id === "ai-sketch-to-image" && (s2iInputMode === "upload" && !s2iSketchImage.file || !s2iTextPrompt.trim()) || tool.id === "ai-hairstyle" && (!selectedImage.file || !hairstyleTextPrompt.trim()) || tool.id === "ai-image-upscaler" && (!selectedImage.file || availableUpscaleOptions.length === 0) || tool.id === "ai-filter" && (!selectedImage.file || !filterSelectedStyle && !filterCustomStyleImage && !filterTextPrompt.trim()), className: "w-full", children: processedImage.isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(Loader, { className: "w-4 h-4 mr-2 animate-spin" }), "Generating..." ] }) : `Generate ${tool.name}` } ) ] }), /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: "Result" }), processedImage.isLoading ? /* @__PURE__ */ jsxs("div", { className: "border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center", children: [ /* @__PURE__ */ jsx(Loader, { className: "w-10 h-10 text-blue-500 animate-spin mb-4" }), /* @__PURE__ */ jsx("p", { className: "text-gray-700", children: "Processing your image..." }) ] }) : processedImage.url ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [ /* @__PURE__ */ jsx("div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ jsx( "img", { src: processedImage.url, alt: "Processed result", className: "w-full h-auto" } ) }), /* @__PURE__ */ jsx( Button, { fullWidth: true, onClick: handleDownload, leftIcon: /* @__PURE__ */ jsx(Download, { size: 18 }), children: "Download Result" } ) ] }) : processedImage.error ? /* @__PURE__ */ jsxs("div", { className: "border-2 border-dashed border-red-300 bg-red-50 rounded-lg p-8 flex flex-col items-center justify-center", children: [ /* @__PURE__ */ jsx("p", { className: "text-red-600 mb-2", children: "Error" }), /* @__PURE__ */ jsx("p", { className: "text-gray-700 text-center", children: processedImage.error }) ] }) : /* @__PURE__ */ jsx("div", { className: "border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center", children: /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: "Upload and process an image to see the result here" }) }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "mt-12 bg-gray-50 rounded-lg p-6", children: [ /* @__PURE__ */ jsxs("h2", { className: "text-xl font-semibold mb-4", children: [ "About ", tool.name ] }), /* @__PURE__ */ jsxs("p", { className: "text-gray-700 mb-4", children: [ "Our ", tool.name.toLowerCase(), " tool uses advanced AI algorithms to ", getToolDescription(tool), ". This tool is perfect for photographers, designers, social media managers, and anyone who wants to enhance their images." ] }), /* @__PURE__ */ jsx("p", { className: "text-gray-700", children: "Unlike other tools, ModernPhotoTools offers this service completely free with no watermarks. Try it now and see the difference!" }) ] }) ] }) }) ] }); }; function getToolDescription(tool) { switch (tool.id) { case "remove-background": return "automatically detect and remove backgrounds from any image, leaving you with a clean subject that can be placed on any new background"; case "ai-cleanup": return "automatically detect and fix imperfections, remove unwanted objects, and enhance the overall quality of your photos. Simply paint over the areas you want to remove and let AI intelligently fill in the space"; case "ai-expand": return "intelligently expand your images beyond their original boundaries, adding realistic content that matches the original image"; case "ai-replace": return "replace objects or areas in your images with AI-generated content that seamlessly blends with the rest of the image"; case "ai-cartoon": return "transform your photos into cartoon-style artwork with various artistic styles"; case "ai-portrait": return "create realistic portrait transformations with professional styling and artistic effects"; case "ai-face-swap": return "seamlessly swap faces between two images, allowing you to replace faces in photos with either preset faces or custom source images"; case "ai-product-photoshoot": return "create professional product photography with AI-generated backgrounds and lighting that make your products look stunning"; case "ai-background-generator": return "generate stunning new backgrounds for your images using AI, perfect for creating professional-looking photos with custom scenes"; case "ai-outfit": return "virtually change clothing on people in photos using AI, allowing you to transform outfits with simple text descriptions"; case "ai-image-to-image": return "transform any image based on text prompts and optional style references, with adjustable strength controls for precise artistic control"; case "ai-hairstyle": return "virtually try on new hairstyles by uploading a photo and describing the desired look, perfect for experimenting with different hair styles and colors"; case "ai-image-upscaler": return "enhance image resolution and quality using advanced AI upscaling technology, supporting 2x and 4x enlargement while preserving fine details and sharpness"; default: return "transform and enhance your images with professional-quality results"; } } const AboutPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "About Us", description: "Learn about ModernPhotoTools.com, our mission, and how we're making professional photo editing accessible to everyone with AI-powered tools." } ), /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsxs("h1", { className: "text-4xl md:text-5xl font-bold text-gray-900 mb-6", children: [ "About ", /* @__PURE__ */ jsx("span", { className: "text-blue-600", children: "ModernPhotoTools" }) ] }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-700 mb-8", children: "Making professional photo editing accessible to everyone through the power of AI" }) ] }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-white", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "prose prose-lg max-w-none text-gray-700", children: [ /* @__PURE__ */ jsx("h2", { children: "Our Mission" }), /* @__PURE__ */ jsx("p", { children: "At ModernPhotoTools.com, we believe that everyone should have access to professional-quality photo editing tools, regardless of their technical skills or budget. Our mission is to democratize photo editing by leveraging the power of artificial intelligence to make complex editing tasks simple and accessible." }), /* @__PURE__ */ jsx("h2", { children: "What We Offer" }), /* @__PURE__ */ jsx("p", { children: "We provide a comprehensive suite of AI-powered photo editing tools that can help you transform your images in seconds. From removing backgrounds to generating completely new images with AI, our tools are designed to save you time and effort while delivering professional results." }), /* @__PURE__ */ jsx("p", { children: "All our tools are:" }), /* @__PURE__ */ jsxs("ul", { children: [ /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Free to use" }), " - No hidden fees or subscriptions" ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Easy to use" }), " - No technical skills required" ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Fast" }), " - Get results in seconds" ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "High quality" }), " - Professional-grade output" ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Private" }), " - We respect your privacy" ] }) ] }), /* @__PURE__ */ jsx("h2", { children: "Why Choose ModernPhotoTools" }), /* @__PURE__ */ jsx("p", { children: "In a world where visual content is increasingly important, having access to powerful editing tools can make a significant difference. Whether you're a professional photographer, a social media manager, a small business owner, or just someone who wants to enhance their personal photos, our tools can help you achieve your goals without the steep learning curve or high cost of traditional photo editing software." }), /* @__PURE__ */ jsx("h2", { children: "Our Technology" }), /* @__PURE__ */ jsx("p", { children: "We use cutting-edge AI technology powered to deliver fast and accurate results. Our tools are constantly being improved to ensure that you always have access to the latest advancements in AI-powered photo editing." }), /* @__PURE__ */ jsx("h2", { children: "Get Started Today" }), /* @__PURE__ */ jsx("p", { children: "Ready to transform your photos? Explore our tools and see what you can create!" }) ] }) }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-blue-600", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold text-white mb-6", children: "Ready to Transform Your Photos?" }), /* @__PURE__ */ jsx("p", { className: "text-blue-100 mb-8", children: "Join thousands of users who enhance their photos with our AI-powered tools every day." }), /* @__PURE__ */ jsx(Link, { to: "/tools", children: /* @__PURE__ */ jsx(Button, { size: "lg", variant: "secondary", children: "Explore Our Tools" }) }) ] }) }) }) ] }); }; const ContactPage = () => { const [formData, setFormData] = useState({ name: "", email: "", message: "" }); const [formStatus, setFormStatus] = useState({ success: false, message: "", submitted: false }); const handleChange = (e) => { const { name, value } = e.target; setFormData((prev) => ({ ...prev, [name]: value })); }; const handleSubmit = (e) => { e.preventDefault(); if (!formData.name || !formData.email || !formData.message) { setFormStatus({ success: false, message: "Please fill out all fields.", submitted: true }); return; } const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { setFormStatus({ success: false, message: "Please enter a valid email address.", submitted: true }); return; } setTimeout(() => { setFormStatus({ success: true, message: "Your message has been sent. We'll get back to you soon!", submitted: true }); setFormData({ name: "", email: "", message: "" }); }, 1e3); }; return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Contact Us", description: "Have questions or feedback? Contact the ModernPhotoTools.com team. We're here to help with any inquiries about our AI photo editing tools." } ), /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-12", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [ /* @__PURE__ */ jsxs("div", { className: "text-center mb-12", children: [ /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-4xl font-bold text-gray-900 mb-4", children: "Contact Us" }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600", children: "Have questions or feedback? We'd love to hear from you." }) ] }), /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-12", children: [ /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold text-gray-900 mb-4", children: "Get in Touch" }), /* @__PURE__ */ jsx("p", { className: "text-gray-700 mb-6", children: "We're here to help with any questions or feedback you might have about our tools or services." }), /* @__PURE__ */ jsxs("div", { className: "bg-blue-50 rounded-lg p-6", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-start mb-4", children: [ /* @__PURE__ */ jsx(Mail, { className: "w-5 h-5 text-blue-600 mr-3 mt-1" }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium text-gray-900", children: "Email Us" }), /* @__PURE__ */ jsx("p", { className: "text-gray-700", children: "support@modernphototools.com" }) ] }) ] }), /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600", children: "We typically respond within 24-48 hours during business days." }) ] }) ] }), /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold text-gray-900 mb-4", children: "Send a Message" }), formStatus.submitted && /* @__PURE__ */ jsx("div", { className: `mb-6 p-4 rounded-lg ${formStatus.success ? "bg-green-50 text-green-800" : "bg-red-50 text-red-800"}`, children: formStatus.message }), /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, children: [ /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [ /* @__PURE__ */ jsx("label", { htmlFor: "name", className: "block text-gray-700 font-medium mb-1", children: "Your Name" }), /* @__PURE__ */ jsx( "input", { type: "text", id: "name", name: "name", value: formData.name, onChange: handleChange, className: "w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", placeholder: "John Doe" } ) ] }), /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [ /* @__PURE__ */ jsx("label", { htmlFor: "email", className: "block text-gray-700 font-medium mb-1", children: "Your Email" }), /* @__PURE__ */ jsx( "input", { type: "email", id: "email", name: "email", value: formData.email, onChange: handleChange, className: "w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", placeholder: "john.doe@example.com" } ) ] }), /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [ /* @__PURE__ */ jsx("label", { htmlFor: "message", className: "block text-gray-700 font-medium mb-1", children: "Your Message" }), /* @__PURE__ */ jsx( "textarea", { id: "message", name: "message", value: formData.message, onChange: handleChange, rows: 5, className: "w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", placeholder: "How can we help you?" } ) ] }), /* @__PURE__ */ jsx( Button, { type: "submit", fullWidth: true, leftIcon: /* @__PURE__ */ jsx(Send, { size: 18 }), children: "Send Message" } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "mt-12 p-6 bg-gray-50 rounded-lg", children: [ /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-4", children: "Privacy Notice" }), /* @__PURE__ */ jsxs("p", { className: "text-gray-700 text-sm", children: [ "By submitting this form, you agree to our ", /* @__PURE__ */ jsx(Link, { to: "/privacy-policy", className: "text-blue-600 hover:underline", children: "Privacy Policy" }), ". We collect and process your personal data only for the purpose of responding to your inquiry. Your information will not be shared with third parties without your consent." ] }) ] }) ] }) }) ] }); }; const NotFoundPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Page Not Found", description: "Sorry, the page you are looking for could not be found." } ), /* @__PURE__ */ jsx("div", { className: "min-h-[60vh] flex items-center", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-12 text-center", children: [ /* @__PURE__ */ jsx("h1", { className: "text-6xl font-bold text-gray-900 mb-4", children: "404" }), /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold text-gray-800 mb-6", children: "Page Not Found" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600 max-w-md mx-auto mb-8", children: "Sorry, the page you are looking for doesn't exist or has been moved." }), /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row justify-center gap-4", children: [ /* @__PURE__ */ jsx(Link, { to: "/", children: /* @__PURE__ */ jsx(Button, { leftIcon: /* @__PURE__ */ jsx(Home, { size: 18 }), children: "Back to Home" }) }), /* @__PURE__ */ jsx(Link, { to: "/tools", children: /* @__PURE__ */ jsx(Button, { variant: "outline", leftIcon: /* @__PURE__ */ jsx(Search, { size: 18 }), children: "Explore Tools" }) }) ] }) ] }) }) ] }); }; const blogArticles = [ { id: "ai-image-enhancement-guide", title: "AI Image Enhancement: Transform Your Photos with Artificial Intelligence", excerpt: "Discover how AI-powered image enhancement can transform your photos. Learn about the best tools, techniques, and workflows for professional results.", content: `# AI Image Enhancement: Transform Your Photos with Artificial Intelligence Artificial Intelligence has revolutionized photo editing, making professional-quality image enhancement accessible to everyone. Whether you're a photographer, content creator, or someone who simply wants to improve their photos, AI-powered tools can transform ordinary images into stunning visuals with just a few clicks. In this comprehensive guide, we'll explore how AI image enhancement works, the best tools available, and practical techniques to get the most out of this technology. ## What is AI Image Enhancement? AI image enhancement uses machine learning algorithms trained on millions of images to automatically improve photo quality. These systems can: - **Upscale resolution** without losing quality - **Reduce noise** and grain - **Enhance colors** and contrast - **Sharpen details** intelligently - **Fix lighting issues** automatically - **Remove unwanted objects** seamlessly - **Restore old or damaged photos** ## How AI Image Enhancement Works ### Machine Learning Fundamentals AI enhancement tools use deep neural networks trained on vast datasets of high-quality images. The process involves: 1. **Training Phase:** AI learns from millions of before/after image pairs 2. **Pattern Recognition:** Identifies common image problems and solutions 3. **Real-time Processing:** Applies learned improvements to new images 4. **Quality Assessment:** Evaluates and refines results automatically ### Types of AI Enhancement **Generative AI:** Creates new pixel data to improve images **Discriminative AI:** Analyzes and corrects existing pixel information **Hybrid Approaches:** Combines multiple AI techniques for optimal results ## Top AI Image Enhancement Tools ### 1. Photo AI Enhancer Our [AI-powered image enhancer](/tools/ai-image-enhancer) offers professional-quality results with ease: **Key Features:** - **One-click enhancement** - **Multiple enhancement modes** - **Batch processing capabilities** - **High-resolution output** - **Free to use** **How to Use:** 1. Upload your image to [Photo AI Enhancer](/tools/ai-image-enhancer) 2. Select enhancement type 3. Let AI process your image 4. Download enhanced result **Best For:** Quick enhancements, batch processing, beginners ### 2. Topaz Gigapixel AI **Specialization:** Image upscaling and resolution enhancement **Strengths:** Exceptional detail preservation, multiple AI models **Pricing:** Paid software with free trial ### 3. Adobe Camera Raw with AI **Integration:** Built into [Photoshop](https://www.adobe.com/products/photoshop.html) and [Lightroom](https://www.adobe.com/products/photoshop-lightroom.html) **Features:** AI-powered masking, sky replacement, noise reduction **Best For:** Professional photographers, Adobe ecosystem users ### 4. Luminar AI **Focus:** Creative AI enhancements **Unique Features:** Sky AI, Portrait AI, Body AI **Approach:** Artistic enhancement with AI assistance ### 5. Upscayl (Open Source) **Advantages:** **Free**, **open-source**, **privacy-focused** **Limitations:** Requires technical setup **Best For:** Privacy-conscious users, developers ## Practical AI Enhancement Techniques ### Portrait Enhancement **Skin Smoothing:** - Use AI to reduce blemishes naturally - Maintain skin texture authenticity - Avoid over-processing **Eye Enhancement:** - Brighten and sharpen eyes - Enhance iris details - Remove red-eye automatically **Hair Detail Recovery:** - Restore fine hair details - Enhance texture and shine - Fix flyaway hairs ### Landscape Photography **Sky Enhancement:** - Boost cloud definition - Enhance sunset/sunrise colors - Balance exposure automatically **Detail Sharpening:** - Enhance distant objects - Improve texture definition - Maintain natural appearance **Color Grading:** - Automatic color correction - Mood-based adjustments - Seasonal color enhancement ### Product Photography **Background Cleanup:** - Remove distracting elements - Enhance product focus - Create consistent backgrounds **Detail Enhancement:** - Sharpen product features - Enhance material textures - Improve color accuracy ### Old Photo Restoration **Damage Repair:** - Fix scratches and tears - Remove stains and spots - Restore faded areas **Quality Improvement:** - Reduce grain and noise - Enhance sharpness - Improve color accuracy ## Advanced AI Enhancement Workflows ### Multi-Stage Processing 1. **Initial Assessment:** Analyze image problems 2. **Primary Enhancement:** Apply main AI improvements 3. **Selective Adjustments:** Target specific areas 4. **Quality Check:** Review and refine results 5. **Final Output:** Export optimized image ### Combining AI Tools **Workflow Example:** 1. Use AI upscaling for resolution 2. Apply AI noise reduction 3. Enhance with AI color grading 4. Fine-tune with traditional editing ### Batch Processing Strategies **Consistent Results:** - Use same AI model for similar images - Create processing templates - Maintain quality standards **Efficiency Tips:** - Process similar images together - Use appropriate AI models - Monitor processing quality ## Best Practices for AI Enhancement ### Do's 1. **Start with high-quality originals** when possible 2. **Choose appropriate AI models** for your image type 3. **Review results carefully** before finalizing 4. **Maintain backup copies** of original images 5. **Combine AI with manual adjustments** for best results ### Don'ts 1. **Don't over-enhance** - maintain natural appearance 2. **Don't rely solely on AI** - human judgment is important 3. **Don't ignore image context** - consider final use 4. **Don't skip quality checks** - AI isn't perfect 5. **Don't forget about file formats** - choose appropriate output ## Understanding AI Enhancement Limitations ### What AI Does Well - **Pattern Recognition:** Identifying common image problems - **Noise Reduction:** Removing grain and digital artifacts - **Upscaling:** Increasing resolution intelligently - **Color Correction:** Automatic color balance - **Detail Enhancement:** Sharpening without artifacts ### Current Limitations - **Creative Decisions:** AI can't replace artistic vision - **Context Understanding:** May miss image-specific needs - **Extreme Damage:** Severely corrupted images may not improve - **Style Preferences:** Personal taste varies - **Processing Time:** Complex enhancements take time ## Future of AI Image Enhancement ### Emerging Trends **Real-time Processing:** Instant enhancement during capture **Personalized AI:** Models trained on individual preferences **Multi-modal AI:** Understanding image content and context **Edge Computing:** AI processing on mobile devices ### Expected Improvements - Better understanding of image context - More natural-looking results - Faster processing speeds - Lower computational requirements - Improved accessibility ## Choosing the Right AI Tool ### Consider Your Needs **Casual Users:** Simple, one-click solutions **Professionals:** Advanced controls and batch processing **Specific Tasks:** Specialized tools for particular enhancements **Budget:** Free vs. paid options ### Evaluation Criteria 1. **Quality of Results:** Test with your typical images 2. **Ease of Use:** Interface and workflow efficiency 3. **Processing Speed:** Time requirements for your volume 4. **Cost:** One-time vs. subscription pricing 5. **Support:** Documentation and customer service ## Practical Tips for Better Results ### Image Preparation - **Clean your lens** before shooting - **Use proper exposure** when possible - **Shoot in RAW format** for maximum flexibility - **Consider composition** - AI can't fix poor framing ### Enhancement Strategy - **Start subtle** and build up enhancements - **Focus on problem areas** first - **Maintain image authenticity** - **Consider final output size** and format ### Quality Control - **View at 100% zoom** to check details - **Test different AI models** for comparison - **Save multiple versions** for comparison - **Get second opinions** when possible ## Conclusion AI image enhancement has democratized professional-quality photo editing, making it accessible to everyone regardless of technical skill level. While AI tools are incredibly powerful, they work best when combined with human creativity and judgment. The key to successful AI enhancement is understanding what each tool does well and choosing the right approach for your specific needs. Start with simple enhancements and gradually explore more advanced techniques as you become comfortable with the technology. For professional results, try our [AI Image Enhancer](/tools/ai-image-enhancer) or explore our [AI Background Generator](/tools/ai-background-generator) to create stunning backgrounds for your enhanced photos. Remember that AI is a tool to enhance your creative vision, not replace it. The best results come from combining AI capabilities with your artistic eye and understanding of what makes a great image. **Ready to enhance your photos with AI?** Try our [free AI image enhancer](/tools/ai-image-enhancer) and discover how artificial intelligence can transform your photography!`, publishDate: "2025-07-15", readTime: "16 min read", category: "tools", featuredImage: "/images/blog/ai-image-enhancement.svg", relatedTool: "ai-image-enhancer" }, { id: "studio-ghibli-ai-art-guide", title: "How to Make Studio Ghibli AI Art: Step-by-Step Guide", excerpt: "Transform your photos into magical Studio Ghibli-style artwork using AI tools. Complete guide with tips, tricks, and best practices.", content: `# How to Make Studio Ghibli AI Art: Step-by-Step Guide Studio Ghibli's enchanting art style has captivated audiences worldwide with its dreamy landscapes, whimsical characters, and magical atmospheres. Thanks to advances in AI technology, you can now transform your own photos and ideas into beautiful Studio Ghibli-inspired artwork. This comprehensive guide will walk you through everything you need to know about creating Studio Ghibli AI art, from understanding the distinctive style to using the best tools and techniques. ## Understanding Studio Ghibli Art Style ### Key Visual Elements Studio Ghibli films are renowned for their distinctive artistic characteristics: **Color Palette:** - **Soft, muted earth tones** - **Warm greens and blues** - **Golden hour lighting effects** - **Pastel sky gradients** - **Rich, saturated nature colors** **Composition Elements:** - Sweeping landscapes with rolling hills - Detailed architectural elements - Lush vegetation and forests - Floating islands and magical elements - Characters integrated naturally into environments **Artistic Techniques:** - **Hand-painted watercolor textures** - **Soft, organic line work** - **Atmospheric perspective** - **Detailed background elements** - **Whimsical, fantastical elements** ### Iconic Ghibli Themes - **Nature and Environment:** Forests, meadows, and natural landscapes - **Architecture:** Traditional Japanese buildings, castles, and fantastical structures - **Transportation:** Flying machines, trains, and magical vehicles - **Characters:** Expressive faces with large eyes and distinctive clothing - **Magical Elements:** Spirits, floating objects, and otherworldly phenomena ## Best AI Tools for Studio Ghibli Art ### 1. Photo By AI Art Generator Our [AI art generator](/tools/ai-art-generator) excels at creating Studio Ghibli-style artwork: **Features:** - **Dedicated Ghibli art style presets** - **High-resolution output** - **Multiple aspect ratios** - **Batch processing capabilities** - **Free to use** **How to Use:** 1. Visit [AI Filter](/tools/ai-filter) 2. Upload your reference image or start from scratch 3. Select "Studio Ghibli" style preset 4. Adjust settings and parameters 5. Generate and download your artwork ### 2. Midjourney **Strengths:** Exceptional artistic quality and style consistency **Best For:** Detailed landscapes and character art **Pricing:** Subscription-based **Effective Prompts:** - "Studio Ghibli style landscape" - "Miyazaki anime art style" - "Ghibli movie scene" ### 3. Stable Diffusion **Advantages:** **Open-source**, **customizable**, **free** **Best For:** Users comfortable with technical setup **Models:** Specialized Ghibli-trained models available ### 4. DALL-E 3 **Strengths:** **Excellent prompt understanding** **Best For:** Specific scene creation **Access:** Through [ChatGPT Plus](https://openai.com/chatgpt) or API ## Step-by-Step Creation Process ### Method 1: Photo-to-Ghibli Transformation **Step 1: Choose Your Source Image** - Select photos with **interesting landscapes** - Ensure **good composition and lighting** - Avoid cluttered or busy backgrounds - Consider images with **natural elements** **Step 2: Prepare Your Image** - Crop to desired aspect ratio - Adjust basic exposure if needed - Remove distracting elements - Enhance key focal points **Step 3: Apply AI Transformation** 1. Upload to your chosen AI tool 2. Select **Studio Ghibli style preset** 3. Adjust strength/intensity settings 4. Generate multiple variations 5. Select the best result **Step 4: Refine and Enhance** - Fine-tune colors and contrast - Add magical elements if desired - Enhance atmospheric effects - Adjust saturation for Ghibli feel ### Method 2: Text-to-Image Generation **Step 1: Craft Effective Prompts** Successful Ghibli prompts include: - **Style references:** "Studio Ghibli style", "Miyazaki anime" - **Scene descriptions:** "Rolling green hills", "ancient forest" - **Atmospheric elements:** "Golden hour lighting", "misty morning" - **Specific details:** "Traditional Japanese village", "floating castle" **Example Prompts:** - "Studio Ghibli style landscape with rolling green hills, ancient oak tree, golden hour lighting, soft watercolor style" - "Miyazaki anime style village with traditional houses, flower gardens, blue sky with fluffy clouds" - "Ghibli movie scene of a magical forest with glowing spirits, moss-covered trees, ethereal lighting" **Step 2: Generate and Iterate** 1. Start with basic prompt 2. Generate multiple variations 3. Refine prompt based on results 4. Experiment with different parameters 5. Save promising generations **Step 3: Post-Processing** - Enhance colors to match Ghibli palette - Add soft, dreamy effects - Adjust contrast for painted look - Fine-tune atmospheric elements ## Advanced Techniques ### Prompt Engineering for Better Results **Effective Keywords:** - "Studio Ghibli", "Miyazaki", "Ghibli movie" - "Watercolor painting", "soft brushstrokes" - "Dreamy", "whimsical", "magical" - "Pastoral", "idyllic", "serene" **Technical Terms:** - "Cel shading", "anime style" - "Soft lighting", "atmospheric perspective" - "Hand-painted texture", "traditional animation" **Composition Guidance:** - "Wide landscape view", "bird's eye perspective" - "Foreground, midground, background" - "Leading lines", "rule of thirds" ### Color Grading Techniques **Ghibli Color Characteristics:** 1. **Warm Highlights:** Golden, peachy tones 2. **Cool Shadows:** Soft blues and purples 3. **Saturated Greens:** Rich, natural vegetation colors 4. **Soft Contrasts:** Avoid harsh black and white 5. **Atmospheric Haze:** Subtle blue-gray in distance **Post-Processing Steps:** 1. Reduce overall contrast slightly 2. Warm up highlights 3. Cool down shadows 4. Enhance green and blue saturation 5. Add subtle film grain for texture ### Creating Character Art **Character Design Elements:** - **Large, expressive eyes** - **Soft, rounded features** - **Natural hair colors and styles** - **Simple, comfortable clothing** - **Gentle, kind expressions** **Effective Character Prompts:** - "Ghibli style character, young girl with brown hair, kind eyes, simple dress" - "Studio Ghibli boy character, curious expression, adventure clothing" - "Miyazaki style elderly character, wise face, traditional clothing" ## Common Challenges and Solutions ### Challenge 1: Inconsistent Style **Problem:** Generated art doesn't match Ghibli aesthetic **Solutions:** - Use more **specific style keywords** - Reference **specific Ghibli films** - Adjust generation parameters - Try different AI models ### Challenge 2: Over-detailed Results **Problem:** AI generates too much detail, losing Ghibli simplicity **Solutions:** - Add "simple", "clean" to prompts - Reduce detail parameters - Use style strength adjustments - Post-process to simplify ### Challenge 3: Wrong Color Palette **Problem:** Colors don't match Ghibli films **Solutions:** - Specify **color preferences** in prompts - Use **color grading** in post-processing - Reference specific Ghibli color schemes - Adjust saturation and warmth ### Challenge 4: Lack of Magical Elements **Problem:** Results look too realistic **Solutions:** - Add **fantasy elements** to prompts - Include "magical", "whimsical" keywords - Reference specific Ghibli magical elements - Enhance with post-processing effects ## Inspiration from Specific Ghibli Films ### My Neighbor Totoro - **Lush green forests** - **Traditional Japanese countryside** - **Gentle, friendly spirits** - **Warm, family-oriented scenes** ### Spirited Away - **Magical bathhouse architecture** - **Spirit world creatures** - **Rich, detailed environments** - **Mysterious, otherworldly atmosphere** ### Castle in the Sky - **Floating islands and castles** - **Steampunk mechanical elements** - **Vast sky scenes** - **Adventure and exploration themes** ### Princess Mononoke - **Ancient forests and nature spirits** - **Conflict between nature and industry** - **Detailed creature designs** - **Epic, sweeping landscapes** ### Howl's Moving Castle - **Fantastical architecture** - **Magical transformations** - **Romantic, dreamy atmosphere** - **Intricate mechanical designs** ## Tips for Better Results ### Photography Tips for Source Images 1. **Golden Hour Shooting:** Capture during sunrise or sunset 2. **Natural Landscapes:** Focus on forests, hills, and meadows 3. **Interesting Architecture:** Traditional or unique buildings 4. **Clear Skies:** Dramatic clouds or clear blue skies work well 5. **Foreground Interest:** Include interesting foreground elements ### Prompt Optimization 1. **Be Specific:** Include detailed scene descriptions 2. **Use Style Keywords:** Always include Ghibli-related terms 3. **Describe Mood:** Include emotional and atmospheric descriptors 4. **Specify Quality:** Add terms like "high quality", "detailed" 5. **Experiment:** Try variations of successful prompts ### Post-Processing Enhancement 1. **Color Harmony:** Ensure colors work together 2. **Soft Edges:** Reduce harsh lines and edges 3. **Atmospheric Effects:** Add subtle haze or glow 4. **Texture Enhancement:** Add painted or watercolor effects 5. **Final Polish:** Adjust overall brightness and contrast ## Sharing and Using Your Ghibli Art ### Best Practices - **Credit AI Tools:** Mention the AI tool used - **Respect Copyright:** Don't claim as original Ghibli work - **Share Process:** Document your creation process - **Engage Community:** Join AI art communities ### Usage Ideas - **Social Media:** Share on [Instagram](https://www.instagram.com/), [Twitter](https://twitter.com/), [Pinterest](https://www.pinterest.com/) - **Personal Projects:** Use for wallpapers, prints - **Creative Inspiration:** Inspire your own artwork - **Storytelling:** Create visual narratives ## Conclusion Creating Studio Ghibli-style AI art is an exciting way to explore the intersection of technology and artistic expression. While AI tools make it easier than ever to achieve this distinctive style, the key to success lies in understanding what makes Ghibli art special and learning to guide AI tools effectively. Remember that the best results come from experimentation and iteration. Don't be afraid to try different approaches, adjust your prompts, and refine your techniques. Each generation is an opportunity to learn and improve. For even more creative possibilities, try our [AI Background Generator](/tools/ai-background-generator) to create magical Ghibli-inspired backgrounds for your artwork. Whether you're transforming personal photos into magical landscapes or creating entirely new Ghibli-inspired worlds, the most important thing is to have fun and let your creativity flow. **Ready to create your own Studio Ghibli masterpiece?** Try our [AI art generator](/tools/ai-art-generator) and bring the magic of Ghibli to your own images!`, publishDate: "2025-02-28", readTime: "8 min read", category: "general", featuredImage: "/images/blog/studio-ghibli-ai-art.svg" }, { id: "ai-background-generators-2025", title: "13 Best AI Background Generators in 2025", excerpt: "Discover the top AI background generators that can transform your photos with stunning, professional backgrounds in seconds.", content: `# 13 Best AI Background Generators in 2025 **AI background generators** have revolutionized photo editing, making it easier than ever to create stunning visuals with professional backgrounds. Whether you're a content creator, marketer, or photography enthusiast, these tools can transform your images in seconds. ## Why Use AI Background Generators? - **Time-saving**: Generate backgrounds instantly - **Cost-effective**: No need for expensive photo shoots - **Versatile**: Create any environment imaginable - **Professional quality**: High-resolution, realistic results - **Easy to use**: No advanced editing skills required ## Top 13 AI Background Generators 1. Photo [AI Background Generator](/tools/ai-background-generator) Our own **AI Background Generator** offers: - **Instant background creation** - **Multiple style options** - **High-quality results** - **User-friendly interface** - **Free to use** **Best for**: Quick background changes, product photography, social media content **Pro Tip**: Combine with our [Background Remover](/tools/background-remover) for complete background control! 2. [Canva](https://www.canva.com) Background Remover **Canva's AI-powered background tools** integrate seamlessly with their design platform: - **Integrated with design tools** - **Template library** with thousands of options - **Collaboration features** for team projects - **Magic Eraser** for precise background removal **Best for**: Social media graphics, presentations, marketing materials 3. [Remove.bg](https://www.remove.bg) **Specialized in background removal** with AI precision: - **Automatic background detection** - **API integration** for developers - **Bulk processing** capabilities - **High-quality edge detection** **Best for**: E-commerce product photos, profile pictures 4. [Adobe Firefly](https://www.adobe.com/products/firefly.html) **Adobe's generative AI** brings professional capabilities: - **Advanced AI capabilities** - **Creative Cloud integration** - **Professional-grade results** - **Generative fill** technology **Best for**: Professional photographers, creative agencies 5. [Fotor](https://www.fotor.com) Background Generator **One-click background transformation**: - **AI-powered background change** - **Multiple categories** (nature, urban, abstract) - **Mobile app available** - **Batch processing** options **Best for**: Quick edits, mobile photography 6. [Adobe Photoshop](https://www.adobe.com/products/photoshop.html) AI **Industry-standard editing** with AI enhancement: - **Generative fill feature** - **Professional editing tools** - **Industry standard** for professionals - **Neural filters** for advanced effects **Best for**: Professional photo editing, detailed retouching 7. [Luminar Neo](https://skylum.com/luminar) **AI-powered editing suite** with background focus: - **Background replacement AI** - **Portrait enhancement** tools - **Sky replacement** features - **Mask AI** for precise selections **Best for**: Portrait photography, landscape enhancement 8. [Pixlr](https://pixlr.com) **Web-based editor** with AI capabilities: - **AI background tools** - **Free and premium options** - **Cloud-based editing** - **Mobile compatibility** **Best for**: Quick online edits, beginners 9. [GIMP](https://www.gimp.org) with AI Plugins **Open-source solution** with AI extensions: - **Free and open-source** - **Customizable workflows** - **Community support** - **AI plugin compatibility** **Best for**: Budget-conscious users, developers 10. [Kapwing](https://www.kapwing.com) **Video and image editing** platform: - **Background removal** for videos and images - **Online collaboration** tools - **Template library** - **Social media optimization** **Best for**: Content creators, social media managers 11. [Unscreen](https://www.unscreen.com) **Video background removal** specialist: - **Automatic video background removal** - **GIF support** - **Simple drag-and-drop interface** - **No green screen required** **Best for**: Video content, animated GIFs 12. [Clipping Magic](https://clippingmagic.com) **Precision background removal**: - **Smart edge detection** - **Manual refinement tools** - **API available** for integration - **High-quality results** **Best for**: E-commerce, product photography 13. [Background Burner](https://www.bonanza.com/background_burner) **Automatic background processing**: - **Instant background removal** - **Multiple background options** - **Quick processing** times - **Simple interface** **Best for**: Quick background swaps, casual users ## How to Choose the Right Tool Consider these factors when selecting an **AI background generator**: - **Purpose**: Product photos, portraits, creative projects - **Quality requirements**: Resolution and detail needs - **Budget**: Free vs. premium options - **Integration**: Workflow compatibility with tools like [Photoshop](https://www.adobe.com/products/photoshop.html) or [Canva](https://www.canva.com) - **Ease of use**: Learning curve and interface complexity - **Output formats**: Support for various file types and resolutions - **Processing speed**: Batch capabilities and rendering time ## Best Practices for AI Background Generation ### Preparation Tips 1. **Start with high-quality images** - Use well-lit, sharp photos for best results 2. **Clean subject edges** - Remove any existing background artifacts 3. **Consider subject positioning** - Ensure proper framing and composition ### Background Selection 4. **Choose appropriate backgrounds** that complement your subject 5. **Match lighting conditions** between subject and background 6. **Consider color harmony** and overall composition 7. **Maintain realistic proportions** and perspective ### Post-Processing 8. **Refine edges** for seamless integration 9. **Adjust shadows and highlights** to match the new environment 10. **Use our [AI Image Enhancer](/tools/ai-image-enhancer)** to polish final results ## Advanced Techniques ### Combining Tools for Better Results - Start with [Background Remover](/tools/background-remover) for clean subject isolation - Use [AI Background Generator](/tools/ai-background-generator) for new backgrounds - Enhance final image with [AI Image Enhancer](/tools/ai-image-enhancer) - Apply filters using [AI Filter](/tools/ai-filter) for artistic effects ### Professional Workflows **E-commerce Photography:** 1. Remove existing backgrounds 2. Apply consistent white or branded backgrounds 3. Enhance product details 4. Optimize for web display **Social Media Content:** 1. Create eye-catching backgrounds 2. Match brand colors and themes 3. Optimize for platform specifications 4. A/B test different background styles **Portrait Photography:** 1. Select complementary environments 2. Match lighting and mood 3. Enhance subject features 4. Create cohesive series looks ## Future of AI Background Generation The technology continues to evolve rapidly with exciting developments: ### Current Innovations - **Better edge detection** using advanced neural networks - **More realistic lighting adaptation** with 3D understanding - **Improved style consistency** across multiple images - **Real-time processing** for live video applications - **Enhanced mobile capabilities** for on-the-go editing ### Emerging Trends - **3D-aware background generation** for realistic depth - **Style transfer integration** for artistic backgrounds - **Voice-controlled editing** for hands-free operation - **Collaborative AI editing** for team workflows - **Augmented reality preview** for real-time visualization ### Industry Impact **Content Creation**: Democratizing professional-quality visuals **E-commerce**: Reducing product photography costs **Social Media**: Enabling creative expression for everyone **Marketing**: Streamlining campaign asset creation ## Troubleshooting Common Issues ### Edge Quality Problems - **Use higher resolution source images** - **Ensure good contrast** between subject and original background - **Try multiple AI models** for comparison - **Manual refinement** may be needed for complex edges ### Lighting Mismatches - **Adjust background brightness** to match subject - **Use consistent color temperature** - **Add realistic shadows** for believability - **Consider using [AI Image Enhancer](/tools/ai-image-enhancer)** for final adjustments ### Style Inconsistencies - **Choose backgrounds** that match your subject's style - **Maintain consistent processing** across image series - **Use reference images** for style guidance - **Apply uniform post-processing** techniques ## Conclusion **AI background generators** have revolutionized photo editing, making professional-quality background replacement accessible to everyone. Whether you're creating product photos for an online store, enhancing portraits, or developing creative content for social media, these tools can significantly streamline your workflow. ### Key Takeaways - **Choose the right tool** based on your specific needs and budget - **Combine multiple AI tools** for optimal results - **Follow best practices** for professional-quality outputs - **Stay updated** with emerging AI technologies ### Get Started Today Ready to transform your photos? Try our **free** [AI Background Generator](/tools/ai-background-generator) and experience the power of instant background transformation. For complete photo editing workflows, explore our full suite of AI tools: - [Background Remover](/tools/background-remover) - Clean subject isolation - [AI Image Enhancer](/tools/ai-image-enhancer) - Professional quality enhancement - [AI Filter](/tools/ai-filter) - Creative artistic effects - [AI Art Generator](/tools/ai-art-generator) - Generate unique backgrounds from scratch **Start creating stunning visuals today** and join thousands of creators who trust Photo for their AI-powered photo editing needs!`, publishDate: "2024-11-20", readTime: "12 min read", category: "tools", featuredImage: "/images/blog/ai-background-generators.svg", relatedTool: "ai-background-generator" }, { id: "easter-card-messages-2025", title: "100+ Easter Card Message Ideas in 2025", excerpt: "Find the perfect Easter card messages for family, friends, and loved ones. From religious to playful, discover heartfelt words for every relationship.", content: `# 100+ Easter Card Message Ideas in 2025 Easter is a time of renewal, joy, and connection. Whether you're celebrating the religious significance or simply enjoying the spring festivities, the right message can make your Easter cards truly special. Here's a comprehensive collection of Easter card messages for every relationship and occasion. ## Religious Easter Messages ### For Family - "May the miracle of Easter bring you renewed faith, hope, and joy." - "Celebrating the resurrection and the promise of eternal life with you." - "May God's love shine upon you this Easter and always." - "Rejoicing in the victory of Christ and the hope He brings." - "May the blessings of Easter fill your heart with peace and happiness." ### For Friends - "Wishing you a blessed Easter filled with God's grace and love." - "May the joy of Easter morning be with you today and throughout the year." - "Celebrating the hope and new life that Easter brings." - "May your Easter be as bright as your faith." - "Sending you Easter blessings and warm wishes." ## Light-hearted Easter Messages ### For Kids - "Hoppy Easter! May your day be filled with chocolate and fun!" - "Some bunny loves you very much! Happy Easter!" - "Wishing you an egg-stra special Easter!" - "May your Easter basket be full of treats and your heart full of joy!" - "Easter hugs and bunny kisses coming your way!" ### For Adults - "Hope your Easter is egg-cellent in every way!" - "Wishing you a spring-time of happiness and renewal." - "May your Easter be filled with beautiful moments and sweet memories." - "Sending you warm wishes for a wonderful Easter celebration." - "Hope your Easter is as sweet as chocolate and as bright as spring flowers." ## Short Easter Messages - "Happy Easter!" - "Easter blessings to you and yours." - "Wishing you joy this Easter." - "May Easter bring you happiness." - "Celebrating new beginnings with you." - "Easter joy and spring wishes." - "Hope, love, and Easter blessings." - "Springtime happiness to you!" ## Easter Messages for Different Relationships ### For Parents - "Thank you for teaching me the true meaning of Easter. Your love and faith have shaped who I am today." - "Grateful for the Easter traditions you've shared with our family through the years." - "May this Easter bring you the same joy you've brought to our family." ### For Grandparents - "Your wisdom and love make every Easter special. Thank you for being such a blessing in our lives." - "Remembering all the wonderful Easter memories you've helped create." - "May your Easter be filled with the love of family and the joy of spring." ### For Spouse/Partner - "Celebrating new beginnings and endless love with you this Easter." - "You make every season brighter, especially Easter. I love you." - "Looking forward to many more Easter celebrations together." ### For Colleagues - "Wishing you a restful and joyful Easter break." - "May the spring season bring fresh energy and new opportunities." - "Hope you have a wonderful Easter with your loved ones." ## Creative Easter Card Ideas ### Photo Card Messages - "Capturing Easter joy with the people we love most." - "Our family wishes your family a very Happy Easter!" - "Spring has sprung and so has our excitement for Easter!" ### Handmade Card Messages - "Made with love for someone special this Easter." - "A little handmade happiness for your Easter celebration." - "Crafted with care and Easter wishes for you." ## Easter Messages for Different Ages ### For Teenagers - "Hope your Easter break is amazing and your chocolate stash is epic!" - "Wishing you an Easter that's as awesome as you are." - "May your Easter be filled with good times and great memories." ### For Young Adults - "As you navigate this exciting time in your life, may Easter remind you of hope and new possibilities." - "Wishing you an Easter filled with joy, growth, and wonderful discoveries." - "May the spirit of Easter inspire you in all your endeavors." ### For Seniors - "May this Easter bring you peace, comfort, and the warmth of cherished memories." - "Celebrating the wisdom and grace you bring to our lives this Easter." - "Wishing you a gentle and blessed Easter surrounded by love." ## Tips for Writing Personal Easter Messages 1. **Consider your relationship** with the recipient 2. **Match the tone** to the occasion and your relationship 3. **Include personal touches** or shared memories 4. **Keep it genuine** and heartfelt 5. **Consider the recipient's beliefs** and preferences ## Conclusion The perfect Easter message comes from the heart. Whether you choose a traditional religious message, a playful pun, or something completely personal, the most important thing is that it reflects your genuine care for the recipient. Use these ideas as inspiration to create your own unique Easter greetings that will bring joy and warmth to those you care about. Remember, the best Easter cards are those that spread love, hope, and happiness โ€“ the true spirit of the Easter season.`, publishDate: "2024-12-01", readTime: "15 min read", category: "general", featuredImage: "/images/blog/easter-card-messages.svg" }, { id: "remove-background-free-guide", title: "How to Remove Background from Photos for Free: A Complete Guide", excerpt: "Learn how to remove backgrounds from photos for free using various tools and techniques. Perfect for beginners and professionals alike.", content: `# How to Remove Background from Photos for Free: A Complete Guide Removing backgrounds from photos is one of the most common photo editing tasks, whether you're creating product images, social media content, or professional portraits. The good news? You don't need expensive software to achieve professional results. This comprehensive guide will show you multiple free methods to remove backgrounds from your photos. ## Why Remove Photo Backgrounds? - **Product photography:** Clean, professional product images - **Social media:** Eye-catching posts and stories - **Professional headshots:** Consistent, clean backgrounds - **Creative projects:** Composite images and artistic designs - **E-commerce:** Standardized product listings ## Method 1: Photo Background Remover (Recommended) Our [free AI-powered background remover](/tools/remove-background) offers the easiest and most accurate solution: ### Step-by-Step Process: 1. **Visit [Photo Background Remover](/tools/remove-background)** 2. **Upload your image** (supports JPG, PNG, WebP) 3. **Wait for AI processing** (usually 2-3 seconds) 4. **Download your result** in high quality 5. **Fine-tune if needed** using our editing tools ### Advantages: - โœ… **Completely free** - โœ… **AI-powered accuracy** - โœ… **No registration required** - โœ… **High-quality results** - โœ… **Instant processing** - โœ… Works on any device ## Method 2: Remove.bg [Remove.bg](https://www.remove.bg/) is a popular online tool for background removal: ### Features: - Automatic AI detection - Good for people and objects - API available for developers - Limited free uses per month ### How to Use: 1. Go to [remove.bg](https://www.remove.bg/) 2. Upload your image 3. Download the result 4. Use their editor for refinements ## Method 3: Canva Background Remover Integrated into [Canva's](https://www.canva.com/) design platform: ### Process: 1. Create a [Canva account](https://www.canva.com/) (free) 2. Upload your image 3. Use the "Background Remover" feature 4. Download or use in designs ### Best For: - Users already using [Canva](https://www.canva.com/) - Creating designs with removed backgrounds - Social media content ## Method 4: GIMP (Free Desktop Software) For more control and advanced editing: ### Step-by-Step: 1. **Download and install [GIMP](https://www.gimp.org/)** (free) 2. **Open your image** in GIMP 3. **Use selection tools:** - Fuzzy Select Tool for similar colors - Select by Color Tool - Free Select Tool for manual selection 4. **Refine your selection:** - Use "Select > Border" to soften edges - "Select > Feather" for smooth transitions 5. **Delete the background:** - Press Delete key - Or use "Edit > Clear" 6. **Export as PNG** to preserve transparency ### Advanced GIMP Techniques: - **Layer masks** for non-destructive editing - **Path tool** for precise selections - **Alpha to selection** for existing transparent areas ## Method 5: Photopea (Browser-based Photoshop Alternative) A free, web-based editor similar to Photoshop: ### Process: 1. Go to [Photopea.com](https://www.photopea.com/) 2. Open your image 3. Use selection tools (similar to Photoshop) 4. Delete background 5. Save as PNG ## Method 6: PowerPoint/Google Slides (Surprising but Effective) For simple backgrounds: ### Steps: 1. Insert your image 2. Select the image 3. Use "Remove Background" feature 4. Mark areas to keep/remove 5. Right-click and save as image ## Tips for Better Background Removal ### Before You Start: 1. **Choose the right image:** - High contrast between subject and background - Clear, well-defined edges - Good lighting - Minimal background complexity 2. **Image quality matters:** - Higher resolution = better results - Sharp focus on subject - Avoid motion blur ### During Editing: 1. **Zoom in for precision** when manually selecting 2. **Use feathering** to soften harsh edges 3. **Check edges carefully** at 100% zoom 4. **Save in PNG format** to preserve transparency ### After Removal: 1. **Refine edges** if needed 2. **Add subtle shadows** for realism 3. **Match lighting** when compositing 4. **Consider color correction** ## Common Challenges and Solutions ### Hair and Fur - Use specialized hair selection tools - Try multiple methods and combine results - Consider AI tools for complex hair ### Transparent Objects - Manual selection often works better - Use layer masks for gradual transparency - Consider keeping some background for context ### Complex Backgrounds - Break the task into sections - Use multiple selection tools - Consider AI-powered solutions ### Fine Details - Zoom in for precision work - Use smaller brush sizes - Take breaks to avoid eye strain ## Best Practices for Different Image Types ### Product Photos - Use consistent lighting - Shoot against simple backgrounds - Consider the final use case ### Portraits - Pay special attention to hair - Maintain natural edge softness - Consider the new background context ### Objects with Reflections - Decide whether to keep or remove reflections - Maintain realistic lighting - Consider adding new reflections ## Free vs. Paid Tools: When to Upgrade ### Stick with Free When: - Occasional use - Simple backgrounds - Learning and experimenting - Budget constraints ### Consider Paid When: - High-volume processing - Complex, detailed work - Professional requirements - Time is critical ## Conclusion Removing backgrounds from photos doesn't have to be expensive or complicated. With tools like Photo's [free AI background remover](/tools/remove-background), you can achieve professional results in seconds. For more complex projects, free software like [GIMP](https://www.gimp.org/) provides advanced capabilities. The key is choosing the right tool for your specific needs and taking time to refine your results. Start with our [free background remover tool](/tools/remove-background) and explore other options as your skills and requirements grow. You can also try our [AI Background Generator](/tools/ai-background-generator) to create stunning new backgrounds for your images after removing the original ones. **Ready to get started?** Try Photo's [free background remover](/tools/remove-background) now and see the difference AI-powered editing can make!`, publishDate: "2024-11-05", readTime: "18 min read", category: "tools", featuredImage: "/images/blog/remove-background-guide.svg", relatedTool: "remove-background" }, { id: "holi-photoshoot-ideas-2025", title: "10 Unique Holi Photoshoot Ideas for Perfect Festive Clicks", excerpt: "Capture the vibrant spirit of Holi with these creative photoshoot ideas. From color powder portraits to action shots, make your Holi memories unforgettable.", content: `# 10 Unique Holi Photoshoot Ideas for Perfect Festive Clicks Holi, the festival of colors, offers incredible opportunities for stunning photography. The vibrant powders, joyful expressions, and festive atmosphere create the perfect backdrop for memorable photos. Whether you're a professional photographer or just want to capture beautiful memories, these creative ideas will help you make the most of this colorful celebration. ## Essential Holi Photography Preparation ### Camera Protection - Use **protective covers** or underwater housings - Bring **lens cleaning cloths** - Consider using **older equipment** - Have **backup gear** ready ### Safety First - Use **natural, skin-safe colors** - Protect **eyes and breathing passages** - Stay **hydrated** - Plan **escape routes** from crowded areas ## 10 Creative Holi Photoshoot Ideas ### 1. Color Powder Explosion Portraits **Setup:** Position your subject against a **dark background** **Technique:** - Use **high shutter speed** (1/1000s or faster) - **Continuous shooting mode** - Have someone **throw powder** from different angles - Capture the **moment of impact** **Pro Tips:** - Use **backlighting** to make powder glow - Try **different colored powders** for variety - Shoot from **multiple angles** - Consider **slow-motion video** for dramatic effect ### 2. Pre-Holi Clean Portrait Series **Concept:** Document the transformation from clean to colorful **Process:** - Start with **clean, white clothing** portraits - **Gradually add colors** throughout the shoot - Create a **before/during/after sequence** - Show the **progression** of the celebration **Styling Tips:** - Use **white or light-colored** clothing - **Simple backgrounds** work best - Focus on **facial expressions** - Document the **anticipation and excitement** ### 3. Action-Packed Water Balloon Shots **Equipment Needed:** - **Fast autofocus** camera - **High shutter speed** capability - **Waterproof protection** **Shooting Technique:** - **Anticipate the action** - Use **burst mode** - Focus on **expressions during impact** - Capture **water droplets** in mid-air **Creative Angles:** - **Low angle shots** for dramatic effect - **Close-ups** of facial reactions - **Wide shots** showing the full scene - **Overhead shots** of group activities ### 4. Silhouette Magic with Color Clouds **Best Time:** Golden hour or backlit conditions **Setup:** - Position subjects **between camera and light source** - Have them **throw powder into the air** - Focus on creating **dramatic silhouettes** - Use the **color powder as atmospheric elements** **Technical Settings:** - **Expose for the background light** - Use **manual focus** - Consider **HDR** for detail retention - Experiment with **different color combinations** ### 5. Macro Details of Color and Texture **Focus Areas:** - **Hands covered** in colorful powder - **Color-stained fabrics** and textures - **Powder particles** on skin - **Colorful water droplets** **Equipment:** - **Macro lens** or close-up filters - **Good lighting setup** - **Steady tripod** - **Remote shutter release** **Artistic Elements:** - Play with **depth of field** - Focus on **patterns and textures** - Capture the **fine details** of powder - Show the **interaction between colors** ### 6. Group Celebration Dynamics **Composition Ideas:** - **Circle formations** with powder throw - **Action shots** of group activities - **Candid moments** of laughter and joy - **Wide shots** showing the festival atmosphere **Shooting Strategy:** - Use **wide-angle lenses** - Capture **genuine emotions** - Focus on **interactions between people** - Document the **community spirit** ### 7. Creative Color Mixing Experiments **Concept:** Show the artistic side of color blending **Techniques:** - **Wet powder applications** - **Color gradients** on faces - **Artistic body painting** - **Abstract color patterns** **Artistic Approach:** - Focus on **color theory** - Create **intentional color combinations** - Use **brushes and tools** for application - Document the **artistic process** ### 8. Environmental Context Shots **Include:** - **Traditional Holi preparations** - **Street celebrations** - **Cultural elements** and decorations - **Food and traditional sweets** **Documentary Style:** - Capture the **broader celebration** - Show **cultural significance** - Include **architectural elements** - Document **traditional practices** ### 9. Reflection and Water Photography **Creative Opportunities:** - **Reflections** in water puddles - **Color mixing** in water containers - **Wet surfaces** with color streaks - **Rain or water spray** effects **Technical Considerations:** - **Protect equipment** from water - Use **polarizing filters** - Experiment with **different angles** - Capture both **reflection and subject** ### 10. Night Photography with Artificial Lighting **Setup Requirements:** - **Powerful external lighting** - **Colored gels** for mood lighting - **Smoke machines** for atmosphere - **Controlled environment** **Creative Effects:** - **Dramatic lighting** on colored faces - **Powder clouds** illuminated by colored lights - **Long exposure** with moving subjects - **Light painting** with colored sources ## Post-Processing Tips for Holi Photos ### Color Enhancement - **Boost vibrance** and saturation selectively - **Adjust individual** color channels - Use **masking** for targeted adjustments - **Maintain natural** skin tones ### Cleaning Up - **Remove unwanted elements** - **Enhance powder effects** - **Adjust exposure** for better detail - **Sharpen important areas** ### Creative Editing - Add **motion blur** for dynamic feel - Create **composite images** - **Enhance color contrasts** - Apply **artistic filters** sparingly ## Safety and Etiquette Guidelines ### Respect and Consent - Always **ask permission** before photographing people - **Respect personal boundaries** - Be mindful of **cultural sensitivities** - **Share photos responsibly** ### Equipment Safety - Use **protective gear** - **Clean equipment immediately** after use - Have **backup plans** - Consider **insurance** for expensive gear ### Personal Safety - Stay **aware of surroundings** - Avoid **overcrowded areas** - Keep **emergency contacts** handy - Plan **transportation** in advance ## Sharing Your Holi Photography ### Social Media Tips - Use **relevant hashtags** - **Tag locations and people** (with permission) - **Share the story** behind the photos - **Engage with the community** ### Print Considerations - Choose **high-quality printing services** - Consider **color accuracy** - Select **appropriate paper types** - Create **photo books** or albums ## Conclusion Holi photography offers endless creative possibilities. The key is to balance **technical skill** with **spontaneous creativity** while respecting the cultural significance of the festival. Whether you're capturing explosive powder throws or intimate moments of joy, remember that the best Holi photos tell the story of celebration, community, and the triumph of color over monotony. Prepare your equipment, protect your gear, and most importantly, **immerse yourself in the celebration**. The most authentic and powerful Holi photographs come from photographers who participate in the joy while documenting it. For professional-quality results, enhance your Holi photos with our [AI Image Enhancer](/tools/ai-image-enhancer) to bring out those vibrant colors. You can also use our [Background Remover](/tools/remove-background) to isolate subjects and create stunning compositions with our [AI Background Generator](/tools/ai-background-generator). **Ready to capture amazing Holi photos?** Remember to enhance your images with our AI-powered editing tools to make your colorful memories even more vibrant!`, publishDate: "2024-10-28", readTime: "14 min read", category: "general", featuredImage: "/images/blog/holi-photoshoot-ideas.svg" } ]; const getArticleById = (id) => { return blogArticles.find((article) => article.id === id); }; const BlogPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Blog", description: "Stay updated with the latest tips, tutorials, and news about AI photo editing and digital image processing." } ), /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-12", children: [ /* @__PURE__ */ jsxs("div", { className: "text-center mb-12", children: [ /* @__PURE__ */ jsx("h1", { className: "text-4xl md:text-5xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4", children: "Blog" }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600 max-w-2xl mx-auto", children: "Discover tips, tutorials, and insights about AI photo editing and digital creativity" }) ] }), /* @__PURE__ */ jsx("div", { className: "max-w-6xl mx-auto", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: blogArticles.map((article) => /* @__PURE__ */ jsx(Link, { to: `/blog/${article.id}`, className: "block group", children: /* @__PURE__ */ jsxs("article", { className: "bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden h-full", children: [ /* @__PURE__ */ jsxs("div", { className: "h-48 bg-gray-200 relative overflow-hidden", children: [ /* @__PURE__ */ jsx( "img", { src: article.featuredImage, alt: article.title, className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" } ), /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black bg-opacity-20 group-hover:bg-opacity-10 transition-all duration-300" }), /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-4 right-4", children: /* @__PURE__ */ jsx("span", { className: "inline-block px-3 py-1 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full", children: article.category === "general" ? "General" : "Tools" }) }) ] }), /* @__PURE__ */ jsxs("div", { className: "p-6 flex flex-col", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center text-sm text-gray-500 mb-3", children: [ /* @__PURE__ */ jsx("span", { children: new Date(article.publishDate).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" }) }), /* @__PURE__ */ jsx("span", { className: "mx-2", children: "โ€ข" }), /* @__PURE__ */ jsx("span", { children: article.readTime }) ] }), /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold text-gray-900 mb-3 group-hover:text-blue-600 transition-colors duration-300", children: article.title }), /* @__PURE__ */ jsx("p", { className: "text-gray-600 mb-4 line-clamp-3", children: article.excerpt }), /* @__PURE__ */ jsx("div", { className: "mt-auto pt-4", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center text-blue-600 group-hover:text-blue-700 font-medium transition-colors duration-300", children: [ "Read More", /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform duration-300", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) ] }) }) ] }) ] }) }, article.id)) }) }), /* @__PURE__ */ jsx("div", { className: "text-center mt-16", children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl shadow-lg p-8 max-w-2xl mx-auto", children: [ /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Ready to Transform Your Photos?" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600 mb-6", children: "Explore our powerful AI-powered photo editing tools and bring your creative vision to life." }), /* @__PURE__ */ jsxs( Link, { to: "/tools", className: "inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105", children: [ "Explore Our Tools", /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 ml-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }) ] } ) ] }) }) ] }) }) ] }); }; const BlogArticlePage = () => { const { articleId } = useParams(); if (!articleId) { return /* @__PURE__ */ jsx(Navigate, { to: "/blog", replace: true }); } const article = getArticleById(articleId); if (!article) { return /* @__PURE__ */ jsx(Navigate, { to: "/blog", replace: true }); } const parseLine = (line) => { const regex = /(\[\s*(.*?)\s*\]\(\s*(.*?)\s*\))|(\*\*(.*?)\*\*)/g; let lastIndex = 0; const parts = []; let match; let key = 0; while ((match = regex.exec(line)) !== null) { const [fullMatch, linkFull, linkText, linkUrl, boldFull, boldText] = match; if (match.index > lastIndex) { parts.push(line.substring(lastIndex, match.index)); } if (linkFull) { const isInternal = linkUrl.startsWith("/"); if (isInternal) { parts.push(/* @__PURE__ */ jsx(Link, { to: linkUrl, className: "text-blue-600 hover:underline", children: linkText }, key++)); } else { parts.push(/* @__PURE__ */ jsx("a", { href: linkUrl, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 hover:underline", children: linkText }, key++)); } } else if (boldFull) { parts.push(/* @__PURE__ */ jsx("strong", { children: boldText }, key++)); } lastIndex = regex.lastIndex; } if (lastIndex < line.length) { parts.push(line.substring(lastIndex)); } return parts; }; const renderContent = (content) => { const lines = content.split("\n"); const processedLines = /* @__PURE__ */ new Set(); return lines.map((line, index) => { if (processedLines.has(index)) return null; const trimmedLine = line.trim(); if (trimmedLine.startsWith("# ")) return /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-4xl font-bold text-gray-900 mb-6 mt-10", children: trimmedLine.substring(2) }, index); if (trimmedLine.startsWith("## ")) return /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-4 mt-8", children: trimmedLine.substring(3) }, index); if (trimmedLine.startsWith("### ")) return /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-3 mt-6", children: trimmedLine.substring(4) }, index); if (trimmedLine.startsWith("- ")) { const listItems = []; for (let j = index; j < lines.length && lines[j].trim().startsWith("- "); j++) { listItems.push(/* @__PURE__ */ jsx("li", { children: parseLine(lines[j].trim().substring(2)) }, j)); processedLines.add(j); } return /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-2 mb-4 text-gray-700", children: listItems }, index); } const numberedListMatch = trimmedLine.match(/^(\d+)\.\s(.+)/); if (numberedListMatch) { const itemNumber = parseInt(numberedListMatch[1]); const itemText = numberedListMatch[2]; return /* @__PURE__ */ jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [ /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center w-8 h-8 bg-blue-600 text-white text-sm font-bold rounded-full mr-4 mt-1 flex-shrink-0", children: itemNumber }), /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx("div", { className: "text-gray-900 font-semibold text-lg mb-2", children: parseLine(itemText) }) }) ] }) }, index); } if (trimmedLine.length > 0) { return /* @__PURE__ */ jsx("p", { className: "text-gray-700 mb-4 leading-relaxed", children: parseLine(trimmedLine) }, index); } return null; }).filter(Boolean); }; return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: article.title, description: article.excerpt } ), /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-12", children: [ /* @__PURE__ */ jsx("nav", { className: "mb-8", children: /* @__PURE__ */ jsx( Link, { to: "/blog", className: "text-blue-600 hover:text-blue-700 font-medium transition-colors duration-300", children: "โ† Back to Blog" } ) }), /* @__PURE__ */ jsxs("article", { className: "max-w-4xl mx-auto", children: [ /* @__PURE__ */ jsxs("div", { className: "h-64 md:h-80 bg-gray-200 rounded-xl mb-8 relative overflow-hidden", children: [ /* @__PURE__ */ jsx( "img", { src: article.featuredImage, alt: article.title, className: "w-full h-full object-cover" } ), /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black bg-opacity-20" }), /* @__PURE__ */ jsxs("div", { className: "absolute bottom-6 left-6 right-6", children: [ /* @__PURE__ */ jsx("span", { className: "inline-block px-4 py-2 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full mb-4", children: article.category === "general" ? "General" : "Tools" }), /* @__PURE__ */ jsx("h1", { className: "text-2xl md:text-3xl font-bold text-white", children: article.title }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-xl shadow-lg p-8", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-8 pb-6 border-b border-gray-200", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center text-sm text-gray-500", children: [ /* @__PURE__ */ jsx("span", { children: new Date(article.publishDate).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" }) }), /* @__PURE__ */ jsx("span", { className: "mx-2", children: "โ€ข" }), /* @__PURE__ */ jsx("span", { children: article.readTime }) ] }), /* @__PURE__ */ jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ jsx("button", { className: "text-gray-400 hover:text-blue-600 transition-colors duration-300", children: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { d: "M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z" }) }) }) }) ] }), /* @__PURE__ */ jsx("div", { className: "prose prose-lg max-w-none", children: renderContent(article.content) }), /* @__PURE__ */ jsx("div", { className: "mt-12 pt-8 border-t border-gray-200", children: /* @__PURE__ */ jsxs("div", { className: "bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl p-6", children: [ /* @__PURE__ */ jsx("h3", { className: "text-xl font-bold text-gray-900 mb-3", children: "Ready to Try Our AI Tools?" }), /* @__PURE__ */ jsx("p", { className: "text-gray-600 mb-4", children: "Transform your photos with our powerful AI-powered editing tools." }), /* @__PURE__ */ jsxs( Link, { to: "/tools", className: "inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105", children: [ "Explore Tools", /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 ml-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }) ] } ) ] }) }) ] }) ] }) ] }) }) ] }); }; const PrivacyPolicyPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Privacy Policy", description: "Learn how ModernPhotoTools.com protects your privacy and handles your data when you use our AI photo editing tools." } ), /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsxs("h1", { className: "text-4xl md:text-5xl font-bold text-gray-900 mb-6", children: [ "Privacy ", /* @__PURE__ */ jsx("span", { className: "text-blue-600", children: "Policy" }) ] }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-700 mb-8", children: "Learn how we protect your privacy and handle your data when you use our AI photo editing tools" }) ] }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-white", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "prose prose-lg max-w-none text-gray-700", children: [ /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 mb-8", children: [ "Last updated: ", (/* @__PURE__ */ new Date()).toLocaleDateString() ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Introduction" }), /* @__PURE__ */ jsxs("p", { children: [ "At ", /* @__PURE__ */ jsx("strong", { children: "ModernPhotoTools.com" }), ", your privacy is important to us. This Privacy Policy outlines how we collect, use, and protect your information when using our website and AI-powered photo editing tools." ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Information We Collect" }), /* @__PURE__ */ jsx("h3", { className: "text-xl font-medium mt-4 mb-1", children: "๐Ÿ“ท Images & Files" }), /* @__PURE__ */ jsxs("p", { children: [ "When you use our tools (e.g., background remover, blurring, resizing), your uploaded images are processed securely on our servers. We do ", /* @__PURE__ */ jsx("strong", { children: "not store" }), " your images permanently โ€” they are ", /* @__PURE__ */ jsx("strong", { children: "deleted automatically" }), " after processing." ] }), /* @__PURE__ */ jsx("h3", { className: "text-xl font-medium mt-4 mb-1", children: "๐Ÿ“Š Usage Data" }), /* @__PURE__ */ jsx("p", { children: "We may collect anonymous usage data such as:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Pages visited and time spent" }), /* @__PURE__ */ jsx("li", { children: "Tools used and frequency" }), /* @__PURE__ */ jsx("li", { children: "Browser type and device details" }), /* @__PURE__ */ jsx("li", { children: "IP address and general location" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "How We Use Your Information" }), /* @__PURE__ */ jsx("p", { children: "The data we collect helps us to:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Deliver fast and accurate photo editing via AI" }), /* @__PURE__ */ jsx("li", { children: "Improve tool performance and user experience" }), /* @__PURE__ */ jsx("li", { children: "Analyze anonymous usage patterns" }), /* @__PURE__ */ jsx("li", { children: "Maintain website security and stability" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿ” Data Security" }), /* @__PURE__ */ jsx("p", { children: "We prioritize the safety of your data through:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Encrypted connections (SSL/TLS)" }), /* @__PURE__ */ jsx("li", { children: "Immediate deletion of uploaded images" }), /* @__PURE__ */ jsx("li", { children: "No permanent image storage" }), /* @__PURE__ */ jsx("li", { children: "Restricted, monitored server access" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿช Cookies" }), /* @__PURE__ */ jsx("p", { children: "We may use cookies to enhance your browsing experience. You can manage your cookie preferences in your browser settings." }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿ›ก๏ธ Your Rights" }), /* @__PURE__ */ jsx("p", { children: "You have the right to:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Know what data we collect" }), /* @__PURE__ */ jsx("li", { children: "Request deletion of your data" }), /* @__PURE__ */ jsx("li", { children: "Opt-out of certain data collection" }), /* @__PURE__ */ jsx("li", { children: "Contact us regarding privacy concerns" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿ“ฌ Contact Us" }), /* @__PURE__ */ jsxs("p", { children: [ "For any privacy-related inquiries, please reach out to us through the ", /* @__PURE__ */ jsx("a", { href: "/contact", className: "text-blue-600 hover:underline", children: "contact page" }), "." ] }) ] }), /* @__PURE__ */ jsxs("section", { children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿ”„ Updates to This Policy" }), /* @__PURE__ */ jsx("p", { children: "This policy may be updated occasionally. Changes will be reflected on this page along with the latest revision date." }) ] }) ] }) }) }) }) ] }); }; const TermsOfUsePage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Terms of Use", description: "Read the terms and conditions for using ModernPhotoTools.com and our AI-powered photo editing services." } ), /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsxs("h1", { className: "text-4xl md:text-5xl font-bold text-gray-900 mb-6", children: [ "Terms of ", /* @__PURE__ */ jsx("span", { className: "text-blue-600", children: "Use" }) ] }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-700 mb-8", children: "Read the terms and conditions for using our AI-powered photo editing services." }) ] }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-white", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "prose prose-lg max-w-none text-gray-700", children: [ /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 mb-8", children: [ "Last updated: ", (/* @__PURE__ */ new Date()).toLocaleDateString() ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Acceptance of Terms" }), /* @__PURE__ */ jsxs("p", { children: [ "By accessing and using ", /* @__PURE__ */ jsx("strong", { children: "ModernPhotoTools.com" }), ", you accept and agree to be bound by the terms and conditions outlined below. If you do not agree, please do not use our services." ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Use License" }), /* @__PURE__ */ jsx("p", { children: "You are granted a temporary, non-exclusive license to use ModernPhotoTools.com for personal, non-commercial purposes only. Under this license, you may not:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Modify or copy the materials" }), /* @__PURE__ */ jsx("li", { children: "Use the materials for commercial purposes or public display" }), /* @__PURE__ */ jsx("li", { children: "Attempt to reverse-engineer any software on the site" }), /* @__PURE__ */ jsx("li", { children: "Remove copyright or proprietary notations" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Acceptable Use" }), /* @__PURE__ */ jsx("p", { children: "You agree to use our platform lawfully. You must not:" }), /* @__PURE__ */ jsxs("ul", { className: "list-disc list-inside ml-4", children: [ /* @__PURE__ */ jsx("li", { children: "Upload copyrighted or infringing materials" }), /* @__PURE__ */ jsx("li", { children: "Submit offensive, illegal, or harmful content" }), /* @__PURE__ */ jsx("li", { children: "Use services for deepfakes or deceptive media" }), /* @__PURE__ */ jsx("li", { children: "Disrupt our servers or services" }), /* @__PURE__ */ jsx("li", { children: "Use bots or automation without permission" }) ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Content Ownership" }), /* @__PURE__ */ jsx("p", { children: "You retain full ownership of any images you upload. We do not claim rights over your content. By using our tools, you grant us a temporary license to process your content securely and privately." }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Service Availability" }), /* @__PURE__ */ jsx("p", { children: "While we aim for high availability, we do not guarantee uninterrupted access. Downtime may occur due to maintenance or unforeseen technical issues." }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Disclaimer" }), /* @__PURE__ */ jsx("p", { children: 'All materials and tools are provided "as is". We disclaim all warrantiesโ€”express or impliedโ€”including but not limited to merchantability, fitness for a particular purpose, or non-infringement.' }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Limitations" }), /* @__PURE__ */ jsx("p", { children: "In no event shall ModernPhotoTools.com or its affiliates be liable for any indirect or consequential damages, including data loss or business interruption, even if notified of such possibility." }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Privacy Policy" }), /* @__PURE__ */ jsxs("p", { children: [ "Your use of our services is also governed by our ", /* @__PURE__ */ jsx("a", { href: "/privacy-policy", className: "text-blue-600 hover:underline", children: "Privacy Policy" }), ". Please review it to understand how we handle your data." ] }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Modifications" }), /* @__PURE__ */ jsx("p", { children: "We may update these Terms of Use at any time without notice. Continued use of our website indicates your acceptance of the most recent version." }) ] }), /* @__PURE__ */ jsxs("section", { className: "mb-8", children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "Governing Law" }), /* @__PURE__ */ jsx("p", { children: "These terms shall be governed by and interpreted in accordance with the laws applicable in your jurisdiction. Any legal disputes shall be resolved under these laws." }) ] }), /* @__PURE__ */ jsxs("section", { children: [ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-2", children: "๐Ÿ“ฌ Contact Us" }), /* @__PURE__ */ jsxs("p", { children: [ "If you have any questions about these Terms of Use, please ", /* @__PURE__ */ jsx("a", { href: "/contact", className: "text-blue-600 hover:underline", children: "contact us" }), "." ] }) ] }) ] }) }) }) }) ] }); }; const DMCAPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "DMCA Notice", description: "Digital Millennium Copyright Act (DMCA) notice and takedown policy for ModernPhotoTools.com." } ), /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /* @__PURE__ */ jsxs("h1", { className: "text-4xl md:text-5xl font-bold text-gray-900 mb-6", children: [ /* @__PURE__ */ jsx("span", { className: "text-blue-600", children: "DMCA" }), " Notice" ] }), /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-700 mb-8", children: "Our copyright policy and takedown procedures in accordance with the Digital Millennium Copyright Act (DMCA)." }) ] }) }) }), /* @__PURE__ */ jsx("section", { className: "py-16 bg-white", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "prose prose-lg max-w-none text-gray-700", children: [ /* @__PURE__ */ jsx("h2", { children: "DMCA Policy Overview" }), /* @__PURE__ */ jsxs("p", { children: [ "At ", /* @__PURE__ */ jsx("strong", { children: "ModernPhotoTools.com" }), ", we respect the intellectual property rights of others and expect our users to do the same. This DMCA Policy outlines how we respond to copyright infringement notifications in compliance with the", /* @__PURE__ */ jsx("em", { children: "Digital Millennium Copyright Act" }), " (DMCA)." ] }), /* @__PURE__ */ jsx("h2", { children: "Submitting a DMCA Takedown Notice" }), /* @__PURE__ */ jsx("p", { children: "If you believe that material on our website infringes your copyright, please submit a written notification including:" }), /* @__PURE__ */ jsxs("ol", { children: [ /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Identification" }), " of the copyrighted work." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Identification" }), " of the allegedly infringing material with enough detail for us to locate it." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Your contact information" }), ": name, address, phone number, and email." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Statement" }), " that you have a good faith belief the use is unauthorized." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Statement" }), " that the notice is accurate and you are authorized to act on behalf of the copyright owner." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Your physical or electronic signature" }), " (typing your full name suffices)." ] }) ] }), /* @__PURE__ */ jsxs("p", { children: [ "Send your takedown notice via our ", /* @__PURE__ */ jsx("a", { href: "/contact", className: "text-blue-600 underline", children: "Contact Page" }), ' and include "DMCA Takedown Notice" in the subject line.' ] }), /* @__PURE__ */ jsx("h2", { children: "Submitting a Counter-Notification" }), /* @__PURE__ */ jsx("p", { children: "If you believe your content was removed by mistake or misidentification, you may submit a counter-notice containing:" }), /* @__PURE__ */ jsxs("ol", { children: [ /* @__PURE__ */ jsx("li", { children: "Your physical or electronic signature." }), /* @__PURE__ */ jsx("li", { children: "Identification of the removed material and its location prior to removal." }), /* @__PURE__ */ jsx("li", { children: "A good faith statement under penalty of perjury that the removal was in error." }), /* @__PURE__ */ jsx("li", { children: "Your name, address, phone number, and consent to the jurisdiction of the relevant U.S. Federal District Court." }) ] }), /* @__PURE__ */ jsxs("p", { children: [ "Counter-notices should also be submitted via our ", /* @__PURE__ */ jsx("a", { href: "/contact", className: "text-blue-600 underline", children: "Contact Page" }), ' with "DMCA Counter Notice" in the subject.' ] }), /* @__PURE__ */ jsx("h2", { children: "Repeat Infringers" }), /* @__PURE__ */ jsx("p", { children: "We may terminate accounts or restrict access for users who repeatedly violate copyright policies." }), /* @__PURE__ */ jsx("h2", { children: "False Claims Warning" }), /* @__PURE__ */ jsx("p", { children: "Under Section 512(f) of the DMCA, anyone who knowingly submits false claims may be liable for damages, including costs and attorneyโ€™s fees." }), /* @__PURE__ */ jsx("h2", { children: "No Legal Advice" }), /* @__PURE__ */ jsx("p", { children: "This DMCA page is provided for informational purposes only and does not constitute legal advice. Please consult a qualified attorney for legal guidance." }), /* @__PURE__ */ jsx("h2", { children: "Contact Information" }), /* @__PURE__ */ jsxs("p", { children: [ "For DMCA-related issues, please reach out via our ", /* @__PURE__ */ jsx("a", { href: "/contact", className: "text-blue-600 underline", children: "Contact Page" }), ' with "DMCA" in the subject line.' ] }) ] }) }) }) }) ] }); }; const CookiesPolicyPage = () => { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: "Cookies Policy", description: "Learn about how ModernPhotoTools.com uses cookies to enhance your browsing experience and improve our services." } ), /* @__PURE__ */ jsx("section", { className: "bg-white text-gray-800 py-16 px-4 md:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "max-w-4xl mx-auto", children: [ /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-4xl font-extrabold text-gray-900 mb-8", children: "Cookies Policy" }), /* @__PURE__ */ jsxs("div", { className: "prose prose-lg prose-gray max-w-none", children: [ /* @__PURE__ */ jsx("p", { children: 'This Cookies Policy explains how ModernPhotoTools.com ("we", "us", or "our") uses cookies and similar technologies when you visit our website. It explains what these technologies are and why we use them, as well as your rights to control our use of them.' }), /* @__PURE__ */ jsx("hr", { className: "my-10 border-gray-200" }), /* @__PURE__ */ jsx("h2", { children: "What Are Cookies?" }), /* @__PURE__ */ jsx("p", { children: "Cookies are small data files that are placed on your computer or mobile device when you visit a website. Cookies are widely used by website owners to make their websites work, or to work more efficiently, as well as to provide reporting information." }), /* @__PURE__ */ jsx("h2", { children: "Why Do We Use Cookies?" }), /* @__PURE__ */ jsx("p", { children: 'We use cookies for several reasons. Some cookies are required for technical reasons in order for our website to operate, and we refer to these as "essential" or "strictly necessary" cookies. Other cookies enable us to track and target the interests of our users to enhance the experience on our website.' }), /* @__PURE__ */ jsx("h2", { children: "Types of Cookies We Use" }), /* @__PURE__ */ jsx("h3", { children: "Essential Cookies" }), /* @__PURE__ */ jsx("p", { children: "These cookies are strictly necessary to provide you with services available through our website and to use some of its features, such as access to secure areas. Because these cookies are strictly necessary to deliver the website, you cannot refuse them without impacting how our site functions." }), /* @__PURE__ */ jsx("h3", { children: "Performance and Analytics Cookies" }), /* @__PURE__ */ jsx("p", { children: "These cookies collect information about how visitors use our website, for instance which pages visitors go to most often, and if they get error messages from web pages. These cookies don't collect information that identifies a visitor. All information these cookies collect is aggregated and therefore anonymous." }), /* @__PURE__ */ jsx("h3", { children: "Functionality Cookies" }), /* @__PURE__ */ jsx("p", { children: "These cookies allow our website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features. These cookies can also be used to remember changes you have made to text size, fonts, and other parts of web pages that you can customize." }), /* @__PURE__ */ jsx("h3", { children: "Targeting and Advertising Cookies" }), /* @__PURE__ */ jsx("p", { children: "These cookies are used to deliver adverts more relevant to you and your interests. They are also used to limit the number of times you see an advertisement as well as help measure the effectiveness of the advertising campaign." }), /* @__PURE__ */ jsx("h2", { children: "Third-Party Cookies" }), /* @__PURE__ */ jsx("p", { children: "In addition to our own cookies, we may also use various third-party cookies to report usage statistics of the service, deliver advertisements on and through the service, and so on. These third-party cookies are governed by the respective privacy policies of the third parties providing them." }), /* @__PURE__ */ jsx("h2", { children: "How Can You Control Cookies?" }), /* @__PURE__ */ jsx("p", { children: "You have the right to decide whether to accept or reject cookies. You can exercise your cookie preferences by clicking on the appropriate opt-out links provided in the cookie banner when you first visit our website." }), /* @__PURE__ */ jsx("p", { children: "You can also set or amend your web browser controls to accept or refuse cookies. If you choose to reject cookies, you may still use our website though your access to some functionality and areas of our website may be restricted." }), /* @__PURE__ */ jsx("h3", { children: "Browser Controls" }), /* @__PURE__ */ jsx("p", { children: "Most web browsers allow you to control cookies through their settings preferences. However, if you limit the ability of websites to set cookies, you may worsen your overall user experience, since it will no longer be personalized to you." }), /* @__PURE__ */ jsx("h2", { children: "Cookie Retention" }), /* @__PURE__ */ jsx("p", { children: "Cookies set by us will be retained for different periods depending on their purpose:" }), /* @__PURE__ */ jsxs("ul", { children: [ /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Session cookies:" }), " Temporary and deleted when you close your browser." ] }), /* @__PURE__ */ jsxs("li", { children: [ /* @__PURE__ */ jsx("strong", { children: "Persistent cookies:" }), " Remain on your device for a set period or until you delete them." ] }) ] }), /* @__PURE__ */ jsx("h2", { children: "Updates to This Policy" }), /* @__PURE__ */ jsx("p", { children: "We may update this Cookies Policy from time to time in order to reflect changes to the cookies we use or for other operational, legal, or regulatory reasons. Please revisit this policy regularly to stay informed about our use of cookies." }), /* @__PURE__ */ jsx("h2", { children: "Contact Us" }), /* @__PURE__ */ jsxs("p", { children: [ "If you have any questions about our use of cookies or other technologies, please contact us through our ", /* @__PURE__ */ jsx("a", { href: "/contact", children: "contact page" }), "." ] }), /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 mt-10", children: [ /* @__PURE__ */ jsx("strong", { children: "Last updated:" }), " ", (/* @__PURE__ */ new Date()).toLocaleDateString() ] }) ] }) ] }) }) ] }); }; function App() { return /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-h-screen", children: [ /* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx("main", { className: "flex-grow", children: /* @__PURE__ */ jsxs(Routes, { children: [ /* @__PURE__ */ jsx(Route, { path: "/", element: /* @__PURE__ */ jsx(HomePage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/tools", element: /* @__PURE__ */ jsx(ToolsPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/tools/:toolId", element: /* @__PURE__ */ jsx(ToolPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/about", element: /* @__PURE__ */ jsx(AboutPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/contact", element: /* @__PURE__ */ jsx(ContactPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/blog", element: /* @__PURE__ */ jsx(BlogPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/blog/:articleId", element: /* @__PURE__ */ jsx(BlogArticlePage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/privacy-policy", element: /* @__PURE__ */ jsx(PrivacyPolicyPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/terms-of-use", element: /* @__PURE__ */ jsx(TermsOfUsePage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/dmca", element: /* @__PURE__ */ jsx(DMCAPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "/cookies-policy", element: /* @__PURE__ */ jsx(CookiesPolicyPage, {}) }), /* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(NotFoundPage, {}) }) ] }) }), /* @__PURE__ */ jsx(Footer, {}) ] }) }); } function render(url, context) { return ReactDOMServer.renderToString( /* @__PURE__ */ jsx(StaticRouter, { location: url, children: /* @__PURE__ */ jsx(App, {}) }) ); } export { render };
๐Ÿ“„ favicon.svg
๐Ÿ“ images
๐Ÿ“ blog
๐Ÿ“„ ai-background-generators.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#4158D0;stop-opacity:1" /> <stop offset="50%" style="stop-color:#C850C0;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFCC70;stop-opacity:1" /> </linearGradient> <linearGradient id="frameGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#FFFFFF;stop-opacity:1" /> <stop offset="100%" style="stop-color:#F0F0F0;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Main Image Frame --> <rect x="50" y="50" width="450" height="300" rx="10" fill="url(#frameGradient)" filter="url(#dropShadow)" /> <!-- Image Content (Simplified Landscape) --> <rect x="60" y="60" width="430" height="280" rx="5" fill="#87CEEB" /> <polygon points="60,340 490,340 490,200 400,240 300,180 200,220 100,160 60,200" fill="#228B22" /> <circle cx="430" cy="100" r="40" fill="#FFD700" /> <!-- AI Generated Alternatives --> <rect x="550" y="50" width="200" height="120" rx="5" fill="white" filter="url(#dropShadow)" /> <rect x="560" y="60" width="180" height="100" rx="3" fill="#E6F7FF" /> <circle cx="650" cy="110" r="30" fill="#87CEFA" /> <polygon points="560,160 740,160 740,120 700,130 650,110 600,125 560,115" fill="#90EE90" /> <rect x="550" y="190" width="200" height="120" rx="5" fill="white" filter="url(#dropShadow)" /> <rect x="560" y="200" width="180" height="100" rx="3" fill="#FFF0F5" /> <polygon points="560,300 740,300 740,200 650,250 560,220" fill="#DDA0DD" /> <rect x="550" y="330" width="200" height="50" rx="5" fill="white" filter="url(#dropShadow)" /> <text x="650" y="360" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#333">More Options</text> <!-- AI Icon --> <circle cx="100" cy="100" r="25" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="100" y="105" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#4158D0">AI</text> <!-- Title Overlay --> <rect x="60" y="320" width="430" height="60" fill="rgba(255,255,255,0.85)" rx="5" /> <text x="275" y="345" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#333">AI Background Generators</text> <text x="275" y="365" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#666">Transform your photos with stunning backgrounds</text> </svg>
๐Ÿ“„ ai-cartoon-effect.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#4158D0;stop-opacity:1" /> <stop offset="50%" style="stop-color:#C850C0;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFCC70;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Before/After Comparison --> <g transform="translate(50, 50)"> <!-- Original Photo --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Realistic Photo Representation --> <g transform="translate(20, 20)"> <rect x="0" y="0" width="260" height="260" fill="#f0f0f0" /> <!-- Simplified Realistic Portrait --> <g> <!-- Face --> <ellipse cx="130" cy="100" rx="80" ry="90" fill="#F5D0A9" /> <!-- Hair --> <path d="M50,100 C50,40 210,40 210,100 L210,60 C210,20 50,20 50,60 Z" fill="#8A4B08" /> <!-- Eyes --> <ellipse cx="100" cy="90" rx="12" ry="8" fill="white" stroke="#333" stroke-width="1" /> <ellipse cx="160" cy="90" rx="12" ry="8" fill="white" stroke="#333" stroke-width="1" /> <circle cx="100" cy="90" r="5" fill="#333" /> <circle cx="160" cy="90" r="5" fill="#333" /> <!-- Eyebrows --> <path d="M85,75 Q100,65 115,75" fill="none" stroke="#8A4B08" stroke-width="3" /> <path d="M145,75 Q160,65 175,75" fill="none" stroke="#8A4B08" stroke-width="3" /> <!-- Nose --> <path d="M130,95 Q135,115 130,120 Q125,115 130,95" fill="#F5D0A9" stroke="#333" stroke-width="1" /> <!-- Mouth --> <path d="M110,140 Q130,150 150,140" fill="none" stroke="#333" stroke-width="2" /> <!-- Neck --> <path d="M110,190 L110,260 L150,260 L150,190" fill="#F5D0A9" /> <!-- Shirt --> <path d="M50,260 L110,190 L150,190 L210,260" fill="#5882FA" /> <!-- Realistic Details --> <path d="M100,85 Q100,83 102,83" fill="none" stroke="#333" stroke-width="0.5" /> <path d="M160,85 Q160,83 162,83" fill="none" stroke="#333" stroke-width="0.5" /> <path d="M125,140 Q130,142 135,140" fill="none" stroke="#333" stroke-width="0.5" /> <path d="M70,100 Q65,110 70,120" fill="none" stroke="#8A4B08" stroke-width="0.5" /> <path d="M190,100 Q195,110 190,120" fill="none" stroke="#8A4B08" stroke-width="0.5" /> </g> <!-- "Original Photo" Label --> <rect x="10" y="220" width="120" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="70" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Original Photo</text> </g> </g> <!-- Cartoon Version --> <g transform="translate(450, 50)"> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Cartoon Representation --> <g transform="translate(20, 20)"> <rect x="0" y="0" width="260" height="260" fill="#f0f0f0" /> <!-- Cartoon Style Portrait --> <g> <!-- Face --> <ellipse cx="130" cy="100" rx="80" ry="90" fill="#FFD59E" stroke="#000" stroke-width="3" /> <!-- Hair --> <path d="M50,100 C50,40 210,40 210,100 L210,60 C210,20 50,20 50,60 Z" fill="#6E2C00" stroke="#000" stroke-width="3" /> <!-- Eyes (Larger, More Expressive) --> <ellipse cx="100" cy="90" rx="15" ry="12" fill="white" stroke="#000" stroke-width="3" /> <ellipse cx="160" cy="90" rx="15" ry="12" fill="white" stroke="#000" stroke-width="3" /> <circle cx="100" cy="90" r="7" fill="#000" /> <circle cx="160" cy="90" r="7" fill="#000" /> <circle cx="103" cy="87" r="2" fill="white" /> <circle cx="163" cy="87" r="2" fill="white" /> <!-- Eyebrows (Exaggerated) --> <path d="M85,70 Q100,55 115,70" fill="none" stroke="#000" stroke-width="4" /> <path d="M145,70 Q160,55 175,70" fill="none" stroke="#000" stroke-width="4" /> <!-- Nose (Simplified) --> <path d="M130,95 Q140,115 130,120" fill="none" stroke="#000" stroke-width="3" /> <!-- Mouth (More Expressive) --> <path d="M110,140 Q130,155 150,140" fill="none" stroke="#000" stroke-width="3" /> <!-- Neck --> <path d="M110,190 L110,260 L150,260 L150,190" fill="#FFD59E" stroke="#000" stroke-width="3" /> <!-- Shirt --> <path d="M50,260 L110,190 L150,190 L210,260" fill="#5DADE2" stroke="#000" stroke-width="3" /> <!-- Cartoon Effects --> <circle cx="70" cy="70" r="5" fill="none" stroke="#000" stroke-width="1" /> <circle cx="75" cy="65" r="3" fill="none" stroke="#000" stroke-width="1" /> <path d="M190,70 L200,60" stroke="#000" stroke-width="1" /> <path d="M195,70 L205,60" stroke="#000" stroke-width="1" /> </g> <!-- "Cartoon Effect" Label --> <rect x="10" y="220" width="120" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="70" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Cartoon Effect</text> </g> </g> <!-- AI Transformation Arrow --> <g transform="translate(370, 150)"> <circle cx="0" cy="0" r="30" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="0" y="5" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#4158D0">AI</text> <path d="M-15,0 L15,0 M5,-10 L15,0 L5,10" stroke="#4158D0" stroke-width="3" fill="none" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">AI Cartoon Effect Transformation</text> </svg>
๐Ÿ“„ ai-image-enhancement.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#667eea;stop-opacity:1" /> <stop offset="100%" style="stop-color:#764ba2;stop-opacity:1" /> </linearGradient> <linearGradient id="cardGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#ffffff;stop-opacity:0.95" /> <stop offset="100%" style="stop-color:#f8fafc;stop-opacity:0.95" /> </linearGradient> <filter id="glow"> <feGaussianBlur stdDeviation="3" result="coloredBlur"/> <feMerge> <feMergeNode in="coloredBlur"/> <feMergeNode in="SourceGraphic"/> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)"/> <!-- Floating particles --> <circle cx="100" cy="80" r="3" fill="#ffffff" opacity="0.6"> <animate attributeName="cy" values="80;60;80" dur="3s" repeatCount="indefinite"/> </circle> <circle cx="700" cy="120" r="2" fill="#ffffff" opacity="0.4"> <animate attributeName="cy" values="120;100;120" dur="4s" repeatCount="indefinite"/> </circle> <circle cx="650" cy="300" r="2.5" fill="#ffffff" opacity="0.5"> <animate attributeName="cy" values="300;280;300" dur="3.5s" repeatCount="indefinite"/> </circle> <!-- Main content card --> <rect x="100" y="60" width="600" height="280" rx="20" fill="url(#cardGradient)" filter="url(#glow)"/> <!-- Before/After image representation --> <g transform="translate(130, 90)"> <!-- Before image (left) --> <rect x="0" y="0" width="120" height="80" rx="8" fill="#e2e8f0" stroke="#cbd5e1" stroke-width="2"/> <text x="60" y="45" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#64748b">Before</text> <!-- Pixelated/low quality effect --> <rect x="10" y="10" width="8" height="8" fill="#94a3b8"/> <rect x="20" y="10" width="8" height="8" fill="#cbd5e1"/> <rect x="30" y="10" width="8" height="8" fill="#94a3b8"/> <rect x="10" y="20" width="8" height="8" fill="#cbd5e1"/> <rect x="20" y="20" width="8" height="8" fill="#94a3b8"/> <rect x="30" y="20" width="8" height="8" fill="#cbd5e1"/> </g> <!-- Arrow --> <g transform="translate(280, 120)"> <path d="M0,10 L30,10 M25,5 L30,10 L25,15" stroke="#667eea" stroke-width="3" fill="none" stroke-linecap="round"/> <text x="15" y="35" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#667eea" font-weight="bold">AI</text> </g> <!-- After image (right) --> <g transform="translate(340, 90)"> <rect x="0" y="0" width="120" height="80" rx="8" fill="#f0f9ff" stroke="#0ea5e9" stroke-width="2"/> <text x="60" y="45" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#0369a1">After</text> <!-- High quality/enhanced effect --> <circle cx="30" cy="25" r="8" fill="#38bdf8" opacity="0.7"/> <circle cx="50" cy="35" r="6" fill="#0ea5e9" opacity="0.8"/> <circle cx="70" cy="25" r="7" fill="#38bdf8" opacity="0.6"/> <path d="M20,50 Q40,40 60,50 Q80,60 100,50" stroke="#0ea5e9" stroke-width="2" fill="none"/> </g> <!-- AI Enhancement Icons --> <g transform="translate(500, 100)"> <!-- Brightness icon --> <circle cx="20" cy="20" r="8" fill="#fbbf24" opacity="0.8"/> <path d="M20,5 L20,10 M35,20 L30,20 M20,35 L20,30 M5,20 L10,20 M29.14,10.86 L25.86,14.14 M29.14,29.14 L25.86,25.86 M10.86,10.86 L14.14,14.14 M10.86,29.14 L14.14,25.86" stroke="#f59e0b" stroke-width="1.5" stroke-linecap="round"/> <!-- Contrast icon --> <g transform="translate(0, 50)"> <circle cx="20" cy="20" r="12" fill="#6b7280"/> <path d="M20,8 A12,12 0 0,1 20,32 Z" fill="#ffffff"/> </g> <!-- Sharpness icon --> <g transform="translate(50, 20)"> <polygon points="20,5 30,25 10,25" fill="#8b5cf6" opacity="0.8"/> <polygon points="20,8 27,22 13,22" fill="#ffffff"/> </g> </g> <!-- Title --> <text x="400" y="250" text-anchor="middle" font-family="Arial, sans-serif" font-size="24" font-weight="bold" fill="#1e293b">AI Image Enhancement</text> <text x="400" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#64748b">Transform Your Photos with Artificial Intelligence</text> <!-- Decorative elements --> <g transform="translate(150, 300)"> <rect x="0" y="0" width="40" height="4" rx="2" fill="#667eea" opacity="0.6"/> <rect x="50" y="0" width="60" height="4" rx="2" fill="#764ba2" opacity="0.4"/> <rect x="120" y="0" width="30" height="4" rx="2" fill="#667eea" opacity="0.8"/> </g> <g transform="translate(450, 300)"> <rect x="0" y="0" width="50" height="4" rx="2" fill="#764ba2" opacity="0.5"/> <rect x="60" y="0" width="35" height="4" rx="2" fill="#667eea" opacity="0.7"/> <rect x="105" y="0" width="45" height="4" rx="2" fill="#764ba2" opacity="0.6"/> </g> </svg>
๐Ÿ“„ ai-photo-upscaling.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#4158D0;stop-opacity:1" /> <stop offset="50%" style="stop-color:#C850C0;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFCC70;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Main Comparison Area --> <g transform="translate(50, 50)"> <!-- Before Image (Low Resolution) --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Pixelated Image Representation --> <g transform="translate(20, 20)"> <!-- Create a grid of large pixels to represent low resolution --> <rect x="0" y="0" width="260" height="260" fill="#f0f0f0" /> <!-- Pixelated Mountain Scene --> <g> <!-- Sky --> <rect x="0" y="0" width="260" height="130" fill="#87CEEB" /> <!-- Mountains --> <polygon points="0,130 50,70 100,110 150,50 200,90 260,30 260,130" fill="#6B8E23" /> <!-- Ground --> <rect x="0" y="130" width="260" height="130" fill="#8B4513" /> <!-- Sun --> <circle cx="220" cy="40" r="20" fill="#FFD700" /> <!-- Visible Pixels Grid --> <g stroke="#ddd" stroke-width="1"> <path d="M0,0 L0,260" /> <path d="M20,0 L20,260" /> <path d="M40,0 L40,260" /> <path d="M60,0 L60,260" /> <path d="M80,0 L80,260" /> <path d="M100,0 L100,260" /> <path d="M120,0 L120,260" /> <path d="M140,0 L140,260" /> <path d="M160,0 L160,260" /> <path d="M180,0 L180,260" /> <path d="M200,0 L200,260" /> <path d="M220,0 L220,260" /> <path d="M240,0 L240,260" /> <path d="M260,0 L260,260" /> <path d="M0,0 L260,0" /> <path d="M0,20 L260,20" /> <path d="M0,40 L260,40" /> <path d="M0,60 L260,60" /> <path d="M0,80 L260,80" /> <path d="M0,100 L260,100" /> <path d="M0,120 L260,120" /> <path d="M0,140 L260,140" /> <path d="M0,160 L260,160" /> <path d="M0,180 L260,180" /> <path d="M0,200 L260,200" /> <path d="M0,220 L260,220" /> <path d="M0,240 L260,240" /> <path d="M0,260 L260,260" /> </g> </g> <!-- "Low Resolution" Label --> <rect x="10" y="220" width="120" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="70" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Low Resolution</text> </g> </g> <!-- After Image (High Resolution) --> <g transform="translate(450, 50)"> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Smooth Image Representation --> <g transform="translate(20, 20)"> <rect x="0" y="0" width="260" height="260" fill="#f0f0f0" /> <!-- Smooth Mountain Scene --> <g> <!-- Sky with Gradient --> <linearGradient id="skyGradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:#1E90FF;stop-opacity:1" /> <stop offset="100%" style="stop-color:#87CEEB;stop-opacity:1" /> </linearGradient> <rect x="0" y="0" width="260" height="130" fill="url(#skyGradient)" /> <!-- Mountains with Details --> <linearGradient id="mountainGradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:#228B22;stop-opacity:1" /> <stop offset="100%" style="stop-color:#6B8E23;stop-opacity:1" /> </linearGradient> <path d="M0,130 Q25,100 50,70 Q75,90 100,110 Q125,80 150,50 Q175,70 200,90 Q230,60 260,30 L260,130 Z" fill="url(#mountainGradient)" /> <!-- Mountain Details --> <path d="M30,100 L40,90 L50,100" stroke="#228B22" stroke-width="1" fill="none" /> <path d="M80,90 L90,80 L100,90" stroke="#228B22" stroke-width="1" fill="none" /> <path d="M130,70 L140,60 L150,70" stroke="#228B22" stroke-width="1" fill="none" /> <path d="M180,80 L190,70 L200,80" stroke="#228B22" stroke-width="1" fill="none" /> <!-- Ground with Texture --> <linearGradient id="groundGradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:#8B4513;stop-opacity:1" /> <stop offset="100%" style="stop-color:#A0522D;stop-opacity:1" /> </linearGradient> <rect x="0" y="130" width="260" height="130" fill="url(#groundGradient)" /> <!-- Ground Details --> <path d="M20,150 L30,150" stroke="#A0522D" stroke-width="1" /> <path d="M50,170 L70,170" stroke="#A0522D" stroke-width="1" /> <path d="M100,160 L120,160" stroke="#A0522D" stroke-width="1" /> <path d="M150,180 L180,180" stroke="#A0522D" stroke-width="1" /> <path d="M200,150 L220,150" stroke="#A0522D" stroke-width="1" /> <!-- Sun with Glow --> <radialGradient id="sunGradient" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:#FFFF00;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFD700;stop-opacity:1" /> </radialGradient> <circle cx="220" cy="40" r="20" fill="url(#sunGradient)" /> <circle cx="220" cy="40" r="25" fill="none" stroke="#FFD700" stroke-width="1" opacity="0.5" /> <circle cx="220" cy="40" r="30" fill="none" stroke="#FFD700" stroke-width="1" opacity="0.3" /> </g> <!-- "High Resolution" Label --> <rect x="10" y="220" width="120" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="70" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">High Resolution</text> </g> </g> <!-- AI Upscaling Arrow --> <g transform="translate(370, 150)"> <circle cx="0" cy="0" r="30" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="0" y="5" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#4158D0">AI</text> <path d="M-15,0 L15,0 M5,-10 L15,0 L5,10" stroke="#4158D0" stroke-width="3" fill="none" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">AI Photo Upscaling Technology</text> </svg>
๐Ÿ“„ ai-portrait-enhancement.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#4158D0;stop-opacity:1" /> <stop offset="50%" style="stop-color:#C850C0;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFCC70;stop-opacity:1" /> </linearGradient> <linearGradient id="portraitGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#F5F5F5;stop-opacity:1" /> <stop offset="100%" style="stop-color:#E0E0E0;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Before/After Portrait Frames --> <g transform="translate(50, 50)"> <!-- Before Portrait --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <rect x="10" y="10" width="280" height="280" rx="5" fill="url(#portraitGradient)" /> <!-- Simplified Portrait Face (Before) --> <circle cx="150" cy="100" r="70" fill="#F8D0C3" /> <ellipse cx="120" cy="90" rx="10" ry="8" fill="#333" /> <ellipse cx="180" cy="90" rx="10" ry="8" fill="#333" /> <path d="M150,120 Q170,140 150,150 Q130,140 150,120" fill="#E57373" /> <path d="M100,80 Q150,60 200,80" fill="none" stroke="#333" stroke-width="2" /> <path d="M90,180 Q150,220 210,180" fill="none" stroke="#333" stroke-width="2" /> <!-- Body (Before) --> <path d="M90,170 L60,300 L240,300 L210,170" fill="#A1887F" /> <!-- "Before" Label --> <rect x="10" y="250" width="80" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="50" y="270" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="white">Before</text> </g> <g transform="translate(450, 50)"> <!-- After Portrait --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <rect x="10" y="10" width="280" height="280" rx="5" fill="url(#portraitGradient)" /> <!-- Simplified Portrait Face (After - Enhanced) --> <circle cx="150" cy="100" r="70" fill="#FFDDC1" /> <ellipse cx="120" cy="90" rx="10" ry="8" fill="#333" /> <ellipse cx="180" cy="90" rx="10" ry="8" fill="#333" /> <path d="M150,120 Q170,140 150,150 Q130,140 150,120" fill="#FF5252" /> <path d="M100,80 Q150,60 200,80" fill="none" stroke="#333" stroke-width="2" /> <path d="M90,180 Q150,220 210,180" fill="none" stroke="#333" stroke-width="2" /> <!-- Body (After) --> <path d="M90,170 L60,300 L240,300 L210,170" fill="#8D6E63" /> <!-- Enhancement Effects --> <circle cx="120" cy="90" r="15" fill="none" stroke="#4FC3F7" stroke-width="2" stroke-dasharray="2,2" /> <circle cx="180" cy="90" r="15" fill="none" stroke="#4FC3F7" stroke-width="2" stroke-dasharray="2,2" /> <path d="M100,80 Q150,60 200,80" fill="none" stroke="#4FC3F7" stroke-width="2" stroke-dasharray="2,2" /> <path d="M90,180 Q150,220 210,180" fill="none" stroke="#4FC3F7" stroke-width="2" stroke-dasharray="2,2" /> <!-- "After" Label --> <rect x="10" y="250" width="80" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="50" y="270" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="white">After</text> </g> <!-- AI Enhancement Icons --> <g transform="translate(400, 150)"> <circle cx="0" cy="0" r="25" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="0" y="5" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#4158D0">AI</text> <path d="M-15,-15 L15,15" stroke="#4FC3F7" stroke-width="2" /> <path d="M15,-15 L-15,15" stroke="#4FC3F7" stroke-width="2" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">AI Portrait Enhancement Techniques</text> </svg>
๐Ÿ“„ easter-card-messages.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#65C7F7;stop-opacity:1" /> <stop offset="50%" style="stop-color:#0052D4;stop-opacity:1" /> <stop offset="100%" style="stop-color:#9CECFB;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> <pattern id="eggPattern" width="60" height="60" patternUnits="userSpaceOnUse"> <circle cx="30" cy="30" r="25" fill="#FFD700" stroke="#FFA500" stroke-width="1" /> <path d="M20,20 Q30,10 40,20 Q50,30 40,40 Q30,50 20,40 Q10,30 20,20 Z" fill="none" stroke="#FF6347" stroke-width="1" /> <circle cx="25" cy="25" r="3" fill="#FF6347" /> <circle cx="35" cy="25" r="3" fill="#FF6347" /> <circle cx="30" cy="35" r="3" fill="#FF6347" /> </pattern> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Main Content Area --> <g transform="translate(50, 50)"> <!-- Easter Card 1 - Traditional --> <g transform="translate(0, 0)"> <rect x="0" y="0" width="200" height="300" rx="10" fill="#FFFAF0" filter="url(#dropShadow)" /> <!-- Card Content --> <g transform="translate(20, 20)"> <!-- Easter Egg Decoration --> <ellipse cx="80" cy="60" rx="50" ry="60" fill="#FFB6C1" /> <ellipse cx="80" cy="60" rx="40" ry="50" fill="#FFC0CB" /> <!-- Easter Egg Patterns --> <path d="M60,40 Q80,30 100,40" stroke="#FFF" stroke-width="2" fill="none" /> <path d="M60,60 Q80,50 100,60" stroke="#FFF" stroke-width="2" fill="none" /> <path d="M60,80 Q80,70 100,80" stroke="#FFF" stroke-width="2" fill="none" /> <circle cx="70" cy="50" r="5" fill="#FFF" /> <circle cx="90" cy="50" r="5" fill="#FFF" /> <circle cx="70" cy="70" r="5" fill="#FFF" /> <circle cx="90" cy="70" r="5" fill="#FFF" /> <!-- Card Text --> <text x="80" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">Happy Easter!</text> <rect x="20" y="170" width="120" height="1" fill="#DDD" /> <text x="80" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Wishing you a blessed</text> <text x="80" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">and joyful Easter</text> <text x="80" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">celebration with</text> <text x="80" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">your loved ones!</text> <!-- Card Label --> <rect x="10" y="250" width="140" height="20" rx="5" fill="rgba(0,0,0,0.1)" /> <text x="80" y="265" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#333">Traditional</text> </g> </g> <!-- Easter Card 2 - Funny --> <g transform="translate(220, 0)"> <rect x="0" y="0" width="200" height="300" rx="10" fill="#E6F7FF" filter="url(#dropShadow)" /> <!-- Card Content --> <g transform="translate(20, 20)"> <!-- Cartoon Bunny --> <ellipse cx="80" cy="70" rx="50" ry="60" fill="#FFF" /> <!-- Bunny Ears --> <path d="M60,40 Q60,0 80,20 Q100,0 100,40" fill="#FFF" stroke="#DDD" stroke-width="1" /> <!-- Bunny Face --> <circle cx="70" cy="60" r="5" fill="#333" /> <circle cx="90" cy="60" r="5" fill="#333" /> <!-- Bunny Nose --> <ellipse cx="80" cy="75" rx="7" ry="5" fill="#FFB6C1" /> <!-- Bunny Mouth --> <path d="M75,85 Q80,90 85,85" stroke="#333" stroke-width="2" fill="none" /> <!-- Bunny Whiskers --> <line x1="60" y1="75" x2="73" y2="77" stroke="#999" stroke-width="1" /> <line x1="60" y1="80" x2="73" y2="80" stroke="#999" stroke-width="1" /> <line x1="87" y1="77" x2="100" y2="75" stroke="#999" stroke-width="1" /> <line x1="87" y1="80" x2="100" y2="80" stroke="#999" stroke-width="1" /> <!-- Card Text --> <text x="80" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">Hoppy Easter!</text> <rect x="20" y="170" width="120" height="1" fill="#DDD" /> <text x="80" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">I'm not saying you're</text> <text x="80" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">old, but the Easter</text> <text x="80" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Bunny needs GPS to</text> <text x="80" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">find your house!</text> <!-- Card Label --> <rect x="10" y="250" width="140" height="20" rx="5" fill="rgba(0,0,0,0.1)" /> <text x="80" y="265" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#333">Funny</text> </g> </g> <!-- Easter Card 3 - Religious --> <g transform="translate(440, 0)"> <rect x="0" y="0" width="200" height="300" rx="10" fill="#F0F8FF" filter="url(#dropShadow)" /> <!-- Card Content --> <g transform="translate(20, 20)"> <!-- Cross Symbol --> <rect x="70" y="20" width="20" height="80" fill="#FFD700" /> <rect x="40" y="40" width="80" height="20" fill="#FFD700" /> <!-- Light Rays --> <path d="M80,10 L80,0 M60,20 L50,10 M100,20 L110,10 M40,60 L30,60 M120,60 L130,60 M60,100 L50,110 M100,100 L110,110" stroke="#FFD700" stroke-width="2" /> <!-- Card Text --> <text x="80" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">He Is Risen</text> <rect x="20" y="170" width="120" height="1" fill="#DDD" /> <text x="80" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">May the miracle of</text> <text x="80" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Easter bring you</text> <text x="80" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">renewed hope, faith,</text> <text x="80" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">love, and joy.</text> <!-- Card Label --> <rect x="10" y="250" width="140" height="20" rx="5" fill="rgba(0,0,0,0.1)" /> <text x="80" y="265" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#333">Religious</text> </g> </g> </g> <!-- Easter Basket with Message Cards --> <g transform="translate(650, 200)"> <!-- Basket --> <path d="M0,50 C0,20 100,20 100,50 L100,100 C100,120 0,120 0,100 Z" fill="#D2B48C" stroke="#8B4513" stroke-width="2" /> <path d="M0,50 C0,70 100,70 100,50" fill="none" stroke="#8B4513" stroke-width="2" /> <path d="M40,0 C50,-10 50,-10 60,0" fill="none" stroke="#8B4513" stroke-width="4" /> <!-- Easter Eggs in Basket --> <ellipse cx="30" cy="70" rx="15" ry="20" fill="#FF6347" stroke="#FFF" stroke-width="1" /> <ellipse cx="50" cy="80" rx="15" ry="20" fill="#4169E1" stroke="#FFF" stroke-width="1" /> <ellipse cx="70" cy="70" rx="15" ry="20" fill="#32CD32" stroke="#FFF" stroke-width="1" /> <!-- Message Cards --> <rect x="20" y="40" width="20" height="30" rx="2" fill="#FFF" transform="rotate(-15,20,40)" /> <rect x="60" y="35" width="20" height="30" rx="2" fill="#FFF" transform="rotate(15,60,35)" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">Easter Card Message Ideas</text> </svg>
๐Ÿ“„ holi-photoshoot-ideas.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#FF416C;stop-opacity:1" /> <stop offset="50%" style="stop-color:#FF4B2B;stop-opacity:1" /> <stop offset="100%" style="stop-color:#F76B1C;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> <radialGradient id="colorSplash" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:#FF1493;stop-opacity:0.8" /> <stop offset="25%" style="stop-color:#9400D3;stop-opacity:0.8" /> <stop offset="50%" style="stop-color:#0000FF;stop-opacity:0.8" /> <stop offset="75%" style="stop-color:#00FF00;stop-opacity:0.8" /> <stop offset="100%" style="stop-color:#FFFF00;stop-opacity:0.8" /> </radialGradient> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Main Content Area --> <g transform="translate(50, 50)"> <!-- Photo Frame 1 - Portrait --> <g transform="translate(0, 0)"> <rect x="0" y="0" width="200" height="250" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Photo Content --> <g transform="translate(10, 10)"> <rect x="0" y="0" width="180" height="230" fill="#f0f0f0" /> <!-- Silhouette of Person with Color Splash --> <g> <!-- Background --> <rect x="0" y="0" width="180" height="230" fill="#f8f8f8" /> <!-- Person Silhouette --> <path d="M90,50 C110,50 120,65 120,80 C120,95 110,105 100,110 L105,160 L115,230 L65,230 L75,160 L80,110 C70,105 60,95 60,80 C60,65 70,50 90,50 Z" fill="#333" /> <!-- Color Splashes --> <circle cx="60" cy="70" r="20" fill="#FF1493" opacity="0.7" /> <circle cx="120" cy="70" r="25" fill="#9400D3" opacity="0.7" /> <circle cx="90" cy="120" r="30" fill="#0000FF" opacity="0.7" /> <circle cx="50" cy="150" r="25" fill="#00FF00" opacity="0.7" /> <circle cx="130" cy="150" r="20" fill="#FFFF00" opacity="0.7" /> <circle cx="90" cy="190" r="35" fill="#FF4500" opacity="0.7" /> </g> <!-- "Portrait" Label --> <rect x="10" y="190" width="70" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="45" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Portrait</text> </g> </g> <!-- Photo Frame 2 - Group Shot --> <g transform="translate(220, 0)"> <rect x="0" y="0" width="280" height="180" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Photo Content --> <g transform="translate(10, 10)"> <rect x="0" y="0" width="260" height="160" fill="#f0f0f0" /> <!-- Group Silhouettes with Color Splash --> <g> <!-- Background --> <rect x="0" y="0" width="260" height="160" fill="#f8f8f8" /> <!-- Group Silhouettes --> <path d="M50,50 C60,50 65,60 65,70 C65,80 60,85 55,90 L58,120 L62,160 L38,160 L42,120 L45,90 C40,85 35,80 35,70 C35,60 40,50 50,50 Z" fill="#333" /> <path d="M100,40 C115,40 125,55 125,70 C125,85 115,95 105,100 L110,130 L115,160 L85,160 L90,130 L95,100 C85,95 75,85 75,70 C75,55 85,40 100,40 Z" fill="#333" /> <path d="M150,45 C160,45 165,55 165,65 C165,75 160,80 155,85 L158,120 L162,160 L138,160 L142,120 L145,85 C140,80 135,75 135,65 C135,55 140,45 150,45 Z" fill="#333" /> <path d="M200,50 C210,50 215,60 215,70 C215,80 210,85 205,90 L208,120 L212,160 L188,160 L192,120 L195,90 C190,85 185,80 185,70 C185,60 190,50 200,50 Z" fill="#333" /> <!-- Color Splashes --> <circle cx="50" cy="40" r="25" fill="#FF1493" opacity="0.7" /> <circle cx="100" cy="30" r="30" fill="#9400D3" opacity="0.7" /> <circle cx="150" cy="35" r="25" fill="#0000FF" opacity="0.7" /> <circle cx="200" cy="40" r="30" fill="#00FF00" opacity="0.7" /> <circle cx="75" cy="100" r="40" fill="#FFFF00" opacity="0.7" /> <circle cx="175" cy="100" r="40" fill="#FF4500" opacity="0.7" /> </g> <!-- "Group Shot" Label --> <rect x="10" y="120" width="90" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="55" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Group Shot</text> </g> </g> <!-- Photo Frame 3 - Action Shot --> <g transform="translate(220, 200)"> <rect x="0" y="0" width="280" height="150" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Photo Content --> <g transform="translate(10, 10)"> <rect x="0" y="0" width="260" height="130" fill="#f0f0f0" /> <!-- Action Shot with Color Splash --> <g> <!-- Background --> <rect x="0" y="0" width="260" height="130" fill="#f8f8f8" /> <!-- Person Silhouette in Motion --> <path d="M80,30 C95,30 105,40 105,55 C105,70 95,80 85,85 L75,100 C90,95 110,105 120,115 L130,130 L50,130 L60,100 L65,85 C55,80 45,70 45,55 C45,40 65,30 80,30 Z" fill="#333" /> <!-- Color Splash Motion Effect --> <path d="M130,30 C180,50 200,90 220,130 L130,130 Z" fill="url(#colorSplash)" opacity="0.6" /> <path d="M30,30 C10,50 0,90 0,130 L80,130 Z" fill="url(#colorSplash)" opacity="0.6" /> </g> <!-- "Action Shot" Label --> <rect x="10" y="90" width="90" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="55" y="110" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Action Shot</text> </g> </g> <!-- Photo Frame 4 - Detail Shot --> <g transform="translate(0, 270)"> <rect x="0" y="0" width="200" height="130" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Photo Content --> <g transform="translate(10, 10)"> <rect x="0" y="0" width="180" height="110" fill="#f0f0f0" /> <!-- Detail Shot with Color Powder --> <g> <!-- Background --> <rect x="0" y="0" width="180" height="110" fill="#f8f8f8" /> <!-- Hand Silhouette --> <path d="M60,30 C70,20 90,15 100,25 C110,15 130,20 140,30 C150,40 150,60 140,80 C130,100 110,110 100,110 C90,110 70,100 60,80 C50,60 50,40 60,30 Z" fill="#333" /> <!-- Color Powder in Hand --> <circle cx="100" cy="60" r="30" fill="#FF1493" opacity="0.8" /> <circle cx="100" cy="60" r="20" fill="#9400D3" opacity="0.8" /> <circle cx="100" cy="60" r="10" fill="#FFFF00" opacity="0.8" /> </g> <!-- "Detail Shot" Label --> <rect x="10" y="70" width="90" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="55" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Detail Shot</text> </g> </g> </g> <!-- Camera Icon --> <g transform="translate(600, 200)"> <circle cx="0" cy="0" r="50" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <!-- Camera Body --> <rect x="-30" y="-15" width="60" height="40" rx="5" fill="#333" /> <!-- Camera Lens --> <circle cx="0" cy="5" r="15" fill="#666" /> <circle cx="0" cy="5" r="10" fill="#444" /> <circle cx="0" cy="5" r="5" fill="#222" /> <!-- Camera Flash --> <rect x="-20" y="-25" width="15" height="10" rx="2" fill="#666" /> <!-- Camera Button --> <circle cx="25" cy="-5" r="5" fill="#FF4500" /> <!-- Color Splash from Camera --> <circle cx="0" cy="5" r="60" fill="none" stroke="url(#colorSplash)" stroke-width="5" stroke-dasharray="5,5" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">Holi Photoshoot Ideas</text> </svg>
๐Ÿ“„ remove-background-guide.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#4158D0;stop-opacity:1" /> <stop offset="50%" style="stop-color:#C850C0;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFCC70;stop-opacity:1" /> </linearGradient> <filter id="dropShadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="5" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.3" /> </feComponentTransfer> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> <!-- Background --> <rect width="800" height="400" fill="url(#bgGradient)" /> <!-- Main Image Area --> <g transform="translate(50, 50)"> <!-- Original Image Frame --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Original Image Content --> <g transform="translate(20, 20)"> <rect x="0" y="0" width="260" height="260" fill="#f0f0f0" /> <!-- Simple Product Photo with Background --> <rect x="0" y="0" width="260" height="260" fill="#E0E0E0" /> <!-- Background Elements --> <rect x="0" y="130" width="260" height="130" fill="#D0D0D0" /> <circle cx="50" cy="50" r="30" fill="#C0C0C0" /> <rect x="180" y="30" width="50" height="80" fill="#C0C0C0" /> <!-- Product (Bottle) --> <g> <!-- Bottle Body --> <rect x="100" y="80" width="60" height="140" rx="10" fill="#FFFFFF" stroke="#CCCCCC" stroke-width="1" /> <!-- Bottle Cap --> <rect x="110" y="60" width="40" height="20" rx="5" fill="#4FC3F7" /> <!-- Bottle Label --> <rect x="105" y="120" width="50" height="70" rx="5" fill="#E1F5FE" /> <line x1="110" y1="135" x2="150" y2="135" stroke="#333" stroke-width="1" /> <line x1="110" y1="145" x2="150" y2="145" stroke="#333" stroke-width="1" /> <line x1="110" y1="155" x2="140" y2="155" stroke="#333" stroke-width="1" /> <line x1="110" y1="165" x2="130" y2="165" stroke="#333" stroke-width="1" /> </g> <!-- "Original" Label --> <rect x="10" y="220" width="80" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="50" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Original</text> </g> </g> <!-- Processed Image Area --> <g transform="translate(450, 50)"> <!-- Processed Image Frame --> <rect x="0" y="0" width="300" height="300" rx="10" fill="white" filter="url(#dropShadow)" /> <!-- Transparent Background Representation --> <g transform="translate(20, 20)"> <!-- Checkered Background to Represent Transparency --> <pattern id="checkerPattern" width="20" height="20" patternUnits="userSpaceOnUse"> <rect width="10" height="10" fill="#F5F5F5" /> <rect x="10" y="0" width="10" height="10" fill="#E0E0E0" /> <rect x="0" y="10" width="10" height="10" fill="#E0E0E0" /> <rect x="10" y="10" width="10" height="10" fill="#F5F5F5" /> </pattern> <rect x="0" y="0" width="260" height="260" fill="url(#checkerPattern)" /> <!-- Product (Bottle) with No Background --> <g> <!-- Bottle Body --> <rect x="100" y="80" width="60" height="140" rx="10" fill="#FFFFFF" stroke="#CCCCCC" stroke-width="1" /> <!-- Bottle Cap --> <rect x="110" y="60" width="40" height="20" rx="5" fill="#4FC3F7" /> <!-- Bottle Label --> <rect x="105" y="120" width="50" height="70" rx="5" fill="#E1F5FE" /> <line x1="110" y1="135" x2="150" y2="135" stroke="#333" stroke-width="1" /> <line x1="110" y1="145" x2="150" y2="145" stroke="#333" stroke-width="1" /> <line x1="110" y1="155" x2="140" y2="155" stroke="#333" stroke-width="1" /> <line x1="110" y1="165" x2="130" y2="165" stroke="#333" stroke-width="1" /> </g> <!-- Selection Outline Effect --> <rect x="95" y="55" width="70" height="170" rx="12" fill="none" stroke="#4FC3F7" stroke-width="2" stroke-dasharray="5,5" /> <!-- "Background Removed" Label --> <rect x="10" y="220" width="140" height="30" rx="5" fill="rgba(0,0,0,0.5)" /> <text x="80" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="white">Background Removed</text> </g> </g> <!-- AI Processing Arrow --> <g transform="translate(370, 150)"> <circle cx="0" cy="0" r="30" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="0" y="5" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#4158D0">AI</text> <path d="M-15,0 L15,0 M5,-10 L15,0 L5,10" stroke="#4158D0" stroke-width="3" fill="none" /> </g> <!-- Title --> <rect x="200" y="360" width="400" height="30" rx="5" fill="rgba(255,255,255,0.9)" filter="url(#dropShadow)" /> <text x="400" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#333">How to Remove Background from Photos</text> </svg>
๐Ÿ“„ studio-ghibli-ai-art.svg
<svg width="800" height="400" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="skyGradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:#87CEEB;stop-opacity:1" /> <stop offset="100%" style="stop-color:#E0F6FF;stop-opacity:1" /> </linearGradient> <linearGradient id="grassGradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:#90EE90;stop-opacity:1" /> <stop offset="100%" style="stop-color:#228B22;stop-opacity:1" /> </linearGradient> <radialGradient id="sunGradient" cx="50%" cy="50%" r="50%"> <stop offset="0%" style="stop-color:#FFD700;stop-opacity:1" /> <stop offset="100%" style="stop-color:#FFA500;stop-opacity:0.8" /> </radialGradient> </defs> <!-- Sky background --> <rect width="800" height="280" fill="url(#skyGradient)"/> <!-- Clouds --> <ellipse cx="150" cy="80" rx="40" ry="20" fill="white" opacity="0.8"/> <ellipse cx="170" cy="75" rx="35" ry="18" fill="white" opacity="0.8"/> <ellipse cx="130" cy="85" rx="30" ry="15" fill="white" opacity="0.8"/> <ellipse cx="600" cy="60" rx="50" ry="25" fill="white" opacity="0.7"/> <ellipse cx="625" cy="55" rx="40" ry="20" fill="white" opacity="0.7"/> <ellipse cx="575" cy="65" rx="35" ry="18" fill="white" opacity="0.7"/> <!-- Sun --> <circle cx="700" cy="100" r="40" fill="url(#sunGradient)"/> <!-- Mountains --> <polygon points="0,280 200,150 400,200 800,120 800,280" fill="#8FBC8F" opacity="0.6"/> <polygon points="100,280 350,180 600,160 800,140 800,280" fill="#9ACD32" opacity="0.5"/> <!-- Ground --> <rect y="280" width="800" height="120" fill="url(#grassGradient)"/> <!-- Trees --> <ellipse cx="100" cy="250" rx="25" ry="40" fill="#228B22"/> <rect x="95" y="270" width="10" height="30" fill="#8B4513"/> <ellipse cx="300" cy="240" rx="30" ry="50" fill="#32CD32"/> <rect x="295" y="270" width="10" height="35" fill="#8B4513"/> <ellipse cx="500" cy="260" rx="20" ry="35" fill="#228B22"/> <rect x="495" y="280" width="10" height="25" fill="#8B4513"/> <!-- Floating elements (Ghibli style) --> <circle cx="250" cy="120" r="3" fill="white" opacity="0.8"/> <circle cx="400" cy="140" r="2" fill="white" opacity="0.6"/> <circle cx="550" cy="110" r="2.5" fill="white" opacity="0.7"/> <circle cx="320" cy="90" r="2" fill="white" opacity="0.5"/> <!-- Title overlay --> <rect x="50" y="320" width="700" height="60" fill="rgba(255,255,255,0.9)" rx="10"/> <text x="400" y="345" text-anchor="middle" font-family="Arial, sans-serif" font-size="24" font-weight="bold" fill="#2E8B57">Studio Ghibli AI Art Guide</text> <text x="400" y="365" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" fill="#666">Transform your photos into magical artwork</text> </svg>
๐Ÿ“„ robots.txt
๐Ÿ“„ eslint.config.js
import js from '@eslint/js'; import globals from 'globals'; import reactHooks from 'eslint-plugin-react-hooks'; import reactRefresh from 'eslint-plugin-react-refresh'; import tseslint from 'typescript-eslint'; export default tseslint.config( { ignores: ['dist'] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], }, } );
๐Ÿ“„ generate-multimedia-sitemap-simple.js
const fs = require('fs'); const path = require('path'); // Configuration const BASE_URL = 'https://modernphototools.com'; const OUTPUT_FILE = 'public/sitemap-multimedia.xml'; // Tool mapping for metadata const toolMetadata = { 'AI Avatar': { title: 'AI Avatar Generator Tool', description: 'Create stunning AI avatars from your photos with advanced artificial intelligence technology', duration: '45' }, 'AI Background Generator': { title: 'AI Background Generator Tool', description: 'Generate professional backgrounds for your photos using AI technology', duration: '60' }, 'AI Caricature': { title: 'AI Caricature Generator Tool', description: 'Transform your photos into fun caricatures with AI-powered technology', duration: '50' }, 'AI Cartoon': { title: 'AI Cartoon Generator Tool', description: 'Convert your photos into cartoon style images using advanced AI', duration: '55' }, 'AI Cleanup': { title: 'AI Cleanup Tool', description: 'Remove unwanted objects and clean up your photos with AI technology', duration: '40' }, 'AI Expand': { title: 'AI Expand Tool', description: 'Expand your images beyond their original boundaries using AI', duration: '65' }, 'AI Face Swap': { title: 'AI Face Swap Tool', description: 'Swap faces in photos seamlessly with advanced AI face recognition', duration: '45' }, 'AI Filter': { title: 'AI Filter Tool', description: 'Apply artistic filters to your photos using AI-powered technology', duration: '35' }, 'AI Hairstyle': { title: 'AI Hairstyle Tool', description: 'Try different hairstyles on your photos with AI technology', duration: '50' }, 'AI Image Generator_text-to-image': { title: 'AI Image Generator Tool', description: 'Generate images from text descriptions using advanced AI technology', duration: '70' }, 'AI Image Upscaler': { title: 'AI Image Upscaler Tool', description: 'Enhance and upscale your images with AI-powered technology', duration: '55' }, 'AI Image to Image': { title: 'AI Image to Image Tool', description: 'Transform images from one style to another using AI technology', duration: '60' }, 'AI Outfit': { title: 'AI Outfit Tool', description: 'Try different outfits on your photos with AI-powered fashion technology', duration: '55' }, 'AI Portrait': { title: 'AI Portrait Tool', description: 'Create professional portraits from your photos using AI technology', duration: '60' }, 'AI Product Photoshoot': { title: 'AI Product Photoshoot Tool', description: 'Create professional product photos with AI-powered background technology', duration: '65' }, 'AI Replace': { title: 'AI Replace Tool', description: 'Replace objects in photos seamlessly with AI technology', duration: '50' }, 'AI Sketch to Image': { title: 'AI Sketch to Image Tool', description: 'Convert sketches into realistic images using AI technology', duration: '75' }, 'Remove Background': { title: 'Remove Background Tool', description: 'Remove backgrounds from photos instantly with AI technology', duration: '30' } }; // Video files const videoFiles = [ 'AI Avatar.mp4', 'AI Background Generator.mp4', 'AI Caricature.mp4', 'AI Cartoon.mp4', 'AI Cleanup.mp4', 'AI Expand.mp4', 'AI Face Swap.mp4', 'AI Filter.mp4', 'AI Hairstyle.mp4', 'AI Image Generator_text-to-image.mp4', 'AI Image Upscaler.mp4', 'AI Image to Image.mp4', 'AI Outfit.mp4', 'AI Portrait.mp4', 'AI Product Photoshoot.mp4', 'AI Replace.mp4', 'AI Sketch to Image.mp4', 'Remove Background.mp4' ]; // Image files const imageFiles = [ 'AI Avatar Tool.jpg', 'AI Background Generator Tool.jpg', 'AI Caricature Generator Tool.jpg', 'AI Cartoon Tool.jpg', 'AI Cleanup Tool.jpg', 'Ai Expand tool.jpg', 'AI Face Swap Tool.jpg', 'AI Filter Tool.jpg', 'AI Hairstyle Tool.jpg', 'AI Image Generator Tool.jpg', 'AI Image Upscaler Tool.jpg', 'AI Image to Image Tool.jpg', 'AI Outfit Tool.jpg', 'AI Portrait Tool.jpg', 'AI Product Photoshoot Tool.jpg', 'AI Replace tool.jpg', 'AI Sketch to Image Tool.jpg', 'Remove Background tool.jpg' ]; function getCurrentDate() { return new Date().toISOString(); } function generateVideoEntry(filename) { const toolKey = filename.replace('.mp4', ''); const metadata = toolMetadata[toolKey] || { title: filename.replace('.mp4', ''), description: 'AI-powered photo editing tool video demonstration', duration: '60' }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + ' Tool.jpg')}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getCurrentDate(); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <video:video> <video:thumbnail_loc>${thumbnailUrl}</video:thumbnail_loc> <video:title>${metadata.title}</video:title> <video:description>${metadata.description}</video:description> <video:content_loc>${videoUrl}</video:content_loc> <video:duration>${metadata.duration}</video:duration> <video:publication_date>${lastmod}</video:publication_date> <video:family_friendly>yes</video:family_friendly> <video:tag>AI tools</video:tag> <video:tag>photo editing</video:tag> <video:tag>artificial intelligence</video:tag> <video:tag>image processing</video:tag> </video:video> </url>`; } function generateImageEntry(filename) { const toolKey = filename.replace(' Tool.jpg', '').replace('.jpg', ''); const metadata = toolMetadata[toolKey] || { title: filename.replace('.jpg', ''), description: 'AI-powered photo editing tool demonstration image' }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getCurrentDate(); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <image:image> <image:loc>${imageUrl}</image:loc> <image:title>${metadata.title}</image:title> <image:caption>${metadata.description}</image:caption> <image:license>${BASE_URL}/terms-of-use</image:license> <image:geo_location>Global</image:geo_location> </image:image> </url>`; } function generateMultimediaSitemap() { console.log('Generating multimedia sitemap...'); let xmlContent = `<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> `; // Add video entries console.log(`Processing ${videoFiles.length} video files...`); videoFiles.forEach(filename => { xmlContent += generateVideoEntry(filename) + '\n'; }); // Add image entries console.log(`Processing ${imageFiles.length} image files...`); imageFiles.forEach(filename => { xmlContent += generateImageEntry(filename) + '\n'; }); xmlContent += '</urlset>'; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, 'utf8'); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error('Failed to generate multimedia sitemap:', error); process.exit(1); }
๐Ÿ“„ generate-multimedia-sitemap.js
const fs = require('fs'); const path = require('path'); // Configuration const BASE_URL = 'https://modernphototools.com'; const VIDEO_DIR = 'public/tools videos'; const IMAGE_DIR = 'public/images/tools images'; const OUTPUT_FILE = 'public/sitemap-multimedia.xml'; // Tool mapping for metadata const toolMetadata = { 'AI Avatar': { title: 'AI Avatar Generator Tool', description: 'Create stunning AI avatars from your photos with advanced artificial intelligence technology', category: 'avatar-creation', duration: '45' // seconds }, 'AI Background Generator': { title: 'AI Background Generator Tool', description: 'Generate professional backgrounds for your photos using AI technology', category: 'background-generation', duration: '60' }, 'AI Caricature': { title: 'AI Caricature Generator Tool', description: 'Transform your photos into fun caricatures with AI-powered technology', category: 'caricature-creation', duration: '50' }, 'AI Cartoon': { title: 'AI Cartoon Generator Tool', description: 'Convert your photos into cartoon style images using advanced AI', category: 'cartoon-creation', duration: '55' }, 'AI Cleanup': { title: 'AI Cleanup Tool', description: 'Remove unwanted objects and clean up your photos with AI technology', category: 'photo-cleanup', duration: '40' }, 'AI Expand': { title: 'AI Expand Tool', description: 'Expand your images beyond their original boundaries using AI', category: 'image-expansion', duration: '65' }, 'AI Face Swap': { title: 'AI Face Swap Tool', description: 'Swap faces in photos seamlessly with advanced AI face recognition', category: 'face-swap', duration: '45' }, 'AI Filter': { title: 'AI Filter Tool', description: 'Apply artistic filters to your photos using AI-powered technology', category: 'filter-application', duration: '35' }, 'AI Hairstyle': { title: 'AI Hairstyle Tool', description: 'Try different hairstyles on your photos with AI technology', category: 'hairstyle-simulation', duration: '50' }, 'AI Image Generator_text-to-image': { title: 'AI Image Generator Tool', description: 'Generate images from text descriptions using advanced AI technology', category: 'text-to-image', duration: '70' }, 'AI Image Upscaler': { title: 'AI Image Upscaler Tool', description: 'Enhance and upscale your images with AI-powered technology', category: 'image-upscaling', duration: '55' }, 'AI Image to Image': { title: 'AI Image to Image Tool', description: 'Transform images from one style to another using AI technology', category: 'image-transformation', duration: '60' }, 'AI Outfit': { title: 'AI Outfit Tool', description: 'Try different outfits on your photos with AI-powered fashion technology', category: 'outfit-simulation', duration: '55' }, 'AI Portrait': { title: 'AI Portrait Tool', description: 'Create professional portraits from your photos using AI technology', category: 'portrait-creation', duration: '60' }, 'AI Product Photoshoot': { title: 'AI Product Photoshoot Tool', description: 'Create professional product photos with AI-powered background technology', category: 'product-photography', duration: '65' }, 'AI Replace': { title: 'AI Replace Tool', description: 'Replace objects in photos seamlessly with AI technology', category: 'object-replacement', duration: '50' }, 'AI Sketch to Image': { title: 'AI Sketch to Image Tool', description: 'Convert sketches into realistic images using AI technology', category: 'sketch-to-image', duration: '75' }, 'Remove Background': { title: 'Remove Background Tool', description: 'Remove backgrounds from photos instantly with AI technology', category: 'background-removal', duration: '30' } }; function getFileLastModified(filePath) { try { const stats = fs.statSync(filePath); return stats.mtime.toISOString(); } catch (error) { return new Date().toISOString(); } } function generateVideoSitemapEntry(filename, toolKey) { const metadata = toolMetadata[toolKey] || { title: filename.replace('.mp4', ''), description: 'AI-powered photo editing tool video demonstration', category: 'ai-tools', duration: '60' }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + ' Tool.jpg')}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getFileLastModified(path.join(VIDEO_DIR, filename)); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <video:video> <video:thumbnail_loc>${thumbnailUrl}</video:thumbnail_loc> <video:title>${metadata.title}</video:title> <video:description>${metadata.description}</video:description> <video:content_loc>${videoUrl}</video:content_loc> <video:duration>${metadata.duration}</video:duration> <video:publication_date>${lastmod}</video:publication_date> <video:family_friendly>yes</video:family_friendly> <video:category>${metadata.category}</video:category> <video:tag>AI tools</video:tag> <video:tag>photo editing</video:tag> <video:tag>artificial intelligence</video:tag> <video:tag>image processing</video:tag> </video:video> </url>`; } function generateImageSitemapEntry(filename, toolKey) { const metadata = toolMetadata[toolKey] || { title: filename.replace('.jpg', ''), description: 'AI-powered photo editing tool demonstration image', category: 'ai-tools' }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getFileLastModified(path.join(IMAGE_DIR, filename)); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <image:image> <image:loc>${imageUrl}</image:loc> <image:title>${metadata.title}</image:title> <image:caption>${metadata.description}</image:caption> <image:license>${BASE_URL}/terms-of-use</image:license> <image:geo_location>Global</image:geo_location> </image:image> </url>`; } function generateMultimediaSitemap() { console.log('Generating multimedia sitemap...'); // Read video files const videoFiles = fs.readdirSync(VIDEO_DIR).filter(file => file.endsWith('.mp4')); console.log(`Found ${videoFiles.length} video files`); // Read image files const imageFiles = fs.readdirSync(IMAGE_DIR).filter(file => file.endsWith('.jpg')); console.log(`Found ${imageFiles.length} image files`); // Generate XML content let xmlContent = `<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> `; // Add video entries console.log('Processing video files...'); videoFiles.forEach(filename => { const toolKey = filename.replace('.mp4', ''); xmlContent += generateVideoSitemapEntry(filename, toolKey) + '\n'; }); // Add image entries console.log('Processing image files...'); imageFiles.forEach(filename => { const toolKey = filename.replace(' Tool.jpg', '').replace('.jpg', ''); xmlContent += generateImageSitemapEntry(filename, toolKey) + '\n'; }); xmlContent += '</urlset>'; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, 'utf8'); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Error handling process.on('uncaughtException', (error) => { console.error('Error generating sitemap:', error); process.exit(1); }); process.on('unhandledRejection', (error) => { console.error('Unhandled promise rejection:', error); process.exit(1); }); // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error('Failed to generate multimedia sitemap:', error); process.exit(1); }
๐Ÿ“„ generate-multimedia-sitemap.mjs
import fs from 'fs'; // Configuration const BASE_URL = 'https://modernphototools.com'; const OUTPUT_FILE = 'public/sitemap-multimedia.xml'; // Tool mapping for metadata const toolMetadata = { 'AI Avatar': { title: 'AI Avatar Generator Tool', description: 'Create stunning AI avatars from your photos with advanced artificial intelligence technology', duration: '45' }, 'AI Background Generator': { title: 'AI Background Generator Tool', description: 'Generate professional backgrounds for your photos using AI technology', duration: '60' }, 'AI Caricature': { title: 'AI Caricature Generator Tool', description: 'Transform your photos into fun caricatures with AI-powered technology', duration: '50' }, 'AI Cartoon': { title: 'AI Cartoon Generator Tool', description: 'Convert your photos into cartoon style images using advanced AI', duration: '55' }, 'AI Cleanup': { title: 'AI Cleanup Tool', description: 'Remove unwanted objects and clean up your photos with AI technology', duration: '40' }, 'AI Expand': { title: 'AI Expand Tool', description: 'Expand your images beyond their original boundaries using AI', duration: '65' }, 'AI Face Swap': { title: 'AI Face Swap Tool', description: 'Swap faces in photos seamlessly with advanced AI face recognition', duration: '45' }, 'AI Filter': { title: 'AI Filter Tool', description: 'Apply artistic filters to your photos using AI-powered technology', duration: '35' }, 'AI Hairstyle': { title: 'AI Hairstyle Tool', description: 'Try different hairstyles on your photos with AI technology', duration: '50' }, 'AI Image Generator_text-to-image': { title: 'AI Image Generator Tool', description: 'Generate images from text descriptions using advanced AI technology', duration: '70' }, 'AI Image Upscaler': { title: 'AI Image Upscaler Tool', description: 'Enhance and upscale your images with AI-powered technology', duration: '55' }, 'AI Image to Image': { title: 'AI Image to Image Tool', description: 'Transform images from one style to another using AI technology', duration: '60' }, 'AI Outfit': { title: 'AI Outfit Tool', description: 'Try different outfits on your photos with AI-powered fashion technology', duration: '55' }, 'AI Portrait': { title: 'AI Portrait Tool', description: 'Create professional portraits from your photos using AI technology', duration: '60' }, 'AI Product Photoshoot': { title: 'AI Product Photoshoot Tool', description: 'Create professional product photos with AI-powered background technology', duration: '65' }, 'AI Replace': { title: 'AI Replace Tool', description: 'Replace objects in photos seamlessly with AI technology', duration: '50' }, 'AI Sketch to Image': { title: 'AI Sketch to Image Tool', description: 'Convert sketches into realistic images using AI technology', duration: '75' }, 'Remove Background': { title: 'Remove Background Tool', description: 'Remove backgrounds from photos instantly with AI technology', duration: '30' } }; // Video files const videoFiles = [ 'AI Avatar.mp4', 'AI Background Generator.mp4', 'AI Caricature.mp4', 'AI Cartoon.mp4', 'AI Cleanup.mp4', 'AI Expand.mp4', 'AI Face Swap.mp4', 'AI Filter.mp4', 'AI Hairstyle.mp4', 'AI Image Generator_text-to-image.mp4', 'AI Image Upscaler.mp4', 'AI Image to Image.mp4', 'AI Outfit.mp4', 'AI Portrait.mp4', 'AI Product Photoshoot.mp4', 'AI Replace.mp4', 'AI Sketch to Image.mp4', 'Remove Background.mp4' ]; // Image files const imageFiles = [ 'AI Avatar Tool.jpg', 'AI Background Generator Tool.jpg', 'AI Caricature Generator Tool.jpg', 'AI Cartoon Tool.jpg', 'AI Cleanup Tool.jpg', 'Ai Expand tool.jpg', 'AI Face Swap Tool.jpg', 'AI Filter Tool.jpg', 'AI Hairstyle Tool.jpg', 'AI Image Generator Tool.jpg', 'AI Image Upscaler Tool.jpg', 'AI Image to Image Tool.jpg', 'AI Outfit Tool.jpg', 'AI Portrait Tool.jpg', 'AI Product Photoshoot Tool.jpg', 'AI Replace tool.jpg', 'AI Sketch to Image Tool.jpg', 'Remove Background tool.jpg' ]; function getCurrentDate() { return new Date().toISOString(); } function generateVideoEntry(filename) { const toolKey = filename.replace('.mp4', ''); const metadata = toolMetadata[toolKey] || { title: filename.replace('.mp4', ''), description: 'AI-powered photo editing tool video demonstration', duration: '60' }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + ' Tool.jpg')}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getCurrentDate(); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <video:video> <video:thumbnail_loc>${thumbnailUrl}</video:thumbnail_loc> <video:title>${metadata.title}</video:title> <video:description>${metadata.description}</video:description> <video:content_loc>${videoUrl}</video:content_loc> <video:duration>${metadata.duration}</video:duration> <video:publication_date>${lastmod}</video:publication_date> <video:family_friendly>yes</video:family_friendly> <video:tag>AI tools</video:tag> <video:tag>photo editing</video:tag> <video:tag>artificial intelligence</video:tag> <video:tag>image processing</video:tag> </video:video> </url>`; } function generateImageEntry(filename) { const toolKey = filename.replace(' Tool.jpg', '').replace('.jpg', ''); const metadata = toolMetadata[toolKey] || { title: filename.replace('.jpg', ''), description: 'AI-powered photo editing tool demonstration image' }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, '-').replace(/\s+/g, '-')}`; const lastmod = getCurrentDate(); return ` <url> <loc>${toolPageUrl}</loc> <lastmod>${lastmod}</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> <image:image> <image:loc>${imageUrl}</image:loc> <image:title>${metadata.title}</image:title> <image:caption>${metadata.description}</image:caption> <image:license>${BASE_URL}/terms-of-use</image:license> <image:geo_location>Global</image:geo_location> </image:image> </url>`; } function generateMultimediaSitemap() { console.log('Generating multimedia sitemap...'); let xmlContent = `<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> `; // Add video entries console.log(`Processing ${videoFiles.length} video files...`); videoFiles.forEach(filename => { xmlContent += generateVideoEntry(filename) + '\n'; }); // Add image entries console.log(`Processing ${imageFiles.length} image files...`); imageFiles.forEach(filename => { xmlContent += generateImageEntry(filename) + '\n'; }); xmlContent += '</urlset>'; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, 'utf8'); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error('Failed to generate multimedia sitemap:', error); process.exit(1); }
๐Ÿ“„ generate-sitemap.cjs
const { SitemapStream, streamToPromise } = require('sitemap'); const fs = require('node:fs'); const path = require('node:path'); const matter = require('gray-matter'); class SitemapGenerator { constructor() { this.baseUrl = 'https://modernphototools.com'; this.contentDir = path.resolve('./content/blog'); this.toolsPath = path.resolve('./src/data/tools.ts'); this.blogArticlesPath = path.resolve('./src/data/blogArticles.ts'); this.sitemapPath = path.resolve('./public/sitemap.xml'); this.lastGeneratedPath = path.resolve('./public/.sitemap-lastgen'); } // Parse TypeScript data files parseDataFile(filePath) { try { const content = fs.readFileSync(filePath, 'utf-8'); const exportMatch = content.match(/export const (\w+):\s*\w+\[\]\s*=\s*(\[[\s\S]*?\]);/); if (exportMatch) { const [, varName, arrayContent] = exportMatch; let jsonContent = arrayContent .replace(/'/g, '"') .replace(/(\w+):/g, '"$1":') .replace(/,\s*}/g, '}') .replace(/,\s*]/g, ']'); return JSON.parse(jsonContent); } return []; } catch (error) { console.warn(`Could not parse ${filePath}:`, error.message); return []; } } // Scan blog directory for markdown files async scanBlogArticles() { const articles = []; try { if (!fs.existsSync(this.contentDir)) { console.warn(`Blog content directory not found: ${this.contentDir}`); return articles; } const files = fs.readdirSync(this.contentDir); const markdownFiles = files.filter(file => file.endsWith('.md')); for (const file of markdownFiles) { try { const filePath = path.join(this.contentDir, file); const fileContent = fs.readFileSync(filePath, 'utf-8'); const { data: frontmatter } = matter(fileContent); // Get file stats for lastmod const stats = fs.statSync(filePath); // Validate required frontmatter fields if (!frontmatter.id || !frontmatter.title) { console.warn(`Skipping ${file}: Missing required frontmatter (id or title)`); continue; } // Check if article is published (not draft) if (frontmatter.draft === true) { console.log(`Skipping draft article: ${file}`); continue; } articles.push({ id: frontmatter.id, title: frontmatter.title, category: frontmatter.category || 'general', featuredImage: frontmatter.featuredImage || '', keywords: frontmatter.keywords || [], publishDate: frontmatter.publishDate || stats.birthtime.toISOString().split('T')[0], lastModified: stats.mtime, filePath: filePath }); } catch (error) { console.warn(`Error processing ${file}:`, error.message); } } console.log(`โœ… Scanned ${articles.length} published articles from ${markdownFiles.length} markdown files`); return articles; } catch (error) { console.error('Error scanning blog articles:', error); return articles; } } // Extract tools data extractToolsData() { try { const toolsContent = fs.readFileSync(this.toolsPath, 'utf-8'); const toolMatches = toolsContent.matchAll(/{\s*id:\s*'([^']+)',[\s\S]*?path:\s*'([^']+)'[\s\S]*?}/g); return Array.from(toolMatches).map(match => ({ id: match[1], path: match[2] })); } catch (error) { console.warn('Error extracting tools data:', error.message); return []; } } // Generate sitemap URLs generateUrls(tools, articles) { const urls = []; // Static pages with priorities and change frequencies const staticPages = [ { url: '/', changefreq: 'daily', priority: 1.0 }, { url: '/tools', changefreq: 'daily', priority: 0.9 }, { url: '/blog', changefreq: 'daily', priority: 0.9 }, { url: '/about', changefreq: 'yearly', priority: 0.7 }, { url: '/contact', changefreq: 'yearly', priority: 0.7 }, { url: '/privacy-policy', changefreq: 'yearly', priority: 0.5 }, { url: '/terms-of-use', changefreq: 'yearly', priority: 0.5 }, { url: '/dmca', changefreq: 'yearly', priority: 0.5 }, { url: '/cookies-policy', changefreq: 'yearly', priority: 0.5 }, ]; urls.push(...staticPages); // Tool pages const toolPages = tools.map(tool => ({ url: tool.path, changefreq: 'monthly', priority: 0.8, lastmod: new Date().toISOString() })); urls.push(...toolPages); // Blog article pages with proper lastmod dates const blogPages = articles.map(article => { const blogUrl = { url: `/blog/${article.id}`, changefreq: 'monthly', priority: 0.7, lastmod: article.lastModified.toISOString() }; // Add image if featured image exists if (article.featuredImage) { blogUrl.img = [{ url: article.featuredImage.startsWith('http') ? article.featuredImage : `${this.baseUrl}${article.featuredImage}`, title: article.title, caption: `Featured image for: ${article.title}` }]; } return blogUrl; }); urls.push(...blogPages); // Intentionally excluding blog category and tag pages from sitemap return { urls, counts: { static: staticPages.length, tools: toolPages.length, articles: blogPages.length, total: urls.length } }; } // Validate sitemap XML validateSitemap(xmlContent) { try { // Basic XML validation if (!xmlContent.includes('<?xml version="1.0" encoding="UTF-8"?>')) { throw new Error('Missing XML declaration'); } // Check for sitemap namespace (more flexible) if (!xmlContent.includes('xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"')) { throw new Error('Missing sitemap namespace'); } // Count URLs const urlCount = (xmlContent.match(/<url>/g) || []).length; if (urlCount === 0) { throw new Error('No URLs found in sitemap'); } // Check for duplicate URLs const urlMatches = xmlContent.match(/<loc>(.*?)<\/loc>/g) || []; const urls = urlMatches.map(match => match.replace(/<\/?loc>/g, '')); const uniqueUrls = new Set(urls); if (urls.length !== uniqueUrls.size) { throw new Error(`Found ${urls.length - uniqueUrls.size} duplicate URLs`); } console.log(`โœ… Sitemap validation passed: ${urlCount} URLs, no duplicates`); return true; } catch (error) { console.error('โŒ Sitemap validation failed:', error.message); return false; } } // Check if regeneration is needed shouldRegenerate() { try { if (!fs.existsSync(this.sitemapPath)) { console.log('๐Ÿ”„ Sitemap not found, generating new one'); return true; } if (!fs.existsSync(this.lastGeneratedPath)) { console.log('๐Ÿ”„ Last generation timestamp not found, regenerating'); return true; } const lastGenerated = new Date(fs.readFileSync(this.lastGeneratedPath, 'utf-8')); const sitemapStats = fs.statSync(this.sitemapPath); // Check if any blog files are newer than the sitemap if (fs.existsSync(this.contentDir)) { const blogFiles = fs.readdirSync(this.contentDir) .filter(file => file.endsWith('.md')) .map(file => path.join(this.contentDir, file)); for (const file of blogFiles) { const fileStats = fs.statSync(file); if (fileStats.mtime > sitemapStats.mtime) { console.log(`๐Ÿ”„ Blog file ${path.basename(file)} is newer than sitemap, regenerating`); return true; } } } // Check if data files are newer const dataFiles = [this.toolsPath, this.blogArticlesPath]; for (const file of dataFiles) { if (fs.existsSync(file)) { const fileStats = fs.statSync(file); if (fileStats.mtime > sitemapStats.mtime) { console.log(`๐Ÿ”„ Data file ${path.basename(file)} is newer than sitemap, regenerating`); return true; } } } console.log('โœ… Sitemap is up to date'); return false; } catch (error) { console.warn('Error checking if regeneration needed:', error.message); return true; } } // Main generation method async generate(force = false) { try { console.log('๐Ÿš€ Starting sitemap generation...'); // Check if regeneration is needed (unless forced) if (!force && !this.shouldRegenerate()) { return { success: true, message: 'Sitemap is up to date' }; } // Scan for articles and extract tools const [articles, tools] = await Promise.all([ this.scanBlogArticles(), Promise.resolve(this.extractToolsData()) ]); console.log(`๐Ÿ“Š Found ${tools.length} tools and ${articles.length} articles`); // Generate URLs const { urls, counts } = this.generateUrls(tools, articles); // Create sitemap const sitemapStream = new SitemapStream({ hostname: this.baseUrl }); urls.forEach(url => { sitemapStream.write(url); }); sitemapStream.end(); const sitemapXML = await streamToPromise(sitemapStream).then(data => data.toString()); // Validate sitemap if (!this.validateSitemap(sitemapXML)) { throw new Error('Sitemap validation failed'); } // Ensure public directory exists const publicDir = path.dirname(this.sitemapPath); if (!fs.existsSync(publicDir)) { fs.mkdirSync(publicDir, { recursive: true }); } // Write sitemap fs.writeFileSync(this.sitemapPath, sitemapXML); // Update last generated timestamp fs.writeFileSync(this.lastGeneratedPath, new Date().toISOString()); console.log(`โœ… Sitemap generated successfully at ${this.sitemapPath}`); console.log(`๐Ÿ“Š Breakdown:`); console.log(` - Static pages: ${counts.static}`); console.log(` - Tool pages: ${counts.tools}`); console.log(` - Blog articles: ${counts.articles}`); console.log(` - Total URLs: ${counts.total}`); return { success: true, message: 'Sitemap generated successfully', counts, path: this.sitemapPath }; } catch (error) { console.error('โŒ Sitemap generation failed:', error); return { success: false, message: error.message, error: error }; } } } // CLI execution async function main() { const generator = new SitemapGenerator(); const force = process.argv.includes('--force') || process.argv.includes('-f'); const result = await generator.generate(force); if (!result.success) { process.exit(1); } } // Export for programmatic use module.exports = { SitemapGenerator }; // Run if called directly if (require.main === module) { main().catch(console.error); }
๐Ÿ“„ index.html
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/x-icon" href="/favicon.ico" /> <link rel="manifest" href="/manifest.json" /> <meta name="theme-color" content="#3b82f6" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>ModernPhotoTools.com Website</title> <script type="text/javascript"> (function (c, l, a, r, i, t, y) { c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) }; t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i; y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y); })(window, document, "clarity", "script", "tt1ibc0orv"); </script> <!-- Pinterest Tag --> <script> !function (e) { if (!window.pintrk) { window.pintrk = function () { window.pintrk.queue.push(Array.prototype.slice.call(arguments)) }; var n = window.pintrk; n.queue = [], n.version = "3.0"; var t = document.createElement("script"); t.async = !0, t.src = e; var r = document.getElementsByTagName("script")[0]; r.parentNode.insertBefore(t, r) } }("https://s.pinimg.com/ct/core.js"); pintrk('load', '2613220059684', { em: '<user_email_address>' }); pintrk('page'); </script> <!-- end Pinterest Tag --> </head> <body> <!-- Pinterest Tag --> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?event=init&tid=2613220059684&pd[em]=<hashed_email_address>&noscript=1" /> </noscript> <!-- end Pinterest Tag --> <div id="root"><!--app-html--></div> <script type="module" src="/src/main.tsx"></script> </body> </html>
๐Ÿ“ lightx-proxy-server
๐Ÿ“„ .env
# LightX API Configuration # Get your API key from: https://api.lightxeditor.com/ # Replace 'your_lightx_api_key_here' with your actual API key LIGHTX_API_KEY=202df11c643247f78c55631d30545ef0_bda6172f37824c53aaba3fe40349479a_andoraitools # Server Configuration PORT=3001 BYTEZ_API_KEY=ace64116a3b62f47f6406e85d34026c7
๐Ÿ“„ package.json
{ "name": "lightx-proxy-server", "version": "1.0.0", "main": "server.js", "scripts": { "start": "node server.js", "dev": "nodemon server.js" }, "keywords": [], "author": "", "license": "ISC", "description": "", "dependencies": { "bytez.js": "^1.1.18", "cors": "^2.8.5", "dotenv": "^16.5.0", "express": "^4.18.2", "node-fetch": "^3.3.2" }, "devDependencies": { "nodemon": "^3.1.10" } }
๐Ÿ“„ server.js
// server.js const express = require('express'); const cors = require('cors'); // Use node-fetch v2 syntax for CommonJS const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); require('dotenv').config(); const app = express(); const PORT = process.env.PORT || 3001; // Middleware app.use(cors({ origin: ['https://modernphototools.netlify.app', 'http://localhost:5173', 'http://localhost:5174'], // Your Vite dev server credentials: true, methods: ['GET', 'POST', 'PUT', 'OPTIONS'], allowedHeaders: ['Content-Type', 'x-api-key', 'Authorization'], preflightContinue: false, })); app.use(express.json()); // Generic LightX API proxy endpoint (similar to serverless function approach) app.post('/api/lightx-proxy', async (req, res) => { try { const { endpoint, body } = req.body; console.log('Proxy request received: ', { endpoint, body }); if (!endpoint) { return res.status(400).json({ error: 'Missing endpoint parameter' }); } const lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(body, null, 2)); // Use the full API key const apiKey = process.env.LIGHTX_API_KEY.trim(); if (!apiKey) { console.error('LIGHTX_API_KEY not found in environment variables'); return res.status(500).json({ error: 'API key not configured' }); } console.log(`Using API key (masked): ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); const headers = { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'User-Agent': 'PhotoNow-Proxy/1.0' }; console.log('Request headers:', { ...headers, 'x-api-key': '[MASKED]' }); const response = await fetch(lightxUrl, { method: 'POST', headers: headers, body: JSON.stringify(body), }); console.log('Response status:', response.status); console.log('Response headers:', Object.fromEntries(response.headers.entries())); const responseText = await response.text(); console.log('Raw response:', responseText); let data; try { data = JSON.parse(responseText); } catch (parseError) { console.error('Failed to parse JSON response:', parseError); return res.status(500).json({ error: 'Invalid JSON response from LightX API', details: responseText.substring(0, 500) }); } console.log('Parsed response data:', JSON.stringify(data, null, 2)); if (!response.ok) { console.error('LightX API Error:', { status: response.status, statusText: response.statusText, data }); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error('Proxy Error:', error); res.status(500).json({ error: 'Proxy server error', details: error.message }); } }); app.post('/api/optimize-prompt', async (req, res) => { try { const { basePrompt, framework } = req.body; if (!process.env.BYTEZ_API_KEY) { return res.status(500).json({ error: 'Server config error: API Key missing' }); } const Bytez = (await import('bytez.js')).default; const sdk = new Bytez(process.env.BYTEZ_API_KEY); const model = sdk.model('openai/gpt-4o'); let structure = ''; if (framework === 'COSTAR') { structure = 'Context, Offer, Style, Target, Action, Result'; } else if (framework === 'ICDF') { structure = 'Instruction, Context, Data, Format'; } else if (framework === 'RCREOC') { structure = 'Role, Context, Request, Examples, Output, Constraints'; } else { structure = 'Message, Intention, Context, Rhythm, Output'; } const systemInstruction = `You are an expert Prompt Engineer. Your goal is to transform a basic user request into a detailed, professional prompt using the ${framework} framework.\n\nAnalyze the User's Request and generate specific content for these fields: ${structure}.\n\nReturn ONLY a valid JSON object. The keys must be the field names listed above (e.g., "Context", "Offer").\nDo not use markdown code blocks. Just the raw JSON string.`; const { error, output } = await model.run([ { role: 'system', content: systemInstruction }, { role: 'user', content: basePrompt } ]); if (error) { throw new Error(error); } const raw = Array.isArray(output) ? (output[0]?.text ?? output[0]) : (typeof output === 'string' ? output : (output && typeof output === 'object' && 'text' in output ? output.text : JSON.stringify(output))); const cleanJson = String(raw).replace(/```json/g, '').replace(/```/g, '').trim(); let parsed = JSON.parse(cleanJson); if (parsed && typeof parsed === 'object' && typeof parsed.content === 'string') { try { parsed = JSON.parse(parsed.content); } catch (_ignore) {} } return res.json({ success: true, data: parsed }); } catch (e) { console.error('Bytez Error:', e); return res.status(500).json({ error: e.message }); } }); // Keep the original endpoints for backward compatibility app.post('/api/lightx/v1/*', async (req, res) => { try { const endpoint = req.params[0]; const lightxUrl = `https://api.lightxeditor.com/external/api/v1/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(req.body)); // Use the full API key without splitting it const apiKey = process.env.LIGHTX_API_KEY.trim(); console.log(`Using full API key (masked): ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); console.log(`Request URL: ${lightxUrl}`); console.log(`Request body: ${JSON.stringify(req.body)}`); console.log(`Request method: POST`); console.log(`Content-Type: application/json`); // Try with different header combinations const headers = { 'Content-Type': 'application/json', 'x-api-key': apiKey, }; console.log('Request headers:', headers); const response = await fetch(lightxUrl, { method: 'POST', headers: headers, body: JSON.stringify(req.body), }); console.log('Response status:', response.status); const data = await response.json(); console.log('Response data:', JSON.stringify(data)); if (!response.ok) { console.error('LightX API Error:', data); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error('Proxy Error:', error); res.status(500).json({ error: 'Proxy server error', details: error.message }); } }); app.post('/api/lightx/v2/*', async (req, res) => { try { const endpoint = req.params[0]; const lightxUrl = `https://api.lightxeditor.com/external/api/v2/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(req.body)); // Log the API key (without revealing the full key for security) const apiKey = process.env.LIGHTX_API_KEY; console.log(`Using API key: ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); // Try with different header combinations const headers = { 'Content-Type': 'application/json', 'x-api-key': apiKey.trim(), }; console.log('Request headers:', headers); const response = await fetch(lightxUrl, { method: 'POST', headers: headers, body: JSON.stringify(req.body), }); console.log('Response status:', response.status); const data = await response.json(); console.log('Response data:', JSON.stringify(data)); if (!response.ok) { console.error('LightX API Error:', data); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error('Proxy Error:', error); res.status(500).json({ error: 'Proxy server error', details: error.message }); } }); // Special handler for image uploads (PUT requests to S3) app.put('/api/upload-proxy', async (req, res) => { try { const { uploadUrl } = req.query; if (!uploadUrl) { return res.status(400).json({ error: 'Upload URL is required' }); } // Forward the request to S3 const response = await fetch(uploadUrl, { method: 'PUT', headers: { 'Content-Type': req.headers['content-type'], 'Content-Length': req.headers['content-length'], }, body: req.body, }); if (!response.ok) { const errorText = await response.text(); console.error('S3 Upload Error:', errorText); return res.status(response.status).json({ error: 'Upload failed', details: errorText }); } res.status(200).json({ message: 'Upload successful' }); } catch (error) { console.error('Upload Proxy Error:', error); res.status(500).json({ error: 'Upload proxy error', details: error.message }); } }); app.listen(PORT, () => { console.log(`Proxy server running on http://localhost:${PORT}`); });
๐Ÿ“ netlify
๐Ÿ“ functions
๐Ÿ“„ lightx-proxy.js
// netlify/functions/lightx-proxy.js /** * Securely retrieves and validates environment variables at runtime * @param {string} key - Environment variable key * @param {boolean} required - Whether the variable is required * @returns {string|null} - The environment variable value or null if not found */ function getSecureEnvVar(key, required = true) { const value = process.env[key]; if (!value || value.trim() === '') { if (required) { console.error(`Required environment variable ${key} is missing or empty`); return null; } console.warn(`Optional environment variable ${key} is not set`); return null; } // Basic validation for API key format (should be non-empty string) if (key.includes('API_KEY') && value.length < 10) { console.error(`Environment variable ${key} appears to be invalid (too short)`); return null; } return value.trim(); } /** * Creates standardized error response * @param {number} statusCode - HTTP status code * @param {string} message - Error message * @param {string} details - Optional error details * @returns {Object} - Netlify function response object */ function createErrorResponse(statusCode, message, details = null) { const response = { statusCode, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Allow-Methods': 'POST, OPTIONS' }, body: JSON.stringify({ error: message, ...(details && { details }) }) }; // Log error for debugging (without sensitive info) console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : ''}`); return response; } exports.handler = async function(event, context) { // Dynamic import for node-fetch ES module const { default: fetch } = await import('node-fetch'); // Handle preflight OPTIONS request if (event.httpMethod === 'OPTIONS') { return { statusCode: 200, headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Allow-Methods': 'POST, OPTIONS' }, body: '' }; } // Only allow POST requests if (event.httpMethod !== 'POST') { return createErrorResponse(405, 'Method Not Allowed'); } try { // Parse the request body let requestBody; try { requestBody = JSON.parse(event.body); } catch (parseError) { return createErrorResponse(400, 'Invalid JSON in request body', parseError.message); } const { endpoint, body } = requestBody; if (!endpoint) { return createErrorResponse(400, 'Missing endpoint parameter'); } // Validate endpoint format if (typeof endpoint !== 'string' || endpoint.trim() === '') { return createErrorResponse(400, 'Invalid endpoint parameter'); } // Construct the LightX API URL based on version // For v1 endpoints, the URL structure is different than v2 let lightxUrl; if (endpoint.startsWith('v1/')) { // v1 endpoints use a different URL structure lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } else { // v2 and other endpoints use the external/api path lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } // Securely retrieve API key at runtime const apiKey = getSecureEnvVar('LIGHTX_API_KEY', true); if (!apiKey) { return createErrorResponse(500, 'API key not configured or invalid'); } // Log request details (excluding sensitive info) - only in development const isDevelopment = getSecureEnvVar('NODE_ENV', false) !== 'production'; if (isDevelopment) { console.log(`Making request to: ${lightxUrl}`); console.log(`Request body keys: ${Object.keys(body || {}).join(', ')}`); console.log(`API key present: Yes`); } // Validate request body if present if (body && typeof body !== 'object') { return createErrorResponse(400, 'Request body must be an object'); } // Make the request to the LightX API with timeout const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 30000); // 30 second timeout let response; try { response = await fetch(lightxUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'User-Agent': 'ModernPhotoTools/1.0' }, body: JSON.stringify(body || {}), signal: controller.signal }); } catch (fetchError) { clearTimeout(timeoutId); if (fetchError.name === 'AbortError') { return createErrorResponse(408, 'Request timeout'); } return createErrorResponse(502, 'Failed to connect to LightX API', fetchError.message); } finally { clearTimeout(timeoutId); } if (isDevelopment) { console.log(`Response status: ${response.status}`); console.log(`Response status text: ${response.statusText}`); } // Get the response data let data; try { data = await response.json(); } catch (jsonError) { return createErrorResponse(502, 'Invalid JSON response from LightX API', jsonError.message); } // Return the response with proper headers return { statusCode: response.status, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Allow-Methods': 'POST, OPTIONS', 'Cache-Control': 'no-cache, no-store, must-revalidate' }, body: JSON.stringify(data) }; } catch (error) { // Log full error details for debugging console.error('Function error:', { message: error.message, stack: error.stack, name: error.name }); return createErrorResponse(500, 'Internal server error', error.message); } };
๐Ÿ“„ package.json
{ "name": "netlify-functions", "version": "1.0.0", "description": "Netlify Functions for LightX API proxy", "main": "lightx-proxy.js", "dependencies": { "node-fetch": "^2.6.7" } }
๐Ÿ“„ netlify.toml
# netlify.toml [build] # Directory to change to before starting a build base = "/" # Directory that contains the deploy-ready HTML files and assets publish = "dist" # Default build command command = "npm run build" # Redirects and rewrites [[redirects]] from = "/api/lightx-proxy" to = "/.netlify/functions/lightx-proxy" status = 200 force = true # For SPA routing [[redirects]] from = "/*" to = "/index.html" status = 200
๐Ÿ“„ package.json
{ "name": "modern-photo-tools", "private": true, "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", "build:client": "vite build", "build:server": "vite build --ssr src/entry-server.tsx --outDir dist/server", "build:prerender": "node prerender.js", "build:sitemap": "node generate-sitemap.cjs", "build": "npm run build:client && npm run build:server && npm run build:prerender", "sitemap:watch": "node scripts/sitemap-watcher.cjs", "sitemap:schedule": "node scripts/sitemap-scheduler.cjs", "sitemap:schedule:hourly": "node scripts/sitemap-scheduler.cjs --interval=60", "sitemap:schedule:daily": "node scripts/sitemap-scheduler.cjs --interval=1440", "sitemap:validate": "node scripts/sitemap-validator.cjs", "sitemap:validate:regenerate": "node scripts/sitemap-validator.cjs --regenerate", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "@supabase/supabase-js": "^2.49.8", "gray-matter": "^4.0.3", "lucide-react": "^0.344.0", "node-fetch": "^3.3.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-helmet-async": "^2.0.4", "react-markdown": "^10.1.0", "react-router-dom": "^6.22.3", "sitemap": "^8.0.2", "uuid": "^11.1.0" }, "devDependencies": { "@eslint/js": "^9.9.1", "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "autoprefixer": "^10.4.18", "eslint": "^9.9.1", "eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-refresh": "^0.4.11", "globals": "^15.9.0", "postcss": "^8.4.35", "tailwindcss": "^3.4.1", "typescript": "^5.5.3", "typescript-eslint": "^8.3.0", "vite": "^5.4.2" } }
๐Ÿ“„ postcss.config.js
export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, };
๐Ÿ“„ prerender.js
import fs from 'node:fs'; import path from 'node:path'; import url from 'node:url'; // --- START: Static Route Generation --- // Base static pages const basePages = ['/', '/tools', '/blog', '/about', '/contact', '/privacy-policy', '/terms-of-use', '/dmca', '/cookies-policy']; // Tool pages (based on tools data) const toolPages = [ '/tools/remove-background', '/tools/ai-cleanup', '/tools/ai-expand', '/tools/ai-replace', '/tools/ai-cartoon', '/tools/ai-caricature', '/tools/ai-avatar', '/tools/ai-product-photoshoot', '/tools/ai-background-generator', '/tools/ai-image-generator', '/tools/ai-portrait', '/tools/ai-face-swap', '/tools/ai-outfit', '/tools/ai-image-to-image', '/tools/ai-sketch-to-image', '/tools/ai-hairstyle', '/tools/ai-image-upscaler', '/tools/ai-filter' ]; // Blog pages (based on blogArticles data) const blogPages = [ '/blog/ai-image-enhancement-guide', '/blog/ai-background-generators-2025', '/blog/best-ai-headshot-generators', '/blog/ai-avatar-creation-guide', '/blog/professional-headshots-ai', '/blog/ai-cartoon-photo-effects' ]; // --- END: Static Route Generation --- const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); const toAbsolute = (p) => path.resolve(__dirname, p); const template = fs.readFileSync(toAbsolute('dist/index.html'), 'utf-8'); const { render } = await import('./dist/server/entry-server.js'); // Pre-render all routes const allRoutes = [...basePages, ...toolPages, ...blogPages]; console.log('Discovered routes to prerender:', allRoutes); (async () => { for (const routeUrl of allRoutes) { const appHtml = render(routeUrl, {}); const html = template.replace(`<!--app-html-->`, appHtml); let filePath = `dist${routeUrl}`; if (routeUrl.endsWith('/')) { filePath += 'index.html'; } else { // Handle routes like /tools/ai-avatar filePath += '.html'; } const dir = path.dirname(filePath); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } fs.writeFileSync(toAbsolute(filePath), html); console.log(`Pre-rendered: ${filePath}`); } })();
๐Ÿ“„ project_code.html
<html><head><style> body { font-family: Arial, sans-serif; margin: 20px; } .folder { font-weight: bold; margin-top: 10px; } .file { margin-left: 20px; color: blue; font-weight: bold; } .content { margin-left: 40px; white-space: pre-wrap; font-family: monospace; color: black; border-left: 2px solid #ddd; padding-left: 10px; } </style></head><body><h1>Project Files</h1> <div class="folder" style="margin-left: 0px;">๐Ÿ“ .bolt</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ config.json</div> <div class="content">{ &quot;template&quot;: &quot;bolt-vite-react-ts&quot; } </div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ prompt</div> <div class="content">For all designs I ask you to make, have them be beautiful, not cookie cutter. Make webpages that are fully featured and worthy for production. By default, this template supports JSX syntax with Tailwind CSS classes, React hooks, and Lucide React for icons. Do not install other packages for UI themes, icons, etc unless absolutely necessary or I request them. Use icons from lucide-react for logos. </div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ .netlify</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ blobs-serve</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ functions-internal</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ functions-serve</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ lightx-proxy</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ___netlify-telemetry.mjs</div> <div class="content"> var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from&quot;module&quot;;const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=&gt;typeof require&lt;&quot;u&quot;?require:typeof Proxy&lt;&quot;u&quot;?new Proxy(r,{get:(e,t)=&gt;(typeof require&lt;&quot;u&quot;?require:e)[t]}):r)(function(r){if(typeof require&lt;&quot;u&quot;)return require.apply(this,arguments);throw Error(&#x27;Dynamic require of &quot;&#x27;+r+&#x27;&quot; is not supported&#x27;)});var p=(r,e)=&gt;()=&gt;(r&amp;&amp;(e=r(r=0)),e);var T=(r,e)=&gt;()=&gt;(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=&gt;{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=&gt;{if(e&amp;&amp;typeof e==&quot;object&quot;||typeof e==&quot;function&quot;)for(let s of lz(e))!uz.call(r,s)&amp;&amp;s!==t&amp;&amp;xu(r,s,{get:()=&gt;e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=&gt;(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,&quot;default&quot;,{value:r,enumerable:!0}):t,r)),ee=r=&gt;NR(xu({},&quot;__esModule&quot;,{value:!0}),r);var CR,PR=p(()=&gt;{CR=typeof globalThis==&quot;object&quot;?globalThis:global});var IR=p(()=&gt;{PR()});var bR=p(()=&gt;{IR()});var cn,hm=p(()=&gt;{cn=&quot;1.9.0&quot;});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&amp;&amp;s.patch&lt;=u.patch?i(l):a(l):s.minor&lt;=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=&gt;{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&amp;&amp;(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&amp;&amp;s!==void 0?s:{version:cn};if(!o&amp;&amp;a[r]){var i=new Error(&quot;@opentelemetry/api: Attempted duplicate registration of API: &quot;+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error(&quot;@opentelemetry/api: Registration of version v&quot;+a.version+&quot; for &quot;+r+&quot; does not match previously registered API v&quot;+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug(&quot;@opentelemetry/api: Registered a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug(&quot;@opentelemetry/api: Unregistering a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;);var t=Fa[Va];t&amp;&amp;delete t[r]}var pz,Va,Fa,Ei=p(()=&gt;{bR();hm();MR();pz=cn.split(&quot;.&quot;)[0],Va=Symbol.for(&quot;opentelemetry.js.api.&quot;+pz),Fa=CR});function Ga(r,e,t){var o=xt(&quot;diag&quot;);if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=&gt;{Ei();dz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||&quot;DiagComponentLogger&quot;}return r.prototype.debug=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;debug&quot;,this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;error&quot;,this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;info&quot;,this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;warn&quot;,this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;verbose&quot;,this._namespace,e)},r})()});var H,Mu=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.ERROR=30]=&quot;ERROR&quot;,r[r.WARN=50]=&quot;WARN&quot;,r[r.INFO=60]=&quot;INFO&quot;,r[r.DEBUG=70]=&quot;DEBUG&quot;,r[r.VERBOSE=80]=&quot;VERBOSE&quot;,r[r.ALL=9999]=&quot;ALL&quot;})(H||(H={}))});function UR(r,e){r&lt;H.NONE?r=H.NONE:r&gt;H.ALL&amp;&amp;(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a==&quot;function&quot;&amp;&amp;r&gt;=s?a.bind(e):function(){}}return{error:t(&quot;error&quot;,H.ERROR),warn:t(&quot;warn&quot;,H.WARN),info:t(&quot;info&quot;,H.INFO),debug:t(&quot;debug&quot;,H.DEBUG),verbose:t(&quot;verbose&quot;,H.VERBOSE)}}var kR=p(()=&gt;{Mu()});var _z,Ez,mz,ft,mi=p(()=&gt;{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz=&quot;diag&quot;,ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i&lt;arguments.length;i++)a[i]=arguments[i];var n=xt(&quot;diag&quot;);if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&amp;&amp;(a={logLevel:H.INFO}),s===t){var c=new Error(&quot;Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation&quot;);return t.error((i=c.stack)!==null&amp;&amp;i!==void 0?i:c.message),!1}typeof a==&quot;number&quot;&amp;&amp;(a={logLevel:a});var u=xt(&quot;diag&quot;),f=UR((n=a.logLevel)!==null&amp;&amp;n!==void 0?n:H.INFO,s);if(u&amp;&amp;!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&amp;&amp;l!==void 0?l:&quot;&lt;failed to generate stacktrace&gt;&quot;;u.warn(&quot;Current logger will be overwritten from &quot;+_),f.warn(&quot;Current logger will overwrite one already registered from &quot;+_)}return Ir(&quot;diag&quot;,f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e(&quot;verbose&quot;),t.debug=e(&quot;debug&quot;),t.info=e(&quot;info&quot;),t.warn=e(&quot;warn&quot;),t.error=e(&quot;error&quot;)}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=&gt;{Tz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s&lt;arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&amp;&amp;!n.done&amp;&amp;(t=i.return)&amp;&amp;t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=&gt;{FR=Symbol(&quot;BaggageEntryMetadata&quot;)});function HR(r){return r===void 0&amp;&amp;(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!=&quot;string&quot;&amp;&amp;(gz.error(&quot;Cannot create baggage metadata from unknown type: &quot;+typeof r),r=&quot;&quot;),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=&gt;{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=&gt;{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=&gt;{Em=[{n:&quot;error&quot;,c:&quot;error&quot;},{n:&quot;warn&quot;,c:&quot;warn&quot;},{n:&quot;info&quot;,c:&quot;info&quot;},{n:&quot;debug&quot;,c:&quot;debug&quot;},{n:&quot;verbose&quot;,c:&quot;trace&quot;}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a&lt;arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!=&quot;function&quot;&amp;&amp;(i=console.log),typeof i==&quot;function&quot;)return i.apply(console,s)}}}for(var t=0;t&lt;Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=&gt;{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=&gt;{(function(r){r[r.INT=0]=&quot;INT&quot;,r[r.DOUBLE=1]=&quot;DOUBLE&quot;})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=&gt;{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&amp;&amp;(r[e]=t)}}});var kz,Bz,YR,zR=p(()=&gt;{Ha();kz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a&lt;arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=&gt;{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm=&quot;context&quot;,Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i&lt;arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.SAMPLED=1]=&quot;SAMPLED&quot;})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=&gt;{ym();ja=&quot;0000000000000000&quot;,Ya=&quot;00000000000000000000000000000000&quot;,Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=&gt;{Fu();Pn=(function(){function r(e){e===void 0&amp;&amp;(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=&gt;{Ha();Gu();qa();Om=De(&quot;OpenTelemetry Context Key SPAN&quot;)});function Mt(r){return Hz.test(r)&amp;&amp;r!==Ya}function Si(r){return qz.test(r)&amp;&amp;r!==ja}function xe(r){return Mt(r.traceId)&amp;&amp;Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=&gt;{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r==&quot;object&quot;&amp;&amp;typeof r.spanId==&quot;string&quot;&amp;&amp;typeof r.traceId==&quot;string&quot;&amp;&amp;typeof r.traceFlags==&quot;number&quot;}var Rm,Yu,Nm=p(()=&gt;{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&amp;&amp;(o=Rm.active());var s=!!(t!=null&amp;&amp;t.root);if(s)return new Pn;var a=o&amp;&amp;qu(o);return jz(a)&amp;&amp;xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length&lt;2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=&gt;{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=&gt;{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=&gt;{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&amp;&amp;s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(ke||(ke={}))});var qt,eN=p(()=&gt;{(function(r){r[r.INTERNAL=0]=&quot;INTERNAL&quot;,r[r.SERVER=1]=&quot;SERVER&quot;,r[r.CLIENT=2]=&quot;CLIENT&quot;,r[r.PRODUCER=3]=&quot;PRODUCER&quot;,r[r.CONSUMER=4]=&quot;CONSUMER&quot;})(qt||(qt={}))});var jt,tN=p(()=&gt;{(function(r){r[r.UNSET=0]=&quot;UNSET&quot;,r[r.OK=1]=&quot;OK&quot;,r[r.ERROR=2]=&quot;ERROR&quot;})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&amp;&amp;!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=&gt;{Im=&quot;[_0-9a-z-*/]&quot;,Kz=&quot;[a-z]&quot;+Im+&quot;{0,255}&quot;,$z=&quot;[a-z0-9]&quot;+Im+&quot;{0,240}@[a-z]&quot;+Im+&quot;{0,13}&quot;,Xz=new RegExp(&quot;^(?:&quot;+Kz+&quot;|&quot;+$z+&quot;)$&quot;),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=&gt;{iN();oN=32,Qz=512,sN=&quot;,&quot;,aN=&quot;=&quot;,lN=(function(){function r(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length&gt;Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&amp;&amp;nN(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;oN&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=&gt;{cN()});var he,pN=p(()=&gt;{qa();he=Cn.getInstance()});var S,dN=p(()=&gt;{mi();S=ft.instance()});var Zz,hN,_N=p(()=&gt;{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=&gt;{_N();Ei();mi();bm=&quot;metrics&quot;,EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=&gt;{mN();gi=EN.getInstance()});var SN,gN=p(()=&gt;{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=&gt;{qa();Ha();Lm=De(&quot;OpenTelemetry Baggage Key&quot;)});var Mm,eK,RN,NN=p(()=&gt;{Ei();gN();gm();AN();_m();mi();Mm=&quot;propagation&quot;,eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&amp;&amp;(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&amp;&amp;(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=&gt;{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=&gt;{Ei();Pm();ju();Am();mi();wm=&quot;trace&quot;,PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&amp;&amp;this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=&gt;{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=&gt;Du,DiagLogLevel:()=&gt;H,INVALID_SPANID:()=&gt;ja,INVALID_SPAN_CONTEXT:()=&gt;Uo,INVALID_TRACEID:()=&gt;Ya,ProxyTracer:()=&gt;zu,ProxyTracerProvider:()=&gt;Ka,ROOT_CONTEXT:()=&gt;wu,SamplingDecision:()=&gt;ke,SpanKind:()=&gt;qt,SpanStatusCode:()=&gt;jt,TraceFlags:()=&gt;se,ValueType:()=&gt;Ot,baggageEntryMetadataFromString:()=&gt;Lr,context:()=&gt;he,createContextKey:()=&gt;De,createNoopMeter:()=&gt;ku,createTraceState:()=&gt;uN,default:()=&gt;tK,defaultTextMapGetter:()=&gt;Bu,defaultTextMapSetter:()=&gt;Vu,diag:()=&gt;S,isSpanContextValid:()=&gt;xe,isValidSpanId:()=&gt;Si,isValidTraceId:()=&gt;Mt,metrics:()=&gt;gi,propagation:()=&gt;Ue,trace:()=&gt;ie});var tK,P=p(()=&gt;{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o&lt;t;o++){var s=r[o];s&amp;&amp;(e[String(s).toUpperCase().replace(/[-.]/g,&quot;_&quot;)]=s)}return e}var Dm=p(()=&gt;{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=&gt;{Dm();MN=&quot;aws.lambda.invoked_arn&quot;,wN=&quot;db.system&quot;,DN=&quot;db.connection_string&quot;,UN=&quot;db.user&quot;,kN=&quot;db.jdbc.driver_classname&quot;,BN=&quot;db.name&quot;,VN=&quot;db.statement&quot;,FN=&quot;db.operation&quot;,GN=&quot;db.mssql.instance_name&quot;,HN=&quot;db.cassandra.keyspace&quot;,qN=&quot;db.cassandra.page_size&quot;,jN=&quot;db.cassandra.consistency_level&quot;,YN=&quot;db.cassandra.table&quot;,zN=&quot;db.cassandra.idempotence&quot;,KN=&quot;db.cassandra.speculative_execution_count&quot;,$N=&quot;db.cassandra.coordinator.id&quot;,XN=&quot;db.cassandra.coordinator.dc&quot;,WN=&quot;db.hbase.namespace&quot;,JN=&quot;db.redis.database_index&quot;,QN=&quot;db.mongodb.collection&quot;,ZN=&quot;db.sql.table&quot;,eC=&quot;exception.type&quot;,tC=&quot;exception.message&quot;,rC=&quot;exception.stacktrace&quot;,nC=&quot;exception.escaped&quot;,iC=&quot;faas.trigger&quot;,oC=&quot;faas.execution&quot;,sC=&quot;faas.document.collection&quot;,aC=&quot;faas.document.operation&quot;,lC=&quot;faas.document.time&quot;,cC=&quot;faas.document.name&quot;,uC=&quot;faas.time&quot;,fC=&quot;faas.cron&quot;,pC=&quot;faas.coldstart&quot;,dC=&quot;faas.invoked_name&quot;,hC=&quot;faas.invoked_provider&quot;,_C=&quot;faas.invoked_region&quot;,EC=&quot;net.transport&quot;,mC=&quot;net.peer.ip&quot;,TC=&quot;net.peer.port&quot;,SC=&quot;net.peer.name&quot;,gC=&quot;net.host.ip&quot;,vC=&quot;net.host.port&quot;,yC=&quot;net.host.name&quot;,OC=&quot;net.host.connection.type&quot;,AC=&quot;net.host.connection.subtype&quot;,RC=&quot;net.host.carrier.name&quot;,NC=&quot;net.host.carrier.mcc&quot;,CC=&quot;net.host.carrier.mnc&quot;,PC=&quot;net.host.carrier.icc&quot;,IC=&quot;peer.service&quot;,bC=&quot;enduser.id&quot;,LC=&quot;enduser.role&quot;,xC=&quot;enduser.scope&quot;,MC=&quot;thread.id&quot;,wC=&quot;thread.name&quot;,DC=&quot;code.function&quot;,UC=&quot;code.namespace&quot;,kC=&quot;code.filepath&quot;,BC=&quot;code.lineno&quot;,VC=&quot;http.method&quot;,FC=&quot;http.url&quot;,GC=&quot;http.target&quot;,HC=&quot;http.host&quot;,qC=&quot;http.scheme&quot;,jC=&quot;http.status_code&quot;,YC=&quot;http.flavor&quot;,zC=&quot;http.user_agent&quot;,KC=&quot;http.request_content_length&quot;,$C=&quot;http.request_content_length_uncompressed&quot;,XC=&quot;http.response_content_length&quot;,WC=&quot;http.response_content_length_uncompressed&quot;,JC=&quot;http.server_name&quot;,QC=&quot;http.route&quot;,ZC=&quot;http.client_ip&quot;,eP=&quot;aws.dynamodb.table_names&quot;,tP=&quot;aws.dynamodb.consumed_capacity&quot;,rP=&quot;aws.dynamodb.item_collection_metrics&quot;,nP=&quot;aws.dynamodb.provisioned_read_capacity&quot;,iP=&quot;aws.dynamodb.provisioned_write_capacity&quot;,oP=&quot;aws.dynamodb.consistent_read&quot;,sP=&quot;aws.dynamodb.projection&quot;,aP=&quot;aws.dynamodb.limit&quot;,lP=&quot;aws.dynamodb.attributes_to_get&quot;,cP=&quot;aws.dynamodb.index_name&quot;,uP=&quot;aws.dynamodb.select&quot;,fP=&quot;aws.dynamodb.global_secondary_indexes&quot;,pP=&quot;aws.dynamodb.local_secondary_indexes&quot;,dP=&quot;aws.dynamodb.exclusive_start_table&quot;,hP=&quot;aws.dynamodb.table_count&quot;,_P=&quot;aws.dynamodb.scan_forward&quot;,EP=&quot;aws.dynamodb.segment&quot;,mP=&quot;aws.dynamodb.total_segments&quot;,TP=&quot;aws.dynamodb.count&quot;,SP=&quot;aws.dynamodb.scanned_count&quot;,gP=&quot;aws.dynamodb.attribute_definitions&quot;,vP=&quot;aws.dynamodb.global_secondary_index_updates&quot;,yP=&quot;messaging.system&quot;,OP=&quot;messaging.destination&quot;,AP=&quot;messaging.destination_kind&quot;,RP=&quot;messaging.temp_destination&quot;,NP=&quot;messaging.protocol&quot;,CP=&quot;messaging.protocol_version&quot;,PP=&quot;messaging.url&quot;,IP=&quot;messaging.message_id&quot;,bP=&quot;messaging.conversation_id&quot;,LP=&quot;messaging.message_payload_size_bytes&quot;,xP=&quot;messaging.message_payload_compressed_size_bytes&quot;,MP=&quot;messaging.operation&quot;,wP=&quot;messaging.consumer_id&quot;,DP=&quot;messaging.rabbitmq.routing_key&quot;,UP=&quot;messaging.kafka.message_key&quot;,kP=&quot;messaging.kafka.consumer_group&quot;,BP=&quot;messaging.kafka.client_id&quot;,VP=&quot;messaging.kafka.partition&quot;,FP=&quot;messaging.kafka.tombstone&quot;,GP=&quot;rpc.system&quot;,HP=&quot;rpc.service&quot;,qP=&quot;rpc.method&quot;,jP=&quot;rpc.grpc.status_code&quot;,YP=&quot;rpc.jsonrpc.version&quot;,zP=&quot;rpc.jsonrpc.request_id&quot;,KP=&quot;rpc.jsonrpc.error_code&quot;,$P=&quot;rpc.jsonrpc.error_message&quot;,XP=&quot;message.type&quot;,WP=&quot;message.id&quot;,JP=&quot;message.compressed_size&quot;,QP=&quot;message.uncompressed_size&quot;,rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP=&quot;other_sql&quot;,eI=&quot;mssql&quot;,tI=&quot;mysql&quot;,rI=&quot;oracle&quot;,nI=&quot;db2&quot;,iI=&quot;postgresql&quot;,oI=&quot;redshift&quot;,sI=&quot;hive&quot;,aI=&quot;cloudscape&quot;,lI=&quot;hsqldb&quot;,cI=&quot;progress&quot;,uI=&quot;maxdb&quot;,fI=&quot;hanadb&quot;,pI=&quot;ingres&quot;,dI=&quot;firstsql&quot;,hI=&quot;edb&quot;,_I=&quot;cache&quot;,EI=&quot;adabas&quot;,mI=&quot;firebird&quot;,TI=&quot;derby&quot;,SI=&quot;filemaker&quot;,gI=&quot;informix&quot;,vI=&quot;instantdb&quot;,yI=&quot;interbase&quot;,OI=&quot;mariadb&quot;,AI=&quot;netezza&quot;,RI=&quot;pervasive&quot;,NI=&quot;pointbase&quot;,CI=&quot;sqlite&quot;,PI=&quot;sybase&quot;,II=&quot;teradata&quot;,bI=&quot;vertica&quot;,LI=&quot;h2&quot;,xI=&quot;coldfusion&quot;,MI=&quot;cassandra&quot;,wI=&quot;hbase&quot;,DI=&quot;mongodb&quot;,UI=&quot;redis&quot;,kI=&quot;couchbase&quot;,BI=&quot;couchdb&quot;,VI=&quot;cosmosdb&quot;,FI=&quot;dynamodb&quot;,GI=&quot;neo4j&quot;,HI=&quot;geode&quot;,qI=&quot;elasticsearch&quot;,jI=&quot;memcached&quot;,YI=&quot;cockroachdb&quot;,gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI=&quot;all&quot;,KI=&quot;each_quorum&quot;,$I=&quot;quorum&quot;,XI=&quot;local_quorum&quot;,WI=&quot;one&quot;,JI=&quot;two&quot;,QI=&quot;three&quot;,ZI=&quot;local_one&quot;,eb=&quot;any&quot;,tb=&quot;serial&quot;,rb=&quot;local_serial&quot;,hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb=&quot;datasource&quot;,ib=&quot;http&quot;,ob=&quot;pubsub&quot;,sb=&quot;timer&quot;,ab=&quot;other&quot;,NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb=&quot;insert&quot;,cb=&quot;edit&quot;,ub=&quot;delete&quot;,xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb=&quot;alibaba_cloud&quot;,pb=&quot;aws&quot;,db=&quot;azure&quot;,hb=&quot;gcp&quot;,UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b=&quot;ip_tcp&quot;,Eb=&quot;ip_udp&quot;,mb=&quot;ip&quot;,Tb=&quot;unix&quot;,Sb=&quot;pipe&quot;,gb=&quot;inproc&quot;,vb=&quot;other&quot;,GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb=&quot;wifi&quot;,Ob=&quot;wired&quot;,Ab=&quot;cell&quot;,Rb=&quot;unavailable&quot;,Nb=&quot;unknown&quot;,XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb=&quot;gprs&quot;,Pb=&quot;edge&quot;,Ib=&quot;umts&quot;,bb=&quot;cdma&quot;,Lb=&quot;evdo_0&quot;,xb=&quot;evdo_a&quot;,Mb=&quot;cdma2000_1xrtt&quot;,wb=&quot;hsdpa&quot;,Db=&quot;hsupa&quot;,Ub=&quot;hspa&quot;,kb=&quot;iden&quot;,Bb=&quot;evdo_b&quot;,Vb=&quot;lte&quot;,Fb=&quot;ehrpd&quot;,Gb=&quot;hspap&quot;,Hb=&quot;gsm&quot;,qb=&quot;td_scdma&quot;,jb=&quot;iwlan&quot;,Yb=&quot;nr&quot;,zb=&quot;nrnsa&quot;,Kb=&quot;lte_ca&quot;,t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b=&quot;1.0&quot;,Xb=&quot;1.1&quot;,Wb=&quot;2.0&quot;,Jb=&quot;SPDY&quot;,Qb=&quot;QUIC&quot;,O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb=&quot;queue&quot;,eL=&quot;topic&quot;,I8=Zb,b8=eL,L8=Be([Zb,eL]),tL=&quot;receive&quot;,rL=&quot;process&quot;,x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL=&quot;SENT&quot;,vL=&quot;RECEIVED&quot;,Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=&gt;{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=&gt;{Dm();AL=&quot;cloud.provider&quot;,RL=&quot;cloud.account.id&quot;,NL=&quot;cloud.region&quot;,CL=&quot;cloud.availability_zone&quot;,PL=&quot;cloud.platform&quot;,IL=&quot;aws.ecs.container.arn&quot;,bL=&quot;aws.ecs.cluster.arn&quot;,LL=&quot;aws.ecs.launchtype&quot;,xL=&quot;aws.ecs.task.arn&quot;,ML=&quot;aws.ecs.task.family&quot;,wL=&quot;aws.ecs.task.revision&quot;,DL=&quot;aws.eks.cluster.arn&quot;,UL=&quot;aws.log.group.names&quot;,kL=&quot;aws.log.group.arns&quot;,BL=&quot;aws.log.stream.names&quot;,VL=&quot;aws.log.stream.arns&quot;,FL=&quot;container.name&quot;,GL=&quot;container.id&quot;,HL=&quot;container.runtime&quot;,qL=&quot;container.image.name&quot;,jL=&quot;container.image.tag&quot;,YL=&quot;deployment.environment&quot;,zL=&quot;device.id&quot;,KL=&quot;device.model.identifier&quot;,$L=&quot;device.model.name&quot;,XL=&quot;faas.name&quot;,WL=&quot;faas.id&quot;,JL=&quot;faas.version&quot;,QL=&quot;faas.instance&quot;,ZL=&quot;faas.max_memory&quot;,e0=&quot;host.id&quot;,t0=&quot;host.name&quot;,r0=&quot;host.type&quot;,n0=&quot;host.arch&quot;,i0=&quot;host.image.name&quot;,o0=&quot;host.image.id&quot;,s0=&quot;host.image.version&quot;,a0=&quot;k8s.cluster.name&quot;,l0=&quot;k8s.node.name&quot;,c0=&quot;k8s.node.uid&quot;,u0=&quot;k8s.namespace.name&quot;,f0=&quot;k8s.pod.uid&quot;,p0=&quot;k8s.pod.name&quot;,d0=&quot;k8s.container.name&quot;,h0=&quot;k8s.replicaset.uid&quot;,_0=&quot;k8s.replicaset.name&quot;,E0=&quot;k8s.deployment.uid&quot;,m0=&quot;k8s.deployment.name&quot;,T0=&quot;k8s.statefulset.uid&quot;,S0=&quot;k8s.statefulset.name&quot;,g0=&quot;k8s.daemonset.uid&quot;,v0=&quot;k8s.daemonset.name&quot;,y0=&quot;k8s.job.uid&quot;,O0=&quot;k8s.job.name&quot;,A0=&quot;k8s.cronjob.uid&quot;,R0=&quot;k8s.cronjob.name&quot;,N0=&quot;os.type&quot;,C0=&quot;os.description&quot;,P0=&quot;os.name&quot;,I0=&quot;os.version&quot;,b0=&quot;process.pid&quot;,L0=&quot;process.executable.name&quot;,x0=&quot;process.executable.path&quot;,M0=&quot;process.command&quot;,w0=&quot;process.command_line&quot;,D0=&quot;process.command_args&quot;,U0=&quot;process.owner&quot;,k0=&quot;process.runtime.name&quot;,B0=&quot;process.runtime.version&quot;,V0=&quot;process.runtime.description&quot;,F0=&quot;service.name&quot;,G0=&quot;service.namespace&quot;,H0=&quot;service.instance.id&quot;,q0=&quot;service.version&quot;,j0=&quot;telemetry.sdk.name&quot;,Y0=&quot;telemetry.sdk.language&quot;,z0=&quot;telemetry.sdk.version&quot;,K0=&quot;telemetry.auto.version&quot;,$0=&quot;webengine.name&quot;,X0=&quot;webengine.version&quot;,W0=&quot;webengine.description&quot;,r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0=&quot;alibaba_cloud&quot;,Q0=&quot;aws&quot;,Z0=&quot;azure&quot;,ex=&quot;gcp&quot;,f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx=&quot;alibaba_cloud_ecs&quot;,rx=&quot;alibaba_cloud_fc&quot;,nx=&quot;aws_ec2&quot;,ix=&quot;aws_ecs&quot;,ox=&quot;aws_eks&quot;,sx=&quot;aws_lambda&quot;,ax=&quot;aws_elastic_beanstalk&quot;,lx=&quot;azure_vm&quot;,cx=&quot;azure_container_instances&quot;,ux=&quot;azure_aks&quot;,fx=&quot;azure_functions&quot;,px=&quot;azure_app_service&quot;,dx=&quot;gcp_compute_engine&quot;,hx=&quot;gcp_cloud_run&quot;,_x=&quot;gcp_kubernetes_engine&quot;,Ex=&quot;gcp_cloud_functions&quot;,mx=&quot;gcp_app_engine&quot;,E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx=&quot;ec2&quot;,Sx=&quot;fargate&quot;,w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx=&quot;amd64&quot;,vx=&quot;arm32&quot;,yx=&quot;arm64&quot;,Ox=&quot;ia64&quot;,Ax=&quot;ppc32&quot;,Rx=&quot;ppc64&quot;,Nx=&quot;x86&quot;,k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx=&quot;windows&quot;,Px=&quot;linux&quot;,Ix=&quot;darwin&quot;,bx=&quot;freebsd&quot;,Lx=&quot;netbsd&quot;,xx=&quot;openbsd&quot;,Mx=&quot;dragonflybsd&quot;,wx=&quot;hpux&quot;,Dx=&quot;aix&quot;,Ux=&quot;solaris&quot;,kx=&quot;z_os&quot;,Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx=&quot;cpp&quot;,Vx=&quot;dotnet&quot;,Fx=&quot;erlang&quot;,Gx=&quot;go&quot;,Hx=&quot;java&quot;,qx=&quot;nodejs&quot;,jx=&quot;php&quot;,Yx=&quot;python&quot;,zx=&quot;ruby&quot;,Kx=&quot;webjs&quot;,n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=&gt;{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=&gt;{d9=&quot;aspnetcore.rate_limiting.result&quot;,h9=&quot;acquired&quot;,_9=&quot;endpoint_limiter&quot;,E9=&quot;global_limiter&quot;,m9=&quot;request_canceled&quot;,T9=&quot;telemetry.sdk.language&quot;,S9=&quot;cpp&quot;,g9=&quot;dotnet&quot;,v9=&quot;erlang&quot;,y9=&quot;go&quot;,O9=&quot;java&quot;,A9=&quot;nodejs&quot;,R9=&quot;php&quot;,N9=&quot;python&quot;,C9=&quot;ruby&quot;,P9=&quot;rust&quot;,I9=&quot;swift&quot;,b9=&quot;webjs&quot;,L9=&quot;telemetry.sdk.name&quot;,x9=&quot;telemetry.sdk.version&quot;,M9=&quot;aspnetcore.diagnostics.handler.type&quot;,w9=&quot;aspnetcore.diagnostics.exception.result&quot;,D9=&quot;aborted&quot;,U9=&quot;handled&quot;,k9=&quot;skipped&quot;,B9=&quot;unhandled&quot;,V9=&quot;aspnetcore.rate_limiting.policy&quot;,F9=&quot;aspnetcore.request.is_unhandled&quot;,G9=&quot;aspnetcore.routing.is_fallback&quot;,H9=&quot;aspnetcore.routing.match_status&quot;,q9=&quot;failure&quot;,j9=&quot;success&quot;,Y9=&quot;client.address&quot;,z9=&quot;client.port&quot;,K9=&quot;error.type&quot;,$9=&quot;_OTHER&quot;,X9=&quot;exception.escaped&quot;,W9=&quot;exception.message&quot;,J9=&quot;exception.stacktrace&quot;,Q9=&quot;exception.type&quot;,Z9=function(r){return&quot;http.request.header.&quot;+r},eJ=&quot;http.request.method&quot;,tJ=&quot;_OTHER&quot;,rJ=&quot;CONNECT&quot;,nJ=&quot;DELETE&quot;,iJ=&quot;GET&quot;,oJ=&quot;HEAD&quot;,sJ=&quot;OPTIONS&quot;,aJ=&quot;PATCH&quot;,lJ=&quot;POST&quot;,cJ=&quot;PUT&quot;,uJ=&quot;TRACE&quot;,fJ=&quot;http.request.method_original&quot;,pJ=&quot;http.request.resend_count&quot;,dJ=function(r){return&quot;http.response.header.&quot;+r},hJ=&quot;http.response.status_code&quot;,_J=&quot;http.route&quot;,EJ=&quot;jvm.gc.action&quot;,mJ=&quot;jvm.gc.name&quot;,TJ=&quot;jvm.memory.pool.name&quot;,SJ=&quot;jvm.memory.type&quot;,gJ=&quot;heap&quot;,vJ=&quot;non_heap&quot;,yJ=&quot;jvm.thread.daemon&quot;,OJ=&quot;jvm.thread.state&quot;,AJ=&quot;blocked&quot;,RJ=&quot;new&quot;,NJ=&quot;runnable&quot;,CJ=&quot;terminated&quot;,PJ=&quot;timed_waiting&quot;,IJ=&quot;waiting&quot;,bJ=&quot;network.local.address&quot;,LJ=&quot;network.local.port&quot;,xJ=&quot;network.peer.address&quot;,MJ=&quot;network.peer.port&quot;,wJ=&quot;network.protocol.name&quot;,DJ=&quot;network.protocol.version&quot;,UJ=&quot;network.transport&quot;,kJ=&quot;pipe&quot;,BJ=&quot;quic&quot;,VJ=&quot;tcp&quot;,FJ=&quot;udp&quot;,GJ=&quot;unix&quot;,HJ=&quot;network.type&quot;,qJ=&quot;ipv4&quot;,jJ=&quot;ipv6&quot;,YJ=&quot;otel.scope.name&quot;,zJ=&quot;otel.scope.version&quot;,KJ=&quot;otel.status_code&quot;,$J=&quot;ERROR&quot;,XJ=&quot;OK&quot;,WJ=&quot;otel.status_description&quot;,JJ=&quot;server.address&quot;,QJ=&quot;server.port&quot;,ZJ=&quot;service.name&quot;,eQ=&quot;service.version&quot;,tQ=&quot;signalr.connection.status&quot;,rQ=&quot;app_shutdown&quot;,nQ=&quot;normal_closure&quot;,iQ=&quot;timeout&quot;,oQ=&quot;signalr.transport&quot;,sQ=&quot;long_polling&quot;,aQ=&quot;server_sent_events&quot;,lQ=&quot;web_sockets&quot;,cQ=&quot;url.fragment&quot;,uQ=&quot;url.full&quot;,fQ=&quot;url.path&quot;,pQ=&quot;url.query&quot;,dQ=&quot;url.scheme&quot;,hQ=&quot;user_agent.original&quot;});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=&gt;{_Q=&quot;aspnetcore.diagnostics.exceptions&quot;,EQ=&quot;aspnetcore.rate_limiting.active_request_leases&quot;,mQ=&quot;aspnetcore.rate_limiting.queued_requests&quot;,TQ=&quot;aspnetcore.rate_limiting.request.time_in_queue&quot;,SQ=&quot;aspnetcore.rate_limiting.request_lease.duration&quot;,gQ=&quot;aspnetcore.rate_limiting.requests&quot;,vQ=&quot;aspnetcore.routing.match_attempts&quot;,yQ=&quot;http.client.request.duration&quot;,OQ=&quot;http.server.request.duration&quot;,AQ=&quot;jvm.class.count&quot;,RQ=&quot;jvm.class.loaded&quot;,NQ=&quot;jvm.class.unloaded&quot;,CQ=&quot;jvm.cpu.count&quot;,PQ=&quot;jvm.cpu.recent_utilization&quot;,IQ=&quot;jvm.cpu.time&quot;,bQ=&quot;jvm.gc.duration&quot;,LQ=&quot;jvm.memory.committed&quot;,xQ=&quot;jvm.memory.limit&quot;,MQ=&quot;jvm.memory.used&quot;,wQ=&quot;jvm.memory.used_after_last_gc&quot;,DQ=&quot;jvm.thread.count&quot;,UQ=&quot;kestrel.active_connections&quot;,kQ=&quot;kestrel.active_tls_handshakes&quot;,BQ=&quot;kestrel.connection.duration&quot;,VQ=&quot;kestrel.queued_connections&quot;,FQ=&quot;kestrel.queued_requests&quot;,GQ=&quot;kestrel.rejected_connections&quot;,HQ=&quot;kestrel.tls_handshake.duration&quot;,qQ=&quot;kestrel.upgraded_connections&quot;,jQ=&quot;signalr.server.active_connections&quot;,YQ=&quot;signalr.server.connection.duration&quot;});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=&gt;D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=&gt;U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=&gt;k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=&gt;B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=&gt;h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=&gt;_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=&gt;E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=&gt;m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=&gt;q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=&gt;j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=&gt;w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=&gt;M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=&gt;V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=&gt;d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=&gt;F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=&gt;G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=&gt;H9,ATTR_CLIENT_ADDRESS:()=&gt;Y9,ATTR_CLIENT_PORT:()=&gt;z9,ATTR_ERROR_TYPE:()=&gt;K9,ATTR_EXCEPTION_ESCAPED:()=&gt;X9,ATTR_EXCEPTION_MESSAGE:()=&gt;W9,ATTR_EXCEPTION_STACKTRACE:()=&gt;J9,ATTR_EXCEPTION_TYPE:()=&gt;Q9,ATTR_HTTP_REQUEST_HEADER:()=&gt;Z9,ATTR_HTTP_REQUEST_METHOD:()=&gt;eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=&gt;fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=&gt;pJ,ATTR_HTTP_RESPONSE_HEADER:()=&gt;dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=&gt;hJ,ATTR_HTTP_ROUTE:()=&gt;_J,ATTR_JVM_GC_ACTION:()=&gt;EJ,ATTR_JVM_GC_NAME:()=&gt;mJ,ATTR_JVM_MEMORY_POOL_NAME:()=&gt;TJ,ATTR_JVM_MEMORY_TYPE:()=&gt;SJ,ATTR_JVM_THREAD_DAEMON:()=&gt;yJ,ATTR_JVM_THREAD_STATE:()=&gt;OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=&gt;bJ,ATTR_NETWORK_LOCAL_PORT:()=&gt;LJ,ATTR_NETWORK_PEER_ADDRESS:()=&gt;xJ,ATTR_NETWORK_PEER_PORT:()=&gt;MJ,ATTR_NETWORK_PROTOCOL_NAME:()=&gt;wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=&gt;DJ,ATTR_NETWORK_TRANSPORT:()=&gt;UJ,ATTR_NETWORK_TYPE:()=&gt;HJ,ATTR_OTEL_SCOPE_NAME:()=&gt;YJ,ATTR_OTEL_SCOPE_VERSION:()=&gt;zJ,ATTR_OTEL_STATUS_CODE:()=&gt;KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=&gt;WJ,ATTR_SERVER_ADDRESS:()=&gt;JJ,ATTR_SERVER_PORT:()=&gt;QJ,ATTR_SERVICE_NAME:()=&gt;ZJ,ATTR_SERVICE_VERSION:()=&gt;eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=&gt;tQ,ATTR_SIGNALR_TRANSPORT:()=&gt;oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=&gt;T9,ATTR_TELEMETRY_SDK_NAME:()=&gt;L9,ATTR_TELEMETRY_SDK_VERSION:()=&gt;x9,ATTR_URL_FRAGMENT:()=&gt;cQ,ATTR_URL_FULL:()=&gt;uQ,ATTR_URL_PATH:()=&gt;fQ,ATTR_URL_QUERY:()=&gt;pQ,ATTR_URL_SCHEME:()=&gt;dQ,ATTR_USER_AGENT_ORIGINAL:()=&gt;hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=&gt;w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=&gt;D7,AwsEcsLaunchtypeValues:()=&gt;U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=&gt;E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=&gt;m7,CLOUDPLATFORMVALUES_AWS_EC2:()=&gt;T7,CLOUDPLATFORMVALUES_AWS_ECS:()=&gt;S7,CLOUDPLATFORMVALUES_AWS_EKS:()=&gt;g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=&gt;y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=&gt;v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=&gt;R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=&gt;C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=&gt;A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=&gt;N7,CLOUDPLATFORMVALUES_AZURE_VM:()=&gt;O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=&gt;x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=&gt;L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=&gt;I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=&gt;P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=&gt;b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;f7,CLOUDPROVIDERVALUES_AWS:()=&gt;p7,CLOUDPROVIDERVALUES_AZURE:()=&gt;d7,CLOUDPROVIDERVALUES_GCP:()=&gt;h7,CloudPlatformValues:()=&gt;M7,CloudProviderValues:()=&gt;_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=&gt;hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=&gt;yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=&gt;_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=&gt;vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=&gt;mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=&gt;AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=&gt;TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=&gt;EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=&gt;OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=&gt;gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=&gt;SW,DBSYSTEMVALUES_ADABAS:()=&gt;kX,DBSYSTEMVALUES_CACHE:()=&gt;UX,DBSYSTEMVALUES_CASSANDRA:()=&gt;eW,DBSYSTEMVALUES_CLOUDSCAPE:()=&gt;PX,DBSYSTEMVALUES_COCKROACHDB:()=&gt;pW,DBSYSTEMVALUES_COLDFUSION:()=&gt;ZX,DBSYSTEMVALUES_COSMOSDB:()=&gt;sW,DBSYSTEMVALUES_COUCHBASE:()=&gt;iW,DBSYSTEMVALUES_COUCHDB:()=&gt;oW,DBSYSTEMVALUES_DB2:()=&gt;AX,DBSYSTEMVALUES_DERBY:()=&gt;VX,DBSYSTEMVALUES_DYNAMODB:()=&gt;aW,DBSYSTEMVALUES_EDB:()=&gt;DX,DBSYSTEMVALUES_ELASTICSEARCH:()=&gt;uW,DBSYSTEMVALUES_FILEMAKER:()=&gt;FX,DBSYSTEMVALUES_FIREBIRD:()=&gt;BX,DBSYSTEMVALUES_FIRSTSQL:()=&gt;wX,DBSYSTEMVALUES_GEODE:()=&gt;cW,DBSYSTEMVALUES_H2:()=&gt;QX,DBSYSTEMVALUES_HANADB:()=&gt;xX,DBSYSTEMVALUES_HBASE:()=&gt;tW,DBSYSTEMVALUES_HIVE:()=&gt;CX,DBSYSTEMVALUES_HSQLDB:()=&gt;IX,DBSYSTEMVALUES_INFORMIX:()=&gt;GX,DBSYSTEMVALUES_INGRES:()=&gt;MX,DBSYSTEMVALUES_INSTANTDB:()=&gt;HX,DBSYSTEMVALUES_INTERBASE:()=&gt;qX,DBSYSTEMVALUES_MARIADB:()=&gt;jX,DBSYSTEMVALUES_MAXDB:()=&gt;LX,DBSYSTEMVALUES_MEMCACHED:()=&gt;fW,DBSYSTEMVALUES_MONGODB:()=&gt;rW,DBSYSTEMVALUES_MSSQL:()=&gt;vX,DBSYSTEMVALUES_MYSQL:()=&gt;yX,DBSYSTEMVALUES_NEO4J:()=&gt;lW,DBSYSTEMVALUES_NETEZZA:()=&gt;YX,DBSYSTEMVALUES_ORACLE:()=&gt;OX,DBSYSTEMVALUES_OTHER_SQL:()=&gt;gX,DBSYSTEMVALUES_PERVASIVE:()=&gt;zX,DBSYSTEMVALUES_POINTBASE:()=&gt;KX,DBSYSTEMVALUES_POSTGRESQL:()=&gt;RX,DBSYSTEMVALUES_PROGRESS:()=&gt;bX,DBSYSTEMVALUES_REDIS:()=&gt;nW,DBSYSTEMVALUES_REDSHIFT:()=&gt;NX,DBSYSTEMVALUES_SQLITE:()=&gt;$X,DBSYSTEMVALUES_SYBASE:()=&gt;XX,DBSYSTEMVALUES_TERADATA:()=&gt;WX,DBSYSTEMVALUES_VERTICA:()=&gt;JX,DbCassandraConsistencyLevelValues:()=&gt;RW,DbSystemValues:()=&gt;dW,ERROR_TYPE_VALUE_OTHER:()=&gt;$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=&gt;wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=&gt;MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=&gt;xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;UW,FAASINVOKEDPROVIDERVALUES_AWS:()=&gt;kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=&gt;BW,FAASINVOKEDPROVIDERVALUES_GCP:()=&gt;VW,FAASTRIGGERVALUES_DATASOURCE:()=&gt;NW,FAASTRIGGERVALUES_HTTP:()=&gt;CW,FAASTRIGGERVALUES_OTHER:()=&gt;bW,FAASTRIGGERVALUES_PUBSUB:()=&gt;PW,FAASTRIGGERVALUES_TIMER:()=&gt;IW,FaasDocumentOperationValues:()=&gt;DW,FaasInvokedProviderValues:()=&gt;FW,FaasTriggerValues:()=&gt;LW,HOSTARCHVALUES_AMD64:()=&gt;k7,HOSTARCHVALUES_ARM32:()=&gt;B7,HOSTARCHVALUES_ARM64:()=&gt;V7,HOSTARCHVALUES_IA64:()=&gt;F7,HOSTARCHVALUES_PPC32:()=&gt;G7,HOSTARCHVALUES_PPC64:()=&gt;H7,HOSTARCHVALUES_X86:()=&gt;q7,HTTPFLAVORVALUES_HTTP_1_0:()=&gt;O8,HTTPFLAVORVALUES_HTTP_1_1:()=&gt;A8,HTTPFLAVORVALUES_HTTP_2_0:()=&gt;R8,HTTPFLAVORVALUES_QUIC:()=&gt;C8,HTTPFLAVORVALUES_SPDY:()=&gt;N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=&gt;rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=&gt;nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=&gt;iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=&gt;oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=&gt;sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=&gt;tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=&gt;aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=&gt;lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=&gt;cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=&gt;uJ,HostArchValues:()=&gt;j7,HttpFlavorValues:()=&gt;P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=&gt;gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=&gt;vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=&gt;AJ,JVM_THREAD_STATE_VALUE_NEW:()=&gt;RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=&gt;NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=&gt;CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=&gt;PJ,JVM_THREAD_STATE_VALUE_WAITING:()=&gt;IJ,MESSAGETYPEVALUES_RECEIVED:()=&gt;e5,MESSAGETYPEVALUES_SENT:()=&gt;Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=&gt;I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=&gt;b8,MESSAGINGOPERATIONVALUES_PROCESS:()=&gt;M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=&gt;x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=&gt;_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=&gt;EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=&gt;mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=&gt;gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=&gt;SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=&gt;TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=&gt;vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=&gt;yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=&gt;OQ,METRIC_JVM_CLASS_COUNT:()=&gt;AQ,METRIC_JVM_CLASS_LOADED:()=&gt;RQ,METRIC_JVM_CLASS_UNLOADED:()=&gt;NQ,METRIC_JVM_CPU_COUNT:()=&gt;CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=&gt;PQ,METRIC_JVM_CPU_TIME:()=&gt;IQ,METRIC_JVM_GC_DURATION:()=&gt;bQ,METRIC_JVM_MEMORY_COMMITTED:()=&gt;LQ,METRIC_JVM_MEMORY_LIMIT:()=&gt;xQ,METRIC_JVM_MEMORY_USED:()=&gt;MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=&gt;wQ,METRIC_JVM_THREAD_COUNT:()=&gt;DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=&gt;UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=&gt;kQ,METRIC_KESTREL_CONNECTION_DURATION:()=&gt;BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=&gt;VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=&gt;FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=&gt;GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=&gt;HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=&gt;qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=&gt;jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=&gt;YQ,MessageTypeValues:()=&gt;t5,MessagingDestinationKindValues:()=&gt;L8,MessagingOperationValues:()=&gt;w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=&gt;i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=&gt;a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=&gt;r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=&gt;h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=&gt;o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=&gt;s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=&gt;p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=&gt;t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=&gt;E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=&gt;l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=&gt;u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=&gt;_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=&gt;c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=&gt;f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=&gt;T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=&gt;d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=&gt;v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=&gt;S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=&gt;g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=&gt;m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=&gt;n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=&gt;JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=&gt;QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=&gt;ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=&gt;XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=&gt;WW,NETTRANSPORTVALUES_INPROC:()=&gt;zW,NETTRANSPORTVALUES_IP:()=&gt;qW,NETTRANSPORTVALUES_IP_TCP:()=&gt;GW,NETTRANSPORTVALUES_IP_UDP:()=&gt;HW,NETTRANSPORTVALUES_OTHER:()=&gt;KW,NETTRANSPORTVALUES_PIPE:()=&gt;YW,NETTRANSPORTVALUES_UNIX:()=&gt;jW,NETWORK_TRANSPORT_VALUE_PIPE:()=&gt;kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=&gt;BJ,NETWORK_TRANSPORT_VALUE_TCP:()=&gt;VJ,NETWORK_TRANSPORT_VALUE_UDP:()=&gt;FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=&gt;GJ,NETWORK_TYPE_VALUE_IPV4:()=&gt;qJ,NETWORK_TYPE_VALUE_IPV6:()=&gt;jJ,NetHostConnectionSubtypeValues:()=&gt;y8,NetHostConnectionTypeValues:()=&gt;e8,NetTransportValues:()=&gt;$W,OSTYPEVALUES_AIX:()=&gt;Z7,OSTYPEVALUES_DARWIN:()=&gt;K7,OSTYPEVALUES_DRAGONFLYBSD:()=&gt;J7,OSTYPEVALUES_FREEBSD:()=&gt;$7,OSTYPEVALUES_HPUX:()=&gt;Q7,OSTYPEVALUES_LINUX:()=&gt;z7,OSTYPEVALUES_NETBSD:()=&gt;X7,OSTYPEVALUES_OPENBSD:()=&gt;W7,OSTYPEVALUES_SOLARIS:()=&gt;e9,OSTYPEVALUES_WINDOWS:()=&gt;Y7,OSTYPEVALUES_Z_OS:()=&gt;t9,OTEL_STATUS_CODE_VALUE_ERROR:()=&gt;$J,OTEL_STATUS_CODE_VALUE_OK:()=&gt;XJ,OsTypeValues:()=&gt;r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=&gt;Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=&gt;G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=&gt;U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=&gt;W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=&gt;V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=&gt;j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=&gt;$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=&gt;B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=&gt;F8,RPCGRPCSTATUSCODEVALUES_OK:()=&gt;D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=&gt;z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=&gt;H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=&gt;q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=&gt;J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=&gt;X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=&gt;K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=&gt;k8,RpcGrpcStatusCodeValues:()=&gt;Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=&gt;P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=&gt;F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=&gt;R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=&gt;v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=&gt;B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=&gt;M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=&gt;L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=&gt;G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=&gt;I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=&gt;y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=&gt;C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=&gt;x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=&gt;N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=&gt;O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=&gt;A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=&gt;V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=&gt;D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=&gt;U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=&gt;b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=&gt;w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=&gt;g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=&gt;k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=&gt;rK,SEMATTRS_CODE_FILEPATH:()=&gt;n$,SEMATTRS_CODE_FUNCTION:()=&gt;t$,SEMATTRS_CODE_LINENO:()=&gt;i$,SEMATTRS_CODE_NAMESPACE:()=&gt;r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=&gt;dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=&gt;TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=&gt;mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=&gt;_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=&gt;fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=&gt;pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=&gt;EK,SEMATTRS_DB_CASSANDRA_TABLE:()=&gt;hK,SEMATTRS_DB_CONNECTION_STRING:()=&gt;iK,SEMATTRS_DB_HBASE_NAMESPACE:()=&gt;SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=&gt;sK,SEMATTRS_DB_MONGODB_COLLECTION:()=&gt;vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=&gt;uK,SEMATTRS_DB_NAME:()=&gt;aK,SEMATTRS_DB_OPERATION:()=&gt;cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=&gt;gK,SEMATTRS_DB_SQL_TABLE:()=&gt;yK,SEMATTRS_DB_STATEMENT:()=&gt;lK,SEMATTRS_DB_SYSTEM:()=&gt;nK,SEMATTRS_DB_USER:()=&gt;oK,SEMATTRS_ENDUSER_ID:()=&gt;WK,SEMATTRS_ENDUSER_ROLE:()=&gt;JK,SEMATTRS_ENDUSER_SCOPE:()=&gt;QK,SEMATTRS_EXCEPTION_ESCAPED:()=&gt;OK,SEMATTRS_EXCEPTION_MESSAGE:()=&gt;Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=&gt;Um,SEMATTRS_EXCEPTION_TYPE:()=&gt;Xa,SEMATTRS_FAAS_COLDSTART:()=&gt;xK,SEMATTRS_FAAS_CRON:()=&gt;LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=&gt;NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=&gt;IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=&gt;CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=&gt;PK,SEMATTRS_FAAS_EXECUTION:()=&gt;RK,SEMATTRS_FAAS_INVOKED_NAME:()=&gt;MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=&gt;wK,SEMATTRS_FAAS_INVOKED_REGION:()=&gt;DK,SEMATTRS_FAAS_TIME:()=&gt;bK,SEMATTRS_FAAS_TRIGGER:()=&gt;AK,SEMATTRS_HTTP_CLIENT_IP:()=&gt;S$,SEMATTRS_HTTP_FLAVOR:()=&gt;f$,SEMATTRS_HTTP_HOST:()=&gt;l$,SEMATTRS_HTTP_METHOD:()=&gt;o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=&gt;d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=&gt;_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;E$,SEMATTRS_HTTP_ROUTE:()=&gt;T$,SEMATTRS_HTTP_SCHEME:()=&gt;c$,SEMATTRS_HTTP_SERVER_NAME:()=&gt;m$,SEMATTRS_HTTP_STATUS_CODE:()=&gt;u$,SEMATTRS_HTTP_TARGET:()=&gt;a$,SEMATTRS_HTTP_URL:()=&gt;s$,SEMATTRS_HTTP_USER_AGENT:()=&gt;p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=&gt;mX,SEMATTRS_MESSAGE_ID:()=&gt;EX,SEMATTRS_MESSAGE_TYPE:()=&gt;_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=&gt;TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=&gt;eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=&gt;W$,SEMATTRS_MESSAGING_DESTINATION:()=&gt;q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=&gt;j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=&gt;iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=&gt;nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=&gt;rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=&gt;oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=&gt;sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=&gt;X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=&gt;Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=&gt;J$,SEMATTRS_MESSAGING_OPERATION:()=&gt;Z$,SEMATTRS_MESSAGING_PROTOCOL:()=&gt;z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=&gt;K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=&gt;tX,SEMATTRS_MESSAGING_SYSTEM:()=&gt;H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=&gt;Y$,SEMATTRS_MESSAGING_URL:()=&gt;$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=&gt;$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=&gt;zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=&gt;KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=&gt;YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=&gt;jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=&gt;qK,SEMATTRS_NET_HOST_IP:()=&gt;FK,SEMATTRS_NET_HOST_NAME:()=&gt;HK,SEMATTRS_NET_HOST_PORT:()=&gt;GK,SEMATTRS_NET_PEER_IP:()=&gt;kK,SEMATTRS_NET_PEER_NAME:()=&gt;VK,SEMATTRS_NET_PEER_PORT:()=&gt;BK,SEMATTRS_NET_TRANSPORT:()=&gt;UK,SEMATTRS_PEER_SERVICE:()=&gt;XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=&gt;uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=&gt;dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=&gt;hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=&gt;pX,SEMATTRS_RPC_JSONRPC_VERSION:()=&gt;fX,SEMATTRS_RPC_METHOD:()=&gt;cX,SEMATTRS_RPC_SERVICE:()=&gt;lX,SEMATTRS_RPC_SYSTEM:()=&gt;aX,SEMATTRS_THREAD_ID:()=&gt;ZK,SEMATTRS_THREAD_NAME:()=&gt;e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=&gt;l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=&gt;a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=&gt;c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=&gt;u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=&gt;f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=&gt;p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=&gt;d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=&gt;_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=&gt;h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=&gt;m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=&gt;E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=&gt;n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=&gt;o5,SEMRESATTRS_CLOUD_PLATFORM:()=&gt;s5,SEMRESATTRS_CLOUD_PROVIDER:()=&gt;r5,SEMRESATTRS_CLOUD_REGION:()=&gt;i5,SEMRESATTRS_CONTAINER_ID:()=&gt;S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=&gt;v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=&gt;y5,SEMRESATTRS_CONTAINER_NAME:()=&gt;T5,SEMRESATTRS_CONTAINER_RUNTIME:()=&gt;g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=&gt;O5,SEMRESATTRS_DEVICE_ID:()=&gt;A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=&gt;R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=&gt;N5,SEMRESATTRS_FAAS_ID:()=&gt;P5,SEMRESATTRS_FAAS_INSTANCE:()=&gt;b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=&gt;L5,SEMRESATTRS_FAAS_NAME:()=&gt;C5,SEMRESATTRS_FAAS_VERSION:()=&gt;I5,SEMRESATTRS_HOST_ARCH:()=&gt;Vm,SEMRESATTRS_HOST_ID:()=&gt;km,SEMRESATTRS_HOST_IMAGE_ID:()=&gt;w5,SEMRESATTRS_HOST_IMAGE_NAME:()=&gt;M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=&gt;D5,SEMRESATTRS_HOST_NAME:()=&gt;Bm,SEMRESATTRS_HOST_TYPE:()=&gt;x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=&gt;U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=&gt;H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=&gt;e7,SEMRESATTRS_K8S_CRONJOB_UID:()=&gt;Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=&gt;W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=&gt;X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=&gt;z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=&gt;Y5,SEMRESATTRS_K8S_JOB_NAME:()=&gt;Q5,SEMRESATTRS_K8S_JOB_UID:()=&gt;J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=&gt;V5,SEMRESATTRS_K8S_NODE_NAME:()=&gt;k5,SEMRESATTRS_K8S_NODE_UID:()=&gt;B5,SEMRESATTRS_K8S_POD_NAME:()=&gt;G5,SEMRESATTRS_K8S_POD_UID:()=&gt;F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=&gt;j5,SEMRESATTRS_K8S_REPLICASET_UID:()=&gt;q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=&gt;$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=&gt;K5,SEMRESATTRS_OS_DESCRIPTION:()=&gt;t7,SEMRESATTRS_OS_NAME:()=&gt;r7,SEMRESATTRS_OS_TYPE:()=&gt;Fm,SEMRESATTRS_OS_VERSION:()=&gt;Gm,SEMRESATTRS_PROCESS_COMMAND:()=&gt;Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=&gt;zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=&gt;n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=&gt;qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=&gt;jm,SEMRESATTRS_PROCESS_OWNER:()=&gt;Km,SEMRESATTRS_PROCESS_PID:()=&gt;Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=&gt;Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=&gt;st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=&gt;ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=&gt;$m,SEMRESATTRS_SERVICE_NAME:()=&gt;at,SEMRESATTRS_SERVICE_NAMESPACE:()=&gt;i7,SEMRESATTRS_SERVICE_VERSION:()=&gt;o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=&gt;s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=&gt;ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=&gt;Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=&gt;ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=&gt;c7,SEMRESATTRS_WEBENGINE_NAME:()=&gt;a7,SEMRESATTRS_WEBENGINE_VERSION:()=&gt;l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=&gt;rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=&gt;nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=&gt;iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=&gt;sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=&gt;aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=&gt;lQ,SemanticAttributes:()=&gt;SX,SemanticResourceAttributes:()=&gt;u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=&gt;n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=&gt;i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=&gt;o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=&gt;s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=&gt;a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=&gt;wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=&gt;l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=&gt;c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=&gt;u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=&gt;f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=&gt;S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=&gt;g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=&gt;v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=&gt;y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=&gt;O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=&gt;A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=&gt;R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=&gt;N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=&gt;C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=&gt;P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=&gt;I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=&gt;b9,TelemetrySdkLanguageValues:()=&gt;p9});var Ve=p(()=&gt;{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=&gt;{P();Zm=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Zu,SM=p(()=&gt;{Zu=&quot;baggage&quot;});function tf(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function rf(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function il(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;il(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var eT=p(()=&gt;{P()});var nf,yM=p(()=&gt;{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=tf(a);i.length&gt;0&amp;&amp;o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=il(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=&gt;{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var NM=p(()=&gt;{P()});function sf(){return r=&gt;{S.error(EZ(r))}}function EZ(r){return typeof r==&quot;string&quot;?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=&gt;{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=&gt;{nT();CM=sf()});var Vo,oT=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)&gt;-1}function yZ(r){return vZ.indexOf(r)&gt;-1}function AZ(r){return OZ.indexOf(r)&gt;-1}function RZ(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=PZ[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=&gt;{P();oT();TZ=&quot;,&quot;,SZ=[&quot;OTEL_SDK_DISABLED&quot;];vZ=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];OZ=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=&gt;{lT()});var cf,bM=p(()=&gt;{cf=typeof globalThis==&quot;object&quot;?globalThis:global});function LM(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var cT=p(()=&gt;{});function ff(r){return Buffer.from(uf(r)).toString(&quot;base64&quot;)}var xM=p(()=&gt;{cT()});function MM(r){return function(){for(let t=0;t&lt;r/4;t++)pf.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(pf[t]&gt;0);t++)t===r-1&amp;&amp;(pf[r-1]=1);return pf.toString(&quot;hex&quot;,0,r)}}var Go,pf,wM=p(()=&gt;{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from&quot;perf_hooks&quot;;var In,DM=p(()=&gt;{In=bZ});var df,uT=p(()=&gt;{df=&quot;1.29.0&quot;});var bn,UM=p(()=&gt;{uT();Ve();bn={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=&gt;{});var BM=p(()=&gt;{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=&gt;{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!=&quot;number&quot;){let e=In;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r==&quot;number&quot;?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r==&quot;number&quot;)return r&lt;Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function zM(r){return mf(r)||typeof r==&quot;number&quot;||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=_f&amp;&amp;(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=&gt;{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Tf||(Tf={}))});var Sf,XM=p(()=&gt;{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&amp;&amp;!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=&gt;{hT=&quot;[_0-9a-z-*/]&quot;,MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=&gt;{QM();ZM=32,BZ=512,ew=&quot;,&quot;,tw=&quot;=&quot;,qo=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length&gt;BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&amp;&amp;JM(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;ZM&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=&gt;{P();nl();_T();cl=&quot;traceparent&quot;,ul=&quot;tracestate&quot;,VZ=&quot;00&quot;,FZ=&quot;(?!ff)[\\da-f]{2}&quot;,GZ=&quot;(?![0]{32})[\\da-f]{32}&quot;,HZ=&quot;(?![0]{16})[\\da-f]{16}&quot;,qZ=&quot;[\\da-f]{2}&quot;,jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&amp;&amp;o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new qo(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=&gt;{P();mT=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(vf||(vf={}))});var Ai,TT=p(()=&gt;{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Ln,ST=p(()=&gt;{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var yf,aw=p(()=&gt;{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=&gt;{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;cw.call(t)===XZ}function QZ(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&amp;&amp;Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&amp;&amp;(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=&gt;{YZ=&quot;[object Object]&quot;,zZ=&quot;[object Null]&quot;,KZ=&quot;[object Undefined]&quot;,$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t&gt;ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Af(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&amp;&amp;fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r==&quot;function&quot;}function fl(r){return!Af(r)&amp;&amp;!Rf(r)&amp;&amp;!mw(r)&amp;&amp;typeof r==&quot;object&quot;}function Af(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=&gt;{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var pl,gw=p(()=&gt;{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=&gt;{});function Ow(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Aw=p(()=&gt;{});var Nf,Rw=p(()=&gt;{Nf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=&gt;{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=&gt;{he.with(Qu(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Pw=p(()=&gt;{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=&gt;Ai,AlwaysOnSampler:()=&gt;Ln,AnchoredClock:()=&gt;of,BindOnceFuture:()=&gt;Cf,CompositePropagator:()=&gt;Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;ol,DEFAULT_ENVIRONMENT:()=&gt;al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;aT,ExportResultCode:()=&gt;Tf,ParentBasedSampler:()=&gt;yf,RPCType:()=&gt;vf,RandomIdGenerator:()=&gt;Go,SDK_INFO:()=&gt;bn,TRACE_PARENT_HEADER:()=&gt;cl,TRACE_STATE_HEADER:()=&gt;ul,TimeoutError:()=&gt;pl,TraceIdRatioBasedSampler:()=&gt;Of,TraceState:()=&gt;qo,TracesSamplerValues:()=&gt;Vo,VERSION:()=&gt;df,W3CBaggagePropagator:()=&gt;nf,W3CTraceContextPropagator:()=&gt;gf,_globalThis:()=&gt;cf,addHrTimes:()=&gt;dT,baggageUtils:()=&gt;iee,callWithTimeout:()=&gt;Sw,deleteRPCMetadata:()=&gt;iw,getEnv:()=&gt;Fo,getEnvWithoutDefaults:()=&gt;lf,getRPCMetadata:()=&gt;ow,getTimeOrigin:()=&gt;Ef,globalErrorHandler:()=&gt;af,hexToBase64:()=&gt;ff,hexToBinary:()=&gt;uf,hrTime:()=&gt;pT,hrTimeDuration:()=&gt;GM,hrTimeToMicroseconds:()=&gt;YM,hrTimeToMilliseconds:()=&gt;jM,hrTimeToNanoseconds:()=&gt;qM,hrTimeToTimeStamp:()=&gt;HM,internal:()=&gt;oee,isAttributeKey:()=&gt;tT,isAttributeValue:()=&gt;rT,isTimeInput:()=&gt;zM,isTimeInputHrTime:()=&gt;mf,isTracingSuppressed:()=&gt;At,isUrlIgnored:()=&gt;vw,isWrapped:()=&gt;Ow,loggingErrorHandler:()=&gt;sf,merge:()=&gt;_w,millisToHrTime:()=&gt;Ho,otperformance:()=&gt;In,parseEnvironment:()=&gt;ll,parseTraceParent:()=&gt;ET,sanitizeAttributes:()=&gt;AM,setGlobalErrorHandler:()=&gt;PM,setRPCMetadata:()=&gt;nw,suppressTracing:()=&gt;Qu,timeInputToHrTime:()=&gt;FM,unrefTimer:()=&gt;hf,unsuppressTracing:()=&gt;TM,urlMatches:()=&gt;yT});var iee,oee,xr=p(()=&gt;{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=&gt;{(function(r){r[r.UNSPECIFIED=0]=&quot;UNSPECIFIED&quot;,r[r.TRACE=1]=&quot;TRACE&quot;,r[r.TRACE2=2]=&quot;TRACE2&quot;,r[r.TRACE3=3]=&quot;TRACE3&quot;,r[r.TRACE4=4]=&quot;TRACE4&quot;,r[r.DEBUG=5]=&quot;DEBUG&quot;,r[r.DEBUG2=6]=&quot;DEBUG2&quot;,r[r.DEBUG3=7]=&quot;DEBUG3&quot;,r[r.DEBUG4=8]=&quot;DEBUG4&quot;,r[r.INFO=9]=&quot;INFO&quot;,r[r.INFO2=10]=&quot;INFO2&quot;,r[r.INFO3=11]=&quot;INFO3&quot;,r[r.INFO4=12]=&quot;INFO4&quot;,r[r.WARN=13]=&quot;WARN&quot;,r[r.WARN2=14]=&quot;WARN2&quot;,r[r.WARN3=15]=&quot;WARN3&quot;,r[r.WARN4=16]=&quot;WARN4&quot;,r[r.ERROR=17]=&quot;ERROR&quot;,r[r.ERROR2=18]=&quot;ERROR2&quot;,r[r.ERROR3=19]=&quot;ERROR3&quot;,r[r.ERROR4=20]=&quot;ERROR4&quot;,r[r.FATAL=21]=&quot;FATAL&quot;,r[r.FATAL2=22]=&quot;FATAL2&quot;,r[r.FATAL3=23]=&quot;FATAL3&quot;,r[r.FATAL4=24]=&quot;FATAL4&quot;})(If||(If={}))});var Ni,jo,bf=p(()=&gt;{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=&gt;{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=&gt;{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=&gt;{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&amp;&amp;s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=&gt;{xf=typeof globalThis==&quot;object&quot;?globalThis:global});var Lw=p(()=&gt;{bw()});var xw=p(()=&gt;{Lw()});function Mw(r,e,t){return o=&gt;o===r?e:t}var hl,Ko,RT,ww=p(()=&gt;{xw();hl=Symbol.for(&quot;io.opentelemetry.js.api.logs&quot;),Ko=xf;RT=1});var Mf,Dw=p(()=&gt;{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&amp;&amp;t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=&gt;jo,NOOP_LOGGER_PROVIDER:()=&gt;Yo,NoopLogger:()=&gt;Ni,NoopLoggerProvider:()=&gt;dl,ProxyLogger:()=&gt;zo,ProxyLoggerProvider:()=&gt;Ci,SeverityNumber:()=&gt;If,logs:()=&gt;_l});var _l,El=p(()=&gt;{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=&gt;{P();see=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var Fw=p(()=&gt;{});function Gw(){return r=&gt;{S.error(lee(r))}}function lee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=&gt;{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=&gt;{Hw();uee=Gw()});var Df,jw=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Df||(Df={}))});function dee(r){return pee.indexOf(r)&gt;-1}function _ee(r){return hee.indexOf(r)&gt;-1}function mee(r){return Eee.indexOf(r)&gt;-1}function Tee(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=vee[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=&gt;{P();jw();fee=&quot;,&quot;,pee=[&quot;OTEL_SDK_DISABLED&quot;];hee=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];Eee=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=&gt;{NT()});import{performance as Oee}from&quot;perf_hooks&quot;;var Pi,$w=p(()=&gt;{Pi=Oee});var Xw,Ww=p(()=&gt;{Xw=&quot;1.29.0&quot;});var Ii,Jw=p(()=&gt;{Ww();Ve();Ii={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=&gt;{});var Zw=p(()=&gt;{Kw();$w();Jw();Qw()});var CT=p(()=&gt;{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!=&quot;number&quot;){let e=Pi;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r==&quot;number&quot;?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r==&quot;number&quot;)return r&lt;PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=e1&amp;&amp;(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=&gt;{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;s1.call(t)===wee}function kee(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Bee(r){return r==null?r===void 0?xee:Lee:bi&amp;&amp;bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&amp;&amp;(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=&gt;{bee=&quot;[object Object]&quot;,Lee=&quot;[object Null]&quot;,xee=&quot;[object Undefined]&quot;,Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t&gt;Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&amp;&amp;gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r==&quot;function&quot;}function gl(r){return!Vf(r)&amp;&amp;!Ff(r)&amp;&amp;!d1(r)&amp;&amp;typeof r==&quot;object&quot;}function Vf(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=&gt;{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Gf,_1=p(()=&gt;{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=&gt;{Hf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=&gt;{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=&gt;{he.with(kw(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var S1=p(()=&gt;{P();Bw()});var qf,cr=p(()=&gt;{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=&gt;{});var v1=p(()=&gt;{g1()});var y1=p(()=&gt;{v1()});var Mn,O1=p(()=&gt;{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=&gt;{O1()});var Wo,MT=p(()=&gt;{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&amp;&amp;xe(_)&amp;&amp;(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&amp;&amp;!(typeof t==&quot;object&quot;&amp;&amp;!Array.isArray(t)&amp;&amp;Object.keys(t).length&gt;0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length&gt;=this._logRecordLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&amp;&amp;S.warn(&quot;Dropping extra attributes.&quot;),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&amp;&amp;S.warn(&quot;Can not execute the operation on emitted log record&quot;),this._isReadonly}}});var Yf,R1=p(()=&gt;{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&amp;&amp;e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&amp;&amp;s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;i!==void 0?i:$o}}var P1=p(()=&gt;{cr()});var zf,I1=p(()=&gt;{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=&gt;vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=&gt;o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=&gt;e.shutdown()))}}});var Jo,wT=p(()=&gt;{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=&gt;{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=&gt;{P();El();A1();cr();R1();P1();I1();b1();qee=&quot;unknown&quot;;$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn(&quot;A shutdown LoggerProvider cannot provide a Logger&quot;),jo;e||S.warn(&quot;Logger requested without instrumentation scope name.&quot;);let s=e||qee,a=`${s}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&amp;&amp;this._sharedState.activeProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current log record processor&quot;,t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn(&quot;invalid attempt to force flush after LoggerProvider shutdown&quot;),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn(&quot;shutdown may only be called once per LoggerProvider&quot;),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=&gt;{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=&gt;{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=&gt;qf._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Yt.SUCCESS&amp;&amp;Mr((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(this._unresolvedExports.delete(a),s()),Mr);a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=&gt;{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=&gt;{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&amp;&amp;o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&amp;&amp;s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&amp;&amp;a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&amp;&amp;i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length&gt;=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a&lt;s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=&gt;{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=&gt;e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;{this._flushOneBatch().then(()=&gt;{this._finishedLogRecords.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(e=&gt;{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=&gt;qf._export(this._exporter,e).then(s=&gt;{var a;s.code!==Yt.SUCCESS&amp;&amp;Mr((a=s.error)!==null&amp;&amp;a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=&gt;s.resource).filter(s=&gt;s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=&gt;{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=&gt;{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=&gt;{U1()});var B1=p(()=&gt;{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=&gt;Qo,ConsoleLogRecordExporter:()=&gt;Xf,InMemoryLogRecordExporter:()=&gt;Jf,LogRecord:()=&gt;Wo,LoggerProvider:()=&gt;$f,NoopLogRecordProcessor:()=&gt;Jo,SimpleLogRecordProcessor:()=&gt;Wf});var UT=p(()=&gt;{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=&gt;{(function(r){r[r.DELTA=0]=&quot;DELTA&quot;,r[r.CUMULATIVE=1]=&quot;CUMULATIVE&quot;})(ur||(ur={}))});var lt,Zo=p(()=&gt;{(function(r){r[r.HISTOGRAM=0]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=1]=&quot;EXPONENTIAL_HISTOGRAM&quot;,r[r.GAUGE=2]=&quot;GAUGE&quot;,r[r.SUM=3]=&quot;SUM&quot;})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?&quot;&quot;:(e=e.sort(),JSON.stringify(e.map(t=&gt;[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&amp;&amp;e!==void 0?e:&quot;&quot;}:${(t=r.schemaUrl)!==null&amp;&amp;t!==void 0?t:&quot;&quot;}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=&gt;{try{return{status:&quot;fulfilled&quot;,value:await e}}catch(t){return{status:&quot;rejected&quot;,reason:t}}}))}function H1(r){return r.status===&quot;rejected&quot;}function kT(r,e){let t=[];return r.forEach(o=&gt;{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o&gt;=t;){let a=t+Math.trunc((o-t)/2);r[a]&lt;e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=&gt;{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=&gt;{(function(r){r[r.DROP=0]=&quot;DROP&quot;,r[r.SUM=1]=&quot;SUM&quot;,r[r.LAST_VALUE=2]=&quot;LAST_VALUE&quot;,r[r.HISTOGRAM=3]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=4]=&quot;EXPONENTIAL_HISTOGRAM&quot;})(zt||(zt={}))});var yl,z1=p(()=&gt;{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: &quot;${r}&quot;. The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&amp;&amp;o!==void 0?o:&quot;&quot;,unit:(s=t==null?void 0:t.unit)!==null&amp;&amp;s!==void 0?s:&quot;&quot;,valueType:(a=t==null?void 0:t.valueType)!==null&amp;&amp;a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&amp;&amp;i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&amp;&amp;t!==void 0?t:e.name,description:(o=r.description)!==null&amp;&amp;o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&amp;&amp;r.unit===e.unit&amp;&amp;r.type===e.type&amp;&amp;r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=&gt;{P();fr();(function(r){r.COUNTER=&quot;COUNTER&quot;,r.GAUGE=&quot;GAUGE&quot;,r.HISTOGRAM=&quot;HISTOGRAM&quot;,r.UP_DOWN_COUNTER=&quot;UP_DOWN_COUNTER&quot;,r.OBSERVABLE_COUNTER=&quot;OBSERVABLE_COUNTER&quot;,r.OBSERVABLE_GAUGE=&quot;OBSERVABLE_GAUGE&quot;,r.OBSERVABLE_UP_DOWN_COUNTER=&quot;OBSERVABLE_UP_DOWN_COUNTER&quot;})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=&gt;0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=&gt;{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&amp;&amp;(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u&lt;a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&amp;&amp;(o.hasMinMax&amp;&amp;s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&amp;&amp;(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&amp;&amp;(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l&lt;a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=&gt;{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&amp;&amp;this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=&gt;this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e&lt;t&amp;&amp;(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e&lt;this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e&gt;=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1&lt;&lt;e,s=0,a=0;for(let i=this.indexStart;i&lt;=this.indexEnd;){let n=i%o;n&lt;0&amp;&amp;(n+=o);for(let l=n;l&lt;o&amp;&amp;s&lt;t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart&gt;&gt;=e,this.indexEnd&gt;&gt;=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&amp;&amp;(e&gt;0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&amp;&amp;this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s&lt;o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]&gt;=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&amp;2146435072)&gt;&gt;20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&amp;1048575)*Math.pow(2,32)+o}var Al,VT=p(()=&gt;{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r&gt;&gt;1,r|=r&gt;&gt;2,r|=r&gt;&gt;4,r|=r&gt;&gt;8,r|=r&gt;&gt;16,r++,r}var np=p(()=&gt;{});var Dr,ip=p(()=&gt;{Dr=class extends Error{}});var op,eD=p(()=&gt;{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e&lt;Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o&gt;&gt;this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e&lt;t)throw new Dr(`underflow: ${e} is &lt; minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e&gt;o)throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${o}`);return Rl(1,e&lt;&lt;this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022&gt;&gt;this._shift;return this._shift&lt;2&amp;&amp;e--,e}_maxNormalLowerBoundaryIndex(){return 1023&gt;&gt;this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=&gt;{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e&lt;=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)&lt;&lt;this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t&gt;=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e&gt;=t){if(e===t)return 2*Math.exp((e-(1&lt;&lt;this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e&lt;=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1&lt;&lt;this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is &lt; minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022&lt;&lt;this._scale}_maxNormalLowerBoundaryIndex(){return(1024&lt;&lt;this._scale)-1}}});function HT(r){if(r&gt;nD||r&lt;rD)throw new Dr(`expected scale &gt;= ${rD} &amp;&amp; &lt;= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=&gt;{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=&gt;e&gt;10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=&gt;{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize&lt;qT&amp;&amp;(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e&gt;this._max&amp;&amp;(this._max=e),e&lt;this._min&amp;&amp;(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e&gt;0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&amp;&amp;(e.min&lt;this.min&amp;&amp;(this._min=e.min),e.max&gt;this.max&amp;&amp;(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s&lt;e.indexStart&amp;&amp;e.indexEnd-s&gt;=this._maxSize?(a=!0,n=s,i=e.indexEnd):s&gt;e.indexEnd&amp;&amp;s-e.indexStart&gt;=this._maxSize&amp;&amp;(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&amp;&amp;(e.indexStart=e.indexEnd=e.indexBase=t),t&lt;e.indexStart){let a=e.indexEnd-t;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexStart=t}else if(t&gt;e.indexEnd){let a=t-e.indexStart;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s&lt;0&amp;&amp;(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i&gt;this._maxSize&amp;&amp;(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t&gt;=this._maxSize;)e&gt;&gt;=1,t&gt;&gt;=1,o++;return o}_downscale(e){if(e===0)return;if(e&lt;0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart&gt;&gt;s,e.indexEnd&gt;&gt;s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++)this._incrementIndexBy(e,a+n&gt;&gt;i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++){let c=(a+n&gt;&gt;i)-e.indexBase;c&lt;0&amp;&amp;(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=&gt;{P();Qee=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function lD(){return r=&gt;{S.error(Zee(r))}}function Zee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=&gt;{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=&gt;{cD();tte=lD()});var fD,pD=p(()=&gt;{fD=&quot;1.29.0&quot;});var xi,dD=p(()=&gt;{pD();Ve();xi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=&gt;{});var _D=p(()=&gt;{dD();hD()});var ED=p(()=&gt;{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=&gt;{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(pr||(pr={}))});function SD(r,e){return new Promise(t=&gt;{he.with(sD(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var gD=p(()=&gt;{P();aD()});var vD,Dn=p(()=&gt;{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=&gt;{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=&gt;{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&amp;&amp;e&lt;0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&amp;&amp;o&gt;s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=&gt;{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=&gt;{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error(&quot;ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array&quot;);e=e.concat(),e=e.sort((a,i)=&gt;a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&amp;&amp;(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=&gt;{cp();Zf();ID=r=&gt;mt.Default(),up=r=&gt;ur.CUMULATIVE});var us,YT=p(()=&gt;{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&amp;&amp;t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&amp;&amp;o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&amp;&amp;s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error(&quot;MetricReader can not be bound to a MeterProvider again.&quot;);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error(&quot;MetricReader is not bound to a MetricProducer&quot;);if(this._shutdown)throw new Error(&quot;MetricReader is shutdown&quot;);let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=&gt;n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=&gt;n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=&gt;n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error(&quot;Cannot call shutdown twice.&quot;);return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn(&quot;Cannot forceFlush on already shutdown MetricReader.&quot;);return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=&gt;{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;=0)throw Error(&quot;exportIntervalMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportTimeoutMillis&lt;=0)throw Error(&quot;exportTimeoutMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;e.exportTimeoutMillis)throw Error(&quot;exportIntervalMillis must be greater than or equal to exportTimeoutMillis&quot;);this._exportInterval=(s=e.exportIntervalMillis)!==null&amp;&amp;s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&amp;&amp;a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error(&quot;Export took longer than %s milliseconds and timed out.&quot;,this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length&gt;0&amp;&amp;S.error(&quot;PeriodicExportingMetricReader: metrics collection errors&quot;,...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug(&quot;Error while resolving async portion of resource: &quot;,i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=&gt;{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&amp;&amp;clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=&gt;{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=&gt;t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=&gt;t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=&gt;{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&amp;&amp;t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=&gt;{});var wD=p(()=&gt;{MD()});var DD=p(()=&gt;{wD()});var kn,UD=p(()=&gt;{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=&gt;{UD()});var _p,BD=p(()=&gt;{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=&gt;this._matchInstrument(s.instrumentSelector,e)&amp;&amp;this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&amp;&amp;e.getNameFilter().match(t.name)&amp;&amp;e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&amp;&amp;(t.version===void 0||e.getVersionFilter().match(t.version))&amp;&amp;(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=&gt;{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e&lt;0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e&lt;0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=&gt;{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=&gt;{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=&gt;{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=&gt;{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={&quot;otel.metric.overflow&quot;:!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size&gt;=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=&gt;this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=&gt;{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size&gt;=this._cardinalityLimit&amp;&amp;(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=&gt;{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=&gt;{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&amp;&amp;(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=&gt;{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=&gt;{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t=&quot;&quot;;return r.unit!==e.unit&amp;&amp;(t+=` - Unit &#x27;${r.unit}&#x27; does not match &#x27;${e.unit}&#x27; `),r.type!==e.type&amp;&amp;(t+=` - Type &#x27;${r.type}&#x27; does not match &#x27;${e.type}&#x27; `),r.valueType!==e.valueType&amp;&amp;(t+=` - Value Type &#x27;${r.valueType}&#x27; does not match &#x27;${e.valueType}&#x27; `),r.description!==e.description&amp;&amp;(t+=` - Description &#x27;${r.description}&#x27; does not match &#x27;${e.description}&#x27; `),t}function hte(r,e){return` - use valueType &#x27;${r.valueType}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function _te(r,e){return` - use unit &#x27;${r.unit}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27;`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27; - OR - create a new view with the name ${r.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):&quot;&quot;}var GD=p(()=&gt;{});var Np,HD=p(()=&gt;{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&amp;&amp;(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&amp;&amp;(e.description.length&gt;a.description.length&amp;&amp;s.updateDescription(e.description),S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=&gt;{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=&gt;{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=&gt;{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&amp;&amp;(s=new Dt,this._buffer.set(e,s)),typeof t!=&quot;number&quot;){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(t)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=&gt;{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)&gt;=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o&lt;0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error(&quot;BatchObservableCallback is not associated with valid instruments&quot;,t);return}this._findBatchCallback(e,o)&gt;=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s&lt;0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=&gt;n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=&gt;{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s._metricStorages.forEach(n=&gt;{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=&gt;{let a=new Ip,i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s.forEach(n=&gt;{let l=a._buffer.get(n);l!=null&amp;&amp;n._metricStorages.forEach(c=&gt;{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=&gt;o.callback===e&amp;&amp;o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=&gt;o.callback===e&amp;&amp;q1(o.instruments,t))}}});var Lp,zD=p(()=&gt;{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=&gt;{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=&gt;this._allowedAttributeNames.includes(s)).forEach(s=&gt;o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=&gt;{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=&gt;n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=&gt;{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=&gt;{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=&gt;{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&amp;&amp;(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=&gt;{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=&gt;{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&amp;&amp;o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&amp;&amp;s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&amp;&amp;s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=&gt;{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&amp;&amp;t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&amp;&amp;e.views.length&gt;0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&amp;&amp;e.readers.length&gt;0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t=&quot;&quot;,o={}){return this._shutdown?(S.warn(&quot;A shutdown MeterProvider cannot provide a Meter&quot;),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn(&quot;shutdown may only be called once per MeterProvider&quot;);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn(&quot;invalid attempt to force flush after MeterProvider shutdown&quot;);return}await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=&gt;{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e===&quot;*&quot;?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,&quot;\\$&amp;&quot;).replace(&quot;*&quot;,&quot;.*&quot;)}$`}static hasWildcard(e){return e.includes(&quot;*&quot;)}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=&gt;{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&amp;&amp;t!==void 0?t:&quot;*&quot;),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=&gt;{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&amp;&amp;r.instrumentType==null&amp;&amp;r.instrumentUnit==null&amp;&amp;r.meterName==null&amp;&amp;r.meterVersion==null&amp;&amp;r.meterSchemaUrl==null}var Fp,ZD=p(()=&gt;{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error(&quot;Cannot create view with no selector arguments supplied&quot;);if(e.name!=null&amp;&amp;((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error(&quot;Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.&quot;);e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&amp;&amp;t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=&gt;mt,AggregationTemporality:()=&gt;ur,ConsoleMetricExporter:()=&gt;dp,DataPointType:()=&gt;lt,DefaultAggregation:()=&gt;Ll,DropAggregation:()=&gt;as,ExplicitBucketHistogramAggregation:()=&gt;Il,ExponentialHistogramAggregation:()=&gt;bl,HistogramAggregation:()=&gt;cs,InMemoryMetricExporter:()=&gt;pp,InstrumentType:()=&gt;_e,LastValueAggregation:()=&gt;ls,MeterProvider:()=&gt;Up,MetricReader:()=&gt;us,PeriodicExportingMetricReader:()=&gt;fp,SumAggregation:()=&gt;wi,TimeoutError:()=&gt;Li,View:()=&gt;Fp});var Gp=p(()=&gt;{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=&gt;{&quot;use strict&quot;;Object.defineProperty(Hp,&quot;__esModule&quot;,{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V(&quot;events&quot;),Ote=[&quot;addListener&quot;,&quot;on&quot;,&quot;once&quot;,&quot;prependListener&quot;,&quot;prependOnceListener&quot;],tS=class{constructor(){this._kOtListeners=Symbol(&quot;OtListeners&quot;),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t==&quot;function&quot;?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=&gt;t.apply(this,a))};return Object.defineProperty(s,&quot;length&quot;,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=&gt;{t[s]!==void 0&amp;&amp;(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener==&quot;function&quot;&amp;&amp;(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off==&quot;function&quot;&amp;&amp;(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners==&quot;function&quot;&amp;&amp;(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&amp;&amp;(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&amp;&amp;delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&amp;&amp;(n=s._createPatchMap(e));let l=n[a];l===void 0&amp;&amp;(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=&gt;{&quot;use strict&quot;;Object.defineProperty(qp,&quot;__esModule&quot;,{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V(&quot;async_hooks&quot;),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&amp;&amp;e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t===&quot;TIMERWRAP&quot;)return;let o=this._stack[this._stack.length-1];o!==void 0&amp;&amp;this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&amp;&amp;this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=&gt;{&quot;use strict&quot;;Object.defineProperty(jp,&quot;__esModule&quot;,{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V(&quot;async_hooks&quot;),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&amp;&amp;e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=&gt;{&quot;use strict&quot;;Object.defineProperty(ms,&quot;__esModule&quot;,{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,&quot;AsyncHooksContextManager&quot;,{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,&quot;AsyncLocalStorageContextManager&quot;,{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=&gt;{P();Ts=De(&quot;OpenTelemetry Context Key B3 Debug Flag&quot;)});var Ss,gs,vs,ys,Yp,Os,sS=p(()=&gt;{Ss=&quot;b3&quot;,gs=&quot;x-b3-traceid&quot;,vs=&quot;x-b3-spanid&quot;,ys=&quot;x-b3-sampled&quot;,Yp=&quot;x-b3-parentspanid&quot;,Os=&quot;x-b3-flags&quot;});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t==&quot;string&quot;?t.padStart(32,&quot;0&quot;):&quot;&quot;}function kte(r,e){let t=Kp(r,e,vs);return typeof t==&quot;string&quot;?t:&quot;&quot;}function nU(r,e){return Kp(r,e,Os)===&quot;1&quot;?&quot;1&quot;:void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)===&quot;1&quot;||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=&gt;{P();xr();oS();sS();xte=new Set([!0,&quot;true&quot;,&quot;True&quot;,&quot;1&quot;,1]),Mte=new Set([!1,&quot;false&quot;,&quot;False&quot;,&quot;0&quot;,0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a===&quot;1&quot;?o.set(t,Os,a):s.traceFlags!==void 0&amp;&amp;o.set(t,ys,(se.SAMPLED&amp;s.traceFlags)===se.SAMPLED?&quot;1&quot;:&quot;0&quot;)}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&amp;&amp;Si(a)&amp;&amp;wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&amp;&amp;Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=&gt;{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte=&quot;0&quot;.repeat(16),Gte=new Set([&quot;d&quot;,&quot;1&quot;]),Hte=&quot;d&quot;;$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&amp;1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,&quot;b3&quot;,i)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;),a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&amp;&amp;(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return[&quot;b3&quot;]}}});var As,aS=p(()=&gt;{(function(r){r[r.SINGLE_HEADER=0]=&quot;SINGLE_HEADER&quot;,r[r.MULTI_HEADER=1]=&quot;MULTI_HEADER&quot;})(As||(As={}))});var Xp,sU=p(()=&gt;{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;);return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=&gt;As,B3Propagator:()=&gt;Xp,B3_CONTEXT_HEADER:()=&gt;Ss,X_B3_FLAGS:()=&gt;Os,X_B3_PARENT_SPAN_ID:()=&gt;Yp,X_B3_SAMPLED:()=&gt;ys,X_B3_SPAN_ID:()=&gt;vs,X_B3_TRACE_ID:()=&gt;gs});var lU=p(()=&gt;{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=&gt;{P();cU=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Wp,uU=p(()=&gt;{Wp=&quot;baggage&quot;});function pU(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function dU(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function hU(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}var _U=p(()=&gt;{P()});var Ul,EU=p(()=&gt;{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=pU(a);i.length&gt;0&amp;&amp;o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=hU(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var SU=p(()=&gt;{P()});function gU(){return r=&gt;{S.error($te(r))}}function $te(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=&gt;{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=&gt;{vU();Wte=gU()});var Ut,cS=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)&gt;-1}function tre(r){return ere.indexOf(r)&gt;-1}function nre(r){return rre.indexOf(r)&gt;-1}function ire(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=are[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=&gt;{P();cS();Jte=&quot;,&quot;,Qte=[&quot;OTEL_SDK_DISABLED&quot;];ere=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rre=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=&gt;{uS()});import{performance as cre}from&quot;perf_hooks&quot;;var dr,NU=p(()=&gt;{dr=cre});var CU,PU=p(()=&gt;{CU=&quot;1.29.0&quot;});var ki,IU=p(()=&gt;{PU();Ve();ki={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=&gt;{});var LU=p(()=&gt;{RU();NU();IU();bU()});var fS=p(()=&gt;{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!=&quot;number&quot;){let e=dr;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r==&quot;number&quot;?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function nd(r){return rd(r)||typeof r==&quot;number&quot;||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=pS&amp;&amp;(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=&gt;{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Xt||(Xt={}))});var Vl,wU=p(()=&gt;{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&amp;&amp;!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=&gt;{_S=&quot;[_0-9a-z-*/]&quot;,Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=&gt;{kU();BU=32,vre=512,VU=&quot;,&quot;,FU=&quot;=&quot;,od=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length&gt;vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&amp;&amp;UU(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;BU&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=&gt;{P();Dl();GU();sd=&quot;traceparent&quot;,ad=&quot;tracestate&quot;,yre=&quot;00&quot;,Ore=&quot;(?!ff)[\\da-f]{2}&quot;,Are=&quot;(?![0]{32})[\\da-f]{32}&quot;,Rre=&quot;(?![0]{16})[\\da-f]{16}&quot;,Nre=&quot;[\\da-f]{2}&quot;,Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&amp;&amp;o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new od(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;jU.call(t)===xre}function Dre(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&amp;&amp;Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&amp;&amp;(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=&gt;{Pre=&quot;[object Object]&quot;,Ire=&quot;[object Null]&quot;,bre=&quot;[object Undefined]&quot;,Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t&gt;Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(ld(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&amp;&amp;Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r==&quot;function&quot;}function Gl(r){return!ld(r)&amp;&amp;!cd(r)&amp;&amp;!JU(r)&amp;&amp;typeof r==&quot;object&quot;}function ld(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=&gt;{$U();Vre=20});var ud,ZU=p(()=&gt;{ud=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=&gt;{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=&gt;{he.with(wl(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var rk=p(()=&gt;{P();Dl()});var nk,kt=p(()=&gt;{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=&gt;{ik=&quot;exception&quot;});var Cs,SS=p(()=&gt;{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&amp;&amp;this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length&gt;=this._spanLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn(&quot;No events allowed.&quot;),this._droppedEventsCount++,this;this.events.length&gt;=this._spanLimits.eventCountLimit&amp;&amp;(this._droppedEventsCount===0&amp;&amp;S.debug(&quot;Dropping extra events.&quot;),this.events.shift(),this._droppedEventsCount++),nd(t)&amp;&amp;(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&amp;&amp;typeof e.message!=&quot;string&quot;&amp;&amp;(S.warn(`Dropping invalid status.message of type &#x27;${typeof e.message}&#x27;, expected &#x27;string&#x27;`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]&lt;0&amp;&amp;(S.warn(&quot;Inconsistent start and end time, startTime &gt; endTime. Setting span duration to 0ms.&quot;,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount&gt;0&amp;&amp;S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==&quot;number&quot;&amp;&amp;e&lt;=dr.now())return dS(e+this._performanceOffset);if(typeof e==&quot;number&quot;)return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e==&quot;string&quot;?o[Wa]=e:e&amp;&amp;(e.code?o[Xa]=e.code.toString():e.name&amp;&amp;(o[Xa]=e.name),e.message&amp;&amp;(o[Wa]=e.message),e.stack&amp;&amp;(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&amp;&amp;S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(hr||(hr={}))});var Ur,fd=p(()=&gt;{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Wt,pd=p(()=&gt;{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var Gn,gS=p(()=&gt;{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=&gt;{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value &quot;${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}&quot;.`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG===&quot;&quot;)return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e&lt;0||e&gt;1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=&gt;{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&amp;&amp;t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&amp;&amp;s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&amp;&amp;l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&amp;&amp;u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=&gt;{OS();kt()});var hd,ck=p(()=&gt;{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==&quot;number&quot;?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==&quot;number&quot;?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==&quot;number&quot;?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==&quot;number&quot;?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)!==0&amp;&amp;this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=&gt;this.onShutdown()).then(()=&gt;this._flushAll()).then(()=&gt;this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length&gt;=this._maxQueueSize){this._droppedSpansCount===0&amp;&amp;S.debug(&quot;maxQueueSize reached, dropping spans&quot;),this._droppedSpansCount++;return}this._droppedSpansCount&gt;0&amp;&amp;(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a&lt;i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=&gt;{let o=setTimeout(()=&gt;{t(new Error(&quot;Timeout&quot;))},this._exportTimeoutMillis);he.with(wl(he.active()),()=&gt;{let s;this._finishedSpans.length&lt;=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=&gt;this._exporter.export(s,n=&gt;{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&amp;&amp;l!==void 0?l:new Error(&quot;BatchSpanProcessor: span export failed&quot;))}),i=null;for(let n=0,l=s.length;n&lt;l;n++){let c=s[n];c.resource.asyncAttributesPending&amp;&amp;c.resource.waitForAsyncAttributes&amp;&amp;(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=&gt;{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=&gt;{this._isExporting=!0,this._flushOneBatch().finally(()=&gt;{this._isExporting=!1,this._finishedSpans.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(t=&gt;{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length&gt;=this._maxExportBatchSize)return e();this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=&gt;{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t&lt;r/4;t++)_d.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(_d[t]&gt;0);t++)t===r-1&amp;&amp;(_d[r-1]=1);return _d.toString(&quot;hex&quot;,0,r)}}var qn,_d,pk=p(()=&gt;{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=&gt;{uk();pk()});var Ed=p(()=&gt;{dk()});var Is,hk=p(()=&gt;{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&amp;&amp;(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug(&quot;Instrumentation suppressed, returning Noop Span&quot;),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&amp;&amp;s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&amp;&amp;a!==void 0?a:[]).map(z=&gt;({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&amp;&amp;i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug(&quot;Recording is off, propagating context in a non-recording span&quot;),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length&lt;2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=&gt;{});var Ek=p(()=&gt;{_k()});var mk=p(()=&gt;{Ek()});var jn,Tk=p(()=&gt;{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=&gt;{Tk()});var ql,gk=p(()=&gt;{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=&gt;{Promise.all(e).then(()=&gt;{t()}).catch(o=&gt;{Kt(o||new Error(&quot;MultiSpanProcessor: forceFlush failed&quot;)),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=&gt;{Promise.all(e).then(()=&gt;{t()},o)})}}});var bs,RS=p(()=&gt;{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=&gt;{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]=&quot;resolved&quot;,r[r.timeout=1]=&quot;timeout&quot;,r[r.error=2]=&quot;error&quot;,r[r.unresolved=3]=&quot;unresolved&quot;})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&amp;&amp;t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&amp;&amp;(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&amp;&amp;o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&amp;&amp;this.activeSpanProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current span processor&quot;,t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&amp;&amp;(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&amp;&amp;he.setGlobalContextManager(e.contextManager),e.propagator&amp;&amp;Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=&gt;new Promise(s=&gt;{let a,i=setTimeout(()=&gt;{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=&gt;{clearTimeout(i),a!==pn.timeout&amp;&amp;(a=pn.resolved,s(a))}).catch(n=&gt;{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=&gt;{Promise.all(t).then(a=&gt;{let i=a.filter(n=&gt;n!==pn.resolved);i.length&gt;0?s(i):o()}).catch(a=&gt;s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=&gt;{let a=this._getPropagator(s);return a||S.warn(`Propagator &quot;${s}&quot; requested through environment variable is unavailable.`),a}).reduce((s,a)=&gt;(a&amp;&amp;s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e===&quot;none&quot;||e===&quot;&quot;)return;let t=this._getSpanExporter(e);return t||S.error(`Exporter &quot;${e}&quot; requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([[&quot;tracecontext&quot;,()=&gt;new Fl],[&quot;baggage&quot;,()=&gt;new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=&gt;{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=&gt;{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedSpans.push(...e),setTimeout(()=&gt;t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=&gt;{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&amp;&amp;await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)===0)return;let s=()=&gt;nk._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Xt.SUCCESS&amp;&amp;Kt((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=&gt;{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(a!=null&amp;&amp;this._unresolvedExports.delete(a),s()),i=&gt;Kt(i));a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=&gt;Ur,AlwaysOnSampler:()=&gt;Wt,BasicTracerProvider:()=&gt;Ls,BatchSpanProcessor:()=&gt;Hn,ConsoleSpanExporter:()=&gt;Td,ForceFlushState:()=&gt;pn,InMemorySpanExporter:()=&gt;Sd,NoopSpanProcessor:()=&gt;bs,ParentBasedSampler:()=&gt;Gn,RandomIdGenerator:()=&gt;qn,SamplingDecision:()=&gt;hr,SimpleSpanProcessor:()=&gt;gd,Span:()=&gt;Cs,TraceIdRatioBasedSampler:()=&gt;Fi,Tracer:()=&gt;Is});var Gi=p(()=&gt;{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=&gt;{&quot;use strict&quot;;var qre=&quot;2.0.0&quot;,jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=[&quot;major&quot;,&quot;premajor&quot;,&quot;minor&quot;,&quot;preminor&quot;,&quot;patch&quot;,&quot;prepatch&quot;,&quot;prerelease&quot;];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=&gt;{&quot;use strict&quot;;var $re=typeof process==&quot;object&quot;&amp;&amp;process.env&amp;&amp;process.env.NODE_DEBUG&amp;&amp;/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=&gt;console.error(&quot;SEMVER&quot;,...r):()=&gt;{};Nk.exports=$re});var Ms=T((kr,Ck)=&gt;{&quot;use strict&quot;;var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS=&quot;[a-zA-Z0-9-]&quot;,rne=[[&quot;\\s&quot;,1],[&quot;\\d&quot;,Wre],[CS,Xre]],nne=r=&gt;{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=&gt;{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?&quot;g&quot;:void 0),Zre[s]=new RegExp(o,t?&quot;g&quot;:void 0)};re(&quot;NUMERICIDENTIFIER&quot;,&quot;0|[1-9]\\d*&quot;);re(&quot;NUMERICIDENTIFIERLOOSE&quot;,&quot;\\d+&quot;);re(&quot;NONNUMERICIDENTIFIER&quot;,`\\d*[a-zA-Z-]${CS}*`);re(&quot;MAINVERSION&quot;,`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re(&quot;MAINVERSIONLOOSE&quot;,`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASEIDENTIFIER&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re(&quot;PRERELEASEIDENTIFIERLOOSE&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASE&quot;,`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re(&quot;PRERELEASELOOSE&quot;,`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re(&quot;BUILDIDENTIFIER&quot;,`${CS}+`);re(&quot;BUILD&quot;,`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re(&quot;FULLPLAIN&quot;,`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re(&quot;FULL&quot;,`^${D[U.FULLPLAIN]}$`);re(&quot;LOOSEPLAIN&quot;,`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re(&quot;LOOSE&quot;,`^${D[U.LOOSEPLAIN]}$`);re(&quot;GTLT&quot;,&quot;((?:&lt;|&gt;)?=?)&quot;);re(&quot;XRANGEIDENTIFIERLOOSE&quot;,`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re(&quot;XRANGEIDENTIFIER&quot;,`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re(&quot;XRANGEPLAIN&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGEPLAINLOOSE&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re(&quot;XRANGELOOSE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COERCEPLAIN&quot;,`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re(&quot;COERCE&quot;,`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re(&quot;COERCEFULL&quot;,D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re(&quot;COERCERTL&quot;,D[U.COERCE],!0);re(&quot;COERCERTLFULL&quot;,D[U.COERCEFULL],!0);re(&quot;LONETILDE&quot;,&quot;(?:~&gt;?)&quot;);re(&quot;TILDETRIM&quot;,`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace=&quot;$1~&quot;;re(&quot;TILDE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re(&quot;TILDELOOSE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;LONECARET&quot;,&quot;(?:\\^)&quot;);re(&quot;CARETTRIM&quot;,`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace=&quot;$1^&quot;;re(&quot;CARET&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re(&quot;CARETLOOSE&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COMPARATORLOOSE&quot;,`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re(&quot;COMPARATOR&quot;,`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re(&quot;COMPARATORTRIM&quot;,`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace=&quot;$1$2$3&quot;;re(&quot;HYPHENRANGE&quot;,`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re(&quot;HYPHENRANGELOOSE&quot;,`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re(&quot;STAR&quot;,&quot;(&lt;|&gt;)?=?\\s*\\*&quot;);re(&quot;GTE0&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0\\s*$&quot;);re(&quot;GTE0PRE&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0-0\\s*$&quot;)});var vd=T((c1e,Pk)=&gt;{&quot;use strict&quot;;var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=&gt;r?typeof r!=&quot;object&quot;?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=&gt;{&quot;use strict&quot;;var Ik=/^[0-9]+$/,bk=(r,e)=&gt;{let t=Ik.test(r),o=Ik.test(e);return t&amp;&amp;o&amp;&amp;(r=+r,e=+e),r===e?0:t&amp;&amp;!o?-1:o&amp;&amp;!t?1:r&lt;e?-1:1},ane=(r,e)=&gt;bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=&gt;{&quot;use strict&quot;;var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!=&quot;string&quot;)throw new TypeError(`Invalid version. Must be a string. Got type &quot;${typeof e}&quot;.`);if(e.length&gt;xk)throw new TypeError(`version is longer than ${xk} characters`);yd(&quot;SemVer&quot;,e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major&gt;Od||this.major&lt;0)throw new TypeError(&quot;Invalid major version&quot;);if(this.minor&gt;Od||this.minor&lt;0)throw new TypeError(&quot;Invalid minor version&quot;);if(this.patch&gt;Od||this.patch&lt;0)throw new TypeError(&quot;Invalid patch version&quot;);o[4]?this.prerelease=o[4].split(&quot;.&quot;).map(s=&gt;{if(/^[0-9]+$/.test(s)){let a=+s;if(a&gt;=0&amp;&amp;a&lt;Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split(&quot;.&quot;):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&amp;&amp;(this.version+=`-${this.prerelease.join(&quot;.&quot;)}`),this.version}toString(){return this.version}compare(e){if(yd(&quot;SemVer.compare&quot;,this.version,this.options,e),!(e instanceof r)){if(typeof e==&quot;string&quot;&amp;&amp;e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&amp;&amp;!e.prerelease.length)return-1;if(!this.prerelease.length&amp;&amp;e.prerelease.length)return 1;if(!this.prerelease.length&amp;&amp;!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd(&quot;prerelease compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd(&quot;build compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith(&quot;pre&quot;)){if(!t&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier is empty&quot;);if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case&quot;premajor&quot;:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(&quot;pre&quot;,t,o);break;case&quot;preminor&quot;:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(&quot;pre&quot;,t,o);break;case&quot;prepatch&quot;:this.prerelease.length=0,this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;prerelease&quot;:this.prerelease.length===0&amp;&amp;this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;release&quot;:if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case&quot;major&quot;:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&amp;&amp;this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case&quot;minor&quot;:(this.patch!==0||this.prerelease.length===0)&amp;&amp;this.minor++,this.patch=0,this.prerelease=[];break;case&quot;patch&quot;:this.prerelease.length===0&amp;&amp;this.patch++,this.prerelease=[];break;case&quot;pre&quot;:{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a&gt;=0;)typeof this.prerelease[a]==&quot;number&quot;&amp;&amp;(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(&quot;.&quot;)&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier already exists&quot;);this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&amp;&amp;(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&amp;&amp;(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&amp;&amp;(this.raw+=`+${this.build.join(&quot;.&quot;)}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=&gt;{&quot;use strict&quot;;var wk=pt(),cne=(r,e,t=!1)=&gt;{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=&gt;{&quot;use strict&quot;;var une=Hi(),fne=(r,e)=&gt;{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=&gt;{&quot;use strict&quot;;var pne=Hi(),dne=(r,e)=&gt;{let t=pne(r.trim().replace(/^[=v]+/,&quot;&quot;),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=&gt;{&quot;use strict&quot;;var Fk=pt(),hne=(r,e,t,o,s)=&gt;{typeof t==&quot;string&quot;&amp;&amp;(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=&gt;{&quot;use strict&quot;;var qk=Hi(),_ne=(r,e)=&gt;{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s&gt;0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&amp;&amp;!l){if(!n.patch&amp;&amp;!n.minor)return&quot;major&quot;;if(n.compareMain(i)===0)return n.minor&amp;&amp;!n.patch?&quot;minor&quot;:&quot;patch&quot;}let u=l?&quot;pre&quot;:&quot;&quot;;return t.major!==o.major?u+&quot;major&quot;:t.minor!==o.minor?u+&quot;minor&quot;:t.patch!==o.patch?u+&quot;patch&quot;:&quot;prerelease&quot;};jk.exports=_ne});var Kk=T((m1e,zk)=&gt;{&quot;use strict&quot;;var Ene=pt(),mne=(r,e)=&gt;new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=&gt;{&quot;use strict&quot;;var Tne=pt(),Sne=(r,e)=&gt;new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=&gt;{&quot;use strict&quot;;var gne=pt(),vne=(r,e)=&gt;new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=&gt;{&quot;use strict&quot;;var yne=Hi(),One=(r,e)=&gt;{let t=yne(r,e);return t&amp;&amp;t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=&gt;{&quot;use strict&quot;;var eB=pt(),Ane=(r,e,t)=&gt;new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=&gt;{&quot;use strict&quot;;var Rne=Jt(),Nne=(r,e,t)=&gt;Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=&gt;{&quot;use strict&quot;;var Cne=Jt(),Pne=(r,e)=&gt;Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=&gt;{&quot;use strict&quot;;var sB=pt(),Ine=(r,e,t)=&gt;{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=&gt;{&quot;use strict&quot;;var bne=Nd(),Lne=(r,e)=&gt;r.sort((t,o)=&gt;bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=&gt;{&quot;use strict&quot;;var xne=Nd(),Mne=(r,e)=&gt;r.sort((t,o)=&gt;xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=&gt;{&quot;use strict&quot;;var wne=Jt(),Dne=(r,e,t)=&gt;wne(r,e,t)&gt;0;pB.exports=Dne});var Cd=T((P1e,dB)=&gt;{&quot;use strict&quot;;var Une=Jt(),kne=(r,e,t)=&gt;Une(r,e,t)&lt;0;dB.exports=kne});var bS=T((I1e,hB)=&gt;{&quot;use strict&quot;;var Bne=Jt(),Vne=(r,e,t)=&gt;Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=&gt;{&quot;use strict&quot;;var Fne=Jt(),Gne=(r,e,t)=&gt;Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=&gt;{&quot;use strict&quot;;var Hne=Jt(),qne=(r,e,t)=&gt;Hne(r,e,t)&gt;=0;EB.exports=qne});var Id=T((x1e,mB)=&gt;{&quot;use strict&quot;;var jne=Jt(),Yne=(r,e,t)=&gt;jne(r,e,t)&lt;=0;mB.exports=Yne});var xS=T((M1e,TB)=&gt;{&quot;use strict&quot;;var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=&gt;{switch(e){case&quot;===&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r===t;case&quot;!==&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r!==t;case&quot;&quot;:case&quot;=&quot;:case&quot;==&quot;:return zne(r,t,o);case&quot;!=&quot;:return Kne(r,t,o);case&quot;&gt;&quot;:return $ne(r,t,o);case&quot;&gt;=&quot;:return Xne(r,t,o);case&quot;&lt;&quot;:return Wne(r,t,o);case&quot;&lt;=&quot;:return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=&gt;{&quot;use strict&quot;;var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=&gt;{if(r instanceof Zne)return r;if(typeof r==&quot;number&quot;&amp;&amp;(r=String(r)),typeof r!=&quot;string&quot;)return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&amp;&amp;(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&amp;&amp;(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||&quot;0&quot;,a=t[4]||&quot;0&quot;,i=e.includePrerelease&amp;&amp;t[5]?`-${t[5]}`:&quot;&quot;,n=e.includePrerelease&amp;&amp;t[6]?`+${t[6]}`:&quot;&quot;;return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=&gt;{&quot;use strict&quot;;var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&amp;&amp;t!==void 0){if(this.map.size&gt;=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=&gt;{&quot;use strict&quot;;var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie,&quot; &quot;),this.set=this.raw.split(&quot;||&quot;).map(o=&gt;this.parseRange(o.trim())).filter(o=&gt;o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length&gt;1){let o=this.set[0];if(this.set=this.set.filter(s=&gt;!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length&gt;1){for(let s of this.set)if(s.length===1&amp;&amp;fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=&quot;&quot;;for(let e=0;e&lt;this.set.length;e++){e&gt;0&amp;&amp;(this.formatted+=&quot;||&quot;);let t=this.set[e];for(let o=0;o&lt;t.length;o++)o&gt;0&amp;&amp;(this.formatted+=&quot; &quot;),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&amp;&amp;cie)|(this.options.loose&amp;&amp;uie))+&quot;:&quot;+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be(&quot;hyphen replace&quot;,e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be(&quot;comparator trim&quot;,e),e=e.replace(Rt[Tt.TILDETRIM],aie),be(&quot;tilde trim&quot;,e),e=e.replace(Rt[Tt.CARETTRIM],lie),be(&quot;caret trim&quot;,e);let n=e.split(&quot; &quot;).map(f=&gt;pie(f,this.options)).join(&quot; &quot;).split(/\s+/).map(f=&gt;gie(f,this.options));a&amp;&amp;(n=n.filter(f=&gt;(be(&quot;loose invalid filter&quot;,f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be(&quot;range list&quot;,n);let l=new Map,c=n.map(f=&gt;new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size&gt;1&amp;&amp;l.has(&quot;&quot;)&amp;&amp;l.delete(&quot;&quot;);let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Range is required&quot;);return this.set.some(o=&gt;RB(o,t)&amp;&amp;e.set.some(s=&gt;RB(s,t)&amp;&amp;o.every(a=&gt;s.every(i=&gt;a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==&quot;string&quot;)try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t&lt;this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=&gt;r.value===&quot;&lt;0.0.0-0&quot;,fie=r=&gt;r.value===&quot;&quot;,RB=(r,e)=&gt;{let t=!0,o=r.slice(),s=o.pop();for(;t&amp;&amp;o.length;)t=o.every(a=&gt;s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=&gt;(be(&quot;comp&quot;,r,e),r=_ie(r,e),be(&quot;caret&quot;,r),r=die(r,e),be(&quot;tildes&quot;,r),r=mie(r,e),be(&quot;xrange&quot;,r),r=Sie(r,e),be(&quot;stars&quot;,r),r),St=r=&gt;!r||r.toLowerCase()===&quot;x&quot;||r===&quot;*&quot;,die=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;hie(t,e)).join(&quot; &quot;),hie=(r,e)=&gt;{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=&gt;{be(&quot;tilde&quot;,r,o,s,a,i,n);let l;return St(s)?l=&quot;&quot;:St(a)?l=`&gt;=${s}.0.0 &lt;${+s+1}.0.0-0`:St(i)?l=`&gt;=${s}.${a}.0 &lt;${s}.${+a+1}.0-0`:n?(be(&quot;replaceTilde pr&quot;,n),l=`&gt;=${s}.${a}.${i}-${n} &lt;${s}.${+a+1}.0-0`):l=`&gt;=${s}.${a}.${i} &lt;${s}.${+a+1}.0-0`,be(&quot;tilde return&quot;,l),l})},_ie=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;Eie(t,e)).join(&quot; &quot;),Eie=(r,e)=&gt;{be(&quot;caret&quot;,r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?&quot;-0&quot;:&quot;&quot;;return r.replace(t,(s,a,i,n,l)=&gt;{be(&quot;caret&quot;,r,s,a,i,n,l);let c;return St(a)?c=&quot;&quot;:St(i)?c=`&gt;=${a}.0.0${o} &lt;${+a+1}.0.0-0`:St(n)?a===&quot;0&quot;?c=`&gt;=${a}.${i}.0${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.0${o} &lt;${+a+1}.0.0-0`:l?(be(&quot;replaceCaret pr&quot;,l),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${+a+1}.0.0-0`):(be(&quot;no pr&quot;),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n} &lt;${+a+1}.0.0-0`),be(&quot;caret return&quot;,c),c})},mie=(r,e)=&gt;(be(&quot;replaceXRanges&quot;,r,e),r.split(/\s+/).map(t=&gt;Tie(t,e)).join(&quot; &quot;)),Tie=(r,e)=&gt;{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=&gt;{be(&quot;xRange&quot;,r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s===&quot;=&quot;&amp;&amp;_&amp;&amp;(s=&quot;&quot;),l=e.includePrerelease?&quot;-0&quot;:&quot;&quot;,c?s===&quot;&gt;&quot;||s===&quot;&lt;&quot;?o=&quot;&lt;0.0.0-0&quot;:o=&quot;*&quot;:s&amp;&amp;_?(u&amp;&amp;(i=0),n=0,s===&quot;&gt;&quot;?(s=&quot;&gt;=&quot;,u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s===&quot;&lt;=&quot;&amp;&amp;(s=&quot;&lt;&quot;,u?a=+a+1:i=+i+1),s===&quot;&lt;&quot;&amp;&amp;(l=&quot;-0&quot;),o=`${s+a}.${i}.${n}${l}`):u?o=`&gt;=${a}.0.0${l} &lt;${+a+1}.0.0-0`:f&amp;&amp;(o=`&gt;=${a}.${i}.0${l} &lt;${a}.${+i+1}.0-0`),be(&quot;xRange return&quot;,o),o})},Sie=(r,e)=&gt;(be(&quot;replaceStars&quot;,r,e),r.trim().replace(Rt[Tt.STAR],&quot;&quot;)),gie=(r,e)=&gt;(be(&quot;replaceGTE0&quot;,r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],&quot;&quot;)),vie=r=&gt;(e,t,o,s,a,i,n,l,c,u,f,_)=&gt;(St(o)?t=&quot;&quot;:St(s)?t=`&gt;=${o}.0.0${r?&quot;-0&quot;:&quot;&quot;}`:St(a)?t=`&gt;=${o}.${s}.0${r?&quot;-0&quot;:&quot;&quot;}`:i?t=`&gt;=${t}`:t=`&gt;=${t}${r?&quot;-0&quot;:&quot;&quot;}`,St(c)?l=&quot;&quot;:St(u)?l=`&lt;${+c+1}.0.0-0`:St(f)?l=`&lt;${c}.${+u+1}.0-0`:_?l=`&lt;=${c}.${u}.${f}-${_}`:r?l=`&lt;${c}.${u}.${+f+1}-0`:l=`&lt;=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=&gt;{for(let o=0;o&lt;r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&amp;&amp;!t.includePrerelease){for(let o=0;o&lt;r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&amp;&amp;r[o].semver.prerelease.length&gt;0){let s=r[o].semver;if(s.major===e.major&amp;&amp;s.minor===e.minor&amp;&amp;s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=&gt;{&quot;use strict&quot;;var $l=Symbol(&quot;SemVer ANY&quot;),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(&quot; &quot;),kS(&quot;comparator&quot;,e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value=&quot;&quot;:this.value=this.operator+this.semver.version,kS(&quot;comp&quot;,this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:&quot;&quot;,this.operator===&quot;=&quot;&amp;&amp;(this.operator=&quot;&quot;),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS(&quot;Comparator.test&quot;,e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e==&quot;string&quot;)try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Comparator is required&quot;);return this.operator===&quot;&quot;?this.value===&quot;&quot;?!0:new LB(e.value,t).test(this.value):e.operator===&quot;&quot;?e.value===&quot;&quot;?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&amp;&amp;(this.value===&quot;&lt;0.0.0-0&quot;||e.value===&quot;&lt;0.0.0-0&quot;)||!t.includePrerelease&amp;&amp;(this.value.startsWith(&quot;&lt;0.0.0&quot;)||e.value.startsWith(&quot;&lt;0.0.0&quot;))?!1:!!(this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)||this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||this.semver.version===e.semver.version&amp;&amp;this.operator.includes(&quot;=&quot;)&amp;&amp;e.operator.includes(&quot;=&quot;)||US(this.semver,&quot;&lt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||US(this.semver,&quot;&gt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=&gt;{&quot;use strict&quot;;var Oie=Qt(),Aie=(r,e,t)=&gt;{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=&gt;{&quot;use strict&quot;;var Rie=Qt(),Nie=(r,e)=&gt;new Rie(r,e).set.map(t=&gt;t.map(o=&gt;o.value).join(&quot; &quot;).trim().split(&quot; &quot;));wB.exports=Nie});var kB=T((F1e,UB)=&gt;{&quot;use strict&quot;;var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===-1)&amp;&amp;(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=&gt;{&quot;use strict&quot;;var bie=pt(),Lie=Qt(),xie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===1)&amp;&amp;(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=&gt;{&quot;use strict&quot;;var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=&gt;{r=new Mie(r,e);let t=new VS(&quot;0.0.0&quot;);if(r.test(t)||(t=new VS(&quot;0.0.0-0&quot;),r.test(t)))return t;t=null;for(let o=0;o&lt;r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=&gt;{let n=new VS(i.semver.version);switch(i.operator){case&quot;&gt;&quot;:n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case&quot;&quot;:case&quot;&gt;=&quot;:(!a||FB(n,a))&amp;&amp;(a=n);break;case&quot;&lt;&quot;:case&quot;&lt;=&quot;:break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&amp;&amp;(!t||FB(t,a))&amp;&amp;(t=a)}return t&amp;&amp;r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=&gt;{&quot;use strict&quot;;var Die=Qt(),Uie=(r,e)=&gt;{try{return new Die(r,e).range||&quot;*&quot;}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=&gt;{&quot;use strict&quot;;var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=&gt;{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case&quot;&gt;&quot;:s=YB,a=Gie,i=zB,n=&quot;&gt;&quot;,l=&quot;&gt;=&quot;;break;case&quot;&lt;&quot;:s=zB,a=Hie,i=YB,n=&quot;&lt;&quot;,l=&quot;&lt;=&quot;;break;default:throw new TypeError(&#x27;Must provide a hilo val of &quot;&lt;&quot; or &quot;&gt;&quot;&#x27;)}if(Fie(r,e,o))return!1;for(let c=0;c&lt;e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=&gt;{m.semver===Bie&amp;&amp;(m=new KB(&quot;&gt;=0.0.0&quot;)),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&amp;&amp;(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&amp;&amp;a(r,_.semver))return!1;if(_.operator===l&amp;&amp;i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=&gt;{&quot;use strict&quot;;var jie=xd(),Yie=(r,e,t)=&gt;jie(r,e,&quot;&gt;&quot;,t);XB.exports=Yie});var QB=T((z1e,JB)=&gt;{&quot;use strict&quot;;var zie=xd(),Kie=(r,e,t)=&gt;zie(r,e,&quot;&lt;&quot;,t);JB.exports=Kie});var tV=T((K1e,eV)=&gt;{&quot;use strict&quot;;var ZB=Qt(),$ie=(r,e,t)=&gt;(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=&gt;{&quot;use strict&quot;;var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=&gt;{let o=[],s=null,a=null,i=r.sort((u,f)=&gt;Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&amp;&amp;o.push([s,a]),a=null,s=null);s&amp;&amp;o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&amp;&amp;u===i[0]?n.push(&quot;*&quot;):f?u===i[0]?n.push(`&lt;=${f}`):n.push(`${u} - ${f}`):n.push(`&gt;=${u}`);let l=n.join(&quot; || &quot;),c=typeof e.raw==&quot;string&quot;?e.raw:String(e);return l.length&lt;c.length?l:e}});var cV=T((X1e,lV)=&gt;{&quot;use strict&quot;;var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=&gt;{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(&quot;&gt;=0.0.0-0&quot;)],oV=[new GS(&quot;&gt;=0.0.0&quot;)],Zie=(r,e,t)=&gt;{if(r===e)return!0;if(r.length===1&amp;&amp;r[0].semver===FS){if(e.length===1&amp;&amp;e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&amp;&amp;e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;?s=sV(s,m,t):m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;?a=aV(a,m,t):o.add(m.semver);if(o.size&gt;1)return null;let i;if(s&amp;&amp;a){if(i=HS(s.semver,a.semver,t),i&gt;0)return null;if(i===0&amp;&amp;(s.operator!==&quot;&gt;=&quot;||a.operator!==&quot;&lt;=&quot;))return null}for(let m of o){if(s&amp;&amp;!Wl(m,String(s),t)||a&amp;&amp;!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&amp;&amp;!t.includePrerelease&amp;&amp;a.semver.prerelease.length?a.semver:!1,_=s&amp;&amp;!t.includePrerelease&amp;&amp;s.semver.prerelease.length?s.semver:!1;f&amp;&amp;f.prerelease.length===1&amp;&amp;a.operator===&quot;&lt;&quot;&amp;&amp;f.prerelease[0]===0&amp;&amp;(f=!1);for(let m of e){if(u=u||m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;,c=c||m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;,s){if(_&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===_.major&amp;&amp;m.semver.minor===_.minor&amp;&amp;m.semver.patch===_.patch&amp;&amp;(_=!1),m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;){if(n=sV(s,m,t),n===m&amp;&amp;n!==s)return!1}else if(s.operator===&quot;&gt;=&quot;&amp;&amp;!Wl(s.semver,String(m),t))return!1}if(a){if(f&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===f.major&amp;&amp;m.semver.minor===f.minor&amp;&amp;m.semver.patch===f.patch&amp;&amp;(f=!1),m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;){if(l=aV(a,m,t),l===m&amp;&amp;l!==a)return!1}else if(a.operator===&quot;&lt;=&quot;&amp;&amp;!Wl(a.semver,String(m),t))return!1}if(!m.operator&amp;&amp;(a||s)&amp;&amp;i!==0)return!1}return!(s&amp;&amp;c&amp;&amp;!a&amp;&amp;i!==0||a&amp;&amp;u&amp;&amp;!s&amp;&amp;i!==0||_||f)},sV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&gt;0?r:o&lt;0||e.operator===&quot;&gt;&quot;&amp;&amp;r.operator===&quot;&gt;=&quot;?e:r},aV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&lt;0?r:o&gt;0||e.operator===&quot;&lt;&quot;&amp;&amp;r.operator===&quot;&lt;=&quot;?e:r};lV.exports=Jie});var jS=T((W1e,pV)=&gt;{&quot;use strict&quot;;var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(&quot;:&quot;);if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,&quot;0&quot;),n=s.padStart(16,&quot;0&quot;),l=Boe.test(a)?parseInt(a,16)&amp;1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=&gt;{P();xr();dV=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},hV=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},YS=&quot;uber-trace-id&quot;,Md=&quot;uberctx&quot;,_V=(function(){function r(e){typeof e==&quot;string&quot;?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&amp;&amp;At(e)===!1){var l=&quot;0&quot;+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+&quot;:&quot;+i.spanId+&quot;:0:&quot;+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+&quot;-&quot;+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&amp;&amp;!u.done&amp;&amp;(a=c.return)&amp;&amp;a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+&quot;-&quot;)}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c==&quot;string&quot;){var _=Voe(c);_&amp;&amp;(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&amp;&amp;n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&amp;&amp;(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&amp;&amp;!y.done&amp;&amp;(a=O.return)&amp;&amp;a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=&gt;_V,UBER_BAGGAGE_HEADER_PREFIX:()=&gt;Md,UBER_TRACE_ID_HEADER:()=&gt;YS});var TV=p(()=&gt;{EV()});var vV=T(Ud=&gt;{&quot;use strict&quot;;Object.defineProperty(Ud,&quot;__esModule&quot;,{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,&quot;14.8.0&quot;)?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,[&quot;b3&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],[&quot;b3multi&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],[&quot;jaeger&quot;,()=&gt;new Goe.JaegerPropagator]])});var zS=T(fe=&gt;{&quot;use strict&quot;;Object.defineProperty(fe,&quot;__esModule&quot;,{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,&quot;NodeTracerProvider&quot;,{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,&quot;AlwaysOffSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,&quot;AlwaysOnSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,&quot;BasicTracerProvider&quot;,{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,&quot;BatchSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,&quot;ConsoleSpanExporter&quot;,{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,&quot;ForceFlushState&quot;,{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,&quot;InMemorySpanExporter&quot;,{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,&quot;NoopSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,&quot;ParentBasedSampler&quot;,{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,&quot;RandomIdGenerator&quot;,{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,&quot;SamplingDecision&quot;,{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,&quot;SimpleSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,&quot;Span&quot;,{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,&quot;TraceIdRatioBasedSampler&quot;,{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,&quot;Tracer&quot;,{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=&gt;{});var OV=p(()=&gt;{yV()});var KS=p(()=&gt;{OV()});var Ce,dn=p(()=&gt;{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=&gt;{AV=r=&gt;{switch(r){case&quot;arm&quot;:return&quot;arm32&quot;;case&quot;ppc&quot;:return&quot;ppc32&quot;;case&quot;x64&quot;:return&quot;amd64&quot;;default:return r}},RV=r=&gt;{switch(r){case&quot;sunos&quot;:return&quot;solaris&quot;;case&quot;win32&quot;:return&quot;windows&quot;;default:return r}}});import*as NV from&quot;child_process&quot;;import*as CV from&quot;util&quot;;var Us,kd=p(()=&gt;{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=&gt;qoe});async function qoe(){try{let e=(await Us(&#x27;ioreg -rd1 -c &quot;IOPlatformExpertDevice&quot;&#x27;)).stdout.split(` `).find(o=&gt;o.includes(&quot;IOPlatformUUID&quot;));if(!e)return&quot;&quot;;let t=e.split(&#x27;&quot; = &quot;&#x27;);if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var IV=p(()=&gt;{kd();P()});var bV={};Ae(bV,{getMachineId:()=&gt;Yoe});import{promises as joe}from&quot;fs&quot;;async function Yoe(){let r=[&quot;/etc/machine-id&quot;,&quot;/var/lib/dbus/machine-id&quot;];for(let e of r)try{return(await joe.readFile(e,{encoding:&quot;utf8&quot;})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var LV=p(()=&gt;{P()});var xV={};Ae(xV,{getMachineId:()=&gt;Koe});import{promises as zoe}from&quot;fs&quot;;async function Koe(){try{return(await zoe.readFile(&quot;/etc/hostid&quot;,{encoding:&quot;utf8&quot;})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us(&quot;kenv -q smbios.system.uuid&quot;)).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var MV=p(()=&gt;{kd();P()});var wV={};Ae(wV,{getMachineId:()=&gt;$oe});import*as Bd from&quot;process&quot;;async function $oe(){let r=&quot;QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid&quot;,e=&quot;%windir%\\System32\\REG.exe&quot;;Bd.arch===&quot;ia32&quot;&amp;&amp;&quot;PROCESSOR_ARCHITEW6432&quot;in Bd.env&amp;&amp;(e=&quot;%windir%\\sysnative\\cmd.exe /c &quot;+e);try{let o=(await Us(`${e} ${r}`)).stdout.split(&quot;REG_SZ&quot;);if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var DV=p(()=&gt;{kd();P()});var UV={};Ae(UV,{getMachineId:()=&gt;Xoe});async function Xoe(){return S.debug(&quot;could not read machine-id: unsupported platform&quot;),&quot;&quot;}var kV=p(()=&gt;{P()});import*as BV from&quot;process&quot;;var qi,VV=p(()=&gt;{switch(BV.platform){case&quot;darwin&quot;:({getMachineId:qi}=(IV(),ee(PV)));break;case&quot;linux&quot;:({getMachineId:qi}=(LV(),ee(bV)));break;case&quot;freebsd&quot;:({getMachineId:qi}=(MV(),ee(xV)));break;case&quot;win32&quot;:({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from&quot;os&quot;;var XS,ji,WS=p(()=&gt;{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=&gt;{let t={};return e&amp;&amp;(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=&gt;{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from&quot;os&quot;;var QS,Yi,ZS=p(()=&gt;{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=&gt;{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from&quot;os&quot;;var tg,zi,rg=p(()=&gt;{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:&quot;nodejs&quot;,[Ja]:&quot;Node.js&quot;};process.argv.length&gt;1&amp;&amp;(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=&gt;{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from&quot;crypto&quot;;var ig,ec,jV=p(()=&gt;{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=&gt;{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=&gt;{YV()});var og,tc,sg=p(()=&gt;{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator&lt;&quot;u&quot;&amp;&amp;((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&amp;&amp;((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:&quot;browser&quot;,[Ja]:&quot;Web Browser&quot;,[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===&quot;&quot;?(S.debug(&quot;BrowserDetector failed: Unable to find required browser resources. &quot;),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=&gt;{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=&gt;{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=&quot;,&quot;,this._LABEL_KEY_VALUE_SPLITTER=&quot;=&quot;,this._ERROR_MESSAGE_INVALID_CHARS=&quot;should be a ASCII string with a length greater than 0 and not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;,this._ERROR_MESSAGE_INVALID_VALUE=&quot;should be a ASCII string with a length not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&amp;&amp;(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^&quot;|&quot;$/).join(&quot;&quot;),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length&lt;=this._MAX_LENGTH&amp;&amp;this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t&lt;e.length;t++){let o=e.charCodeAt(t);if(o&lt;33||o===44||o===59||o===92||o&gt;126)return!1}return!0}_isValidAndNotEmpty(e){return e.length&gt;0&amp;&amp;this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=&gt;{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=&gt;{zV();KV();$V();sg();ug()});var WV,JV=p(()=&gt;{WV=r=&gt;r!==null&amp;&amp;typeof r==&quot;object&quot;&amp;&amp;typeof r.then==&quot;function&quot;});var QV,ZV,e2,t2=p(()=&gt;{dn();P();JV();QV=async(r={})=&gt;{let e=await Promise.all((r.detectors||[]).map(async t=&gt;{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=&gt;t.merge(o),Ce.empty())},ZV=(r={})=&gt;{var e;let t=((e=r.detectors)!==null&amp;&amp;e!==void 0?e:[]).map(s=&gt;{try{let a=s.detect(r),i;if(WV(a)){let n=async()=&gt;{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=&gt;S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=&gt;s.merge(a),Ce.empty());return o.waitForAsyncAttributes&amp;&amp;o.waitForAsyncAttributes().then(()=&gt;{e2(t)}),o},e2=r=&gt;{r.forEach(e=&gt;{if(Object.keys(e.attributes).length&gt;0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=&gt;Ce,browserDetector:()=&gt;lg,browserDetectorSync:()=&gt;tc,defaultServiceName:()=&gt;Ds,detectResources:()=&gt;QV,detectResourcesSync:()=&gt;ZV,envDetector:()=&gt;pg,envDetectorSync:()=&gt;rc,hostDetector:()=&gt;Jl,hostDetectorSync:()=&gt;ji,osDetector:()=&gt;Ql,osDetectorSync:()=&gt;Yi,processDetector:()=&gt;Zl,processDetectorSync:()=&gt;zi,serviceInstanceIdDetectorSync:()=&gt;ec});var Fd=p(()=&gt;{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s&lt;a;s++){let i=r[s];e&amp;&amp;i.setTracerProvider(e),t&amp;&amp;i.setMeterProvider(t),o&amp;&amp;i.setLoggerProvider&amp;&amp;i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=&gt;e.disable())}var i2=p(()=&gt;{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&amp;&amp;t!==void 0?t:[];return r2(i,o,s,a),()=&gt;{n2(i)}}var s2=p(()=&gt;{P();El();i2()});var hg=T((FUe,c2)=&gt;{&quot;use strict&quot;;function dg(r){return typeof r==&quot;function&quot;}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&amp;&amp;r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&amp;&amp;r.logger&amp;&amp;(dg(r.logger)?vt=r.logger:vt(&quot;new logger isn&#x27;t a function, not replacing&quot;))}function a2(r,e,t){if(!r||!r[e]){vt(&quot;no original function &quot;+e+&quot; to wrap&quot;);return}if(!t){vt(&quot;no wrapper function&quot;),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt(&quot;original object and wrapper must be functions&quot;);return}var o=r[e],s=t(o,e);return nc(s,&quot;__original&quot;,o),nc(s,&quot;__unwrap&quot;,function(){r[e]===s&amp;&amp;nc(r,e,o)}),nc(s,&quot;__wrapped&quot;,!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to wrap on modules&quot;);return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt(&quot;no function to unwrap.&quot;),vt(new Error().stack);return}if(!r[e].__unwrap)vt(&quot;no original to unwrap to -- has &quot;+e+&quot; already been unwrapped?&quot;);else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to unwrap on modules&quot;);return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=&gt;{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&amp;&amp;e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error(&quot;Error running span customization hook due to exception in handler&quot;,{triggerName:t},a)}}}});var p2=T((jUe,f2)=&gt;{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t===&quot;string&quot;&amp;&amp;r.length&gt;0)return ose(r);if(t===&quot;number&quot;&amp;&amp;isFinite(r))return e.long?ase(r):sse(r);throw new Error(&quot;val is not a non-empty string or a valid number. val=&quot;+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length&gt;100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||&quot;ms&quot;).toLowerCase();switch(o){case&quot;years&quot;:case&quot;year&quot;:case&quot;yrs&quot;:case&quot;yr&quot;:case&quot;y&quot;:return t*ise;case&quot;weeks&quot;:case&quot;week&quot;:case&quot;w&quot;:return t*nse;case&quot;days&quot;:case&quot;day&quot;:case&quot;d&quot;:return t*Ki;case&quot;hours&quot;:case&quot;hour&quot;:case&quot;hrs&quot;:case&quot;hr&quot;:case&quot;h&quot;:return t*Vs;case&quot;minutes&quot;:case&quot;minute&quot;:case&quot;mins&quot;:case&quot;min&quot;:case&quot;m&quot;:return t*Bs;case&quot;seconds&quot;:case&quot;second&quot;:case&quot;secs&quot;:case&quot;sec&quot;:case&quot;s&quot;:return t*ks;case&quot;milliseconds&quot;:case&quot;millisecond&quot;:case&quot;msecs&quot;:case&quot;msec&quot;:case&quot;ms&quot;:return t;default:return}}}}function sse(r){var e=Math.abs(r);return e&gt;=Ki?Math.round(r/Ki)+&quot;d&quot;:e&gt;=Vs?Math.round(r/Vs)+&quot;h&quot;:e&gt;=Bs?Math.round(r/Bs)+&quot;m&quot;:e&gt;=ks?Math.round(r/ks)+&quot;s&quot;:r+&quot;ms&quot;}function ase(r){var e=Math.abs(r);return e&gt;=Ki?Hd(r,e,Ki,&quot;day&quot;):e&gt;=Vs?Hd(r,e,Vs,&quot;hour&quot;):e&gt;=Bs?Hd(r,e,Bs,&quot;minute&quot;):e&gt;=ks?Hd(r,e,ks,&quot;second&quot;):r+&quot; ms&quot;}function Hd(r,e,t,o){var s=e&gt;=t*1.5;return Math.round(r/t)+&quot; &quot;+o+(s?&quot;s&quot;:&quot;&quot;)}});var _g=T((YUe,d2)=&gt;{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=&gt;{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_&lt;u.length;_++)f=(f&lt;&lt;5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!=&quot;string&quot;&amp;&amp;A.unshift(&quot;%O&quot;);let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=&gt;{if(B===&quot;%%&quot;)return&quot;%&quot;;N++;let te=t.formatters[G];if(typeof te==&quot;function&quot;){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,&quot;enabled&quot;,{enumerable:!0,configurable:!1,get:()=&gt;_!==null?_:(m!==t.namespaces&amp;&amp;(m=t.namespaces,O=t.enabled(u)),O),set:A=&gt;{_=A}}),typeof t.init==&quot;function&quot;&amp;&amp;t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f&gt;&quot;u&quot;?&quot;:&quot;:f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u==&quot;string&quot;?u:&quot;&quot;).trim().replace(/\s+/g,&quot;,&quot;).split(&quot;,&quot;).filter(Boolean);for(let _ of f)_[0]===&quot;-&quot;?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_&lt;u.length;)if(m&lt;f.length&amp;&amp;(f[m]===u[_]||f[m]===&quot;*&quot;))f[m]===&quot;*&quot;?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m&lt;f.length&amp;&amp;f[m]===&quot;*&quot;;)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=&gt;&quot;-&quot;+f)].join(&quot;,&quot;);return t.enable(&quot;&quot;),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;)}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=&gt;{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=&gt;{let r=!1;return()=&gt;{r||(r=!0,console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;))}})();Nt.colors=[&quot;#0000CC&quot;,&quot;#0000FF&quot;,&quot;#0033CC&quot;,&quot;#0033FF&quot;,&quot;#0066CC&quot;,&quot;#0066FF&quot;,&quot;#0099CC&quot;,&quot;#0099FF&quot;,&quot;#00CC00&quot;,&quot;#00CC33&quot;,&quot;#00CC66&quot;,&quot;#00CC99&quot;,&quot;#00CCCC&quot;,&quot;#00CCFF&quot;,&quot;#3300CC&quot;,&quot;#3300FF&quot;,&quot;#3333CC&quot;,&quot;#3333FF&quot;,&quot;#3366CC&quot;,&quot;#3366FF&quot;,&quot;#3399CC&quot;,&quot;#3399FF&quot;,&quot;#33CC00&quot;,&quot;#33CC33&quot;,&quot;#33CC66&quot;,&quot;#33CC99&quot;,&quot;#33CCCC&quot;,&quot;#33CCFF&quot;,&quot;#6600CC&quot;,&quot;#6600FF&quot;,&quot;#6633CC&quot;,&quot;#6633FF&quot;,&quot;#66CC00&quot;,&quot;#66CC33&quot;,&quot;#9900CC&quot;,&quot;#9900FF&quot;,&quot;#9933CC&quot;,&quot;#9933FF&quot;,&quot;#99CC00&quot;,&quot;#99CC33&quot;,&quot;#CC0000&quot;,&quot;#CC0033&quot;,&quot;#CC0066&quot;,&quot;#CC0099&quot;,&quot;#CC00CC&quot;,&quot;#CC00FF&quot;,&quot;#CC3300&quot;,&quot;#CC3333&quot;,&quot;#CC3366&quot;,&quot;#CC3399&quot;,&quot;#CC33CC&quot;,&quot;#CC33FF&quot;,&quot;#CC6600&quot;,&quot;#CC6633&quot;,&quot;#CC9900&quot;,&quot;#CC9933&quot;,&quot;#CCCC00&quot;,&quot;#CCCC33&quot;,&quot;#FF0000&quot;,&quot;#FF0033&quot;,&quot;#FF0066&quot;,&quot;#FF0099&quot;,&quot;#FF00CC&quot;,&quot;#FF00FF&quot;,&quot;#FF3300&quot;,&quot;#FF3333&quot;,&quot;#FF3366&quot;,&quot;#FF3399&quot;,&quot;#FF33CC&quot;,&quot;#FF33FF&quot;,&quot;#FF6600&quot;,&quot;#FF6633&quot;,&quot;#FF9900&quot;,&quot;#FF9933&quot;,&quot;#FFCC00&quot;,&quot;#FFCC33&quot;];function cse(){if(typeof window&lt;&quot;u&quot;&amp;&amp;window.process&amp;&amp;(window.process.type===&quot;renderer&quot;||window.process.__nwjs))return!0;if(typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document&lt;&quot;u&quot;&amp;&amp;document.documentElement&amp;&amp;document.documentElement.style&amp;&amp;document.documentElement.style.WebkitAppearance||typeof window&lt;&quot;u&quot;&amp;&amp;window.console&amp;&amp;(window.console.firebug||window.console.exception&amp;&amp;window.console.table)||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&amp;&amp;parseInt(r[1],10)&gt;=31||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?&quot;%c&quot;:&quot;&quot;)+this.namespace+(this.useColors?&quot; %c&quot;:&quot; &quot;)+r[0]+(this.useColors?&quot;%c &quot;:&quot; &quot;)+&quot;+&quot;+qd.exports.humanize(this.diff),!this.useColors)return;let e=&quot;color: &quot;+this.color;r.splice(1,0,e,&quot;color: inherit&quot;);let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=&gt;{s!==&quot;%%&quot;&amp;&amp;(t++,s===&quot;%c&quot;&amp;&amp;(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=&gt;{});function fse(r){try{r?Nt.storage.setItem(&quot;debug&quot;,r):Nt.storage.removeItem(&quot;debug&quot;)}catch{}}function pse(){let r;try{r=Nt.storage.getItem(&quot;debug&quot;)||Nt.storage.getItem(&quot;DEBUG&quot;)}catch{}return!r&amp;&amp;typeof process&lt;&quot;u&quot;&amp;&amp;&quot;env&quot;in process&amp;&amp;(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return&quot;[UnexpectedJSONParseError]: &quot;+e.message}}});var E2=T((zUe,_2)=&gt;{&quot;use strict&quot;;_2.exports=(r,e=process.argv)=&gt;{let t=r.startsWith(&quot;-&quot;)?&quot;&quot;:r.length===1?&quot;-&quot;:&quot;--&quot;,o=e.indexOf(t+r),s=e.indexOf(&quot;--&quot;);return o!==-1&amp;&amp;(s===-1||o&lt;s)}});var S2=T((KUe,T2)=&gt;{&quot;use strict&quot;;var _se=V(&quot;os&quot;),m2=V(&quot;tty&quot;),Zt=E2(),{env:Ze}=process,zn;Zt(&quot;no-color&quot;)||Zt(&quot;no-colors&quot;)||Zt(&quot;color=false&quot;)||Zt(&quot;color=never&quot;)?zn=0:(Zt(&quot;color&quot;)||Zt(&quot;colors&quot;)||Zt(&quot;color=true&quot;)||Zt(&quot;color=always&quot;))&amp;&amp;(zn=1);&quot;FORCE_COLOR&quot;in Ze&amp;&amp;(Ze.FORCE_COLOR===&quot;true&quot;?zn=1:Ze.FORCE_COLOR===&quot;false&quot;?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r&gt;=2,has16m:r&gt;=3}}function mg(r,e){if(zn===0)return 0;if(Zt(&quot;color=16m&quot;)||Zt(&quot;color=full&quot;)||Zt(&quot;color=truecolor&quot;))return 3;if(Zt(&quot;color=256&quot;))return 2;if(r&amp;&amp;!e&amp;&amp;zn===void 0)return 0;let t=zn||0;if(Ze.TERM===&quot;dumb&quot;)return t;if(process.platform===&quot;win32&quot;){let o=_se.release().split(&quot;.&quot;);return Number(o[0])&gt;=10&amp;&amp;Number(o[2])&gt;=10586?Number(o[2])&gt;=14931?3:2:1}if(&quot;CI&quot;in Ze)return[&quot;TRAVIS&quot;,&quot;CIRCLECI&quot;,&quot;APPVEYOR&quot;,&quot;GITLAB_CI&quot;,&quot;GITHUB_ACTIONS&quot;,&quot;BUILDKITE&quot;].some(o=&gt;o in Ze)||Ze.CI_NAME===&quot;codeship&quot;?1:t;if(&quot;TEAMCITY_VERSION&quot;in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM===&quot;truecolor&quot;)return 3;if(&quot;TERM_PROGRAM&quot;in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||&quot;&quot;).split(&quot;.&quot;)[0],10);switch(Ze.TERM_PROGRAM){case&quot;iTerm.app&quot;:return o&gt;=3?3:2;case&quot;Apple_Terminal&quot;:return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||&quot;COLORTERM&quot;in Ze?1:t}function Ese(r){let e=mg(r,r&amp;&amp;r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=&gt;{var mse=V(&quot;tty&quot;),jd=V(&quot;util&quot;);et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=&gt;{},&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;);et.colors=[6,2,3,4,5,1];try{let r=S2();r&amp;&amp;(r.stderr||r).level&gt;=2&amp;&amp;(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=&gt;/^debug_/i.test(r)).reduce((r,e)=&gt;{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=&gt;a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o===&quot;null&quot;?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return&quot;colors&quot;in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s=&quot;\x1B[3&quot;+(o&lt;8?o:&quot;8;5;&quot;+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+&quot;m+&quot;+Yd.exports.humanize(this.diff)+&quot;\x1B[0m&quot;)}else r[0]=gse()+e+&quot; &quot;+r[0]}function gse(){return et.inspectOpts.hideDate?&quot;&quot;:new Date().toISOString()+&quot; &quot;}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t&lt;e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=&gt;e.trim()).join(&quot; &quot;)};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=&gt;{typeof process&gt;&quot;u&quot;||process.type===&quot;renderer&quot;||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=&gt;{&quot;use strict&quot;;var Sg=V(&quot;path&quot;).sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf(&quot;node_modules&quot;);if(t!==-1&amp;&amp;e[t+1]){for(var o=e[t+1][0]===&quot;@&quot;,s=o?e[t+1]+&quot;/&quot;+e[t+2]:e[t+1],a=o?3:2,i=&quot;&quot;,n=t+a-1,l=0;l&lt;=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c=&quot;&quot;,u=e.length-1,f=t+a;f&lt;=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=&gt;{&quot;use strict&quot;;var Rse=V(&quot;os&quot;);A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform===&quot;win32&quot;?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform===&quot;darwin&quot;?e||(t?&quot;/Users/&quot;+t:null):process.platform===&quot;linux&quot;?e||(process.getuid()===0?&quot;/root&quot;:t?&quot;/home/&quot;+t:null):e||null}});var yg=T((JUe,R2)=&gt;{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=&gt;{&quot;use strict&quot;;var Nse=process.platform===&quot;win32&quot;,Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=&gt;{var I2=V(&quot;path&quot;),C2=I2.parse||N2(),P2=function(e,t){var o=&quot;/&quot;;/^([A-Za-z]:)/.test(e)?o=&quot;&quot;:/^\\\\/.test(e)&amp;&amp;(o=&quot;\\\\&quot;);for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&amp;&amp;t.moduleDirectory?[].concat(t.moduleDirectory):[&quot;node_modules&quot;];if(t&amp;&amp;typeof t.paths==&quot;function&quot;)return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&amp;&amp;t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=&gt;{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=&gt;{&quot;use strict&quot;;var Lse=&quot;Function.prototype.bind called on incompatible &quot;,xse=Object.prototype.toString,Mse=Math.max,wse=&quot;[object Function]&quot;,x2=function(e,t){for(var o=[],s=0;s&lt;e.length;s+=1)o[s]=e[s];for(var a=0;a&lt;t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s&lt;e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t=&quot;&quot;,o=0;o&lt;r.length;o+=1)t+=r[o],o+1&lt;r.length&amp;&amp;(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!=&quot;function&quot;||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l&lt;i;l++)n[l]=&quot;$&quot;+l;if(s=Function(&quot;binder&quot;,&quot;return function (&quot;+Use(n,&quot;,&quot;)+&quot;){ return binder.apply(this,arguments); }&quot;)(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=&gt;{&quot;use strict&quot;;var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=&gt;{&quot;use strict&quot;;var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=&gt;{Gse.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:[&quot;&gt;= 22.13 &amp;&amp; &lt; 23&quot;,&quot;&gt;= 23.4&quot;],_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var sc=T((oke,H2)=&gt;{&quot;use strict&quot;;var Hse=B2();function qse(r,e){for(var t=r.split(&quot;.&quot;),o=e.split(&quot; &quot;),s=o.length&gt;1?o[0]:&quot;=&quot;,a=(o.length&gt;1?o[1]:o[0]).split(&quot;.&quot;),i=0;i&lt;3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s===&quot;&lt;&quot;?n&lt;l:s===&quot;&gt;=&quot;?n&gt;=l:!1}return s===&quot;&gt;=&quot;}function F2(r,e){var t=e.split(/ ?&amp;&amp; ?/);if(t.length===0)return!1;for(var o=0;o&lt;t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e==&quot;boolean&quot;)return e;var t=typeof r&gt;&quot;u&quot;?process.versions&amp;&amp;process.versions.node:r;if(typeof t!=&quot;string&quot;)throw new TypeError(typeof r&gt;&quot;u&quot;?&quot;Unable to determine current node version&quot;:&quot;If provided, a valid node version is required&quot;);if(e&amp;&amp;typeof e==&quot;object&quot;){for(var o=0;o&lt;e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&amp;&amp;jse(t,G2[e])}});var Y2=T((ske,j2)=&gt;{var $i=V(&quot;fs&quot;),Yse=vg(),ze=V(&quot;path&quot;),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!==&quot;win32&quot;&amp;&amp;$i.realpath&amp;&amp;typeof $i.realpath.native==&quot;function&quot;?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,&quot;.node_modules&quot;),ze.join(q2,&quot;.node_libraries&quot;)]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&amp;&amp;o.code!==&quot;ENOENT&quot;?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&amp;&amp;o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a&lt;s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t==&quot;function&quot;&amp;&amp;(s=a,a={}),typeof e!=&quot;string&quot;){var i=new TypeError(&quot;Path must be a string.&quot;);return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&amp;&amp;a.readPackage){var _=new TypeError(&quot;`readFile` and `readPackage` are mutually exclusive.&quot;);return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[&quot;.js&quot;],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(F+=&quot;/&quot;),/\/$/.test(e)&amp;&amp;F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&amp;&amp;Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);C.code=&quot;MODULE_NOT_FOUND&quot;,s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);Y.code=&quot;MODULE_NOT_FOUND&quot;,s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E==&quot;function&quot;&amp;&amp;(C=E,E=void 0);var Q=[&quot;&quot;].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&amp;&amp;Te&amp;&amp;a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([&quot;&quot;].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===&quot;&quot;||v===&quot;/&quot;||process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,&quot;package.json&quot;);n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&amp;&amp;W(J);var Ne=ce;Ne&amp;&amp;a.packageFilter&amp;&amp;(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C==&quot;function&quot;&amp;&amp;(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,&quot;package.json&quot;);n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,&quot;index&quot;),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&amp;&amp;a.packageFilter&amp;&amp;(Z=a.packageFilter(Z,J)),Z&amp;&amp;Z.main){if(typeof Z.main!=&quot;string&quot;){var je=new TypeError(&quot;package \u201C&quot;+Z.name+&quot;\u201D `main` must be a string&quot;);return je.code=&quot;INVALID_PACKAGE_MAIN&quot;,E(je)}(Z.main===&quot;.&quot;||Z.main===&quot;./&quot;)&amp;&amp;(Z.main=&quot;index&quot;),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,&quot;index&quot;),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,&quot;index&quot;),Ye,E)})});return}B(ze.join(v,&quot;/index&quot;),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=&gt;{nae.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:&quot;&gt;= 23.4&quot;,_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var W2=T((lke,X2)=&gt;{&quot;use strict&quot;;var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&amp;&amp;($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=&gt;{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=&gt;{var sae=sc(),Xi=V(&quot;fs&quot;),dt=V(&quot;path&quot;),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!==&quot;win32&quot;&amp;&amp;Xi.realpathSync&amp;&amp;typeof Xi.realpathSync.native==&quot;function&quot;?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,&quot;.node_modules&quot;),dt.join(Z2,&quot;.node_libraries&quot;)]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!==&quot;ENOENT&quot;)throw t}return e},lc=function(e,t,o){return o&amp;&amp;o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a&lt;s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Path must be a string.&quot;);var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&amp;&amp;o.readPackageSync)throw new TypeError(&quot;`readFileSync` and `readPackageSync` are mutually exclusive.&quot;);var c=o.packageIterator,u=o.extensions||[&quot;.js&quot;],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(y+=&quot;/&quot;);var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&amp;&amp;sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+m+&quot;&#x27;&quot;);throw M.code=&quot;MODULE_NOT_FOUND&quot;,M;function F(G){var te=N(dt.dirname(G));if(te&amp;&amp;te.dir&amp;&amp;te.pkg&amp;&amp;o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&amp;&amp;(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v&lt;u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===&quot;&quot;||G===&quot;/&quot;)&amp;&amp;!(process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(G))&amp;&amp;!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),&quot;package.json&quot;);if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),&quot;/package.json&quot;);if(s(te)){try{var $=l(a,te)}catch{}if($&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),$&amp;&amp;$.main){if(typeof $.main!=&quot;string&quot;){var le=new TypeError(&quot;package \u201C&quot;+$.name+&quot;\u201D `main` must be a string&quot;);throw le.code=&quot;INVALID_PACKAGE_MAIN&quot;,le}($.main===&quot;.&quot;||$.main===&quot;./&quot;)&amp;&amp;($.main=&quot;index&quot;);try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,&quot;/index&quot;))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v&lt;le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=&gt;{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=&gt;{Tae.exports={name:&quot;require-in-the-middle&quot;,version:&quot;7.5.2&quot;,description:&quot;Module to hook into the Node.js require function&quot;,main:&quot;index.js&quot;,types:&quot;types/index.d.ts&quot;,dependencies:{debug:&quot;^4.3.5&quot;,&quot;module-details-from-path&quot;:&quot;^1.0.3&quot;,resolve:&quot;^1.22.8&quot;},devDependencies:{&quot;@babel/core&quot;:&quot;^7.9.0&quot;,&quot;@babel/preset-env&quot;:&quot;^7.9.5&quot;,&quot;@babel/preset-typescript&quot;:&quot;^7.9.0&quot;,&quot;@babel/register&quot;:&quot;^7.9.0&quot;,&quot;ipp-printer&quot;:&quot;^1.0.0&quot;,patterns:&quot;^1.0.3&quot;,roundround:&quot;^0.2.0&quot;,semver:&quot;^6.3.0&quot;,standard:&quot;^14.3.1&quot;,tape:&quot;^4.11.0&quot;},scripts:{test:&quot;npm run test:lint &amp;&amp; npm run test:tape &amp;&amp; npm run test:babel&quot;,&quot;test:lint&quot;:&quot;standard&quot;,&quot;test:tape&quot;:&quot;tape test/*.js&quot;,&quot;test:babel&quot;:&quot;node test/babel/babel-register.js&quot;},repository:{type:&quot;git&quot;,url:&quot;git+https://github.com/nodejs/require-in-the-middle.git&quot;},keywords:[&quot;require&quot;,&quot;hook&quot;,&quot;shim&quot;,&quot;shimmer&quot;,&quot;shimming&quot;,&quot;patch&quot;,&quot;monkey&quot;,&quot;monkeypatch&quot;,&quot;module&quot;,&quot;load&quot;],files:[&quot;types&quot;],author:&quot;Thomas Watson Steen &lt;w@tson.dk&gt; (https://twitter.com/wa7son)&quot;,license:&quot;MIT&quot;,bugs:{url:&quot;https://github.com/nodejs/require-in-the-middle/issues&quot;},homepage:&quot;https://github.com/nodejs/require-in-the-middle#readme&quot;,engines:{node:&quot;&gt;=8.6.0&quot;}}});var Lg=T((dke,bg)=&gt;{&quot;use strict&quot;;var Gs=V(&quot;path&quot;),_r=V(&quot;module&quot;),Fe=y2()(&quot;require-in-the-middle&quot;),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=&gt;r.startsWith(&quot;node:&quot;)?!0:(Pg===void 0&amp;&amp;(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(&quot;.&quot;).map(Number);e===8&amp;&amp;t&lt;8?Fs=o=&gt;o===&quot;http2&quot;?!0:!!r.core[o]:Fs=o=&gt;!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&amp;&amp;V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol(&quot;RitmExports&quot;)}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&amp;&amp;this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&amp;&amp;s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe(&#x27;non-core module is unexpectedly not in require.cache: &quot;%s&quot;&#x27;,e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null),typeof _r._resolveFilename!=&quot;function&quot;){console.error(&quot;Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!&quot;,typeof _r._resolveFilename),console.error(&quot;Please report this error as an issue related to Node.js %s at %s&quot;,process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe(&quot;registering require hook&quot;),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe(&quot;ignoring require call - module is soft-unhooked&quot;),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule==&quot;function&quot;&amp;&amp;(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe(&quot;ignoring process.getBuiltinModule call - module is soft-unhooked&quot;),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith(&quot;node:&quot;)){let M=u.slice(5);Fs(M)&amp;&amp;(_=M)}}else{if(c)return Fe(&quot;call to process.getBuiltinModule with unknown built-in id&quot;),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe(&#x27;Module._resolveFilename(&quot;%s&quot;) threw %j, calling original Module.require&#x27;,u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe(&quot;processing %s module require(&#x27;%s&#x27;): %s&quot;,f===!0?&quot;core&quot;:&quot;non-core&quot;,u,_),o._cache.has(_,f)===!0)return Fe(&quot;returning already patched cached module: %s&quot;,_),o._cache.get(_,f);let y=s.has(_);y===!1&amp;&amp;s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe(&quot;module is in the process of being patched already - ignoring: %s&quot;,_),A;if(s.delete(_),f===!0){if(i===!0&amp;&amp;r.includes(_)===!1)return Fe(&quot;ignoring core module not on whitelist: %s&quot;,_),A;m=_}else if(i===!0&amp;&amp;r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe(&quot;could not parse filename: %s&quot;,_),A;m=M.name,O=M.basedir;let F=yae(M);Fe(&quot;resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)&quot;,m,u,F,O);let N=!1;if(i){if(!u.startsWith(&quot;.&quot;)&amp;&amp;r.includes(u)&amp;&amp;(m=u,N=!0),!r.includes(m)&amp;&amp;!r.includes(F))return A;r.includes(F)&amp;&amp;F!==m&amp;&amp;(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe(&quot;could not resolve module: %s&quot;,m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe(&quot;preparing to process require of internal file: %s&quot;,m);else return Fe(&quot;ignoring require of non-main module file: %s&quot;,z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe(&quot;calling require hook: %s&quot;,m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe(&quot;returning module: %s&quot;,m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe(&quot;require unhook successful&quot;)):Fe(&quot;require unhook unsuccessful&quot;),process.getBuiltinModule!==void 0&amp;&amp;(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe(&quot;process.getBuiltinModule unhook successful&quot;)):Fe(&quot;process.getBuiltinModule unhook unsuccessful&quot;))};function yae(r){let e=Gs.sep!==&quot;/&quot;?r.path.split(Gs.sep).join(&quot;/&quot;):r.path;return Gs.posix.join(r.name,e).replace(vae,&quot;&quot;)}});var Xd,Wd,iF=p(()=&gt;{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split(&quot;/&quot;)){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split(&quot;/&quot;)){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&amp;&amp;i&amp;&amp;a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&amp;&amp;a.sort((n,l)=&gt;n.insertedId-l.insertedId),a.map(({hook:n})=&gt;n))}}});import*as xg from&quot;path&quot;;function Aae(r){return xg.sep!==&quot;/&quot;?r.split(xg.sep).join(&quot;/&quot;):r}var sF,Oae,Jd,aF=p(()=&gt;{sF=Nn(Lg());iF();Oae=[&quot;afterEach&quot;,&quot;after&quot;,&quot;beforeEach&quot;,&quot;before&quot;,&quot;describe&quot;,&quot;it&quot;].every(r=&gt;typeof global[r]==&quot;function&quot;),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=&gt;{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&amp;&amp;e!==void 0?e:new r}}});var dF=T(Wi=&gt;{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return&quot;Module&quot;;let t=cF.get(r)[e];if(typeof t==&quot;function&quot;)return t()},defineProperty(r,e,t){if(!(&quot;value&quot;in t))throw new Error(&quot;Getters/setters are not supported for exports property descriptors.&quot;);return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=&gt;i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=&gt;{var hF=V(&quot;path&quot;),Iae=gg(),{fileURLToPath:_F}=V(&quot;url&quot;),{MessageChannel:bae}=V(&quot;worker_threads&quot;),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=&gt;r(e,t))}function TF(r){let e=wg.indexOf(r);e&gt;-1&amp;&amp;wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&amp;&amp;s!==e&amp;&amp;(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=&gt;{t++,r.postMessage(n)},r.on(&quot;message&quot;,()=&gt;{t--,o&amp;&amp;t&lt;=0&amp;&amp;o()}).unref();function s(){let n=setInterval(()=&gt;{},1e3),l=new Promise(c=&gt;{o=c}).then(()=&gt;{clearInterval(n)});return t===0&amp;&amp;o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null);let o=e?e.internals===!0:!1;Dg&amp;&amp;Array.isArray(r)&amp;&amp;Dg(r),this._iitmHook=(s,a)=&gt;{let i=s,n=s.startsWith(&quot;node:&quot;),l;if(n)s=s.replace(/^node:/,&quot;&quot;);else{if(s.startsWith(&quot;file://&quot;))try{s=_F(s)}catch{}let c=Iae(s);c&amp;&amp;(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&amp;&amp;!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}function Qd(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Ug=p(()=&gt;{});import*as hn from&quot;path&quot;;import{types as yF}from&quot;util&quot;;import{readFileSync as Dae}from&quot;fs&quot;;function OF(r,e,t){return typeof e&gt;&quot;u&quot;?r.includes(&quot;*&quot;):r.some(o=&gt;(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=&gt;{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=&gt;{if(Qd(a[i])&amp;&amp;this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=&gt;yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(l=&gt;{i.forEach(c=&gt;{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(n=&gt;{i.forEach(l=&gt;{this._unwrap(n,l)})})};let s=this.init();s&amp;&amp;!Array.isArray(s)&amp;&amp;(s=[s]),this._modules=s||[],this._config.enabled&amp;&amp;this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=&gt;{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&amp;&amp;this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,&quot;package.json&quot;),{encoding:&quot;utf8&quot;}),o=JSON.parse(t).version;return typeof o==&quot;string&quot;?o:void 0}catch{S.warn(&quot;Failed extracting version&quot;,e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for nodejs core module on require hook&quot;,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&amp;&amp;typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for module on require hook&quot;,{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&amp;&amp;a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=&gt;u.name===l).filter(u=&gt;OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=&gt;(f.moduleExports=u,this._enabled?(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on require hook&quot;,{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length&gt;0){for(let e of this._modules){typeof e.patch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=&gt;{if(!l&amp;&amp;hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=&gt;this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module file on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from&quot;path&quot;;var PF=p(()=&gt;{});var IF=p(()=&gt;{CF();PF()});var kg=p(()=&gt;{IF()});var eh,bF=p(()=&gt;{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=&gt;{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=&gt;qs,InstrumentationNodeModuleDefinition:()=&gt;eh,InstrumentationNodeModuleFile:()=&gt;th,isWrapped:()=&gt;Qd,registerInstrumentations:()=&gt;o2,safeExecuteInTheMiddle:()=&gt;gF,safeExecuteInTheMiddleAsync:()=&gt;vF});var MF=p(()=&gt;{s2();kg();bF();LF();Ug()});var Br,wF=p(()=&gt;{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=&gt;{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name=&quot;OTLPExporterError&quot;,a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&amp;&amp;Number.isFinite(r)&amp;&amp;r&gt;0)return r;throw new Error(&quot;Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: &#x27;&quot;+r+&quot;&#x27;)&quot;)}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&amp;&amp;o!==void 0?o:e.timeoutMillis)!==null&amp;&amp;s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&amp;&amp;a!==void 0?a:e.concurrencyLimit)!==null&amp;&amp;i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&amp;&amp;n!==void 0?n:e.compression)!==null&amp;&amp;l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:&quot;none&quot;}}var pc=p(()=&gt;{});var sh,DF=p(()=&gt;{(function(r){r.NONE=&quot;none&quot;,r.GZIP=&quot;gzip&quot;})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=&gt;{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error(&quot;Concurrency Limit reached&quot;);this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length&gt;=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function BF(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Vg(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Vg(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var FF=p(()=&gt;{P()});var Er,GF=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Er||(Er={}))});var dc,Fg=p(()=&gt;{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,&quot;partialSuccess&quot;)}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn(&quot;Received Partial Success response:&quot;,JSON.stringify(r.partialSuccess))}}}var qF=p(()=&gt;{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=&gt;{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:&quot;OTLPExportDelegate&quot;})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug(&quot;items to be sent&quot;,e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error(&quot;Concurrent export limit reached&quot;)});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error(&quot;Nothing to send&quot;)});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status===&quot;success&quot;){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn(&quot;Export succeeded but could not deserialize response - is the response specification compliant?&quot;,i,a.data)}t({code:Er.SUCCESS});return}else if(a.status===&quot;failure&quot;&amp;&amp;a.error){t({code:Er.FAILED,error:a.error});return}else a.status===&quot;retryable&quot;?t({code:Er.FAILED,error:new Ji(&quot;Export failed with retryable status&quot;)}):t({code:Er.FAILED,error:new Ji(&quot;Export failed with unknown error&quot;)})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug(&quot;shutdown started&quot;),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=&gt;{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=&gt;sh,OTLPExporterBase:()=&gt;Br,OTLPExporterError:()=&gt;Ji,createOtlpNetworkExportDelegate:()=&gt;jF,getSharedConfigurationDefaults:()=&gt;oh,mergeOtlpSharedConfigurationWithDefaults:()=&gt;ih});var _n=p(()=&gt;{wF();rh();pc();DF();YF()});function zF(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var KF=p(()=&gt;{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=&gt;{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=&gt;{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=&gt;{XF();Xae=typeof BigInt&lt;&quot;u&quot;?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=&gt;{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]=&quot;SPAN_KIND_UNSPECIFIED&quot;,r[r.SPAN_KIND_INTERNAL=1]=&quot;SPAN_KIND_INTERNAL&quot;,r[r.SPAN_KIND_SERVER=2]=&quot;SPAN_KIND_SERVER&quot;,r[r.SPAN_KIND_CLIENT=3]=&quot;SPAN_KIND_CLIENT&quot;,r[r.SPAN_KIND_PRODUCER=4]=&quot;SPAN_KIND_PRODUCER&quot;,r[r.SPAN_KIND_CONSUMER=5]=&quot;SPAN_KIND_CONSUMER&quot;})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;ph(t,o))}}:{}}var Ys=p(()=&gt;{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=&gt;{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=&gt;{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=&gt;{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=&gt;({scope:js(t.scope),metrics:t.metrics.map(o=&gt;rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=&gt;nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=&gt;{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=&gt;rG(t,e))}}var Eh=p(()=&gt;{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a=&quot;&quot;,schemaUrl:i=&quot;&quot;}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=&gt;({resource:zs(o),scopeLogs:Array.from(s,([,a])=&gt;({scope:js(a[0].instrumentationScope),logRecords:a.map(i=&gt;cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}var mh=p(()=&gt;{Ec();Ys();hh()});var Yg=T((sVe,iG)=&gt;{&quot;use strict&quot;;iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s&lt;arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&amp;&amp;(a=!1,l(c))}})}});var lG=T(aG=&gt;{&quot;use strict&quot;;var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4&gt;1&amp;&amp;e.charAt(t)===&quot;=&quot;;)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr&lt;64;)sG[Ws[mr]=mr&lt;26?mr+65:mr&lt;52?mr+71:mr&lt;62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t&lt;o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c&gt;&gt;2],l=(c&amp;3)&lt;&lt;4,n=1;break;case 1:a[i++]=Ws[l|c&gt;&gt;4],l=(c&amp;15)&lt;&lt;2,n=2;break;case 2:a[i++]=Ws[l|c&gt;&gt;6],a[i++]=Ws[c&amp;63],n=0;break}i&gt;8191&amp;&amp;((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&amp;&amp;(a[i++]=Ws[l],a[i++]=61,n===1&amp;&amp;(a[i++]=61)),s?(i&amp;&amp;s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join(&quot;&quot;)):String.fromCharCode.apply(String,a.slice(0,i))};var oG=&quot;invalid encoding&quot;;Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n&lt;e.length;){var l=e.charCodeAt(n++);if(l===61&amp;&amp;a&gt;1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i&lt;&lt;2|(l&amp;48)&gt;&gt;4,i=l,a=2;break;case 2:t[o++]=(i&amp;15)&lt;&lt;4|(l&amp;60)&gt;&gt;2,i=l,a=3;break;case 3:t[o++]=(i&amp;3)&lt;&lt;6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=&gt;{&quot;use strict&quot;;cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s&lt;o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s&lt;arguments.length;)o.push(arguments[s++]);for(s=0;s&lt;t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=&gt;{&quot;use strict&quot;;EG.exports=fG(fG);function fG(r){return typeof Float32Array&lt;&quot;u&quot;?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s&lt;0?1:0;if(n&amp;&amp;(s=-s),s===0)o(1/s&gt;0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s&gt;34028234663852886e22)o((n&lt;&lt;31|2139095040)&gt;&gt;&gt;0,a,i);else if(s&lt;11754943508222875e-54)o((n&lt;&lt;31|Math.round(s/1401298464324817e-60))&gt;&gt;&gt;0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&amp;8388607;o((n&lt;&lt;31|l+127&lt;&lt;23|c)&gt;&gt;&gt;0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i&gt;&gt;31)*2+1,l=i&gt;&gt;&gt;23&amp;255,c=i&amp;8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array&lt;&quot;u&quot;?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i&lt;0?1:0;if(c&amp;&amp;(i=-i),i===0)o(0,n,l+s),o(1/i&gt;0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i&gt;17976931348623157e292)o(0,n,l+s),o((c&lt;&lt;31|2146435072)&gt;&gt;&gt;0,n,l+a);else{var u;if(i&lt;22250738585072014e-324)u=i/5e-324,o(u&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|u/4294967296)&gt;&gt;&gt;0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&amp;&amp;(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|f+1023&lt;&lt;20|u*1048576&amp;1048575)&gt;&gt;&gt;0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c&gt;&gt;31)*2+1,f=c&gt;&gt;&gt;20&amp;2047,_=4294967296*(c&amp;1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}function dG(r,e,t){e[t]=r&gt;&gt;&gt;24,e[t+1]=r&gt;&gt;&gt;16&amp;255,e[t+2]=r&gt;&gt;&gt;8&amp;255,e[t+3]=r&amp;255}function hG(r,e){return(r[e]|r[e+1]&lt;&lt;8|r[e+2]&lt;&lt;16|r[e+3]&lt;&lt;24)&gt;&gt;&gt;0}function _G(r,e){return(r[e]&lt;&lt;24|r[e+1]&lt;&lt;16|r[e+2]&lt;&lt;8|r[e+3])&gt;&gt;&gt;0}});var zg=T((exports,module)=&gt;{&quot;use strict&quot;;module.exports=inquire;function inquire(moduleName){try{var mod=eval(&quot;quire&quot;.replace(/^/,&quot;re&quot;))(moduleName);if(mod&amp;&amp;(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=&gt;{&quot;use strict&quot;;var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s&lt;e.length;++s)o=e.charCodeAt(s),o&lt;128?t+=1:o&lt;2048?t+=2:(o&amp;64512)===55296&amp;&amp;(e.charCodeAt(s+1)&amp;64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s&lt;1)return&quot;&quot;;for(var a=null,i=[],n=0,l;t&lt;o;)l=e[t++],l&lt;128?i[n++]=l:l&gt;191&amp;&amp;l&lt;224?i[n++]=(l&amp;31)&lt;&lt;6|e[t++]&amp;63:l&gt;239&amp;&amp;l&lt;365?(l=((l&amp;7)&lt;&lt;18|(e[t++]&amp;63)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63)-65536,i[n++]=55296+(l&gt;&gt;10),i[n++]=56320+(l&amp;1023)):i[n++]=(l&amp;15)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63,n&gt;8191&amp;&amp;((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&amp;&amp;a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join(&quot;&quot;)):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n&lt;e.length;++n)a=e.charCodeAt(n),a&lt;128?t[o++]=a:a&lt;2048?(t[o++]=a&gt;&gt;6|192,t[o++]=a&amp;63|128):(a&amp;64512)===55296&amp;&amp;((i=e.charCodeAt(n+1))&amp;64512)===56320?(a=65536+((a&amp;1023)&lt;&lt;10)+(i&amp;1023),++n,t[o++]=a&gt;&gt;18|240,t[o++]=a&gt;&gt;12&amp;63|128,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128):(t[o++]=a&gt;&gt;12|224,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128);return o-s}});var vG=T((fVe,gG)=&gt;{&quot;use strict&quot;;gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o&gt;&gt;&gt;1,a=null,i=o;return function(l){if(l&lt;1||l&gt;s)return r(l);i+l&gt;o&amp;&amp;(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&amp;7&amp;&amp;(i=(i|7)+1),c}}});var OG=T((pVe,yG)=&gt;{&quot;use strict&quot;;yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r&gt;&gt;&gt;0,this.hi=e&gt;&gt;&gt;0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash=&quot;\0\0\0\0\0\0\0\0&quot;;tt.fromNumber=function(e){if(e===0)return Qi;var t=e&lt;0;t&amp;&amp;(e=-e);var o=e&gt;&gt;&gt;0,s=(e-o)/4294967296&gt;&gt;&gt;0;return t&amp;&amp;(s=~s&gt;&gt;&gt;0,o=~o&gt;&gt;&gt;0,++o&gt;4294967295&amp;&amp;(o=0,++s&gt;4294967295&amp;&amp;(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e==&quot;number&quot;)return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low&gt;&gt;&gt;0,e.high&gt;&gt;&gt;0):Qi};tt.prototype.toNumber=function(e){if(!e&amp;&amp;this.hi&gt;&gt;&gt;31){var t=~this.lo+1&gt;&gt;&gt;0,o=~this.hi&gt;&gt;&gt;0;return t||(o=o+1&gt;&gt;&gt;0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)&lt;&lt;8|$n.call(e,2)&lt;&lt;16|$n.call(e,3)&lt;&lt;24)&gt;&gt;&gt;0,($n.call(e,4)|$n.call(e,5)&lt;&lt;8|$n.call(e,6)&lt;&lt;16|$n.call(e,7)&lt;&lt;24)&gt;&gt;&gt;0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&amp;255,this.lo&gt;&gt;&gt;8&amp;255,this.lo&gt;&gt;&gt;16&amp;255,this.lo&gt;&gt;&gt;24,this.hi&amp;255,this.hi&gt;&gt;&gt;8&amp;255,this.hi&gt;&gt;&gt;16&amp;255,this.hi&gt;&gt;&gt;24)};tt.prototype.zzEncode=function(){var e=this.hi&gt;&gt;31;return this.hi=((this.hi&lt;&lt;1|this.lo&gt;&gt;&gt;31)^e)&gt;&gt;&gt;0,this.lo=(this.lo&lt;&lt;1^e)&gt;&gt;&gt;0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&amp;1);return this.lo=((this.lo&gt;&gt;&gt;1|this.hi&lt;&lt;31)^e)&gt;&gt;&gt;0,this.hi=(this.hi&gt;&gt;&gt;1^e)&gt;&gt;&gt;0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo&gt;&gt;&gt;28|this.hi&lt;&lt;4)&gt;&gt;&gt;0,o=this.hi&gt;&gt;&gt;24;return o===0?t===0?e&lt;16384?e&lt;128?1:2:e&lt;2097152?3:4:t&lt;16384?t&lt;128?5:6:t&lt;2097152?7:8:o&lt;128?9:10}});var Fr=T($g=&gt;{&quot;use strict&quot;;var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global&lt;&quot;u&quot;&amp;&amp;global&amp;&amp;global.process&amp;&amp;global.process.versions&amp;&amp;global.process.versions.node);K.global=K.isNode&amp;&amp;global||typeof window&lt;&quot;u&quot;&amp;&amp;window||typeof self&lt;&quot;u&quot;&amp;&amp;self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e==&quot;number&quot;&amp;&amp;isFinite(e)&amp;&amp;Math.floor(e)===e};K.isString=function(e){return typeof e==&quot;string&quot;||e instanceof String};K.isObject=function(e){return e&amp;&amp;typeof e==&quot;object&quot;};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&amp;&amp;e.hasOwnProperty(t)?typeof o!=&quot;object&quot;||(Array.isArray(o)?o.length:Object.keys(o).length)&gt;0:!1};K.Buffer=(function(){try{var r=K.inquire(&quot;buffer&quot;).Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e==&quot;number&quot;?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array&gt;&quot;u&quot;?e:new Uint8Array(e)};K.Array=typeof Uint8Array&lt;&quot;u&quot;?Uint8Array:Array;K.Long=K.global.dcodeIO&amp;&amp;K.global.dcodeIO.Long||K.global.Long||K.inquire(&quot;long&quot;);K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s&lt;o.length;++s)(r[o[s]]===void 0||!t)&amp;&amp;(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,&quot;message&quot;,{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,&quot;stack&quot;,{value:new Error().stack||&quot;&quot;}),o&amp;&amp;AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+&quot;: &quot;+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG(&quot;ProtocolError&quot;);K.oneOfGetter=function(e){for(var t={},o=0;o&lt;e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a&gt;-1;--a)if(t[s[a]]===1&amp;&amp;this[s[a]]!==void 0&amp;&amp;this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o&lt;e.length;++o)e[o]!==t&amp;&amp;delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&amp;&amp;r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=&gt;{&quot;use strict&quot;;IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&amp;&amp;(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&amp;255}function _le(r,e,t){for(;r&gt;127;)e[t++]=r&amp;127|128,r&gt;&gt;&gt;=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e&gt;&gt;&gt;0)&lt;128?1:e&lt;16384?2:e&lt;2097152?3:e&lt;268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e&lt;0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e&lt;&lt;1^e&gt;&gt;31)&gt;&gt;&gt;0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&amp;127|128,r.lo=(r.lo&gt;&gt;&gt;7|r.hi&lt;&lt;25)&gt;&gt;&gt;0,r.hi&gt;&gt;&gt;=7;for(;r.lo&gt;127;)e[t++]=r.lo&amp;127|128,r.lo=r.lo&gt;&gt;&gt;7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e&gt;&gt;&gt;0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s&lt;e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length&gt;&gt;&gt;0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&amp;&amp;(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=&gt;{&quot;use strict&quot;;LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&amp;&amp;Xn.Buffer.prototype instanceof Uint8Array&amp;&amp;Xn.Buffer.prototype.set.name===&quot;set&quot;?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s&lt;e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&amp;&amp;(e=Xn._Buffer_from(e,&quot;base64&quot;));var t=e.length&gt;&gt;&gt;0;return this.uint32(t),t&amp;&amp;this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length&lt;40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&amp;&amp;this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=&gt;{&quot;use strict&quot;;kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError(&quot;index out of range: &quot;+r.pos+&quot; + &quot;+(e||1)+&quot; &gt; &quot;+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array&lt;&quot;u&quot;?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)}:function(e){if(Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&amp;127)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;14)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;21)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;15)&lt;&lt;28)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128))return e;if((this.pos+=5)&gt;this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e&gt;&gt;&gt;1^-(e&amp;1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos&gt;4){for(;e&lt;4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;28)&gt;&gt;&gt;0,r.hi=(r.hi|(this.buf[this.pos]&amp;127)&gt;&gt;4)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;e=0}else{for(;e&lt;3;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,r}if(this.len-this.pos&gt;4){for(;e&lt;5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}else for(;e&lt;5;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}throw Error(&quot;invalid varint encoding&quot;)}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]&lt;&lt;8|r[e-2]&lt;&lt;16|r[e-1]&lt;&lt;24)&gt;&gt;&gt;0}Ge.prototype.fixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8&gt;this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8&gt;this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o&gt;this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e==&quot;number&quot;){if(this.pos+e&gt;this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos&gt;=this.len)throw Sr(this);while(this.buf[this.pos++]&amp;128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&amp;7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error(&quot;invalid wire type &quot;+r+&quot; at offset &quot;+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?&quot;toLong&quot;:&quot;toNumber&quot;;Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=&gt;{&quot;use strict&quot;;FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&amp;&amp;(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(&quot;utf-8&quot;,this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=&gt;{&quot;use strict&quot;;HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!=&quot;function&quot;)throw TypeError(&quot;rpcImpl must be a function&quot;);nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError(&quot;request must be specified&quot;);var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error(&quot;already ended&quot;))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?&quot;encodeDelimited&quot;:&quot;encode&quot;](s).finish(),function(l,c){if(l)return i.emit(&quot;error&quot;,l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?&quot;decodeDelimited&quot;:&quot;decode&quot;](c)}catch(u){return i.emit(&quot;error&quot;,u,e),a(u)}return i.emit(&quot;data&quot;,c,e),a(null,c)})}catch(n){i.emit(&quot;error&quot;,n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&amp;&amp;(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(&quot;end&quot;).off()),this}});var iv=T(jG=&gt;{&quot;use strict&quot;;var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=&gt;{&quot;use strict&quot;;YG.exports={}});var sv=T(KG=&gt;{&quot;use strict&quot;;var Ct=KG;Ct.build=&quot;minimal&quot;;Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=&gt;{&quot;use strict&quot;;$G.exports=sv()});var JG=T((OVe,WG)=&gt;{&quot;use strict&quot;;var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;intValue&quot;,&quot;doubleValue&quot;,&quot;arrayValue&quot;,&quot;kvlistValue&quot;,&quot;bytesValue&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;stringValue&quot;)&amp;&amp;l.uint32(10).string(n.stringValue),n.boolValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;boolValue&quot;)&amp;&amp;l.uint32(16).bool(n.boolValue),n.intValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;intValue&quot;)&amp;&amp;l.uint32(24).int64(n.intValue),n.doubleValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;doubleValue&quot;)&amp;&amp;l.uint32(33).double(n.doubleValue),n.arrayValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;arrayValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;kvlistValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;bytesValue&quot;)&amp;&amp;l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(l.value=1,!h.isString(n.stringValue)))return&quot;stringValue: string expected&quot;;if(n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.boolValue!=&quot;boolean&quot;)return&quot;boolValue: boolean expected&quot;}if(n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.intValue)&amp;&amp;!(n.intValue&amp;&amp;h.isInteger(n.intValue.low)&amp;&amp;h.isInteger(n.intValue.high)))return&quot;intValue: integer|Long expected&quot;}if(n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.doubleValue!=&quot;number&quot;)return&quot;doubleValue: number expected&quot;}if(n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return&quot;arrayValue.&quot;+c}}if(n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return&quot;kvlistValue.&quot;+c}}if(n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!(n.bytesValue&amp;&amp;typeof n.bytesValue.length==&quot;number&quot;||h.isString(n.bytesValue)))return&quot;bytesValue: buffer expected&quot;}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&amp;&amp;(l.stringValue=String(n.stringValue)),n.boolValue!=null&amp;&amp;(l.boolValue=!!n.boolValue),n.intValue!=null&amp;&amp;(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue==&quot;string&quot;?l.intValue=parseInt(n.intValue,10):typeof n.intValue==&quot;number&quot;?l.intValue=n.intValue:typeof n.intValue==&quot;object&quot;&amp;&amp;(l.intValue=new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber())),n.doubleValue!=null&amp;&amp;(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected&quot;);l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected&quot;);l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&amp;&amp;(typeof n.bytesValue==&quot;string&quot;?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length&gt;=0&amp;&amp;(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(c.stringValue=n.stringValue,l.oneofs&amp;&amp;(c.value=&quot;stringValue&quot;)),n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)&amp;&amp;(c.boolValue=n.boolValue,l.oneofs&amp;&amp;(c.value=&quot;boolValue&quot;)),n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)&amp;&amp;(typeof n.intValue==&quot;number&quot;?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber():n.intValue,l.oneofs&amp;&amp;(c.value=&quot;intValue&quot;)),n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)&amp;&amp;(c.doubleValue=l.json&amp;&amp;!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&amp;&amp;(c.value=&quot;doubleValue&quot;)),n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)&amp;&amp;(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&amp;&amp;(c.value=&quot;arrayValue&quot;)),n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)&amp;&amp;(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&amp;&amp;(c.value=&quot;kvlistValue&quot;)),n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)&amp;&amp;(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&amp;&amp;(c.value=&quot;bytesValue&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.common.v1.AnyValue&quot;},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.ArrayValue&quot;},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValueList&quot;},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;key&quot;)&amp;&amp;n.uint32(10).string(i.key),i.value!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;value&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;!h.isString(i.key))return&quot;key: string expected&quot;;if(i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return&quot;value.&quot;+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&amp;&amp;(n.key=String(i.key)),i.value!=null){if(typeof i.value!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValue.value: object expected&quot;);n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.key=&quot;&quot;,l.value=null),i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;(l.key=i.key),i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)&amp;&amp;(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValue&quot;},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(10).string(i.name),i.version!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;version&quot;)&amp;&amp;n.uint32(18).string(i.version),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;!h.isString(i.version))return&quot;version: string expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&amp;&amp;(n.name=String(i.name)),i.version!=null&amp;&amp;(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.name=&quot;&quot;,l.version=&quot;&quot;,l.droppedAttributesCount=0),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;(l.version=i.version),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.InstrumentationScope&quot;},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.droppedAttributesCount=0),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.resource.v1.Resource&quot;},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&amp;&amp;i.resourceSpans.length)for(var l=0;l&lt;i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceSpans&amp;&amp;c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceSpans!=null&amp;&amp;i.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(i.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var n=0;n&lt;i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return&quot;resourceSpans.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected&quot;);n.resourceSpans=[];for(var l=0;l&lt;i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected&quot;);n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceSpans=[]),i.resourceSpans&amp;&amp;i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c&lt;i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.TracesData&quot;},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&amp;&amp;i.scopeSpans.length)for(var l=0;l&lt;i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&amp;&amp;c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeSpans!=null&amp;&amp;i.hasOwnProperty(&quot;scopeSpans&quot;)){if(!Array.isArray(i.scopeSpans))return&quot;scopeSpans: array expected&quot;;for(var l=0;l&lt;i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return&quot;scopeSpans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected&quot;);n.scopeSpans=[];for(var l=0;l&lt;i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected&quot;);n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeSpans=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&amp;&amp;i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c&lt;i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ResourceSpans&quot;},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&amp;&amp;i.spans.length)for(var l=0;l&lt;i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&amp;&amp;c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.spans!=null&amp;&amp;i.hasOwnProperty(&quot;spans&quot;)){if(!Array.isArray(i.spans))return&quot;spans: array expected&quot;;for(var l=0;l&lt;i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return&quot;spans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected&quot;);n.spans=[];for(var l=0;l&lt;i.spans.length;++l){if(typeof i.spans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected&quot;);n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.spans=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&amp;&amp;i.spans.length){l.spans=[];for(var c=0;c&lt;i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ScopeSpans&quot;},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(10).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(18).bytes(i.spanId),i.traceState!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceState&quot;)&amp;&amp;n.uint32(26).string(i.traceState),i.parentSpanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;parentSpanId&quot;)&amp;&amp;n.uint32(34).bytes(i.parentSpanId),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(42).string(i.name),i.kind!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;kind&quot;)&amp;&amp;n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;endTimeUnixNano&quot;)&amp;&amp;n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&amp;&amp;i.events.length)for(var l=0;l&lt;i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedEventsCount&quot;)&amp;&amp;n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&amp;&amp;i.links.length)for(var l=0;l&lt;i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedLinksCount&quot;)&amp;&amp;n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;status&quot;)&amp;&amp;d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&amp;&amp;c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&amp;&amp;c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId)))return&quot;traceId: buffer expected&quot;;if(i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId)))return&quot;spanId: buffer expected&quot;;if(i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(i.traceState))return&quot;traceState: string expected&quot;;if(i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;!(i.parentSpanId&amp;&amp;typeof i.parentSpanId.length==&quot;number&quot;||h.isString(i.parentSpanId)))return&quot;parentSpanId: buffer expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;))switch(i.kind){default:return&quot;kind: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.endTimeUnixNano)&amp;&amp;!(i.endTimeUnixNano&amp;&amp;h.isInteger(i.endTimeUnixNano.low)&amp;&amp;h.isInteger(i.endTimeUnixNano.high)))return&quot;endTimeUnixNano: integer|Long expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount))return&quot;droppedAttributesCount: integer expected&quot;;if(i.events!=null&amp;&amp;i.hasOwnProperty(&quot;events&quot;)){if(!Array.isArray(i.events))return&quot;events: array expected&quot;;for(var n=0;n&lt;i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return&quot;events.&quot;+l}}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;!h.isInteger(i.droppedEventsCount))return&quot;droppedEventsCount: integer expected&quot;;if(i.links!=null&amp;&amp;i.hasOwnProperty(&quot;links&quot;)){if(!Array.isArray(i.links))return&quot;links: array expected&quot;;for(var n=0;n&lt;i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return&quot;links.&quot;+l}}if(i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;!h.isInteger(i.droppedLinksCount))return&quot;droppedLinksCount: integer expected&quot;;if(i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return&quot;status.&quot;+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),i.traceState!=null&amp;&amp;(n.traceState=String(i.traceState)),i.parentSpanId!=null&amp;&amp;(typeof i.parentSpanId==&quot;string&quot;?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length&gt;=0&amp;&amp;(n.parentSpanId=i.parentSpanId)),i.name!=null&amp;&amp;(n.name=String(i.name)),i.kind){default:if(typeof i.kind==&quot;number&quot;){n.kind=i.kind;break}break;case&quot;SPAN_KIND_UNSPECIFIED&quot;:case 0:n.kind=0;break;case&quot;SPAN_KIND_INTERNAL&quot;:case 1:n.kind=1;break;case&quot;SPAN_KIND_SERVER&quot;:case 2:n.kind=2;break;case&quot;SPAN_KIND_CLIENT&quot;:case 3:n.kind=3;break;case&quot;SPAN_KIND_PRODUCER&quot;:case 4:n.kind=4;break;case&quot;SPAN_KIND_CONSUMER&quot;:case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.endTimeUnixNano!=null&amp;&amp;(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano==&quot;string&quot;?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano==&quot;number&quot;?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano==&quot;object&quot;&amp;&amp;(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.events){if(!Array.isArray(i.events))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: array expected&quot;);n.events=[];for(var l=0;l&lt;i.events.length;++l){if(typeof i.events[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: object expected&quot;);n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&amp;&amp;(n.droppedEventsCount=i.droppedEventsCount&gt;&gt;&gt;0),i.links){if(!Array.isArray(i.links))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: array expected&quot;);n.links=[];for(var l=0;l&lt;i.links.length;++l){if(typeof i.links[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: object expected&quot;);n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&amp;&amp;(n.droppedLinksCount=i.droppedLinksCount&gt;&gt;&gt;0),i.status!=null){if(typeof i.status!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.status: object expected&quot;);n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),l.traceState=&quot;&quot;,n.bytes===String?l.parentSpanId=&quot;&quot;:(l.parentSpanId=[],n.bytes!==Array&amp;&amp;(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name=&quot;&quot;,l.kind=n.enums===String?&quot;SPAN_KIND_UNSPECIFIED&quot;:0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?&quot;0&quot;:0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(l.traceState=i.traceState),i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;)&amp;&amp;(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;(typeof i.endTimeUnixNano==&quot;number&quot;?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.endTimeUnixNano),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.events&amp;&amp;i.events.length){l.events=[];for(var u=0;u&lt;i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;(l.droppedEventsCount=i.droppedEventsCount),i.links&amp;&amp;i.links.length){l.links=[];for(var u=0;u&lt;i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)&amp;&amp;(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Span&quot;},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;SPAN_KIND_UNSPECIFIED&quot;]=0,i[a[1]=&quot;SPAN_KIND_INTERNAL&quot;]=1,i[a[2]=&quot;SPAN_KIND_SERVER&quot;]=2,i[a[3]=&quot;SPAN_KIND_CLIENT&quot;]=3,i[a[4]=&quot;SPAN_KIND_PRODUCER&quot;]=4,i[a[5]=&quot;SPAN_KIND_CONSUMER&quot;]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(18).string(n.name),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.name!=null&amp;&amp;(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.name=&quot;&quot;,c.droppedAttributesCount=0}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Event&quot;},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(10).bytes(n.traceId),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(18).bytes(n.spanId),n.traceState!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceState&quot;)&amp;&amp;l.uint32(26).string(n.traceState),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId)))return&quot;traceId: buffer expected&quot;;if(n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId)))return&quot;spanId: buffer expected&quot;;if(n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(n.traceState))return&quot;traceState: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceState!=null&amp;&amp;(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults&amp;&amp;(l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),c.traceState=&quot;&quot;,c.droppedAttributesCount=0),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(c.traceState=n.traceState),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var u=0;u&lt;n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Link&quot;},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;message&quot;)&amp;&amp;n.uint32(18).string(i.message),i.code!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;code&quot;)&amp;&amp;n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;!h.isString(i.message))return&quot;message: string expected&quot;;if(i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;))switch(i.code){default:return&quot;code: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&amp;&amp;(n.message=String(i.message)),i.code){default:if(typeof i.code==&quot;number&quot;){n.code=i.code;break}break;case&quot;STATUS_CODE_UNSET&quot;:case 0:n.code=0;break;case&quot;STATUS_CODE_OK&quot;:case 1:n.code=1;break;case&quot;STATUS_CODE_ERROR&quot;:case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.message=&quot;&quot;,l.code=n.enums===String?&quot;STATUS_CODE_UNSET&quot;:0),i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;(l.message=i.message),i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;)&amp;&amp;(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Status&quot;},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;STATUS_CODE_UNSET&quot;]=0,i[a[1]=&quot;STATUS_CODE_OK&quot;]=1,i[a[2]=&quot;STATUS_CODE_ERROR&quot;]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&amp;&amp;n.resourceSpans.length)for(var c=0;c&lt;n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceSpans&amp;&amp;u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceSpans!=null&amp;&amp;n.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(n.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var l=0;l&lt;n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return&quot;resourceSpans.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected&quot;);l.resourceSpans=[];for(var c=0;c&lt;n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected&quot;);l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceSpans=[]),n.resourceSpans&amp;&amp;n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u&lt;n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest&quot;},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse&quot;},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedSpans&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;!h.isInteger(n.rejectedSpans)&amp;&amp;!(n.rejectedSpans&amp;&amp;h.isInteger(n.rejectedSpans.low)&amp;&amp;h.isInteger(n.rejectedSpans.high))?&quot;rejectedSpans: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&amp;&amp;(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans==&quot;string&quot;?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans==&quot;number&quot;?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans==&quot;object&quot;&amp;&amp;(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;(typeof n.rejectedSpans==&quot;number&quot;?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber():n.rejectedSpans),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess&quot;},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&amp;&amp;n.resourceMetrics.length)for(var c=0;c&lt;n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceMetrics&amp;&amp;u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceMetrics!=null&amp;&amp;n.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(n.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var l=0;l&lt;n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return&quot;resourceMetrics.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected&quot;);l.resourceMetrics=[];for(var c=0;c&lt;n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected&quot;);l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceMetrics=[]),n.resourceMetrics&amp;&amp;n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u&lt;n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest&quot;},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse&quot;},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedDataPoints&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;!h.isInteger(n.rejectedDataPoints)&amp;&amp;!(n.rejectedDataPoints&amp;&amp;h.isInteger(n.rejectedDataPoints.low)&amp;&amp;h.isInteger(n.rejectedDataPoints.high))?&quot;rejectedDataPoints: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&amp;&amp;(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints==&quot;string&quot;?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints==&quot;number&quot;?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints==&quot;object&quot;&amp;&amp;(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;(typeof n.rejectedDataPoints==&quot;number&quot;?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess&quot;},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&amp;&amp;n.resourceLogs.length)for(var c=0;c&lt;n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceLogs&amp;&amp;u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceLogs!=null&amp;&amp;n.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(n.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var l=0;l&lt;n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return&quot;resourceLogs.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected&quot;);l.resourceLogs=[];for(var c=0;c&lt;n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected&quot;);l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceLogs=[]),n.resourceLogs&amp;&amp;n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u&lt;n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest&quot;},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse&quot;},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedLogRecords&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;!h.isInteger(n.rejectedLogRecords)&amp;&amp;!(n.rejectedLogRecords&amp;&amp;h.isInteger(n.rejectedLogRecords.low)&amp;&amp;h.isInteger(n.rejectedLogRecords.high))?&quot;rejectedLogRecords: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&amp;&amp;(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords==&quot;string&quot;?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords==&quot;number&quot;?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords==&quot;object&quot;&amp;&amp;(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;(typeof n.rejectedLogRecords==&quot;number&quot;?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess&quot;},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&amp;&amp;i.resourceMetrics.length)for(var l=0;l&lt;i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceMetrics&amp;&amp;c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(i.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var n=0;n&lt;i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return&quot;resourceMetrics.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected&quot;);n.resourceMetrics=[];for(var l=0;l&lt;i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected&quot;);n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceMetrics=[]),i.resourceMetrics&amp;&amp;i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c&lt;i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.MetricsData&quot;},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&amp;&amp;i.scopeMetrics.length)for(var l=0;l&lt;i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&amp;&amp;c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;scopeMetrics&quot;)){if(!Array.isArray(i.scopeMetrics))return&quot;scopeMetrics: array expected&quot;;for(var l=0;l&lt;i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return&quot;scopeMetrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected&quot;);n.scopeMetrics=[];for(var l=0;l&lt;i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected&quot;);n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeMetrics=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&amp;&amp;i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c&lt;i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ResourceMetrics&quot;},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&amp;&amp;i.metrics.length)for(var l=0;l&lt;i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&amp;&amp;c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.metrics!=null&amp;&amp;i.hasOwnProperty(&quot;metrics&quot;)){if(!Array.isArray(i.metrics))return&quot;metrics: array expected&quot;;for(var l=0;l&lt;i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return&quot;metrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected&quot;);n.metrics=[];for(var l=0;l&lt;i.metrics.length;++l){if(typeof i.metrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected&quot;);n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.metrics=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&amp;&amp;i.metrics.length){l.metrics=[];for(var c=0;c&lt;i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ScopeMetrics&quot;},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,&quot;data&quot;,{get:h.oneOfGetter(a=[&quot;gauge&quot;,&quot;sum&quot;,&quot;histogram&quot;,&quot;exponentialHistogram&quot;,&quot;summary&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(10).string(n.name),n.description!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;description&quot;)&amp;&amp;l.uint32(18).string(n.description),n.unit!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;unit&quot;)&amp;&amp;l.uint32(26).string(n.unit),n.gauge!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;gauge&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;histogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;exponentialHistogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;summary&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;!h.isString(n.description))return&quot;description: string expected&quot;;if(n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;!h.isString(n.unit))return&quot;unit: string expected&quot;;if(n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return&quot;gauge.&quot;+c}}if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return&quot;sum.&quot;+c}}if(n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return&quot;histogram.&quot;+c}}if(n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return&quot;exponentialHistogram.&quot;+c}}if(n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return&quot;summary.&quot;+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&amp;&amp;(l.name=String(n.name)),n.description!=null&amp;&amp;(l.description=String(n.description)),n.unit!=null&amp;&amp;(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.gauge: object expected&quot;);l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.sum: object expected&quot;);l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.histogram: object expected&quot;);l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected&quot;);l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.summary: object expected&quot;);l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.name=&quot;&quot;,c.description=&quot;&quot;,c.unit=&quot;&quot;),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;(c.description=n.description),n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;(c.unit=n.unit),n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)&amp;&amp;(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&amp;&amp;(c.data=&quot;gauge&quot;)),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&amp;&amp;(c.data=&quot;sum&quot;)),n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)&amp;&amp;(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&amp;&amp;(c.data=&quot;histogram&quot;)),n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)&amp;&amp;(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&amp;&amp;(c.data=&quot;exponentialHistogram&quot;)),n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)&amp;&amp;(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&amp;&amp;(c.data=&quot;summary&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Metric&quot;},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Gauge&quot;},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;isMonotonic&quot;)&amp;&amp;n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;typeof i.isMonotonic!=&quot;boolean&quot;?&quot;isMonotonic: boolean expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&amp;&amp;(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0,l.isMonotonic=!1),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Sum&quot;},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Histogram&quot;},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogram&quot;},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Summary&quot;},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;]=0,a[s[1]=&quot;AGGREGATION_TEMPORALITY_DELTA&quot;]=1,a[s[2]=&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;DATA_POINT_FLAGS_DO_NOT_USE&quot;]=0,a[s[1]=&quot;DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK&quot;]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(33).double(n.asDouble),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.NumberDataPoint&quot;},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.bucketCounts!=null&amp;&amp;n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c&lt;n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&amp;&amp;n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c&lt;n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(89).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 9:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&amp;&amp;u.bucketCounts.length||(u.bucketCounts=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&amp;&amp;u.explicitBounds.length||(u.explicitBounds=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.bucketCounts!=null&amp;&amp;n.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(n.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&amp;&amp;!(n.bucketCounts[c]&amp;&amp;h.isInteger(n.bucketCounts[c].low)&amp;&amp;h.isInteger(n.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}if(n.explicitBounds!=null&amp;&amp;n.hasOwnProperty(&quot;explicitBounds&quot;)){if(!Array.isArray(n.explicitBounds))return&quot;explicitBounds: array expected&quot;;for(var c=0;c&lt;n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!=&quot;number&quot;)return&quot;explicitBounds: number[] expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected&quot;);l.bucketCounts=[];for(var c=0;c&lt;n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]==&quot;string&quot;?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]==&quot;number&quot;?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]==&quot;object&quot;&amp;&amp;(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low&gt;&gt;&gt;0,n.bucketCounts[c].high&gt;&gt;&gt;0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected&quot;);l.explicitBounds=[];for(var c=0;c&lt;n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.bucketCounts&amp;&amp;n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f&lt;n.bucketCounts.length;++f)typeof n.bucketCounts[f]==&quot;number&quot;?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low&gt;&gt;&gt;0,n.bucketCounts[f].high&gt;&gt;&gt;0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&amp;&amp;n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f&lt;n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&amp;&amp;!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.HistogramDataPoint&quot;},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.scale!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;scale&quot;)&amp;&amp;l.uint32(48).sint32(n.scale),n.zeroCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroCount&quot;)&amp;&amp;l.uint32(57).fixed64(n.zeroCount),n.positive!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;positive&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;negative&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(97).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(105).double(n.max),n.zeroThreshold!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroThreshold&quot;)&amp;&amp;l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;!h.isInteger(n.scale))return&quot;scale: integer expected&quot;;if(n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;!h.isInteger(n.zeroCount)&amp;&amp;!(n.zeroCount&amp;&amp;h.isInteger(n.zeroCount.low)&amp;&amp;h.isInteger(n.zeroCount.high)))return&quot;zeroCount: integer|Long expected&quot;;if(n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return&quot;positive.&quot;+u}if(n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return&quot;negative.&quot;+u}if(n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags))return&quot;flags: integer expected&quot;;if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;typeof n.zeroThreshold!=&quot;number&quot;?&quot;zeroThreshold: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.scale!=null&amp;&amp;(l.scale=n.scale|0),n.zeroCount!=null&amp;&amp;(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount==&quot;string&quot;?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount==&quot;number&quot;?l.zeroCount=n.zeroCount:typeof n.zeroCount==&quot;object&quot;&amp;&amp;(l.zeroCount=new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber())),n.positive!=null){if(typeof n.positive!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected&quot;);l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected&quot;);l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),n.zeroThreshold!=null&amp;&amp;(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?&quot;0&quot;:0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;(c.scale=n.scale),n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;(typeof n.zeroCount==&quot;number&quot;?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber():n.zeroCount),n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)&amp;&amp;(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)&amp;&amp;(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;(c.zeroThreshold=l.json&amp;&amp;!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint&quot;},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c&lt;l.length;++c)n[l[c]]!=null&amp;&amp;(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&amp;&amp;Object.hasOwnProperty.call(l,&quot;offset&quot;)&amp;&amp;c.uint32(8).sint32(l.offset),l.bucketCounts!=null&amp;&amp;l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u&lt;l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos&lt;u;){var _=l.uint32();switch(_&gt;&gt;&gt;3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&amp;&amp;f.bucketCounts.length||(f.bucketCounts=[]),(_&amp;7)===2)for(var m=l.uint32()+l.pos;l.pos&lt;m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&amp;7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!=&quot;object&quot;||l===null)return&quot;object expected&quot;;if(l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;!h.isInteger(l.offset))return&quot;offset: integer expected&quot;;if(l.bucketCounts!=null&amp;&amp;l.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(l.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&amp;&amp;!(l.bucketCounts[c]&amp;&amp;h.isInteger(l.bucketCounts[c].low)&amp;&amp;h.isInteger(l.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&amp;&amp;(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected&quot;);c.bucketCounts=[];for(var u=0;u&lt;l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]==&quot;string&quot;?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]==&quot;number&quot;?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]==&quot;object&quot;&amp;&amp;(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low&gt;&gt;&gt;0,l.bucketCounts[u].high&gt;&gt;&gt;0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&amp;&amp;(u.bucketCounts=[]),c.defaults&amp;&amp;(u.offset=0),l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;(u.offset=l.offset),l.bucketCounts&amp;&amp;l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f&lt;l.bucketCounts.length;++f)typeof l.bucketCounts[f]==&quot;number&quot;?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low&gt;&gt;&gt;0,l.bucketCounts[f].high&gt;&gt;&gt;0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&amp;&amp;(l=&quot;type.googleapis.com&quot;),l+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets&quot;},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;count&quot;)&amp;&amp;n.uint32(33).fixed64(i.count),i.sum!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;sum&quot;)&amp;&amp;n.uint32(41).double(i.sum),i.quantileValues!=null&amp;&amp;i.quantileValues.length)for(var l=0;l&lt;i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 7:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&amp;&amp;c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(i.count)&amp;&amp;!(i.count&amp;&amp;h.isInteger(i.count.low)&amp;&amp;h.isInteger(i.count.high)))return&quot;count: integer|Long expected&quot;;if(i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;typeof i.sum!=&quot;number&quot;)return&quot;sum: number expected&quot;;if(i.quantileValues!=null&amp;&amp;i.hasOwnProperty(&quot;quantileValues&quot;)){if(!Array.isArray(i.quantileValues))return&quot;quantileValues: array expected&quot;;for(var n=0;n&lt;i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return&quot;quantileValues.&quot;+l}}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.count!=null&amp;&amp;(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count==&quot;string&quot;?n.count=parseInt(i.count,10):typeof i.count==&quot;number&quot;?n.count=i.count:typeof i.count==&quot;object&quot;&amp;&amp;(n.count=new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber())),i.sum!=null&amp;&amp;(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected&quot;);n.quantileValues=[];for(var l=0;l&lt;i.quantileValues.length;++l){if(typeof i.quantileValues[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected&quot;);n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?&quot;0&quot;:0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof i.count==&quot;number&quot;?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber():i.count),i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l.sum=n.json&amp;&amp;!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&amp;&amp;i.quantileValues.length){l.quantileValues=[];for(var u=0;u&lt;i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint&quot;},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;quantile&quot;)&amp;&amp;l.uint32(9).double(n.quantile),n.value!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;value&quot;)&amp;&amp;l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;typeof n.quantile!=&quot;number&quot;?&quot;quantile: number expected&quot;:n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;typeof n.value!=&quot;number&quot;?&quot;value: number expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&amp;&amp;(l.quantile=Number(n.quantile)),n.value!=null&amp;&amp;(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.quantile=0,c.value=0),n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;(c.quantile=l.json&amp;&amp;!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;(c.value=l.json&amp;&amp;!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile&quot;},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(25).double(n.asDouble),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(34).bytes(n.spanId),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(42).bytes(n.traceId),n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&amp;&amp;n.filteredAttributes.length)for(var c=0;c&lt;n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.filteredAttributes&amp;&amp;u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.filteredAttributes!=null&amp;&amp;n.hasOwnProperty(&quot;filteredAttributes&quot;)){if(!Array.isArray(n.filteredAttributes))return&quot;filteredAttributes: array expected&quot;;for(var c=0;c&lt;n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return&quot;filteredAttributes.&quot;+u}}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}return n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId))?&quot;spanId: buffer expected&quot;:n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId))?&quot;traceId: buffer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected&quot;);l.filteredAttributes=[];for(var c=0;c&lt;n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected&quot;);l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.filteredAttributes&amp;&amp;n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f&lt;n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Exemplar&quot;},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&amp;&amp;i.resourceLogs.length)for(var l=0;l&lt;i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceLogs&amp;&amp;c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceLogs!=null&amp;&amp;i.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(i.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var n=0;n&lt;i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return&quot;resourceLogs.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected&quot;);n.resourceLogs=[];for(var l=0;l&lt;i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected&quot;);n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceLogs=[]),i.resourceLogs&amp;&amp;i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c&lt;i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogsData&quot;},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&amp;&amp;i.scopeLogs.length)for(var l=0;l&lt;i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&amp;&amp;c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeLogs!=null&amp;&amp;i.hasOwnProperty(&quot;scopeLogs&quot;)){if(!Array.isArray(i.scopeLogs))return&quot;scopeLogs: array expected&quot;;for(var l=0;l&lt;i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return&quot;scopeLogs.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected&quot;);n.scopeLogs=[];for(var l=0;l&lt;i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected&quot;);n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeLogs=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&amp;&amp;i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c&lt;i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ResourceLogs&quot;},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&amp;&amp;i.logRecords.length)for(var l=0;l&lt;i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&amp;&amp;c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.logRecords!=null&amp;&amp;i.hasOwnProperty(&quot;logRecords&quot;)){if(!Array.isArray(i.logRecords))return&quot;logRecords: array expected&quot;;for(var l=0;l&lt;i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return&quot;logRecords.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected&quot;);n.logRecords=[];for(var l=0;l&lt;i.logRecords.length;++l){if(typeof i.logRecords[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected&quot;);n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.logRecords=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&amp;&amp;i.logRecords.length){l.logRecords=[];for(var c=0;c&lt;i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ScopeLogs&quot;},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;]=0,a[s[1]=&quot;SEVERITY_NUMBER_TRACE&quot;]=1,a[s[2]=&quot;SEVERITY_NUMBER_TRACE2&quot;]=2,a[s[3]=&quot;SEVERITY_NUMBER_TRACE3&quot;]=3,a[s[4]=&quot;SEVERITY_NUMBER_TRACE4&quot;]=4,a[s[5]=&quot;SEVERITY_NUMBER_DEBUG&quot;]=5,a[s[6]=&quot;SEVERITY_NUMBER_DEBUG2&quot;]=6,a[s[7]=&quot;SEVERITY_NUMBER_DEBUG3&quot;]=7,a[s[8]=&quot;SEVERITY_NUMBER_DEBUG4&quot;]=8,a[s[9]=&quot;SEVERITY_NUMBER_INFO&quot;]=9,a[s[10]=&quot;SEVERITY_NUMBER_INFO2&quot;]=10,a[s[11]=&quot;SEVERITY_NUMBER_INFO3&quot;]=11,a[s[12]=&quot;SEVERITY_NUMBER_INFO4&quot;]=12,a[s[13]=&quot;SEVERITY_NUMBER_WARN&quot;]=13,a[s[14]=&quot;SEVERITY_NUMBER_WARN2&quot;]=14,a[s[15]=&quot;SEVERITY_NUMBER_WARN3&quot;]=15,a[s[16]=&quot;SEVERITY_NUMBER_WARN4&quot;]=16,a[s[17]=&quot;SEVERITY_NUMBER_ERROR&quot;]=17,a[s[18]=&quot;SEVERITY_NUMBER_ERROR2&quot;]=18,a[s[19]=&quot;SEVERITY_NUMBER_ERROR3&quot;]=19,a[s[20]=&quot;SEVERITY_NUMBER_ERROR4&quot;]=20,a[s[21]=&quot;SEVERITY_NUMBER_FATAL&quot;]=21,a[s[22]=&quot;SEVERITY_NUMBER_FATAL2&quot;]=22,a[s[23]=&quot;SEVERITY_NUMBER_FATAL3&quot;]=23,a[s[24]=&quot;SEVERITY_NUMBER_FATAL4&quot;]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;LOG_RECORD_FLAGS_DO_NOT_USE&quot;]=0,a[s[255]=&quot;LOG_RECORD_FLAGS_TRACE_FLAGS_MASK&quot;]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityNumber&quot;)&amp;&amp;n.uint32(16).int32(i.severityNumber),i.severityText!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityText&quot;)&amp;&amp;n.uint32(26).string(i.severityText),i.body!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;body&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(69).fixed32(i.flags),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(74).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;observedTimeUnixNano&quot;)&amp;&amp;n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.observedTimeUnixNano)&amp;&amp;!(i.observedTimeUnixNano&amp;&amp;h.isInteger(i.observedTimeUnixNano.low)&amp;&amp;h.isInteger(i.observedTimeUnixNano.high)))return&quot;observedTimeUnixNano: integer|Long expected&quot;;if(i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;))switch(i.severityNumber){default:return&quot;severityNumber: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;!h.isString(i.severityText))return&quot;severityText: string expected&quot;;if(i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return&quot;body.&quot;+n}if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return&quot;attributes.&quot;+n}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId))?&quot;traceId: buffer expected&quot;:i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId))?&quot;spanId: buffer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.observedTimeUnixNano!=null&amp;&amp;(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano==&quot;string&quot;?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano==&quot;number&quot;?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano==&quot;object&quot;&amp;&amp;(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber==&quot;number&quot;){n.severityNumber=i.severityNumber;break}break;case&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:case 0:n.severityNumber=0;break;case&quot;SEVERITY_NUMBER_TRACE&quot;:case 1:n.severityNumber=1;break;case&quot;SEVERITY_NUMBER_TRACE2&quot;:case 2:n.severityNumber=2;break;case&quot;SEVERITY_NUMBER_TRACE3&quot;:case 3:n.severityNumber=3;break;case&quot;SEVERITY_NUMBER_TRACE4&quot;:case 4:n.severityNumber=4;break;case&quot;SEVERITY_NUMBER_DEBUG&quot;:case 5:n.severityNumber=5;break;case&quot;SEVERITY_NUMBER_DEBUG2&quot;:case 6:n.severityNumber=6;break;case&quot;SEVERITY_NUMBER_DEBUG3&quot;:case 7:n.severityNumber=7;break;case&quot;SEVERITY_NUMBER_DEBUG4&quot;:case 8:n.severityNumber=8;break;case&quot;SEVERITY_NUMBER_INFO&quot;:case 9:n.severityNumber=9;break;case&quot;SEVERITY_NUMBER_INFO2&quot;:case 10:n.severityNumber=10;break;case&quot;SEVERITY_NUMBER_INFO3&quot;:case 11:n.severityNumber=11;break;case&quot;SEVERITY_NUMBER_INFO4&quot;:case 12:n.severityNumber=12;break;case&quot;SEVERITY_NUMBER_WARN&quot;:case 13:n.severityNumber=13;break;case&quot;SEVERITY_NUMBER_WARN2&quot;:case 14:n.severityNumber=14;break;case&quot;SEVERITY_NUMBER_WARN3&quot;:case 15:n.severityNumber=15;break;case&quot;SEVERITY_NUMBER_WARN4&quot;:case 16:n.severityNumber=16;break;case&quot;SEVERITY_NUMBER_ERROR&quot;:case 17:n.severityNumber=17;break;case&quot;SEVERITY_NUMBER_ERROR2&quot;:case 18:n.severityNumber=18;break;case&quot;SEVERITY_NUMBER_ERROR3&quot;:case 19:n.severityNumber=19;break;case&quot;SEVERITY_NUMBER_ERROR4&quot;:case 20:n.severityNumber=20;break;case&quot;SEVERITY_NUMBER_FATAL&quot;:case 21:n.severityNumber=21;break;case&quot;SEVERITY_NUMBER_FATAL2&quot;:case 22:n.severityNumber=22;break;case&quot;SEVERITY_NUMBER_FATAL3&quot;:case 23:n.severityNumber=23;break;case&quot;SEVERITY_NUMBER_FATAL4&quot;:case 24:n.severityNumber=24;break}if(i.severityText!=null&amp;&amp;(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.body: object expected&quot;);n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(l.severityNumber=n.enums===String?&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:0,l.severityText=&quot;&quot;,l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?&quot;0&quot;:0}if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;)&amp;&amp;(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;(l.severityText=i.severityText),i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)&amp;&amp;(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;(typeof i.observedTimeUnixNano==&quot;number&quot;?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogRecord&quot;},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=&gt;{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=&gt;{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=&gt;gle.decode(r)},QG={serializeRequest:r=&gt;{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=&gt;yle.decode(r)},Rh={serializeRequest:r=&gt;{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=&gt;Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=&gt;{_h();Eh();mh();Nh={serializeRequest:r=&gt;{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=&gt;{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=&gt;{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=&gt;fh,JsonLogsSerializer:()=&gt;Ch,JsonMetricsSerializer:()=&gt;e3,JsonTraceSerializer:()=&gt;Nh,ProtobufLogsSerializer:()=&gt;Ah,ProtobufMetricsSerializer:()=&gt;QG,ProtobufTraceSerializer:()=&gt;Rh,createExportLogsServiceRequest:()=&gt;Xs,createExportMetricsServiceRequest:()=&gt;$s,createExportTraceServiceRequest:()=&gt;Ks,encodeAsLongBits:()=&gt;uh,encodeAsString:()=&gt;jg,getOtlpEncoder:()=&gt;Kn,hrTimeToNanos:()=&gt;ch,toLongBits:()=&gt;qg});var to=p(()=&gt;{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=&gt;{r3=&quot;0.56.0&quot;});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e&gt;0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t&gt;=0?t:0}}var s3=p(()=&gt;{});var c3={};Ae(c3,{compressAndSend:()=&gt;l3,createHttpAgent:()=&gt;Ile,sendWithHttp:()=&gt;Cle});import*as Ph from&quot;http&quot;;import*as Ih from&quot;https&quot;;import*as a3 from&quot;zlib&quot;;import{Readable as Nle}from&quot;stream&quot;;function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(&quot;.&quot;)[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:&quot;POST&quot;,headers:lv({},r.headers()),agent:e},l=a.protocol===&quot;http:&quot;?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on(&quot;data&quot;,function(m){return _.push(m)}),f.on(&quot;end&quot;,function(){if(f.statusCode&amp;&amp;f.statusCode&lt;299)o({status:&quot;success&quot;,data:Buffer.concat(_)});else if(f.statusCode&amp;&amp;i3(f.statusCode))o({status:&quot;retryable&quot;,retryInMillis:o3(f.headers[&quot;retry-after&quot;])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:&quot;failure&quot;,error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:&quot;failure&quot;,error:new Error(&quot;Request Timeout&quot;)})}),c.on(&quot;error&quot;,function(f){o({status:&quot;failure&quot;,error:f})});var u=i&gt;=14?&quot;close&quot;:&quot;abort&quot;;c.on(u,function(){o({status:&quot;failure&quot;,error:new Error(&quot;Request timed out&quot;)})}),l3(c,r.compression,t,function(f){o({status:&quot;failure&quot;,error:f})})}function l3(r,e,t,o){var s=Ple(t);e===&quot;gzip&quot;&amp;&amp;(r.setHeader(&quot;Content-Encoding&quot;,&quot;gzip&quot;),s=s.on(&quot;error&quot;,o).pipe(a3.createGzip()).on(&quot;error&quot;,o)),s.pipe(r).on(&quot;error&quot;,o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol===&quot;http:&quot;?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=&gt;{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=&gt;{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&amp;&amp;(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=&gt;{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status===&quot;retryable&quot;&amp;&amp;i&gt;0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&amp;&amp;o!==void 0?o:l,u=s-Date.now(),c&gt;u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=&gt;{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&amp;&amp;t!==&quot;&quot;){var o=Number(t);if(!Number.isNaN(o)&amp;&amp;Number.isFinite(o)&amp;&amp;o&gt;0)return o;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected number greater than 0 (actual: &quot;+t+&quot;)&quot;)}}function Gle(r){var e=m3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_TIMEOUT&quot;),t=m3(&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;);return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==&quot;&quot;){if(t==null||t===&quot;none&quot;||t===&quot;gzip&quot;)return t;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected &#x27;none&#x27; or &#x27;gzip&#x27; (actual: &#x27;&quot;+t+&quot;&#x27;)&quot;)}}function Hle(r){var e=T3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_COMPRESSION&quot;),t=T3(&quot;OTEL_EXPORTER_OTLP_COMPRESSION&quot;);return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=&gt;{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&amp;&amp;e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i&lt;&quot;u&quot;?t[a]=String(i):S.warn(&#x27;Header &quot;&#x27;+a+&#x27;&quot; has invalid value (&#x27;+i+&quot;) and will be ignored&quot;)}),t}}var qle,g3=p(()=&gt;{P();qle=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&amp;&amp;Object.assign(s,e()),r!=null&amp;&amp;Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error(&quot;Configuration: Could not parse user-provided export URL: &#x27;&quot;+r+&quot;&#x27;&quot;)}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&amp;&amp;a!==void 0?a:e.agentOptions)!==null&amp;&amp;i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:&quot;http://localhost:4318/&quot;+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=&gt;{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_HEADERS&quot;])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}}function $le(r,e){try{new URL(r)}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}r.endsWith(&quot;/&quot;)||(r=r+&quot;/&quot;),r+=e;try{new URL(r)}catch{S.warn(&quot;Configuration: Provided URL appended with &#x27;&quot;+e+&quot;&#x27; is not a valid URL, using &#x27;undefined&#x27; instead of &#x27;&quot;+r+&quot;&#x27;&quot;);return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return $le(t,r)}function Wle(r){var e,t=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_ENDPOINT&quot;])===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&amp;&amp;t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=&gt;{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&amp;&amp;(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&amp;&amp;(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&amp;&amp;S.warn(&quot;Metadata cannot be set when using http&quot;),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=&gt;{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=&gt;qr,createOtlpHttpExportDelegate:()=&gt;Hr,getSharedConfigurationFromEnvironment:()=&gt;bh});var Js=p(()=&gt;{E3();cv();N3()});var Qs,P3=p(()=&gt;{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${r3}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Ch))}}});var I3=p(()=&gt;{P3()});var b3=p(()=&gt;{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=&gt;Qs});var x3=p(()=&gt;{b3()});var ue=T(tr=&gt;{&quot;use strict&quot;;Object.defineProperty(tr,&quot;__esModule&quot;,{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]=&quot;OK&quot;,r[r.CANCELLED=1]=&quot;CANCELLED&quot;,r[r.UNKNOWN=2]=&quot;UNKNOWN&quot;,r[r.INVALID_ARGUMENT=3]=&quot;INVALID_ARGUMENT&quot;,r[r.DEADLINE_EXCEEDED=4]=&quot;DEADLINE_EXCEEDED&quot;,r[r.NOT_FOUND=5]=&quot;NOT_FOUND&quot;,r[r.ALREADY_EXISTS=6]=&quot;ALREADY_EXISTS&quot;,r[r.PERMISSION_DENIED=7]=&quot;PERMISSION_DENIED&quot;,r[r.RESOURCE_EXHAUSTED=8]=&quot;RESOURCE_EXHAUSTED&quot;,r[r.FAILED_PRECONDITION=9]=&quot;FAILED_PRECONDITION&quot;,r[r.ABORTED=10]=&quot;ABORTED&quot;,r[r.OUT_OF_RANGE=11]=&quot;OUT_OF_RANGE&quot;,r[r.UNIMPLEMENTED=12]=&quot;UNIMPLEMENTED&quot;,r[r.INTERNAL=13]=&quot;INTERNAL&quot;,r[r.UNAVAILABLE=14]=&quot;UNAVAILABLE&quot;,r[r.DATA_LOSS=15]=&quot;DATA_LOSS&quot;,r[r.UNAUTHENTICATED=16]=&quot;UNAUTHENTICATED&quot;})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]=&quot;DEBUG&quot;,r[r.INFO=1]=&quot;INFO&quot;,r[r.ERROR=2]=&quot;ERROR&quot;,r[r.NONE=3]=&quot;NONE&quot;})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]=&quot;DEADLINE&quot;,r[r.CENSUS_STATS_CONTEXT=2]=&quot;CENSUS_STATS_CONTEXT&quot;,r[r.CENSUS_TRACING_CONTEXT=4]=&quot;CENSUS_TRACING_CONTEXT&quot;,r[r.CANCELLATION=8]=&quot;CANCELLATION&quot;,r[r.DEFAULTS=65535]=&quot;DEFAULTS&quot;})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=&gt;{Qle.exports={name:&quot;@grpc/grpc-js&quot;,version:&quot;1.13.4&quot;,description:&quot;gRPC Library for Node - pure JS implementation&quot;,homepage:&quot;https://grpc.io/&quot;,repository:&quot;https://github.com/grpc/grpc-node/tree/master/packages/grpc-js&quot;,main:&quot;build/src/index.js&quot;,engines:{node:&quot;&gt;=12.10.0&quot;},keywords:[],author:{name:&quot;Google Inc.&quot;},types:&quot;build/src/index.d.ts&quot;,license:&quot;Apache-2.0&quot;,devDependencies:{&quot;@grpc/proto-loader&quot;:&quot;file:../proto-loader&quot;,&quot;@types/gulp&quot;:&quot;^4.0.17&quot;,&quot;@types/gulp-mocha&quot;:&quot;0.0.37&quot;,&quot;@types/lodash&quot;:&quot;^4.14.202&quot;,&quot;@types/mocha&quot;:&quot;^10.0.6&quot;,&quot;@types/ncp&quot;:&quot;^2.0.8&quot;,&quot;@types/node&quot;:&quot;&gt;=20.11.20&quot;,&quot;@types/pify&quot;:&quot;^5.0.4&quot;,&quot;@types/semver&quot;:&quot;^7.5.8&quot;,&quot;@typescript-eslint/eslint-plugin&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/parser&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/typescript-estree&quot;:&quot;^7.1.0&quot;,&quot;clang-format&quot;:&quot;^1.8.0&quot;,eslint:&quot;^8.42.0&quot;,&quot;eslint-config-prettier&quot;:&quot;^8.8.0&quot;,&quot;eslint-plugin-node&quot;:&quot;^11.1.0&quot;,&quot;eslint-plugin-prettier&quot;:&quot;^4.2.1&quot;,execa:&quot;^2.0.3&quot;,gulp:&quot;^4.0.2&quot;,&quot;gulp-mocha&quot;:&quot;^6.0.0&quot;,lodash:&quot;^4.17.21&quot;,madge:&quot;^5.0.1&quot;,&quot;mocha-jenkins-reporter&quot;:&quot;^0.4.1&quot;,ncp:&quot;^2.0.0&quot;,pify:&quot;^4.0.1&quot;,prettier:&quot;^2.8.8&quot;,rimraf:&quot;^3.0.2&quot;,semver:&quot;^7.6.0&quot;,&quot;ts-node&quot;:&quot;^10.9.2&quot;,typescript:&quot;^5.3.3&quot;},contributors:[{name:&quot;Google Inc.&quot;}],scripts:{build:&quot;npm run compile&quot;,clean:&quot;rimraf ./build&quot;,compile:&quot;tsc -p .&quot;,format:&#x27;clang-format -i -style=&quot;{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}&quot; src/*.ts test/*.ts&#x27;,lint:&quot;eslint src/*.ts test/*.ts&quot;,prepare:&quot;npm run generate-types &amp;&amp; npm run compile&quot;,test:&quot;gulp test&quot;,check:&quot;npm run lint&quot;,fix:&quot;eslint --fix src/*.ts test/*.ts&quot;,pretest:&quot;npm run generate-types &amp;&amp; npm run generate-test-types &amp;&amp; npm run compile&quot;,posttest:&quot;npm run check &amp;&amp; madge -c ./build/src&quot;,&quot;generate-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto&quot;,&quot;generate-test-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto&quot;},dependencies:{&quot;@grpc/proto-loader&quot;:&quot;^0.7.13&quot;,&quot;@js-sdsl/ordered-map&quot;:&quot;^4.4.2&quot;},files:[&quot;src/**/*.ts&quot;,&quot;build/src/**/*.{js,d.ts,js.map}&quot;,&quot;proto/*.proto&quot;,&quot;LICENSE&quot;,&quot;deps/envoy-api/envoy/api/v2/**/*.proto&quot;,&quot;deps/envoy-api/envoy/config/**/*.proto&quot;,&quot;deps/envoy-api/envoy/service/**/*.proto&quot;,&quot;deps/envoy-api/envoy/type/**/*.proto&quot;,&quot;deps/udpa/udpa/**/*.proto&quot;,&quot;deps/googleapis/google/api/*.proto&quot;,&quot;deps/googleapis/google/rpc/*.proto&quot;,&quot;deps/protoc-gen-validate/validate/**/*.proto&quot;]}});var Pe=T(Bt=&gt;{&quot;use strict&quot;;var fv,pv,dv,hv;Object.defineProperty(Bt,&quot;__esModule&quot;,{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V(&quot;process&quot;),ece=uv().version,tce={error:(r,...e)=&gt;{console.error(&quot;E &quot;+r,...e)},info:(r,...e)=&gt;{console.error(&quot;I &quot;+r,...e)},debug:(r,...e)=&gt;{console.error(&quot;D &quot;+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&amp;&amp;fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&amp;&amp;pv!==void 0?pv:&quot;&quot;;switch(rce.toUpperCase()){case&quot;DEBUG&quot;:Zs=Wn.LogVerbosity.DEBUG;break;case&quot;INFO&quot;:Zs=Wn.LogVerbosity.INFO;break;case&quot;ERROR&quot;:Zs=Wn.LogVerbosity.ERROR;break;case&quot;NONE&quot;:Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=&gt;no;Bt.getLogger=nce;var ice=r=&gt;{no=r};Bt.setLogger=ice;var oce=r=&gt;{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=&gt;{let t;if(r&gt;=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&amp;&amp;t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&amp;&amp;dv!==void 0?dv:process.env.GRPC_TRACE)!==null&amp;&amp;hv!==void 0?hv:&quot;&quot;,_v=new Set,U3=new Set;for(let r of ace.split(&quot;,&quot;))r.startsWith(&quot;-&quot;)?U3.add(r.substring(1)):_v.add(r);var lce=_v.has(&quot;all&quot;);function cce(r,e,t){k3(e)&amp;&amp;(0,Bt.log)(r,new Date().toISOString()+&quot; | v&quot;+ece+&quot; &quot;+Zle.pid+&quot; | &quot;+e+&quot; | &quot;+t)}function k3(r){return!U3.has(r)&amp;&amp;(lce||_v.has(r))}});var Mh=T(xh=&gt;{&quot;use strict&quot;;Object.defineProperty(xh,&quot;__esModule&quot;,{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r==&quot;object&quot;&amp;&amp;r!==null&amp;&amp;&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;?r.code:null}});var ht=T(Dh=&gt;{&quot;use strict&quot;;Object.defineProperty(Dh,&quot;__esModule&quot;,{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith(&quot;-bin&quot;)}function Sce(r){return!r.startsWith(&quot;grpc-&quot;)}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error(&#x27;Metadata key &quot;&#x27;+r+&#x27;&quot; contains illegal characters&#x27;);if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error(&quot;keys that end with &#x27;-bin&#x27; must have Buffer values&quot;)}else{if(Buffer.isBuffer(e))throw new Error(&quot;keys that don&#x27;t end with &#x27;-bin&#x27; must have String values&quot;);if(!Tce(e))throw new Error(&#x27;Metadata string value &quot;&#x27;+e+&#x27;&quot; contains illegal characters&#x27;)}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length&gt;0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=&gt;Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===&quot;:&quot;)continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=&gt;{t.add(o,Buffer.from(a,&quot;base64&quot;))}):s!==void 0&amp;&amp;(Sce(o)?s.split(&quot;,&quot;).forEach(a=&gt;{t.add(o,Buffer.from(a.trim(),&quot;base64&quot;))}):t.add(o,Buffer.from(s,&quot;base64&quot;))):Array.isArray(s)?s.forEach(a=&gt;{t.add(o,a)}):s!==void 0&amp;&amp;t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=&gt;Buffer.isBuffer(r)?r.toString(&quot;base64&quot;):r});var kh=T(Uh=&gt;{&quot;use strict&quot;;Object.defineProperty(Uh,&quot;__esModule&quot;,{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return&quot;getRequestHeaders&quot;in r&amp;&amp;typeof r.getRequestHeaders==&quot;function&quot;}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=&gt;{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=&gt;{e.getRequestMetadata(t.service_url,(n,l)=&gt;{if(n){i(n);return}if(!l){i(new Error(&quot;Headers not set by metadata plugin&quot;));return}a(l)})}),s.then(a=&gt;{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=&gt;{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=&gt;s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=&gt;t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=&gt;{this.metadataGenerator(e,(s,a)=&gt;{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=&gt;{&quot;use strict&quot;;Object.defineProperty(gc,&quot;__esModule&quot;,{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V(&quot;fs&quot;);gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&amp;&amp;(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=&gt;{&quot;use strict&quot;;Object.defineProperty(ta,&quot;__esModule&quot;,{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith(&quot;[&quot;)){let e=r.indexOf(&quot;]&quot;);if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(&quot;:&quot;)===-1)return null;if(r.length&gt;e+1)if(r[e+1]===&quot;:&quot;){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(&quot;:&quot;);return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(&quot;:&quot;)?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e=&quot;&quot;;return r.scheme!==void 0&amp;&amp;(e+=r.scheme+&quot;:&quot;),r.authority!==void 0&amp;&amp;(e+=&quot;//&quot;+r.authority+&quot;/&quot;),e+=r.path,e}});var jr=T(io=&gt;{&quot;use strict&quot;;Object.defineProperty(io,&quot;__esModule&quot;,{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=&gt;{&quot;use strict&quot;;Object.defineProperty(yc,&quot;__esModule&quot;,{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V(&quot;tls&quot;),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&amp;&amp;!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,&quot;Root certificate&quot;),Rv(t,&quot;Private key&quot;),Rv(o,&quot;Certificate chain&quot;),t&amp;&amp;!o)throw new Error(&quot;Private key must be given with accompanying certificate chain&quot;);if(!t&amp;&amp;o)throw new Error(&quot;Certificate chain must be given with accompanying private key&quot;);let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&amp;&amp;a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error(&quot;Cannot compose insecure credentials&quot;)}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=&gt;Promise.resolve(),getCallCredentials:()=&gt;o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if(&quot;grpc.http_connect_target&quot;in o){let f=(0,H3.parseUri)(o[&quot;grpc.http_connect_target&quot;]);f&amp;&amp;(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&amp;&amp;s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&amp;&amp;(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&amp;&amp;(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=[&quot;h2&quot;],o[&quot;grpc.ssl_target_name_override&quot;]){let f=o[&quot;grpc.ssl_target_name_override&quot;],_=(a=i.checkServerIdentity)!==null&amp;&amp;a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=&gt;_(f,O),i.servername=f}else i.servername=u;return o[&quot;grpc-node.tls_enable_trace&quot;]&amp;&amp;(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=&gt;{let a=(0,vc.connect)(t,()=&gt;{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&amp;&amp;i!==void 0)||i)&amp;&amp;!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on(&quot;error&quot;,i=&gt;{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&amp;&amp;this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&amp;&amp;(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&amp;&amp;(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&amp;&amp;this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=&gt;{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&amp;&amp;!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,&quot;Failed to createSecureContext with error &quot;+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=&gt;{let o=this.parent.getLatestSecureContext();if(!o){t(new Error(&quot;Failed to load credentials&quot;));return}r.closed&amp;&amp;t(new Error(&quot;Socket closed while loading credentials&quot;));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=&gt;{t(new Error(&quot;Socket closed&quot;))},n=c=&gt;{t(c)},l=(0,vc.connect)(a,()=&gt;{var c;if(l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&amp;&amp;c!==void 0)||c)&amp;&amp;!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error(&quot;Cannot compose insecure credentials&quot;)}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&amp;&amp;this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=&gt;{&quot;use strict&quot;;Object.defineProperty(Yr,&quot;__esModule&quot;,{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&amp;&amp;o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&amp;&amp;a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&amp;&amp;n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&amp;&amp;c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&amp;&amp;f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error(&quot;Provided load balancing config has multiple conflicting entries&quot;);let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error(&quot;No default load balancer type registered&quot;);return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,&quot;Config parsing failed with error&quot;,o.message);continue}return e&amp;&amp;Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=&gt;{&quot;use strict&quot;;Object.defineProperty(Rc,&quot;__esModule&quot;,{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V(&quot;os&quot;),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce=&quot;node&quot;;function Xce(r){if(&quot;service&quot;in r&amp;&amp;r.service!==&quot;&quot;){if(typeof r.service!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if(&quot;method&quot;in r&amp;&amp;r.method!==&quot;&quot;){if(typeof r.method!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if(&quot;method&quot;in r&amp;&amp;r.method!==void 0)throw new Error(&quot;Invalid method config name: method set with empty or unset service&quot;);return{}}}function Wce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config retry policy: maxAttempts must be an integer at least 2&quot;);if(!(&quot;initialBackoff&quot;in r)||typeof r.initialBackoff!=&quot;string&quot;||!Hh.test(r.initialBackoff))throw new Error(&quot;Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;maxBackoff&quot;in r)||typeof r.maxBackoff!=&quot;string&quot;||!Hh.test(r.maxBackoff))throw new Error(&quot;Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;backoffMultiplier&quot;in r)||typeof r.backoffMultiplier!=&quot;number&quot;||r.backoffMultiplier&lt;=0)throw new Error(&quot;Invalid method config retry policy: backoffMultiplier must be a number greater than 0&quot;);if(!(&quot;retryableStatusCodes&quot;in r&amp;&amp;Array.isArray(r.retryableStatusCodes)))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes is required&quot;);if(r.retryableStatusCodes.length===0)throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes must be non-empty&quot;);for(let e of r.retryableStatusCodes)if(typeof e==&quot;number&quot;){if(!Object.values(Gh.Status).includes(e))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not in status code range&quot;)}else if(typeof e==&quot;string&quot;){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value must be a string or number&quot;);return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config hedging policy: maxAttempts must be an integer at least 2&quot;);if(&quot;hedgingDelay&quot;in r&amp;&amp;(typeof r.hedgingDelay!=&quot;string&quot;||!Hh.test(r.hedgingDelay)))throw new Error(&quot;Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s&quot;);if(&quot;nonFatalStatusCodes&quot;in r&amp;&amp;Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t==&quot;number&quot;){if(!Object.values(Gh.Status).includes(t))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not in status code range&quot;)}else if(typeof t==&quot;string&quot;){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number&quot;);let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&amp;&amp;(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&amp;&amp;(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!(&quot;name&quot;in r)||!Array.isArray(r.name))throw new Error(&quot;Invalid method config: invalid name array&quot;);for(let o of r.name)t.name.push(Xce(o));if(&quot;waitForReady&quot;in r){if(typeof r.waitForReady!=&quot;boolean&quot;)throw new Error(&quot;Invalid method config: invalid waitForReady&quot;);t.waitForReady=r.waitForReady}if(&quot;timeout&quot;in r)if(typeof r.timeout==&quot;object&quot;){if(!(&quot;seconds&quot;in r.timeout)||typeof r.timeout.seconds!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.seconds&quot;);if(!(&quot;nanos&quot;in r.timeout)||typeof r.timeout.nanos!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.nanos&quot;);t.timeout=r.timeout}else if(typeof r.timeout==&quot;string&quot;&amp;&amp;Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(&quot;.&quot;);t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&amp;&amp;e!==void 0?e:0)|0}}else throw new Error(&quot;Invalid method config: invalid timeout&quot;);if(&quot;maxRequestBytes&quot;in r){if(typeof r.maxRequestBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxRequestBytes=r.maxRequestBytes}if(&quot;maxResponseBytes&quot;in r){if(typeof r.maxResponseBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxResponseBytes=r.maxResponseBytes}if(&quot;retryPolicy&quot;in r){if(&quot;hedgingPolicy&quot;in r)throw new Error(&quot;Invalid method config: retryPolicy and hedgingPolicy cannot both be specified&quot;);t.retryPolicy=Wce(r.retryPolicy)}else&quot;hedgingPolicy&quot;in r&amp;&amp;(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!(&quot;maxTokens&quot;in r)||typeof r.maxTokens!=&quot;number&quot;||r.maxTokens&lt;=0||r.maxTokens&gt;1e3)throw new Error(&quot;Invalid retryThrottling: maxTokens must be a number in (0, 1000]&quot;);if(!(&quot;tokenRatio&quot;in r)||typeof r.tokenRatio!=&quot;number&quot;||r.tokenRatio&lt;=0)throw new Error(&quot;Invalid retryThrottling: tokenRatio must be a number greater than 0&quot;);return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r==&quot;object&quot;&amp;&amp;r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length&gt;1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error(&quot;Invalid loadBalancingConfig: load balancing policy name required&quot;);return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if(&quot;loadBalancingPolicy&quot;in r)if(typeof r.loadBalancingPolicy==&quot;string&quot;)e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error(&quot;Invalid service config: invalid loadBalancingPolicy&quot;);if(&quot;loadBalancingConfig&quot;in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error(&quot;Invalid service config: invalid loadBalancingConfig&quot;);if(&quot;methodConfig&quot;in r&amp;&amp;Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));&quot;retryThrottling&quot;in r&amp;&amp;(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&amp;&amp;s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!(&quot;serviceConfig&quot;in r))throw new Error(&quot;Invalid service config choice: missing service config&quot;);let e={serviceConfig:z3(r.serviceConfig)};if(&quot;clientLanguage&quot;in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o==&quot;string&quot;)e.clientLanguage.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;);if(&quot;clientHostname&quot;in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o==&quot;string&quot;)e.clientHostname.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;);if(&quot;percentage&quot;in r)if(typeof r.percentage==&quot;number&quot;&amp;&amp;0&lt;=r.percentage&amp;&amp;r.percentage&lt;=100)e.percentage=r.percentage;else throw new Error(&quot;Invalid service config choice: invalid percentage&quot;);let t=[&quot;clientLanguage&quot;,&quot;percentage&quot;,&quot;clientHostname&quot;,&quot;serviceConfig&quot;];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error(&quot;Invalid service config list&quot;);for(let t of r){let o=eue(t);if(!(typeof o.percentage==&quot;number&quot;&amp;&amp;e&gt;o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&amp;&amp;(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&amp;&amp;(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error(&quot;No matching service config found&quot;)}function rue(r,e){for(let t of r)if(t.length&gt;0&amp;&amp;t[0].startsWith(&quot;grpc_config=&quot;)){let o=t.join(&quot;&quot;).substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=&gt;{&quot;use strict&quot;;Object.defineProperty(qh,&quot;__esModule&quot;,{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]=&quot;IDLE&quot;,r[r.CONNECTING=1]=&quot;CONNECTING&quot;,r[r.READY=2]=&quot;READY&quot;,r[r.TRANSIENT_FAILURE=3]=&quot;TRANSIENT_FAILURE&quot;,r[r.SHUTDOWN=4]=&quot;SHUTDOWN&quot;})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=&gt;{&quot;use strict&quot;;Object.defineProperty(Qn,&quot;__esModule&quot;,{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]=&quot;COMPLETE&quot;,r[r.QUEUE=1]=&quot;QUEUE&quot;,r[r.TRANSIENT_FAILURE=2]=&quot;TRANSIENT_FAILURE&quot;,r[r.DROP=3]=&quot;DROP&quot;})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:&quot;No connection established&quot;,metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=&gt;{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=&gt;{&quot;use strict&quot;;Object.defineProperty(zh,&quot;__esModule&quot;,{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue=&quot;backoff&quot;,lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&amp;&amp;(t.initialDelay&amp;&amp;(this.initialDelay=t.initialDelay),t.multiplier&amp;&amp;(this.multiplier=t.multiplier),t.jitter&amp;&amp;(this.jitter=t.jitter),t.maxDelay&amp;&amp;(this.maxDelay=t.maxDelay)),this.trace(&quot;constructed initialDelay=&quot;+this.initialDelay+&quot; multiplier=&quot;+this.multiplier+&quot; jitter=&quot;+this.jitter+&quot; maxDelay=&quot;+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=&gt;{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,&quot;{&quot;+this.id+&quot;} &quot;+e)}runTimer(e){var t,o;this.trace(&quot;runTimer(delay=&quot;+e+&quot;)&quot;),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=&gt;{this.trace(&quot;timer fired&quot;),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace(&quot;runOnce()&quot;),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace(&quot;stop()&quot;),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(&quot;reset() running=&quot;+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e&lt;t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=&gt;{&quot;use strict&quot;;Object.defineProperty(Kh,&quot;__esModule&quot;,{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue=&quot;child_load_balancer_helper&quot;,Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&amp;&amp;t!==void 0?t:this.parent.currentChild;this.child===o&amp;&amp;this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&amp;&amp;this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&amp;&amp;(this.currentChild.exitIdle(),this.pendingChild&amp;&amp;this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&amp;&amp;(this.currentChild.resetBackoff(),this.pendingChild&amp;&amp;this.pendingChild.resetBackoff())}destroy(){this.currentChild&amp;&amp;(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&amp;&amp;(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=&gt;{&quot;use strict&quot;;Object.defineProperty(Xh,&quot;__esModule&quot;,{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue=&quot;resolving_load_balancer&quot;;function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=[&quot;SERVICE_AND_METHOD&quot;,&quot;SERVICE&quot;,&quot;EMPTY&quot;];function Cue(r,e,t,o){for(let s of t.name)switch(o){case&quot;EMPTY&quot;:if(!s.service&amp;&amp;!s.method)return!0;break;case&quot;SERVICE&quot;:if(s.service===r&amp;&amp;!s.method)return!0;break;case&quot;SERVICE_AND_METHOD&quot;:if(s.service===r&amp;&amp;s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split(&quot;/&quot;).filter(l=&gt;l.length&gt;0),i=(o=a[0])!==null&amp;&amp;o!==void 0?o:&quot;&quot;,n=(s=a[1])!==null&amp;&amp;s!==void 0?s:&quot;&quot;;if(r&amp;&amp;r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o[&quot;grpc.service_config&quot;]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o[&quot;grpc.service_config&quot;])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=&gt;{this.backoffTimeout.isRunning()?($3(&quot;requestReresolution delayed by backoff timer until &quot;+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=&gt;{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=&gt;{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&amp;&amp;_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:&quot;All load balancer options in service config are not compatible&quot;,metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=&gt;{this.handleResolutionFailure(n)}},o);let i={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new Sue.BackoffTimeout(()=&gt;{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&amp;&amp;this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+&quot; &quot;+It.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&amp;&amp;(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&amp;&amp;(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&amp;&amp;(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error(&quot;updateAddressList not supported on ResolvingLoadBalancer&quot;)}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return&quot;resolving_load_balancer&quot;}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=&gt;{&quot;use strict&quot;;Object.defineProperty(Pc,&quot;__esModule&quot;,{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={&quot;grpc.ssl_target_name_override&quot;:!0,&quot;grpc.primary_user_agent&quot;:!0,&quot;grpc.secondary_user_agent&quot;:!0,&quot;grpc.default_authority&quot;:!0,&quot;grpc.keepalive_time_ms&quot;:!0,&quot;grpc.keepalive_timeout_ms&quot;:!0,&quot;grpc.keepalive_permit_without_calls&quot;:!0,&quot;grpc.service_config&quot;:!0,&quot;grpc.max_concurrent_streams&quot;:!0,&quot;grpc.initial_reconnect_backoff_ms&quot;:!0,&quot;grpc.max_reconnect_backoff_ms&quot;:!0,&quot;grpc.use_local_subchannel_pool&quot;:!0,&quot;grpc.max_send_message_length&quot;:!0,&quot;grpc.max_receive_message_length&quot;:!0,&quot;grpc.enable_http_proxy&quot;:!0,&quot;grpc.enable_channelz&quot;:!0,&quot;grpc.dns_min_time_between_resolutions_ms&quot;:!0,&quot;grpc.enable_retries&quot;:!0,&quot;grpc.per_rpc_retry_buffer_size&quot;:!0,&quot;grpc.retry_buffer_size&quot;:!0,&quot;grpc.max_connection_age_ms&quot;:!0,&quot;grpc.max_connection_age_grace_ms&quot;:!0,&quot;grpc-node.max_session_memory&quot;:!0,&quot;grpc.service_config_disable_resolution&quot;:!0,&quot;grpc.client_idle_timeout_ms&quot;:!0,&quot;grpc-node.tls_enable_trace&quot;:!0,&quot;grpc.lb.ring_hash.ring_size_cap&quot;:!0,&quot;grpc-node.retry_max_attempts_limit&quot;:!0,&quot;grpc-node.flow_control_window&quot;:!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s&lt;t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=&gt;{&quot;use strict&quot;;Object.defineProperty(gr,&quot;__esModule&quot;,{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V(&quot;net&quot;);function bc(r){return&quot;port&quot;in r}function Wh(r,e){return!r&amp;&amp;!e?!0:!r||!e?!1:bc(r)?bc(e)&amp;&amp;r.host===e.host&amp;&amp;r.port===e.port:!bc(e)&amp;&amp;r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?&quot;[&quot;+r.host+&quot;]:&quot;+r.port:r.host+&quot;:&quot;+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t&lt;r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return&quot;[&quot;+r.addresses.map(Q3).join(&quot;, &quot;)+&quot;]&quot;}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&amp;&amp;(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=&gt;Hue});function na(r,e){if(typeof e!=&quot;function&quot;&amp;&amp;e!==null)throw new TypeError(&quot;Class extends value &quot;+String(e)+&quot; is not a constructor or null&quot;);kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;i&amp;&amp;(i=0,c[0]&amp;&amp;(t=0)),t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError(&quot;Iterator access denied!&quot;)}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=&gt;{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&amp;&amp;(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&amp;&amp;(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&amp;&amp;e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&amp;&amp;(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&amp;&amp;(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&amp;&amp;r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&amp;&amp;(this.O+=this.t.O),this.i&amp;&amp;(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&amp;&amp;(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,&quot;length&quot;,{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&amp;&amp;(t=function(a,i){return a&lt;i?-1:a&gt;i?1:0}),o===void 0&amp;&amp;(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)t=t.i;else if(a&gt;0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)s=t,t=t.i;else if(a&gt;0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&amp;&amp;s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&amp;&amp;s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&amp;&amp;s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&amp;&amp;s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&amp;&amp;(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t==&quot;number&quot;?t:void 0,s=typeof t==&quot;function&quot;?t:void 0,a=typeof t&gt;&quot;u&quot;?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&amp;&amp;a.push(n),s&amp;&amp;s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&amp;&amp;(t.t.h=o),t.i&amp;&amp;(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&amp;&amp;(t.t.h=s),t.i&amp;&amp;(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&amp;&amp;(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n&gt;0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c&lt;0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f&gt;0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m&lt;0&amp;&amp;(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O&gt;0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O&lt;0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s&lt;0)t=t.i;else if(s&gt;0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&amp;&amp;ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)&gt;0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)&lt;0?(s.u=o,!0):!1:this.g(i,o)&gt;=0||this.g(a,o)&lt;=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&amp;&amp;ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&amp;&amp;t.next():(!s||o.t===void 0)&amp;&amp;t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&amp;&amp;ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&amp;&amp;ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,&quot;index&quot;,{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&amp;&amp;(s+=t.t.O);t!==o;){var a=t.h;t===a.i&amp;&amp;(s+=1,a.t&amp;&amp;(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,&quot;pointer&quot;,{get:function(){this.C===this.A&amp;&amp;ao();var t=this;return new Proxy([],{get:function(o,s){return s===&quot;0&quot;?t.C.u:s===&quot;1&quot;?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!==&quot;1&quot;)throw new TypeError(&quot;prop must be 1&quot;);return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&amp;&amp;(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s&lt;t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=&gt;{&quot;use strict&quot;;Object.defineProperty(Jh,&quot;__esModule&quot;,{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=&gt;{&quot;use strict&quot;;Object.defineProperty(vr,&quot;__esModule&quot;,{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V(&quot;events&quot;),Hv=V(&quot;stream&quot;),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=&gt;{&quot;use strict&quot;;Object.defineProperty(xc,&quot;__esModule&quot;,{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&amp;&amp;this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=&gt;{&quot;use strict&quot;;Object.defineProperty(yr,&quot;__esModule&quot;,{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name=&quot;InterceptorConfigurationError&quot;,Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveStatus:(r,e)=&gt;{e(r)}},Mc={start:(r,e,t)=&gt;{t(r,e)},sendMessage:(r,e)=&gt;{e(r)},halfClose:r=&gt;{r()},cancel:r=&gt;{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&amp;&amp;o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&amp;&amp;s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&amp;&amp;a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&amp;&amp;i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=&gt;{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&amp;&amp;(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&amp;&amp;this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(u=&gt;{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&amp;&amp;i!==void 0?i:(u=&gt;{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&amp;&amp;l!==void 0?l:(u=&gt;{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=&gt;{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&amp;&amp;_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&amp;&amp;m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&amp;&amp;O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=&gt;{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&amp;&amp;o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&amp;&amp;s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&amp;&amp;u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=&gt;{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=&gt;{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=&gt;{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(n=&gt;{}),onReceiveMessage:n=&gt;{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=&gt;{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length&gt;0&amp;&amp;r.clientInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(r.callInterceptors.length&gt;0&amp;&amp;r.callInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.&quot;);let s=[];r.callInterceptors.length&gt;0||r.callInterceptorProviders.length&gt;0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=&gt;c=&gt;l(c,n),n=&gt;Wue(o,n,e))(a)}});var Zv=T(t_=&gt;{&quot;use strict&quot;;Object.defineProperty(t_,&quot;__esModule&quot;,{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r==&quot;function&quot;}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||&quot;no stack trace available&quot;}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&amp;&amp;s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&amp;&amp;a!==void 0?a:[],delete o.interceptor_providers,this[oa].length&gt;0&amp;&amp;this[sa].length&gt;0)throw new Error(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=&gt;{if(s){t(new Error(&quot;Failed to connect before the deadline&quot;));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error(&quot;The channel has been closed&quot;));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error(&quot;The channel has been closed&quot;))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&amp;&amp;t instanceof Object&amp;&amp;Jv(o)))throw new Error(&quot;Incorrect arguments passed&quot;);return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&amp;&amp;(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&amp;&amp;l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&amp;&amp;c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=&gt;{m.emit(&quot;metadata&quot;,F)},onReceiveMessage(F){A!==null&amp;&amp;y.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit(&quot;status&quot;,F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=&gt;{_.emit(&quot;metadata&quot;,M)},onReceiveMessage(M){y!==null&amp;&amp;O.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit(&quot;status&quot;,M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit(&quot;metadata&quot;,I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit(&quot;status&quot;,I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&amp;&amp;(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&amp;&amp;i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&amp;&amp;n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit(&quot;metadata&quot;,A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit(&quot;status&quot;,A)}}}),f}};t_.Client=Qv});var ry=T(r_=&gt;{&quot;use strict&quot;;Object.defineProperty(r_,&quot;__esModule&quot;,{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return[&quot;__proto__&quot;,&quot;prototype&quot;,&quot;constructor&quot;].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=&gt;{if(ty(s))return;let a=r[s],i;if(typeof s==&quot;string&quot;&amp;&amp;s.charAt(0)===&quot;$&quot;)throw new Error(&quot;Method names cannot start with $&quot;);a.requestStream?a.responseStream?i=&quot;bidi&quot;:i=&quot;client_stream&quot;:a.responseStream?i=&quot;server_stream&quot;:i=&quot;unary&quot;;let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&amp;&amp;!ty(a.originalName)&amp;&amp;(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return&quot;format&quot;in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(&quot;.&quot;);if(s.some(n=&gt;ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=&gt;{var ife=1/0,ofe=&quot;[object Symbol]&quot;,sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_=&quot;\\ud800-\\udfff&quot;,mH=&quot;\\u0300-\\u036f\\ufe20-\\ufe23&quot;,TH=&quot;\\u20d0-\\u20f0&quot;,SH=&quot;\\u2700-\\u27bf&quot;,gH=&quot;a-z\\xdf-\\xf6\\xf8-\\xff&quot;,lfe=&quot;\\xac\\xb1\\xd7\\xf7&quot;,cfe=&quot;\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf&quot;,ufe=&quot;\\u2000-\\u206f&quot;,ffe=&quot; \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000&quot;,vH=&quot;A-Z\\xc0-\\xd6\\xd8-\\xde&quot;,yH=&quot;\\ufe0e\\ufe0f&quot;,OH=lfe+cfe+ufe+ffe,iy=&quot;[&#x27;\u2019]&quot;,pfe=&quot;[&quot;+i_+&quot;]&quot;,uH=&quot;[&quot;+OH+&quot;]&quot;,n_=&quot;[&quot;+mH+TH+&quot;]&quot;,AH=&quot;\\d+&quot;,dfe=&quot;[&quot;+SH+&quot;]&quot;,RH=&quot;[&quot;+gH+&quot;]&quot;,NH=&quot;[^&quot;+i_+OH+AH+SH+gH+vH+&quot;]&quot;,ny=&quot;\\ud83c[\\udffb-\\udfff]&quot;,hfe=&quot;(?:&quot;+n_+&quot;|&quot;+ny+&quot;)&quot;,CH=&quot;[^&quot;+i_+&quot;]&quot;,oy=&quot;(?:\\ud83c[\\udde6-\\uddff]){2}&quot;,sy=&quot;[\\ud800-\\udbff][\\udc00-\\udfff]&quot;,la=&quot;[&quot;+vH+&quot;]&quot;,PH=&quot;\\u200d&quot;,fH=&quot;(?:&quot;+RH+&quot;|&quot;+NH+&quot;)&quot;,_fe=&quot;(?:&quot;+la+&quot;|&quot;+NH+&quot;)&quot;,pH=&quot;(?:&quot;+iy+&quot;(?:d|ll|m|re|s|t|ve))?&quot;,dH=&quot;(?:&quot;+iy+&quot;(?:D|LL|M|RE|S|T|VE))?&quot;,IH=hfe+&quot;?&quot;,bH=&quot;[&quot;+yH+&quot;]?&quot;,Efe=&quot;(?:&quot;+PH+&quot;(?:&quot;+[CH,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+bH+IH+&quot;)*&quot;,LH=bH+IH+Efe,mfe=&quot;(?:&quot;+[dfe,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+LH,Tfe=&quot;(?:&quot;+[CH+n_+&quot;?&quot;,n_,oy,sy,pfe].join(&quot;|&quot;)+&quot;)&quot;,Sfe=RegExp(iy,&quot;g&quot;),gfe=RegExp(n_,&quot;g&quot;),vfe=RegExp(ny+&quot;(?=&quot;+ny+&quot;)|&quot;+Tfe+LH,&quot;g&quot;),yfe=RegExp([la+&quot;?&quot;+RH+&quot;+&quot;+pH+&quot;(?=&quot;+[uH,la,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,_fe+&quot;+&quot;+dH+&quot;(?=&quot;+[uH,la+fH,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,la+&quot;?&quot;+fH+&quot;+&quot;+pH,la+&quot;+&quot;+dH,AH,mfe].join(&quot;|&quot;),&quot;g&quot;),Ofe=RegExp(&quot;[&quot;+PH+i_+mH+TH+yH+&quot;]&quot;),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:&quot;A&quot;,\u00C1:&quot;A&quot;,\u00C2:&quot;A&quot;,\u00C3:&quot;A&quot;,\u00C4:&quot;A&quot;,\u00C5:&quot;A&quot;,\u00E0:&quot;a&quot;,\u00E1:&quot;a&quot;,\u00E2:&quot;a&quot;,\u00E3:&quot;a&quot;,\u00E4:&quot;a&quot;,\u00E5:&quot;a&quot;,\u00C7:&quot;C&quot;,\u00E7:&quot;c&quot;,\u00D0:&quot;D&quot;,\u00F0:&quot;d&quot;,\u00C8:&quot;E&quot;,\u00C9:&quot;E&quot;,\u00CA:&quot;E&quot;,\u00CB:&quot;E&quot;,\u00E8:&quot;e&quot;,\u00E9:&quot;e&quot;,\u00EA:&quot;e&quot;,\u00EB:&quot;e&quot;,\u00CC:&quot;I&quot;,\u00CD:&quot;I&quot;,\u00CE:&quot;I&quot;,\u00CF:&quot;I&quot;,\u00EC:&quot;i&quot;,\u00ED:&quot;i&quot;,\u00EE:&quot;i&quot;,\u00EF:&quot;i&quot;,\u00D1:&quot;N&quot;,\u00F1:&quot;n&quot;,\u00D2:&quot;O&quot;,\u00D3:&quot;O&quot;,\u00D4:&quot;O&quot;,\u00D5:&quot;O&quot;,\u00D6:&quot;O&quot;,\u00D8:&quot;O&quot;,\u00F2:&quot;o&quot;,\u00F3:&quot;o&quot;,\u00F4:&quot;o&quot;,\u00F5:&quot;o&quot;,\u00F6:&quot;o&quot;,\u00F8:&quot;o&quot;,\u00D9:&quot;U&quot;,\u00DA:&quot;U&quot;,\u00DB:&quot;U&quot;,\u00DC:&quot;U&quot;,\u00F9:&quot;u&quot;,\u00FA:&quot;u&quot;,\u00FB:&quot;u&quot;,\u00FC:&quot;u&quot;,\u00DD:&quot;Y&quot;,\u00FD:&quot;y&quot;,\u00FF:&quot;y&quot;,\u00C6:&quot;Ae&quot;,\u00E6:&quot;ae&quot;,\u00DE:&quot;Th&quot;,\u00FE:&quot;th&quot;,\u00DF:&quot;ss&quot;,\u0100:&quot;A&quot;,\u0102:&quot;A&quot;,\u0104:&quot;A&quot;,\u0101:&quot;a&quot;,\u0103:&quot;a&quot;,\u0105:&quot;a&quot;,\u0106:&quot;C&quot;,\u0108:&quot;C&quot;,\u010A:&quot;C&quot;,\u010C:&quot;C&quot;,\u0107:&quot;c&quot;,\u0109:&quot;c&quot;,\u010B:&quot;c&quot;,\u010D:&quot;c&quot;,\u010E:&quot;D&quot;,\u0110:&quot;D&quot;,\u010F:&quot;d&quot;,\u0111:&quot;d&quot;,\u0112:&quot;E&quot;,\u0114:&quot;E&quot;,\u0116:&quot;E&quot;,\u0118:&quot;E&quot;,\u011A:&quot;E&quot;,\u0113:&quot;e&quot;,\u0115:&quot;e&quot;,\u0117:&quot;e&quot;,\u0119:&quot;e&quot;,\u011B:&quot;e&quot;,\u011C:&quot;G&quot;,\u011E:&quot;G&quot;,\u0120:&quot;G&quot;,\u0122:&quot;G&quot;,\u011D:&quot;g&quot;,\u011F:&quot;g&quot;,\u0121:&quot;g&quot;,\u0123:&quot;g&quot;,\u0124:&quot;H&quot;,\u0126:&quot;H&quot;,\u0125:&quot;h&quot;,\u0127:&quot;h&quot;,\u0128:&quot;I&quot;,\u012A:&quot;I&quot;,\u012C:&quot;I&quot;,\u012E:&quot;I&quot;,\u0130:&quot;I&quot;,\u0129:&quot;i&quot;,\u012B:&quot;i&quot;,\u012D:&quot;i&quot;,\u012F:&quot;i&quot;,\u0131:&quot;i&quot;,\u0134:&quot;J&quot;,\u0135:&quot;j&quot;,\u0136:&quot;K&quot;,\u0137:&quot;k&quot;,\u0138:&quot;k&quot;,\u0139:&quot;L&quot;,\u013B:&quot;L&quot;,\u013D:&quot;L&quot;,\u013F:&quot;L&quot;,\u0141:&quot;L&quot;,\u013A:&quot;l&quot;,\u013C:&quot;l&quot;,\u013E:&quot;l&quot;,\u0140:&quot;l&quot;,\u0142:&quot;l&quot;,\u0143:&quot;N&quot;,\u0145:&quot;N&quot;,\u0147:&quot;N&quot;,\u014A:&quot;N&quot;,\u0144:&quot;n&quot;,\u0146:&quot;n&quot;,\u0148:&quot;n&quot;,\u014B:&quot;n&quot;,\u014C:&quot;O&quot;,\u014E:&quot;O&quot;,\u0150:&quot;O&quot;,\u014D:&quot;o&quot;,\u014F:&quot;o&quot;,\u0151:&quot;o&quot;,\u0154:&quot;R&quot;,\u0156:&quot;R&quot;,\u0158:&quot;R&quot;,\u0155:&quot;r&quot;,\u0157:&quot;r&quot;,\u0159:&quot;r&quot;,\u015A:&quot;S&quot;,\u015C:&quot;S&quot;,\u015E:&quot;S&quot;,\u0160:&quot;S&quot;,\u015B:&quot;s&quot;,\u015D:&quot;s&quot;,\u015F:&quot;s&quot;,\u0161:&quot;s&quot;,\u0162:&quot;T&quot;,\u0164:&quot;T&quot;,\u0166:&quot;T&quot;,\u0163:&quot;t&quot;,\u0165:&quot;t&quot;,\u0167:&quot;t&quot;,\u0168:&quot;U&quot;,\u016A:&quot;U&quot;,\u016C:&quot;U&quot;,\u016E:&quot;U&quot;,\u0170:&quot;U&quot;,\u0172:&quot;U&quot;,\u0169:&quot;u&quot;,\u016B:&quot;u&quot;,\u016D:&quot;u&quot;,\u016F:&quot;u&quot;,\u0171:&quot;u&quot;,\u0173:&quot;u&quot;,\u0174:&quot;W&quot;,\u0175:&quot;w&quot;,\u0176:&quot;Y&quot;,\u0177:&quot;y&quot;,\u0178:&quot;Y&quot;,\u0179:&quot;Z&quot;,\u017B:&quot;Z&quot;,\u017D:&quot;Z&quot;,\u017A:&quot;z&quot;,\u017C:&quot;z&quot;,\u017E:&quot;z&quot;,\u0132:&quot;IJ&quot;,\u0133:&quot;ij&quot;,\u0152:&quot;Oe&quot;,\u0153:&quot;oe&quot;,\u0149:&quot;&#x27;n&quot;,\u017F:&quot;ss&quot;},Nfe=typeof global==&quot;object&quot;&amp;&amp;global&amp;&amp;global.Object===Object&amp;&amp;global,Cfe=typeof self==&quot;object&quot;&amp;&amp;self&amp;&amp;self.Object===Object&amp;&amp;self,Pfe=Nfe||Cfe||Function(&quot;return this&quot;)();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&amp;&amp;a&amp;&amp;(t=r[++s]);++s&lt;a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split(&quot;&quot;)}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e&lt;0&amp;&amp;(e=-e&gt;s?0:s+e),t=t&gt;s?s:t,t&lt;0&amp;&amp;(t+=s),s=e&gt;t?0:t-e&gt;&gt;&gt;0,e&gt;&gt;&gt;=0;for(var a=Array(s);++o&lt;s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r==&quot;string&quot;)return r;if(zfe(r))return EH?EH.call(r):&quot;&quot;;var e=r+&quot;&quot;;return e==&quot;0&quot;&amp;&amp;1/r==-ife?&quot;-0&quot;:e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&amp;&amp;t&gt;=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(&quot;&quot;):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,&quot;&quot;)),r,&quot;&quot;)}}function Yfe(r){return!!r&amp;&amp;typeof r==&quot;object&quot;}function zfe(r){return typeof r==&quot;symbol&quot;||Yfe(r)&amp;&amp;Vfe.call(r)==ofe}function o_(r){return r==null?&quot;&quot;:Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&amp;&amp;r.replace(afe,Mfe).replace(gfe,&quot;&quot;)}var Wfe=qfe(&quot;toUpperCase&quot;);function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=&gt;{&quot;use strict&quot;;DH.exports=ay;function ay(r,e){typeof r==&quot;string&quot;&amp;&amp;(e=r,r=void 0);var t=[];function o(a){if(typeof a!=&quot;string&quot;){var i=s();if(ay.verbose&amp;&amp;console.log(&quot;codegen: &quot;+i),i=&quot;return &quot;+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u&lt;n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case&quot;d&quot;:case&quot;f&quot;:return String(Number(A));case&quot;i&quot;:return String(Math.floor(A));case&quot;j&quot;:return JSON.stringify(A);case&quot;s&quot;:return String(A)}return&quot;%&quot;}),_!==f.length)throw Error(&quot;parameter count mismatch&quot;);return t.push(a),o}function s(a){return&quot;function &quot;+(a||e||&quot;&quot;)+&quot;(&quot;+(r&amp;&amp;r.join(&quot;,&quot;)||&quot;&quot;)+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=&gt;{&quot;use strict&quot;;kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe(&quot;fs&quot;);function Uc(r,e,t){return typeof e==&quot;function&quot;?(t=e,e={}):e||(e={}),t?!e.xhr&amp;&amp;ly&amp;&amp;ly.readFile?ly.readFile(r,function(s,a){return s&amp;&amp;typeof XMLHttpRequest&lt;&quot;u&quot;?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString(&quot;utf8&quot;))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&amp;&amp;s.status!==200)return o(Error(&quot;status &quot;+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n&lt;s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&amp;255)}return o(null,typeof Uint8Array&lt;&quot;u&quot;?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&amp;&amp;(&quot;overrideMimeType&quot;in s&amp;&amp;s.overrideMimeType(&quot;text/plain; charset=x-user-defined&quot;),s.responseType=&quot;arraybuffer&quot;),s.open(&quot;GET&quot;,e),s.send()}});var GH=T(FH=&gt;{&quot;use strict&quot;;var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,&quot;/&quot;).replace(/\/{2,}/g,&quot;/&quot;);var t=e.split(&quot;/&quot;),o=VH(e),s=&quot;&quot;;o&amp;&amp;(s=t.shift()+&quot;/&quot;);for(var a=0;a&lt;t.length;)t[a]===&quot;..&quot;?a&gt;0&amp;&amp;t[a-1]!==&quot;..&quot;?t.splice(--a,2):o?t.splice(a,1):++a:t[a]===&quot;.&quot;?t.splice(a,1):++a;return s+t.join(&quot;/&quot;)};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,&quot;&quot;)).length?cy(e+&quot;/&quot;+t):t)}});var ua=T((iFe,jH)=&gt;{&quot;use strict&quot;;jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className=&quot;Namespace&quot;;var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&amp;&amp;r.length){for(var t={},o=0;o&lt;r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(typeof e[o]!=&quot;string&quot;&amp;&amp;e[o][0]&lt;=t&amp;&amp;e[o][1]&gt;t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,&quot;nestedArray&quot;,{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject([&quot;options&quot;,this.options,&quot;nested&quot;,HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s&lt;o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&amp;&amp;this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&amp;&amp;this.nested[e]instanceof co)return this.nested[e].values;throw Error(&quot;no such enum: &quot;+e)};pe.prototype.add=function(e){if(!(e instanceof fy&amp;&amp;e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError(&quot;object must be a valid nested object&quot;);if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&amp;&amp;e instanceof pe&amp;&amp;!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s&lt;o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError(&quot;object must be a ReflectionObject&quot;);if(e.parent!==this)throw Error(e+&quot; is not a member of &quot;+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(&quot;.&quot;);else if(!Array.isArray(e))throw TypeError(&quot;illegal path&quot;);if(e&amp;&amp;e.length&amp;&amp;e[0]===&quot;&quot;)throw Error(&quot;path must be relative&quot;);for(var o=this;e.length&gt;0;){var s=e.shift();if(o.nested&amp;&amp;o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error(&quot;path conflicts with non-namespace objects&quot;)}else o.add(o=new pe(s))}return t&amp;&amp;o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t&lt;e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t==&quot;boolean&quot;?(o=t,t=void 0):t&amp;&amp;!Array.isArray(t)&amp;&amp;(t=[t]),a_.isString(e)&amp;&amp;e.length){if(e===&quot;.&quot;)return this.root;e=e.split(&quot;.&quot;)}else if(!e.length)return this;var s=e.join(&quot;.&quot;);if(e[0]===&quot;&quot;)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&amp;&amp;this.root._fullyQualifiedObjects[&quot;.&quot;+s];if(a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)||(a=this._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&amp;&amp;(e=e.slice(1),s=o._lookupImpl(e,e.join(&quot;.&quot;)));else for(var a=0;a&lt;this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&amp;&amp;(o=this._nestedArray[a]._lookupImpl(e,t))&amp;&amp;(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error(&quot;no such type: &quot;+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error(&quot;no such Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error(&quot;no such Type or Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error(&quot;no such Service &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=&gt;{&quot;use strict&quot;;YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className=&quot;MapField&quot;;var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError(&quot;keyType must be a string&quot;);this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject([&quot;keyType&quot;,this.keyType,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error(&quot;invalid key type: &quot;+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o==&quot;function&quot;?o=kc.decorateType(o).name:o&amp;&amp;typeof o==&quot;object&quot;&amp;&amp;(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=&gt;{&quot;use strict&quot;;zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className=&quot;Method&quot;;var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&amp;&amp;(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError(&quot;type must be a string&quot;);if(!fa.isString(t))throw TypeError(&quot;requestType must be a string&quot;);if(!fa.isString(o))throw TypeError(&quot;responseType must be a string&quot;);dy.call(this,r,i),this.type=e||&quot;rpc&quot;,this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject([&quot;type&quot;,this.type!==&quot;rpc&quot;&amp;&amp;this.type||void 0,&quot;requestType&quot;,this.requestType,&quot;requestStream&quot;,this.requestStream,&quot;responseType&quot;,this.responseType,&quot;responseStream&quot;,this.responseStream,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0,&quot;parsedOptions&quot;,this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=&gt;{&quot;use strict&quot;;$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className=&quot;Service&quot;;var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a&lt;s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&amp;&amp;o.addJSON(t.nested),t.edition&amp;&amp;(o._edition=t.edition),o.comment=t.comment,o._defaultEdition=&quot;proto3&quot;,o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;methods&quot;,Sn.arrayToJSON(this.methodsArray,e)||{},&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Object.defineProperty(Vt.prototype,&quot;methodsArray&quot;,{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t&lt;e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a&lt;this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,&quot;&quot;);s[n]=Bc.codegen([&quot;r&quot;,&quot;c&quot;],Bc.isReserved(n)?n+&quot;_&quot;:n)(&quot;return this.rpcCall(m,q,s,r,c)&quot;)({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=&gt;{&quot;use strict&quot;;XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t&lt;e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=&gt;{&quot;use strict&quot;;JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return&quot;missing required &#x27;&quot;+r.name+&quot;&#x27;&quot;}function spe(r){for(var e=WH.codegen([&quot;r&quot;,&quot;l&quot;,&quot;e&quot;],r.name+&quot;$decode&quot;)(&quot;if(!(r instanceof Reader))&quot;)(&quot;r=Reader.create(r)&quot;)(&quot;var c=l===undefined?r.len:r.pos+l,m=new this.ctor&quot;+(r.fieldsArray.filter(function(n){return n.map}).length?&quot;,k,value&quot;:&quot;&quot;))(&quot;while(r.pos&lt;c){&quot;)(&quot;var t=r.uint32()&quot;)(&quot;if(t===e)&quot;)(&quot;break&quot;)(&quot;switch(t&gt;&gt;&gt;3){&quot;),t=0;t&lt;r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?&quot;int32&quot;:o.type,a=&quot;m&quot;+WH.safeProp(o.name);e(&quot;case %i: {&quot;,o.id),o.map?(e(&quot;if(%s===util.emptyObject)&quot;,a)(&quot;%s={}&quot;,a)(&quot;var c2 = r.uint32()+r.pos&quot;),gn.defaults[o.keyType]!==void 0?e(&quot;k=%j&quot;,gn.defaults[o.keyType]):e(&quot;k=null&quot;),gn.defaults[s]!==void 0?e(&quot;value=%j&quot;,gn.defaults[s]):e(&quot;value=null&quot;),e(&quot;while(r.pos&lt;c2){&quot;)(&quot;var tag2=r.uint32()&quot;)(&quot;switch(tag2&gt;&gt;&gt;3){&quot;)(&quot;case 1: k=r.%s(); break&quot;,o.keyType)(&quot;case 2:&quot;),gn.basic[s]===void 0?e(&quot;value=types[%i].decode(r,r.uint32())&quot;,t):e(&quot;value=r.%s()&quot;,s),e(&quot;break&quot;)(&quot;default:&quot;)(&quot;r.skipType(tag2&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),gn.long[o.keyType]!==void 0?e(&#x27;%s[typeof k===&quot;object&quot;?util.longToHash(k):k]=value&#x27;,a):e(&quot;%s[k]=value&quot;,a)):o.repeated?(e(&quot;if(!(%s&amp;&amp;%s.length))&quot;,a,a)(&quot;%s=[]&quot;,a),gn.packed[s]!==void 0&amp;&amp;e(&quot;if((t&amp;7)===2){&quot;)(&quot;var c2=r.uint32()+r.pos&quot;)(&quot;while(r.pos&lt;c2)&quot;)(&quot;%s.push(r.%s())&quot;,a,s)(&quot;}else&quot;),gn.basic[s]===void 0?e(o.delimited?&quot;%s.push(types[%i].decode(r,undefined,((t&amp;~7)|4)))&quot;:&quot;%s.push(types[%i].decode(r,r.uint32()))&quot;,a,t):e(&quot;%s.push(r.%s())&quot;,a,s)):gn.basic[s]===void 0?e(o.delimited?&quot;%s=types[%i].decode(r,undefined,((t&amp;~7)|4))&quot;:&quot;%s=types[%i].decode(r,r.uint32())&quot;,a,t):e(&quot;%s=r.%s()&quot;,a,s),e(&quot;break&quot;)(&quot;}&quot;)}for(e(&quot;default:&quot;)(&quot;r.skipType(t&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),t=0;t&lt;r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&amp;&amp;e(&quot;if(!m.hasOwnProperty(%j))&quot;,i.name)(&quot;throw util.ProtocolError(%j,{instance:m})&quot;,ope(i))}return e(&quot;return m&quot;)}});var Ty=T((uFe,QH)=&gt;{&quot;use strict&quot;;QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+&quot;: &quot;+e+(r.repeated&amp;&amp;e!==&quot;array&quot;?&quot;[]&quot;:r.map&amp;&amp;e!==&quot;object&quot;?&quot;{k:&quot;+r.keyType+&quot;}&quot;:&quot;&quot;)+&quot; expected&quot;}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r(&quot;switch(%s){&quot;,o)(&quot;default:&quot;)(&quot;return%j&quot;,ir(e,&quot;enum value&quot;));for(var s=Object.keys(e.resolvedType.values),a=0;a&lt;s.length;++a)r(&quot;case %i:&quot;,e.resolvedType.values[s[a]]);r(&quot;break&quot;)(&quot;}&quot;)}else r(&quot;{&quot;)(&quot;var e=types[%i].verify(%s);&quot;,t,o)(&quot;if(e)&quot;)(&quot;return%j+e&quot;,e.name+&quot;.&quot;)(&quot;}&quot;);else switch(e.type){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.isInteger(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;integer&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.isInteger(%s)&amp;&amp;!(%s&amp;&amp;util.isInteger(%s.low)&amp;&amp;util.isInteger(%s.high)))&quot;,o,o,o,o)(&quot;return%j&quot;,ir(e,&quot;integer|Long&quot;));break;case&quot;float&quot;:case&quot;double&quot;:r(&#x27;if(typeof %s!==&quot;number&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;number&quot;));break;case&quot;bool&quot;:r(&#x27;if(typeof %s!==&quot;boolean&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;boolean&quot;));break;case&quot;string&quot;:r(&quot;if(!util.isString(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;string&quot;));break;case&quot;bytes&quot;:r(&#x27;if(!(%s&amp;&amp;typeof %s.length===&quot;number&quot;||util.isString(%s)))&#x27;,o,o,o)(&quot;return%j&quot;,ir(e,&quot;buffer&quot;));break}return r}function lpe(r,e,t){switch(e.keyType){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.key32Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer key&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.key64Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer|Long key&quot;));break;case&quot;bool&quot;:r(&quot;if(!util.key2Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;boolean key&quot;));break}return r}function cpe(r){var e=Ey.codegen([&quot;m&quot;],r.name+&quot;$verify&quot;)(&#x27;if(typeof m!==&quot;object&quot;||m===null)&#x27;)(&quot;return%j&quot;,&quot;object expected&quot;),t=r.oneofsArray,o={};t.length&amp;&amp;e(&quot;var p={}&quot;);for(var s=0;s&lt;r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i=&quot;m&quot;+Ey.safeProp(a.name);if(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,i,a.name),a.map)e(&quot;if(!util.isObject(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;object&quot;))(&quot;var k=Object.keys(%s)&quot;,i)(&quot;for(var i=0;i&lt;k.length;++i){&quot;),lpe(e,a,&quot;k[i]&quot;),my(e,a,s,i+&quot;[k[i]]&quot;)(&quot;}&quot;);else if(a.repeated)e(&quot;if(!Array.isArray(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;array&quot;))(&quot;for(var i=0;i&lt;%s.length;++i){&quot;,i),my(e,a,s,i+&quot;[i]&quot;)(&quot;}&quot;);else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&amp;&amp;e(&quot;if(p%s===1)&quot;,n)(&quot;return%j&quot;,a.partOf.name+&quot;: multiple values&quot;),o[a.partOf.name]=1,e(&quot;p%s=1&quot;,n)}my(e,a,s,i)}a.optional&amp;&amp;e(&quot;}&quot;)}return e(&quot;return null&quot;)}});var vy=T(eq=&gt;{&quot;use strict&quot;;var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r(&quot;switch(d%s){&quot;,o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]===e.typeDefault&amp;&amp;!s&amp;&amp;(r(&quot;default:&quot;)(&#x27;if(typeof(d%s)===&quot;number&quot;){m%s=d%s;break}&#x27;,o,o,o),e.repeated||r(&quot;break&quot;),s=!0),r(&quot;case%j:&quot;,i[n])(&quot;case %i:&quot;,a[i[n]])(&quot;m%s=%j&quot;,o,a[i[n]])(&quot;break&quot;);r(&quot;}&quot;)}else r(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,o)(&quot;throw TypeError(%j)&quot;,e.fullName+&quot;: object expected&quot;)(&quot;m%s=types[%i].fromObject(d%s)&quot;,o,t,o);else{var l=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;m%s=Number(d%s)&quot;,o,o);break;case&quot;uint32&quot;:case&quot;fixed32&quot;:r(&quot;m%s=d%s&gt;&gt;&gt;0&quot;,o,o);break;case&quot;int32&quot;:case&quot;sint32&quot;:case&quot;sfixed32&quot;:r(&quot;m%s=d%s|0&quot;,o,o);break;case&quot;uint64&quot;:l=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(util.Long)&quot;)(&quot;(m%s=util.Long.fromValue(d%s)).unsigned=%j&quot;,o,o,l)(&#x27;else if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;m%s=parseInt(d%s,10)&quot;,o,o)(&#x27;else if(typeof d%s===&quot;number&quot;)&#x27;,o)(&quot;m%s=d%s&quot;,o,o)(&#x27;else if(typeof d%s===&quot;object&quot;)&#x27;,o)(&quot;m%s=new util.LongBits(d%s.low&gt;&gt;&gt;0,d%s.high&gt;&gt;&gt;0).toNumber(%s)&quot;,o,o,o,l?&quot;true&quot;:&quot;&quot;);break;case&quot;bytes&quot;:r(&#x27;if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)&quot;,o,o,o)(&quot;else if(d%s.length &gt;= 0)&quot;,o)(&quot;m%s=d%s&quot;,o,o);break;case&quot;string&quot;:r(&quot;m%s=String(d%s)&quot;,o,o);break;case&quot;bool&quot;:r(&quot;m%s=Boolean(d%s)&quot;,o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen([&quot;d&quot;],e.name+&quot;$fromObject&quot;)(&quot;if(d instanceof this.ctor)&quot;)(&quot;return d&quot;);if(!t.length)return o(&quot;return new this.ctor&quot;);o(&quot;var m=new this.ctor&quot;);for(var s=0;s&lt;t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o(&quot;if(d%s){&quot;,i)(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: object expected&quot;)(&quot;m%s={}&quot;,i)(&quot;for(var ks=Object.keys(d%s),i=0;i&lt;ks.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[ks[i]]&quot;)(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(o(&quot;if(d%s){&quot;,i)(&quot;if(!Array.isArray(d%s))&quot;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: array expected&quot;)(&quot;m%s=[]&quot;,i)(&quot;for(var i=0;i&lt;d%s.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[i]&quot;)(&quot;}&quot;)(&quot;}&quot;)):(a.resolvedType instanceof Vc||o(&quot;if(d%s!=null){&quot;,i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o(&quot;}&quot;))}return o(&quot;return m&quot;)};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r(&quot;d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s&quot;,o,t,o,o,t,o,o):r(&quot;d%s=types[%i].toObject(m%s,o)&quot;,o,t,o);else{var s=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;d%s=o.json&amp;&amp;!isFinite(m%s)?String(m%s):m%s&quot;,o,o,o,o);break;case&quot;uint64&quot;:s=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&#x27;if(typeof m%s===&quot;number&quot;)&#x27;,o)(&quot;d%s=o.longs===String?String(m%s):m%s&quot;,o,o,o)(&quot;else&quot;)(&quot;d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low&gt;&gt;&gt;0,m%s.high&gt;&gt;&gt;0).toNumber(%s):m%s&quot;,o,o,o,o,s?&quot;true&quot;:&quot;&quot;,o);break;case&quot;bytes&quot;:r(&quot;d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s&quot;,o,o,o,o,o);break;default:r(&quot;d%s=m%s&quot;,o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()(&quot;return {}&quot;);for(var o=$r.codegen([&quot;m&quot;,&quot;o&quot;],e.name+&quot;$toObject&quot;)(&quot;if(!o)&quot;)(&quot;o={}&quot;)(&quot;var d={}&quot;),s=[],a=[],i=[],n=0;n&lt;t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o(&quot;if(o.arrays||o.defaults){&quot;),n=0;n&lt;s.length;++n)o(&quot;d%s=[]&quot;,$r.safeProp(s[n].name));o(&quot;}&quot;)}if(a.length){for(o(&quot;if(o.objects||o.defaults){&quot;),n=0;n&lt;a.length;++n)o(&quot;d%s={}&quot;,$r.safeProp(a[n].name));o(&quot;}&quot;)}if(i.length){for(o(&quot;if(o.defaults){&quot;),n=0;n&lt;i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o(&quot;d%s=o.enums===String?%j:%j&quot;,c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o(&quot;if(util.Long){&quot;)(&quot;var n=new util.Long(%i,%i,%j)&quot;,l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)(&quot;d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n&quot;,c)(&quot;}else&quot;)(&quot;d%s=o.longs===String?%j:%i&quot;,c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u=&quot;[&quot;+Array.prototype.slice.call(l.typeDefault).join(&quot;,&quot;)+&quot;]&quot;;o(&quot;if(o.bytes===String)d%s=%j&quot;,c,String.fromCharCode.apply(String,l.typeDefault))(&quot;else{&quot;)(&quot;d%s=%s&quot;,c,u)(&quot;if(o.bytes!==Array)d%s=util.newBuffer(d%s)&quot;,c,c)(&quot;}&quot;)}else o(&quot;d%s=%j&quot;,c,l.typeDefault)}o(&quot;}&quot;)}var f=!1;for(n=0;n&lt;t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o(&quot;var ks2&quot;)),o(&quot;if(m%s&amp;&amp;(ks2=Object.keys(m%s)).length){&quot;,c,c)(&quot;d%s={}&quot;,c)(&quot;for(var j=0;j&lt;ks2.length;++j){&quot;),gy(o,l,_,c+&quot;[ks2[j]]&quot;)(&quot;}&quot;)):l.repeated?(o(&quot;if(m%s&amp;&amp;m%s.length){&quot;,c,c)(&quot;d%s=[]&quot;,c)(&quot;for(var j=0;j&lt;m%s.length;++j){&quot;,c),gy(o,l,_,c+&quot;[j]&quot;)(&quot;}&quot;)):(o(&quot;if(m%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,c,l.name),gy(o,l,_,c),l.partOf&amp;&amp;o(&quot;if(o.oneofs)&quot;)(&quot;d%s=%j&quot;,$r.safeProp(l.partOf.name),l.name)),o(&quot;}&quot;)}return o(&quot;return d&quot;)}});var yy=T(tq=&gt;{&quot;use strict&quot;;var upe=tq,fpe=f_();upe[&quot;.google.protobuf.Any&quot;]={fromObject:function(r){if(r&amp;&amp;r[&quot;@type&quot;]){var e=r[&quot;@type&quot;].substring(r[&quot;@type&quot;].lastIndexOf(&quot;/&quot;)+1),t=this.lookup(e);if(t){var o=r[&quot;@type&quot;].charAt(0)===&quot;.&quot;?r[&quot;@type&quot;].slice(1):r[&quot;@type&quot;];return o.indexOf(&quot;/&quot;)===-1&amp;&amp;(o=&quot;/&quot;+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t=&quot;type.googleapis.com/&quot;,o=&quot;&quot;,s=&quot;&quot;;if(e&amp;&amp;e.json&amp;&amp;r.type_url&amp;&amp;r.value){s=r.type_url.substring(r.type_url.lastIndexOf(&quot;/&quot;)+1),o=r.type_url.substring(0,r.type_url.lastIndexOf(&quot;/&quot;)+1);var a=this.lookup(s);a&amp;&amp;(r=a.decode(r.value))}if(!(r instanceof this.ctor)&amp;&amp;r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]===&quot;.&quot;?r.$type.fullName.slice(1):r.$type.fullName;return o===&quot;&quot;&amp;&amp;(o=t),s=o+n,i[&quot;@type&quot;]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=&gt;{&quot;use strict&quot;;nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className=&quot;Type&quot;;var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e&lt;r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error(&quot;duplicate id &quot;+o+&quot; in &quot;+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t&lt;this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t&lt;this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&amp;&amp;Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen([&quot;p&quot;],e.name),o=0,s;o&lt;e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t(&quot;this%s={}&quot;,_t.safeProp(s.name)):s.repeated&amp;&amp;t(&quot;this%s=[]&quot;,_t.safeProp(s.name));return t(&quot;if(p)for(var ks=Object.keys(p),i=0;i&lt;ks.length;++i)if(p[ks[i]]!=null)&quot;)(&quot;this[ks[i]]=p[ks[i]]&quot;)};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a&lt;s.length;++a)o.add((typeof t.fields[s[a]].keyType&lt;&quot;u&quot;?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a&lt;s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a&lt;s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&amp;&amp;t.extensions.length&amp;&amp;(o.extensions=t.extensions),t.reserved&amp;&amp;t.reserved.length&amp;&amp;(o.reserved=t.reserved),t.group&amp;&amp;(o.group=!0),t.comment&amp;&amp;(o.comment=t.comment),t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;oneofs&quot;,or.arrayToJSON(this.oneofsArray,e),&quot;fields&quot;,or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},&quot;extensions&quot;,this.extensions&amp;&amp;this.extensions.length?this.extensions:void 0,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;group&quot;,this.group||void 0,&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o&lt;e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o&lt;t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&amp;&amp;this.oneofs[e]||this.nested&amp;&amp;this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);if(e instanceof p_&amp;&amp;e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(&quot;duplicate id &quot;+e.id+&quot; in &quot;+this);if(this.isReservedId(e.id))throw Error(&quot;id &quot;+e.id+&quot; is reserved in &quot;+this);if(this.isReservedName(e.name))throw Error(&quot;name &#x27;&quot;+e.name+&quot;&#x27; is reserved in &quot;+this);return e.parent&amp;&amp;e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&amp;&amp;e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o&lt;this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&amp;&amp;t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=&gt;{&quot;use strict&quot;;sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className=&quot;Root&quot;;var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,&quot;&quot;,r),this.deferred=[],this.files=[],this._edition=&quot;proto2&quot;,this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&amp;&amp;t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t==&quot;function&quot;&amp;&amp;(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&amp;&amp;O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf(&quot;google/protobuf/&quot;);if(O&gt;-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&amp;&amp;O.charAt(0)===&quot;{&quot;&amp;&amp;(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I&lt;y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&amp;&amp;c(A);if(y.weakImports)for(I=0;I&lt;y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&amp;&amp;c(A,!0)}}catch(M){i(M)}!a&amp;&amp;!u&amp;&amp;i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)&gt;-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString(&quot;utf8&quot;)}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&amp;&amp;(e=[e]);for(var f=0,_;f&lt;e.length;++f)(_=s.resolvePath(&quot;&quot;,e[f]))&amp;&amp;c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error(&quot;not supported&quot;);return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(&quot;unresolvable extensions: &quot;+this.deferred.map(function(e){return&quot;&#x27;extend &quot;+e.extend+&quot;&#x27; in &quot;+e.parent.fullName}).join(&quot;, &quot;));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&amp;&amp;!e.extensionField&amp;&amp;(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&amp;&amp;(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t&lt;this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o&lt;e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&amp;&amp;(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&amp;&amp;(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t&gt;-1&amp;&amp;this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&amp;&amp;delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o&lt;e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&amp;&amp;delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=&gt;{&quot;use strict&quot;;var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire(&quot;fs&quot;);He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s&lt;t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o&lt;e.length;){var s=e[o++],a=e[o++];a!==void 0&amp;&amp;(t[s]=a)}return t};var vpe=/\\/g,ype=/&quot;/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?&#x27;[&quot;&#x27;+e.replace(vpe,&quot;\\\\&quot;).replace(ype,&#x27;\\&quot;&#x27;)+&#x27;&quot;]&#x27;:&quot;.&quot;+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&amp;&amp;e.$type.name!==t&amp;&amp;(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,&quot;$type&quot;,{value:o,enumerable:!1}),Object.defineProperty(e.prototype,&quot;$type&quot;,{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly(&quot;Enum&quot;+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,&quot;$type&quot;,{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c===&quot;__proto__&quot;||c===&quot;prototype&quot;)return i;if(n.length&gt;0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&amp;&amp;s)return i;u&amp;&amp;(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!=&quot;object&quot;)throw TypeError(&quot;dst must be an object&quot;);if(!t)throw TypeError(&quot;path must be specified&quot;);return t=t.split(&quot;.&quot;),a(e,t,o)};Object.defineProperty(He,&quot;decorateRoot&quot;,{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=&gt;{&quot;use strict&quot;;var Gc=cq,Rpe=rt(),Npe=[&quot;double&quot;,&quot;float&quot;,&quot;int32&quot;,&quot;uint32&quot;,&quot;sint32&quot;,&quot;fixed32&quot;,&quot;sfixed32&quot;,&quot;int64&quot;,&quot;uint64&quot;,&quot;sint64&quot;,&quot;fixed64&quot;,&quot;sfixed64&quot;,&quot;bool&quot;,&quot;string&quot;,&quot;bytes&quot;];function Hc(r,e){var t=0,o={};for(e|=0;t&lt;r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,&quot;&quot;,Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=&gt;{&quot;use strict&quot;;fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className=&quot;Field&quot;;var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&amp;&amp;(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e&lt;0)throw TypeError(&quot;id must be a non-negative integer&quot;);if(!Ke.isString(t))throw TypeError(&quot;type must be a string&quot;);if(o!==void 0&amp;&amp;!Cpe.test(o=o.toString().toLowerCase()))throw TypeError(&quot;rule must be a string rule&quot;);if(s!==void 0&amp;&amp;!Ke.isString(s))throw TypeError(&quot;extend must be a string&quot;);o===&quot;proto3_optional&quot;&amp;&amp;(o=&quot;optional&quot;),this.rule=o&amp;&amp;o!==&quot;optional&quot;?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o===&quot;repeated&quot;,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t===&quot;bytes&quot;,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,&quot;required&quot;,{get:function(){return this._features.field_presence===&quot;LEGACY_REQUIRED&quot;}});Object.defineProperty(nt.prototype,&quot;optional&quot;,{get:function(){return!this.required}});Object.defineProperty(nt.prototype,&quot;delimited&quot;,{get:function(){return this.resolvedType instanceof qc&amp;&amp;this._features.message_encoding===&quot;DELIMITED&quot;}});Object.defineProperty(nt.prototype,&quot;packed&quot;,{get:function(){return this._features.repeated_field_encoding===&quot;PACKED&quot;}});Object.defineProperty(nt.prototype,&quot;hasPresence&quot;,{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==&quot;IMPLICIT&quot;}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;rule&quot;,this.rule!==&quot;optional&quot;&amp;&amp;this.rule||void 0,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&amp;&amp;this.options.proto3_optional&amp;&amp;(this.typeDefault=null),this.options&amp;&amp;this.options.default!=null&amp;&amp;(this.typeDefault=this.options.default,this.resolvedType instanceof uq&amp;&amp;typeof this.typeDefault==&quot;string&quot;&amp;&amp;(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&amp;&amp;(this.options.packed!==void 0&amp;&amp;this.resolvedType&amp;&amp;!(this.resolvedType instanceof uq)&amp;&amp;delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)===&quot;u&quot;),Object.freeze&amp;&amp;Object.freeze(this.typeDefault);else if(this.bytes&amp;&amp;typeof this.typeDefault==&quot;string&quot;){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&amp;&amp;(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!==&quot;proto2&quot;&amp;&amp;e!==&quot;proto3&quot;)return{};var t={};if(this.rule===&quot;required&quot;&amp;&amp;(t.field_presence=&quot;LEGACY_REQUIRED&quot;),this.parent&amp;&amp;xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(&quot;.&quot;).pop());o&amp;&amp;o instanceof qc&amp;&amp;o.group&amp;&amp;(t.message_encoding=&quot;DELIMITED&quot;)}return this.getOption(&quot;packed&quot;)===!0?t.repeated_field_encoding=&quot;PACKED&quot;:this.getOption(&quot;packed&quot;)===!1&amp;&amp;(t.repeated_field_encoding=&quot;EXPANDED&quot;),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t==&quot;function&quot;?t=Ke.decorateType(t).name:t&amp;&amp;typeof t==&quot;object&quot;&amp;&amp;(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=&gt;{&quot;use strict&quot;;hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className=&quot;OneOf&quot;;var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError(&quot;fieldNames must be an Array&quot;);this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject([&quot;options&quot;,this.options,&quot;oneof&quot;,this.oneof,&quot;comment&quot;,t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e&lt;r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);return e.parent&amp;&amp;e.parent!==this.parent&amp;&amp;e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);var t=this.fieldsArray.indexOf(e);if(t&lt;0)throw Error(e+&quot; is not a member of &quot;+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t&gt;-1&amp;&amp;this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o&lt;this.oneof.length;++o){var s=e.get(this.oneof[o]);s&amp;&amp;!s.partOf&amp;&amp;(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t&lt;this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&amp;&amp;o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,&quot;isProto3Optional&quot;,{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&amp;&amp;r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t&lt;arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=&gt;{&quot;use strict&quot;;_q.exports=ct;ct.className=&quot;ReflectionObject&quot;;var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:&quot;OPEN&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;},bpe={enum_type:&quot;CLOSED&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;LEGACY_BEST_EFFORT&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;EXPANDED&quot;,utf8_validation:&quot;NONE&quot;},Lpe={enum_type:&quot;OPEN&quot;,field_presence:&quot;IMPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;};function ct(r,e){if(!Yc.isString(r))throw TypeError(&quot;name must be a string&quot;);if(e&amp;&amp;!Yc.isObject(e))throw TypeError(&quot;options must be an object&quot;);this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition=&quot;proto2&quot;,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(&quot;.&quot;)}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&amp;&amp;this.parent!==e&amp;&amp;this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&amp;&amp;t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&amp;&amp;t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&amp;&amp;(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error(&quot;Unknown edition for &quot;+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e===&quot;proto2&quot;)t=Object.assign({},bpe);else if(e===&quot;proto3&quot;)t=Object.assign({},Lpe);else if(e===&quot;2023&quot;)t=Object.assign({},Ipe);else throw new Error(&quot;Unknown edition: &quot;+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error(&quot;Unable to find a parent for &quot;+this.fullName);this.extensionField&amp;&amp;(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&amp;&amp;(this.getOption(e)!==t&amp;&amp;(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s&lt;o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+&quot; &quot;+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===&quot;proto3&quot;))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=&gt;{&quot;use strict&quot;;mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className=&quot;Enum&quot;;var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&amp;&amp;typeof e!=&quot;object&quot;)throw TypeError(&quot;values must be an object&quot;);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n&lt;i.length;++n)typeof e[i[n]]==&quot;number&quot;&amp;&amp;(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=&gt;{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&amp;&amp;this.valuesOptions[t]&amp;&amp;this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,this.options,&quot;valuesOptions&quot;,this.valuesOptions,&quot;values&quot;,this.values,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;comment&quot;,t?this.comment:void 0,&quot;comments&quot;,t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);if(!y_.isInteger(t))throw TypeError(&quot;id must be an integer&quot;);if(this.values[e]!==void 0)throw Error(&quot;duplicate name &#x27;&quot;+e+&quot;&#x27; in &quot;+this);if(this.isReservedId(t))throw Error(&quot;id &quot;+t+&quot; is reserved in &quot;+this);if(this.isReservedName(e))throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; is reserved in &quot;+this);if(this.valuesById[t]!==void 0){if(!(this.options&amp;&amp;this.options.allow_alias))throw Error(&quot;duplicate id &quot;+t+&quot; in &quot;+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&amp;&amp;(this.valuesOptions===void 0&amp;&amp;(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);var t=this.values[e];if(t==null)throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; does not exist in &quot;+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&amp;&amp;delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=&gt;{&quot;use strict&quot;;Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r(&quot;types[%i].encode(%s,w.uint32(%i)).uint32(%i)&quot;,t,o,(e.id&lt;&lt;3|3)&gt;&gt;&gt;0,(e.id&lt;&lt;3|4)&gt;&gt;&gt;0):r(&quot;types[%i].encode(%s,w.uint32(%i).fork()).ldelim()&quot;,t,o,(e.id&lt;&lt;3|2)&gt;&gt;&gt;0)}function Mpe(r){for(var e=Dy.codegen([&quot;m&quot;,&quot;w&quot;],r.name+&quot;$encode&quot;)(&quot;if(!w)&quot;)(&quot;w=Writer.create()&quot;),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t&lt;s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?&quot;int32&quot;:a.type,l=wy.basic[n];o=&quot;m&quot;+Dy.safeProp(a.name),a.map?(e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j)){&quot;,o,a.name)(&quot;for(var ks=Object.keys(%s),i=0;i&lt;ks.length;++i){&quot;,o)(&quot;w.uint32(%i).fork().uint32(%i).%s(ks[i])&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e(&quot;types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()&quot;,i,o):e(&quot;.uint32(%i).%s(%s[ks[i]]).ldelim()&quot;,16|l,n,o),e(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(e(&quot;if(%s!=null&amp;&amp;%s.length){&quot;,o,o),a.packed&amp;&amp;wy.packed[n]!==void 0?e(&quot;w.uint32(%i).fork()&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0)(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o)(&quot;w.%s(%s[i])&quot;,n,o)(&quot;w.ldelim()&quot;):(e(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o),l===void 0?Tq(e,a,i,o+&quot;[i]&quot;):e(&quot;w.uint32(%i).%s(%s[i])&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o)),e(&quot;}&quot;)):(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j))&quot;,o,a.name),l===void 0?Tq(e,a,i,o):e(&quot;w.uint32(%i).%s(%s)&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o))}return e(&quot;return w&quot;)}});var vq=T((yFe,gq)=&gt;{&quot;use strict&quot;;var de=gq.exports=sv();de.build=&quot;light&quot;;function wpe(r,e,t){return typeof e==&quot;function&quot;?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=&gt;{&quot;use strict&quot;;Aq.exports=Oq;var Uy=/[\s{}=;:[\],&#x27;&quot;()&lt;&gt;]/g,Upe=/(?:&quot;([^&quot;\\]*(?:\\.[^&quot;\\]*)*)&quot;)/g,kpe=/(?:&#x27;([^&#x27;\\]*(?:\\.[^&#x27;\\]*)*)&#x27;)/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:&quot;\0&quot;,r:&quot;\r&quot;,n:` `,t:&quot; &quot;};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case&quot;\\&quot;:case&quot;&quot;:return t;default:return qpe[t]||&quot;&quot;}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error(&quot;illegal &quot;+N+&quot; (line &quot;+s+&quot;)&quot;)}function u(){var N=l===&quot;&#x27;&quot;?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c(&quot;string&quot;);return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$&lt;0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===&quot; &quot;||le===&quot; &quot;);for(var v=r.substring(N,z).split(Fpe),W=0;W&lt;v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,&quot;&quot;).trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z&lt;o&amp;&amp;f(z)!==` `;)z++;return z}function y(){if(n.length&gt;0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&amp;&amp;($=!0,++s),++t===o)return null;if(f(t)===&quot;/&quot;){if(++t===o)throw c(&quot;comment&quot;);if(f(t)===&quot;/&quot;)if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&amp;&amp;(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)===&quot;/&quot;;f(++t)!==` `;)if(t===o)return null;++t,te&amp;&amp;(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))===&quot;*&quot;){G=t+1,te=e||f(G)===&quot;*&quot;;do{if(B===` `&amp;&amp;++s,++t===o)throw c(&quot;comment&quot;);z=B,B=f(t)}while(z!==&quot;*&quot;||B!==&quot;/&quot;);++t,te&amp;&amp;(_(G,t-2,$),$=!0),N=!0}else return&quot;/&quot;}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le&lt;o&amp;&amp;!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W===&#x27;&quot;&#x27;||W===&quot;&#x27;&quot;)&amp;&amp;(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c(&quot;token &#x27;&quot;+B+&quot;&#x27;, &#x27;&quot;+N+&quot;&#x27; expected&quot;);return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&amp;&amp;(e||B.type===&quot;*&quot;||B.lineEmpty)&amp;&amp;(z=B.leading?B.text:null)):(a&lt;N&amp;&amp;I(),B=i[N],delete i[N],B&amp;&amp;!B.lineEmpty&amp;&amp;(e||B.type===&quot;/&quot;)&amp;&amp;(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},&quot;line&quot;,{get:function(){return s}})}});var bq=T((AFe,Iq)=&gt;{&quot;use strict&quot;;Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O=&quot;proto2&quot;,y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=&gt;{L._edition=O,Object.keys(I).forEach(b=&gt;{L.getOption(b)===void 0&amp;&amp;L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error(&quot;illegal &quot;+(b||&quot;token&quot;)+&quot; &#x27;&quot;+L+&quot;&#x27; (&quot;+(j?j+&quot;, &quot;:&quot;&quot;)+&quot;line &quot;+s.line+&quot;)&quot;)}function z(){var L=[],b;do{if((b=a())!==&#x27;&quot;&#x27;&amp;&amp;b!==&quot;&#x27;&quot;)throw N(b);L.push(a()),l(b),b=n()}while(b===&#x27;&quot;&#x27;||b===&quot;&#x27;&quot;);return L.join(&quot;&quot;)}function B(L){var b=a();switch(b){case&quot;&#x27;&quot;:case&#x27;&quot;&#x27;:return i(b),z();case&quot;true&quot;:case&quot;TRUE&quot;:return!0;case&quot;false&quot;:case&quot;FALSE&quot;:return!1}try{return te(b,!0)}catch{if(L&amp;&amp;Wr.test(b))return b;throw N(b,&quot;value&quot;)}}function G(L,b){var x,j;do if(b&amp;&amp;((x=n())===&#x27;&quot;&#x27;||x===&quot;&#x27;&quot;)){var q=z();if(L.push(q),O&gt;=2023)throw N(q,&quot;id&quot;)}else try{L.push([j=$(a()),l(&quot;to&quot;,!0)?$(a()):j])}catch(Le){if(b&amp;&amp;Wr.test(x)&amp;&amp;O&gt;=2023)L.push(x);else throw Le}while(l(&quot;,&quot;,!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&amp;&amp;(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut===&quot;option&quot;)Z(ne,ut),l(&quot;;&quot;);else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)===&quot;-&quot;&amp;&amp;(x=-1,L=L.substring(1)),L){case&quot;inf&quot;:case&quot;INF&quot;:case&quot;Inf&quot;:return x*(1/0);case&quot;nan&quot;:case&quot;NAN&quot;:case&quot;Nan&quot;:case&quot;NaN&quot;:return NaN;case&quot;0&quot;:return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,&quot;number&quot;,b)}function $(L,b){switch(L){case&quot;max&quot;:case&quot;MAX&quot;:case&quot;Max&quot;:return 536870911;case&quot;0&quot;:return 0}if(!b&amp;&amp;L.charAt(0)===&quot;-&quot;)throw N(L,&quot;id&quot;);if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,&quot;id&quot;)}function le(){if(f!==void 0)throw N(&quot;package&quot;);if(f=a(),!Wr.test(f))throw N(f,&quot;name&quot;);y=y.define(f),l(&quot;;&quot;)}function v(){var L=n(),b;switch(L){case&quot;weak&quot;:b=m||(m=[]),a();break;case&quot;public&quot;:a();default:b=_||(_=[]);break}L=z(),l(&quot;;&quot;),b.push(L)}function W(){if(l(&quot;=&quot;),O=z(),O&lt;2023)throw N(O,&quot;syntax&quot;);l(&quot;;&quot;)}function R(){if(l(&quot;=&quot;),O=z(),![&quot;2023&quot;].includes(O))throw N(O,&quot;edition&quot;);l(&quot;;&quot;)}function E(L,b){switch(b){case&quot;option&quot;:return Z(L,b),l(&quot;;&quot;),!0;case&quot;message&quot;:return Q(L,b),!0;case&quot;enum&quot;:return Me(L,b),!0;case&quot;service&quot;:return wo(L,b),!0;case&quot;extend&quot;:return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&amp;&amp;(typeof L.comment!=&quot;string&quot;&amp;&amp;(L.comment=c()),L.filename=vn.filename),l(&quot;{&quot;,!0)){for(var q;(q=a())!==&quot;}&quot;;)b(q);l(&quot;;&quot;,!0)}else x&amp;&amp;x(),l(&quot;;&quot;),L&amp;&amp;(typeof L.comment!=&quot;string&quot;||o)&amp;&amp;(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,&quot;type name&quot;);var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case&quot;map&quot;:ce(x,q);break;case&quot;required&quot;:if(O!==&quot;proto2&quot;)throw N(q);case&quot;repeated&quot;:Y(x,q);break;case&quot;optional&quot;:if(O===&quot;proto3&quot;)Y(x,&quot;proto3_optional&quot;);else{if(O!==&quot;proto2&quot;)throw N(q);Y(x,&quot;optional&quot;)}break;case&quot;oneof&quot;:Ne(x,q);break;case&quot;extensions&quot;:G(x.extensions||(x.extensions=[]));break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(x,&quot;optional&quot;);break}}),L.add(x),L===y&amp;&amp;A.push(x)}function Y(L,b,x){var j=a();if(j===&quot;group&quot;){J(L,b);return}for(;j.endsWith(&quot;.&quot;)||n().startsWith(&quot;.&quot;);)j+=a();if(!Wr.test(j))throw N(j,&quot;type&quot;);var q=a();if(!Xr.test(q))throw N(q,&quot;name&quot;);q=M(q),l(&quot;=&quot;);var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et===&quot;option&quot;)Z(ne,Et),l(&quot;;&quot;);else throw N(Et)},function(){We(ne)}),b===&quot;proto3_optional&quot;){var Le=new Pq(&quot;_&quot;+q);ne.setOption(&quot;proto3_optional&quot;,!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&amp;&amp;A.push(ne)}function J(L,b){if(O&gt;=2023)throw N(&quot;group&quot;);var x=a();if(!Xr.test(x))throw N(x,&quot;name&quot;);var j=By.lcFirst(x);x===j&amp;&amp;(x=By.ucFirst(x)),l(&quot;=&quot;);var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case&quot;option&quot;:Z(ne,Et),l(&quot;;&quot;);break;case&quot;required&quot;:case&quot;repeated&quot;:Y(ne,Et);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(ne,&quot;proto3_optional&quot;):Y(ne,&quot;optional&quot;);break;case&quot;message&quot;:Q(ne,Et);break;case&quot;enum&quot;:Me(ne,Et);break;case&quot;reserved&quot;:G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l(&quot;&lt;&quot;);var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,&quot;type&quot;);l(&quot;,&quot;);var x=a();if(!Wr.test(x))throw N(x,&quot;type&quot;);l(&quot;&gt;&quot;);var j=a();if(!Xr.test(j))throw N(j,&quot;name&quot;);l(&quot;=&quot;);var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le===&quot;option&quot;)Z(q,Le),l(&quot;;&quot;);else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new Pq(M(b));C(x,function(q){q===&quot;option&quot;?(Z(x,q),l(&quot;;&quot;)):(i(q),Y(x,&quot;optional&quot;))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new zpe(b);C(x,function(q){switch(q){case&quot;option&quot;:Z(x,q),l(&quot;;&quot;);break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&amp;&amp;(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&amp;&amp;A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,&quot;name&quot;);l(&quot;=&quot;);var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne===&quot;option&quot;)Z(j,ne),l(&quot;;&quot;);else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b===&quot;option&quot;&amp;&amp;(b=a());b!==&quot;=&quot;;){if(b===&quot;(&quot;){var ne=a();l(&quot;)&quot;),b=&quot;(&quot;+ne+&quot;)&quot;}if(q){if(q=!1,b.includes(&quot;.&quot;)&amp;&amp;!b.includes(&quot;(&quot;)){var Le=b.split(&quot;.&quot;);x=Le[0]+&quot;.&quot;,b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&amp;&amp;j[0]===&quot;.&quot;?j.slice(1):j,x=x&amp;&amp;x[x.length-1]===&quot;.&quot;?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l(&quot;{&quot;,!0)){for(var x={};!l(&quot;}&quot;,!0);){if(!Xr.test(Ye=a()))throw N(Ye,&quot;name&quot;);if(Ye===null)throw N(Ye,&quot;end of input&quot;);var j,q=Ye;if(l(&quot;:&quot;,!0),n()===&quot;{&quot;)j=je(L,b+&quot;.&quot;+Ye);else if(n()===&quot;[&quot;){j=[];var ne;if(l(&quot;[&quot;,!0)){do ne=B(!0),j.push(ne);while(l(&quot;,&quot;,!0));l(&quot;]&quot;),typeof ne&lt;&quot;u&quot;&amp;&amp;me(L,b+&quot;.&quot;+Ye,ne)}}else j=B(!0),me(L,b+&quot;.&quot;+Ye,j);var Le=x[q];Le&amp;&amp;(j=[].concat(Le).concat(j)),x[q]=j,l(&quot;,&quot;,!0),l(&quot;;&quot;,!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&amp;&amp;/^features\./.test(b)){I[b]=x;return}L.setOption&amp;&amp;L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&amp;&amp;L.setParsedOption(b,x,j)}function We(L){if(l(&quot;[&quot;,!0)){do Z(L,&quot;option&quot;);while(l(&quot;,&quot;,!0));l(&quot;]&quot;)}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,&quot;service name&quot;);var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q===&quot;rpc&quot;)Do(x,q);else throw N(q)}),L.add(x),L===y&amp;&amp;A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var q=b,ne,Le,ut,Et;if(l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Le=!0),!Wr.test(b=a())||(ne=b,l(&quot;)&quot;),l(&quot;returns&quot;),l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(&quot;)&quot;);var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm===&quot;option&quot;)Z(Lu,dm),l(&quot;;&quot;);else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,&quot;reference&quot;);var x=b;C(null,function(q){switch(q){case&quot;required&quot;:case&quot;repeated&quot;:Y(L,q,x);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(L,&quot;proto3_optional&quot;,x):Y(L,&quot;optional&quot;,x);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(L,&quot;optional&quot;,x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case&quot;package&quot;:if(!u)throw N(Ye);le();break;case&quot;import&quot;:if(!u)throw N(Ye);v();break;case&quot;syntax&quot;:if(!u)throw N(Ye);W();break;case&quot;edition&quot;:if(!u)throw N(Ye);R();break;case&quot;option&quot;:Z(y,Ye),l(&quot;;&quot;,!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=&gt;{&quot;use strict&quot;;xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r=&quot;google/protobuf/&quot;+r+&quot;.proto&quot;,e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr(&quot;any&quot;,{Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}}});var Lq;Nr(&quot;duration&quot;,{Duration:Lq={fields:{seconds:{type:&quot;int64&quot;,id:1},nanos:{type:&quot;int32&quot;,id:2}}}});Nr(&quot;timestamp&quot;,{Timestamp:Lq});Nr(&quot;empty&quot;,{Empty:{fields:{}}});Nr(&quot;struct&quot;,{Struct:{fields:{fields:{keyType:&quot;string&quot;,type:&quot;Value&quot;,id:1}}},Value:{oneofs:{kind:{oneof:[&quot;nullValue&quot;,&quot;numberValue&quot;,&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;structValue&quot;,&quot;listValue&quot;]}},fields:{nullValue:{type:&quot;NullValue&quot;,id:1},numberValue:{type:&quot;double&quot;,id:2},stringValue:{type:&quot;string&quot;,id:3},boolValue:{type:&quot;bool&quot;,id:4},structValue:{type:&quot;Struct&quot;,id:5},listValue:{type:&quot;ListValue&quot;,id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:&quot;repeated&quot;,type:&quot;Value&quot;,id:1}}}});Nr(&quot;wrappers&quot;,{DoubleValue:{fields:{value:{type:&quot;double&quot;,id:1}}},FloatValue:{fields:{value:{type:&quot;float&quot;,id:1}}},Int64Value:{fields:{value:{type:&quot;int64&quot;,id:1}}},UInt64Value:{fields:{value:{type:&quot;uint64&quot;,id:1}}},Int32Value:{fields:{value:{type:&quot;int32&quot;,id:1}}},UInt32Value:{fields:{value:{type:&quot;uint32&quot;,id:1}}},BoolValue:{fields:{value:{type:&quot;bool&quot;,id:1}}},StringValue:{fields:{value:{type:&quot;string&quot;,id:1}}},BytesValue:{fields:{value:{type:&quot;bytes&quot;,id:1}}}});Nr(&quot;field_mask&quot;,{FieldMask:{fields:{paths:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=&gt;{&quot;use strict&quot;;var ii=wq.exports=vq();ii.build=&quot;full&quot;;ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=&gt;{&quot;use strict&quot;;Uq.exports=Dq()});var Vy=T((PFe,ode)=&gt;{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:&quot;google.golang.org/protobuf/types/descriptorpb&quot;,java_package:&quot;com.google.protobuf&quot;,java_outer_classname:&quot;DescriptorProtos&quot;,csharp_namespace:&quot;Google.Protobuf.Reflection&quot;,objc_class_prefix:&quot;GPB&quot;,cc_enable_arenas:!0,optimize_for:&quot;SPEED&quot;},nested:{FileDescriptorSet:{edition:&quot;proto2&quot;,fields:{file:{rule:&quot;repeated&quot;,type:&quot;FileDescriptorProto&quot;,id:1}},extensions:[[536e6,536e6]]},Edition:{edition:&quot;proto2&quot;,values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},package:{type:&quot;string&quot;,id:2},dependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},publicDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:10},weakDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:11},optionDependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:15},messageType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:4},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:5},service:{rule:&quot;repeated&quot;,type:&quot;ServiceDescriptorProto&quot;,id:6},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:7},options:{type:&quot;FileOptions&quot;,id:8},sourceCodeInfo:{type:&quot;SourceCodeInfo&quot;,id:9},syntax:{type:&quot;string&quot;,id:12},edition:{type:&quot;Edition&quot;,id:14}}},DescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},field:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:2},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:6},nestedType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:3},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:4},extensionRange:{rule:&quot;repeated&quot;,type:&quot;ExtensionRange&quot;,id:5},oneofDecl:{rule:&quot;repeated&quot;,type:&quot;OneofDescriptorProto&quot;,id:8},options:{type:&quot;MessageOptions&quot;,id:7},reservedRange:{rule:&quot;repeated&quot;,type:&quot;ReservedRange&quot;,id:9},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:10},visibility:{type:&quot;SymbolVisibility&quot;,id:11}},nested:{ExtensionRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2},options:{type:&quot;ExtensionRangeOptions&quot;,id:3}}},ReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},ExtensionRangeOptions:{edition:&quot;proto2&quot;,fields:{uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999},declaration:{rule:&quot;repeated&quot;,type:&quot;Declaration&quot;,id:2,options:{retention:&quot;RETENTION_SOURCE&quot;}},features:{type:&quot;FeatureSet&quot;,id:50},verification:{type:&quot;VerificationState&quot;,id:3,options:{default:&quot;UNVERIFIED&quot;,retention:&quot;RETENTION_SOURCE&quot;}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:&quot;int32&quot;,id:1},fullName:{type:&quot;string&quot;,id:2},type:{type:&quot;string&quot;,id:3},reserved:{type:&quot;bool&quot;,id:5},repeated:{type:&quot;bool&quot;,id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:3},label:{type:&quot;Label&quot;,id:4},type:{type:&quot;Type&quot;,id:5},typeName:{type:&quot;string&quot;,id:6},extendee:{type:&quot;string&quot;,id:2},defaultValue:{type:&quot;string&quot;,id:7},oneofIndex:{type:&quot;int32&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},options:{type:&quot;FieldOptions&quot;,id:8},proto3Optional:{type:&quot;bool&quot;,id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},options:{type:&quot;OneofOptions&quot;,id:2}}},EnumDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},value:{rule:&quot;repeated&quot;,type:&quot;EnumValueDescriptorProto&quot;,id:2},options:{type:&quot;EnumOptions&quot;,id:3},reservedRange:{rule:&quot;repeated&quot;,type:&quot;EnumReservedRange&quot;,id:4},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:5},visibility:{type:&quot;SymbolVisibility&quot;,id:6}},nested:{EnumReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},EnumValueDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{type:&quot;EnumValueOptions&quot;,id:3}}},ServiceDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},method:{rule:&quot;repeated&quot;,type:&quot;MethodDescriptorProto&quot;,id:2},options:{type:&quot;ServiceOptions&quot;,id:3}}},MethodDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},inputType:{type:&quot;string&quot;,id:2},outputType:{type:&quot;string&quot;,id:3},options:{type:&quot;MethodOptions&quot;,id:4},clientStreaming:{type:&quot;bool&quot;,id:5},serverStreaming:{type:&quot;bool&quot;,id:6}}},FileOptions:{edition:&quot;proto2&quot;,fields:{javaPackage:{type:&quot;string&quot;,id:1},javaOuterClassname:{type:&quot;string&quot;,id:8},javaMultipleFiles:{type:&quot;bool&quot;,id:10},javaGenerateEqualsAndHash:{type:&quot;bool&quot;,id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:&quot;bool&quot;,id:27},optimizeFor:{type:&quot;OptimizeMode&quot;,id:9,options:{default:&quot;SPEED&quot;}},goPackage:{type:&quot;string&quot;,id:11},ccGenericServices:{type:&quot;bool&quot;,id:16},javaGenericServices:{type:&quot;bool&quot;,id:17},pyGenericServices:{type:&quot;bool&quot;,id:18},deprecated:{type:&quot;bool&quot;,id:23},ccEnableArenas:{type:&quot;bool&quot;,id:31,options:{default:!0}},objcClassPrefix:{type:&quot;string&quot;,id:36},csharpNamespace:{type:&quot;string&quot;,id:37},swiftPrefix:{type:&quot;string&quot;,id:39},phpClassPrefix:{type:&quot;string&quot;,id:40},phpNamespace:{type:&quot;string&quot;,id:41},phpMetadataNamespace:{type:&quot;string&quot;,id:44},rubyPackage:{type:&quot;string&quot;,id:45},features:{type:&quot;FeatureSet&quot;,id:50},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],&quot;php_generic_services&quot;,[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:&quot;proto2&quot;,fields:{messageSetWireFormat:{type:&quot;bool&quot;,id:1},noStandardDescriptorAccessor:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},mapEntry:{type:&quot;bool&quot;,id:7},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:11,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:12},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:&quot;proto2&quot;,fields:{ctype:{type:&quot;CType&quot;,id:1,options:{default:&quot;STRING&quot;}},packed:{type:&quot;bool&quot;,id:2},jstype:{type:&quot;JSType&quot;,id:6,options:{default:&quot;JS_NORMAL&quot;}},lazy:{type:&quot;bool&quot;,id:5},unverifiedLazy:{type:&quot;bool&quot;,id:15},deprecated:{type:&quot;bool&quot;,id:3},weak:{type:&quot;bool&quot;,id:10,options:{deprecated:!0}},debugRedact:{type:&quot;bool&quot;,id:16},retention:{type:&quot;OptionRetention&quot;,id:17},targets:{rule:&quot;repeated&quot;,type:&quot;OptionTargetType&quot;,id:19},editionDefaults:{rule:&quot;repeated&quot;,type:&quot;EditionDefault&quot;,id:20},features:{type:&quot;FeatureSet&quot;,id:21},featureSupport:{type:&quot;FeatureSupport&quot;,id:22},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},value:{type:&quot;string&quot;,id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:&quot;Edition&quot;,id:1},editionDeprecated:{type:&quot;Edition&quot;,id:2},deprecationWarning:{type:&quot;string&quot;,id:3},editionRemoved:{type:&quot;Edition&quot;,id:4}}}}},OneofOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:1},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:&quot;proto2&quot;,fields:{allowAlias:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:6,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:7},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:1},features:{type:&quot;FeatureSet&quot;,id:2},debugRedact:{type:&quot;bool&quot;,id:3},featureSupport:{type:&quot;FieldOptions.FeatureSupport&quot;,id:4},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:34},deprecated:{type:&quot;bool&quot;,id:33},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:33},idempotencyLevel:{type:&quot;IdempotencyLevel&quot;,id:34,options:{default:&quot;IDEMPOTENCY_UNKNOWN&quot;}},features:{type:&quot;FeatureSet&quot;,id:35},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:&quot;proto2&quot;,fields:{name:{rule:&quot;repeated&quot;,type:&quot;NamePart&quot;,id:2},identifierValue:{type:&quot;string&quot;,id:3},positiveIntValue:{type:&quot;uint64&quot;,id:4},negativeIntValue:{type:&quot;int64&quot;,id:5},doubleValue:{type:&quot;double&quot;,id:6},stringValue:{type:&quot;bytes&quot;,id:7},aggregateValue:{type:&quot;string&quot;,id:8}},nested:{NamePart:{fields:{namePart:{rule:&quot;required&quot;,type:&quot;string&quot;,id:1},isExtension:{rule:&quot;required&quot;,type:&quot;bool&quot;,id:2}}}}},FeatureSet:{edition:&quot;proto2&quot;,fields:{fieldPresence:{type:&quot;FieldPresence&quot;,id:1,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.value&quot;:&quot;EXPLICIT&quot;}},enumType:{type:&quot;EnumType&quot;,id:2,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;OPEN&quot;}},repeatedFieldEncoding:{type:&quot;RepeatedFieldEncoding&quot;,id:3,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;PACKED&quot;}},utf8Validation:{type:&quot;Utf8Validation&quot;,id:4,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;VERIFY&quot;}},messageEncoding:{type:&quot;MessageEncoding&quot;,id:5,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_LEGACY&quot;,&quot;edition_defaults.value&quot;:&quot;LENGTH_PREFIXED&quot;}},jsonFormat:{type:&quot;JsonFormat&quot;,id:6,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;ALLOW&quot;}},enforceNamingStyle:{type:&quot;EnforceNamingStyle&quot;,id:7,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_METHOD&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;STYLE2024&quot;}},defaultSymbolVisibility:{type:&quot;VisibilityFeature.DefaultSymbolVisibility&quot;,id:8,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;EXPORT_TOP_LEVEL&quot;}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:&quot;proto2&quot;,fields:{defaults:{rule:&quot;repeated&quot;,type:&quot;FeatureSetEditionDefault&quot;,id:1},minimumEdition:{type:&quot;Edition&quot;,id:4},maximumEdition:{type:&quot;Edition&quot;,id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},overridableFeatures:{type:&quot;FeatureSet&quot;,id:4},fixedFeatures:{type:&quot;FeatureSet&quot;,id:5}},reserved:[[1,1],[2,2],&quot;features&quot;]}}},SourceCodeInfo:{edition:&quot;proto2&quot;,fields:{location:{rule:&quot;repeated&quot;,type:&quot;Location&quot;,id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},span:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:2,options:{packed:!0}},leadingComments:{type:&quot;string&quot;,id:3},trailingComments:{type:&quot;string&quot;,id:4},leadingDetachedComments:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:6}}}}},GeneratedCodeInfo:{edition:&quot;proto2&quot;,fields:{annotation:{rule:&quot;repeated&quot;,type:&quot;Annotation&quot;,id:1}},nested:{Annotation:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},sourceFile:{type:&quot;string&quot;,id:2},begin:{type:&quot;int32&quot;,id:3},end:{type:&quot;int32&quot;,id:4},semantic:{type:&quot;Semantic&quot;,id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:&quot;proto2&quot;,values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=&gt;{&quot;use strict&quot;;var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(&quot;.google.protobuf&quot;);var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a&lt;e.file.length;++a){s=t,(o=e.file[a]).package&amp;&amp;o.package.length&amp;&amp;(s=t.define(o.package));var n=Ede(o);if(o.name&amp;&amp;o.name.length&amp;&amp;t.files.push(s.filename=o.name),o.messageType)for(i=0;i&lt;o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i&lt;o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i&lt;o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i&lt;o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i&lt;c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,&quot;_&quot;)||&quot;root&quot;)+&quot;.proto&quot;});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s&lt;r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&amp;&amp;Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&amp;&amp;e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:&quot;Type&quot;+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a&lt;e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a&lt;e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty(&quot;oneofIndex&quot;)&amp;&amp;s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a&lt;e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a&lt;e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&amp;&amp;e.nestedType[a].options.mapEntry&amp;&amp;s.setOption(&quot;map_entry&quot;,!0);if(e.enumType)for(a=0;a&lt;e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&amp;&amp;e.extensionRange.length)for(s.extensions=[],a=0;a&lt;e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&amp;&amp;e.reservedRange.length||e.reservedName&amp;&amp;e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a&lt;e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a&lt;e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o&lt;this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&amp;&amp;Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:&quot;key&quot;,number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:&quot;value&quot;,number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o&lt;this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o&lt;this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&amp;&amp;t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o&lt;this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o&lt;this.reserved.length;++o)typeof this.reserved[o]==&quot;string&quot;?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e)),typeof e.number!=&quot;number&quot;)throw Error(&quot;missing field id&quot;);var s;e.typeName&amp;&amp;e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a=&quot;required&quot;;break;case 3:a=&quot;repeated&quot;;break;default:throw Error(&quot;illegal label: &quot;+e.label)}var i=e.extendee;e.extendee!==void 0&amp;&amp;(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:&quot;field&quot;+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&amp;&amp;(n.options.proto3_optional=!0),e.defaultValue&amp;&amp;e.defaultValue.length){var l=e.defaultValue;switch(l){case&quot;true&quot;:case&quot;TRUE&quot;:l=!0;break;case&quot;false&quot;:case&quot;FALSE&quot;:l=!1;break;default:var c=lde.exec(l);c&amp;&amp;(l=parseInt(l));break}n.setOption(&quot;default&quot;,l)}return hde(e.type)&amp;&amp;(t===&quot;proto3&quot;?e.options&amp;&amp;!e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!1):(!t||t===&quot;proto2&quot;)&amp;&amp;e.options&amp;&amp;e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule===&quot;repeated&quot;?t.label=3:this.required&amp;&amp;e===&quot;proto2&quot;?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&amp;&amp;(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))&lt;0)throw Error(&quot;missing oneof&quot;);return this.options&amp;&amp;(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&amp;&amp;(t.defaultValue=String(this.options.default)),this.options.proto3_optional&amp;&amp;(t.proto3_optional=!0)),e===&quot;proto3&quot;?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e===&quot;proto2&quot;)&amp;&amp;this.packed&amp;&amp;((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a&lt;e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&amp;&amp;i.length?i:&quot;NAME&quot;+n]=n}var l=new yn(e.name&amp;&amp;e.name.length?e.name:&quot;Enum&quot;+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t&lt;o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&amp;&amp;e.name.length?e.name:&quot;oneof&quot;+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&amp;&amp;e.name.length?e.name:&quot;Service&quot;+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a&lt;e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t&lt;this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&amp;&amp;e.name.length?e.name:&quot;Method&quot;+pde++,&quot;rpc&quot;,e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return&quot;double&quot;;case 2:return&quot;float&quot;;case 3:return&quot;int64&quot;;case 4:return&quot;uint64&quot;;case 5:return&quot;int32&quot;;case 6:return&quot;fixed64&quot;;case 7:return&quot;fixed32&quot;;case 8:return&quot;bool&quot;;case 9:return&quot;string&quot;;case 12:return&quot;bytes&quot;;case 13:return&quot;uint32&quot;;case 15:return&quot;sfixed32&quot;;case 16:return&quot;sfixed64&quot;;case 17:return&quot;sint32&quot;;case 18:return&quot;sint64&quot;}throw Error(&quot;illegal type: &quot;+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case&quot;double&quot;:return 1;case&quot;float&quot;:return 2;case&quot;int64&quot;:return 3;case&quot;uint64&quot;:return 4;case&quot;int32&quot;:return 5;case&quot;fixed64&quot;:return 6;case&quot;fixed32&quot;:return 7;case&quot;bool&quot;:return 8;case&quot;string&quot;:return 9;case&quot;bytes&quot;:return 12;case&quot;uint32&quot;:return 13;case&quot;sfixed32&quot;:return 15;case&quot;sfixed64&quot;:return 16;case&quot;sint32&quot;:return 17;case&quot;sint64&quot;:return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error(&quot;illegal type: &quot;+r)}function Vq(r,e){for(var t={},o=0,s,a;o&lt;e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!==&quot;uninterpretedOption&quot;&amp;&amp;Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s&lt;o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&amp;&amp;!Array.isArray(t[i])&amp;&amp;(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split(&quot;.&quot;),o=e.fullName.split(&quot;.&quot;),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&amp;&amp;e instanceof kq)for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&amp;&amp;n!==e)break;++a}else for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];++s,++a);return o.slice(a).join(&quot;.&quot;)}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return&quot;_&quot;+t.toLowerCase()})}function Ede(r){if(r.syntax===&quot;editions&quot;)switch(r.edition){case ae.Edition.EDITION_2023:return&quot;2023&quot;;default:throw new Error(&quot;Unsupported edition &quot;+r.edition)}return r.syntax===&quot;proto3&quot;?&quot;proto3&quot;:&quot;proto2&quot;}function mde(r,e){if(r)if(r===&quot;proto2&quot;||r===&quot;proto3&quot;)e.syntax=r;else switch(e.syntax=&quot;editions&quot;,r){case&quot;2023&quot;:e.edition=ae.Edition.EDITION_2023;break;default:throw new Error(&quot;Unsupported edition &quot;+r)}}});var jq=T((IFe,Tde)=&gt;{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:&quot;string&quot;,id:1},methods:{rule:&quot;repeated&quot;,type:&quot;Method&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},version:{type:&quot;string&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},mixins:{rule:&quot;repeated&quot;,type:&quot;Mixin&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Method:{fields:{name:{type:&quot;string&quot;,id:1},requestTypeUrl:{type:&quot;string&quot;,id:2},requestStreaming:{type:&quot;bool&quot;,id:3},responseTypeUrl:{type:&quot;string&quot;,id:4},responseStreaming:{type:&quot;bool&quot;,id:5},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Mixin:{fields:{name:{type:&quot;string&quot;,id:1},root:{type:&quot;string&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=&gt;{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var zq=T((LFe,gde)=&gt;{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:&quot;string&quot;,id:1},fields:{rule:&quot;repeated&quot;,type:&quot;Field&quot;,id:2},oneofs:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},syntax:{type:&quot;Syntax&quot;,id:6}}},Field:{fields:{kind:{type:&quot;Kind&quot;,id:1},cardinality:{type:&quot;Cardinality&quot;,id:2},number:{type:&quot;int32&quot;,id:3},name:{type:&quot;string&quot;,id:4},typeUrl:{type:&quot;string&quot;,id:6},oneofIndex:{type:&quot;int32&quot;,id:7},packed:{type:&quot;bool&quot;,id:8},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},defaultValue:{type:&quot;string&quot;,id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:&quot;string&quot;,id:1},enumvalue:{rule:&quot;repeated&quot;,type:&quot;EnumValue&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},sourceContext:{type:&quot;SourceContext&quot;,id:4},syntax:{type:&quot;Syntax&quot;,id:5}}},EnumValue:{fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var Wq=T(si=&gt;{&quot;use strict&quot;;Object.defineProperty(si,&quot;__esModule&quot;,{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V(&quot;fs&quot;),$q=V(&quot;path&quot;),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=&gt;{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error(&quot;The includeDirs option must be an array&quot;));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error(&quot;The includeDirs option must be an array&quot;);Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common(&quot;api&quot;,r.nested.google.nested.protobuf.nested),ha.common(&quot;descriptor&quot;,e.nested.google.nested.protobuf.nested),ha.common(&quot;source_context&quot;,t.nested.google.nested.protobuf.nested),ha.common(&quot;type&quot;,o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=&gt;{(function(r,e){function t(o){return o.default||o}typeof define==&quot;function&quot;&amp;&amp;define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c==&quot;object&quot;?(e($c),typeof Gy==&quot;object&quot;&amp;&amp;(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis&lt;&quot;u&quot;?globalThis:typeof self&lt;&quot;u&quot;?self:$c,function(r){&quot;use strict&quot;;Object.defineProperty(r,&quot;__esModule&quot;,{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,&quot;__isLong__&quot;,{value:!0});function o(R){return(R&amp;&amp;R.__isLong__)===!0}function s(R){var E=Math.clz32(R&amp;-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R&gt;&gt;&gt;=0,(Y=0&lt;=R&amp;&amp;R&lt;256)&amp;&amp;(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&amp;&amp;(i[R]=C),C)):(R|=0,(Y=-128&lt;=R&amp;&amp;R&lt;128)&amp;&amp;(Q=a[R],Q)?Q:(C=c(R,R&lt;0?-1:0,!1),Y&amp;&amp;(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R&lt;0)return N;if(R&gt;=A)return $}else{if(R&lt;=-I)return le;if(R+1&gt;=I)return te}return R&lt;0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error(&quot;empty string&quot;);if(typeof E==&quot;number&quot;?(C=E,E=!1):E=!!E,R===&quot;NaN&quot;||R===&quot;Infinity&quot;||R===&quot;+Infinity&quot;||R===&quot;-Infinity&quot;)return E?N:F;if(C=C||10,C&lt;2||36&lt;C)throw RangeError(&quot;radix&quot;);var Q;if((Q=R.indexOf(&quot;-&quot;))&gt;0)throw Error(&quot;interior hyphen&quot;);if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce&lt;R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne&lt;8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R==&quot;number&quot;?l(R,E):typeof R==&quot;string&quot;?f(R,E):c(R.low,R.high,typeof E==&quot;boolean&quot;?E:R.unsigned)}t.fromValue=_;var m=65536,O=1&lt;&lt;24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low&gt;&gt;&gt;0:this.low},v.toNumber=function(){return this.unsigned?(this.high&gt;&gt;&gt;0)*y+(this.low&gt;&gt;&gt;0):this.high*y+(this.low&gt;&gt;&gt;0)},v.toString=function(E){if(E=E||10,E&lt;2||36&lt;E)throw RangeError(&quot;radix&quot;);if(this.isZero())return&quot;0&quot;;if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return&quot;-&quot;+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne=&quot;&quot;;;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()&gt;&gt;&gt;0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length&lt;6;)Z=&quot;0&quot;+Z;Ne=&quot;&quot;+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high&gt;&gt;&gt;0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low&gt;&gt;&gt;0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C&gt;0&amp;&amp;(E&amp;1&lt;&lt;C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high&gt;&gt;21;return E?this.unsigned?!1:E===-1&amp;&amp;!(this.low===0&amp;&amp;this.high===-2097152):!0},v.isZero=function(){return this.high===0&amp;&amp;this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&amp;&amp;this.high&lt;0},v.isPositive=function(){return this.unsigned||this.high&gt;=0},v.isOdd=function(){return(this.low&amp;1)===1},v.isEven=function(){return(this.low&amp;1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&amp;&amp;this.high&gt;&gt;&gt;31===1&amp;&amp;E.high&gt;&gt;&gt;31===1?!1:this.high===E.high&amp;&amp;this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)&lt;0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)&lt;=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)&gt;0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)&gt;=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&amp;&amp;!Q?-1:!C&amp;&amp;Q?1:this.unsigned?E.high&gt;&gt;&gt;0&gt;this.high&gt;&gt;&gt;0||E.high===this.high&amp;&amp;E.low&gt;&gt;&gt;0&gt;this.low&gt;&gt;&gt;0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&amp;&amp;this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high&gt;&gt;&gt;16,Q=this.high&amp;65535,Y=this.low&gt;&gt;&gt;16,J=this.low&amp;65535,ce=E.high&gt;&gt;&gt;16,Ne=E.high&amp;65535,Me=E.low&gt;&gt;&gt;16,Te=E.low&amp;65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y+Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q+Ne,Z+=je&gt;&gt;&gt;16,je&amp;=65535,Z+=C+ce,Z&amp;=65535,c(me&lt;&lt;16|we,Z&lt;&lt;16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&amp;&amp;E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high&gt;&gt;&gt;16,Y=this.high&amp;65535,J=this.low&gt;&gt;&gt;16,ce=this.low&amp;65535,Ne=E.high&gt;&gt;&gt;16,Me=E.high&amp;65535,Te=E.low&gt;&gt;&gt;16,Z=E.low&amp;65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We&gt;&gt;&gt;16,We&amp;=65535,we+=J*Z,me+=we&gt;&gt;&gt;16,we&amp;=65535,we+=ce*Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y*Z,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=J*Te,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=ce*Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&amp;=65535,c(we&lt;&lt;16|We,je&lt;&lt;16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error(&quot;division by zero&quot;);if(e){if(!this.unsigned&amp;&amp;this.high===-2147483648&amp;&amp;E.low===-1&amp;&amp;E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne&lt;=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&amp;&amp;(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&amp;E.low,this.high&amp;E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&lt;&lt;E,this.high&lt;&lt;E|this.low&gt;&gt;&gt;32-E,this.unsigned):c(0,this.low&lt;&lt;E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;E,this.unsigned):c(this.high&gt;&gt;E-32,this.high&gt;=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;&gt;E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high&gt;&gt;&gt;E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.unsigned)):(E-=32,C=32-E,c(this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.unsigned)):(E-=32,C=32-E,c(this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&amp;255,C&gt;&gt;&gt;8&amp;255,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;24,E&amp;255,E&gt;&gt;&gt;8&amp;255,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E&gt;&gt;&gt;24,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;8&amp;255,E&amp;255,C&gt;&gt;&gt;24,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;8&amp;255,C&amp;255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]&lt;&lt;8|E[2]&lt;&lt;16|E[3]&lt;&lt;24,E[4]|E[5]&lt;&lt;8|E[6]&lt;&lt;16|E[7]&lt;&lt;24,C)},t.fromBytesBE=function(E,C){return new t(E[4]&lt;&lt;24|E[5]&lt;&lt;16|E[6]&lt;&lt;8|E[7],E[0]&lt;&lt;24|E[1]&lt;&lt;16|E[2]&lt;&lt;8|E[3],C)},typeof BigInt==&quot;function&quot;&amp;&amp;(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E&gt;&gt;BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E==&quot;bigint&quot;?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low&gt;&gt;&gt;0),C=BigInt(this.unsigned?this.high&gt;&gt;&gt;0:this.high);return C&lt;&lt;BigInt(32)|E});var W=r.default=t})});var ij=T(Je=&gt;{&quot;use strict&quot;;Object.defineProperty(Je,&quot;__esModule&quot;,{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return&quot;@type&quot;in r&amp;&amp;typeof r[&quot;@type&quot;]==&quot;string&quot;}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN=&quot;IDEMPOTENCY_UNKNOWN&quot;,r.NO_SIDE_EFFECTS=&quot;NO_SIDE_EFFECTS&quot;,r.IDEMPOTENT=&quot;IDEMPOTENT&quot;})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===&quot;&quot;?e:r+&quot;.&quot;+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&amp;&amp;typeof r.nested&lt;&quot;u&quot;?Object.keys(r.nested).map(o=&gt;rj(r.nested[o],t)).reduce((o,s)=&gt;o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=&gt;{for(let[o,s]of Object.entries(t))switch(o){case&quot;uninterpreted_option&quot;:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:&quot;/&quot;+e+&quot;/&quot;+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 DescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 EnumDescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error(&quot;Type mismatch in reflection object handling&quot;)}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor(&quot;proto3&quot;).file.map(a=&gt;Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,&quot;&quot;))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=&gt;N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=&gt;{&quot;use strict&quot;;Object.defineProperty(Ie,&quot;__esModule&quot;,{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V(&quot;net&quot;),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)===&quot;channel&quot;?o:void 0,childSubchannel:(o==null?void 0:o.kind)===&quot;subchannel&quot;?o:void 0}),this.events.length&gt;=oj*2&amp;&amp;(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=&gt;({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&amp;&amp;(o.count-=1,o.count===0&amp;&amp;t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=&gt;{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=&gt;{let n=t(),l={id:n,name:s,kind:r};return i&amp;&amp;o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_(&quot;channel&quot;);Ie.registerChannelzSubchannel=x_(&quot;subchannel&quot;);Ie.registerChannelzServer=x_(&quot;server&quot;);Ie.registerChannelzSocket=x_(&quot;socket&quot;);function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r===&quot;&quot;)return[];let e=r.split(&quot;:&quot;).map(o=&gt;Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&amp;&amp;r.toLowerCase().startsWith(&quot;::ffff:&quot;)&amp;&amp;(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(&quot;.&quot;).map(e=&gt;Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf(&quot;::&quot;);o===-1?(e=r,t=&quot;&quot;):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:&quot;CONNECTING&quot;};case Xc.ConnectivityState.IDLE:return{state:&quot;IDLE&quot;};case Xc.ConnectivityState.READY:return{state:&quot;READY&quot;};case Xc.ConnectivityState.SHUTDOWN:return{state:&quot;SHUTDOWN&quot;};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:&quot;TRANSIENT_FAILURE&quot;};default:return{state:&quot;UNKNOWN&quot;}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=&gt;{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=&gt;{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No channel data found for id &quot;+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&amp;&amp;o.length&lt;t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=&gt;{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&amp;&amp;a.length&lt;t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No subchannel data found for id &quot;+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=&gt;{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:&quot;tcpip_address&quot;,tcpip_address:{ip_address:(e=Kde(r.host))!==null&amp;&amp;e!==void 0?e:void 0,port:r.port}}:{address:&quot;uds_address&quot;,uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No socket data found for id &quot;+n});return}let c=l.getInfo(),u=c.security?{model:&quot;tls&quot;,tls:{cipher_suite:c.security.cipherSuiteStandardName?&quot;standard_name&quot;:&quot;other_name&quot;,standard_name:(t=c.security.cipherSuiteStandardName)!==null&amp;&amp;t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&amp;&amp;o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&amp;&amp;s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&amp;&amp;a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&amp;&amp;i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&amp;&amp;l.length&lt;a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r(&quot;channelz.proto&quot;,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=&gt;{&quot;use strict&quot;;Object.defineProperty(w_,&quot;__esModule&quot;,{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe=&quot;subchannel&quot;,she=~(1&lt;&lt;31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new rhe.BackoffTimeout(()=&gt;{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;i!==void 0?i:-1,o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Subchannel created&quot;),this.trace(&quot;Subchannel constructed with options &quot;+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,&quot;subchannel_refcount&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[&quot;grpc.keepalive_time_ms&quot;]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{&quot;grpc.keepalive_time_ms&quot;:t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&amp;&amp;this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=&gt;{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&amp;&amp;this.keepaliveTime&gt;0&amp;&amp;(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]+&#x27; with error &quot;&#x27;+o+&#x27;&quot;&#x27;):this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]),this.channelzEnabled&amp;&amp;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=&gt;{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount-1)),this.refcount-=1,this.refcount===0&amp;&amp;(this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Shutting down&quot;),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error(&quot;Cannot create call, subchannel not READY&quot;);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=&gt;{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=&gt;{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e&gt;this.keepaliveTime&amp;&amp;(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=&gt;{&quot;use strict&quot;;var eO;Object.defineProperty(D_,&quot;__esModule&quot;,{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&amp;&amp;eO!==void 0?eO:&quot;false&quot;)===&quot;true&quot;});var oO=T(Eo=&gt;{&quot;use strict&quot;;Object.defineProperty(Eo,&quot;__esModule&quot;,{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V(&quot;dns&quot;),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V(&quot;net&quot;),uhe=Nc(),Tj=_j(),fhe=&quot;dns_resolver&quot;;function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn(&quot;Resolver constructed for target &quot;+(0,ai.uriToString)(e)),e.authority&amp;&amp;this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&amp;&amp;s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&amp;&amp;a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o[&quot;grpc.service_config_disable_resolution&quot;]===1&amp;&amp;(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoff=new uhe.BackoffTimeout(()=&gt;{this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o[&quot;grpc.dns_min_time_between_resolutions_ms&quot;])!==null&amp;&amp;i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=&gt;{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn(&quot;Returning IP address for target &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn(&quot;Failed to parse DNS address &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn(&quot;Looking up DNS hostname &quot;+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=&gt;{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=&gt;({addresses:[s]}));let o=&quot;[&quot;+t.map(s=&gt;s.host+&quot;:&quot;+s.port).join(&quot;,&quot;)+&quot;]&quot;;if(tn(&quot;Resolved addresses for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=&gt;{this.pendingLookupPromise!==null&amp;&amp;(tn(&quot;Resolution error for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&amp;&amp;this.pendingTxtPromise===null&amp;&amp;(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=&gt;{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&amp;&amp;this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=&gt;{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn(&quot;Using alternative DNS resolver.&quot;);let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=&gt;s.status===&quot;rejected&quot;))throw new Error(o[0].reason);return o.reduce((s,a)=&gt;a.status===&quot;fulfilled&quot;?[...s,...a.value]:s,[]).map(s=&gt;({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=&gt;({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn(&quot;Using alternative DNS resolver.&quot;),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=&gt;{this.stopNextResolutionTimer(),this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&amp;&amp;(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&amp;&amp;(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn(&#x27;resolution update delayed by &quot;min time between resolutions&quot; rate limit&#x27;):tn(&quot;resolution update delayed by backoff timer until &quot;+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)(&quot;dns&quot;,iO),(0,Ej.registerDefaultScheme)(&quot;dns&quot;)}});var sO=T(Zc=&gt;{&quot;use strict&quot;;Object.defineProperty(Zc,&quot;__esModule&quot;,{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V(&quot;net&quot;),hhe=V(&quot;http&quot;),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V(&quot;url&quot;),mhe=oO(),The=&quot;proxy&quot;;function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r=&quot;&quot;,e=&quot;&quot;;if(process.env.grpc_proxy)e=&quot;grpc_proxy&quot;,r=process.env.grpc_proxy;else if(process.env.https_proxy)e=&quot;https_proxy&quot;,r=process.env.https_proxy;else if(process.env.http_proxy)e=&quot;http_proxy&quot;,r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of &quot;${e}&quot; env var`),{}}if(t.protocol!==&quot;http:&quot;)return(0,Jc.log)(_a.LogVerbosity.ERROR,`&quot;${t.protocol}&quot; scheme not supported in proxy URI`),{};let o=null;t.username&amp;&amp;(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,&quot;userinfo found in proxy URI&quot;),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===&quot;&quot;&amp;&amp;(a=&quot;80&quot;);let i={address:`${s}:${a}`};return o&amp;&amp;(i.creds=o),Ea(&quot;Proxy server &quot;+i.address+&quot; set by environment variable &quot;+e),i}function ghe(){let r=process.env.no_grpc_proxy,e=&quot;no_grpc_proxy&quot;;return r||(r=process.env.no_proxy,e=&quot;no_proxy&quot;),r?(Ea(&quot;No proxy server list set by environment variable &quot;+e),r.split(&quot;,&quot;)):[]}function vj(r){let e=r.split(&quot;/&quot;);if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t&lt;0||t&gt;32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(&quot;.&quot;).reduce((e,t)=&gt;(e&lt;&lt;8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1&lt;&lt;32-r.prefixLength;return(yj(e)&amp;o)===(t&amp;o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&amp;&amp;t&amp;&amp;vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e[&quot;grpc.enable_http_proxy&quot;])!==null&amp;&amp;t!==void 0?t:1)===0||r.scheme===&quot;unix&quot;)return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea(&quot;Not using proxy for target in no_proxy list: &quot;+(0,Qc.uriToString)(r)),o;let n={&quot;grpc.http_connect_target&quot;:(0,Qc.uriToString)(r)};return s.creds&amp;&amp;(n[&quot;grpc.http_connect_creds&quot;]=s.creds),{target:{scheme:&quot;dns&quot;,path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!(&quot;grpc.http_connect_target&quot;in e))return Promise.resolve(null);let o=e[&quot;grpc.http_connect_target&quot;],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&amp;&amp;t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:&quot;CONNECT&quot;,path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,&quot;grpc.http_connect_creds&quot;in e&amp;&amp;(l[&quot;Proxy-Authorization&quot;]=&quot;Basic &quot;+Buffer.from(e[&quot;grpc.http_connect_creds&quot;]).toString(&quot;base64&quot;)),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea(&quot;Using proxy &quot;+c+&quot; to connect to &quot;+n.path),new Promise((u,f)=&gt;{let _=hhe.request(n);_.once(&quot;connect&quot;,(m,O,y)=&gt;{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea(&quot;Successfully connected to &quot;+n.path+&quot; through proxy &quot;+c),y.length&gt;0&amp;&amp;O.unshift(y),Ea(&quot;Successfully established a plaintext connection to &quot;+n.path+&quot; through proxy &quot;+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to &quot;+n.path+&quot; through proxy &quot;+c+&quot; with status &quot;+m.statusCode),f())}),_.once(&quot;error&quot;,m=&gt;{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to proxy &quot;+c+&quot; with error &quot;+m.message),f()}),_.end()})}});var lO=T(U_=&gt;{&quot;use strict&quot;;Object.defineProperty(U_,&quot;__esModule&quot;,{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]=&quot;NO_DATA&quot;,r[r.READING_SIZE=1]=&quot;READING_SIZE&quot;,r[r.READING_MESSAGE=2]=&quot;READING_MESSAGE&quot;})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t&lt;e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&amp;&amp;this.readMessageSize&gt;this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining&gt;0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error(&quot;Unexpected read state&quot;)}return s}};U_.StreamDecoder=aO});var Oj=T(k_=&gt;{&quot;use strict&quot;;Object.defineProperty(k_,&quot;__esModule&quot;,{value:!0});k_.Http2SubchannelCall=void 0;var An=V(&quot;http2&quot;),Rhe=V(&quot;os&quot;),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe=&quot;subchannel_call&quot;;function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return&quot;Unknown system error &quot;+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on(&quot;response&quot;,(l,c)=&gt;{let u=&quot;&quot;;for(let f of Object.keys(l))u+=&quot; &quot;+f+&quot;: &quot;+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[&quot;:status&quot;],c&amp;An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on(&quot;trailers&quot;,l=&gt;{this.handleTrailers(l)}),e.on(&quot;data&quot;,l=&gt;{if(this.statusOutput)return;this.trace(&quot;receive HTTP/2 data frame of length &quot;+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace(&quot;parsed message of length &quot;+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on(&quot;end&quot;,()=&gt;{this.readsClosed=!0,this.maybeOutputStatus()}),e.on(&quot;close&quot;,()=&gt;{this.serverEndedCall=!0,process.nextTick(()=&gt;{var l;if(this.trace(&quot;HTTP/2 stream closed with code &quot;+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u=&quot;&quot;;switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u=&quot;Stream refused by server&quot;;break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u=&quot;Connection dropped&quot;):(c=Oe.Status.CANCELLED,u=&quot;Call cancelled&quot;);break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u=&quot;Bandwidth exhausted or memory limit exceeded&quot;;break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u=&quot;Protocol not secure enough&quot;;break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code===&quot;ECONNRESET&quot;||this.internalError.code===&quot;ETIMEDOUT&quot;?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on(&quot;error&quot;,l=&gt;{l.code!==&quot;ERR_HTTP2_STREAM_ERROR&quot;&amp;&amp;(this.trace(&quot;Node error event: message=&quot;+l.message+&quot; code=&quot;+l.code+&quot; errno=&quot;+bhe(l.errno)+&quot; syscall=&quot;+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=&gt;{this.endCall({code:Oe.Status.UNAVAILABLE,details:&quot;Connection dropped&quot;,metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace(&quot;ended with status: code=&quot;+this.finalStatus.code+&#x27; details=&quot;&#x27;+this.finalStatus.details+&#x27;&quot;&#x27;),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=&gt;{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,&quot;[&quot;+this.callId+&quot;] &quot;+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&amp;&amp;(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&amp;&amp;(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&amp;&amp;this.unpushedReadMessages.length===0&amp;&amp;!this.isReadFilterPending&amp;&amp;!this.isPushPending)&amp;&amp;this.outputStatus()}push(e){this.trace(&quot;pushing to reader message of length &quot;+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=&gt;{this.isPushPending=!1,!this.statusOutput&amp;&amp;(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace(&quot;unpushedReadMessages.push message of length &quot;+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t=&quot;&quot;;for(let i of Object.keys(e))t+=&quot; &quot;+i+&quot;: &quot;+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s[&quot;grpc-status&quot;]==&quot;string&quot;){let i=Number(s[&quot;grpc-status&quot;]);this.trace(&quot;received status code &quot;+i+&quot; from server&quot;),o.remove(&quot;grpc-status&quot;);let n=&quot;&quot;;if(typeof s[&quot;grpc-message&quot;]==&quot;string&quot;){try{n=decodeURI(s[&quot;grpc-message&quot;])}catch{n=s[&quot;grpc-message&quot;]}o.remove(&quot;grpc-message&quot;),this.trace(&#x27;received status details string &quot;&#x27;+n+&#x27;&quot; from server&#x27;)}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:&quot;No status information received&quot;,metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace(&quot;close http2 stream with code &quot;+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&amp;&amp;this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length&gt;0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length);let o=s=&gt;{process.nextTick(()=&gt;{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)===&quot;ERR_STREAM_WRITE_AFTER_END&quot;&amp;&amp;(i=Oe.Status.INTERNAL),s&amp;&amp;this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace(&quot;sending data chunk of length &quot;+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace(&quot;end() called&quot;),this.trace(&quot;calling end() on HTTP/2 stream&quot;),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=&gt;{&quot;use strict&quot;;Object.defineProperty(fO,&quot;__esModule&quot;,{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=&gt;{&quot;use strict&quot;;Object.defineProperty(F_,&quot;__esModule&quot;,{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V(&quot;http2&quot;),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V(&quot;net&quot;),Uhe=Oj(),khe=pO(),hO=&quot;transport&quot;,Bhe=&quot;transport_flowctrl&quot;,Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from(&quot;too_many_pings&quot;,&quot;ascii&quot;),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o[&quot;grpc.primary_user_agent&quot;],`grpc-node-js/${Vhe}`,o[&quot;grpc.secondary_user_agent&quot;]].filter(a=&gt;a).join(&quot; &quot;),&quot;grpc.keepalive_time_ms&quot;in o?this.keepaliveTimeMs=o[&quot;grpc.keepalive_time_ms&quot;]:this.keepaliveTimeMs=-1,&quot;grpc.keepalive_timeout_ms&quot;in o?this.keepaliveTimeoutMs=o[&quot;grpc.keepalive_timeout_ms&quot;]:this.keepaliveTimeoutMs=zhe,&quot;grpc.keepalive_permit_without_calls&quot;in o?this.keepaliveWithoutCalls=o[&quot;grpc.keepalive_permit_without_calls&quot;]===1:this.keepaliveWithoutCalls=!1,e.once(&quot;close&quot;,()=&gt;{this.trace(&quot;session closed&quot;),this.handleDisconnect()}),e.once(&quot;goaway&quot;,(a,i,n)=&gt;{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&amp;&amp;n&amp;&amp;n.equals(Khe)&amp;&amp;(l=!0),this.trace(&quot;connection closed by GOAWAY with code &quot;+a+&quot; and data &quot;+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once(&quot;error&quot;,a=&gt;{this.trace(&quot;connection closed with error &quot;+a.message),this.handleDisconnect()}),e.socket.once(&quot;close&quot;,a=&gt;{this.trace(&quot;connection closed. hadError=&quot;+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&amp;&amp;(e.on(&quot;remoteSettings&quot;,a=&gt;{this.trace(&quot;new settings received&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))}),e.on(&quot;localSettings&quot;,a=&gt;{this.trace(&quot;local settings acknowledged by remote&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))})),this.keepaliveWithoutCalls&amp;&amp;this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&amp;&amp;e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&amp;&amp;&quot;raw&quot;in f?f.raw:null,remoteCertificate:_&amp;&amp;&quot;raw&quot;in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&amp;&amp;t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&amp;&amp;o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;transport_internals&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=&gt;t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=&gt;{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&amp;&amp;this.keepaliveTimeMs&gt;0&amp;&amp;(this.keepaliveWithoutCalls||this.activeCalls.size&gt;0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(&quot;keepaliveTimeout is not null&quot;);return}this.channelzEnabled&amp;&amp;(this.keepalivesSent+=1),this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o=&quot;&quot;;try{this.session.ping((a,i,n)=&gt;{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace(&quot;Ping failed with error &quot;+a.message),this.handleDisconnect()):(this.keepaliveTrace(&quot;Received ping response&quot;),this.maybeStartKeepalivePingTimer())})||(o=&quot;Ping returned false&quot;)}catch(s){o=(s instanceof Error?s.message:&quot;&quot;)||&quot;Unknown error&quot;}o&amp;&amp;(this.keepaliveTrace(&quot;Ping send failed: &quot;+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&amp;&amp;(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&amp;&amp;(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&amp;&amp;this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&amp;&amp;(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]=&quot;application/grpc&quot;,i[Hhe]=&quot;POST&quot;,i[qhe]=o,i[jhe]=&quot;trailers&quot;;let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace(&quot;local window size: &quot;+this.session.state.localWindowSize+&quot; remote window size: &quot;+this.session.state.remoteWindowSize),this.internalsTrace(&quot;session.closed=&quot;+this.session.closed+&quot; session.destroyed=&quot;+this.session.destroyed+&quot; session.socket.destroyed=&quot;+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=&gt;{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=&gt;{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+&quot; &quot;+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(&quot;Connection closed before starting HTTP/2 handshake&quot;):new Promise((s,a)=&gt;{let i=null,n=this.channelTarget;if(&quot;grpc.http_connect_target&quot;in o){let A=(0,dO.parseUri)(o[&quot;grpc.http_connect_target&quot;]);A&amp;&amp;(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?&quot;https&quot;:&quot;http&quot;,c=(0,whe.getDefaultAuthority)(n),u=()=&gt;{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=&gt;{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=&gt;{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace(&quot;connection failed with error &quot;+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=&gt;e.socket};o[&quot;grpc-node.flow_control_window&quot;]!==void 0&amp;&amp;(_.settings={initialWindowSize:o[&quot;grpc-node.flow_control_window&quot;]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O=&quot;Failed to connect&quot;,y=!1;m.unref(),m.once(&quot;remoteSettings&quot;,()=&gt;{m.removeAllListeners(),e.socket.removeListener(&quot;close&quot;,u),e.socket.removeListener(&quot;error&quot;,f),s(new _O(m,t,o,i)),this.session=null}),m.once(&quot;close&quot;,u),m.once(&quot;error&quot;,f),e.socket.once(&quot;close&quot;,u),e.socket.once(&quot;error&quot;,f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=&gt;o||new Promise((s,a)=&gt;{let i=()=&gt;{a(new Error(&quot;Socket closed&quot;))},n=c=&gt;{a(c)},l=Dhe.connect(e,()=&gt;{l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),s(l)});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+&quot; Waiting for secureConnector to be ready&quot;),await t.waitForReady(),this.trace(i+&quot; secureConnector is ready&quot;),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+&quot; Established TCP connection&quot;),a=await t.connect(s),this.trace(i+&quot; Established secure connection&quot;),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=&gt;{&quot;use strict&quot;;Object.defineProperty(ru,&quot;__esModule&quot;,{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=&gt;!a.subchannel.unrefIfOneRef());s.length&gt;0&amp;&amp;(e=!1),this.pool[t]=s}e&amp;&amp;this.cleanupTimer!==null&amp;&amp;(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&amp;&amp;(this.cleanupTimer=setInterval(()=&gt;{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&amp;&amp;(0,$he.channelOptionsEqual)(o,l.channelArguments)&amp;&amp;s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=&gt;{&quot;use strict&quot;;Object.defineProperty(Ta,&quot;__esModule&quot;,{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=&gt;e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=&gt;{&quot;use strict&quot;;Object.defineProperty(H_,&quot;__esModule&quot;,{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]=&quot;identity&quot;,r[r.deflate=1]=&quot;deflate&quot;,r[r.gzip=2]=&quot;gzip&quot;})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=&gt;{&quot;use strict&quot;;Object.defineProperty(q_,&quot;__esModule&quot;,{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=&gt;{&quot;use strict&quot;;Object.defineProperty(va,&quot;__esModule&quot;,{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V(&quot;zlib&quot;),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=&gt;typeof r==&quot;number&quot;&amp;&amp;typeof Pj.CompressionAlgorithms[r]==&quot;string&quot;,ga=class{async writeMessage(e,t){let o=e;t&amp;&amp;(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&amp;&amp;(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error(&#x27;Received compressed message but &quot;grpc-encoding&quot; header was identity&#x27;))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.deflate(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createInflate();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.gzip(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createGunzip();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case&quot;identity&quot;:return new mo;case&quot;deflate&quot;:return new OO(e);case&quot;gzip&quot;:return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;;let i=e[&quot;grpc.default_compression_algorithm&quot;];if(this.maxReceiveMessageLength=(o=e[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e[&quot;grpc.max_send_message_length&quot;])!==null&amp;&amp;s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(&quot;,&quot;);(!l||l.includes(n))&amp;&amp;(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set(&quot;grpc-accept-encoding&quot;,&quot;identity,deflate,gzip&quot;),t.set(&quot;accept-encoding&quot;,&quot;identity&quot;),this.currentCompressionAlgorithm===&quot;identity&quot;?t.remove(&quot;grpc-encoding&quot;):t.set(&quot;grpc-encoding&quot;,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(&quot;grpc-encoding&quot;);if(t.length&gt;0){let s=t[0];typeof s==&quot;string&quot;&amp;&amp;(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove(&quot;grpc-encoding&quot;);let o=e.get(&quot;grpc-accept-encoding&quot;)[0];return o&amp;&amp;(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(&quot;,&quot;).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;)),e.remove(&quot;grpc-accept-encoding&quot;),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&amp;&amp;o.message.length&gt;this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&amp;&amp;t!==void 0?t:0)&amp;2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=&gt;{&quot;use strict&quot;;Object.defineProperty(To,&quot;__esModule&quot;,{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o&lt;e&amp;&amp;(e=o)}return e}var s_e=[[&quot;m&quot;,1],[&quot;S&quot;,1e3],[&quot;M&quot;,60*1e3],[&quot;H&quot;,3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&amp;&amp;(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a&lt;1e8)return String(Math.ceil(a))+o}throw new Error(&quot;Deadline is too far in the future&quot;)}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o&lt;0?0:o&gt;l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?&quot;&quot;+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+&quot;s&quot;}});var z_=T(CO=&gt;{&quot;use strict&quot;;Object.defineProperty(CO,&quot;__esModule&quot;,{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=&gt;{&quot;use strict&quot;;Object.defineProperty(X_,&quot;__esModule&quot;,{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V(&quot;http2&quot;),m_e=&quot;load_balancing_call&quot;,IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split(&quot;/&quot;),f=&quot;&quot;;u.length&gt;=2&amp;&amp;(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&amp;&amp;c!==void 0?c:&quot;localhost&quot;;this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime&gt;this.startTime&amp;&amp;(!((e=this.metadata)===null||e===void 0)&amp;&amp;e.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(&quot;Waiting for LB pick&quot;),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error(&quot;doPick called before start&quot;);this.trace(&quot;Pick called&quot;);let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?&quot;(&quot;+s.subchannel.getChannelzRef().id+&quot;) &quot;+s.subchannel.getAddress():&quot;&quot;+s.subchannel;switch(this.trace(&quot;Pick result: &quot;+iu.PickResultType[s.pickResultType]+&quot; subchannel: &quot;+a+&quot; status: &quot;+((e=s.status)===null||e===void 0?void 0:e.code)+&quot; &quot;+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=&gt;{var u;if(this.ended){this.trace(&quot;Credentials metadata generation finished after call ended&quot;);return}if(o.merge(c),o.get(&quot;authorization&quot;).length&gt;1&amp;&amp;this.outputStatus({code:K_.Status.INTERNAL,details:&#x27;&quot;authorization&quot; metadata cannot have multiple values&#x27;,metadata:new $_.Metadata},&quot;PROCESSED&quot;),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace(&quot;Picked subchannel &quot;+a+&quot; has state &quot;+bj.ConnectivityState[s.subchannel.getConnectivityState()]+&quot; after getting credentials metadata. Retrying pick&quot;),this.doPick();return}this.deadline!==1/0&amp;&amp;o.set(&quot;grpc-timeout&quot;,(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=&gt;{this.trace(&quot;Received message&quot;),this.listener.onReceiveMessage(f)},onReceiveStatus:f=&gt;{this.trace(&quot;Received status&quot;),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,&quot;REFUSED&quot;):this.outputStatus(f,&quot;PROCESSED&quot;)}}),this.childStartTime=new Date}catch(f){this.trace(&quot;Failed to start call on picked subchannel &quot;+a+&quot; with error &quot;+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:&quot;Failed to start HTTP/2 stream with error &quot;+f.message,metadata:new $_.Metadata},&quot;NOT_STARTED&quot;);return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace(&quot;Created child call [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage&amp;&amp;this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&amp;&amp;this.child.halfClose()},c=&gt;{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code==&quot;number&quot;?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},&quot;PROCESSED&quot;)});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:n,details:l,metadata:s.status.metadata},&quot;DROP&quot;)});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:c,details:u,metadata:s.status.metadata},&quot;PROCESSED&quot;)})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},&quot;PROCESSED&quot;)}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=&gt;{&quot;use strict&quot;;Object.defineProperty(W_,&quot;__esModule&quot;,{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e=&quot;resolving_call&quot;,bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=&gt;{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&amp;&amp;(o.flags&amp;So.Propagate.CANCELLATION&amp;&amp;o.parentCall.on(&quot;cancelled&quot;,()=&gt;{this.cancelWithStatus(So.Status.CANCELLED,&quot;Cancelled by parent call&quot;)}),o.flags&amp;So.Propagate.DEADLINE&amp;&amp;(this.trace(&quot;Propagating deadline from parent: &quot;+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace(&quot;Created&quot;),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(&quot;Deadline: &quot;+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(&quot;Deadline will be reached in &quot;+e+&quot;ms&quot;);let t=()=&gt;{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,&quot;Deadline exceeded&quot;);return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime&gt;this.deadlineStartTime&amp;&amp;o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime&gt;this.configReceivedTime&amp;&amp;o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push(&quot;waiting for metadata filters&quot;)):o.push(&quot;waiting for name resolution&quot;),this.child&amp;&amp;o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(&quot;,&quot;))};e&lt;=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(&quot;ended with status: code=&quot;+t.code+&#x27; details=&quot;&#x27;+t.details+&#x27;&quot;&#x27;),this.statusWatchers.forEach(o=&gt;o(t)),process.nextTick(()=&gt;{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error(&quot;sendMessageonChild called with child not populated&quot;);let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=&gt;{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&amp;&amp;o.halfClose()},s=&gt;{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error(&quot;getConfig called before start&quot;);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===&quot;NONE&quot;){this.channel.queueCallForConfig(this);return}else if(e.type===&quot;ERROR&quot;){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,&quot;Failed to route call to method &quot;+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=&gt;{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(&quot;Created child [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=&gt;{this.trace(&quot;Received message&quot;),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=&gt;{this.trace(&quot;Finished filtering received message&quot;),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&amp;&amp;this.outputStatus(this.pendingChildStatus)},a=&gt;{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=&gt;{this.trace(&quot;Received status&quot;),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&amp;&amp;this.child.halfClose()},o=&gt;{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child&amp;&amp;!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=&gt;{&quot;use strict&quot;;Object.defineProperty(li,&quot;__esModule&quot;,{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e=&quot;retrying_call&quot;,xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens&gt;this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;return this.limitPerCall-s&lt;e||this.totalLimit-this.totalAllocated&lt;e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;if(s&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&amp;&amp;t!==void 0?t:0;if(this.totalAllocated&lt;o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO=&quot;grpc-previous-rpc-attempts&quot;,N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()[&quot;grpc-node.retry_max_attempts_limit&quot;])!==null&amp;&amp;u!==void 0?u:N_e;if(e.getOptions()[&quot;grpc.enable_retries&quot;]===0)this.state=&quot;NO_RETRY&quot;,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=&quot;RETRY&quot;;let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state=&quot;HEDGING&quot;,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state=&quot;TRANSPARENT_ONLY&quot;,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length&gt;1&amp;&amp;e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime&gt;this.startTime&amp;&amp;e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}reportStatus(e){this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=&gt;{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():&quot;unknown&quot;}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&amp;&amp;t!==void 0?t:{entryType:&quot;FREED&quot;,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==&quot;COMMITTED&quot;)return;let e;this.underlyingCalls[this.committedCallIndex].state===&quot;COMPLETED&quot;?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t&lt;e;t++){let o=this.getBufferEntry(t);o.allocated&amp;&amp;this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!==&quot;COMMITTED&quot;){this.trace(&quot;Committing call [&quot;+this.underlyingCalls[e].call.getCallNumber()+&quot;] at index &quot;+e),this.state=&quot;COMMITTED&quot;,(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s&lt;this.underlyingCalls.length;s++)s!==e&amp;&amp;this.underlyingCalls[s].state!==&quot;COMPLETED&quot;&amp;&amp;(this.underlyingCalls[s].state=&quot;COMPLETED&quot;,this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,&quot;Discarded in favor of other hedged attempt&quot;));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===&quot;COMMITTED&quot;)return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state===&quot;ACTIVE&quot;&amp;&amp;s.nextMessageToSend&gt;e&amp;&amp;(e=s.nextMessageToSend,t=o);t===-1?this.state=&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=&gt;{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!==&quot;RETRY&quot;){t(!1);return}if(this.attempts&gt;=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=&gt;{var s,a;if(this.state!==&quot;RETRY&quot;){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&amp;&amp;a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(&quot;Retry attempt denied by throttling policy&quot;),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case&quot;COMMITTED&quot;:case&quot;NO_RETRY&quot;:case&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;HEDGING&quot;:if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&amp;&amp;s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=&gt;{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&amp;&amp;(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case&quot;RETRY&quot;:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=&gt;{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(&quot;grpc-retry-pushback-ms&quot;);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state===&quot;COMPLETED&quot;)return;if(this.trace(&quot;state=&quot;+this.state+&quot; handling status with progress &quot;+e.progress+&quot; from child [&quot;+this.underlyingCalls[t].call.getCallNumber()+&quot;] in state &quot;+this.underlyingCalls[t].state),this.underlyingCalls[t].state=&quot;COMPLETED&quot;,e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;NO_RETRY&quot;){this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;COMMITTED&quot;){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case&quot;NOT_STARTED&quot;:this.startNewAttempt();break;case&quot;REFUSED&quot;:this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case&quot;DROP&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;PROCESSED&quot;:this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state===&quot;HEDGING&quot;&amp;&amp;this.callConfig.methodConfig.hedgingPolicy&amp;&amp;(this.attempts&gt;=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&amp;&amp;clearTimeout(this.hedgingTimer),this.state!==&quot;HEDGING&quot;||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts&gt;=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&amp;&amp;e!==void 0?e:&quot;0s&quot;,i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=&gt;{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(&quot;Created child call [&quot;+e.getCallNumber()+&quot;] for attempt &quot;+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:&quot;ACTIVE&quot;,call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o&gt;0&amp;&amp;s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=&gt;{this.trace(&quot;Received metadata from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),a=!0,o&gt;0&amp;&amp;i.set(LO,`${o}`),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMetadata(i)},onReceiveMessage:i=&gt;{this.trace(&quot;Received message from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMessage(i)},onReceiveStatus:i=&gt;{this.trace(&quot;Received status from child [&quot;+e.getCallNumber()+&quot;]&quot;),!a&amp;&amp;o&gt;0&amp;&amp;i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&amp;&amp;e.startRead()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!==&quot;COMPLETED&quot;&amp;&amp;this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case&quot;MESSAGE&quot;:t.call.sendMessageWithContext({callback:s=&gt;{this.handleChildWriteCompleted(e)}},o.message.message);break;case&quot;HALF_CLOSE&quot;:t.nextMessageToSend+=1,t.call.halfClose();break;case&quot;FREED&quot;:break}}}sendMessageWithContext(e,t){var o;this.trace(&quot;write() called with message of length &quot;+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:&quot;MESSAGE&quot;,message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state===&quot;ACTIVE&quot;&amp;&amp;l.nextMessageToSend===a&amp;&amp;l.call.sendMessageWithContext({callback:c=&gt;{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===&quot;ACTIVE&quot;&amp;&amp;n.nextMessageToSend===a&amp;&amp;n.call.sendMessageWithContext({callback:l=&gt;{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace(&quot;startRead called&quot;),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)===&quot;ACTIVE&quot;&amp;&amp;e.call.startRead()}halfClose(){this.trace(&quot;halfClose called&quot;);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:&quot;HALF_CLOSE&quot;,allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;t.nextMessageToSend===e&amp;&amp;(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=&gt;{&quot;use strict&quot;;Object.defineProperty(Q_,&quot;__esModule&quot;,{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=&gt;{this.healthy&amp;&amp;this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&amp;&amp;this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&amp;&amp;(this.healthy=e,this.child.isHealthy()&amp;&amp;this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=&gt;{&quot;use strict&quot;;Object.defineProperty(vo,&quot;__esModule&quot;,{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1&lt;&lt;24,q_e=1&lt;&lt;20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=&gt;{t.throttleKeepalive(i)}}ref(){this.refCount===0&amp;&amp;(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:&quot;Channel closed before call started&quot;,metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=&quot;grpc.internal.no_subchannel&quot;;var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=&gt;({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof C_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name &quot;${e}&quot;`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name &quot;${e}&quot;`);this.options[&quot;grpc.enable_channelz&quot;]===0&amp;&amp;(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Channel created&quot;),this.options[&quot;grpc.default_authority&quot;]?this.defaultAuthority=this.options[&quot;grpc.default_authority&quot;]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options[&quot;grpc.use_local_subchannel_pool&quot;])!==null&amp;&amp;s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options[&quot;grpc.retry_buffer_size&quot;])!==null&amp;&amp;a!==void 0?a:H_e,(i=this.options[&quot;grpc.per_rpc_retry_buffer_size&quot;])!==null&amp;&amp;i!==void 0?i:q_e),this.keepaliveTime=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options[&quot;grpc.client_idle_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=&gt;{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Created subchannel or used existing subchannel&quot;,M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=&gt;{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=&gt;{throw new Error(&quot;Resolving load balancer should never call requestReresolution&quot;)},addChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=&gt;{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Address resolution succeeded&quot;),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=&gt;{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_WARNING&quot;,&quot;Address resolution failed with code &quot;+y.code+&#x27; and details &quot;&#x27;+y.details+&#x27;&quot;&#x27;),this.configSelectionQueue.length&gt;0&amp;&amp;this.trace(&quot;Name resolution failed with calls queued for config selection&quot;),this.configSelector===null&amp;&amp;(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace(&quot;Channel constructed with options &quot;+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)(&quot;channel_stacktrace&quot;)&amp;&amp;(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;channel_stacktrace&quot;,&quot;(&quot;+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,&quot;channel&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=&gt;{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&amp;&amp;t.call(e)||(this.trace(&quot;callRefTimer.ref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&amp;&amp;e.hasRef)||this.callRefTimer.hasRef())&amp;&amp;(this.trace(&quot;callRefTimer.unref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=&gt;o===e);t&gt;=0&amp;&amp;this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;connectivity_state&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+sr.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+sr.ConnectivityState[e]),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&amp;&amp;(o.timer&amp;&amp;clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.currentResolutionError=null)}throttleKeepalive(e){if(e&gt;this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:&quot;SUCCESS&quot;,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:&quot;ERROR&quot;,error:this.currentResolutionError}:{type:&quot;NONE&quot;}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&amp;&amp;(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&amp;&amp;(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=&gt;{if(this.callCount&gt;0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a&gt;=this.idleTimeoutMs?(this.trace(&quot;Idle timer triggered after &quot;+this.idleTimeoutMs+&quot;ms of inactivity&quot;),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;!this.idleTimer&amp;&amp;this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&amp;&amp;this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&amp;&amp;(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createLoadBalancingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createRetryingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace(&quot;createResolvingCall [&quot;+i+&#x27;] method=&quot;&#x27;+e+&#x27;&quot;, deadline=&#x27;+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=&gt;{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.pickQueue=[],this.callRefTimer&amp;&amp;clearInterval(this.callRefTimer),this.idleTimer&amp;&amp;clearTimeout(this.idleTimer),this.channelzEnabled&amp;&amp;(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&amp;&amp;(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i&lt;=n){process.nextTick(o,new Error(&quot;Deadline passed without connectivity state change&quot;));return}s=setTimeout(()=&gt;{this.removeConnectivityStateWatcher(a),o(new Error(&quot;Deadline passed without connectivity state change&quot;))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=&gt;{&quot;use strict&quot;;Object.defineProperty(nE,&quot;__esModule&quot;,{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof j_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=&gt;{&quot;use strict&quot;;Object.defineProperty(Cr,&quot;__esModule&quot;,{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V(&quot;events&quot;),XO=V(&quot;stream&quot;),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:&quot;message&quot;in r?r.message:&quot;Unknown Error&quot;,metadata:(t=e??r.metadata)!==null&amp;&amp;t!==void 0?t:null};return&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;&amp;&amp;Number.isInteger(r.code)&amp;&amp;(o.code=r.code,&quot;details&quot;in r&amp;&amp;typeof r.details==&quot;string&quot;&amp;&amp;(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,a=&gt;{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,s=&gt;{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=&gt;{&quot;use strict&quot;;Object.defineProperty(ya,&quot;__esModule&quot;,{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&amp;&amp;!Buffer.isBuffer(e))throw new TypeError(&quot;rootCerts must be null or a Buffer&quot;);if(!Array.isArray(t))throw new TypeError(&quot;keyCertPairs must be an array&quot;);if(typeof o!=&quot;boolean&quot;)throw new TypeError(&quot;checkClientCertificate must be a boolean&quot;);let a=[],i=[];for(let n=0;n&lt;t.length;n++){let l=t[n];if(l===null||typeof l!=&quot;object&quot;)throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&amp;&amp;s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&amp;&amp;Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&amp;&amp;Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t&lt;this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&amp;&amp;Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t&lt;this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&amp;&amp;this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t&lt;this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=&gt;{&quot;use strict&quot;;Object.defineProperty(ar,&quot;__esModule&quot;,{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V(&quot;http2&quot;),Vj=Mh(),Fj=V(&quot;zlib&quot;),X_e=lO(),jj=Pe(),Yj=&quot;server_call&quot;;function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&amp;&amp;(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,!this.cancelled&amp;&amp;(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,!this.cancelled&amp;&amp;(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=&gt;{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveHalfClose:r=&gt;{r()},onCancel:()=&gt;{}},sE={start:r=&gt;{r()},sendMetadata:(r,e)=&gt;{e(r)},sendMessage:(r,e)=&gt;{e(r)},sendStatus:(r,e)=&gt;{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&amp;&amp;o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&amp;&amp;s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&amp;&amp;a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&amp;&amp;i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&amp;&amp;(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&amp;&amp;(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=&gt;{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&amp;&amp;o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&amp;&amp;s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&amp;&amp;a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&amp;&amp;i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj=&quot;grpc-accept-encoding&quot;,cA=&quot;grpc-encoding&quot;,Gj=&quot;grpc-message&quot;,Hj=&quot;grpc-status&quot;,nA=&quot;grpc-timeout&quot;,J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:&quot;identity,deflate,gzip&quot;,[cA]:&quot;identity&quot;},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding=&quot;identity&quot;,this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once(&quot;error&quot;,u=&gt;{}),this.stream.once(&quot;close&quot;,()=&gt;{var u;Oo(&quot;Request to method &quot;+((u=this.handler)===null||u===void 0?void 0:u.path)+&quot; stream closed with rstCode &quot;+this.stream.rstCode),this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:&quot;Stream closed before sending status&quot;,metadata:null})),this.notifyOnCancel()}),this.stream.on(&quot;data&quot;,u=&gt;{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on(&quot;end&quot;,()=&gt;{this.handleEndEvent()}),&quot;grpc.max_send_message_length&quot;in a&amp;&amp;(this.maxSendMessageSize=a[&quot;grpc.max_send_message_length&quot;]),&quot;grpc.max_receive_message_length&quot;in a&amp;&amp;(this.maxReceiveMessageSize=a[&quot;grpc.max_receive_message_length&quot;]),this.host=(i=t[&quot;:authority&quot;])!==null&amp;&amp;i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&amp;&amp;Oo(&quot;Request to &quot;+this.handler.path+&quot; received headers &quot;+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length&gt;0&amp;&amp;this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length&gt;0&amp;&amp;(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value &quot;${e}&quot;`,metadata:null};process.nextTick(()=&gt;{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=&gt;{let a={code:bt.Status.DEADLINE_EXCEEDED,details:&quot;Deadline exceeded&quot;,metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&amp;&amp;(this.stream.destroyed||this.stream.closed)&amp;&amp;(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=&gt;{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&amp;&amp;clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t===&quot;identity&quot;)return o;if(t===&quot;deflate&quot;||t===&quot;gzip&quot;){let s;return t===&quot;deflate&quot;?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=&gt;{let n=0,l=[];s.on(&quot;data&quot;,c=&gt;{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&amp;&amp;n&gt;this.maxReceiveMessageSize&amp;&amp;(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on(&quot;end&quot;,()=&gt;{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding &quot;${t}&quot;`})}async decompressAndMaybePush(e){if(e.type!==&quot;COMPRESSED&quot;)throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:&quot;identity&quot;,s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type=&quot;READABLE&quot;,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&amp;&amp;this.isReadPending&amp;&amp;this.readQueue.length&gt;0&amp;&amp;this.readQueue[0].type!==&quot;COMPRESSED&quot;){this.isReadPending=!1;let e=this.readQueue.shift();e.type===&quot;READABLE&quot;?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo(&quot;Request to &quot;+this.handler.path+&quot; received data frame of size &quot;+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:&quot;COMPRESSED&quot;,compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:&quot;HALF_CLOSE&quot;,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo(&quot;Request to &quot;+this.handler.path+&quot; start called&quot;),!this.checkCancelled()&amp;&amp;(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&amp;&amp;o.length-5&gt;this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo(&quot;Request to &quot;+this.handler.path+&quot; sent data frame of size &quot;+o.length),this.stream.write(o,s=&gt;{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo(&quot;Request to method &quot;+((t=this.handler)===null||t===void 0?void 0:t.path)+&quot; ended with status code: &quot;+bt.Status[e.code]+&quot; details: &quot;+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(&quot;wantTrailers&quot;,()=&gt;{var s;this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo(&quot;Request to &quot;+this.handler.path+&quot; startRead called&quot;),!this.checkCancelled()&amp;&amp;(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&amp;&amp;t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:&quot;unknown&quot;}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type===&quot;clientStream&quot;||s.type===&quot;bidi&quot;,responseStream:s.type===&quot;serverStream&quot;||s.type===&quot;bidi&quot;,requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=&gt;c(i,l),n)}});var Zj=T(fi=&gt;{&quot;use strict&quot;;var rEe=fi&amp;&amp;fi.__runInitializers||function(r,e,t){for(var o=arguments.length&gt;2,s=0;s&lt;e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&amp;&amp;fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&amp;&amp;typeof I!=&quot;function&quot;)throw new TypeError(&quot;Function expected&quot;);return I}for(var n=o.kind,l=n===&quot;getter&quot;?&quot;get&quot;:n===&quot;setter&quot;?&quot;set&quot;:&quot;value&quot;,c=!e&amp;&amp;r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m&gt;=0;m--){var O={};for(var y in o)O[y]=y===&quot;access&quot;?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError(&quot;Cannot add initializers after decoration has completed&quot;);a.push(i(I||null))};var A=(0,t[m])(n===&quot;accessor&quot;?{get:u.get,set:u.set}:u[l],O);if(n===&quot;accessor&quot;){if(A===void 0)continue;if(A===null||typeof A!=&quot;object&quot;)throw new TypeError(&quot;Object expected&quot;);(f=i(A.get))&amp;&amp;(u.get=f),(f=i(A.set))&amp;&amp;(u.set=f),(f=i(A.init))&amp;&amp;s.unshift(f)}else(f=i(A))&amp;&amp;(n===&quot;field&quot;?s.unshift(f):u[l]=f)}c&amp;&amp;Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,&quot;__esModule&quot;,{value:!0});fi.Server=void 0;var Lt=V(&quot;http2&quot;),iEe=V(&quot;util&quot;),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1&lt;&lt;31),pA=~(1&lt;&lt;31),oEe=2e4,Xj=~(1&lt;&lt;31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe=&quot;server&quot;,Jj=Buffer.from(&quot;max_age&quot;);function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,&quot;server_call&quot;,r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case&quot;unary&quot;:return(o,s)=&gt;{s(t,null)};case&quot;clientStream&quot;:return(o,s)=&gt;{s(t,null)};case&quot;serverStream&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};case&quot;bidi&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=&gt;{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString=&quot;null&quot;,this.channelzEnabled=!0,this.options=s??{},this.options[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)(&quot;server&quot;,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Server created&quot;),this.maxConnectionAgeMs=(a=this.options[&quot;grpc.max_connection_age_ms&quot;])!==null&amp;&amp;a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options[&quot;grpc.max_connection_age_grace_ms&quot;])!==null&amp;&amp;i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options[&quot;grpc.keepalive_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options[&quot;grpc.max_connection_idle_ms&quot;])!==null&amp;&amp;c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},&quot;grpc-node.max_session_memory&quot;in this.options?this.commonServerOptions.maxSessionMemory=this.options[&quot;grpc-node.max_session_memory&quot;]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,&quot;grpc.max_concurrent_streams&quot;in this.options&amp;&amp;(this.commonServerOptions.settings={maxConcurrentStreams:this.options[&quot;grpc.max_concurrent_streams&quot;]}),this.interceptors=(u=this.options.interceptors)!==null&amp;&amp;u!==void 0?u:[],this.trace(&quot;Server constructed&quot;)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&amp;&amp;a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&amp;&amp;&quot;raw&quot;in A?A.raw:null,remoteCertificate:I&amp;&amp;&quot;raw&quot;in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&amp;&amp;i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&amp;&amp;n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}addProtoService(){throw new Error(&quot;Not implemented. Use addService() instead&quot;)}addService(s,a){if(s===null||typeof s!=&quot;object&quot;||a===null||typeof a!=&quot;object&quot;)throw new Error(&quot;addService() requires two objects as arguments&quot;);let i=Object.keys(s);if(i.length===0)throw new Error(&quot;Cannot add an empty service to a server&quot;);i.forEach(n=&gt;{let l=s[n],c;l.requestStream?l.responseStream?c=&quot;bidi&quot;:c=&quot;clientStream&quot;:l.responseStream?c=&quot;serverStream&quot;:c=&quot;unary&quot;;let u=a[n],f;if(u===void 0&amp;&amp;typeof l.originalName==&quot;string&quot;&amp;&amp;(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!=&quot;object&quot;)throw new Error(&quot;removeService() requires object as argument&quot;);Object.keys(s).forEach(i=&gt;{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error(&quot;Not implemented. Use bindAsync() instead&quot;)}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=&gt;({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options[&quot;grpc-node.tls_enable_trace&quot;]===1}),c=n!==null;this.trace(&quot;Initial credentials valid: &quot;+c),a=Lt.createSecureServer(l),a.prependListener(&quot;connection&quot;,f=&gt;{c||(this.trace(&quot;Dropped connection from &quot;+JSON.stringify(f.address())+&quot; due to unloaded credentials&quot;),f.destroy())}),a.on(&quot;secureConnection&quot;,f=&gt;{f.on(&quot;error&quot;,_=&gt;{this.trace(&quot;An incoming TLS connection closed with error: &quot;+_.message)})});let u=f=&gt;{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,&quot;Failed to set secure context with error &quot;+m.message),f=null}}c=f!==null,this.trace(&quot;Post-update credentials valid: &quot;+c)};s._addWatcher(u),a.on(&quot;close&quot;,()=&gt;{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace(&quot;Attempting to bind &quot;+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=&gt;{let c=u=&gt;{this.trace(&quot;Failed to bind &quot;+(0,ui.subchannelAddressToString)(s)+&quot; with error &quot;+u.message),n({port:&quot;port&quot;in s?s.port:1,error:u.message})};i.once(&quot;error&quot;,c),i.listen(s,()=&gt;{let u=i.address(),f;typeof u==&quot;string&quot;?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace(&quot;Successfully bound &quot;+(0,ui.subchannelAddressToString)(f)),n({port:&quot;port&quot;in f?f.port:1}),i.removeListener(&quot;error&quot;,c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&amp;&amp;s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=&gt;(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=&gt;this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=&gt;u.error===void 0).length,port:i.port,errors:c.filter(u=&gt;u.error).map(u=&gt;u.error)}}}else{let i=await Promise.all(s.map(n=&gt;this.bindOneAddress(n,a)));return{count:i.filter(n=&gt;n.error===void 0).length,port:i[0].port,errors:i.filter(n=&gt;n.error).map(n=&gt;n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count&gt;0)return i.count&lt;s.length&amp;&amp;Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(&quot;,&quot;)}]`)}}resolvePort(s){return new Promise((a,i)=&gt;{let n={onSuccessfulResolution:(c,u,f)=&gt;{n.onSuccessfulResolution=()=&gt;{};let _=[].concat(...c.map(m=&gt;m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=&gt;{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port &quot;${s}&quot;`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port &quot;${s}&quot;`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error(&quot;bindAsync called after shutdown&quot;);if(typeof s!=&quot;string&quot;)throw new TypeError(&quot;port must be a string&quot;);if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);if(typeof i!=&quot;function&quot;)throw new TypeError(&quot;callback must be a function&quot;);this.trace(&quot;bindAsync port=&quot;+s);let n=this.normalizePort(s),l=(_,m)=&gt;{process.nextTick(()=&gt;i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=&gt;i(null,_),_=&gt;i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=&gt;{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=&gt;{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=&gt;{c.completionPromise=null,c.portNumber=_,i(null,_)},_=&gt;{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)(&quot;injector&quot;,()=&gt;({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);this.channelzEnabled&amp;&amp;this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=&gt;{n.emit(&quot;connection&quot;,c)},drain:c=&gt;{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=&gt;{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=&gt;{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace(&quot;Closing server with address &quot;+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=&gt;{i&amp;&amp;i.ownsChannelzRef&amp;&amp;(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace(&quot;Closing session initiated by &quot;+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=&gt;{n&amp;&amp;(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=&gt;{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace(&quot;unbind port=&quot;+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error(&quot;Cannot unbind port 0&quot;);let n=this.boundPorts.get((0,Pr.uriToString)(a));n&amp;&amp;(this.trace(&quot;unbinding &quot;+n.mapKey+&quot; originally bound as &quot;+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace(&quot;drain port=&quot;+s+&quot; graceTimeMs=&quot;+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error(&quot;Cannot drain port 0&quot;);let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=&gt;{f.delete(O)})}(n=(i=setTimeout(()=&gt;{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=&gt;{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=&gt;!s.listening))throw new Error(&quot;server must be bound in order to start&quot;);if(this.started===!0)throw new Error(&quot;server is already started&quot;);this.started=!0}tryShutdown(s){var a;let i=c=&gt;{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&amp;&amp;i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace(&quot;Waiting for server &quot;+f+&quot; to close&quot;),this.closeServer(c,()=&gt;{this.trace(&quot;Server &quot;+f+&quot; finished closing&quot;),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace(&quot;Waiting for session &quot;+m+&quot; to close&quot;),this.closeSession(_,()=&gt;{this.trace(&quot;Session &quot;+m+&quot; finished closing&quot;),l()})}}n===0&amp;&amp;i()}addHttp2Port(){throw new Error(&quot;Not yet implemented&quot;)}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!=&quot;string&quot;||!i.startsWith(&quot;application/grpc&quot;)?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj(&quot;Received call to method &quot;+s+&quot; at address &quot;+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj(&quot;No handler registered for method &quot;+s+&quot;. Sending UNIMPLEMENTED status.&quot;),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({&quot;grpc-status&quot;:(n=s.code)!==null&amp;&amp;n!==void 0?n:qe.Status.INTERNAL,&quot;grpc-message&quot;:s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=&gt;{n&amp;&amp;(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=&gt;{n&amp;&amp;(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=&gt;{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=&gt;{n&amp;&amp;(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i===&quot;unary&quot;)fEe(s,a);else if(i===&quot;clientStream&quot;)pEe(s,a);else if(i===&quot;serverStream&quot;)dEe(s,a);else if(i===&quot;bidi&quot;)hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n=&quot;null&quot;;i&amp;&amp;(typeof i==&quot;string&quot;?n=i:n=i.address+&quot;:&quot;+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on(&quot;stream&quot;,l.bind(this,a)),s.on(&quot;session&quot;,c)}_sessionHandler(s){return a=&gt;{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=&gt;{var F,N;f=!0,this.trace(&quot;Connection dropped by max connection age: &quot;+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(c=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=&gt;{u&amp;&amp;(clearTimeout(u),u=null)},O=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,y,A=()=&gt;{var I;O()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),u=setTimeout(()=&gt;{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=&gt;{var I;if(!O())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let M=&quot;&quot;;try{a.ping((N,z,B)=&gt;{m(),N?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+N.message),f=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),A())})||(M=&quot;Ping returned false&quot;)}catch(F){M=(F instanceof Error?F.message:&quot;&quot;)||&quot;Unknown error&quot;}if(M){this.keepaliveTrace(&quot;Ping send failed: &quot;+M),this.trace(&quot;Connection dropped due to ping send error: &quot;+M),f=!0,a.close();return}u=setTimeout(()=&gt;{m(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.trace(&quot;Connection dropped by keepalive timeout&quot;),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on(&quot;close&quot;,()=&gt;{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&amp;&amp;clearTimeout(l),c&amp;&amp;clearTimeout(c),m(),_!==null&amp;&amp;(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=&gt;{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&amp;&amp;n!==void 0?n:&quot;unknown&quot;,this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection established by client &quot;+_),this.trace(&quot;Connection established by client &quot;+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=&gt;{var te;A=!0,this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by max connection age from &quot;+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(O=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=&gt;{y&amp;&amp;(clearTimeout(y),y=null)},F=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,N,z=()=&gt;{var B;F()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),y=setTimeout(()=&gt;{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=&gt;{var B;if(!F())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let G=&quot;&quot;;try{a.ping(($,le,v)=&gt;{M(),$?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+$.message),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to error of a ping frame &quot;+$.message+&quot; return in &quot;+le),A=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),z())})||(G=&quot;Ping returned false&quot;)}catch(te){G=(te instanceof Error?te.message:&quot;&quot;)||&quot;Unknown error&quot;}if(G){this.keepaliveTrace(&quot;Ping send failed: &quot;+G),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to ping send error: &quot;+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=&gt;{M(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by keepalive timeout from &quot;+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on(&quot;close&quot;,()=&gt;{var B;A||this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by client &quot;+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&amp;&amp;clearTimeout(m),O&amp;&amp;clearTimeout(O),M(),I!==null&amp;&amp;(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout&gt;=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace(&quot;Enable idle timeout for &quot;+l.remoteAddress+&quot;:&quot;+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&amp;&amp;n.activeStreams===0&amp;&amp;(Date.now()-n.lastIdle&gt;=s.sessionIdleTimeout?(s.trace(&quot;Session idle timeout triggered for &quot;+(i==null?void 0:i.remoteAddress)+&quot;:&quot;+(i==null?void 0:i.remotePort)+&quot; last idle at &quot;+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&amp;&amp;(i.activeStreams+=1,s.once(&quot;close&quot;,i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&amp;&amp;(n.activeStreams-=1,n.activeStreams===0&amp;&amp;(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace(&quot;Session onStreamClose&quot;+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+&quot;:&quot;+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+&quot; at &quot;+n.lastIdle)))}},(()=&gt;{let o=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.metadata?Object.create(null):void 0;t=[lEe(&quot;Calling start() is no longer necessary. It can be safely omitted.&quot;)],nEe(r,null,t,{kind:&quot;method&quot;,name:&quot;start&quot;,static:!1,private:!1,access:{has:s=&gt;&quot;start&quot;in s,get:s=&gt;s.start},metadata:o},null,e),o&amp;&amp;Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}});var e4=T(lE=&gt;{&quot;use strict&quot;;Object.defineProperty(lE,&quot;__esModule&quot;,{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&amp;&amp;(e.code=this.code),this.details!==null&amp;&amp;(e.details=this.details),this.metadata!==null&amp;&amp;(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=&gt;{&quot;use strict&quot;;Object.defineProperty(Ca,&quot;__esModule&quot;,{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds==&quot;number&quot;&amp;&amp;typeof r.nanos==&quot;number&quot;}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,&quot;0&quot;),10):0}:null}});var cE=T(on=&gt;{&quot;use strict&quot;;Object.defineProperty(on,&quot;__esModule&quot;,{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V(&quot;net&quot;),yEe=&quot;pick_first&quot;;function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au=&quot;pick_first&quot;,OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if(&quot;shuffleAddressList&quot;in e&amp;&amp;typeof e.shuffleAddressList!=&quot;boolean&quot;)throw new Error(&quot;pick_first config field shuffleAddressList must be a boolean if provided&quot;);return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t&gt;1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&amp;&amp;(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&amp;&amp;(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n&lt;Math.max(a.length,i.length);n++)n&lt;a.length&amp;&amp;e.push(a[n]),n&lt;i.length&amp;&amp;e.push(i[n]);return e}var o4=&quot;grpc-node.internal.pick-first.report_health_status&quot;,lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=&gt;{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=&gt;this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=&gt;{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=&gt;e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=&gt;e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&amp;&amp;!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&amp;&amp;(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&amp;&amp;a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&amp;&amp;(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&amp;&amp;this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(n.hasReportedTransientFailure=!0,s&amp;&amp;(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&amp;&amp;this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t&gt;=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&amp;&amp;(su(&quot;Start connecting to subchannel with address &quot;+this.children[e].subchannel.getAddress()),process.nextTick(()=&gt;{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=&gt;{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su(&quot;Pick subchannel with address &quot;+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su(&quot;connectToAddressList([&quot;+e.map(s=&gt;(0,t4.subchannelAddressToString)(s))+&quot;])&quot;);let o=e.map(s=&gt;({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&amp;&amp;(e=i4(e));let s=[].concat(...e.map(i=&gt;i.addresses));su(&quot;updateAddressList([&quot;+s.map(i=&gt;(0,t4.subchannelAddressToString)(i))+&quot;])&quot;),s.length===0&amp;&amp;(this.lastError=&quot;No addresses resolved&quot;);let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&amp;&amp;this.latestAddressList&amp;&amp;this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=&gt;{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&amp;&amp;this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=&gt;{&quot;use strict&quot;;Object.defineProperty(fE,&quot;__esModule&quot;,{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V(&quot;fs&quot;),PEe=Pe(),IEe=ue(),bEe=V(&quot;util&quot;),LEe=&quot;certificate_provider&quot;;function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error(&quot;certificateFile and privateKeyFile must be set or unset together&quot;);if(e.certificateFile===void 0&amp;&amp;e.caCertificateFile===void 0)throw new Error(&quot;At least one of certificateFile and caCertificateFile must be set&quot;);uE(&quot;File watcher constructed with config &quot;+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=&gt;{if(this.refreshTimer){uE(&quot;File watcher read certificates certificate &quot;+e.status+&quot;, privateKey &quot;+t.status+&quot;, CA certificate &quot;+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===&quot;fulfilled&quot;&amp;&amp;t.status===&quot;fulfilled&quot;?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status===&quot;fulfilled&quot;?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE(&quot;File watcher initiated certificate update&quot;))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e&gt;this.config.refreshIntervalMs&amp;&amp;this.updateCertificates(),e&gt;this.config.refreshIntervalMs*2&amp;&amp;(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=&gt;this.updateCertificates(),this.config.refreshIntervalMs),uE(&quot;File watcher started watching&quot;)}}maybeStopWatchingFiles(){this.caListeners.size===0&amp;&amp;this.identityListeners.size===0&amp;&amp;(this.fileResultPromise=null,this.refreshTimer&amp;&amp;(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=&gt;{&quot;use strict&quot;;Object.defineProperty(k,&quot;__esModule&quot;,{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,&quot;trace&quot;,{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,&quot;log&quot;,{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,&quot;registerResolver&quot;,{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,&quot;createResolver&quot;,{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,&quot;uriToString&quot;,{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,&quot;splitHostPort&quot;,{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,&quot;durationToMs&quot;,{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,&quot;parseDuration&quot;,{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,&quot;BackoffTimeout&quot;,{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,&quot;createChildChannelControlHelper&quot;,{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,&quot;registerLoadBalancerType&quot;,{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,&quot;selectLbConfigFromList&quot;,{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,&quot;parseLoadBalancingConfig&quot;,{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,&quot;isLoadBalancerNameRegistered&quot;,{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,&quot;LeafLoadBalancer&quot;,{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,&quot;subchannelAddressToString&quot;,{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,&quot;endpointToString&quot;,{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,&quot;endpointHasAddress&quot;,{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,&quot;EndpointMap&quot;,{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,&quot;ChildLoadBalancerHandler&quot;,{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,&quot;UnavailablePicker&quot;,{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,&quot;QueuePicker&quot;,{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,&quot;PickResultType&quot;,{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,&quot;BaseFilter&quot;,{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,&quot;FilterStackFactory&quot;,{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,&quot;registerAdminService&quot;,{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,&quot;BaseSubchannelWrapper&quot;,{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,&quot;createServerCredentialsWithInterceptors&quot;,{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,&quot;createCertificateProviderServerCredentials&quot;,{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,&quot;FileWatcherCertificateProvider&quot;,{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,&quot;createCertificateProviderChannelCredentials&quot;,{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,&quot;SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX&quot;,{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=&gt;{&quot;use strict&quot;;Object.defineProperty(AA,&quot;__esModule&quot;,{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===&quot;&quot;?s=&quot;/&quot;+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return&quot;localhost&quot;}};function qEe(){(0,HEe.registerResolver)(&quot;unix&quot;,OA)}});var m4=T(PA=&gt;{&quot;use strict&quot;;Object.defineProperty(PA,&quot;__esModule&quot;,{value:!0});PA.setup=KEe;var d4=V(&quot;net&quot;),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe=&quot;ip_resolver&quot;;function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA=&quot;ipv4&quot;,CA=&quot;ipv6&quot;,zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4(&quot;Resolver constructed for target &quot;+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(&quot;,&quot;);for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&amp;&amp;!(0,d4.isIPv4)(l.host)||e.scheme===CA&amp;&amp;!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&amp;&amp;s!==void 0?s:zEe})}this.endpoints=a.map(n=&gt;({addresses:[n]})),E4(&quot;Parsed &quot;+e.scheme+&quot; address list &quot;+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=&gt;{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(&quot;,&quot;)[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=&gt;{&quot;use strict&quot;;Object.defineProperty(uu,&quot;__esModule&quot;,{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe=&quot;round_robin&quot;;function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E=&quot;round_robin&quot;,bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=&gt;{this.currentState===yt.ConnectivityState.READY&amp;&amp;t!==yt.ConnectivityState.READY&amp;&amp;this.channelControlHelper.requestReresolution(),s&amp;&amp;(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=&gt;t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)&gt;0){let e=this.children.filter(o=&gt;o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=&gt;(0,T4.endpointEqual)(s.getEndpoint(),o)),t&lt;0&amp;&amp;(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=&gt;({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)&gt;0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)&gt;0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&amp;&amp;e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4(&quot;Connect to endpoint list &quot;+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=&gt;new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=&gt;{&quot;use strict&quot;;var xA;Object.defineProperty(No,&quot;__esModule&quot;,{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome=&quot;outlier_detection&quot;;function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA=&quot;outlier_detection&quot;,sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&amp;&amp;xA!==void 0?xA:&quot;true&quot;)===&quot;true&quot;,ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&amp;&amp;r[e]!==void 0&amp;&amp;typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&amp;&amp;r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds&gt;=0&amp;&amp;r[e].seconds&lt;=315576e6&amp;&amp;r[e].nanos&gt;=0&amp;&amp;r[e].nanos&lt;=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,&quot;number&quot;,t),e in r&amp;&amp;r[e]!==void 0&amp;&amp;!(r[e]&gt;=0&amp;&amp;r[e]&lt;=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()===&quot;pick_first&quot;)throw new Error(&quot;outlier_detection LB policy cannot have a pick_first child policy&quot;);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&amp;&amp;e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&amp;&amp;t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,&quot;interval&quot;),wA(e,&quot;base_ejection_time&quot;),wA(e,&quot;max_ejection_time&quot;),mE(e,&quot;max_ejection_percent&quot;),&quot;success_rate_ejection&quot;in e&amp;&amp;e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config success_rate_ejection must be an object&quot;);Ia(e.success_rate_ejection,&quot;stdev_factor&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),mE(e.success_rate_ejection,&quot;enforcement_percentage&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;)}if(&quot;failure_percentage_ejection&quot;in e&amp;&amp;e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config failure_percentage_ejection must be an object&quot;);mE(e.failure_percentage_ejection,&quot;threshold&quot;,&quot;failure_percentage_ejection&quot;),mE(e.failure_percentage_ejection,&quot;enforcement_percentage&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;)}if(!(&quot;child_policy&quot;in e)||!Array.isArray(e.child_policy))throw new Error(&quot;outlier detection config child_policy must be an array&quot;);let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error(&quot;outlier detection config child_policy: no valid recognized policy found&quot;);return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&amp;&amp;t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e&gt;=0&amp;&amp;this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&amp;&amp;(a=i=&gt;{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=&gt;{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&amp;&amp;i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=&gt;{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=&gt;{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&amp;&amp;(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&amp;&amp;(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it(&quot;Running success rate check&quot;);let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it(&quot;Stats for &quot;+(0,MA.endpointToString)(f)+&quot;: successes=&quot;+m+&quot; failures=&quot;+O+&quot; targetRequestVolume=&quot;+o),m+O&gt;=o&amp;&amp;(s+=1,a.push(m/(m+O)))}if(it(&quot;Found &quot;+s+&quot; success rate candidates; currentEjectionPercent=&quot;+this.getCurrentEjectionPercent()+&quot; successRates=[&quot;+a+&quot;]&quot;),s&lt;t.minimum_hosts)return;let i=a.reduce((f,_)=&gt;f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it(&quot;stdev=&quot;+c+&quot; ejectionThreshold=&quot;+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O&lt;o)continue;let y=m/(m+O);if(it(&quot;Checking candidate &quot;+f+&quot; successRate=&quot;+y),y&lt;u){let A=Math.random()*100;it(&quot;Candidate &quot;+f+&quot; randomNumber=&quot;+A+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),A&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it(&quot;Running failure percentage check. threshold=&quot;+t.threshold+&quot; request volume threshold=&quot;+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i&gt;=t.request_volume&amp;&amp;(o+=1)}if(!(o&lt;t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it(&quot;Candidate successes=&quot;+i+&quot; failures=&quot;+n),i+n&lt;t.request_volume)continue;if(n*100/(n+i)&gt;t.threshold){let c=Math.random()*100;it(&quot;Candidate &quot;+s+&quot; randomNumber=&quot;+c+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),c&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=&gt;this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it(&quot;Ejection timer running&quot;),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier&gt;0&amp;&amp;(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i&lt;new Date&amp;&amp;(it(&quot;Unejecting &quot;+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it(&quot;Received update with config: &quot;+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it(&quot;Adding map entry for &quot;+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it(&quot;Previous timer existed. Replacing timer&quot;),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it(&quot;Starting new timer&quot;),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it(&quot;Counting disabled. Cancelling timer.&quot;),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&amp;&amp;(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=&gt;{&quot;use strict&quot;;Object.defineProperty(w,&quot;__esModule&quot;,{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,&quot;CallCredentials&quot;,{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,&quot;Channel&quot;,{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,&quot;compressionAlgorithms&quot;,{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,&quot;connectivityState&quot;,{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,&quot;ChannelCredentials&quot;,{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,&quot;Client&quot;,{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,&quot;logVerbosity&quot;,{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,&quot;status&quot;,{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,&quot;propagate&quot;,{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,&quot;loadPackageDefinition&quot;,{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,&quot;makeClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,&quot;makeGenericClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,&quot;Metadata&quot;,{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,&quot;Server&quot;,{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,&quot;ServerCredentials&quot;,{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,&quot;StatusBuilder&quot;,{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),combineCallCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=&gt;r.close();w.closeClient=mme;var Tme=(r,e,t)=&gt;r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.loadObject=Sme;var gme=(r,e,t)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.load=gme;var vme=r=&gt;{N4.setLogger(r)};w.setLogger=vme;var yme=r=&gt;{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=&gt;R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,&quot;ListenerBuilder&quot;,{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,&quot;RequesterBuilder&quot;,{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,&quot;InterceptingCall&quot;,{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,&quot;InterceptorConfigurationError&quot;,{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,&quot;getChannelzServiceDefinition&quot;,{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,&quot;getChannelzHandlers&quot;,{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,&quot;addAdminServicesToServer&quot;,{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,&quot;ServerListenerBuilder&quot;,{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,&quot;ResponderBuilder&quot;,{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,&quot;ServerInterceptingCall&quot;,{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=&gt;{&quot;use strict&quot;;Object.defineProperty(yE,&quot;__esModule&quot;,{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=&gt;o,requestDeserialize:o=&gt;o,responseSerialize:o=&gt;o,responseDeserialize:o=&gt;o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=&gt;{&quot;use strict&quot;;Object.defineProperty(lr,&quot;__esModule&quot;,{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r===&quot;gzip&quot;?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{&quot;grpc.default_compression_algorithm&quot;:kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}}return new Promise(s=&gt;{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error(&quot;metadata was null&quot;),status:&quot;failure&quot;});this._client.export(o,this._metadata,{deadline:a},(i,n)=&gt;{s(i?{status:&quot;failure&quot;,error:i}:{data:n,status:&quot;success&quot;})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=&gt;{&quot;use strict&quot;;Object.defineProperty(AE,&quot;__esModule&quot;,{value:!0});AE.VERSION=void 0;AE.VERSION=&quot;0.56.0&quot;});var w4=T(pi=&gt;{&quot;use strict&quot;;Object.defineProperty(pi,&quot;__esModule&quot;,{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V(&quot;url&quot;),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol===&quot;unix:&quot;?r:(o.pathname&amp;&amp;o.pathname!==&quot;/&quot;&amp;&amp;b4.diag.warn(&quot;URL path should not be set when using grpc, the path part of the URL will be ignored.&quot;),o.protocol!==&quot;&quot;&amp;&amp;!(!((e=o.protocol)===null||e===void 0)&amp;&amp;e.match(/^(http)s?:$/))&amp;&amp;b4.diag.warn(&quot;URL protocol should be http(s)://. Using http://.&quot;),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length&lt;1&amp;&amp;r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=&gt;{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&amp;&amp;u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&amp;&amp;_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&amp;&amp;a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&amp;&amp;n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=&gt;{let r=(0,hu.createEmptyMetadata)();return r.set(&quot;User-Agent&quot;,`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:&quot;http://localhost:4317&quot;,credentials:r=&gt;r.startsWith(&quot;http://&quot;)?()=&gt;(0,hu.createInsecureCredentials)():()=&gt;(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=&gt;{P();qA=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var NE,U4=p(()=&gt;{NE=&quot;baggage&quot;});function PE(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function IE(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Eu(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Eu(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var jA=p(()=&gt;{P()});var bE,V4=p(()=&gt;{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=PE(a);i.length&gt;0&amp;&amp;o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=Eu(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=&gt;{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var q4=p(()=&gt;{P()});function xE(){return r=&gt;{S.error(Xme(r))}}function Xme(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=&gt;{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=&gt;{KA();j4=xE()});var La,XA=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(La||(La={}))});function Zme(r){return Qme.indexOf(r)&gt;-1}function tTe(r){return eTe.indexOf(r)&gt;-1}function nTe(r){return rTe.indexOf(r)&gt;-1}function iTe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=aTe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=&gt;{P();XA();Jme=&quot;,&quot;,Qme=[&quot;OTEL_SDK_DISABLED&quot;];eTe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rTe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=&gt;{QA()});var UE,K4=p(()=&gt;{UE=typeof globalThis==&quot;object&quot;?globalThis:global});function $4(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var ZA=p(()=&gt;{});function BE(r){return Buffer.from(kE(r)).toString(&quot;base64&quot;)}var X4=p(()=&gt;{ZA()});function W4(r){return function(){for(let t=0;t&lt;r/4;t++)VE.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(VE[t]&gt;0);t++)t===r-1&amp;&amp;(VE[r-1]=1);return VE.toString(&quot;hex&quot;,0,r)}}var xa,VE,J4=p(()=&gt;{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from&quot;perf_hooks&quot;;var di,Q4=p(()=&gt;{di=cTe});var FE,eR=p(()=&gt;{FE=&quot;1.29.0&quot;});var GE,Z4=p(()=&gt;{eR();Ve();GE={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=&gt;{});var t6=p(()=&gt;{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=&gt;{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!=&quot;number&quot;){let e=di;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r==&quot;number&quot;?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r==&quot;number&quot;)return r&lt;jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function c6(r){return YE(r)||typeof r==&quot;number&quot;||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=qE&amp;&amp;(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=&gt;{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(zE||(zE={}))});var KE,p6=p(()=&gt;{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&amp;&amp;!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=&gt;{iR=&quot;[_0-9a-z-*/]&quot;,pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=&gt;{_6();E6=32,mTe=512,m6=&quot;,&quot;,T6=&quot;=&quot;,wa=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length&gt;mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&amp;&amp;h6(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;E6&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=&gt;{P();_u();oR();vu=&quot;traceparent&quot;,yu=&quot;tracestate&quot;,TTe=&quot;00&quot;,STe=&quot;(?!ff)[\\da-f]{2}&quot;,gTe=&quot;(?![0]{32})[\\da-f]{32}&quot;,vTe=&quot;(?![0]{16})[\\da-f]{16}&quot;,yTe=&quot;[\\da-f]{2}&quot;,OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&amp;&amp;o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new wa(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=&gt;{P();aR=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(XE||(XE={}))});var Co,lR=p(()=&gt;{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var hi,cR=p(()=&gt;{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var WE,A6=p(()=&gt;{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=&gt;{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;N6.call(t)===PTe}function LTe(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&amp;&amp;Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&amp;&amp;(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=&gt;{ATe=&quot;[object Object]&quot;,RTe=&quot;[object Null]&quot;,NTe=&quot;[object Undefined]&quot;,CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t&gt;DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(QE(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&amp;&amp;Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r==&quot;function&quot;}function Ou(r){return!QE(r)&amp;&amp;!ZE(r)&amp;&amp;!w6(r)&amp;&amp;typeof r==&quot;object&quot;}function QE(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=&gt;{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Au,k6=p(()=&gt;{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=&gt;{});function F6(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var G6=p(()=&gt;{});var em,H6=p(()=&gt;{em=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=&gt;{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=&gt;{he.with(RE(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Y6=p(()=&gt;{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=&gt;Co,AlwaysOnSampler:()=&gt;hi,AnchoredClock:()=&gt;LE,BindOnceFuture:()=&gt;tm,CompositePropagator:()=&gt;KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;mu,DEFAULT_ENVIRONMENT:()=&gt;Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;JA,ExportResultCode:()=&gt;zE,ParentBasedSampler:()=&gt;WE,RPCType:()=&gt;XE,RandomIdGenerator:()=&gt;xa,SDK_INFO:()=&gt;GE,TRACE_PARENT_HEADER:()=&gt;vu,TRACE_STATE_HEADER:()=&gt;yu,TimeoutError:()=&gt;Au,TraceIdRatioBasedSampler:()=&gt;JE,TraceState:()=&gt;wa,TracesSamplerValues:()=&gt;La,VERSION:()=&gt;FE,W3CBaggagePropagator:()=&gt;bE,W3CTraceContextPropagator:()=&gt;$E,_globalThis:()=&gt;UE,addHrTimes:()=&gt;nR,baggageUtils:()=&gt;kTe,callWithTimeout:()=&gt;U6,deleteRPCMetadata:()=&gt;v6,getEnv:()=&gt;wE,getEnvWithoutDefaults:()=&gt;DE,getRPCMetadata:()=&gt;y6,getTimeOrigin:()=&gt;jE,globalErrorHandler:()=&gt;ME,hexToBase64:()=&gt;BE,hexToBinary:()=&gt;kE,hrTime:()=&gt;rR,hrTimeDuration:()=&gt;i6,hrTimeToMicroseconds:()=&gt;l6,hrTimeToMilliseconds:()=&gt;a6,hrTimeToNanoseconds:()=&gt;s6,hrTimeToTimeStamp:()=&gt;o6,internal:()=&gt;BTe,isAttributeKey:()=&gt;YA,isAttributeValue:()=&gt;zA,isTimeInput:()=&gt;c6,isTimeInputHrTime:()=&gt;YE,isTracingSuppressed:()=&gt;ba,isUrlIgnored:()=&gt;B6,isWrapped:()=&gt;F6,loggingErrorHandler:()=&gt;xE,merge:()=&gt;x6,millisToHrTime:()=&gt;Ma,otperformance:()=&gt;di,parseEnvironment:()=&gt;gu,parseTraceParent:()=&gt;sR,sanitizeAttributes:()=&gt;G4,setGlobalErrorHandler:()=&gt;Y4,setRPCMetadata:()=&gt;g6,suppressTracing:()=&gt;RE,timeInputToHrTime:()=&gt;n6,unrefTimer:()=&gt;HE,unsuppressTracing:()=&gt;D4,urlMatches:()=&gt;pR});var kTe,BTe,K6=p(()=&gt;{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=&gt;{&quot;use strict&quot;;Object.defineProperty(rm,&quot;__esModule&quot;,{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V(&quot;fs&quot;),GTe=V(&quot;path&quot;),W6=(P(),ee(ot));function dR(r,e){if(r!=null&amp;&amp;r!==&quot;&quot;)return r;if(e!=null&amp;&amp;e!==&quot;&quot;)return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=&gt;e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)===&quot;true&quot;}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE&quot;,&quot;Failed to read client certificate chain file&quot;)}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,&quot;OTEL_EXPORTER_OTLP_CLIENT_KEY&quot;,&quot;Failed to read client certificate private key file&quot;)}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CERTIFICATE&quot;,&quot;Failed to read root certificate file&quot;)}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&amp;&amp;t!=null;return o!=null&amp;&amp;!s?(W6.diag.warn(&quot;Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate&quot;),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=&gt;e.startsWith(&quot;http://&quot;)?()=&gt;(0,Ru.createInsecureCredentials)():e.startsWith(&quot;https://&quot;)?()=&gt;J6(r):()=&gt;$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=&gt;{&quot;use strict&quot;;Object.defineProperty(nm,&quot;__esModule&quot;,{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&amp;&amp;WTe.diag.warn(&quot;Headers cannot be set when using grpc&quot;);let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=&gt;{var o;return(o=r.metadata)!==null&amp;&amp;o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=&gt;t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=&gt;{&quot;use strict&quot;;Object.defineProperty(im,&quot;__esModule&quot;,{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=&gt;{&quot;use strict&quot;;Object.defineProperty(Da,&quot;__esModule&quot;,{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,&quot;convertLegacyOtlpGrpcOptions&quot;,{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,&quot;createOtlpGrpcExportDelegate&quot;,{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=&gt;{&quot;use strict&quot;;Object.defineProperty(om,&quot;__esModule&quot;,{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,&quot;LOGS&quot;),oSe.ProtobufLogsSerializer,&quot;LogsExportService&quot;,&quot;/opentelemetry.proto.collector.logs.v1.LogsService/Export&quot;))}};om.OTLPLogExporter=ER});var iY=T(Io=&gt;{&quot;use strict&quot;;var aSe=Io&amp;&amp;Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),lSe=Io&amp;&amp;Io.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;aSe(e,r,t)};Object.defineProperty(Io,&quot;__esModule&quot;,{value:!0});lSe(nY(),Io)});var oY,sY=p(()=&gt;{oY=&quot;0.56.0&quot;});var Ua,aY=p(()=&gt;{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${oY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Ah))}}});var lY=p(()=&gt;{aY()});var cY=p(()=&gt;{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=&gt;Ua});var fY=p(()=&gt;{cY()});var pY,dY=p(()=&gt;{pY=&quot;0.56.0&quot;});var ka,hY=p(()=&gt;{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${pY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Rh))}}});var _Y=p(()=&gt;{hY()});var EY=p(()=&gt;{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=&gt;ka});var TY=p(()=&gt;{EY()});var SY,gY=p(()=&gt;{SY=&quot;0.56.0&quot;});var mR,vY=p(()=&gt;{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${SY}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Nh))}}});var yY=p(()=&gt;{vY()});var OY=p(()=&gt;{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=&gt;mR});var RY=p(()=&gt;{OY()});var CY=T(sm=&gt;{&quot;use strict&quot;;Object.defineProperty(sm,&quot;__esModule&quot;,{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,&quot;TRACES&quot;),cSe.ProtobufTraceSerializer,&quot;TraceExportService&quot;,&quot;/opentelemetry.proto.collector.trace.v1.TraceService/Export&quot;))}};sm.OTLPTraceExporter=TR});var PY=T(bo=&gt;{&quot;use strict&quot;;var fSe=bo&amp;&amp;bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),pSe=bo&amp;&amp;bo.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;fSe(e,r,t)};Object.defineProperty(bo,&quot;__esModule&quot;,{value:!0});pSe(CY(),bo)});var am,IY=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(am||(am={}))});function _Se(r){return hSe.indexOf(r)&gt;-1}function mSe(r){return ESe.indexOf(r)&gt;-1}function SSe(r){return TSe.indexOf(r)&gt;-1}function ySe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=RSe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=&gt;{P();IY();dSe=&quot;,&quot;,hSe=[&quot;OTEL_SDK_DISABLED&quot;];ESe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];TSe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=&gt;{LY()});var wY=p(()=&gt;{xY()});var DY=p(()=&gt;{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=&gt;{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(sn||(sn={}))});var lm=p(()=&gt;{UY();kY();DY()});import*as DSe from&quot;http&quot;;import*as USe from&quot;https&quot;;import*as BY from&quot;url&quot;;function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:&quot;POST&quot;,headers:Object.assign({&quot;Content-Type&quot;:&quot;application/json&quot;},e)},t);return function(a,i){if(a.length===0)return S.debug(&quot;Zipkin send with empty spans&quot;),i({code:sn.SUCCESS});let{request:n}=o.protocol===&quot;http:&quot;?DSe:USe,l=n(o,u=&gt;{let f=&quot;&quot;;u.on(&quot;data&quot;,_=&gt;{f+=_}),u.on(&quot;end&quot;,()=&gt;{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_&lt;400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on(&quot;error&quot;,u=&gt;i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,&quot;utf8&quot;),l.end()}}var VY=p(()=&gt;{P();lm()});var FY=p(()=&gt;{VY()});var yR=p(()=&gt;{FY()});var xo,GY=p(()=&gt;{(function(r){r.CLIENT=&quot;CLIENT&quot;,r.SERVER=&quot;SERVER&quot;,r.CONSUMER=&quot;CONSUMER&quot;,r.PRODUCER=&quot;PRODUCER&quot;})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&amp;&amp;(l[i]=String(jt[t.code])),t.code===jt.ERROR&amp;&amp;t.message&amp;&amp;(l[n]=t.message),o&amp;&amp;(l[&quot;otel.dropped_attributes_count&quot;]=String(o)),s&amp;&amp;(l[&quot;otel.dropped_events_count&quot;]=String(s)),a&amp;&amp;(l[&quot;otel.dropped_links_count&quot;]=String(a)),Object.keys(e.attributes).forEach(c=&gt;l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=&gt;({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=&gt;{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY=&quot;otel.status_code&quot;,qY=&quot;error&quot;});function zY(r){return function(){return r()}}var KY=p(()=&gt;{});var cm,$Y=p(()=&gt;{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME=&quot;OpenTelemetry Service&quot;,this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders==&quot;function&quot;?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug(&quot;Zipkin exporter export&quot;),this._isShutdown){setTimeout(()=&gt;t({code:sn.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)}));return}let s=new Promise(i=&gt;{this._sendSpans(e,o,n=&gt;{i(),t(n)})});this._sendingPromises.push(s);let a=()=&gt;{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug(&quot;Zipkin exporter shutdown&quot;),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=&gt;{Promise.all(this._sendingPromises).then(()=&gt;{e()},t)})}_beforeSend(){this._getHeaders&amp;&amp;(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=&gt;jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=&gt;{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=&gt;cm,prepareSend:()=&gt;Lo});var WY=p(()=&gt;{yR();$Y()});var ez=T(an=&gt;{&quot;use strict&quot;;Object.defineProperty(an,&quot;__esModule&quot;,{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe=&quot;env&quot;,YSe=&quot;host&quot;,zSe=&quot;os&quot;,KSe=&quot;process&quot;,$Se=&quot;serviceinstance&quot;;function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(&quot;,&quot;))!==null&amp;&amp;e!==void 0?e:[&quot;all&quot;];return o.includes(&quot;all&quot;)?[...t.values()].flat():o.includes(&quot;none&quot;)?[]:o.flatMap(s=&gt;{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector &quot;${s}&quot; specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=&gt;e.trim()).filter(e=&gt;e!==&quot;null&quot;&amp;&amp;e!==&quot;&quot;)}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&amp;&amp;e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case&quot;grpc&quot;:return new HSe.OTLPTraceExporter;case&quot;http/json&quot;:return new GSe.OTLPTraceExporter;case&quot;http/protobuf&quot;:return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V(&quot;@opentelemetry/exporter-jaeger&quot;);return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter&#x27;s lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([[&quot;otlp&quot;,()=&gt;WSe()],[&quot;zipkin&quot;,()=&gt;new qSe.ZipkinExporter],[&quot;console&quot;,()=&gt;new um.ConsoleSpanExporter],[&quot;jaeger&quot;,()=&gt;JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(&quot;,&quot;))));if(s[0]===&quot;none&quot;)return Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot;. SDK will not be initialized.&#x27;),[];s.length===0?(Mo.diag.warn(&quot;OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.&quot;),s=[&quot;otlp&quot;]):s.length&gt;1&amp;&amp;s.includes(&quot;none&quot;)&amp;&amp;(Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot; along with other exporters. Using default otlp exporter.&#x27;),s=[&quot;otlp&quot;]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&amp;&amp;Mo.diag.warn(&quot;Unable to set up trace exporter(s) due to invalid exporter and/or protocol values.&quot;),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=&gt;{&quot;use strict&quot;;Object.defineProperty(pm,&quot;__esModule&quot;,{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&amp;&amp;(this._disabled=!0),u.OTEL_LOG_LEVEL&amp;&amp;ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&amp;&amp;t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&amp;&amp;o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&amp;&amp;s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&amp;&amp;(f.sampler=e.sampler),e.spanLimits&amp;&amp;(f.spanLimits=e.spanLimits),e.idGenerator&amp;&amp;(f.idGenerator=e.idGenerator),e.spanProcessor&amp;&amp;ln.diag.warn(&quot;The &#x27;spanProcessor&#x27; option is deprecated. Please use &#x27;spanProcessors&#x27; instead.&quot;);let _=(a=e.spanProcessor)!==null&amp;&amp;a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&amp;&amp;i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn(&quot;The &#x27;logRecordProcessor&#x27; option is deprecated. Please use &#x27;logRecordProcessors&#x27; instead.&quot;)):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&amp;&amp;(f.reader=e.metricReader),e.views&amp;&amp;(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&amp;&amp;l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length&gt;0&amp;&amp;this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&amp;&amp;t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&amp;&amp;l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&amp;&amp;i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&amp;&amp;e.push(this._tracerProvider.shutdown()),this._loggerProvider&amp;&amp;e.push(this._loggerProvider.shutdown()),this._meterProvider&amp;&amp;e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=&gt;{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&amp;&amp;e!==void 0?e:&quot;&quot;,o=(0,AR.filterBlanksAndNulls)(t.split(&quot;,&quot;));if(o.length===0&amp;&amp;(ln.diag.info(&quot;OTEL_LOGS_EXPORTER is empty. Using default otlp exporter.&quot;),o.push(&quot;otlp&quot;)),o.includes(&quot;none&quot;)){ln.diag.info(&#x27;OTEL_LOGS_EXPORTER contains &quot;none&quot;. Logger provider will not be initialized.&#x27;);return}let s=[];o.forEach(a=&gt;{var i,n;if(a===&quot;otlp&quot;){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&amp;&amp;i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case&quot;grpc&quot;:s.push(new rge.OTLPLogExporter);break;case&quot;http/json&quot;:s.push(new tge.OTLPLogExporter);break;case&quot;http/protobuf&quot;:s.push(new OR.OTLPLogExporter);break;case void 0:case&quot;&quot;:s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: &quot;${l}&quot;. Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a===&quot;console&quot;?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: &quot;${a}&quot;. Supported values are: otlp, console, none.`)}),s.length&gt;0&amp;&amp;(this._loggerProviderConfig={logRecordProcessors:s.map(a=&gt;a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=&gt;{&quot;use strict&quot;;Object.defineProperty(Xe,&quot;__esModule&quot;,{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,&quot;NodeSDK&quot;,{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from&quot;process&quot;;P();var vi=typeof globalThis==&quot;object&quot;?globalThis:global;function LN(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var xN=&quot;1.30.1&quot;;Ve();var yi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt&lt;&quot;u&quot;?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=&gt;sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=&gt;{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=&gt;{throw TypeError(r)},Jm=(r,e,t)=&gt;e.has(r)||uM(&quot;Cannot &quot;+t),el=(r,e,t)=&gt;(Jm(r,e,&quot;read from private field&quot;),t?t.call(r):e.get(r)),Wu=(r,e,t)=&gt;e.has(r)?uM(&quot;Cannot add the same private member more than once&quot;):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=&gt;(Jm(r,e,&quot;write to private field&quot;),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=&gt;(Jm(r,e,&quot;access private method&quot;),t),fZ=&quot;__nfOTLPTrace&quot;,tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:&quot;netlify-span-exporter&quot;}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug(&quot;Shutting down&quot;),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&amp;&amp;!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&amp;&amp;o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)==&quot;function&quot;?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName=&quot;@netlify/otel/instrumentation-fetch&quot;,this.instrumentationVersion=&quot;1.0.0&quot;,this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,&quot;http.request.method&quot;:e.method,&quot;url.full&quot;:o.href,&quot;url.host&quot;:o.host,&quot;url.scheme&quot;:o.protocol.slice(0,-1),&quot;server.address&quot;:o.hostname,&quot;server.port&quot;:o.port,...this.prepareHeaders(&quot;request&quot;,e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,&quot;http.response.status_code&quot;:e.status,...this.prepareHeaders(&quot;response&quot;,e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=[&quot;*&quot;,&quot;/.*/&quot;],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=&gt;t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l))?i[u]=&quot;REDACTED&quot;:i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=&gt;{var a;let o=typeof e==&quot;string&quot;?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&amp;&amp;a.some(i=&gt;typeof i==&quot;string&quot;?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan(&quot;fetch&quot;,async i=&gt;{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&amp;&amp;(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&amp;&amp;S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({&quot;service.name&quot;:SERVICE_NAME??&quot;lambda-function&quot;,&quot;service.version&quot;:SERVICE_VERSION,&quot;process.runtime.name&quot;:&quot;nodejs&quot;,&quot;process.runtime.version&quot;:lge.slice(1),&quot;deployment.environment&quot;:(iz=bu.URL)!=null&amp;&amp;iz.includes(&quot;netlifystg.com&quot;)?&quot;staging&quot;:&quot;production&quot;,&quot;http.url&quot;:bu.URL,&quot;netlify.site.id&quot;:bu.SITE_ID,&quot;netlify.site.name&quot;:bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */ </div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ lightx-proxy.js</div> <div class="content">module.exports = require(&#x27;./netlify/functions/lightx-proxy.js&#x27;)</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ netlify</div> <div class="folder" style="margin-left: 80px;">๐Ÿ“ functions</div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ lightx-proxy.js</div> <div class="content">var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) =&gt; function __init() { return fn &amp;&amp; (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) =&gt; function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) =&gt; { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) =&gt; { if (from &amp;&amp; typeof from === &quot;object&quot; || typeof from === &quot;function&quot;) { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) &amp;&amp; key !== except) __defProp(to, key, { get: () =&gt; from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) =&gt; (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. &quot;__esModule&quot; has not been set), then set // &quot;default&quot; to the CommonJS &quot;module.exports&quot; for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, &quot;default&quot;, { value: mod, enumerable: true }) : target, mod )); // node_modules/data-uri-to-buffer/dist/index.js function dataUriToBuffer(uri) { if (!/^data:/i.test(uri)) { throw new TypeError(&#x27;`uri` does not appear to be a Data URI (must begin with &quot;data:&quot;)&#x27;); } uri = uri.replace(/\r?\n/g, &quot;&quot;); const firstComma = uri.indexOf(&quot;,&quot;); if (firstComma === -1 || firstComma &lt;= 4) { throw new TypeError(&quot;malformed data: URI&quot;); } const meta = uri.substring(5, firstComma).split(&quot;;&quot;); let charset = &quot;&quot;; let base64 = false; const type = meta[0] || &quot;text/plain&quot;; let typeFull = type; for (let i2 = 1; i2 &lt; meta.length; i2++) { if (meta[i2] === &quot;base64&quot;) { base64 = true; } else if (meta[i2]) { typeFull += `;${meta[i2]}`; if (meta[i2].indexOf(&quot;charset=&quot;) === 0) { charset = meta[i2].substring(8); } } } if (!meta[0] &amp;&amp; !charset.length) { typeFull += &quot;;charset=US-ASCII&quot;; charset = &quot;US-ASCII&quot;; } const encoding = base64 ? &quot;base64&quot; : &quot;ascii&quot;; const data = unescape(uri.substring(firstComma + 1)); const buffer = Buffer.from(data, encoding); buffer.type = type; buffer.typeFull = typeFull; buffer.charset = charset; return buffer; } var dist_default; var init_dist = __esm({ &quot;node_modules/data-uri-to-buffer/dist/index.js&quot;() { dist_default = dataUriToBuffer; } }); // node_modules/web-streams-polyfill/dist/ponyfill.es2018.js var require_ponyfill_es2018 = __commonJS({ &quot;node_modules/web-streams-polyfill/dist/ponyfill.es2018.js&quot;(exports2, module2) { (function(global2, factory) { typeof exports2 === &quot;object&quot; &amp;&amp; typeof module2 !== &quot;undefined&quot; ? factory(exports2) : typeof define === &quot;function&quot; &amp;&amp; define.amd ? define([&quot;exports&quot;], factory) : (global2 = typeof globalThis !== &quot;undefined&quot; ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {})); })(exports2, (function(exports3) { &quot;use strict&quot;; function noop2() { return void 0; } function typeIsObject(x2) { return typeof x2 === &quot;object&quot; &amp;&amp; x2 !== null || typeof x2 === &quot;function&quot;; } const rethrowAssertionErrorRejection = noop2; function setFunctionName(fn, name) { try { Object.defineProperty(fn, &quot;name&quot;, { value: name, configurable: true }); } catch (_a2) { } } const originalPromise = Promise; const originalPromiseThen = Promise.prototype.then; const originalPromiseReject = Promise.reject.bind(originalPromise); function newPromise(executor) { return new originalPromise(executor); } function promiseResolvedWith(value) { return newPromise((resolve) =&gt; resolve(value)); } function promiseRejectedWith(reason) { return originalPromiseReject(reason); } function PerformPromiseThen(promise, onFulfilled, onRejected) { return originalPromiseThen.call(promise, onFulfilled, onRejected); } function uponPromise(promise, onFulfilled, onRejected) { PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), void 0, rethrowAssertionErrorRejection); } function uponFulfillment(promise, onFulfilled) { uponPromise(promise, onFulfilled); } function uponRejection(promise, onRejected) { uponPromise(promise, void 0, onRejected); } function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) { return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler); } function setPromiseIsHandledToTrue(promise) { PerformPromiseThen(promise, void 0, rethrowAssertionErrorRejection); } let _queueMicrotask = (callback) =&gt; { if (typeof queueMicrotask === &quot;function&quot;) { _queueMicrotask = queueMicrotask; } else { const resolvedPromise = promiseResolvedWith(void 0); _queueMicrotask = (cb) =&gt; PerformPromiseThen(resolvedPromise, cb); } return _queueMicrotask(callback); }; function reflectCall(F2, V, args) { if (typeof F2 !== &quot;function&quot;) { throw new TypeError(&quot;Argument is not a function&quot;); } return Function.prototype.apply.call(F2, V, args); } function promiseCall(F2, V, args) { try { return promiseResolvedWith(reflectCall(F2, V, args)); } catch (value) { return promiseRejectedWith(value); } } const QUEUE_MAX_ARRAY_SIZE = 16384; class SimpleQueue { constructor() { this._cursor = 0; this._size = 0; this._front = { _elements: [], _next: void 0 }; this._back = this._front; this._cursor = 0; this._size = 0; } get length() { return this._size; } // For exception safety, this method is structured in order: // 1. Read state // 2. Calculate required state mutations // 3. Perform state mutations push(element) { const oldBack = this._back; let newBack = oldBack; if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) { newBack = { _elements: [], _next: void 0 }; } oldBack._elements.push(element); if (newBack !== oldBack) { this._back = newBack; oldBack._next = newBack; } ++this._size; } // Like push(), shift() follows the read -&gt; calculate -&gt; mutate pattern for // exception safety. shift() { const oldFront = this._front; let newFront = oldFront; const oldCursor = this._cursor; let newCursor = oldCursor + 1; const elements = oldFront._elements; const element = elements[oldCursor]; if (newCursor === QUEUE_MAX_ARRAY_SIZE) { newFront = oldFront._next; newCursor = 0; } --this._size; this._cursor = newCursor; if (oldFront !== newFront) { this._front = newFront; } elements[oldCursor] = void 0; return element; } // The tricky thing about forEach() is that it can be called // re-entrantly. The queue may be mutated inside the callback. It is easy to // see that push() within the callback has no negative effects since the end // of the queue is checked for on every iteration. If shift() is called // repeatedly within the callback then the next iteration may return an // element that has been removed. In this case the callback will be called // with undefined values until we either &quot;catch up&quot; with elements that still // exist or reach the back of the queue. forEach(callback) { let i2 = this._cursor; let node = this._front; let elements = node._elements; while (i2 !== elements.length || node._next !== void 0) { if (i2 === elements.length) { node = node._next; elements = node._elements; i2 = 0; if (elements.length === 0) { break; } } callback(elements[i2]); ++i2; } } // Return the element that would be returned if shift() was called now, // without modifying the queue. peek() { const front = this._front; const cursor = this._cursor; return front._elements[cursor]; } } const AbortSteps = Symbol(&quot;[[AbortSteps]]&quot;); const ErrorSteps = Symbol(&quot;[[ErrorSteps]]&quot;); const CancelSteps = Symbol(&quot;[[CancelSteps]]&quot;); const PullSteps = Symbol(&quot;[[PullSteps]]&quot;); const ReleaseSteps = Symbol(&quot;[[ReleaseSteps]]&quot;); function ReadableStreamReaderGenericInitialize(reader, stream) { reader._ownerReadableStream = stream; stream._reader = reader; if (stream._state === &quot;readable&quot;) { defaultReaderClosedPromiseInitialize(reader); } else if (stream._state === &quot;closed&quot;) { defaultReaderClosedPromiseInitializeAsResolved(reader); } else { defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); } } function ReadableStreamReaderGenericCancel(reader, reason) { const stream = reader._ownerReadableStream; return ReadableStreamCancel(stream, reason); } function ReadableStreamReaderGenericRelease(reader) { const stream = reader._ownerReadableStream; if (stream._state === &quot;readable&quot;) { defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream&#x27;s closedness`)); } else { defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream&#x27;s closedness`)); } stream._readableStreamController[ReleaseSteps](); stream._reader = void 0; reader._ownerReadableStream = void 0; } function readerLockException(name) { return new TypeError(&quot;Cannot &quot; + name + &quot; a stream using a released reader&quot;); } function defaultReaderClosedPromiseInitialize(reader) { reader._closedPromise = newPromise((resolve, reject) =&gt; { reader._closedPromise_resolve = resolve; reader._closedPromise_reject = reject; }); } function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseReject(reader, reason); } function defaultReaderClosedPromiseInitializeAsResolved(reader) { defaultReaderClosedPromiseInitialize(reader); defaultReaderClosedPromiseResolve(reader); } function defaultReaderClosedPromiseReject(reader, reason) { if (reader._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(reader._closedPromise); reader._closedPromise_reject(reason); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } function defaultReaderClosedPromiseResetToRejected(reader, reason) { defaultReaderClosedPromiseInitializeAsRejected(reader, reason); } function defaultReaderClosedPromiseResolve(reader) { if (reader._closedPromise_resolve === void 0) { return; } reader._closedPromise_resolve(void 0); reader._closedPromise_resolve = void 0; reader._closedPromise_reject = void 0; } const NumberIsFinite = Number.isFinite || function(x2) { return typeof x2 === &quot;number&quot; &amp;&amp; isFinite(x2); }; const MathTrunc = Math.trunc || function(v) { return v &lt; 0 ? Math.ceil(v) : Math.floor(v); }; function isDictionary(x2) { return typeof x2 === &quot;object&quot; || typeof x2 === &quot;function&quot;; } function assertDictionary(obj, context) { if (obj !== void 0 &amp;&amp; !isDictionary(obj)) { throw new TypeError(`${context} is not an object.`); } } function assertFunction(x2, context) { if (typeof x2 !== &quot;function&quot;) { throw new TypeError(`${context} is not a function.`); } } function isObject(x2) { return typeof x2 === &quot;object&quot; &amp;&amp; x2 !== null || typeof x2 === &quot;function&quot;; } function assertObject(x2, context) { if (!isObject(x2)) { throw new TypeError(`${context} is not an object.`); } } function assertRequiredArgument(x2, position, context) { if (x2 === void 0) { throw new TypeError(`Parameter ${position} is required in &#x27;${context}&#x27;.`); } } function assertRequiredField(x2, field, context) { if (x2 === void 0) { throw new TypeError(`${field} is required in &#x27;${context}&#x27;.`); } } function convertUnrestrictedDouble(value) { return Number(value); } function censorNegativeZero(x2) { return x2 === 0 ? 0 : x2; } function integerPart(x2) { return censorNegativeZero(MathTrunc(x2)); } function convertUnsignedLongLongWithEnforceRange(value, context) { const lowerBound = 0; const upperBound = Number.MAX_SAFE_INTEGER; let x2 = Number(value); x2 = censorNegativeZero(x2); if (!NumberIsFinite(x2)) { throw new TypeError(`${context} is not a finite number`); } x2 = integerPart(x2); if (x2 &lt; lowerBound || x2 &gt; upperBound) { throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`); } if (!NumberIsFinite(x2) || x2 === 0) { return 0; } return x2; } function assertReadableStream(x2, context) { if (!IsReadableStream(x2)) { throw new TypeError(`${context} is not a ReadableStream.`); } } function AcquireReadableStreamDefaultReader(stream) { return new ReadableStreamDefaultReader(stream); } function ReadableStreamAddReadRequest(stream, readRequest) { stream._reader._readRequests.push(readRequest); } function ReadableStreamFulfillReadRequest(stream, chunk, done) { const reader = stream._reader; const readRequest = reader._readRequests.shift(); if (done) { readRequest._closeSteps(); } else { readRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadRequests(stream) { return stream._reader._readRequests.length; } function ReadableStreamHasDefaultReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamDefaultReader(reader)) { return false; } return true; } class ReadableStreamDefaultReader { constructor(stream) { assertRequiredArgument(stream, 1, &quot;ReadableStreamDefaultReader&quot;); assertReadableStream(stream, &quot;First parameter&quot;); if (IsReadableStreamLocked(stream)) { throw new TypeError(&quot;This stream has already been locked for exclusive reading by another reader&quot;); } ReadableStreamReaderGenericInitialize(this, stream); this._readRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, * or rejected if the stream ever errors or the reader&#x27;s lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException(&quot;closed&quot;)); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException(&quot;cancel&quot;)); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException(&quot;cancel&quot;)); } return ReadableStreamReaderGenericCancel(this, reason); } /** * Returns a promise that allows access to the next chunk from the stream&#x27;s internal queue, if available. * * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. */ read() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException(&quot;read&quot;)); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException(&quot;read from&quot;)); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) =&gt; { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) =&gt; resolvePromise({ value: chunk, done: false }), _closeSteps: () =&gt; resolvePromise({ value: void 0, done: true }), _errorSteps: (e2) =&gt; rejectPromise(e2) }; ReadableStreamDefaultReaderRead(this, readRequest); return promise; } /** * Releases the reader&#x27;s lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader&#x27;s lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader&#x27;s {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamDefaultReader(this)) { throw defaultReaderBrandCheckException(&quot;releaseLock&quot;); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamDefaultReaderRelease(this); } } Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamDefaultReader.prototype.cancel, &quot;cancel&quot;); setFunctionName(ReadableStreamDefaultReader.prototype.read, &quot;read&quot;); setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, &quot;releaseLock&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, { value: &quot;ReadableStreamDefaultReader&quot;, configurable: true }); } function IsReadableStreamDefaultReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_readRequests&quot;)) { return false; } return x2 instanceof ReadableStreamDefaultReader; } function ReadableStreamDefaultReaderRead(reader, readRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === &quot;closed&quot;) { readRequest._closeSteps(); } else if (stream._state === &quot;errored&quot;) { readRequest._errorSteps(stream._storedError); } else { stream._readableStreamController[PullSteps](readRequest); } } function ReadableStreamDefaultReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError(&quot;Reader was released&quot;); ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } function ReadableStreamDefaultReaderErrorReadRequests(reader, e2) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) =&gt; { readRequest._errorSteps(e2); }); } function defaultReaderBrandCheckException(name) { return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`); } const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { }).prototype); class ReadableStreamAsyncIteratorImpl { constructor(reader, preventCancel) { this._ongoingPromise = void 0; this._isFinished = false; this._reader = reader; this._preventCancel = preventCancel; } next() { const nextSteps = () =&gt; this._nextSteps(); this._ongoingPromise = this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) : nextSteps(); return this._ongoingPromise; } return(value) { const returnSteps = () =&gt; this._returnSteps(value); return this._ongoingPromise ? transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) : returnSteps(); } _nextSteps() { if (this._isFinished) { return Promise.resolve({ value: void 0, done: true }); } const reader = this._reader; let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) =&gt; { resolvePromise = resolve; rejectPromise = reject; }); const readRequest = { _chunkSteps: (chunk) =&gt; { this._ongoingPromise = void 0; _queueMicrotask(() =&gt; resolvePromise({ value: chunk, done: false })); }, _closeSteps: () =&gt; { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); resolvePromise({ value: void 0, done: true }); }, _errorSteps: (reason) =&gt; { this._ongoingPromise = void 0; this._isFinished = true; ReadableStreamReaderGenericRelease(reader); rejectPromise(reason); } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promise; } _returnSteps(value) { if (this._isFinished) { return Promise.resolve({ value, done: true }); } this._isFinished = true; const reader = this._reader; if (!this._preventCancel) { const result = ReadableStreamReaderGenericCancel(reader, value); ReadableStreamReaderGenericRelease(reader); return transformPromiseWith(result, () =&gt; ({ value, done: true })); } ReadableStreamReaderGenericRelease(reader); return promiseResolvedWith({ value, done: true }); } } const ReadableStreamAsyncIteratorPrototype = { next() { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException(&quot;next&quot;)); } return this._asyncIteratorImpl.next(); }, return(value) { if (!IsReadableStreamAsyncIterator(this)) { return promiseRejectedWith(streamAsyncIteratorBrandCheckException(&quot;return&quot;)); } return this._asyncIteratorImpl.return(value); } }; Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype); function AcquireReadableStreamAsyncIterator(stream, preventCancel) { const reader = AcquireReadableStreamDefaultReader(stream); const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel); const iterator = Object.create(ReadableStreamAsyncIteratorPrototype); iterator._asyncIteratorImpl = impl; return iterator; } function IsReadableStreamAsyncIterator(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_asyncIteratorImpl&quot;)) { return false; } try { return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl; } catch (_a2) { return false; } } function streamAsyncIteratorBrandCheckException(name) { return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`); } const NumberIsNaN = Number.isNaN || function(x2) { return x2 !== x2; }; var _a, _b, _c; function CreateArrayFromList(elements) { return elements.slice(); } function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) { new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); } let TransferArrayBuffer = (O) =&gt; { if (typeof O.transfer === &quot;function&quot;) { TransferArrayBuffer = (buffer) =&gt; buffer.transfer(); } else if (typeof structuredClone === &quot;function&quot;) { TransferArrayBuffer = (buffer) =&gt; structuredClone(buffer, { transfer: [buffer] }); } else { TransferArrayBuffer = (buffer) =&gt; buffer; } return TransferArrayBuffer(O); }; let IsDetachedBuffer = (O) =&gt; { if (typeof O.detached === &quot;boolean&quot;) { IsDetachedBuffer = (buffer) =&gt; buffer.detached; } else { IsDetachedBuffer = (buffer) =&gt; buffer.byteLength === 0; } return IsDetachedBuffer(O); }; function ArrayBufferSlice(buffer, begin, end) { if (buffer.slice) { return buffer.slice(begin, end); } const length = end - begin; const slice = new ArrayBuffer(length); CopyDataBlockBytes(slice, 0, buffer, begin, length); return slice; } function GetMethod(receiver, prop) { const func = receiver[prop]; if (func === void 0 || func === null) { return void 0; } if (typeof func !== &quot;function&quot;) { throw new TypeError(`${String(prop)} is not a function`); } return func; } function CreateAsyncFromSyncIterator(syncIteratorRecord) { const syncIterable = { [Symbol.iterator]: () =&gt; syncIteratorRecord.iterator }; const asyncIterator = (async function* () { return yield* syncIterable; })(); const nextMethod = asyncIterator.next; return { iterator: asyncIterator, nextMethod, done: false }; } const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null &amp;&amp; _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, &quot;Symbol.asyncIterator&quot;)) !== null &amp;&amp; _c !== void 0 ? _c : &quot;@@asyncIterator&quot;; function GetIterator(obj, hint = &quot;sync&quot;, method) { if (method === void 0) { if (hint === &quot;async&quot;) { method = GetMethod(obj, SymbolAsyncIterator); if (method === void 0) { const syncMethod = GetMethod(obj, Symbol.iterator); const syncIteratorRecord = GetIterator(obj, &quot;sync&quot;, syncMethod); return CreateAsyncFromSyncIterator(syncIteratorRecord); } } else { method = GetMethod(obj, Symbol.iterator); } } if (method === void 0) { throw new TypeError(&quot;The object is not iterable&quot;); } const iterator = reflectCall(method, obj, []); if (!typeIsObject(iterator)) { throw new TypeError(&quot;The iterator method must return an object&quot;); } const nextMethod = iterator.next; return { iterator, nextMethod, done: false }; } function IteratorNext(iteratorRecord) { const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []); if (!typeIsObject(result)) { throw new TypeError(&quot;The iterator.next() method must return an object&quot;); } return result; } function IteratorComplete(iterResult) { return Boolean(iterResult.done); } function IteratorValue(iterResult) { return iterResult.value; } function IsNonNegativeNumber(v) { if (typeof v !== &quot;number&quot;) { return false; } if (NumberIsNaN(v)) { return false; } if (v &lt; 0) { return false; } return true; } function CloneAsUint8Array(O) { const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength); return new Uint8Array(buffer); } function DequeueValue(container) { const pair = container._queue.shift(); container._queueTotalSize -= pair.size; if (container._queueTotalSize &lt; 0) { container._queueTotalSize = 0; } return pair.value; } function EnqueueValueWithSize(container, value, size) { if (!IsNonNegativeNumber(size) || size === Infinity) { throw new RangeError(&quot;Size must be a finite, non-NaN, non-negative number.&quot;); } container._queue.push({ value, size }); container._queueTotalSize += size; } function PeekQueueValue(container) { const pair = container._queue.peek(); return pair.value; } function ResetQueue(container) { container._queue = new SimpleQueue(); container._queueTotalSize = 0; } function isDataViewConstructor(ctor) { return ctor === DataView; } function isDataView(view) { return isDataViewConstructor(view.constructor); } function arrayBufferViewElementSize(ctor) { if (isDataViewConstructor(ctor)) { return 1; } return ctor.BYTES_PER_ELEMENT; } class ReadableStreamBYOBRequest { constructor() { throw new TypeError(&quot;Illegal constructor&quot;); } /** * Returns the view for writing in to, or `null` if the BYOB request has already been responded to. */ get view() { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException(&quot;view&quot;); } return this._view; } respond(bytesWritten) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException(&quot;respond&quot;); } assertRequiredArgument(bytesWritten, 1, &quot;respond&quot;); bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, &quot;First parameter&quot;); if (this._associatedReadableByteStreamController === void 0) { throw new TypeError(&quot;This BYOB request has been invalidated&quot;); } if (IsDetachedBuffer(this._view.buffer)) { throw new TypeError(`The BYOB request&#x27;s buffer has been detached and so cannot be used as a response`); } ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); } respondWithNewView(view) { if (!IsReadableStreamBYOBRequest(this)) { throw byobRequestBrandCheckException(&quot;respondWithNewView&quot;); } assertRequiredArgument(view, 1, &quot;respondWithNewView&quot;); if (!ArrayBuffer.isView(view)) { throw new TypeError(&quot;You can only respond with array buffer views&quot;); } if (this._associatedReadableByteStreamController === void 0) { throw new TypeError(&quot;This BYOB request has been invalidated&quot;); } if (IsDetachedBuffer(view.buffer)) { throw new TypeError(&quot;The given view&#x27;s buffer has been detached and so cannot be used as a response&quot;); } ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); } } Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }); setFunctionName(ReadableStreamBYOBRequest.prototype.respond, &quot;respond&quot;); setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, &quot;respondWithNewView&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, { value: &quot;ReadableStreamBYOBRequest&quot;, configurable: true }); } class ReadableByteStreamController { constructor() { throw new TypeError(&quot;Illegal constructor&quot;); } /** * Returns the current BYOB pull request, or `null` if there isn&#x27;t one. */ get byobRequest() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException(&quot;byobRequest&quot;); } return ReadableByteStreamControllerGetBYOBRequest(this); } /** * Returns the desired size to fill the controlled stream&#x27;s internal queue. It can be negative, if the queue is * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException(&quot;desiredSize&quot;); } return ReadableByteStreamControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException(&quot;close&quot;); } if (this._closeRequested) { throw new TypeError(&quot;The stream has already been closed; do not close it again!&quot;); } const state = this._controlledReadableByteStream._state; if (state !== &quot;readable&quot;) { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`); } ReadableByteStreamControllerClose(this); } enqueue(chunk) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException(&quot;enqueue&quot;); } assertRequiredArgument(chunk, 1, &quot;enqueue&quot;); if (!ArrayBuffer.isView(chunk)) { throw new TypeError(&quot;chunk must be an array buffer view&quot;); } if (chunk.byteLength === 0) { throw new TypeError(&quot;chunk must have non-zero byteLength&quot;); } if (chunk.buffer.byteLength === 0) { throw new TypeError(`chunk&#x27;s buffer must have non-zero byteLength`); } if (this._closeRequested) { throw new TypeError(&quot;stream is closed or draining&quot;); } const state = this._controlledReadableByteStream._state; if (state !== &quot;readable&quot;) { throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`); } ReadableByteStreamControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableByteStreamController(this)) { throw byteStreamControllerBrandCheckException(&quot;error&quot;); } ReadableByteStreamControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ReadableByteStreamControllerClearPendingPullIntos(this); ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableByteStreamControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableByteStream; if (this._queueTotalSize &gt; 0) { ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest); return; } const autoAllocateChunkSize = this._autoAllocateChunkSize; if (autoAllocateChunkSize !== void 0) { let buffer; try { buffer = new ArrayBuffer(autoAllocateChunkSize); } catch (bufferE) { readRequest._errorSteps(bufferE); return; } const pullIntoDescriptor = { buffer, bufferByteLength: autoAllocateChunkSize, byteOffset: 0, byteLength: autoAllocateChunkSize, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: &quot;default&quot; }; this._pendingPullIntos.push(pullIntoDescriptor); } ReadableStreamAddReadRequest(stream, readRequest); ReadableByteStreamControllerCallPullIfNeeded(this); } /** @internal */ [ReleaseSteps]() { if (this._pendingPullIntos.length &gt; 0) { const firstPullInto = this._pendingPullIntos.peek(); firstPullInto.readerType = &quot;none&quot;; this._pendingPullIntos = new SimpleQueue(); this._pendingPullIntos.push(firstPullInto); } } } Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableByteStreamController.prototype.close, &quot;close&quot;); setFunctionName(ReadableByteStreamController.prototype.enqueue, &quot;enqueue&quot;); setFunctionName(ReadableByteStreamController.prototype.error, &quot;error&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, { value: &quot;ReadableByteStreamController&quot;, configurable: true }); } function IsReadableByteStreamController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_controlledReadableByteStream&quot;)) { return false; } return x2 instanceof ReadableByteStreamController; } function IsReadableStreamBYOBRequest(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_associatedReadableByteStreamController&quot;)) { return false; } return x2 instanceof ReadableStreamBYOBRequest; } function ReadableByteStreamControllerCallPullIfNeeded(controller) { const shouldPull = ReadableByteStreamControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () =&gt; { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableByteStreamControllerCallPullIfNeeded(controller); } return null; }, (e2) =&gt; { ReadableByteStreamControllerError(controller, e2); return null; }); } function ReadableByteStreamControllerClearPendingPullIntos(controller) { ReadableByteStreamControllerInvalidateBYOBRequest(controller); controller._pendingPullIntos = new SimpleQueue(); } function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { let done = false; if (stream._state === &quot;closed&quot;) { done = true; } const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); if (pullIntoDescriptor.readerType === &quot;default&quot;) { ReadableStreamFulfillReadRequest(stream, filledView, done); } else { ReadableStreamFulfillReadIntoRequest(stream, filledView, done); } } function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { const bytesFilled = pullIntoDescriptor.bytesFilled; const elementSize = pullIntoDescriptor.elementSize; return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); } function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { controller._queue.push({ buffer, byteOffset, byteLength }); controller._queueTotalSize += byteLength; } function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) { let clonedChunk; try { clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength); } catch (cloneE) { ReadableByteStreamControllerError(controller, cloneE); throw cloneE; } ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength); } function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) { if (firstDescriptor.bytesFilled &gt; 0) { ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled); } ReadableByteStreamControllerShiftPendingPullInto(controller); } function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; let totalBytesToCopyRemaining = maxBytesToCopy; let ready = false; const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize; const maxAlignedBytes = maxBytesFilled - remainderBytes; if (maxAlignedBytes &gt;= pullIntoDescriptor.minimumFill) { totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; ready = true; } const queue = controller._queue; while (totalBytesToCopyRemaining &gt; 0) { const headOfQueue = queue.peek(); const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); if (headOfQueue.byteLength === bytesToCopy) { queue.shift(); } else { headOfQueue.byteOffset += bytesToCopy; headOfQueue.byteLength -= bytesToCopy; } controller._queueTotalSize -= bytesToCopy; ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); totalBytesToCopyRemaining -= bytesToCopy; } return ready; } function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { pullIntoDescriptor.bytesFilled += size; } function ReadableByteStreamControllerHandleQueueDrain(controller) { if (controller._queueTotalSize === 0 &amp;&amp; controller._closeRequested) { ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(controller._controlledReadableByteStream); } else { ReadableByteStreamControllerCallPullIfNeeded(controller); } } function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { if (controller._byobRequest === null) { return; } controller._byobRequest._associatedReadableByteStreamController = void 0; controller._byobRequest._view = null; controller._byobRequest = null; } function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { while (controller._pendingPullIntos.length &gt; 0) { if (controller._queueTotalSize === 0) { return; } const pullIntoDescriptor = controller._pendingPullIntos.peek(); if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); } } } function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) { const reader = controller._controlledReadableByteStream._reader; while (reader._readRequests.length &gt; 0) { if (controller._queueTotalSize === 0) { return; } const readRequest = reader._readRequests.shift(); ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest); } } function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) { const stream = controller._controlledReadableByteStream; const ctor = view.constructor; const elementSize = arrayBufferViewElementSize(ctor); const { byteOffset, byteLength } = view; const minimumFill = min * elementSize; let buffer; try { buffer = TransferArrayBuffer(view.buffer); } catch (e2) { readIntoRequest._errorSteps(e2); return; } const pullIntoDescriptor = { buffer, bufferByteLength: buffer.byteLength, byteOffset, byteLength, bytesFilled: 0, minimumFill, elementSize, viewConstructor: ctor, readerType: &quot;byob&quot; }; if (controller._pendingPullIntos.length &gt; 0) { controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); return; } if (stream._state === &quot;closed&quot;) { const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); readIntoRequest._closeSteps(emptyView); return; } if (controller._queueTotalSize &gt; 0) { if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); ReadableByteStreamControllerHandleQueueDrain(controller); readIntoRequest._chunkSteps(filledView); return; } if (controller._closeRequested) { const e2 = new TypeError(&quot;Insufficient bytes to fill elements in the given buffer&quot;); ReadableByteStreamControllerError(controller, e2); readIntoRequest._errorSteps(e2); return; } } controller._pendingPullIntos.push(pullIntoDescriptor); ReadableStreamAddReadIntoRequest(stream, readIntoRequest); ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { if (firstDescriptor.readerType === &quot;none&quot;) { ReadableByteStreamControllerShiftPendingPullInto(controller); } const stream = controller._controlledReadableByteStream; if (ReadableStreamHasBYOBReader(stream)) { while (ReadableStreamGetNumReadIntoRequests(stream) &gt; 0) { const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); } } } function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); if (pullIntoDescriptor.readerType === &quot;none&quot;) { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); return; } if (pullIntoDescriptor.bytesFilled &lt; pullIntoDescriptor.minimumFill) { return; } ReadableByteStreamControllerShiftPendingPullInto(controller); const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; if (remainderSize &gt; 0) { const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize); } pullIntoDescriptor.bytesFilled -= remainderSize; ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); ReadableByteStreamControllerInvalidateBYOBRequest(controller); const state = controller._controlledReadableByteStream._state; if (state === &quot;closed&quot;) { ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); } else { ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerShiftPendingPullInto(controller) { const descriptor = controller._pendingPullIntos.shift(); return descriptor; } function ReadableByteStreamControllerShouldCallPull(controller) { const stream = controller._controlledReadableByteStream; if (stream._state !== &quot;readable&quot;) { return false; } if (controller._closeRequested) { return false; } if (!controller._started) { return false; } if (ReadableStreamHasDefaultReader(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) { return true; } if (ReadableStreamHasBYOBReader(stream) &amp;&amp; ReadableStreamGetNumReadIntoRequests(stream) &gt; 0) { return true; } const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller); if (desiredSize &gt; 0) { return true; } return false; } function ReadableByteStreamControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function ReadableByteStreamControllerClose(controller) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== &quot;readable&quot;) { return; } if (controller._queueTotalSize &gt; 0) { controller._closeRequested = true; return; } if (controller._pendingPullIntos.length &gt; 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) { const e2 = new TypeError(&quot;Insufficient bytes to fill elements in the given buffer&quot;); ReadableByteStreamControllerError(controller, e2); throw e2; } } ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamClose(stream); } function ReadableByteStreamControllerEnqueue(controller, chunk) { const stream = controller._controlledReadableByteStream; if (controller._closeRequested || stream._state !== &quot;readable&quot;) { return; } const { buffer, byteOffset, byteLength } = chunk; if (IsDetachedBuffer(buffer)) { throw new TypeError(&quot;chunk&#x27;s buffer is detached and so cannot be enqueued&quot;); } const transferredBuffer = TransferArrayBuffer(buffer); if (controller._pendingPullIntos.length &gt; 0) { const firstPendingPullInto = controller._pendingPullIntos.peek(); if (IsDetachedBuffer(firstPendingPullInto.buffer)) { throw new TypeError(&quot;The BYOB request&#x27;s buffer has been detached and so cannot be filled with an enqueued chunk&quot;); } ReadableByteStreamControllerInvalidateBYOBRequest(controller); firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer); if (firstPendingPullInto.readerType === &quot;none&quot;) { ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto); } } if (ReadableStreamHasDefaultReader(stream)) { ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller); if (ReadableStreamGetNumReadRequests(stream) === 0) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } else { if (controller._pendingPullIntos.length &gt; 0) { ReadableByteStreamControllerShiftPendingPullInto(controller); } const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); ReadableStreamFulfillReadRequest(stream, transferredView, false); } } else if (ReadableStreamHasBYOBReader(stream)) { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); } else { ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); } ReadableByteStreamControllerCallPullIfNeeded(controller); } function ReadableByteStreamControllerError(controller, e2) { const stream = controller._controlledReadableByteStream; if (stream._state !== &quot;readable&quot;) { return; } ReadableByteStreamControllerClearPendingPullIntos(controller); ResetQueue(controller); ReadableByteStreamControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) { const entry = controller._queue.shift(); controller._queueTotalSize -= entry.byteLength; ReadableByteStreamControllerHandleQueueDrain(controller); const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); readRequest._chunkSteps(view); } function ReadableByteStreamControllerGetBYOBRequest(controller) { if (controller._byobRequest === null &amp;&amp; controller._pendingPullIntos.length &gt; 0) { const firstDescriptor = controller._pendingPullIntos.peek(); const view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); const byobRequest = Object.create(ReadableStreamBYOBRequest.prototype); SetUpReadableStreamBYOBRequest(byobRequest, controller, view); controller._byobRequest = byobRequest; } return controller._byobRequest; } function ReadableByteStreamControllerGetDesiredSize(controller) { const state = controller._controlledReadableByteStream._state; if (state === &quot;errored&quot;) { return null; } if (state === &quot;closed&quot;) { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableByteStreamControllerRespond(controller, bytesWritten) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === &quot;closed&quot;) { if (bytesWritten !== 0) { throw new TypeError(&quot;bytesWritten must be 0 when calling respond() on a closed stream&quot;); } } else { if (bytesWritten === 0) { throw new TypeError(&quot;bytesWritten must be greater than 0 when calling respond() on a readable stream&quot;); } if (firstDescriptor.bytesFilled + bytesWritten &gt; firstDescriptor.byteLength) { throw new RangeError(&quot;bytesWritten out of range&quot;); } } firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); ReadableByteStreamControllerRespondInternal(controller, bytesWritten); } function ReadableByteStreamControllerRespondWithNewView(controller, view) { const firstDescriptor = controller._pendingPullIntos.peek(); const state = controller._controlledReadableByteStream._state; if (state === &quot;closed&quot;) { if (view.byteLength !== 0) { throw new TypeError(&quot;The view&#x27;s length must be 0 when calling respondWithNewView() on a closed stream&quot;); } } else { if (view.byteLength === 0) { throw new TypeError(&quot;The view&#x27;s length must be greater than 0 when calling respondWithNewView() on a readable stream&quot;); } } if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { throw new RangeError(&quot;The region specified by view does not match byobRequest&quot;); } if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) { throw new RangeError(&quot;The buffer of view has different capacity than byobRequest&quot;); } if (firstDescriptor.bytesFilled + view.byteLength &gt; firstDescriptor.byteLength) { throw new RangeError(&quot;The region specified by view is larger than byobRequest&quot;); } const viewByteLength = view.byteLength; firstDescriptor.buffer = TransferArrayBuffer(view.buffer); ReadableByteStreamControllerRespondInternal(controller, viewByteLength); } function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) { controller._controlledReadableByteStream = stream; controller._pullAgain = false; controller._pulling = false; controller._byobRequest = null; controller._queue = controller._queueTotalSize = void 0; ResetQueue(controller); controller._closeRequested = false; controller._started = false; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._autoAllocateChunkSize = autoAllocateChunkSize; controller._pendingPullIntos = new SimpleQueue(); stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () =&gt; { controller._started = true; ReadableByteStreamControllerCallPullIfNeeded(controller); return null; }, (r2) =&gt; { ReadableByteStreamControllerError(controller, r2); return null; }); } function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) { const controller = Object.create(ReadableByteStreamController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingByteSource.start !== void 0) { startAlgorithm = () =&gt; underlyingByteSource.start(controller); } else { startAlgorithm = () =&gt; void 0; } if (underlyingByteSource.pull !== void 0) { pullAlgorithm = () =&gt; underlyingByteSource.pull(controller); } else { pullAlgorithm = () =&gt; promiseResolvedWith(void 0); } if (underlyingByteSource.cancel !== void 0) { cancelAlgorithm = (reason) =&gt; underlyingByteSource.cancel(reason); } else { cancelAlgorithm = () =&gt; promiseResolvedWith(void 0); } const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; if (autoAllocateChunkSize === 0) { throw new TypeError(&quot;autoAllocateChunkSize must be greater than 0&quot;); } SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize); } function SetUpReadableStreamBYOBRequest(request, controller, view) { request._associatedReadableByteStreamController = controller; request._view = view; } function byobRequestBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`); } function byteStreamControllerBrandCheckException(name) { return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`); } function convertReaderOptions(options, context) { assertDictionary(options, context); const mode = options === null || options === void 0 ? void 0 : options.mode; return { mode: mode === void 0 ? void 0 : convertReadableStreamReaderMode(mode, `${context} has member &#x27;mode&#x27; that`) }; } function convertReadableStreamReaderMode(mode, context) { mode = `${mode}`; if (mode !== &quot;byob&quot;) { throw new TypeError(`${context} &#x27;${mode}&#x27; is not a valid enumeration value for ReadableStreamReaderMode`); } return mode; } function convertByobReadOptions(options, context) { var _a2; assertDictionary(options, context); const min = (_a2 = options === null || options === void 0 ? void 0 : options.min) !== null &amp;&amp; _a2 !== void 0 ? _a2 : 1; return { min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member &#x27;min&#x27; that`) }; } function AcquireReadableStreamBYOBReader(stream) { return new ReadableStreamBYOBReader(stream); } function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) { stream._reader._readIntoRequests.push(readIntoRequest); } function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { const reader = stream._reader; const readIntoRequest = reader._readIntoRequests.shift(); if (done) { readIntoRequest._closeSteps(chunk); } else { readIntoRequest._chunkSteps(chunk); } } function ReadableStreamGetNumReadIntoRequests(stream) { return stream._reader._readIntoRequests.length; } function ReadableStreamHasBYOBReader(stream) { const reader = stream._reader; if (reader === void 0) { return false; } if (!IsReadableStreamBYOBReader(reader)) { return false; } return true; } class ReadableStreamBYOBReader { constructor(stream) { assertRequiredArgument(stream, 1, &quot;ReadableStreamBYOBReader&quot;); assertReadableStream(stream, &quot;First parameter&quot;); if (IsReadableStreamLocked(stream)) { throw new TypeError(&quot;This stream has already been locked for exclusive reading by another reader&quot;); } if (!IsReadableByteStreamController(stream._readableStreamController)) { throw new TypeError(&quot;Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source&quot;); } ReadableStreamReaderGenericInitialize(this, stream); this._readIntoRequests = new SimpleQueue(); } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the reader&#x27;s lock is released before the stream finishes closing. */ get closed() { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException(&quot;closed&quot;)); } return this._closedPromise; } /** * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. */ cancel(reason = void 0) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException(&quot;cancel&quot;)); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException(&quot;cancel&quot;)); } return ReadableStreamReaderGenericCancel(this, reason); } read(view, rawOptions = {}) { if (!IsReadableStreamBYOBReader(this)) { return promiseRejectedWith(byobReaderBrandCheckException(&quot;read&quot;)); } if (!ArrayBuffer.isView(view)) { return promiseRejectedWith(new TypeError(&quot;view must be an array buffer view&quot;)); } if (view.byteLength === 0) { return promiseRejectedWith(new TypeError(&quot;view must have non-zero byteLength&quot;)); } if (view.buffer.byteLength === 0) { return promiseRejectedWith(new TypeError(`view&#x27;s buffer must have non-zero byteLength`)); } if (IsDetachedBuffer(view.buffer)) { return promiseRejectedWith(new TypeError(&quot;view&#x27;s buffer has been detached&quot;)); } let options; try { options = convertByobReadOptions(rawOptions, &quot;options&quot;); } catch (e2) { return promiseRejectedWith(e2); } const min = options.min; if (min === 0) { return promiseRejectedWith(new TypeError(&quot;options.min must be greater than 0&quot;)); } if (!isDataView(view)) { if (min &gt; view.length) { return promiseRejectedWith(new RangeError(&quot;options.min must be less than or equal to view&#x27;s length&quot;)); } } else if (min &gt; view.byteLength) { return promiseRejectedWith(new RangeError(&quot;options.min must be less than or equal to view&#x27;s byteLength&quot;)); } if (this._ownerReadableStream === void 0) { return promiseRejectedWith(readerLockException(&quot;read from&quot;)); } let resolvePromise; let rejectPromise; const promise = newPromise((resolve, reject) =&gt; { resolvePromise = resolve; rejectPromise = reject; }); const readIntoRequest = { _chunkSteps: (chunk) =&gt; resolvePromise({ value: chunk, done: false }), _closeSteps: (chunk) =&gt; resolvePromise({ value: chunk, done: true }), _errorSteps: (e2) =&gt; rejectPromise(e2) }; ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest); return promise; } /** * Releases the reader&#x27;s lock on the corresponding stream. After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, the reader will appear errored in the same way * from now on; otherwise, the reader will appear closed. * * A reader&#x27;s lock cannot be released while it still has a pending read request, i.e., if a promise returned by * the reader&#x27;s {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to * do so will throw a `TypeError` and leave the reader locked to the stream. */ releaseLock() { if (!IsReadableStreamBYOBReader(this)) { throw byobReaderBrandCheckException(&quot;releaseLock&quot;); } if (this._ownerReadableStream === void 0) { return; } ReadableStreamBYOBReaderRelease(this); } } Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }); setFunctionName(ReadableStreamBYOBReader.prototype.cancel, &quot;cancel&quot;); setFunctionName(ReadableStreamBYOBReader.prototype.read, &quot;read&quot;); setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, &quot;releaseLock&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, { value: &quot;ReadableStreamBYOBReader&quot;, configurable: true }); } function IsReadableStreamBYOBReader(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_readIntoRequests&quot;)) { return false; } return x2 instanceof ReadableStreamBYOBReader; } function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) { const stream = reader._ownerReadableStream; stream._disturbed = true; if (stream._state === &quot;errored&quot;) { readIntoRequest._errorSteps(stream._storedError); } else { ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest); } } function ReadableStreamBYOBReaderRelease(reader) { ReadableStreamReaderGenericRelease(reader); const e2 = new TypeError(&quot;Reader was released&quot;); ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) =&gt; { readIntoRequest._errorSteps(e2); }); } function byobReaderBrandCheckException(name) { return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`); } function ExtractHighWaterMark(strategy, defaultHWM) { const { highWaterMark } = strategy; if (highWaterMark === void 0) { return defaultHWM; } if (NumberIsNaN(highWaterMark) || highWaterMark &lt; 0) { throw new RangeError(&quot;Invalid highWaterMark&quot;); } return highWaterMark; } function ExtractSizeAlgorithm(strategy) { const { size } = strategy; if (!size) { return () =&gt; 1; } return size; } function convertQueuingStrategy(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; const size = init === null || init === void 0 ? void 0 : init.size; return { highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark), size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member &#x27;size&#x27; that`) }; } function convertQueuingStrategySize(fn, context) { assertFunction(fn, context); return (chunk) =&gt; convertUnrestrictedDouble(fn(chunk)); } function convertUnderlyingSink(original, context) { assertDictionary(original, context); const abort = original === null || original === void 0 ? void 0 : original.abort; const close = original === null || original === void 0 ? void 0 : original.close; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; const write = original === null || original === void 0 ? void 0 : original.write; return { abort: abort === void 0 ? void 0 : convertUnderlyingSinkAbortCallback(abort, original, `${context} has member &#x27;abort&#x27; that`), close: close === void 0 ? void 0 : convertUnderlyingSinkCloseCallback(close, original, `${context} has member &#x27;close&#x27; that`), start: start === void 0 ? void 0 : convertUnderlyingSinkStartCallback(start, original, `${context} has member &#x27;start&#x27; that`), write: write === void 0 ? void 0 : convertUnderlyingSinkWriteCallback(write, original, `${context} has member &#x27;write&#x27; that`), type }; } function convertUnderlyingSinkAbortCallback(fn, original, context) { assertFunction(fn, context); return (reason) =&gt; promiseCall(fn, original, [reason]); } function convertUnderlyingSinkCloseCallback(fn, original, context) { assertFunction(fn, context); return () =&gt; promiseCall(fn, original, []); } function convertUnderlyingSinkStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) =&gt; reflectCall(fn, original, [controller]); } function convertUnderlyingSinkWriteCallback(fn, original, context) { assertFunction(fn, context); return (chunk, controller) =&gt; promiseCall(fn, original, [chunk, controller]); } function assertWritableStream(x2, context) { if (!IsWritableStream(x2)) { throw new TypeError(`${context} is not a WritableStream.`); } } function isAbortSignal2(value) { if (typeof value !== &quot;object&quot; || value === null) { return false; } try { return typeof value.aborted === &quot;boolean&quot;; } catch (_a2) { return false; } } const supportsAbortController = typeof AbortController === &quot;function&quot;; function createAbortController() { if (supportsAbortController) { return new AbortController(); } return void 0; } class WritableStream { constructor(rawUnderlyingSink = {}, rawStrategy = {}) { if (rawUnderlyingSink === void 0) { rawUnderlyingSink = null; } else { assertObject(rawUnderlyingSink, &quot;First parameter&quot;); } const strategy = convertQueuingStrategy(rawStrategy, &quot;Second parameter&quot;); const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, &quot;First parameter&quot;); InitializeWritableStream(this); const type = underlyingSink.type; if (type !== void 0) { throw new RangeError(&quot;Invalid type is specified&quot;); } const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm); } /** * Returns whether or not the writable stream is locked to a writer. */ get locked() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2(&quot;locked&quot;); } return IsWritableStreamLocked(this); } /** * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort * mechanism of the underlying sink. * * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel * the stream) if the stream is currently locked. */ abort(reason = void 0) { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2(&quot;abort&quot;)); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError(&quot;Cannot abort a stream that already has a writer&quot;)); } return WritableStreamAbort(this, reason); } /** * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its * close behavior. During this time any further attempts to write will fail (without erroring the stream). * * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked. */ close() { if (!IsWritableStream(this)) { return promiseRejectedWith(streamBrandCheckException$2(&quot;close&quot;)); } if (IsWritableStreamLocked(this)) { return promiseRejectedWith(new TypeError(&quot;Cannot close a stream that already has a writer&quot;)); } if (WritableStreamCloseQueuedOrInFlight(this)) { return promiseRejectedWith(new TypeError(&quot;Cannot close an already-closing stream&quot;)); } return WritableStreamClose(this); } /** * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream * is locked, no other writer can be acquired until this one is released. * * This functionality is especially useful for creating abstractions that desire the ability to write to a stream * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at * the same time, which would cause the resulting written data to be unpredictable and probably useless. */ getWriter() { if (!IsWritableStream(this)) { throw streamBrandCheckException$2(&quot;getWriter&quot;); } return AcquireWritableStreamDefaultWriter(this); } } Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(WritableStream.prototype.abort, &quot;abort&quot;); setFunctionName(WritableStream.prototype.close, &quot;close&quot;); setFunctionName(WritableStream.prototype.getWriter, &quot;getWriter&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, { value: &quot;WritableStream&quot;, configurable: true }); } function AcquireWritableStreamDefaultWriter(stream) { return new WritableStreamDefaultWriter(stream); } function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark = 1, sizeAlgorithm = () =&gt; 1) { const stream = Object.create(WritableStream.prototype); InitializeWritableStream(stream); const controller = Object.create(WritableStreamDefaultController.prototype); SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function InitializeWritableStream(stream) { stream._state = &quot;writable&quot;; stream._storedError = void 0; stream._writer = void 0; stream._writableStreamController = void 0; stream._writeRequests = new SimpleQueue(); stream._inFlightWriteRequest = void 0; stream._closeRequest = void 0; stream._inFlightCloseRequest = void 0; stream._pendingAbortRequest = void 0; stream._backpressure = false; } function IsWritableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_writableStreamController&quot;)) { return false; } return x2 instanceof WritableStream; } function IsWritableStreamLocked(stream) { if (stream._writer === void 0) { return false; } return true; } function WritableStreamAbort(stream, reason) { var _a2; if (stream._state === &quot;closed&quot; || stream._state === &quot;errored&quot;) { return promiseResolvedWith(void 0); } stream._writableStreamController._abortReason = reason; (_a2 = stream._writableStreamController._abortController) === null || _a2 === void 0 ? void 0 : _a2.abort(reason); const state = stream._state; if (state === &quot;closed&quot; || state === &quot;errored&quot;) { return promiseResolvedWith(void 0); } if (stream._pendingAbortRequest !== void 0) { return stream._pendingAbortRequest._promise; } let wasAlreadyErroring = false; if (state === &quot;erroring&quot;) { wasAlreadyErroring = true; reason = void 0; } const promise = newPromise((resolve, reject) =&gt; { stream._pendingAbortRequest = { _promise: void 0, _resolve: resolve, _reject: reject, _reason: reason, _wasAlreadyErroring: wasAlreadyErroring }; }); stream._pendingAbortRequest._promise = promise; if (!wasAlreadyErroring) { WritableStreamStartErroring(stream, reason); } return promise; } function WritableStreamClose(stream) { const state = stream._state; if (state === &quot;closed&quot; || state === &quot;errored&quot;) { return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`)); } const promise = newPromise((resolve, reject) =&gt; { const closeRequest = { _resolve: resolve, _reject: reject }; stream._closeRequest = closeRequest; }); const writer = stream._writer; if (writer !== void 0 &amp;&amp; stream._backpressure &amp;&amp; state === &quot;writable&quot;) { defaultWriterReadyPromiseResolve(writer); } WritableStreamDefaultControllerClose(stream._writableStreamController); return promise; } function WritableStreamAddWriteRequest(stream) { const promise = newPromise((resolve, reject) =&gt; { const writeRequest = { _resolve: resolve, _reject: reject }; stream._writeRequests.push(writeRequest); }); return promise; } function WritableStreamDealWithRejection(stream, error) { const state = stream._state; if (state === &quot;writable&quot;) { WritableStreamStartErroring(stream, error); return; } WritableStreamFinishErroring(stream); } function WritableStreamStartErroring(stream, reason) { const controller = stream._writableStreamController; stream._state = &quot;erroring&quot;; stream._storedError = reason; const writer = stream._writer; if (writer !== void 0) { WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); } if (!WritableStreamHasOperationMarkedInFlight(stream) &amp;&amp; controller._started) { WritableStreamFinishErroring(stream); } } function WritableStreamFinishErroring(stream) { stream._state = &quot;errored&quot;; stream._writableStreamController[ErrorSteps](); const storedError = stream._storedError; stream._writeRequests.forEach((writeRequest) =&gt; { writeRequest._reject(storedError); }); stream._writeRequests = new SimpleQueue(); if (stream._pendingAbortRequest === void 0) { WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const abortRequest = stream._pendingAbortRequest; stream._pendingAbortRequest = void 0; if (abortRequest._wasAlreadyErroring) { abortRequest._reject(storedError); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } const promise = stream._writableStreamController[AbortSteps](abortRequest._reason); uponPromise(promise, () =&gt; { abortRequest._resolve(); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }, (reason) =&gt; { abortRequest._reject(reason); WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return null; }); } function WritableStreamFinishInFlightWrite(stream) { stream._inFlightWriteRequest._resolve(void 0); stream._inFlightWriteRequest = void 0; } function WritableStreamFinishInFlightWriteWithError(stream, error) { stream._inFlightWriteRequest._reject(error); stream._inFlightWriteRequest = void 0; WritableStreamDealWithRejection(stream, error); } function WritableStreamFinishInFlightClose(stream) { stream._inFlightCloseRequest._resolve(void 0); stream._inFlightCloseRequest = void 0; const state = stream._state; if (state === &quot;erroring&quot;) { stream._storedError = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._resolve(); stream._pendingAbortRequest = void 0; } } stream._state = &quot;closed&quot;; const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseResolve(writer); } } function WritableStreamFinishInFlightCloseWithError(stream, error) { stream._inFlightCloseRequest._reject(error); stream._inFlightCloseRequest = void 0; if (stream._pendingAbortRequest !== void 0) { stream._pendingAbortRequest._reject(error); stream._pendingAbortRequest = void 0; } WritableStreamDealWithRejection(stream, error); } function WritableStreamCloseQueuedOrInFlight(stream) { if (stream._closeRequest === void 0 &amp;&amp; stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamHasOperationMarkedInFlight(stream) { if (stream._inFlightWriteRequest === void 0 &amp;&amp; stream._inFlightCloseRequest === void 0) { return false; } return true; } function WritableStreamMarkCloseRequestInFlight(stream) { stream._inFlightCloseRequest = stream._closeRequest; stream._closeRequest = void 0; } function WritableStreamMarkFirstWriteRequestInFlight(stream) { stream._inFlightWriteRequest = stream._writeRequests.shift(); } function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { if (stream._closeRequest !== void 0) { stream._closeRequest._reject(stream._storedError); stream._closeRequest = void 0; } const writer = stream._writer; if (writer !== void 0) { defaultWriterClosedPromiseReject(writer, stream._storedError); } } function WritableStreamUpdateBackpressure(stream, backpressure) { const writer = stream._writer; if (writer !== void 0 &amp;&amp; backpressure !== stream._backpressure) { if (backpressure) { defaultWriterReadyPromiseReset(writer); } else { defaultWriterReadyPromiseResolve(writer); } } stream._backpressure = backpressure; } class WritableStreamDefaultWriter { constructor(stream) { assertRequiredArgument(stream, 1, &quot;WritableStreamDefaultWriter&quot;); assertWritableStream(stream, &quot;First parameter&quot;); if (IsWritableStreamLocked(stream)) { throw new TypeError(&quot;This stream has already been locked for exclusive writing by another writer&quot;); } this._ownerWritableStream = stream; stream._writer = this; const state = stream._state; if (state === &quot;writable&quot;) { if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; stream._backpressure) { defaultWriterReadyPromiseInitialize(this); } else { defaultWriterReadyPromiseInitializeAsResolved(this); } defaultWriterClosedPromiseInitialize(this); } else if (state === &quot;erroring&quot;) { defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); defaultWriterClosedPromiseInitialize(this); } else if (state === &quot;closed&quot;) { defaultWriterReadyPromiseInitializeAsResolved(this); defaultWriterClosedPromiseInitializeAsResolved(this); } else { const storedError = stream._storedError; defaultWriterReadyPromiseInitializeAsRejected(this, storedError); defaultWriterClosedPromiseInitializeAsRejected(this, storedError); } } /** * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or * the writerโ€™s lock is released before the stream finishes closing. */ get closed() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException(&quot;closed&quot;)); } return this._closedPromise; } /** * Returns the desired size to fill the streamโ€™s internal queue. It can be negative, if the queue is over-full. * A producer can use this information to determine the right amount of data to write. * * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when * the writerโ€™s lock is released. */ get desiredSize() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException(&quot;desiredSize&quot;); } if (this._ownerWritableStream === void 0) { throw defaultWriterLockException(&quot;desiredSize&quot;); } return WritableStreamDefaultWriterGetDesiredSize(this); } /** * Returns a promise that will be fulfilled when the desired size to fill the streamโ€™s internal queue transitions * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips * back to zero or below, the getter will return a new promise that stays pending until the next transition. * * If the stream becomes errored or aborted, or the writerโ€™s lock is released, the returned promise will become * rejected. */ get ready() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException(&quot;ready&quot;)); } return this._readyPromise; } /** * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}. */ abort(reason = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException(&quot;abort&quot;)); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException(&quot;abort&quot;)); } return WritableStreamDefaultWriterAbort(this, reason); } /** * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}. */ close() { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException(&quot;close&quot;)); } const stream = this._ownerWritableStream; if (stream === void 0) { return promiseRejectedWith(defaultWriterLockException(&quot;close&quot;)); } if (WritableStreamCloseQueuedOrInFlight(stream)) { return promiseRejectedWith(new TypeError(&quot;Cannot close an already-closing stream&quot;)); } return WritableStreamDefaultWriterClose(this); } /** * Releases the writerโ€™s lock on the corresponding stream. After the lock is released, the writer is no longer active. * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from * now on; otherwise, the writer will appear closed. * * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled). * Itโ€™s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents * other producers from writing in an interleaved manner. */ releaseLock() { if (!IsWritableStreamDefaultWriter(this)) { throw defaultWriterBrandCheckException(&quot;releaseLock&quot;); } const stream = this._ownerWritableStream; if (stream === void 0) { return; } WritableStreamDefaultWriterRelease(this); } write(chunk = void 0) { if (!IsWritableStreamDefaultWriter(this)) { return promiseRejectedWith(defaultWriterBrandCheckException(&quot;write&quot;)); } if (this._ownerWritableStream === void 0) { return promiseRejectedWith(defaultWriterLockException(&quot;write to&quot;)); } return WritableStreamDefaultWriterWrite(this, chunk); } } Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }); setFunctionName(WritableStreamDefaultWriter.prototype.abort, &quot;abort&quot;); setFunctionName(WritableStreamDefaultWriter.prototype.close, &quot;close&quot;); setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, &quot;releaseLock&quot;); setFunctionName(WritableStreamDefaultWriter.prototype.write, &quot;write&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, { value: &quot;WritableStreamDefaultWriter&quot;, configurable: true }); } function IsWritableStreamDefaultWriter(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_ownerWritableStream&quot;)) { return false; } return x2 instanceof WritableStreamDefaultWriter; } function WritableStreamDefaultWriterAbort(writer, reason) { const stream = writer._ownerWritableStream; return WritableStreamAbort(stream, reason); } function WritableStreamDefaultWriterClose(writer) { const stream = writer._ownerWritableStream; return WritableStreamClose(stream); } function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (WritableStreamCloseQueuedOrInFlight(stream) || state === &quot;closed&quot;) { return promiseResolvedWith(void 0); } if (state === &quot;errored&quot;) { return promiseRejectedWith(stream._storedError); } return WritableStreamDefaultWriterClose(writer); } function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { if (writer._closedPromiseState === &quot;pending&quot;) { defaultWriterClosedPromiseReject(writer, error); } else { defaultWriterClosedPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { if (writer._readyPromiseState === &quot;pending&quot;) { defaultWriterReadyPromiseReject(writer, error); } else { defaultWriterReadyPromiseResetToRejected(writer, error); } } function WritableStreamDefaultWriterGetDesiredSize(writer) { const stream = writer._ownerWritableStream; const state = stream._state; if (state === &quot;errored&quot; || state === &quot;erroring&quot;) { return null; } if (state === &quot;closed&quot;) { return 0; } return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); } function WritableStreamDefaultWriterRelease(writer) { const stream = writer._ownerWritableStream; const releasedError = new TypeError(`Writer was released and can no longer be used to monitor the stream&#x27;s closedness`); WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); stream._writer = void 0; writer._ownerWritableStream = void 0; } function WritableStreamDefaultWriterWrite(writer, chunk) { const stream = writer._ownerWritableStream; const controller = stream._writableStreamController; const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); if (stream !== writer._ownerWritableStream) { return promiseRejectedWith(defaultWriterLockException(&quot;write to&quot;)); } const state = stream._state; if (state === &quot;errored&quot;) { return promiseRejectedWith(stream._storedError); } if (WritableStreamCloseQueuedOrInFlight(stream) || state === &quot;closed&quot;) { return promiseRejectedWith(new TypeError(&quot;The stream is closing or closed and cannot be written to&quot;)); } if (state === &quot;erroring&quot;) { return promiseRejectedWith(stream._storedError); } const promise = WritableStreamAddWriteRequest(stream); WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); return promise; } const closeSentinel = {}; class WritableStreamDefaultController { constructor() { throw new TypeError(&quot;Illegal constructor&quot;); } /** * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted. * * @deprecated * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177. * Use {@link WritableStreamDefaultController.signal}&#x27;s `reason` instead. */ get abortReason() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2(&quot;abortReason&quot;); } return this._abortReason; } /** * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted. */ get signal() { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2(&quot;signal&quot;); } if (this._abortController === void 0) { throw new TypeError(&quot;WritableStreamDefaultController.prototype.signal is not supported&quot;); } return this._abortController.signal; } /** * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`. * * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying * sink&#x27;s methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the * normal lifecycle of interactions with the underlying sink. */ error(e2 = void 0) { if (!IsWritableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$2(&quot;error&quot;); } const state = this._controlledWritableStream._state; if (state !== &quot;writable&quot;) { return; } WritableStreamDefaultControllerError(this, e2); } /** @internal */ [AbortSteps](reason) { const result = this._abortAlgorithm(reason); WritableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [ErrorSteps]() { ResetQueue(this); } } Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, { value: &quot;WritableStreamDefaultController&quot;, configurable: true }); } function IsWritableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_controlledWritableStream&quot;)) { return false; } return x2 instanceof WritableStreamDefaultController; } function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledWritableStream = stream; stream._writableStreamController = controller; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._abortReason = void 0; controller._abortController = createAbortController(); controller._started = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._writeAlgorithm = writeAlgorithm; controller._closeAlgorithm = closeAlgorithm; controller._abortAlgorithm = abortAlgorithm; const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); const startResult = startAlgorithm(); const startPromise = promiseResolvedWith(startResult); uponPromise(startPromise, () =&gt; { controller._started = true; WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (r2) =&gt; { controller._started = true; WritableStreamDealWithRejection(stream, r2); return null; }); } function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) { const controller = Object.create(WritableStreamDefaultController.prototype); let startAlgorithm; let writeAlgorithm; let closeAlgorithm; let abortAlgorithm; if (underlyingSink.start !== void 0) { startAlgorithm = () =&gt; underlyingSink.start(controller); } else { startAlgorithm = () =&gt; void 0; } if (underlyingSink.write !== void 0) { writeAlgorithm = (chunk) =&gt; underlyingSink.write(chunk, controller); } else { writeAlgorithm = () =&gt; promiseResolvedWith(void 0); } if (underlyingSink.close !== void 0) { closeAlgorithm = () =&gt; underlyingSink.close(); } else { closeAlgorithm = () =&gt; promiseResolvedWith(void 0); } if (underlyingSink.abort !== void 0) { abortAlgorithm = (reason) =&gt; underlyingSink.abort(reason); } else { abortAlgorithm = () =&gt; promiseResolvedWith(void 0); } SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); } function WritableStreamDefaultControllerClearAlgorithms(controller) { controller._writeAlgorithm = void 0; controller._closeAlgorithm = void 0; controller._abortAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function WritableStreamDefaultControllerClose(controller) { EnqueueValueWithSize(controller, closeSentinel, 0); WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { try { return controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); return 1; } } function WritableStreamDefaultControllerGetDesiredSize(controller) { return controller._strategyHWM - controller._queueTotalSize; } function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); return; } const stream = controller._controlledWritableStream; if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; stream._state === &quot;writable&quot;) { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); } function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { const stream = controller._controlledWritableStream; if (!controller._started) { return; } if (stream._inFlightWriteRequest !== void 0) { return; } const state = stream._state; if (state === &quot;erroring&quot;) { WritableStreamFinishErroring(stream); return; } if (controller._queue.length === 0) { return; } const value = PeekQueueValue(controller); if (value === closeSentinel) { WritableStreamDefaultControllerProcessClose(controller); } else { WritableStreamDefaultControllerProcessWrite(controller, value); } } function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { if (controller._controlledWritableStream._state === &quot;writable&quot;) { WritableStreamDefaultControllerError(controller, error); } } function WritableStreamDefaultControllerProcessClose(controller) { const stream = controller._controlledWritableStream; WritableStreamMarkCloseRequestInFlight(stream); DequeueValue(controller); const sinkClosePromise = controller._closeAlgorithm(); WritableStreamDefaultControllerClearAlgorithms(controller); uponPromise(sinkClosePromise, () =&gt; { WritableStreamFinishInFlightClose(stream); return null; }, (reason) =&gt; { WritableStreamFinishInFlightCloseWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerProcessWrite(controller, chunk) { const stream = controller._controlledWritableStream; WritableStreamMarkFirstWriteRequestInFlight(stream); const sinkWritePromise = controller._writeAlgorithm(chunk); uponPromise(sinkWritePromise, () =&gt; { WritableStreamFinishInFlightWrite(stream); const state = stream._state; DequeueValue(controller); if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; state === &quot;writable&quot;) { const backpressure = WritableStreamDefaultControllerGetBackpressure(controller); WritableStreamUpdateBackpressure(stream, backpressure); } WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); return null; }, (reason) =&gt; { if (stream._state === &quot;writable&quot;) { WritableStreamDefaultControllerClearAlgorithms(controller); } WritableStreamFinishInFlightWriteWithError(stream, reason); return null; }); } function WritableStreamDefaultControllerGetBackpressure(controller) { const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); return desiredSize &lt;= 0; } function WritableStreamDefaultControllerError(controller, error) { const stream = controller._controlledWritableStream; WritableStreamDefaultControllerClearAlgorithms(controller); WritableStreamStartErroring(stream, error); } function streamBrandCheckException$2(name) { return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`); } function defaultControllerBrandCheckException$2(name) { return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`); } function defaultWriterBrandCheckException(name) { return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`); } function defaultWriterLockException(name) { return new TypeError(&quot;Cannot &quot; + name + &quot; a stream using a released writer&quot;); } function defaultWriterClosedPromiseInitialize(writer) { writer._closedPromise = newPromise((resolve, reject) =&gt; { writer._closedPromise_resolve = resolve; writer._closedPromise_reject = reject; writer._closedPromiseState = &quot;pending&quot;; }); } function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseReject(writer, reason); } function defaultWriterClosedPromiseInitializeAsResolved(writer) { defaultWriterClosedPromiseInitialize(writer); defaultWriterClosedPromiseResolve(writer); } function defaultWriterClosedPromiseReject(writer, reason) { if (writer._closedPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._closedPromise); writer._closedPromise_reject(reason); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = &quot;rejected&quot;; } function defaultWriterClosedPromiseResetToRejected(writer, reason) { defaultWriterClosedPromiseInitializeAsRejected(writer, reason); } function defaultWriterClosedPromiseResolve(writer) { if (writer._closedPromise_resolve === void 0) { return; } writer._closedPromise_resolve(void 0); writer._closedPromise_resolve = void 0; writer._closedPromise_reject = void 0; writer._closedPromiseState = &quot;resolved&quot;; } function defaultWriterReadyPromiseInitialize(writer) { writer._readyPromise = newPromise((resolve, reject) =&gt; { writer._readyPromise_resolve = resolve; writer._readyPromise_reject = reject; }); writer._readyPromiseState = &quot;pending&quot;; } function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseReject(writer, reason); } function defaultWriterReadyPromiseInitializeAsResolved(writer) { defaultWriterReadyPromiseInitialize(writer); defaultWriterReadyPromiseResolve(writer); } function defaultWriterReadyPromiseReject(writer, reason) { if (writer._readyPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(writer._readyPromise); writer._readyPromise_reject(reason); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = &quot;rejected&quot;; } function defaultWriterReadyPromiseReset(writer) { defaultWriterReadyPromiseInitialize(writer); } function defaultWriterReadyPromiseResetToRejected(writer, reason) { defaultWriterReadyPromiseInitializeAsRejected(writer, reason); } function defaultWriterReadyPromiseResolve(writer) { if (writer._readyPromise_resolve === void 0) { return; } writer._readyPromise_resolve(void 0); writer._readyPromise_resolve = void 0; writer._readyPromise_reject = void 0; writer._readyPromiseState = &quot;fulfilled&quot;; } function getGlobals() { if (typeof globalThis !== &quot;undefined&quot;) { return globalThis; } else if (typeof self !== &quot;undefined&quot;) { return self; } else if (typeof global !== &quot;undefined&quot;) { return global; } return void 0; } const globals = getGlobals(); function isDOMExceptionConstructor(ctor) { if (!(typeof ctor === &quot;function&quot; || typeof ctor === &quot;object&quot;)) { return false; } if (ctor.name !== &quot;DOMException&quot;) { return false; } try { new ctor(); return true; } catch (_a2) { return false; } } function getFromGlobal() { const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException; return isDOMExceptionConstructor(ctor) ? ctor : void 0; } function createPolyfill() { const ctor = function DOMException3(message, name) { this.message = message || &quot;&quot;; this.name = name || &quot;Error&quot;; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } }; setFunctionName(ctor, &quot;DOMException&quot;); ctor.prototype = Object.create(Error.prototype); Object.defineProperty(ctor.prototype, &quot;constructor&quot;, { value: ctor, writable: true, configurable: true }); return ctor; } const DOMException2 = getFromGlobal() || createPolyfill(); function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) { const reader = AcquireReadableStreamDefaultReader(source); const writer = AcquireWritableStreamDefaultWriter(dest); source._disturbed = true; let shuttingDown = false; let currentWrite = promiseResolvedWith(void 0); return newPromise((resolve, reject) =&gt; { let abortAlgorithm; if (signal !== void 0) { abortAlgorithm = () =&gt; { const error = signal.reason !== void 0 ? signal.reason : new DOMException2(&quot;Aborted&quot;, &quot;AbortError&quot;); const actions = []; if (!preventAbort) { actions.push(() =&gt; { if (dest._state === &quot;writable&quot;) { return WritableStreamAbort(dest, error); } return promiseResolvedWith(void 0); }); } if (!preventCancel) { actions.push(() =&gt; { if (source._state === &quot;readable&quot;) { return ReadableStreamCancel(source, error); } return promiseResolvedWith(void 0); }); } shutdownWithAction(() =&gt; Promise.all(actions.map((action) =&gt; action())), true, error); }; if (signal.aborted) { abortAlgorithm(); return; } signal.addEventListener(&quot;abort&quot;, abortAlgorithm); } function pipeLoop() { return newPromise((resolveLoop, rejectLoop) =&gt; { function next(done) { if (done) { resolveLoop(); } else { PerformPromiseThen(pipeStep(), next, rejectLoop); } } next(false); }); } function pipeStep() { if (shuttingDown) { return promiseResolvedWith(true); } return PerformPromiseThen(writer._readyPromise, () =&gt; { return newPromise((resolveRead, rejectRead) =&gt; { ReadableStreamDefaultReaderRead(reader, { _chunkSteps: (chunk) =&gt; { currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop2); resolveRead(false); }, _closeSteps: () =&gt; resolveRead(true), _errorSteps: rejectRead }); }); }); } isOrBecomesErrored(source, reader._closedPromise, (storedError) =&gt; { if (!preventAbort) { shutdownWithAction(() =&gt; WritableStreamAbort(dest, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesErrored(dest, writer._closedPromise, (storedError) =&gt; { if (!preventCancel) { shutdownWithAction(() =&gt; ReadableStreamCancel(source, storedError), true, storedError); } else { shutdown(true, storedError); } return null; }); isOrBecomesClosed(source, reader._closedPromise, () =&gt; { if (!preventClose) { shutdownWithAction(() =&gt; WritableStreamDefaultWriterCloseWithErrorPropagation(writer)); } else { shutdown(); } return null; }); if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === &quot;closed&quot;) { const destClosed = new TypeError(&quot;the destination writable stream closed before all data could be piped to it&quot;); if (!preventCancel) { shutdownWithAction(() =&gt; ReadableStreamCancel(source, destClosed), true, destClosed); } else { shutdown(true, destClosed); } } setPromiseIsHandledToTrue(pipeLoop()); function waitForWritesToFinish() { const oldCurrentWrite = currentWrite; return PerformPromiseThen(currentWrite, () =&gt; oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : void 0); } function isOrBecomesErrored(stream, promise, action) { if (stream._state === &quot;errored&quot;) { action(stream._storedError); } else { uponRejection(promise, action); } } function isOrBecomesClosed(stream, promise, action) { if (stream._state === &quot;closed&quot;) { action(); } else { uponFulfillment(promise, action); } } function shutdownWithAction(action, originalIsError, originalError) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === &quot;writable&quot; &amp;&amp; !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), doTheRest); } else { doTheRest(); } function doTheRest() { uponPromise(action(), () =&gt; finalize(originalIsError, originalError), (newError) =&gt; finalize(true, newError)); return null; } } function shutdown(isError, error) { if (shuttingDown) { return; } shuttingDown = true; if (dest._state === &quot;writable&quot; &amp;&amp; !WritableStreamCloseQueuedOrInFlight(dest)) { uponFulfillment(waitForWritesToFinish(), () =&gt; finalize(isError, error)); } else { finalize(isError, error); } } function finalize(isError, error) { WritableStreamDefaultWriterRelease(writer); ReadableStreamReaderGenericRelease(reader); if (signal !== void 0) { signal.removeEventListener(&quot;abort&quot;, abortAlgorithm); } if (isError) { reject(error); } else { resolve(void 0); } return null; } }); } class ReadableStreamDefaultController { constructor() { throw new TypeError(&quot;Illegal constructor&quot;); } /** * Returns the desired size to fill the controlled stream&#x27;s internal queue. It can be negative, if the queue is * over-full. An underlying source ought to use this information to determine when and how to apply backpressure. */ get desiredSize() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1(&quot;desiredSize&quot;); } return ReadableStreamDefaultControllerGetDesiredSize(this); } /** * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from * the stream, but once those are read, the stream will become closed. */ close() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1(&quot;close&quot;); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError(&quot;The stream is not in a state that permits close&quot;); } ReadableStreamDefaultControllerClose(this); } enqueue(chunk = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1(&quot;enqueue&quot;); } if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { throw new TypeError(&quot;The stream is not in a state that permits enqueue&quot;); } return ReadableStreamDefaultControllerEnqueue(this, chunk); } /** * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. */ error(e2 = void 0) { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1(&quot;error&quot;); } ReadableStreamDefaultControllerError(this, e2); } /** @internal */ [CancelSteps](reason) { ResetQueue(this); const result = this._cancelAlgorithm(reason); ReadableStreamDefaultControllerClearAlgorithms(this); return result; } /** @internal */ [PullSteps](readRequest) { const stream = this._controlledReadableStream; if (this._queue.length &gt; 0) { const chunk = DequeueValue(this); if (this._closeRequested &amp;&amp; this._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(this); ReadableStreamClose(stream); } else { ReadableStreamDefaultControllerCallPullIfNeeded(this); } readRequest._chunkSteps(chunk); } else { ReadableStreamAddReadRequest(stream, readRequest); ReadableStreamDefaultControllerCallPullIfNeeded(this); } } /** @internal */ [ReleaseSteps]() { } } Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(ReadableStreamDefaultController.prototype.close, &quot;close&quot;); setFunctionName(ReadableStreamDefaultController.prototype.enqueue, &quot;enqueue&quot;); setFunctionName(ReadableStreamDefaultController.prototype.error, &quot;error&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, { value: &quot;ReadableStreamDefaultController&quot;, configurable: true }); } function IsReadableStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_controlledReadableStream&quot;)) { return false; } return x2 instanceof ReadableStreamDefaultController; } function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); if (!shouldPull) { return; } if (controller._pulling) { controller._pullAgain = true; return; } controller._pulling = true; const pullPromise = controller._pullAlgorithm(); uponPromise(pullPromise, () =&gt; { controller._pulling = false; if (controller._pullAgain) { controller._pullAgain = false; ReadableStreamDefaultControllerCallPullIfNeeded(controller); } return null; }, (e2) =&gt; { ReadableStreamDefaultControllerError(controller, e2); return null; }); } function ReadableStreamDefaultControllerShouldCallPull(controller) { const stream = controller._controlledReadableStream; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return false; } if (!controller._started) { return false; } if (IsReadableStreamLocked(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) { return true; } const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); if (desiredSize &gt; 0) { return true; } return false; } function ReadableStreamDefaultControllerClearAlgorithms(controller) { controller._pullAlgorithm = void 0; controller._cancelAlgorithm = void 0; controller._strategySizeAlgorithm = void 0; } function ReadableStreamDefaultControllerClose(controller) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; controller._closeRequested = true; if (controller._queue.length === 0) { ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamClose(stream); } } function ReadableStreamDefaultControllerEnqueue(controller, chunk) { if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { return; } const stream = controller._controlledReadableStream; if (IsReadableStreamLocked(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) { ReadableStreamFulfillReadRequest(stream, chunk, false); } else { let chunkSize; try { chunkSize = controller._strategySizeAlgorithm(chunk); } catch (chunkSizeE) { ReadableStreamDefaultControllerError(controller, chunkSizeE); throw chunkSizeE; } try { EnqueueValueWithSize(controller, chunk, chunkSize); } catch (enqueueE) { ReadableStreamDefaultControllerError(controller, enqueueE); throw enqueueE; } } ReadableStreamDefaultControllerCallPullIfNeeded(controller); } function ReadableStreamDefaultControllerError(controller, e2) { const stream = controller._controlledReadableStream; if (stream._state !== &quot;readable&quot;) { return; } ResetQueue(controller); ReadableStreamDefaultControllerClearAlgorithms(controller); ReadableStreamError(stream, e2); } function ReadableStreamDefaultControllerGetDesiredSize(controller) { const state = controller._controlledReadableStream._state; if (state === &quot;errored&quot;) { return null; } if (state === &quot;closed&quot;) { return 0; } return controller._strategyHWM - controller._queueTotalSize; } function ReadableStreamDefaultControllerHasBackpressure(controller) { if (ReadableStreamDefaultControllerShouldCallPull(controller)) { return false; } return true; } function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) { const state = controller._controlledReadableStream._state; if (!controller._closeRequested &amp;&amp; state === &quot;readable&quot;) { return true; } return false; } function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) { controller._controlledReadableStream = stream; controller._queue = void 0; controller._queueTotalSize = void 0; ResetQueue(controller); controller._started = false; controller._closeRequested = false; controller._pullAgain = false; controller._pulling = false; controller._strategySizeAlgorithm = sizeAlgorithm; controller._strategyHWM = highWaterMark; controller._pullAlgorithm = pullAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; stream._readableStreamController = controller; const startResult = startAlgorithm(); uponPromise(promiseResolvedWith(startResult), () =&gt; { controller._started = true; ReadableStreamDefaultControllerCallPullIfNeeded(controller); return null; }, (r2) =&gt; { ReadableStreamDefaultControllerError(controller, r2); return null; }); } function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) { const controller = Object.create(ReadableStreamDefaultController.prototype); let startAlgorithm; let pullAlgorithm; let cancelAlgorithm; if (underlyingSource.start !== void 0) { startAlgorithm = () =&gt; underlyingSource.start(controller); } else { startAlgorithm = () =&gt; void 0; } if (underlyingSource.pull !== void 0) { pullAlgorithm = () =&gt; underlyingSource.pull(controller); } else { pullAlgorithm = () =&gt; promiseResolvedWith(void 0); } if (underlyingSource.cancel !== void 0) { cancelAlgorithm = (reason) =&gt; underlyingSource.cancel(reason); } else { cancelAlgorithm = () =&gt; promiseResolvedWith(void 0); } SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); } function defaultControllerBrandCheckException$1(name) { return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`); } function ReadableStreamTee(stream, cloneForBranch2) { if (IsReadableByteStreamController(stream._readableStreamController)) { return ReadableByteStreamTee(stream); } return ReadableStreamDefaultTee(stream); } function ReadableStreamDefaultTee(stream, cloneForBranch2) { const reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgain = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) =&gt; { resolveCancelPromise = resolve; }); function pullAlgorithm() { if (reading) { readAgain = true; return promiseResolvedWith(void 0); } reading = true; const readRequest = { _chunkSteps: (chunk) =&gt; { _queueMicrotask(() =&gt; { readAgain = false; const chunk1 = chunk; const chunk2 = chunk; if (!canceled1) { ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgain) { pullAlgorithm(); } }); }, _closeSteps: () =&gt; { reading = false; if (!canceled1) { ReadableStreamDefaultControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableStreamDefaultControllerClose(branch2._readableStreamController); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () =&gt; { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { } branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm); branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm); uponRejection(reader._closedPromise, (r2) =&gt; { ReadableStreamDefaultControllerError(branch1._readableStreamController, r2); ReadableStreamDefaultControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); return [branch1, branch2]; } function ReadableByteStreamTee(stream) { let reader = AcquireReadableStreamDefaultReader(stream); let reading = false; let readAgainForBranch1 = false; let readAgainForBranch2 = false; let canceled1 = false; let canceled2 = false; let reason1; let reason2; let branch1; let branch2; let resolveCancelPromise; const cancelPromise = newPromise((resolve) =&gt; { resolveCancelPromise = resolve; }); function forwardReaderError(thisReader) { uponRejection(thisReader._closedPromise, (r2) =&gt; { if (thisReader !== reader) { return null; } ReadableByteStreamControllerError(branch1._readableStreamController, r2); ReadableByteStreamControllerError(branch2._readableStreamController, r2); if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } return null; }); } function pullWithDefaultReader() { if (IsReadableStreamBYOBReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamDefaultReader(stream); forwardReaderError(reader); } const readRequest = { _chunkSteps: (chunk) =&gt; { _queueMicrotask(() =&gt; { readAgainForBranch1 = false; readAgainForBranch2 = false; const chunk1 = chunk; let chunk2 = chunk; if (!canceled1 &amp;&amp; !canceled2) { try { chunk2 = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(branch1._readableStreamController, cloneE); ReadableByteStreamControllerError(branch2._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } } if (!canceled1) { ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1); } if (!canceled2) { ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: () =&gt; { reading = false; if (!canceled1) { ReadableByteStreamControllerClose(branch1._readableStreamController); } if (!canceled2) { ReadableByteStreamControllerClose(branch2._readableStreamController); } if (branch1._readableStreamController._pendingPullIntos.length &gt; 0) { ReadableByteStreamControllerRespond(branch1._readableStreamController, 0); } if (branch2._readableStreamController._pendingPullIntos.length &gt; 0) { ReadableByteStreamControllerRespond(branch2._readableStreamController, 0); } if (!canceled1 || !canceled2) { resolveCancelPromise(void 0); } }, _errorSteps: () =&gt; { reading = false; } }; ReadableStreamDefaultReaderRead(reader, readRequest); } function pullWithBYOBReader(view, forBranch2) { if (IsReadableStreamDefaultReader(reader)) { ReadableStreamReaderGenericRelease(reader); reader = AcquireReadableStreamBYOBReader(stream); forwardReaderError(reader); } const byobBranch = forBranch2 ? branch2 : branch1; const otherBranch = forBranch2 ? branch1 : branch2; const readIntoRequest = { _chunkSteps: (chunk) =&gt; { _queueMicrotask(() =&gt; { readAgainForBranch1 = false; readAgainForBranch2 = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!otherCanceled) { let clonedChunk; try { clonedChunk = CloneAsUint8Array(chunk); } catch (cloneE) { ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE); ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE); resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); return; } if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk); } else if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } reading = false; if (readAgainForBranch1) { pull1Algorithm(); } else if (readAgainForBranch2) { pull2Algorithm(); } }); }, _closeSteps: (chunk) =&gt; { reading = false; const byobCanceled = forBranch2 ? canceled2 : canceled1; const otherCanceled = forBranch2 ? canceled1 : canceled2; if (!byobCanceled) { ReadableByteStreamControllerClose(byobBranch._readableStreamController); } if (!otherCanceled) { ReadableByteStreamControllerClose(otherBranch._readableStreamController); } if (chunk !== void 0) { if (!byobCanceled) { ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); } if (!otherCanceled &amp;&amp; otherBranch._readableStreamController._pendingPullIntos.length &gt; 0) { ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0); } } if (!byobCanceled || !otherCanceled) { resolveCancelPromise(void 0); } }, _errorSteps: () =&gt; { reading = false; } }; ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest); } function pull1Algorithm() { if (reading) { readAgainForBranch1 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, false); } return promiseResolvedWith(void 0); } function pull2Algorithm() { if (reading) { readAgainForBranch2 = true; return promiseResolvedWith(void 0); } reading = true; const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController); if (byobRequest === null) { pullWithDefaultReader(); } else { pullWithBYOBReader(byobRequest._view, true); } return promiseResolvedWith(void 0); } function cancel1Algorithm(reason) { canceled1 = true; reason1 = reason; if (canceled2) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function cancel2Algorithm(reason) { canceled2 = true; reason2 = reason; if (canceled1) { const compositeReason = CreateArrayFromList([reason1, reason2]); const cancelResult = ReadableStreamCancel(stream, compositeReason); resolveCancelPromise(cancelResult); } return cancelPromise; } function startAlgorithm() { return; } branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm); branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm); forwardReaderError(reader); return [branch1, branch2]; } function isReadableStreamLike(stream) { return typeIsObject(stream) &amp;&amp; typeof stream.getReader !== &quot;undefined&quot;; } function ReadableStreamFrom(source) { if (isReadableStreamLike(source)) { return ReadableStreamFromDefaultReader(source.getReader()); } return ReadableStreamFromIterable(source); } function ReadableStreamFromIterable(asyncIterable) { let stream; const iteratorRecord = GetIterator(asyncIterable, &quot;async&quot;); const startAlgorithm = noop2; function pullAlgorithm() { let nextResult; try { nextResult = IteratorNext(iteratorRecord); } catch (e2) { return promiseRejectedWith(e2); } const nextPromise = promiseResolvedWith(nextResult); return transformPromiseWith(nextPromise, (iterResult) =&gt; { if (!typeIsObject(iterResult)) { throw new TypeError(&quot;The promise returned by the iterator.next() method must fulfill with an object&quot;); } const done = IteratorComplete(iterResult); if (done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = IteratorValue(iterResult); ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { const iterator = iteratorRecord.iterator; let returnMethod; try { returnMethod = GetMethod(iterator, &quot;return&quot;); } catch (e2) { return promiseRejectedWith(e2); } if (returnMethod === void 0) { return promiseResolvedWith(void 0); } let returnResult; try { returnResult = reflectCall(returnMethod, iterator, [reason]); } catch (e2) { return promiseRejectedWith(e2); } const returnPromise = promiseResolvedWith(returnResult); return transformPromiseWith(returnPromise, (iterResult) =&gt; { if (!typeIsObject(iterResult)) { throw new TypeError(&quot;The promise returned by the iterator.return() method must fulfill with an object&quot;); } return void 0; }); } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function ReadableStreamFromDefaultReader(reader) { let stream; const startAlgorithm = noop2; function pullAlgorithm() { let readPromise; try { readPromise = reader.read(); } catch (e2) { return promiseRejectedWith(e2); } return transformPromiseWith(readPromise, (readResult) =&gt; { if (!typeIsObject(readResult)) { throw new TypeError(&quot;The promise returned by the reader.read() method must fulfill with an object&quot;); } if (readResult.done) { ReadableStreamDefaultControllerClose(stream._readableStreamController); } else { const value = readResult.value; ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value); } }); } function cancelAlgorithm(reason) { try { return promiseResolvedWith(reader.cancel(reason)); } catch (e2) { return promiseRejectedWith(e2); } } stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0); return stream; } function convertUnderlyingDefaultOrByteSource(source, context) { assertDictionary(source, context); const original = source; const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize; const cancel = original === null || original === void 0 ? void 0 : original.cancel; const pull = original === null || original === void 0 ? void 0 : original.pull; const start = original === null || original === void 0 ? void 0 : original.start; const type = original === null || original === void 0 ? void 0 : original.type; return { autoAllocateChunkSize: autoAllocateChunkSize === void 0 ? void 0 : convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member &#x27;autoAllocateChunkSize&#x27; that`), cancel: cancel === void 0 ? void 0 : convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member &#x27;cancel&#x27; that`), pull: pull === void 0 ? void 0 : convertUnderlyingSourcePullCallback(pull, original, `${context} has member &#x27;pull&#x27; that`), start: start === void 0 ? void 0 : convertUnderlyingSourceStartCallback(start, original, `${context} has member &#x27;start&#x27; that`), type: type === void 0 ? void 0 : convertReadableStreamType(type, `${context} has member &#x27;type&#x27; that`) }; } function convertUnderlyingSourceCancelCallback(fn, original, context) { assertFunction(fn, context); return (reason) =&gt; promiseCall(fn, original, [reason]); } function convertUnderlyingSourcePullCallback(fn, original, context) { assertFunction(fn, context); return (controller) =&gt; promiseCall(fn, original, [controller]); } function convertUnderlyingSourceStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) =&gt; reflectCall(fn, original, [controller]); } function convertReadableStreamType(type, context) { type = `${type}`; if (type !== &quot;bytes&quot;) { throw new TypeError(`${context} &#x27;${type}&#x27; is not a valid enumeration value for ReadableStreamType`); } return type; } function convertIteratorOptions(options, context) { assertDictionary(options, context); const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; return { preventCancel: Boolean(preventCancel) }; } function convertPipeOptions(options, context) { assertDictionary(options, context); const preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort; const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; const preventClose = options === null || options === void 0 ? void 0 : options.preventClose; const signal = options === null || options === void 0 ? void 0 : options.signal; if (signal !== void 0) { assertAbortSignal(signal, `${context} has member &#x27;signal&#x27; that`); } return { preventAbort: Boolean(preventAbort), preventCancel: Boolean(preventCancel), preventClose: Boolean(preventClose), signal }; } function assertAbortSignal(signal, context) { if (!isAbortSignal2(signal)) { throw new TypeError(`${context} is not an AbortSignal.`); } } function convertReadableWritablePair(pair, context) { assertDictionary(pair, context); const readable = pair === null || pair === void 0 ? void 0 : pair.readable; assertRequiredField(readable, &quot;readable&quot;, &quot;ReadableWritablePair&quot;); assertReadableStream(readable, `${context} has member &#x27;readable&#x27; that`); const writable = pair === null || pair === void 0 ? void 0 : pair.writable; assertRequiredField(writable, &quot;writable&quot;, &quot;ReadableWritablePair&quot;); assertWritableStream(writable, `${context} has member &#x27;writable&#x27; that`); return { readable, writable }; } class ReadableStream2 { constructor(rawUnderlyingSource = {}, rawStrategy = {}) { if (rawUnderlyingSource === void 0) { rawUnderlyingSource = null; } else { assertObject(rawUnderlyingSource, &quot;First parameter&quot;); } const strategy = convertQueuingStrategy(rawStrategy, &quot;Second parameter&quot;); const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, &quot;First parameter&quot;); InitializeReadableStream(this); if (underlyingSource.type === &quot;bytes&quot;) { if (strategy.size !== void 0) { throw new RangeError(&quot;The strategy for a byte stream cannot have a size function&quot;); } const highWaterMark = ExtractHighWaterMark(strategy, 0); SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark); } else { const sizeAlgorithm = ExtractSizeAlgorithm(strategy); const highWaterMark = ExtractHighWaterMark(strategy, 1); SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm); } } /** * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}. */ get locked() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1(&quot;locked&quot;); } return IsReadableStreamLocked(this); } /** * Cancels the stream, signaling a loss of interest in the stream by a consumer. * * The supplied `reason` argument will be given to the underlying source&#x27;s {@link UnderlyingSource.cancel | cancel()} * method, which might or might not use it. */ cancel(reason = void 0) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1(&quot;cancel&quot;)); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError(&quot;Cannot cancel a stream that already has a reader&quot;)); } return ReadableStreamCancel(this, reason); } getReader(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1(&quot;getReader&quot;); } const options = convertReaderOptions(rawOptions, &quot;First parameter&quot;); if (options.mode === void 0) { return AcquireReadableStreamDefaultReader(this); } return AcquireReadableStreamBYOBReader(this); } pipeThrough(rawTransform, rawOptions = {}) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1(&quot;pipeThrough&quot;); } assertRequiredArgument(rawTransform, 1, &quot;pipeThrough&quot;); const transform = convertReadableWritablePair(rawTransform, &quot;First parameter&quot;); const options = convertPipeOptions(rawOptions, &quot;Second parameter&quot;); if (IsReadableStreamLocked(this)) { throw new TypeError(&quot;ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream&quot;); } if (IsWritableStreamLocked(transform.writable)) { throw new TypeError(&quot;ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream&quot;); } const promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal); setPromiseIsHandledToTrue(promise); return transform.readable; } pipeTo(destination, rawOptions = {}) { if (!IsReadableStream(this)) { return promiseRejectedWith(streamBrandCheckException$1(&quot;pipeTo&quot;)); } if (destination === void 0) { return promiseRejectedWith(`Parameter 1 is required in &#x27;pipeTo&#x27;.`); } if (!IsWritableStream(destination)) { return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo&#x27;s first argument must be a WritableStream`)); } let options; try { options = convertPipeOptions(rawOptions, &quot;Second parameter&quot;); } catch (e2) { return promiseRejectedWith(e2); } if (IsReadableStreamLocked(this)) { return promiseRejectedWith(new TypeError(&quot;ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream&quot;)); } if (IsWritableStreamLocked(destination)) { return promiseRejectedWith(new TypeError(&quot;ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream&quot;)); } return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal); } /** * Tees this readable stream, returning a two-element array containing the two resulting branches as * new {@link ReadableStream} instances. * * Teeing a stream will lock it, preventing any other consumer from acquiring a reader. * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be * propagated to the stream&#x27;s underlying source. * * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, * this could allow interference between the two branches. */ tee() { if (!IsReadableStream(this)) { throw streamBrandCheckException$1(&quot;tee&quot;); } const branches = ReadableStreamTee(this); return CreateArrayFromList(branches); } values(rawOptions = void 0) { if (!IsReadableStream(this)) { throw streamBrandCheckException$1(&quot;values&quot;); } const options = convertIteratorOptions(rawOptions, &quot;First parameter&quot;); return AcquireReadableStreamAsyncIterator(this, options.preventCancel); } [SymbolAsyncIterator](options) { return this.values(options); } /** * Creates a new ReadableStream wrapping the provided iterable or async iterable. * * This can be used to adapt various kinds of objects into a readable stream, * such as an array, an async generator, or a Node.js readable stream. */ static from(asyncIterable) { return ReadableStreamFrom(asyncIterable); } } Object.defineProperties(ReadableStream2, { from: { enumerable: true } }); Object.defineProperties(ReadableStream2.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }); setFunctionName(ReadableStream2.from, &quot;from&quot;); setFunctionName(ReadableStream2.prototype.cancel, &quot;cancel&quot;); setFunctionName(ReadableStream2.prototype.getReader, &quot;getReader&quot;); setFunctionName(ReadableStream2.prototype.pipeThrough, &quot;pipeThrough&quot;); setFunctionName(ReadableStream2.prototype.pipeTo, &quot;pipeTo&quot;); setFunctionName(ReadableStream2.prototype.tee, &quot;tee&quot;); setFunctionName(ReadableStream2.prototype.values, &quot;values&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ReadableStream2.prototype, Symbol.toStringTag, { value: &quot;ReadableStream&quot;, configurable: true }); } Object.defineProperty(ReadableStream2.prototype, SymbolAsyncIterator, { value: ReadableStream2.prototype.values, writable: true, configurable: true }); function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () =&gt; 1) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableStreamDefaultController.prototype); SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); return stream; } function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) { const stream = Object.create(ReadableStream2.prototype); InitializeReadableStream(stream); const controller = Object.create(ReadableByteStreamController.prototype); SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, void 0); return stream; } function InitializeReadableStream(stream) { stream._state = &quot;readable&quot;; stream._reader = void 0; stream._storedError = void 0; stream._disturbed = false; } function IsReadableStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_readableStreamController&quot;)) { return false; } return x2 instanceof ReadableStream2; } function IsReadableStreamLocked(stream) { if (stream._reader === void 0) { return false; } return true; } function ReadableStreamCancel(stream, reason) { stream._disturbed = true; if (stream._state === &quot;closed&quot;) { return promiseResolvedWith(void 0); } if (stream._state === &quot;errored&quot;) { return promiseRejectedWith(stream._storedError); } ReadableStreamClose(stream); const reader = stream._reader; if (reader !== void 0 &amp;&amp; IsReadableStreamBYOBReader(reader)) { const readIntoRequests = reader._readIntoRequests; reader._readIntoRequests = new SimpleQueue(); readIntoRequests.forEach((readIntoRequest) =&gt; { readIntoRequest._closeSteps(void 0); }); } const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason); return transformPromiseWith(sourceCancelPromise, noop2); } function ReadableStreamClose(stream) { stream._state = &quot;closed&quot;; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseResolve(reader); if (IsReadableStreamDefaultReader(reader)) { const readRequests = reader._readRequests; reader._readRequests = new SimpleQueue(); readRequests.forEach((readRequest) =&gt; { readRequest._closeSteps(); }); } } function ReadableStreamError(stream, e2) { stream._state = &quot;errored&quot;; stream._storedError = e2; const reader = stream._reader; if (reader === void 0) { return; } defaultReaderClosedPromiseReject(reader, e2); if (IsReadableStreamDefaultReader(reader)) { ReadableStreamDefaultReaderErrorReadRequests(reader, e2); } else { ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e2); } } function streamBrandCheckException$1(name) { return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`); } function convertQueuingStrategyInit(init, context) { assertDictionary(init, context); const highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; assertRequiredField(highWaterMark, &quot;highWaterMark&quot;, &quot;QueuingStrategyInit&quot;); return { highWaterMark: convertUnrestrictedDouble(highWaterMark) }; } const byteLengthSizeFunction = (chunk) =&gt; { return chunk.byteLength; }; setFunctionName(byteLengthSizeFunction, &quot;size&quot;); class ByteLengthQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, &quot;ByteLengthQueuingStrategy&quot;); options = convertQueuingStrategyInit(options, &quot;First parameter&quot;); this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException(&quot;highWaterMark&quot;); } return this._byteLengthQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by returning the value of its `byteLength` property. */ get size() { if (!IsByteLengthQueuingStrategy(this)) { throw byteLengthBrandCheckException(&quot;size&quot;); } return byteLengthSizeFunction; } } Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, { value: &quot;ByteLengthQueuingStrategy&quot;, configurable: true }); } function byteLengthBrandCheckException(name) { return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`); } function IsByteLengthQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_byteLengthQueuingStrategyHighWaterMark&quot;)) { return false; } return x2 instanceof ByteLengthQueuingStrategy; } const countSizeFunction = () =&gt; { return 1; }; setFunctionName(countSizeFunction, &quot;size&quot;); class CountQueuingStrategy { constructor(options) { assertRequiredArgument(options, 1, &quot;CountQueuingStrategy&quot;); options = convertQueuingStrategyInit(options, &quot;First parameter&quot;); this._countQueuingStrategyHighWaterMark = options.highWaterMark; } /** * Returns the high water mark provided to the constructor. */ get highWaterMark() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException(&quot;highWaterMark&quot;); } return this._countQueuingStrategyHighWaterMark; } /** * Measures the size of `chunk` by always returning 1. * This ensures that the total queue size is a count of the number of chunks in the queue. */ get size() { if (!IsCountQueuingStrategy(this)) { throw countBrandCheckException(&quot;size&quot;); } return countSizeFunction; } } Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, { value: &quot;CountQueuingStrategy&quot;, configurable: true }); } function countBrandCheckException(name) { return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`); } function IsCountQueuingStrategy(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_countQueuingStrategyHighWaterMark&quot;)) { return false; } return x2 instanceof CountQueuingStrategy; } function convertTransformer(original, context) { assertDictionary(original, context); const cancel = original === null || original === void 0 ? void 0 : original.cancel; const flush = original === null || original === void 0 ? void 0 : original.flush; const readableType = original === null || original === void 0 ? void 0 : original.readableType; const start = original === null || original === void 0 ? void 0 : original.start; const transform = original === null || original === void 0 ? void 0 : original.transform; const writableType = original === null || original === void 0 ? void 0 : original.writableType; return { cancel: cancel === void 0 ? void 0 : convertTransformerCancelCallback(cancel, original, `${context} has member &#x27;cancel&#x27; that`), flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member &#x27;flush&#x27; that`), readableType, start: start === void 0 ? void 0 : convertTransformerStartCallback(start, original, `${context} has member &#x27;start&#x27; that`), transform: transform === void 0 ? void 0 : convertTransformerTransformCallback(transform, original, `${context} has member &#x27;transform&#x27; that`), writableType }; } function convertTransformerFlushCallback(fn, original, context) { assertFunction(fn, context); return (controller) =&gt; promiseCall(fn, original, [controller]); } function convertTransformerStartCallback(fn, original, context) { assertFunction(fn, context); return (controller) =&gt; reflectCall(fn, original, [controller]); } function convertTransformerTransformCallback(fn, original, context) { assertFunction(fn, context); return (chunk, controller) =&gt; promiseCall(fn, original, [chunk, controller]); } function convertTransformerCancelCallback(fn, original, context) { assertFunction(fn, context); return (reason) =&gt; promiseCall(fn, original, [reason]); } class TransformStream { constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) { if (rawTransformer === void 0) { rawTransformer = null; } const writableStrategy = convertQueuingStrategy(rawWritableStrategy, &quot;Second parameter&quot;); const readableStrategy = convertQueuingStrategy(rawReadableStrategy, &quot;Third parameter&quot;); const transformer = convertTransformer(rawTransformer, &quot;First parameter&quot;); if (transformer.readableType !== void 0) { throw new RangeError(&quot;Invalid readableType specified&quot;); } if (transformer.writableType !== void 0) { throw new RangeError(&quot;Invalid writableType specified&quot;); } const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0); const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy); const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1); const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy); let startPromise_resolve; const startPromise = newPromise((resolve) =&gt; { startPromise_resolve = resolve; }); InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm); SetUpTransformStreamDefaultControllerFromTransformer(this, transformer); if (transformer.start !== void 0) { startPromise_resolve(transformer.start(this._transformStreamController)); } else { startPromise_resolve(void 0); } } /** * The readable side of the transform stream. */ get readable() { if (!IsTransformStream(this)) { throw streamBrandCheckException(&quot;readable&quot;); } return this._readable; } /** * The writable side of the transform stream. */ get writable() { if (!IsTransformStream(this)) { throw streamBrandCheckException(&quot;writable&quot;); } return this._writable; } } Object.defineProperties(TransformStream.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, { value: &quot;TransformStream&quot;, configurable: true }); } function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) { function startAlgorithm() { return startPromise; } function writeAlgorithm(chunk) { return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk); } function abortAlgorithm(reason) { return TransformStreamDefaultSinkAbortAlgorithm(stream, reason); } function closeAlgorithm() { return TransformStreamDefaultSinkCloseAlgorithm(stream); } stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm); function pullAlgorithm() { return TransformStreamDefaultSourcePullAlgorithm(stream); } function cancelAlgorithm(reason) { return TransformStreamDefaultSourceCancelAlgorithm(stream, reason); } stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm); stream._backpressure = void 0; stream._backpressureChangePromise = void 0; stream._backpressureChangePromise_resolve = void 0; TransformStreamSetBackpressure(stream, true); stream._transformStreamController = void 0; } function IsTransformStream(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_transformStreamController&quot;)) { return false; } return x2 instanceof TransformStream; } function TransformStreamError(stream, e2) { ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e2); TransformStreamErrorWritableAndUnblockWrite(stream, e2); } function TransformStreamErrorWritableAndUnblockWrite(stream, e2) { TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController); WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e2); TransformStreamUnblockWrite(stream); } function TransformStreamUnblockWrite(stream) { if (stream._backpressure) { TransformStreamSetBackpressure(stream, false); } } function TransformStreamSetBackpressure(stream, backpressure) { if (stream._backpressureChangePromise !== void 0) { stream._backpressureChangePromise_resolve(); } stream._backpressureChangePromise = newPromise((resolve) =&gt; { stream._backpressureChangePromise_resolve = resolve; }); stream._backpressure = backpressure; } class TransformStreamDefaultController { constructor() { throw new TypeError(&quot;Illegal constructor&quot;); } /** * Returns the desired size to fill the readable sideโ€™s internal queue. It can be negative, if the queue is over-full. */ get desiredSize() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException(&quot;desiredSize&quot;); } const readableController = this._controlledTransformStream._readable._readableStreamController; return ReadableStreamDefaultControllerGetDesiredSize(readableController); } enqueue(chunk = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException(&quot;enqueue&quot;); } TransformStreamDefaultControllerEnqueue(this, chunk); } /** * Errors both the readable side and the writable side of the controlled transform stream, making all future * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded. */ error(reason = void 0) { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException(&quot;error&quot;); } TransformStreamDefaultControllerError(this, reason); } /** * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the * transformer only needs to consume a portion of the chunks written to the writable side. */ terminate() { if (!IsTransformStreamDefaultController(this)) { throw defaultControllerBrandCheckException(&quot;terminate&quot;); } TransformStreamDefaultControllerTerminate(this); } } Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }); setFunctionName(TransformStreamDefaultController.prototype.enqueue, &quot;enqueue&quot;); setFunctionName(TransformStreamDefaultController.prototype.error, &quot;error&quot;); setFunctionName(TransformStreamDefaultController.prototype.terminate, &quot;terminate&quot;); if (typeof Symbol.toStringTag === &quot;symbol&quot;) { Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, { value: &quot;TransformStreamDefaultController&quot;, configurable: true }); } function IsTransformStreamDefaultController(x2) { if (!typeIsObject(x2)) { return false; } if (!Object.prototype.hasOwnProperty.call(x2, &quot;_controlledTransformStream&quot;)) { return false; } return x2 instanceof TransformStreamDefaultController; } function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) { controller._controlledTransformStream = stream; stream._transformStreamController = controller; controller._transformAlgorithm = transformAlgorithm; controller._flushAlgorithm = flushAlgorithm; controller._cancelAlgorithm = cancelAlgorithm; controller._finishPromise = void 0; controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) { const controller = Object.create(TransformStreamDefaultController.prototype); let transformAlgorithm; let flushAlgorithm; let cancelAlgorithm; if (transformer.transform !== void 0) { transformAlgorithm = (chunk) =&gt; transformer.transform(chunk, controller); } else { transformAlgorithm = (chunk) =&gt; { try { TransformStreamDefaultControllerEnqueue(controller, chunk); return promiseResolvedWith(void 0); } catch (transformResultE) { return promiseRejectedWith(transformResultE); } }; } if (transformer.flush !== void 0) { flushAlgorithm = () =&gt; transformer.flush(controller); } else { flushAlgorithm = () =&gt; promiseResolvedWith(void 0); } if (transformer.cancel !== void 0) { cancelAlgorithm = (reason) =&gt; transformer.cancel(reason); } else { cancelAlgorithm = () =&gt; promiseResolvedWith(void 0); } SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm); } function TransformStreamDefaultControllerClearAlgorithms(controller) { controller._transformAlgorithm = void 0; controller._flushAlgorithm = void 0; controller._cancelAlgorithm = void 0; } function TransformStreamDefaultControllerEnqueue(controller, chunk) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) { throw new TypeError(&quot;Readable side is not in a state that permits enqueue&quot;); } try { ReadableStreamDefaultControllerEnqueue(readableController, chunk); } catch (e2) { TransformStreamErrorWritableAndUnblockWrite(stream, e2); throw stream._readable._storedError; } const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController); if (backpressure !== stream._backpressure) { TransformStreamSetBackpressure(stream, true); } } function TransformStreamDefaultControllerError(controller, e2) { TransformStreamError(controller._controlledTransformStream, e2); } function TransformStreamDefaultControllerPerformTransform(controller, chunk) { const transformPromise = controller._transformAlgorithm(chunk); return transformPromiseWith(transformPromise, void 0, (r2) =&gt; { TransformStreamError(controller._controlledTransformStream, r2); throw r2; }); } function TransformStreamDefaultControllerTerminate(controller) { const stream = controller._controlledTransformStream; const readableController = stream._readable._readableStreamController; ReadableStreamDefaultControllerClose(readableController); const error = new TypeError(&quot;TransformStream terminated&quot;); TransformStreamErrorWritableAndUnblockWrite(stream, error); } function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) { const controller = stream._transformStreamController; if (stream._backpressure) { const backpressureChangePromise = stream._backpressureChangePromise; return transformPromiseWith(backpressureChangePromise, () =&gt; { const writable = stream._writable; const state = writable._state; if (state === &quot;erroring&quot;) { throw writable._storedError; } return TransformStreamDefaultControllerPerformTransform(controller, chunk); }); } return TransformStreamDefaultControllerPerformTransform(controller, chunk); } function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) =&gt; { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () =&gt; { if (readable._state === &quot;errored&quot;) { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerError(readable._readableStreamController, reason); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) =&gt; { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSinkCloseAlgorithm(stream) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const readable = stream._readable; controller._finishPromise = newPromise((resolve, reject) =&gt; { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const flushPromise = controller._flushAlgorithm(); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(flushPromise, () =&gt; { if (readable._state === &quot;errored&quot;) { defaultControllerFinishPromiseReject(controller, readable._storedError); } else { ReadableStreamDefaultControllerClose(readable._readableStreamController); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) =&gt; { ReadableStreamDefaultControllerError(readable._readableStreamController, r2); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function TransformStreamDefaultSourcePullAlgorithm(stream) { TransformStreamSetBackpressure(stream, false); return stream._backpressureChangePromise; } function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) { const controller = stream._transformStreamController; if (controller._finishPromise !== void 0) { return controller._finishPromise; } const writable = stream._writable; controller._finishPromise = newPromise((resolve, reject) =&gt; { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; }); const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () =&gt; { if (writable._state === &quot;errored&quot;) { defaultControllerFinishPromiseReject(controller, writable._storedError); } else { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseResolve(controller); } return null; }, (r2) =&gt; { WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r2); TransformStreamUnblockWrite(stream); defaultControllerFinishPromiseReject(controller, r2); return null; }); return controller._finishPromise; } function defaultControllerBrandCheckException(name) { return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`); } function defaultControllerFinishPromiseResolve(controller) { if (controller._finishPromise_resolve === void 0) { return; } controller._finishPromise_resolve(); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function defaultControllerFinishPromiseReject(controller, reason) { if (controller._finishPromise_reject === void 0) { return; } setPromiseIsHandledToTrue(controller._finishPromise); controller._finishPromise_reject(reason); controller._finishPromise_resolve = void 0; controller._finishPromise_reject = void 0; } function streamBrandCheckException(name) { return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`); } exports3.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy; exports3.CountQueuingStrategy = CountQueuingStrategy; exports3.ReadableByteStreamController = ReadableByteStreamController; exports3.ReadableStream = ReadableStream2; exports3.ReadableStreamBYOBReader = ReadableStreamBYOBReader; exports3.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest; exports3.ReadableStreamDefaultController = ReadableStreamDefaultController; exports3.ReadableStreamDefaultReader = ReadableStreamDefaultReader; exports3.TransformStream = TransformStream; exports3.TransformStreamDefaultController = TransformStreamDefaultController; exports3.WritableStream = WritableStream; exports3.WritableStreamDefaultController = WritableStreamDefaultController; exports3.WritableStreamDefaultWriter = WritableStreamDefaultWriter; })); } }); // node_modules/fetch-blob/streams.cjs var require_streams = __commonJS({ &quot;node_modules/fetch-blob/streams.cjs&quot;() { var POOL_SIZE2 = 65536; if (!globalThis.ReadableStream) { try { const process2 = require(&quot;process&quot;); const { emitWarning } = process2; try { process2.emitWarning = () =&gt; { }; Object.assign(globalThis, require(&quot;stream/web&quot;)); process2.emitWarning = emitWarning; } catch (error) { process2.emitWarning = emitWarning; throw error; } } catch (error) { Object.assign(globalThis, require_ponyfill_es2018()); } } try { const { Blob: Blob3 } = require(&quot;buffer&quot;); if (Blob3 &amp;&amp; !Blob3.prototype.stream) { Blob3.prototype.stream = function name(params) { let position = 0; const blob = this; return new ReadableStream({ type: &quot;bytes&quot;, async pull(ctrl) { const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE2)); const buffer = await chunk.arrayBuffer(); position += buffer.byteLength; ctrl.enqueue(new Uint8Array(buffer)); if (position === blob.size) { ctrl.close(); } } }); }; } } catch (error) { } } }); // node_modules/fetch-blob/index.js async function* toIterator(parts, clone2 = true) { for (const part of parts) { if (&quot;stream&quot; in part) { yield* ( /** @type {AsyncIterableIterator&lt;Uint8Array&gt;} */ part.stream() ); } else if (ArrayBuffer.isView(part)) { if (clone2) { let position = part.byteOffset; const end = part.byteOffset + part.byteLength; while (position !== end) { const size = Math.min(end - position, POOL_SIZE); const chunk = part.buffer.slice(position, position + size); position += chunk.byteLength; yield new Uint8Array(chunk); } } else { yield part; } } else { let position = 0, b = ( /** @type {Blob} */ part ); while (position !== b.size) { const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE)); const buffer = await chunk.arrayBuffer(); position += buffer.byteLength; yield new Uint8Array(buffer); } } } } var import_streams, POOL_SIZE, _Blob, Blob2, fetch_blob_default; var init_fetch_blob = __esm({ &quot;node_modules/fetch-blob/index.js&quot;() { import_streams = __toESM(require_streams(), 1); POOL_SIZE = 65536; _Blob = class Blob { /** @type {Array.&lt;(Blob|Uint8Array)&gt;} */ #parts = []; #type = &quot;&quot;; #size = 0; #endings = &quot;transparent&quot;; /** * The Blob() constructor returns a new Blob object. The content * of the blob consists of the concatenation of the values given * in the parameter array. * * @param {*} blobParts * @param {{ type?: string, endings?: string }} [options] */ constructor(blobParts = [], options = {}) { if (typeof blobParts !== &quot;object&quot; || blobParts === null) { throw new TypeError(&quot;Failed to construct &#x27;Blob&#x27;: The provided value cannot be converted to a sequence.&quot;); } if (typeof blobParts[Symbol.iterator] !== &quot;function&quot;) { throw new TypeError(&quot;Failed to construct &#x27;Blob&#x27;: The object must have a callable @@iterator property.&quot;); } if (typeof options !== &quot;object&quot; &amp;&amp; typeof options !== &quot;function&quot;) { throw new TypeError(&quot;Failed to construct &#x27;Blob&#x27;: parameter 2 cannot convert to dictionary.&quot;); } if (options === null) options = {}; const encoder = new TextEncoder(); for (const element of blobParts) { let part; if (ArrayBuffer.isView(element)) { part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength)); } else if (element instanceof ArrayBuffer) { part = new Uint8Array(element.slice(0)); } else if (element instanceof Blob) { part = element; } else { part = encoder.encode(`${element}`); } this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size; this.#parts.push(part); } this.#endings = `${options.endings === void 0 ? &quot;transparent&quot; : options.endings}`; const type = options.type === void 0 ? &quot;&quot; : String(options.type); this.#type = /^[\x20-\x7E]*$/.test(type) ? type : &quot;&quot;; } /** * The Blob interface&#x27;s size property returns the * size of the Blob in bytes. */ get size() { return this.#size; } /** * The type property of a Blob object returns the MIME type of the file. */ get type() { return this.#type; } /** * The text() method in the Blob interface returns a Promise * that resolves with a string containing the contents of * the blob, interpreted as UTF-8. * * @return {Promise&lt;string&gt;} */ async text() { const decoder = new TextDecoder(); let str = &quot;&quot;; for await (const part of toIterator(this.#parts, false)) { str += decoder.decode(part, { stream: true }); } str += decoder.decode(); return str; } /** * The arrayBuffer() method in the Blob interface returns a * Promise that resolves with the contents of the blob as * binary data contained in an ArrayBuffer. * * @return {Promise&lt;ArrayBuffer&gt;} */ async arrayBuffer() { const data = new Uint8Array(this.size); let offset = 0; for await (const chunk of toIterator(this.#parts, false)) { data.set(chunk, offset); offset += chunk.length; } return data.buffer; } stream() { const it = toIterator(this.#parts, true); return new globalThis.ReadableStream({ // @ts-ignore type: &quot;bytes&quot;, async pull(ctrl) { const chunk = await it.next(); chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value); }, async cancel() { await it.return(); } }); } /** * The Blob interface&#x27;s slice() method creates and returns a * new Blob object which contains data from a subset of the * blob on which it&#x27;s called. * * @param {number} [start] * @param {number} [end] * @param {string} [type] */ slice(start = 0, end = this.size, type = &quot;&quot;) { const { size } = this; let relativeStart = start &lt; 0 ? Math.max(size + start, 0) : Math.min(start, size); let relativeEnd = end &lt; 0 ? Math.max(size + end, 0) : Math.min(end, size); const span = Math.max(relativeEnd - relativeStart, 0); const parts = this.#parts; const blobParts = []; let added = 0; for (const part of parts) { if (added &gt;= span) { break; } const size2 = ArrayBuffer.isView(part) ? part.byteLength : part.size; if (relativeStart &amp;&amp; size2 &lt;= relativeStart) { relativeStart -= size2; relativeEnd -= size2; } else { let chunk; if (ArrayBuffer.isView(part)) { chunk = part.subarray(relativeStart, Math.min(size2, relativeEnd)); added += chunk.byteLength; } else { chunk = part.slice(relativeStart, Math.min(size2, relativeEnd)); added += chunk.size; } relativeEnd -= size2; blobParts.push(chunk); relativeStart = 0; } } const blob = new Blob([], { type: String(type).toLowerCase() }); blob.#size = span; blob.#parts = blobParts; return blob; } get [Symbol.toStringTag]() { return &quot;Blob&quot;; } static [Symbol.hasInstance](object) { return object &amp;&amp; typeof object === &quot;object&quot; &amp;&amp; typeof object.constructor === &quot;function&quot; &amp;&amp; (typeof object.stream === &quot;function&quot; || typeof object.arrayBuffer === &quot;function&quot;) &amp;&amp; /^(Blob|File)$/.test(object[Symbol.toStringTag]); } }; Object.defineProperties(_Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Blob2 = _Blob; fetch_blob_default = Blob2; } }); // node_modules/fetch-blob/file.js var _File, File2, file_default; var init_file = __esm({ &quot;node_modules/fetch-blob/file.js&quot;() { init_fetch_blob(); _File = class File extends fetch_blob_default { #lastModified = 0; #name = &quot;&quot;; /** * @param {*[]} fileBits * @param {string} fileName * @param {{lastModified?: number, type?: string}} options */ // @ts-ignore constructor(fileBits, fileName, options = {}) { if (arguments.length &lt; 2) { throw new TypeError(`Failed to construct &#x27;File&#x27;: 2 arguments required, but only ${arguments.length} present.`); } super(fileBits, options); if (options === null) options = {}; const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified); if (!Number.isNaN(lastModified)) { this.#lastModified = lastModified; } this.#name = String(fileName); } get name() { return this.#name; } get lastModified() { return this.#lastModified; } get [Symbol.toStringTag]() { return &quot;File&quot;; } static [Symbol.hasInstance](object) { return !!object &amp;&amp; object instanceof fetch_blob_default &amp;&amp; /^(File)$/.test(object[Symbol.toStringTag]); } }; File2 = _File; file_default = File2; } }); // node_modules/formdata-polyfill/esm.min.js function formDataToBlob(F2, B = fetch_blob_default) { var b = `${r()}${r()}`.replace(/\./g, &quot;&quot;).slice(-28).padStart(32, &quot;-&quot;), c = [], p = `--${b}\r Content-Disposition: form-data; name=&quot;`; F2.forEach((v, n) =&gt; typeof v == &quot;string&quot; ? c.push(p + e(n) + `&quot;\r \r ${v.replace(/\r(?!\n)|(?&lt;!\r)\n/g, &quot;\r\n&quot;)}\r `) : c.push(p + e(n) + `&quot;; filename=&quot;${e(v.name, 1)}&quot;\r Content-Type: ${v.type || &quot;application/octet-stream&quot;}\r \r `, v, &quot;\r\n&quot;)); c.push(`--${b}--`); return new B(c, { type: &quot;multipart/form-data; boundary=&quot; + b }); } var t, i, h, r, m, f, e, x, FormData; var init_esm_min = __esm({ &quot;node_modules/formdata-polyfill/esm.min.js&quot;() { init_fetch_blob(); init_file(); ({ toStringTag: t, iterator: i, hasInstance: h } = Symbol); r = Math.random; m = &quot;append,set,get,getAll,delete,keys,values,entries,forEach,constructor&quot;.split(&quot;,&quot;); f = (a, b, c) =&gt; (a += &quot;&quot;, /^(Blob|File)$/.test(b &amp;&amp; b[t]) ? [(c = c !== void 0 ? c + &quot;&quot; : b[t] == &quot;File&quot; ? b.name : &quot;blob&quot;, a), b.name !== c || b[t] == &quot;blob&quot; ? new file_default([b], c, b) : b] : [a, b + &quot;&quot;]); e = (c, f3) =&gt; (f3 ? c : c.replace(/\r?\n|\r/g, &quot;\r\n&quot;)).replace(/\n/g, &quot;%0A&quot;).replace(/\r/g, &quot;%0D&quot;).replace(/&quot;/g, &quot;%22&quot;); x = (n, a, e2) =&gt; { if (a.length &lt; e2) { throw new TypeError(`Failed to execute &#x27;${n}&#x27; on &#x27;FormData&#x27;: ${e2} arguments required, but only ${a.length} present.`); } }; FormData = class FormData2 { #d = []; constructor(...a) { if (a.length) throw new TypeError(`Failed to construct &#x27;FormData&#x27;: parameter 1 is not of type &#x27;HTMLFormElement&#x27;.`); } get [t]() { return &quot;FormData&quot;; } [i]() { return this.entries(); } static [h](o) { return o &amp;&amp; typeof o === &quot;object&quot; &amp;&amp; o[t] === &quot;FormData&quot; &amp;&amp; !m.some((m2) =&gt; typeof o[m2] != &quot;function&quot;); } append(...a) { x(&quot;append&quot;, arguments, 2); this.#d.push(f(...a)); } delete(a) { x(&quot;delete&quot;, arguments, 1); a += &quot;&quot;; this.#d = this.#d.filter(([b]) =&gt; b !== a); } get(a) { x(&quot;get&quot;, arguments, 1); a += &quot;&quot;; for (var b = this.#d, l = b.length, c = 0; c &lt; l; c++) if (b[c][0] === a) return b[c][1]; return null; } getAll(a, b) { x(&quot;getAll&quot;, arguments, 1); b = []; a += &quot;&quot;; this.#d.forEach((c) =&gt; c[0] === a &amp;&amp; b.push(c[1])); return b; } has(a) { x(&quot;has&quot;, arguments, 1); a += &quot;&quot;; return this.#d.some((b) =&gt; b[0] === a); } forEach(a, b) { x(&quot;forEach&quot;, arguments, 1); for (var [c, d] of this) a.call(b, d, c, this); } set(...a) { x(&quot;set&quot;, arguments, 2); var b = [], c = true; a = f(...a); this.#d.forEach((d) =&gt; { d[0] === a[0] ? c &amp;&amp; (c = !b.push(a)) : b.push(d); }); c &amp;&amp; b.push(a); this.#d = b; } *entries() { yield* this.#d; } *keys() { for (var [a] of this) yield a; } *values() { for (var [, a] of this) yield a; } }; } }); // node_modules/node-fetch/src/errors/base.js var FetchBaseError; var init_base = __esm({ &quot;node_modules/node-fetch/src/errors/base.js&quot;() { FetchBaseError = class extends Error { constructor(message, type) { super(message); Error.captureStackTrace(this, this.constructor); this.type = type; } get name() { return this.constructor.name; } get [Symbol.toStringTag]() { return this.constructor.name; } }; } }); // node_modules/node-fetch/src/errors/fetch-error.js var FetchError; var init_fetch_error = __esm({ &quot;node_modules/node-fetch/src/errors/fetch-error.js&quot;() { init_base(); FetchError = class extends FetchBaseError { /** * @param {string} message - Error message for human * @param {string} [type] - Error type for machine * @param {SystemError} [systemError] - For Node.js system error */ constructor(message, type, systemError) { super(message, type); if (systemError) { this.code = this.errno = systemError.code; this.erroredSysCall = systemError.syscall; } } }; } }); // node_modules/node-fetch/src/utils/is.js var NAME, isURLSearchParameters, isBlob, isAbortSignal, isDomainOrSubdomain, isSameProtocol; var init_is = __esm({ &quot;node_modules/node-fetch/src/utils/is.js&quot;() { NAME = Symbol.toStringTag; isURLSearchParameters = (object) =&gt; { return typeof object === &quot;object&quot; &amp;&amp; typeof object.append === &quot;function&quot; &amp;&amp; typeof object.delete === &quot;function&quot; &amp;&amp; typeof object.get === &quot;function&quot; &amp;&amp; typeof object.getAll === &quot;function&quot; &amp;&amp; typeof object.has === &quot;function&quot; &amp;&amp; typeof object.set === &quot;function&quot; &amp;&amp; typeof object.sort === &quot;function&quot; &amp;&amp; object[NAME] === &quot;URLSearchParams&quot;; }; isBlob = (object) =&gt; { return object &amp;&amp; typeof object === &quot;object&quot; &amp;&amp; typeof object.arrayBuffer === &quot;function&quot; &amp;&amp; typeof object.type === &quot;string&quot; &amp;&amp; typeof object.stream === &quot;function&quot; &amp;&amp; typeof object.constructor === &quot;function&quot; &amp;&amp; /^(Blob|File)$/.test(object[NAME]); }; isAbortSignal = (object) =&gt; { return typeof object === &quot;object&quot; &amp;&amp; (object[NAME] === &quot;AbortSignal&quot; || object[NAME] === &quot;EventTarget&quot;); }; isDomainOrSubdomain = (destination, original) =&gt; { const orig = new URL(original).hostname; const dest = new URL(destination).hostname; return orig === dest || orig.endsWith(`.${dest}`); }; isSameProtocol = (destination, original) =&gt; { const orig = new URL(original).protocol; const dest = new URL(destination).protocol; return orig === dest; }; } }); // node_modules/node-domexception/index.js var require_node_domexception = __commonJS({ &quot;node_modules/node-domexception/index.js&quot;(exports2, module2) { if (!globalThis.DOMException) { try { const { MessageChannel } = require(&quot;worker_threads&quot;), port = new MessageChannel().port1, ab = new ArrayBuffer(); port.postMessage(ab, [ab, ab]); } catch (err) { err.constructor.name === &quot;DOMException&quot; &amp;&amp; (globalThis.DOMException = err.constructor); } } module2.exports = globalThis.DOMException; } }); // node_modules/fetch-blob/from.js var import_node_fs, import_node_path, import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem; var init_from = __esm({ &quot;node_modules/fetch-blob/from.js&quot;() { import_node_fs = require(&quot;fs&quot;); import_node_path = require(&quot;path&quot;); import_node_domexception = __toESM(require_node_domexception(), 1); init_file(); init_fetch_blob(); ({ stat } = import_node_fs.promises); blobFromSync = (path, type) =&gt; fromBlob((0, import_node_fs.statSync)(path), path, type); blobFrom = (path, type) =&gt; stat(path).then((stat2) =&gt; fromBlob(stat2, path, type)); fileFrom = (path, type) =&gt; stat(path).then((stat2) =&gt; fromFile(stat2, path, type)); fileFromSync = (path, type) =&gt; fromFile((0, import_node_fs.statSync)(path), path, type); fromBlob = (stat2, path, type = &quot;&quot;) =&gt; new fetch_blob_default([new BlobDataItem({ path, size: stat2.size, lastModified: stat2.mtimeMs, start: 0 })], { type }); fromFile = (stat2, path, type = &quot;&quot;) =&gt; new file_default([new BlobDataItem({ path, size: stat2.size, lastModified: stat2.mtimeMs, start: 0 })], (0, import_node_path.basename)(path), { type, lastModified: stat2.mtimeMs }); BlobDataItem = class _BlobDataItem { #path; #start; constructor(options) { this.#path = options.path; this.#start = options.start; this.size = options.size; this.lastModified = options.lastModified; } /** * Slicing arguments is first validated and formatted * to not be out of range by Blob.prototype.slice */ slice(start, end) { return new _BlobDataItem({ path: this.#path, lastModified: this.lastModified, size: end - start, start: this.#start + start }); } async *stream() { const { mtimeMs } = await stat(this.#path); if (mtimeMs &gt; this.lastModified) { throw new import_node_domexception.default(&quot;The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.&quot;, &quot;NotReadableError&quot;); } yield* (0, import_node_fs.createReadStream)(this.#path, { start: this.#start, end: this.#start + this.size - 1 }); } get [Symbol.toStringTag]() { return &quot;Blob&quot;; } }; } }); // node_modules/node-fetch/src/utils/multipart-parser.js var multipart_parser_exports = {}; __export(multipart_parser_exports, { toFormData: () =&gt; toFormData }); function _fileName(headerValue) { const m2 = headerValue.match(/\bfilename=(&quot;(.*?)&quot;|([^()&lt;&gt;@,;:\\&quot;/[\]?={}\s\t]+))($|;\s)/i); if (!m2) { return; } const match = m2[2] || m2[3] || &quot;&quot;; let filename = match.slice(match.lastIndexOf(&quot;\\&quot;) + 1); filename = filename.replace(/%22/g, &#x27;&quot;&#x27;); filename = filename.replace(/&amp;#(\d{4});/g, (m3, code) =&gt; { return String.fromCharCode(code); }); return filename; } async function toFormData(Body2, ct) { if (!/multipart/i.test(ct)) { throw new TypeError(&quot;Failed to fetch&quot;); } const m2 = ct.match(/boundary=(?:&quot;([^&quot;]+)&quot;|([^;]+))/i); if (!m2) { throw new TypeError(&quot;no or bad content-type header, no multipart boundary&quot;); } const parser = new MultipartParser(m2[1] || m2[2]); let headerField; let headerValue; let entryValue; let entryName; let contentType; let filename; const entryChunks = []; const formData = new FormData(); const onPartData = (ui8a) =&gt; { entryValue += decoder.decode(ui8a, { stream: true }); }; const appendToFile = (ui8a) =&gt; { entryChunks.push(ui8a); }; const appendFileToFormData = () =&gt; { const file = new file_default(entryChunks, filename, { type: contentType }); formData.append(entryName, file); }; const appendEntryToFormData = () =&gt; { formData.append(entryName, entryValue); }; const decoder = new TextDecoder(&quot;utf-8&quot;); decoder.decode(); parser.onPartBegin = function() { parser.onPartData = onPartData; parser.onPartEnd = appendEntryToFormData; headerField = &quot;&quot;; headerValue = &quot;&quot;; entryValue = &quot;&quot;; entryName = &quot;&quot;; contentType = &quot;&quot;; filename = null; entryChunks.length = 0; }; parser.onHeaderField = function(ui8a) { headerField += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderValue = function(ui8a) { headerValue += decoder.decode(ui8a, { stream: true }); }; parser.onHeaderEnd = function() { headerValue += decoder.decode(); headerField = headerField.toLowerCase(); if (headerField === &quot;content-disposition&quot;) { const m3 = headerValue.match(/\bname=(&quot;([^&quot;]*)&quot;|([^()&lt;&gt;@,;:\\&quot;/[\]?={}\s\t]+))/i); if (m3) { entryName = m3[2] || m3[3] || &quot;&quot;; } filename = _fileName(headerValue); if (filename) { parser.onPartData = appendToFile; parser.onPartEnd = appendFileToFormData; } } else if (headerField === &quot;content-type&quot;) { contentType = headerValue; } headerValue = &quot;&quot;; headerField = &quot;&quot;; }; for await (const chunk of Body2) { parser.write(chunk); } parser.end(); return formData; } var s, S, f2, F, LF, CR, SPACE, HYPHEN, COLON, A, Z, lower, noop, MultipartParser; var init_multipart_parser = __esm({ &quot;node_modules/node-fetch/src/utils/multipart-parser.js&quot;() { init_from(); init_esm_min(); s = 0; S = { START_BOUNDARY: s++, HEADER_FIELD_START: s++, HEADER_FIELD: s++, HEADER_VALUE_START: s++, HEADER_VALUE: s++, HEADER_VALUE_ALMOST_DONE: s++, HEADERS_ALMOST_DONE: s++, PART_DATA_START: s++, PART_DATA: s++, END: s++ }; f2 = 1; F = { PART_BOUNDARY: f2, LAST_BOUNDARY: f2 *= 2 }; LF = 10; CR = 13; SPACE = 32; HYPHEN = 45; COLON = 58; A = 97; Z = 122; lower = (c) =&gt; c | 32; noop = () =&gt; { }; MultipartParser = class { /** * @param {string} boundary */ constructor(boundary) { this.index = 0; this.flags = 0; this.onHeaderEnd = noop; this.onHeaderField = noop; this.onHeadersEnd = noop; this.onHeaderValue = noop; this.onPartBegin = noop; this.onPartData = noop; this.onPartEnd = noop; this.boundaryChars = {}; boundary = &quot;\r\n--&quot; + boundary; const ui8a = new Uint8Array(boundary.length); for (let i2 = 0; i2 &lt; boundary.length; i2++) { ui8a[i2] = boundary.charCodeAt(i2); this.boundaryChars[ui8a[i2]] = true; } this.boundary = ui8a; this.lookbehind = new Uint8Array(this.boundary.length + 8); this.state = S.START_BOUNDARY; } /** * @param {Uint8Array} data */ write(data) { let i2 = 0; const length_ = data.length; let previousIndex = this.index; let { lookbehind, boundary, boundaryChars, index, state, flags } = this; const boundaryLength = this.boundary.length; const boundaryEnd = boundaryLength - 1; const bufferLength = data.length; let c; let cl; const mark = (name) =&gt; { this[name + &quot;Mark&quot;] = i2; }; const clear = (name) =&gt; { delete this[name + &quot;Mark&quot;]; }; const callback = (callbackSymbol, start, end, ui8a) =&gt; { if (start === void 0 || start !== end) { this[callbackSymbol](ui8a &amp;&amp; ui8a.subarray(start, end)); } }; const dataCallback = (name, clear2) =&gt; { const markSymbol = name + &quot;Mark&quot;; if (!(markSymbol in this)) { return; } if (clear2) { callback(name, this[markSymbol], i2, data); delete this[markSymbol]; } else { callback(name, this[markSymbol], data.length, data); this[markSymbol] = 0; } }; for (i2 = 0; i2 &lt; length_; i2++) { c = data[i2]; switch (state) { case S.START_BOUNDARY: if (index === boundary.length - 2) { if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else if (c !== CR) { return; } index++; break; } else if (index - 1 === boundary.length - 2) { if (flags &amp; F.LAST_BOUNDARY &amp;&amp; c === HYPHEN) { state = S.END; flags = 0; } else if (!(flags &amp; F.LAST_BOUNDARY) &amp;&amp; c === LF) { index = 0; callback(&quot;onPartBegin&quot;); state = S.HEADER_FIELD_START; } else { return; } break; } if (c !== boundary[index + 2]) { index = -2; } if (c === boundary[index + 2]) { index++; } break; case S.HEADER_FIELD_START: state = S.HEADER_FIELD; mark(&quot;onHeaderField&quot;); index = 0; // falls through case S.HEADER_FIELD: if (c === CR) { clear(&quot;onHeaderField&quot;); state = S.HEADERS_ALMOST_DONE; break; } index++; if (c === HYPHEN) { break; } if (c === COLON) { if (index === 1) { return; } dataCallback(&quot;onHeaderField&quot;, true); state = S.HEADER_VALUE_START; break; } cl = lower(c); if (cl &lt; A || cl &gt; Z) { return; } break; case S.HEADER_VALUE_START: if (c === SPACE) { break; } mark(&quot;onHeaderValue&quot;); state = S.HEADER_VALUE; // falls through case S.HEADER_VALUE: if (c === CR) { dataCallback(&quot;onHeaderValue&quot;, true); callback(&quot;onHeaderEnd&quot;); state = S.HEADER_VALUE_ALMOST_DONE; } break; case S.HEADER_VALUE_ALMOST_DONE: if (c !== LF) { return; } state = S.HEADER_FIELD_START; break; case S.HEADERS_ALMOST_DONE: if (c !== LF) { return; } callback(&quot;onHeadersEnd&quot;); state = S.PART_DATA_START; break; case S.PART_DATA_START: state = S.PART_DATA; mark(&quot;onPartData&quot;); // falls through case S.PART_DATA: previousIndex = index; if (index === 0) { i2 += boundaryEnd; while (i2 &lt; bufferLength &amp;&amp; !(data[i2] in boundaryChars)) { i2 += boundaryLength; } i2 -= boundaryEnd; c = data[i2]; } if (index &lt; boundary.length) { if (boundary[index] === c) { if (index === 0) { dataCallback(&quot;onPartData&quot;, true); } index++; } else { index = 0; } } else if (index === boundary.length) { index++; if (c === CR) { flags |= F.PART_BOUNDARY; } else if (c === HYPHEN) { flags |= F.LAST_BOUNDARY; } else { index = 0; } } else if (index - 1 === boundary.length) { if (flags &amp; F.PART_BOUNDARY) { index = 0; if (c === LF) { flags &amp;= ~F.PART_BOUNDARY; callback(&quot;onPartEnd&quot;); callback(&quot;onPartBegin&quot;); state = S.HEADER_FIELD_START; break; } } else if (flags &amp; F.LAST_BOUNDARY) { if (c === HYPHEN) { callback(&quot;onPartEnd&quot;); state = S.END; flags = 0; } else { index = 0; } } else { index = 0; } } if (index &gt; 0) { lookbehind[index - 1] = c; } else if (previousIndex &gt; 0) { const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength); callback(&quot;onPartData&quot;, 0, previousIndex, _lookbehind); previousIndex = 0; mark(&quot;onPartData&quot;); i2--; } break; case S.END: break; default: throw new Error(`Unexpected state entered: ${state}`); } } dataCallback(&quot;onHeaderField&quot;); dataCallback(&quot;onHeaderValue&quot;); dataCallback(&quot;onPartData&quot;); this.index = index; this.state = state; this.flags = flags; } end() { if (this.state === S.HEADER_FIELD_START &amp;&amp; this.index === 0 || this.state === S.PART_DATA &amp;&amp; this.index === this.boundary.length) { this.onPartEnd(); } else if (this.state !== S.END) { throw new Error(&quot;MultipartParser.end(): stream ended unexpectedly&quot;); } } }; } }); // node_modules/node-fetch/src/body.js async function consumeBody(data) { if (data[INTERNALS].disturbed) { throw new TypeError(`body used already for: ${data.url}`); } data[INTERNALS].disturbed = true; if (data[INTERNALS].error) { throw data[INTERNALS].error; } const { body } = data; if (body === null) { return import_node_buffer.Buffer.alloc(0); } if (!(body instanceof import_node_stream.default)) { return import_node_buffer.Buffer.alloc(0); } const accum = []; let accumBytes = 0; try { for await (const chunk of body) { if (data.size &gt; 0 &amp;&amp; accumBytes + chunk.length &gt; data.size) { const error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, &quot;max-size&quot;); body.destroy(error); throw error; } accumBytes += chunk.length; accum.push(chunk); } } catch (error) { const error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, &quot;system&quot;, error); throw error_; } if (body.readableEnded === true || body._readableState.ended === true) { try { if (accum.every((c) =&gt; typeof c === &quot;string&quot;)) { return import_node_buffer.Buffer.from(accum.join(&quot;&quot;)); } return import_node_buffer.Buffer.concat(accum, accumBytes); } catch (error) { throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, &quot;system&quot;, error); } } else { throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`); } } var import_node_stream, import_node_util, import_node_buffer, pipeline, INTERNALS, Body, clone, getNonSpecFormDataBoundary, extractContentType, getTotalBytes, writeToStream; var init_body = __esm({ &quot;node_modules/node-fetch/src/body.js&quot;() { import_node_stream = __toESM(require(&quot;stream&quot;), 1); import_node_util = require(&quot;util&quot;); import_node_buffer = require(&quot;buffer&quot;); init_fetch_blob(); init_esm_min(); init_fetch_error(); init_base(); init_is(); pipeline = (0, import_node_util.promisify)(import_node_stream.default.pipeline); INTERNALS = Symbol(&quot;Body internals&quot;); Body = class { constructor(body, { size = 0 } = {}) { let boundary = null; if (body === null) { body = null; } else if (isURLSearchParameters(body)) { body = import_node_buffer.Buffer.from(body.toString()); } else if (isBlob(body)) { } else if (import_node_buffer.Buffer.isBuffer(body)) { } else if (import_node_util.types.isAnyArrayBuffer(body)) { body = import_node_buffer.Buffer.from(body); } else if (ArrayBuffer.isView(body)) { body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof import_node_stream.default) { } else if (body instanceof FormData) { body = formDataToBlob(body); boundary = body.type.split(&quot;=&quot;)[1]; } else { body = import_node_buffer.Buffer.from(String(body)); } let stream = body; if (import_node_buffer.Buffer.isBuffer(body)) { stream = import_node_stream.default.Readable.from(body); } else if (isBlob(body)) { stream = import_node_stream.default.Readable.from(body.stream()); } this[INTERNALS] = { body, stream, boundary, disturbed: false, error: null }; this.size = size; if (body instanceof import_node_stream.default) { body.on(&quot;error&quot;, (error_) =&gt; { const error = error_ instanceof FetchBaseError ? error_ : new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, &quot;system&quot;, error_); this[INTERNALS].error = error; }); } } get body() { return this[INTERNALS].stream; } get bodyUsed() { return this[INTERNALS].disturbed; } /** * Decode response as ArrayBuffer * * @return Promise */ async arrayBuffer() { const { buffer, byteOffset, byteLength } = await consumeBody(this); return buffer.slice(byteOffset, byteOffset + byteLength); } async formData() { const ct = this.headers.get(&quot;content-type&quot;); if (ct.startsWith(&quot;application/x-www-form-urlencoded&quot;)) { const formData = new FormData(); const parameters = new URLSearchParams(await this.text()); for (const [name, value] of parameters) { formData.append(name, value); } return formData; } const { toFormData: toFormData2 } = await Promise.resolve().then(() =&gt; (init_multipart_parser(), multipart_parser_exports)); return toFormData2(this.body, ct); } /** * Return raw response as Blob * * @return Promise */ async blob() { const ct = this.headers &amp;&amp; this.headers.get(&quot;content-type&quot;) || this[INTERNALS].body &amp;&amp; this[INTERNALS].body.type || &quot;&quot;; const buf = await this.arrayBuffer(); return new fetch_blob_default([buf], { type: ct }); } /** * Decode response as json * * @return Promise */ async json() { const text = await this.text(); return JSON.parse(text); } /** * Decode response as text * * @return Promise */ async text() { const buffer = await consumeBody(this); return new TextDecoder().decode(buffer); } /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody(this); } }; Body.prototype.buffer = (0, import_node_util.deprecate)(Body.prototype.buffer, &quot;Please use &#x27;response.arrayBuffer()&#x27; instead of &#x27;response.buffer()&#x27;&quot;, &quot;node-fetch#buffer&quot;); Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: (0, import_node_util.deprecate)( () =&gt; { }, &quot;data doesn&#x27;t exist, use json(), text(), arrayBuffer(), or body instead&quot;, &quot;https://github.com/node-fetch/node-fetch/issues/1000 (response)&quot; ) } }); clone = (instance, highWaterMark) =&gt; { let p1; let p2; let { body } = instance[INTERNALS]; if (instance.bodyUsed) { throw new Error(&quot;cannot clone body after it is used&quot;); } if (body instanceof import_node_stream.default &amp;&amp; typeof body.getBoundary !== &quot;function&quot;) { p1 = new import_node_stream.PassThrough({ highWaterMark }); p2 = new import_node_stream.PassThrough({ highWaterMark }); body.pipe(p1); body.pipe(p2); instance[INTERNALS].stream = p1; body = p2; } return body; }; getNonSpecFormDataBoundary = (0, import_node_util.deprecate)( (body) =&gt; body.getBoundary(), &quot;form-data doesn&#x27;t follow the spec and requires special treatment. Use alternative package&quot;, &quot;https://github.com/node-fetch/node-fetch/issues/1167&quot; ); extractContentType = (body, request) =&gt; { if (body === null) { return null; } if (typeof body === &quot;string&quot;) { return &quot;text/plain;charset=UTF-8&quot;; } if (isURLSearchParameters(body)) { return &quot;application/x-www-form-urlencoded;charset=UTF-8&quot;; } if (isBlob(body)) { return body.type || null; } if (import_node_buffer.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) { return null; } if (body instanceof FormData) { return `multipart/form-data; boundary=${request[INTERNALS].boundary}`; } if (body &amp;&amp; typeof body.getBoundary === &quot;function&quot;) { return `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`; } if (body instanceof import_node_stream.default) { return null; } return &quot;text/plain;charset=UTF-8&quot;; }; getTotalBytes = (request) =&gt; { const { body } = request[INTERNALS]; if (body === null) { return 0; } if (isBlob(body)) { return body.size; } if (import_node_buffer.Buffer.isBuffer(body)) { return body.length; } if (body &amp;&amp; typeof body.getLengthSync === &quot;function&quot;) { return body.hasKnownLength &amp;&amp; body.hasKnownLength() ? body.getLengthSync() : null; } return null; }; writeToStream = async (dest, { body }) =&gt; { if (body === null) { dest.end(); } else { await pipeline(body, dest); } }; } }); // node_modules/node-fetch/src/headers.js function fromRawHeaders(headers = []) { return new Headers( headers.reduce((result, value, index, array) =&gt; { if (index % 2 === 0) { result.push(array.slice(index, index + 2)); } return result; }, []).filter(([name, value]) =&gt; { try { validateHeaderName(name); validateHeaderValue(name, String(value)); return true; } catch { return false; } }) ); } var import_node_util2, import_node_http, validateHeaderName, validateHeaderValue, Headers; var init_headers = __esm({ &quot;node_modules/node-fetch/src/headers.js&quot;() { import_node_util2 = require(&quot;util&quot;); import_node_http = __toESM(require(&quot;http&quot;), 1); validateHeaderName = typeof import_node_http.default.validateHeaderName === &quot;function&quot; ? import_node_http.default.validateHeaderName : (name) =&gt; { if (!/^[\^`\-\w!#$%&amp;&#x27;*+.|~]+$/.test(name)) { const error = new TypeError(`Header name must be a valid HTTP token [${name}]`); Object.defineProperty(error, &quot;code&quot;, { value: &quot;ERR_INVALID_HTTP_TOKEN&quot; }); throw error; } }; validateHeaderValue = typeof import_node_http.default.validateHeaderValue === &quot;function&quot; ? import_node_http.default.validateHeaderValue : (name, value) =&gt; { if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) { const error = new TypeError(`Invalid character in header content [&quot;${name}&quot;]`); Object.defineProperty(error, &quot;code&quot;, { value: &quot;ERR_INVALID_CHAR&quot; }); throw error; } }; Headers = class _Headers extends URLSearchParams { /** * Headers class * * @constructor * @param {HeadersInit} [init] - Response headers */ constructor(init) { let result = []; if (init instanceof _Headers) { const raw = init.raw(); for (const [name, values] of Object.entries(raw)) { result.push(...values.map((value) =&gt; [name, value])); } } else if (init == null) { } else if (typeof init === &quot;object&quot; &amp;&amp; !import_node_util2.types.isBoxedPrimitive(init)) { const method = init[Symbol.iterator]; if (method == null) { result.push(...Object.entries(init)); } else { if (typeof method !== &quot;function&quot;) { throw new TypeError(&quot;Header pairs must be iterable&quot;); } result = [...init].map((pair) =&gt; { if (typeof pair !== &quot;object&quot; || import_node_util2.types.isBoxedPrimitive(pair)) { throw new TypeError(&quot;Each header pair must be an iterable object&quot;); } return [...pair]; }).map((pair) =&gt; { if (pair.length !== 2) { throw new TypeError(&quot;Each header pair must be a name/value tuple&quot;); } return [...pair]; }); } } else { throw new TypeError(&quot;Failed to construct &#x27;Headers&#x27;: The provided value is not of type &#x27;(sequence&lt;sequence&lt;ByteString&gt;&gt; or record&lt;ByteString, ByteString&gt;)&quot;); } result = result.length &gt; 0 ? result.map(([name, value]) =&gt; { validateHeaderName(name); validateHeaderValue(name, String(value)); return [String(name).toLowerCase(), String(value)]; }) : void 0; super(result); return new Proxy(this, { get(target, p, receiver) { switch (p) { case &quot;append&quot;: case &quot;set&quot;: return (name, value) =&gt; { validateHeaderName(name); validateHeaderValue(name, String(value)); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase(), String(value) ); }; case &quot;delete&quot;: case &quot;has&quot;: case &quot;getAll&quot;: return (name) =&gt; { validateHeaderName(name); return URLSearchParams.prototype[p].call( target, String(name).toLowerCase() ); }; case &quot;keys&quot;: return () =&gt; { target.sort(); return new Set(URLSearchParams.prototype.keys.call(target)).keys(); }; default: return Reflect.get(target, p, receiver); } } }); } get [Symbol.toStringTag]() { return this.constructor.name; } toString() { return Object.prototype.toString.call(this); } get(name) { const values = this.getAll(name); if (values.length === 0) { return null; } let value = values.join(&quot;, &quot;); if (/^content-encoding$/i.test(name)) { value = value.toLowerCase(); } return value; } forEach(callback, thisArg = void 0) { for (const name of this.keys()) { Reflect.apply(callback, thisArg, [this.get(name), name, this]); } } *values() { for (const name of this.keys()) { yield this.get(name); } } /** * @type {() =&gt; IterableIterator&lt;[string, string]&gt;} */ *entries() { for (const name of this.keys()) { yield [name, this.get(name)]; } } [Symbol.iterator]() { return this.entries(); } /** * Node-fetch non-spec method * returning all headers and their values as array * @returns {Record&lt;string, string[]&gt;} */ raw() { return [...this.keys()].reduce((result, key) =&gt; { result[key] = this.getAll(key); return result; }, {}); } /** * For better console.log(headers) and also to convert Headers into Node.js Request compatible format */ [Symbol.for(&quot;nodejs.util.inspect.custom&quot;)]() { return [...this.keys()].reduce((result, key) =&gt; { const values = this.getAll(key); if (key === &quot;host&quot;) { result[key] = values[0]; } else { result[key] = values.length &gt; 1 ? values : values[0]; } return result; }, {}); } }; Object.defineProperties( Headers.prototype, [&quot;get&quot;, &quot;entries&quot;, &quot;forEach&quot;, &quot;values&quot;].reduce((result, property) =&gt; { result[property] = { enumerable: true }; return result; }, {}) ); } }); // node_modules/node-fetch/src/utils/is-redirect.js var redirectStatus, isRedirect; var init_is_redirect = __esm({ &quot;node_modules/node-fetch/src/utils/is-redirect.js&quot;() { redirectStatus = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); isRedirect = (code) =&gt; { return redirectStatus.has(code); }; } }); // node_modules/node-fetch/src/response.js var INTERNALS2, Response; var init_response = __esm({ &quot;node_modules/node-fetch/src/response.js&quot;() { init_headers(); init_body(); init_is_redirect(); INTERNALS2 = Symbol(&quot;Response internals&quot;); Response = class _Response extends Body { constructor(body = null, options = {}) { super(body, options); const status = options.status != null ? options.status : 200; const headers = new Headers(options.headers); if (body !== null &amp;&amp; !headers.has(&quot;Content-Type&quot;)) { const contentType = extractContentType(body, this); if (contentType) { headers.append(&quot;Content-Type&quot;, contentType); } } this[INTERNALS2] = { type: &quot;default&quot;, url: options.url, status, statusText: options.statusText || &quot;&quot;, headers, counter: options.counter, highWaterMark: options.highWaterMark }; } get type() { return this[INTERNALS2].type; } get url() { return this[INTERNALS2].url || &quot;&quot;; } get status() { return this[INTERNALS2].status; } /** * Convenience property representing if the request ended normally */ get ok() { return this[INTERNALS2].status &gt;= 200 &amp;&amp; this[INTERNALS2].status &lt; 300; } get redirected() { return this[INTERNALS2].counter &gt; 0; } get statusText() { return this[INTERNALS2].statusText; } get headers() { return this[INTERNALS2].headers; } get highWaterMark() { return this[INTERNALS2].highWaterMark; } /** * Clone this response * * @return Response */ clone() { return new _Response(clone(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark }); } /** * @param {string} url The URL that the new response is to originate from. * @param {number} status An optional status code for the response (e.g., 302.) * @returns {Response} A Response object. */ static redirect(url, status = 302) { if (!isRedirect(status)) { throw new RangeError(&#x27;Failed to execute &quot;redirect&quot; on &quot;response&quot;: Invalid status code&#x27;); } return new _Response(null, { headers: { location: new URL(url).toString() }, status }); } static error() { const response = new _Response(null, { status: 0, statusText: &quot;&quot; }); response[INTERNALS2].type = &quot;error&quot;; return response; } static json(data = void 0, init = {}) { const body = JSON.stringify(data); if (body === void 0) { throw new TypeError(&quot;data is not JSON serializable&quot;); } const headers = new Headers(init &amp;&amp; init.headers); if (!headers.has(&quot;content-type&quot;)) { headers.set(&quot;content-type&quot;, &quot;application/json&quot;); } return new _Response(body, { ...init, headers }); } get [Symbol.toStringTag]() { return &quot;Response&quot;; } }; Object.defineProperties(Response.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); } }); // node_modules/node-fetch/src/utils/get-search.js var getSearch; var init_get_search = __esm({ &quot;node_modules/node-fetch/src/utils/get-search.js&quot;() { getSearch = (parsedURL) =&gt; { if (parsedURL.search) { return parsedURL.search; } const lastOffset = parsedURL.href.length - 1; const hash = parsedURL.hash || (parsedURL.href[lastOffset] === &quot;#&quot; ? &quot;#&quot; : &quot;&quot;); return parsedURL.href[lastOffset - hash.length] === &quot;?&quot; ? &quot;?&quot; : &quot;&quot;; }; } }); // node_modules/node-fetch/src/utils/referrer.js function stripURLForUseAsAReferrer(url, originOnly = false) { if (url == null) { return &quot;no-referrer&quot;; } url = new URL(url); if (/^(about|blob|data):$/.test(url.protocol)) { return &quot;no-referrer&quot;; } url.username = &quot;&quot;; url.password = &quot;&quot;; url.hash = &quot;&quot;; if (originOnly) { url.pathname = &quot;&quot;; url.search = &quot;&quot;; } return url; } function validateReferrerPolicy(referrerPolicy) { if (!ReferrerPolicy.has(referrerPolicy)) { throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`); } return referrerPolicy; } function isOriginPotentiallyTrustworthy(url) { if (/^(http|ws)s:$/.test(url.protocol)) { return true; } const hostIp = url.host.replace(/(^\[)|(]$)/g, &quot;&quot;); const hostIPVersion = (0, import_node_net.isIP)(hostIp); if (hostIPVersion === 4 &amp;&amp; /^127\./.test(hostIp)) { return true; } if (hostIPVersion === 6 &amp;&amp; /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) { return true; } if (url.host === &quot;localhost&quot; || url.host.endsWith(&quot;.localhost&quot;)) { return false; } if (url.protocol === &quot;file:&quot;) { return true; } return false; } function isUrlPotentiallyTrustworthy(url) { if (/^about:(blank|srcdoc)$/.test(url)) { return true; } if (url.protocol === &quot;data:&quot;) { return true; } if (/^(blob|filesystem):$/.test(url.protocol)) { return true; } return isOriginPotentiallyTrustworthy(url); } function determineRequestsReferrer(request, { referrerURLCallback, referrerOriginCallback } = {}) { if (request.referrer === &quot;no-referrer&quot; || request.referrerPolicy === &quot;&quot;) { return null; } const policy = request.referrerPolicy; if (request.referrer === &quot;about:client&quot;) { return &quot;no-referrer&quot;; } const referrerSource = request.referrer; let referrerURL = stripURLForUseAsAReferrer(referrerSource); let referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true); if (referrerURL.toString().length &gt; 4096) { referrerURL = referrerOrigin; } if (referrerURLCallback) { referrerURL = referrerURLCallback(referrerURL); } if (referrerOriginCallback) { referrerOrigin = referrerOriginCallback(referrerOrigin); } const currentURL = new URL(request.url); switch (policy) { case &quot;no-referrer&quot;: return &quot;no-referrer&quot;; case &quot;origin&quot;: return referrerOrigin; case &quot;unsafe-url&quot;: return referrerURL; case &quot;strict-origin&quot;: if (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) { return &quot;no-referrer&quot;; } return referrerOrigin.toString(); case &quot;strict-origin-when-cross-origin&quot;: if (referrerURL.origin === currentURL.origin) { return referrerURL; } if (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) { return &quot;no-referrer&quot;; } return referrerOrigin; case &quot;same-origin&quot;: if (referrerURL.origin === currentURL.origin) { return referrerURL; } return &quot;no-referrer&quot;; case &quot;origin-when-cross-origin&quot;: if (referrerURL.origin === currentURL.origin) { return referrerURL; } return referrerOrigin; case &quot;no-referrer-when-downgrade&quot;: if (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) { return &quot;no-referrer&quot;; } return referrerURL; default: throw new TypeError(`Invalid referrerPolicy: ${policy}`); } } function parseReferrerPolicyFromHeader(headers) { const policyTokens = (headers.get(&quot;referrer-policy&quot;) || &quot;&quot;).split(/[,\s]+/); let policy = &quot;&quot;; for (const token of policyTokens) { if (token &amp;&amp; ReferrerPolicy.has(token)) { policy = token; } } return policy; } var import_node_net, ReferrerPolicy, DEFAULT_REFERRER_POLICY; var init_referrer = __esm({ &quot;node_modules/node-fetch/src/utils/referrer.js&quot;() { import_node_net = require(&quot;net&quot;); ReferrerPolicy = /* @__PURE__ */ new Set([ &quot;&quot;, &quot;no-referrer&quot;, &quot;no-referrer-when-downgrade&quot;, &quot;same-origin&quot;, &quot;origin&quot;, &quot;strict-origin&quot;, &quot;origin-when-cross-origin&quot;, &quot;strict-origin-when-cross-origin&quot;, &quot;unsafe-url&quot; ]); DEFAULT_REFERRER_POLICY = &quot;strict-origin-when-cross-origin&quot;; } }); // node_modules/node-fetch/src/request.js var import_node_url, import_node_util3, INTERNALS3, isRequest, doBadDataWarn, Request, getNodeRequestOptions; var init_request = __esm({ &quot;node_modules/node-fetch/src/request.js&quot;() { import_node_url = require(&quot;url&quot;); import_node_util3 = require(&quot;util&quot;); init_headers(); init_body(); init_is(); init_get_search(); init_referrer(); INTERNALS3 = Symbol(&quot;Request internals&quot;); isRequest = (object) =&gt; { return typeof object === &quot;object&quot; &amp;&amp; typeof object[INTERNALS3] === &quot;object&quot;; }; doBadDataWarn = (0, import_node_util3.deprecate)( () =&gt; { }, &quot;.data is not a valid RequestInit property, use .body instead&quot;, &quot;https://github.com/node-fetch/node-fetch/issues/1000 (request)&quot; ); Request = class _Request extends Body { constructor(input, init = {}) { let parsedURL; if (isRequest(input)) { parsedURL = new URL(input.url); } else { parsedURL = new URL(input); input = {}; } if (parsedURL.username !== &quot;&quot; || parsedURL.password !== &quot;&quot;) { throw new TypeError(`${parsedURL} is an url with embedded credentials.`); } let method = init.method || input.method || &quot;GET&quot;; if (/^(delete|get|head|options|post|put)$/i.test(method)) { method = method.toUpperCase(); } if (!isRequest(init) &amp;&amp; &quot;data&quot; in init) { doBadDataWarn(); } if ((init.body != null || isRequest(input) &amp;&amp; input.body !== null) &amp;&amp; (method === &quot;GET&quot; || method === &quot;HEAD&quot;)) { throw new TypeError(&quot;Request with GET/HEAD method cannot have body&quot;); } const inputBody = init.body ? init.body : isRequest(input) &amp;&amp; input.body !== null ? clone(input) : null; super(inputBody, { size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody !== null &amp;&amp; !headers.has(&quot;Content-Type&quot;)) { const contentType = extractContentType(inputBody, this); if (contentType) { headers.set(&quot;Content-Type&quot;, contentType); } } let signal = isRequest(input) ? input.signal : null; if (&quot;signal&quot; in init) { signal = init.signal; } if (signal != null &amp;&amp; !isAbortSignal(signal)) { throw new TypeError(&quot;Expected signal to be an instanceof AbortSignal or EventTarget&quot;); } let referrer = init.referrer == null ? input.referrer : init.referrer; if (referrer === &quot;&quot;) { referrer = &quot;no-referrer&quot;; } else if (referrer) { const parsedReferrer = new URL(referrer); referrer = /^about:(\/\/)?client$/.test(parsedReferrer) ? &quot;client&quot; : parsedReferrer; } else { referrer = void 0; } this[INTERNALS3] = { method, redirect: init.redirect || input.redirect || &quot;follow&quot;, headers, parsedURL, signal, referrer }; this.follow = init.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init.follow; this.compress = init.compress === void 0 ? input.compress === void 0 ? true : input.compress : init.compress; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; this.highWaterMark = init.highWaterMark || input.highWaterMark || 16384; this.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false; this.referrerPolicy = init.referrerPolicy || input.referrerPolicy || &quot;&quot;; } /** @returns {string} */ get method() { return this[INTERNALS3].method; } /** @returns {string} */ get url() { return (0, import_node_url.format)(this[INTERNALS3].parsedURL); } /** @returns {Headers} */ get headers() { return this[INTERNALS3].headers; } get redirect() { return this[INTERNALS3].redirect; } /** @returns {AbortSignal} */ get signal() { return this[INTERNALS3].signal; } // https://fetch.spec.whatwg.org/#dom-request-referrer get referrer() { if (this[INTERNALS3].referrer === &quot;no-referrer&quot;) { return &quot;&quot;; } if (this[INTERNALS3].referrer === &quot;client&quot;) { return &quot;about:client&quot;; } if (this[INTERNALS3].referrer) { return this[INTERNALS3].referrer.toString(); } return void 0; } get referrerPolicy() { return this[INTERNALS3].referrerPolicy; } set referrerPolicy(referrerPolicy) { this[INTERNALS3].referrerPolicy = validateReferrerPolicy(referrerPolicy); } /** * Clone this request * * @return Request */ clone() { return new _Request(this); } get [Symbol.toStringTag]() { return &quot;Request&quot;; } }; Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } }); getNodeRequestOptions = (request) =&gt; { const { parsedURL } = request[INTERNALS3]; const headers = new Headers(request[INTERNALS3].headers); if (!headers.has(&quot;Accept&quot;)) { headers.set(&quot;Accept&quot;, &quot;*/*&quot;); } let contentLengthValue = null; if (request.body === null &amp;&amp; /^(post|put)$/i.test(request.method)) { contentLengthValue = &quot;0&quot;; } if (request.body !== null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === &quot;number&quot; &amp;&amp; !Number.isNaN(totalBytes)) { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set(&quot;Content-Length&quot;, contentLengthValue); } if (request.referrerPolicy === &quot;&quot;) { request.referrerPolicy = DEFAULT_REFERRER_POLICY; } if (request.referrer &amp;&amp; request.referrer !== &quot;no-referrer&quot;) { request[INTERNALS3].referrer = determineRequestsReferrer(request); } else { request[INTERNALS3].referrer = &quot;no-referrer&quot;; } if (request[INTERNALS3].referrer instanceof URL) { headers.set(&quot;Referer&quot;, request.referrer); } if (!headers.has(&quot;User-Agent&quot;)) { headers.set(&quot;User-Agent&quot;, &quot;node-fetch&quot;); } if (request.compress &amp;&amp; !headers.has(&quot;Accept-Encoding&quot;)) { headers.set(&quot;Accept-Encoding&quot;, &quot;gzip, deflate, br&quot;); } let { agent } = request; if (typeof agent === &quot;function&quot;) { agent = agent(parsedURL); } const search = getSearch(parsedURL); const options = { // Overwrite search to retain trailing ? (issue #776) path: parsedURL.pathname + search, // The following options are not expressed in the URL method: request.method, headers: headers[Symbol.for(&quot;nodejs.util.inspect.custom&quot;)](), insecureHTTPParser: request.insecureHTTPParser, agent }; return { /** @type {URL} */ parsedURL, options }; }; } }); // node_modules/node-fetch/src/errors/abort-error.js var AbortError; var init_abort_error = __esm({ &quot;node_modules/node-fetch/src/errors/abort-error.js&quot;() { init_base(); AbortError = class extends FetchBaseError { constructor(message, type = &quot;aborted&quot;) { super(message, type); } }; } }); // node_modules/node-fetch/src/index.js var src_exports = {}; __export(src_exports, { AbortError: () =&gt; AbortError, Blob: () =&gt; fetch_blob_default, FetchError: () =&gt; FetchError, File: () =&gt; file_default, FormData: () =&gt; FormData, Headers: () =&gt; Headers, Request: () =&gt; Request, Response: () =&gt; Response, blobFrom: () =&gt; blobFrom, blobFromSync: () =&gt; blobFromSync, default: () =&gt; fetch, fileFrom: () =&gt; fileFrom, fileFromSync: () =&gt; fileFromSync, isRedirect: () =&gt; isRedirect }); async function fetch(url, options_) { return new Promise((resolve, reject) =&gt; { const request = new Request(url, options_); const { parsedURL, options } = getNodeRequestOptions(request); if (!supportedSchemas.has(parsedURL.protocol)) { throw new TypeError(`node-fetch cannot load ${url}. URL scheme &quot;${parsedURL.protocol.replace(/:$/, &quot;&quot;)}&quot; is not supported.`); } if (parsedURL.protocol === &quot;data:&quot;) { const data = dist_default(request.url); const response2 = new Response(data, { headers: { &quot;Content-Type&quot;: data.typeFull } }); resolve(response2); return; } const send = (parsedURL.protocol === &quot;https:&quot; ? import_node_https.default : import_node_http2.default).request; const { signal } = request; let response = null; const abort = () =&gt; { const error = new AbortError(&quot;The operation was aborted.&quot;); reject(error); if (request.body &amp;&amp; request.body instanceof import_node_stream2.default.Readable) { request.body.destroy(error); } if (!response || !response.body) { return; } response.body.emit(&quot;error&quot;, error); }; if (signal &amp;&amp; signal.aborted) { abort(); return; } const abortAndFinalize = () =&gt; { abort(); finalize(); }; const request_ = send(parsedURL.toString(), options); if (signal) { signal.addEventListener(&quot;abort&quot;, abortAndFinalize); } const finalize = () =&gt; { request_.abort(); if (signal) { signal.removeEventListener(&quot;abort&quot;, abortAndFinalize); } }; request_.on(&quot;error&quot;, (error) =&gt; { reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, &quot;system&quot;, error)); finalize(); }); fixResponseChunkedTransferBadEnding(request_, (error) =&gt; { if (response &amp;&amp; response.body) { response.body.destroy(error); } }); if (process.version &lt; &quot;v14&quot;) { request_.on(&quot;socket&quot;, (s2) =&gt; { let endedWithEventsCount; s2.prependListener(&quot;end&quot;, () =&gt; { endedWithEventsCount = s2._eventsCount; }); s2.prependListener(&quot;close&quot;, (hadError) =&gt; { if (response &amp;&amp; endedWithEventsCount &lt; s2._eventsCount &amp;&amp; !hadError) { const error = new Error(&quot;Premature close&quot;); error.code = &quot;ERR_STREAM_PREMATURE_CLOSE&quot;; response.body.emit(&quot;error&quot;, error); } }); }); } request_.on(&quot;response&quot;, (response_) =&gt; { request_.setTimeout(0); const headers = fromRawHeaders(response_.rawHeaders); if (isRedirect(response_.statusCode)) { const location = headers.get(&quot;Location&quot;); let locationURL = null; try { locationURL = location === null ? null : new URL(location, request.url); } catch { if (request.redirect !== &quot;manual&quot;) { reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, &quot;invalid-redirect&quot;)); finalize(); return; } } switch (request.redirect) { case &quot;error&quot;: reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, &quot;no-redirect&quot;)); finalize(); return; case &quot;manual&quot;: break; case &quot;follow&quot;: { if (locationURL === null) { break; } if (request.counter &gt;= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, &quot;max-redirect&quot;)); finalize(); return; } const requestOptions = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: clone(request), signal: request.signal, size: request.size, referrer: request.referrer, referrerPolicy: request.referrerPolicy }; if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { for (const name of [&quot;authorization&quot;, &quot;www-authenticate&quot;, &quot;cookie&quot;, &quot;cookie2&quot;]) { requestOptions.headers.delete(name); } } if (response_.statusCode !== 303 &amp;&amp; request.body &amp;&amp; options_.body instanceof import_node_stream2.default.Readable) { reject(new FetchError(&quot;Cannot follow redirect with body being a readable stream&quot;, &quot;unsupported-redirect&quot;)); finalize(); return; } if (response_.statusCode === 303 || (response_.statusCode === 301 || response_.statusCode === 302) &amp;&amp; request.method === &quot;POST&quot;) { requestOptions.method = &quot;GET&quot;; requestOptions.body = void 0; requestOptions.headers.delete(&quot;content-length&quot;); } const responseReferrerPolicy = parseReferrerPolicyFromHeader(headers); if (responseReferrerPolicy) { requestOptions.referrerPolicy = responseReferrerPolicy; } resolve(fetch(new Request(locationURL, requestOptions))); finalize(); return; } default: return reject(new TypeError(`Redirect option &#x27;${request.redirect}&#x27; is not a valid value of RequestRedirect`)); } } if (signal) { response_.once(&quot;end&quot;, () =&gt; { signal.removeEventListener(&quot;abort&quot;, abortAndFinalize); }); } let body = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) =&gt; { if (error) { reject(error); } }); if (process.version &lt; &quot;v12.10&quot;) { response_.on(&quot;aborted&quot;, abortAndFinalize); } const responseOptions = { url: request.url, status: response_.statusCode, statusText: response_.statusMessage, headers, size: request.size, counter: request.counter, highWaterMark: request.highWaterMark }; const codings = headers.get(&quot;Content-Encoding&quot;); if (!request.compress || request.method === &quot;HEAD&quot; || codings === null || response_.statusCode === 204 || response_.statusCode === 304) { response = new Response(body, responseOptions); resolve(response); return; } const zlibOptions = { flush: import_node_zlib.default.Z_SYNC_FLUSH, finishFlush: import_node_zlib.default.Z_SYNC_FLUSH }; if (codings === &quot;gzip&quot; || codings === &quot;x-gzip&quot;) { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createGunzip(zlibOptions), (error) =&gt; { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } if (codings === &quot;deflate&quot; || codings === &quot;x-deflate&quot;) { const raw = (0, import_node_stream2.pipeline)(response_, new import_node_stream2.PassThrough(), (error) =&gt; { if (error) { reject(error); } }); raw.once(&quot;data&quot;, (chunk) =&gt; { if ((chunk[0] &amp; 15) === 8) { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflate(), (error) =&gt; { if (error) { reject(error); } }); } else { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createInflateRaw(), (error) =&gt; { if (error) { reject(error); } }); } response = new Response(body, responseOptions); resolve(response); }); raw.once(&quot;end&quot;, () =&gt; { if (!response) { response = new Response(body, responseOptions); resolve(response); } }); return; } if (codings === &quot;br&quot;) { body = (0, import_node_stream2.pipeline)(body, import_node_zlib.default.createBrotliDecompress(), (error) =&gt; { if (error) { reject(error); } }); response = new Response(body, responseOptions); resolve(response); return; } response = new Response(body, responseOptions); resolve(response); }); writeToStream(request_, request).catch(reject); }); } function fixResponseChunkedTransferBadEnding(request, errorCallback) { const LAST_CHUNK = import_node_buffer2.Buffer.from(&quot;0\r\n\r\n&quot;); let isChunkedTransfer = false; let properLastChunkReceived = false; let previousChunk; request.on(&quot;response&quot;, (response) =&gt; { const { headers } = response; isChunkedTransfer = headers[&quot;transfer-encoding&quot;] === &quot;chunked&quot; &amp;&amp; !headers[&quot;content-length&quot;]; }); request.on(&quot;socket&quot;, (socket) =&gt; { const onSocketClose = () =&gt; { if (isChunkedTransfer &amp;&amp; !properLastChunkReceived) { const error = new Error(&quot;Premature close&quot;); error.code = &quot;ERR_STREAM_PREMATURE_CLOSE&quot;; errorCallback(error); } }; const onData = (buf) =&gt; { properLastChunkReceived = import_node_buffer2.Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0; if (!properLastChunkReceived &amp;&amp; previousChunk) { properLastChunkReceived = import_node_buffer2.Buffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &amp;&amp; import_node_buffer2.Buffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0; } previousChunk = buf; }; socket.prependListener(&quot;close&quot;, onSocketClose); socket.on(&quot;data&quot;, onData); request.on(&quot;close&quot;, () =&gt; { socket.removeListener(&quot;close&quot;, onSocketClose); socket.removeListener(&quot;data&quot;, onData); }); }); } var import_node_http2, import_node_https, import_node_zlib, import_node_stream2, import_node_buffer2, supportedSchemas; var init_src = __esm({ &quot;node_modules/node-fetch/src/index.js&quot;() { import_node_http2 = __toESM(require(&quot;http&quot;), 1); import_node_https = __toESM(require(&quot;https&quot;), 1); import_node_zlib = __toESM(require(&quot;zlib&quot;), 1); import_node_stream2 = __toESM(require(&quot;stream&quot;), 1); import_node_buffer2 = require(&quot;buffer&quot;); init_dist(); init_body(); init_response(); init_headers(); init_request(); init_fetch_error(); init_abort_error(); init_is_redirect(); init_esm_min(); init_is(); init_referrer(); init_from(); supportedSchemas = /* @__PURE__ */ new Set([&quot;data:&quot;, &quot;http:&quot;, &quot;https:&quot;]); } }); // netlify/functions/lightx-proxy.js function getSecureEnvVar(key, required = true) { const value = process.env[key]; if (!value || value.trim() === &quot;&quot;) { if (required) { console.error(`Required environment variable ${key} is missing or empty`); return null; } console.warn(`Optional environment variable ${key} is not set`); return null; } if (key.includes(&quot;API_KEY&quot;) &amp;&amp; value.length &lt; 10) { console.error(`Environment variable ${key} appears to be invalid (too short)`); return null; } return value.trim(); } function createErrorResponse(statusCode, message, details = null) { const response = { statusCode, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;POST, OPTIONS&quot; }, body: JSON.stringify({ error: message, ...details &amp;&amp; { details } }) }; console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : &quot;&quot;}`); return response; } exports.handler = async function(event, context) { const { default: fetch2 } = await Promise.resolve().then(() =&gt; (init_src(), src_exports)); if (event.httpMethod === &quot;OPTIONS&quot;) { return { statusCode: 200, headers: { &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;POST, OPTIONS&quot; }, body: &quot;&quot; }; } if (event.httpMethod !== &quot;POST&quot;) { return createErrorResponse(405, &quot;Method Not Allowed&quot;); } try { let requestBody; try { requestBody = JSON.parse(event.body); } catch (parseError) { return createErrorResponse(400, &quot;Invalid JSON in request body&quot;, parseError.message); } const { endpoint, body } = requestBody; if (!endpoint) { return createErrorResponse(400, &quot;Missing endpoint parameter&quot;); } if (typeof endpoint !== &quot;string&quot; || endpoint.trim() === &quot;&quot;) { return createErrorResponse(400, &quot;Invalid endpoint parameter&quot;); } let lightxUrl; if (endpoint.startsWith(&quot;v1/&quot;)) { lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } else { lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } const apiKey = getSecureEnvVar(&quot;LIGHTX_API_KEY&quot;, true); if (!apiKey) { return createErrorResponse(500, &quot;API key not configured or invalid&quot;); } const isDevelopment = getSecureEnvVar(&quot;NODE_ENV&quot;, false) !== &quot;production&quot;; if (isDevelopment) { console.log(`Making request to: ${lightxUrl}`); console.log(`Request body keys: ${Object.keys(body || {}).join(&quot;, &quot;)}`); console.log(`API key present: Yes`); } if (body &amp;&amp; typeof body !== &quot;object&quot;) { return createErrorResponse(400, &quot;Request body must be an object&quot;); } const controller = new AbortController(); const timeoutId = setTimeout(() =&gt; controller.abort(), 3e4); let response; try { response = await fetch2(lightxUrl, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;x-api-key&quot;: apiKey, &quot;User-Agent&quot;: &quot;ModernPhotoTools/1.0&quot; }, body: JSON.stringify(body || {}), signal: controller.signal }); } catch (fetchError) { clearTimeout(timeoutId); if (fetchError.name === &quot;AbortError&quot;) { return createErrorResponse(408, &quot;Request timeout&quot;); } return createErrorResponse(502, &quot;Failed to connect to LightX API&quot;, fetchError.message); } finally { clearTimeout(timeoutId); } if (isDevelopment) { console.log(`Response status: ${response.status}`); console.log(`Response status text: ${response.statusText}`); } let data; try { data = await response.json(); } catch (jsonError) { return createErrorResponse(502, &quot;Invalid JSON response from LightX API&quot;, jsonError.message); } return { statusCode: response.status, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;POST, OPTIONS&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store, must-revalidate&quot; }, body: JSON.stringify(data) }; } catch (error) { console.error(&quot;Function error:&quot;, { message: error.message, stack: error.stack, name: error.name }); return createErrorResponse(500, &quot;Internal server error&quot;, error.message); } }; /*! Bundled license information: web-streams-polyfill/dist/ponyfill.es2018.js: (** * @license * web-streams-polyfill v3.3.3 * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors. * This code is released under the MIT license. * SPDX-License-Identifier: MIT *) fetch-blob/index.js: (*! fetch-blob. MIT License. Jimmy Wรคrting &lt;https://jimmy.warting.se/opensource&gt; *) formdata-polyfill/esm.min.js: (*! formdata-polyfill. MIT License. Jimmy Wรคrting &lt;https://jimmy.warting.se/opensource&gt; *) node-domexception/index.js: (*! node-domexception. MIT License. Jimmy Wรคrting &lt;https://jimmy.warting.se/opensource&gt; *) */ //# sourceMappingURL=lightx-proxy.js.map </div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ lightx-proxy.js.map</div> <div class="content">{ &quot;version&quot;: 3, &quot;sources&quot;: [&quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/data-uri-to-buffer/src/index.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/utils.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/miscellaneous.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/webidl.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/simple-queue.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/internal-methods.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/generic-reader.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/number-isfinite.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/math-trunc.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/basic.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/readable-stream.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/default-reader.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/target/es2018/stub/async-iterator-prototype.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/async-iterator.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/number-isnan.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/ecmascript.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/miscellaneous.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/queue-with-sizes.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/helpers/array-buffer-view.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/byte-stream-controller.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/reader-options.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/byob-reader.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abstract-ops/queuing-strategy.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/queuing-strategy.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/underlying-sink.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/writable-stream.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/abort-signal.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/writable-stream.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/globals.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/stub/dom-exception.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/pipe.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/default-controller.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/tee.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/readable-stream-like.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream/from.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/underlying-source.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/iterator-options.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/pipe-options.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/readable-writable-pair.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/readable-stream.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/queuing-strategy-init.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/byte-length-queuing-strategy.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/count-queuing-strategy.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/validators/transformer.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/web-streams-polyfill/src/lib/transform-stream.ts&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/streams.cjs&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/index.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/file.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/formdata-polyfill/esm.min.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/base.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/fetch-error.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/is.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-domexception/index.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/fetch-blob/from.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/multipart-parser.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/body.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/headers.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/is-redirect.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/response.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/get-search.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/utils/referrer.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/request.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/errors/abort-error.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/node_modules/node-fetch/src/index.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/lightx-proxy.js&quot;], &quot;sourceRoot&quot;: &quot;C:/Users/6732~1/AppData/Local/Temp/tmp-13180-I7XYTRQAtEV7&quot;, &quot;sourcesContent&quot;: [&quot;export interface MimeBuffer extends Buffer {\n\ttype: string;\n\ttypeFull: string;\n\tcharset: string;\n}\n\n/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @returns {Buffer} Buffer instance from Data URI\n * @api public\n */\nexport function dataUriToBuffer(uri: string): MimeBuffer {\n\tif (!/^data:/i.test(uri)) {\n\t\tthrow new TypeError(\n\t\t\t&#x27;`uri` does not appear to be a Data URI (must begin with \&quot;data:\&quot;)&#x27;\n\t\t);\n\t}\n\n\t// strip newlines\n\turi = uri.replace(/\\r?\\n/g, &#x27;&#x27;);\n\n\t// split the URI up into the \&quot;metadata\&quot; and the \&quot;data\&quot; portions\n\tconst firstComma = uri.indexOf(&#x27;,&#x27;);\n\tif (firstComma === -1 || firstComma &lt;= 4) {\n\t\tthrow new TypeError(&#x27;malformed data: URI&#x27;);\n\t}\n\n\t// remove the \&quot;data:\&quot; scheme and parse the metadata\n\tconst meta = uri.substring(5, firstComma).split(&#x27;;&#x27;);\n\n\tlet charset = &#x27;&#x27;;\n\tlet base64 = false;\n\tconst type = meta[0] || &#x27;text/plain&#x27;;\n\tlet typeFull = type;\n\tfor (let i = 1; i &lt; meta.length; i++) {\n\t\tif (meta[i] === &#x27;base64&#x27;) {\n\t\t\tbase64 = true;\n\t\t} else if(meta[i]) {\n\t\t\ttypeFull += `;${ meta[i]}`;\n\t\t\tif (meta[i].indexOf(&#x27;charset=&#x27;) === 0) {\n\t\t\t\tcharset = meta[i].substring(8);\n\t\t\t}\n\t\t}\n\t}\n\t// defaults to US-ASCII only if type is not provided\n\tif (!meta[0] &amp;&amp; !charset.length) {\n\t\ttypeFull += &#x27;;charset=US-ASCII&#x27;;\n\t\tcharset = &#x27;US-ASCII&#x27;;\n\t}\n\n\t// get the encoded data portion and decode URI-encoded chars\n\tconst encoding = base64 ? &#x27;base64&#x27; : &#x27;ascii&#x27;;\n\tconst data = unescape(uri.substring(firstComma + 1));\n\tconst buffer = Buffer.from(data, encoding) as MimeBuffer;\n\n\t// set `.type` and `.typeFull` properties to MIME type\n\tbuffer.type = type;\n\tbuffer.typeFull = typeFull;\n\n\t// set the `.charset` property\n\tbuffer.charset = charset;\n\n\treturn buffer;\n}\n\nexport default dataUriToBuffer;\n&quot;, &quot;export function noop(): undefined {\n return undefined;\n}\n&quot;, &quot;import { noop } from &#x27;../../utils&#x27;;\nimport { AssertionError } from &#x27;../../stub/assert&#x27;;\n\nexport function typeIsObject(x: any): x is object {\n return (typeof x === &#x27;object&#x27; &amp;&amp; x !== null) || typeof x === &#x27;function&#x27;;\n}\n\nexport const rethrowAssertionErrorRejection: (e: any) =&gt; void =\n DEBUG ? e =&gt; {\n // Used throughout the reference implementation, as `.catch(rethrowAssertionErrorRejection)`, to ensure any errors\n // get shown. There are places in the spec where we do promise transformations and purposefully ignore or don&#x27;t\n // expect any errors, but assertion errors are always problematic.\n if (e &amp;&amp; e instanceof AssertionError) {\n setTimeout(() =&gt; {\n throw e;\n }, 0);\n }\n } : noop;\n\nexport function setFunctionName(fn: Function, name: string): void {\n try {\n Object.defineProperty(fn, &#x27;name&#x27;, {\n value: name,\n configurable: true\n });\n } catch {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n}\n&quot;, &quot;import { rethrowAssertionErrorRejection } from &#x27;./miscellaneous&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\n\nconst originalPromise = Promise;\nconst originalPromiseThen = Promise.prototype.then;\nconst originalPromiseReject = Promise.reject.bind(originalPromise);\n\n// https://webidl.spec.whatwg.org/#a-new-promise\nexport function newPromise&lt;T&gt;(executor: (\n resolve: (value: T | PromiseLike&lt;T&gt;) =&gt; void,\n reject: (reason?: any) =&gt; void\n) =&gt; void): Promise&lt;T&gt; {\n return new originalPromise(executor);\n}\n\n// https://webidl.spec.whatwg.org/#a-promise-resolved-with\nexport function promiseResolvedWith&lt;T&gt;(value: T | PromiseLike&lt;T&gt;): Promise&lt;T&gt; {\n return newPromise(resolve =&gt; resolve(value));\n}\n\n// https://webidl.spec.whatwg.org/#a-promise-rejected-with\nexport function promiseRejectedWith&lt;T = never&gt;(reason: any): Promise&lt;T&gt; {\n return originalPromiseReject(reason);\n}\n\nexport function PerformPromiseThen&lt;T, TResult1 = T, TResult2 = never&gt;(\n promise: Promise&lt;T&gt;,\n onFulfilled?: (value: T) =&gt; TResult1 | PromiseLike&lt;TResult1&gt;,\n onRejected?: (reason: any) =&gt; TResult2 | PromiseLike&lt;TResult2&gt;): Promise&lt;TResult1 | TResult2&gt; {\n // There doesn&#x27;t appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected) as Promise&lt;TResult1 | TResult2&gt;;\n}\n\n// Bluebird logs a warning when a promise is created within a fulfillment handler, but then isn&#x27;t returned\n// from that handler. To prevent this, return null instead of void from all handlers.\n// http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it\nexport function uponPromise&lt;T&gt;(\n promise: Promise&lt;T&gt;,\n onFulfilled?: (value: T) =&gt; null | PromiseLike&lt;null&gt;,\n onRejected?: (reason: any) =&gt; null | PromiseLike&lt;null&gt;): void {\n PerformPromiseThen(\n PerformPromiseThen(promise, onFulfilled, onRejected),\n undefined,\n rethrowAssertionErrorRejection\n );\n}\n\nexport function uponFulfillment&lt;T&gt;(promise: Promise&lt;T&gt;, onFulfilled: (value: T) =&gt; null | PromiseLike&lt;null&gt;): void {\n uponPromise(promise, onFulfilled);\n}\n\nexport function uponRejection(promise: Promise&lt;unknown&gt;, onRejected: (reason: any) =&gt; null | PromiseLike&lt;null&gt;): void {\n uponPromise(promise, undefined, onRejected);\n}\n\nexport function transformPromiseWith&lt;T, TResult1 = T, TResult2 = never&gt;(\n promise: Promise&lt;T&gt;,\n fulfillmentHandler?: (value: T) =&gt; TResult1 | PromiseLike&lt;TResult1&gt;,\n rejectionHandler?: (reason: any) =&gt; TResult2 | PromiseLike&lt;TResult2&gt;): Promise&lt;TResult1 | TResult2&gt; {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n}\n\nexport function setPromiseIsHandledToTrue(promise: Promise&lt;unknown&gt;): void {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n}\n\nlet _queueMicrotask: (callback: () =&gt; void) =&gt; void = callback =&gt; {\n if (typeof queueMicrotask === &#x27;function&#x27;) {\n _queueMicrotask = queueMicrotask;\n } else {\n const resolvedPromise = promiseResolvedWith(undefined);\n _queueMicrotask = cb =&gt; PerformPromiseThen(resolvedPromise, cb);\n }\n return _queueMicrotask(callback);\n};\n\nexport { _queueMicrotask as queueMicrotask };\n\nexport function reflectCall&lt;T, A extends any[], R&gt;(F: (this: T, ...fnArgs: A) =&gt; R, V: T, args: A): R {\n if (typeof F !== &#x27;function&#x27;) {\n throw new TypeError(&#x27;Argument is not a function&#x27;);\n }\n return Function.prototype.apply.call(F, V, args);\n}\n\nexport function promiseCall&lt;T, A extends any[], R&gt;(F: (this: T, ...fnArgs: A) =&gt; R | PromiseLike&lt;R&gt;,\n V: T,\n args: A): Promise&lt;R&gt; {\n assert(typeof F === &#x27;function&#x27;);\n assert(V !== undefined);\n assert(Array.isArray(args));\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n } catch (value) {\n return promiseRejectedWith(value);\n }\n}\n&quot;, &quot;import assert from &#x27;../stub/assert&#x27;;\n\n// Original from Chromium\n// https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n\nconst QUEUE_MAX_ARRAY_SIZE = 16384;\n\ninterface Node&lt;T&gt; {\n _elements: T[];\n _next: Node&lt;T&gt; | undefined;\n}\n\n/**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\nexport class SimpleQueue&lt;T&gt; {\n private _front: Node&lt;T&gt;;\n private _back: Node&lt;T&gt;;\n private _cursor = 0;\n private _size = 0;\n\n constructor() {\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n\n get length(): number {\n return this._size;\n }\n\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n push(element: T): void {\n const oldBack = this._back;\n let newBack = oldBack;\n assert(oldBack._next === undefined);\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }\n\n // Like push(), shift() follows the read -&gt; calculate -&gt; mutate pattern for\n // exception safety.\n shift(): T {\n assert(this._size &gt; 0); // must not be called on an empty queue\n\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n assert(elements.length === QUEUE_MAX_ARRAY_SIZE);\n assert(oldFront._next !== undefined);\n newFront = oldFront._next!;\n newCursor = 0;\n }\n\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined!;\n\n return element;\n }\n\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \&quot;catch up\&quot; with elements that still\n // exist or reach the back of the queue.\n forEach(callback: (element: T) =&gt; void): void {\n let i = this._cursor;\n let node = this._front;\n let elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n assert(node._next !== undefined);\n assert(i === QUEUE_MAX_ARRAY_SIZE);\n node = node._next!;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }\n\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n peek(): T {\n assert(this._size &gt; 0); // must not be called on an empty queue\n\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }\n}\n&quot;, &quot;export const AbortSteps = Symbol(&#x27;[[AbortSteps]]&#x27;);\nexport const ErrorSteps = Symbol(&#x27;[[ErrorSteps]]&#x27;);\nexport const CancelSteps = Symbol(&#x27;[[CancelSteps]]&#x27;);\nexport const PullSteps = Symbol(&#x27;[[PullSteps]]&#x27;);\nexport const ReleaseSteps = Symbol(&#x27;[[ReleaseSteps]]&#x27;);\n&quot;, &quot;import assert from &#x27;../../stub/assert&#x27;;\nimport { ReadableStream, ReadableStreamCancel, type ReadableStreamReader } from &#x27;../readable-stream&#x27;;\nimport { newPromise, setPromiseIsHandledToTrue } from &#x27;../helpers/webidl&#x27;;\nimport { ReleaseSteps } from &#x27;../abstract-ops/internal-methods&#x27;;\n\nexport function ReadableStreamReaderGenericInitialize&lt;R&gt;(reader: ReadableStreamReader&lt;R&gt;, stream: ReadableStream&lt;R&gt;) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n\n if (stream._state === &#x27;readable&#x27;) {\n defaultReaderClosedPromiseInitialize(reader);\n } else if (stream._state === &#x27;closed&#x27;) {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n } else {\n assert(stream._state === &#x27;errored&#x27;);\n\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n}\n\n// A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n// check.\n\nexport function ReadableStreamReaderGenericCancel(reader: ReadableStreamReader&lt;any&gt;, reason: any): Promise&lt;undefined&gt; {\n const stream = reader._ownerReadableStream;\n assert(stream !== undefined);\n return ReadableStreamCancel(stream, reason);\n}\n\nexport function ReadableStreamReaderGenericRelease(reader: ReadableStreamReader&lt;any&gt;) {\n const stream = reader._ownerReadableStream;\n assert(stream !== undefined);\n assert(stream._reader === reader);\n\n if (stream._state === &#x27;readable&#x27;) {\n defaultReaderClosedPromiseReject(\n reader,\n new TypeError(`Reader was released and can no longer be used to monitor the stream&#x27;s closedness`));\n } else {\n defaultReaderClosedPromiseResetToRejected(\n reader,\n new TypeError(`Reader was released and can no longer be used to monitor the stream&#x27;s closedness`));\n }\n\n stream._readableStreamController[ReleaseSteps]();\n\n stream._reader = undefined;\n reader._ownerReadableStream = undefined!;\n}\n\n// Helper functions for the readers.\n\nexport function readerLockException(name: string): TypeError {\n return new TypeError(&#x27;Cannot &#x27; + name + &#x27; a stream using a released reader&#x27;);\n}\n\n// Helper functions for the ReadableStreamDefaultReader.\n\nexport function defaultReaderClosedPromiseInitialize(reader: ReadableStreamReader&lt;any&gt;) {\n reader._closedPromise = newPromise((resolve, reject) =&gt; {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n}\n\nexport function defaultReaderClosedPromiseInitializeAsRejected(reader: ReadableStreamReader&lt;any&gt;, reason: any) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n}\n\nexport function defaultReaderClosedPromiseInitializeAsResolved(reader: ReadableStreamReader&lt;any&gt;) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n}\n\nexport function defaultReaderClosedPromiseReject(reader: ReadableStreamReader&lt;any&gt;, reason: any) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\n\nexport function defaultReaderClosedPromiseResetToRejected(reader: ReadableStreamReader&lt;any&gt;, reason: any) {\n assert(reader._closedPromise_resolve === undefined);\n assert(reader._closedPromise_reject === undefined);\n\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n}\n\nexport function defaultReaderClosedPromiseResolve(reader: ReadableStreamReader&lt;any&gt;) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n}\n&quot;, &quot;/// &lt;reference lib=\&quot;es2015.core\&quot; /&gt;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\nconst NumberIsFinite: typeof Number.isFinite = Number.isFinite || function (x) {\n return typeof x === &#x27;number&#x27; &amp;&amp; isFinite(x);\n};\n\nexport default NumberIsFinite;\n&quot;, &quot;/// &lt;reference lib=\&quot;es2015.core\&quot; /&gt;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\nconst MathTrunc: typeof Math.trunc = Math.trunc || function (v) {\n return v &lt; 0 ? Math.ceil(v) : Math.floor(v);\n};\n\nexport default MathTrunc;\n&quot;, &quot;import NumberIsFinite from &#x27;../../stub/number-isfinite&#x27;;\nimport MathTrunc from &#x27;../../stub/math-trunc&#x27;;\n\n// https://heycam.github.io/webidl/#idl-dictionaries\nexport function isDictionary(x: any): x is object | null {\n return typeof x === &#x27;object&#x27; || typeof x === &#x27;function&#x27;;\n}\n\nexport function assertDictionary(obj: unknown,\n context: string): asserts obj is object | null | undefined {\n if (obj !== undefined &amp;&amp; !isDictionary(obj)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\n\nexport type AnyFunction = (...args: any[]) =&gt; any;\n\n// https://heycam.github.io/webidl/#idl-callback-functions\nexport function assertFunction(x: unknown, context: string): asserts x is AnyFunction {\n if (typeof x !== &#x27;function&#x27;) {\n throw new TypeError(`${context} is not a function.`);\n }\n}\n\n// https://heycam.github.io/webidl/#idl-object\nexport function isObject(x: any): x is object {\n return (typeof x === &#x27;object&#x27; &amp;&amp; x !== null) || typeof x === &#x27;function&#x27;;\n}\n\nexport function assertObject(x: unknown,\n context: string): asserts x is object {\n if (!isObject(x)) {\n throw new TypeError(`${context} is not an object.`);\n }\n}\n\nexport function assertRequiredArgument&lt;T&gt;(x: T | undefined,\n position: number,\n context: string): asserts x is T {\n if (x === undefined) {\n throw new TypeError(`Parameter ${position} is required in &#x27;${context}&#x27;.`);\n }\n}\n\nexport function assertRequiredField&lt;T&gt;(x: T | undefined,\n field: string,\n context: string): asserts x is T {\n if (x === undefined) {\n throw new TypeError(`${field} is required in &#x27;${context}&#x27;.`);\n }\n}\n\n// https://heycam.github.io/webidl/#idl-unrestricted-double\nexport function convertUnrestrictedDouble(value: unknown): number {\n return Number(value);\n}\n\nfunction censorNegativeZero(x: number): number {\n return x === 0 ? 0 : x;\n}\n\nfunction integerPart(x: number): number {\n return censorNegativeZero(MathTrunc(x));\n}\n\n// https://heycam.github.io/webidl/#idl-unsigned-long-long\nexport function convertUnsignedLongLongWithEnforceRange(value: unknown, context: string): number {\n const lowerBound = 0;\n const upperBound = Number.MAX_SAFE_INTEGER;\n\n let x = Number(value);\n x = censorNegativeZero(x);\n\n if (!NumberIsFinite(x)) {\n throw new TypeError(`${context} is not a finite number`);\n }\n\n x = integerPart(x);\n\n if (x &lt; lowerBound || x &gt; upperBound) {\n throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);\n }\n\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n\n return x;\n}\n&quot;, &quot;import { IsReadableStream, ReadableStream } from &#x27;../readable-stream&#x27;;\n\nexport function assertReadableStream(x: unknown, context: string): asserts x is ReadableStream {\n if (!IsReadableStream(x)) {\n throw new TypeError(`${context} is not a ReadableStream.`);\n }\n}\n&quot;, &quot;import assert from &#x27;../../stub/assert&#x27;;\nimport { SimpleQueue } from &#x27;../simple-queue&#x27;;\nimport {\n ReadableStreamReaderGenericCancel,\n ReadableStreamReaderGenericInitialize,\n ReadableStreamReaderGenericRelease,\n readerLockException\n} from &#x27;./generic-reader&#x27;;\nimport { IsReadableStreamLocked, ReadableStream } from &#x27;../readable-stream&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport { PullSteps } from &#x27;../abstract-ops/internal-methods&#x27;;\nimport { newPromise, promiseRejectedWith } from &#x27;../helpers/webidl&#x27;;\nimport { assertRequiredArgument } from &#x27;../validators/basic&#x27;;\nimport { assertReadableStream } from &#x27;../validators/readable-stream&#x27;;\n\n/**\n * A result returned by {@link ReadableStreamDefaultReader.read}.\n *\n * @public\n */\nexport type ReadableStreamDefaultReadResult&lt;T&gt; = {\n done: false;\n value: T;\n} | {\n done: true;\n value?: undefined;\n}\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamDefaultReader&lt;R&gt;(stream: ReadableStream): ReadableStreamDefaultReader&lt;R&gt; {\n return new ReadableStreamDefaultReader(stream);\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamAddReadRequest&lt;R&gt;(stream: ReadableStream&lt;R&gt;,\n readRequest: ReadRequest&lt;R&gt;): void {\n assert(IsReadableStreamDefaultReader(stream._reader));\n assert(stream._state === &#x27;readable&#x27;);\n\n (stream._reader! as ReadableStreamDefaultReader&lt;R&gt;)._readRequests.push(readRequest);\n}\n\nexport function ReadableStreamFulfillReadRequest&lt;R&gt;(stream: ReadableStream&lt;R&gt;, chunk: R | undefined, done: boolean) {\n const reader = stream._reader as ReadableStreamDefaultReader&lt;R&gt;;\n\n assert(reader._readRequests.length &gt; 0);\n\n const readRequest = reader._readRequests.shift()!;\n if (done) {\n readRequest._closeSteps();\n } else {\n readRequest._chunkSteps(chunk!);\n }\n}\n\nexport function ReadableStreamGetNumReadRequests&lt;R&gt;(stream: ReadableStream&lt;R&gt;): number {\n return (stream._reader as ReadableStreamDefaultReader&lt;R&gt;)._readRequests.length;\n}\n\nexport function ReadableStreamHasDefaultReader(stream: ReadableStream): boolean {\n const reader = stream._reader;\n\n if (reader === undefined) {\n return false;\n }\n\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n\n return true;\n}\n\n// Readers\n\nexport interface ReadRequest&lt;R&gt; {\n _chunkSteps(chunk: R): void;\n\n _closeSteps(): void;\n\n _errorSteps(e: any): void;\n}\n\n/**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nexport class ReadableStreamDefaultReader&lt;R = any&gt; {\n /** @internal */\n _ownerReadableStream!: ReadableStream&lt;R&gt;;\n /** @internal */\n _closedPromise!: Promise&lt;undefined&gt;;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) =&gt; void;\n /** @internal */\n _closedPromise_reject?: (reason: any) =&gt; void;\n /** @internal */\n _readRequests: SimpleQueue&lt;ReadRequest&lt;R&gt;&gt;;\n\n constructor(stream: ReadableStream&lt;R&gt;) {\n assertRequiredArgument(stream, 1, &#x27;ReadableStreamDefaultReader&#x27;);\n assertReadableStream(stream, &#x27;First parameter&#x27;);\n\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError(&#x27;This stream has already been locked for exclusive reading by another reader&#x27;);\n }\n\n ReadableStreamReaderGenericInitialize(this, stream);\n\n this._readRequests = new SimpleQueue();\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader&#x27;s lock is released before the stream finishes closing.\n */\n get closed(): Promise&lt;undefined&gt; {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException(&#x27;closed&#x27;));\n }\n\n return this._closedPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason: any = undefined): Promise&lt;void&gt; {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException(&#x27;cancel&#x27;));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException(&#x27;cancel&#x27;));\n }\n\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n\n /**\n * Returns a promise that allows access to the next chunk from the stream&#x27;s internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read(): Promise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt; {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException(&#x27;read&#x27;));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException(&#x27;read from&#x27;));\n }\n\n let resolvePromise!: (result: ReadableStreamDefaultReadResult&lt;R&gt;) =&gt; void;\n let rejectPromise!: (reason: any) =&gt; void;\n const promise = newPromise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt;((resolve, reject) =&gt; {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest: ReadRequest&lt;R&gt; = {\n _chunkSteps: chunk =&gt; resolvePromise({ value: chunk, done: false }),\n _closeSteps: () =&gt; resolvePromise({ value: undefined, done: true }),\n _errorSteps: e =&gt; rejectPromise(e)\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n }\n\n /**\n * Releases the reader&#x27;s lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader&#x27;s lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader&#x27;s {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock(): void {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException(&#x27;releaseLock&#x27;);\n }\n\n if (this._ownerReadableStream === undefined) {\n return;\n }\n\n ReadableStreamDefaultReaderRelease(this);\n }\n}\n\nObject.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nsetFunctionName(ReadableStreamDefaultReader.prototype.cancel, &#x27;cancel&#x27;);\nsetFunctionName(ReadableStreamDefaultReader.prototype.read, &#x27;read&#x27;);\nsetFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, &#x27;releaseLock&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableStreamDefaultReader&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations for the readers.\n\nexport function IsReadableStreamDefaultReader&lt;R = any&gt;(x: any): x is ReadableStreamDefaultReader&lt;R&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_readRequests&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableStreamDefaultReader;\n}\n\nexport function ReadableStreamDefaultReaderRead&lt;R&gt;(reader: ReadableStreamDefaultReader&lt;R&gt;,\n readRequest: ReadRequest&lt;R&gt;): void {\n const stream = reader._ownerReadableStream;\n\n assert(stream !== undefined);\n\n stream._disturbed = true;\n\n if (stream._state === &#x27;closed&#x27;) {\n readRequest._closeSteps();\n } else if (stream._state === &#x27;errored&#x27;) {\n readRequest._errorSteps(stream._storedError);\n } else {\n assert(stream._state === &#x27;readable&#x27;);\n stream._readableStreamController[PullSteps](readRequest as ReadRequest&lt;any&gt;);\n }\n}\n\nexport function ReadableStreamDefaultReaderRelease(reader: ReadableStreamDefaultReader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError(&#x27;Reader was released&#x27;);\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n}\n\nexport function ReadableStreamDefaultReaderErrorReadRequests(reader: ReadableStreamDefaultReader, e: any) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest =&gt; {\n readRequest._errorSteps(e);\n });\n}\n\n// Helper functions for the ReadableStreamDefaultReader.\n\nfunction defaultReaderBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);\n}\n&quot;, &quot;/// &lt;reference lib=\&quot;es2018.asynciterable\&quot; /&gt;\n\n/* eslint-disable @typescript-eslint/no-empty-function */\nexport const AsyncIteratorPrototype: AsyncIterable&lt;any&gt; =\n Object.getPrototypeOf(Object.getPrototypeOf(async function* (): AsyncIterableIterator&lt;any&gt; {}).prototype);\n&quot;, &quot;/// &lt;reference lib=\&quot;es2018.asynciterable\&quot; /&gt;\n\nimport { ReadableStream } from &#x27;../readable-stream&#x27;;\nimport {\n AcquireReadableStreamDefaultReader,\n ReadableStreamDefaultReader,\n ReadableStreamDefaultReaderRead,\n type ReadableStreamDefaultReadResult,\n type ReadRequest\n} from &#x27;./default-reader&#x27;;\nimport { ReadableStreamReaderGenericCancel, ReadableStreamReaderGenericRelease } from &#x27;./generic-reader&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\nimport { AsyncIteratorPrototype } from &#x27;@@target/stub/async-iterator-prototype&#x27;;\nimport { typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n queueMicrotask,\n transformPromiseWith\n} from &#x27;../helpers/webidl&#x27;;\n\n/**\n * An async iterator returned by {@link ReadableStream.values}.\n *\n * @public\n */\nexport interface ReadableStreamAsyncIterator&lt;R&gt; extends AsyncIterableIterator&lt;R&gt; {\n next(): Promise&lt;IteratorResult&lt;R, undefined&gt;&gt;;\n\n return(value?: any): Promise&lt;IteratorResult&lt;any&gt;&gt;;\n}\n\nexport class ReadableStreamAsyncIteratorImpl&lt;R&gt; {\n private readonly _reader: ReadableStreamDefaultReader&lt;R&gt;;\n private readonly _preventCancel: boolean;\n private _ongoingPromise: Promise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt; | undefined = undefined;\n private _isFinished = false;\n\n constructor(reader: ReadableStreamDefaultReader&lt;R&gt;, preventCancel: boolean) {\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n\n next(): Promise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt; {\n const nextSteps = () =&gt; this._nextSteps();\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n }\n\n return(value: any): Promise&lt;ReadableStreamDefaultReadResult&lt;any&gt;&gt; {\n const returnSteps = () =&gt; this._returnSteps(value);\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n }\n\n private _nextSteps(): Promise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt; {\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n\n const reader = this._reader;\n assert(reader._ownerReadableStream !== undefined);\n\n let resolvePromise!: (result: ReadableStreamDefaultReadResult&lt;R&gt;) =&gt; void;\n let rejectPromise!: (reason: any) =&gt; void;\n const promise = newPromise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt;((resolve, reject) =&gt; {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readRequest: ReadRequest&lt;R&gt; = {\n _chunkSteps: chunk =&gt; {\n this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n queueMicrotask(() =&gt; resolvePromise({ value: chunk, done: false }));\n },\n _closeSteps: () =&gt; {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: reason =&gt; {\n this._ongoingPromise = undefined;\n this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n }\n\n private _returnSteps(value: any): Promise&lt;ReadableStreamDefaultReadResult&lt;any&gt;&gt; {\n if (this._isFinished) {\n return Promise.resolve({ value, done: true });\n }\n this._isFinished = true;\n\n const reader = this._reader;\n assert(reader._ownerReadableStream !== undefined);\n assert(reader._readRequests.length === 0);\n\n if (!this._preventCancel) {\n const result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, () =&gt; ({ value, done: true }));\n }\n\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value, done: true });\n }\n}\n\ninterface ReadableStreamAsyncIteratorInstance&lt;R&gt; extends ReadableStreamAsyncIterator&lt;R&gt; {\n /** @interal */\n _asyncIteratorImpl: ReadableStreamAsyncIteratorImpl&lt;R&gt;;\n\n next(): Promise&lt;IteratorResult&lt;R, undefined&gt;&gt;;\n\n return(value?: any): Promise&lt;IteratorResult&lt;any&gt;&gt;;\n}\n\nconst ReadableStreamAsyncIteratorPrototype: ReadableStreamAsyncIteratorInstance&lt;any&gt; = {\n next(this: ReadableStreamAsyncIteratorInstance&lt;any&gt;): Promise&lt;ReadableStreamDefaultReadResult&lt;any&gt;&gt; {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException(&#x27;next&#x27;));\n }\n return this._asyncIteratorImpl.next();\n },\n\n return(this: ReadableStreamAsyncIteratorInstance&lt;any&gt;, value: any): Promise&lt;ReadableStreamDefaultReadResult&lt;any&gt;&gt; {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException(&#x27;return&#x27;));\n }\n return this._asyncIteratorImpl.return(value);\n }\n} as any;\nObject.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamAsyncIterator&lt;R&gt;(stream: ReadableStream&lt;R&gt;,\n preventCancel: boolean): ReadableStreamAsyncIterator&lt;R&gt; {\n const reader = AcquireReadableStreamDefaultReader&lt;R&gt;(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator: ReadableStreamAsyncIteratorInstance&lt;R&gt; = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n}\n\nfunction IsReadableStreamAsyncIterator&lt;R = any&gt;(x: any): x is ReadableStreamAsyncIterator&lt;R&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_asyncIteratorImpl&#x27;)) {\n return false;\n }\n\n try {\n // noinspection SuspiciousTypeOfGuard\n return (x as ReadableStreamAsyncIteratorInstance&lt;any&gt;)._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n } catch {\n return false;\n }\n}\n\n// Helper functions for the ReadableStream.\n\nfunction streamAsyncIteratorBrandCheckException(name: string): TypeError {\n return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);\n}\n&quot;, &quot;/// &lt;reference lib=\&quot;es2015.core\&quot; /&gt;\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\nconst NumberIsNaN: typeof Number.isNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n};\n\nexport default NumberIsNaN;\n&quot;, &quot;import { reflectCall } from &#x27;lib/helpers/webidl&#x27;;\nimport { typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\n\ndeclare global {\n interface ArrayBuffer {\n readonly detached: boolean;\n\n transfer(): ArrayBuffer;\n }\n\n function structuredClone&lt;T&gt;(value: T, options: { transfer: ArrayBuffer[] }): T;\n}\n\nexport function CreateArrayFromList&lt;T extends any[]&gt;(elements: T): T {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice() as T;\n}\n\nexport function CopyDataBlockBytes(dest: ArrayBuffer,\n destOffset: number,\n src: ArrayBuffer,\n srcOffset: number,\n n: number) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n}\n\nexport let TransferArrayBuffer = (O: ArrayBuffer): ArrayBuffer =&gt; {\n if (typeof O.transfer === &#x27;function&#x27;) {\n TransferArrayBuffer = buffer =&gt; buffer.transfer();\n } else if (typeof structuredClone === &#x27;function&#x27;) {\n TransferArrayBuffer = buffer =&gt; structuredClone(buffer, { transfer: [buffer] });\n } else {\n // Not implemented correctly\n TransferArrayBuffer = buffer =&gt; buffer;\n }\n return TransferArrayBuffer(O);\n};\n\nexport function CanTransferArrayBuffer(O: ArrayBuffer): boolean {\n return !IsDetachedBuffer(O);\n}\n\nexport let IsDetachedBuffer = (O: ArrayBuffer): boolean =&gt; {\n if (typeof O.detached === &#x27;boolean&#x27;) {\n IsDetachedBuffer = buffer =&gt; buffer.detached;\n } else {\n // Not implemented correctly\n IsDetachedBuffer = buffer =&gt; buffer.byteLength === 0;\n }\n return IsDetachedBuffer(O);\n};\n\nexport function ArrayBufferSlice(buffer: ArrayBuffer, begin: number, end: number): ArrayBuffer {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n const length = end - begin;\n const slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n}\n\nexport type MethodName&lt;T&gt; = {\n [P in keyof T]: T[P] extends Function | undefined ? P : never;\n}[keyof T];\n\nexport function GetMethod&lt;T, K extends MethodName&lt;T&gt;&gt;(receiver: T, prop: K): T[K] | undefined {\n const func = receiver[prop];\n if (func === undefined || func === null) {\n return undefined;\n }\n if (typeof func !== &#x27;function&#x27;) {\n throw new TypeError(`${String(prop)} is not a function`);\n }\n return func;\n}\n\nexport interface SyncIteratorRecord&lt;T&gt; {\n iterator: Iterator&lt;T&gt;,\n nextMethod: Iterator&lt;T&gt;[&#x27;next&#x27;],\n done: boolean;\n}\n\nexport interface AsyncIteratorRecord&lt;T&gt; {\n iterator: AsyncIterator&lt;T&gt;,\n nextMethod: AsyncIterator&lt;T&gt;[&#x27;next&#x27;],\n done: boolean;\n}\n\nexport type SyncOrAsyncIteratorRecord&lt;T&gt; = SyncIteratorRecord&lt;T&gt; | AsyncIteratorRecord&lt;T&gt;;\n\nexport function CreateAsyncFromSyncIterator&lt;T&gt;(syncIteratorRecord: SyncIteratorRecord&lt;T&gt;): AsyncIteratorRecord&lt;T&gt; {\n // Instead of re-implementing CreateAsyncFromSyncIterator and %AsyncFromSyncIteratorPrototype%,\n // we use yield* inside an async generator function to achieve the same result.\n\n // Wrap the sync iterator inside a sync iterable, so we can use it with yield*.\n const syncIterable = {\n [Symbol.iterator]: () =&gt; syncIteratorRecord.iterator\n };\n // Create an async generator function and immediately invoke it.\n const asyncIterator = (async function* () {\n return yield* syncIterable;\n }());\n // Return as an async iterator record.\n const nextMethod = asyncIterator.next;\n return { iterator: asyncIterator, nextMethod, done: false };\n}\n\n// Aligns with core-js/modules/es.symbol.async-iterator.js\nexport const SymbolAsyncIterator: (typeof Symbol)[&#x27;asyncIterator&#x27;] =\n Symbol.asyncIterator ??\n Symbol.for?.(&#x27;Symbol.asyncIterator&#x27;) ??\n &#x27;@@asyncIterator&#x27;;\n\nexport type SyncOrAsyncIterable&lt;T&gt; = Iterable&lt;T&gt; | AsyncIterable&lt;T&gt;;\nexport type SyncOrAsyncIteratorMethod&lt;T&gt; = () =&gt; (Iterator&lt;T&gt; | AsyncIterator&lt;T&gt;);\n\nfunction GetIterator&lt;T&gt;(\n obj: SyncOrAsyncIterable&lt;T&gt;,\n hint: &#x27;async&#x27;,\n method?: SyncOrAsyncIteratorMethod&lt;T&gt;\n): AsyncIteratorRecord&lt;T&gt;;\nfunction GetIterator&lt;T&gt;(\n obj: Iterable&lt;T&gt;,\n hint: &#x27;sync&#x27;,\n method?: SyncOrAsyncIteratorMethod&lt;T&gt;\n): SyncIteratorRecord&lt;T&gt;;\nfunction GetIterator&lt;T&gt;(\n obj: SyncOrAsyncIterable&lt;T&gt;,\n hint = &#x27;sync&#x27;,\n method?: SyncOrAsyncIteratorMethod&lt;T&gt;\n): SyncOrAsyncIteratorRecord&lt;T&gt; {\n assert(hint === &#x27;sync&#x27; || hint === &#x27;async&#x27;);\n if (method === undefined) {\n if (hint === &#x27;async&#x27;) {\n method = GetMethod(obj as AsyncIterable&lt;T&gt;, SymbolAsyncIterator);\n if (method === undefined) {\n const syncMethod = GetMethod(obj as Iterable&lt;T&gt;, Symbol.iterator);\n const syncIteratorRecord = GetIterator(obj as Iterable&lt;T&gt;, &#x27;sync&#x27;, syncMethod);\n return CreateAsyncFromSyncIterator(syncIteratorRecord);\n }\n } else {\n method = GetMethod(obj as Iterable&lt;T&gt;, Symbol.iterator);\n }\n }\n if (method === undefined) {\n throw new TypeError(&#x27;The object is not iterable&#x27;);\n }\n const iterator = reflectCall(method, obj, []);\n if (!typeIsObject(iterator)) {\n throw new TypeError(&#x27;The iterator method must return an object&#x27;);\n }\n const nextMethod = iterator.next;\n return { iterator, nextMethod, done: false } as SyncOrAsyncIteratorRecord&lt;T&gt;;\n}\n\nexport { GetIterator };\n\nexport function IteratorNext&lt;T&gt;(iteratorRecord: AsyncIteratorRecord&lt;T&gt;): Promise&lt;IteratorResult&lt;T&gt;&gt; {\n const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);\n if (!typeIsObject(result)) {\n throw new TypeError(&#x27;The iterator.next() method must return an object&#x27;);\n }\n return result;\n}\n\nexport function IteratorComplete&lt;TReturn&gt;(\n iterResult: IteratorResult&lt;unknown, TReturn&gt;\n): iterResult is IteratorReturnResult&lt;TReturn&gt; {\n assert(typeIsObject(iterResult));\n return Boolean(iterResult.done);\n}\n\nexport function IteratorValue&lt;T&gt;(iterResult: IteratorYieldResult&lt;T&gt;): T {\n assert(typeIsObject(iterResult));\n return iterResult.value;\n}\n&quot;, &quot;import NumberIsNaN from &#x27;../../stub/number-isnan&#x27;;\nimport { ArrayBufferSlice } from &#x27;./ecmascript&#x27;;\nimport type { NonShared } from &#x27;../helpers/array-buffer-view&#x27;;\n\nexport function IsNonNegativeNumber(v: number): boolean {\n if (typeof v !== &#x27;number&#x27;) {\n return false;\n }\n\n if (NumberIsNaN(v)) {\n return false;\n }\n\n if (v &lt; 0) {\n return false;\n }\n\n return true;\n}\n\nexport function CloneAsUint8Array(O: NonShared&lt;ArrayBufferView&gt;): NonShared&lt;Uint8Array&gt; {\n const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer) as NonShared&lt;Uint8Array&gt;;\n}\n&quot;, &quot;import assert from &#x27;../../stub/assert&#x27;;\nimport { SimpleQueue } from &#x27;../simple-queue&#x27;;\nimport { IsNonNegativeNumber } from &#x27;./miscellaneous&#x27;;\n\nexport interface QueueContainer&lt;T&gt; {\n _queue: SimpleQueue&lt;T&gt;;\n _queueTotalSize: number;\n}\n\nexport interface QueuePair&lt;T&gt; {\n value: T;\n size: number;\n}\n\nexport function DequeueValue&lt;T&gt;(container: QueueContainer&lt;QueuePair&lt;T&gt;&gt;): T {\n assert(&#x27;_queue&#x27; in container &amp;&amp; &#x27;_queueTotalSize&#x27; in container);\n assert(container._queue.length &gt; 0);\n\n const pair = container._queue.shift()!;\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize &lt; 0) {\n container._queueTotalSize = 0;\n }\n\n return pair.value;\n}\n\nexport function EnqueueValueWithSize&lt;T&gt;(container: QueueContainer&lt;QueuePair&lt;T&gt;&gt;, value: T, size: number) {\n assert(&#x27;_queue&#x27; in container &amp;&amp; &#x27;_queueTotalSize&#x27; in container);\n\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError(&#x27;Size must be a finite, non-NaN, non-negative number.&#x27;);\n }\n\n container._queue.push({ value, size });\n container._queueTotalSize += size;\n}\n\nexport function PeekQueueValue&lt;T&gt;(container: QueueContainer&lt;QueuePair&lt;T&gt;&gt;): T {\n assert(&#x27;_queue&#x27; in container &amp;&amp; &#x27;_queueTotalSize&#x27; in container);\n assert(container._queue.length &gt; 0);\n\n const pair = container._queue.peek();\n return pair.value;\n}\n\nexport function ResetQueue&lt;T&gt;(container: QueueContainer&lt;T&gt;) {\n assert(&#x27;_queue&#x27; in container &amp;&amp; &#x27;_queueTotalSize&#x27; in container);\n\n container._queue = new SimpleQueue&lt;T&gt;();\n container._queueTotalSize = 0;\n}\n&quot;, &quot;export type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport type NonShared&lt;T extends ArrayBufferView&gt; = T &amp; {\n buffer: ArrayBuffer;\n}\n\nexport interface ArrayBufferViewConstructor&lt;T extends ArrayBufferView = ArrayBufferView&gt; {\n new(buffer: ArrayBuffer, byteOffset: number, length?: number): T;\n\n readonly prototype: T;\n}\n\nexport interface TypedArrayConstructor&lt;T extends TypedArray = TypedArray&gt; extends ArrayBufferViewConstructor&lt;T&gt; {\n readonly BYTES_PER_ELEMENT: number;\n}\n\nexport type DataViewConstructor = ArrayBufferViewConstructor&lt;DataView&gt;;\n\nfunction isDataViewConstructor(ctor: Function): ctor is DataViewConstructor {\n return ctor === DataView;\n}\n\nexport function isDataView(view: ArrayBufferView): view is DataView {\n return isDataViewConstructor(view.constructor);\n}\n\nexport function arrayBufferViewElementSize&lt;T extends ArrayBufferView&gt;(ctor: ArrayBufferViewConstructor&lt;T&gt;): number {\n if (isDataViewConstructor(ctor)) {\n return 1;\n }\n return (ctor as unknown as TypedArrayConstructor).BYTES_PER_ELEMENT;\n}\n&quot;, &quot;import assert from &#x27;../../stub/assert&#x27;;\nimport { SimpleQueue } from &#x27;../simple-queue&#x27;;\nimport { ResetQueue } from &#x27;../abstract-ops/queue-with-sizes&#x27;;\nimport {\n IsReadableStreamDefaultReader,\n ReadableStreamAddReadRequest,\n ReadableStreamFulfillReadRequest,\n ReadableStreamGetNumReadRequests,\n ReadableStreamHasDefaultReader,\n type ReadRequest\n} from &#x27;./default-reader&#x27;;\nimport {\n ReadableStreamAddReadIntoRequest,\n ReadableStreamFulfillReadIntoRequest,\n ReadableStreamGetNumReadIntoRequests,\n ReadableStreamHasBYOBReader,\n type ReadIntoRequest\n} from &#x27;./byob-reader&#x27;;\nimport NumberIsInteger from &#x27;../../stub/number-isinteger&#x27;;\nimport {\n IsReadableStreamLocked,\n type ReadableByteStream,\n ReadableStreamClose,\n ReadableStreamError\n} from &#x27;../readable-stream&#x27;;\nimport type { ValidatedUnderlyingByteSource } from &#x27;./underlying-source&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport {\n ArrayBufferSlice,\n CanTransferArrayBuffer,\n CopyDataBlockBytes,\n IsDetachedBuffer,\n TransferArrayBuffer\n} from &#x27;../abstract-ops/ecmascript&#x27;;\nimport { CancelSteps, PullSteps, ReleaseSteps } from &#x27;../abstract-ops/internal-methods&#x27;;\nimport { promiseResolvedWith, uponPromise } from &#x27;../helpers/webidl&#x27;;\nimport { assertRequiredArgument, convertUnsignedLongLongWithEnforceRange } from &#x27;../validators/basic&#x27;;\nimport {\n type ArrayBufferViewConstructor,\n arrayBufferViewElementSize,\n type NonShared,\n type TypedArrayConstructor\n} from &#x27;../helpers/array-buffer-view&#x27;;\n\n/**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\nexport class ReadableStreamBYOBRequest {\n /** @internal */\n _associatedReadableByteStreamController!: ReadableByteStreamController;\n /** @internal */\n _view!: NonShared&lt;ArrayBufferView&gt; | null;\n\n private constructor() {\n throw new TypeError(&#x27;Illegal constructor&#x27;);\n }\n\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get view(): ArrayBufferView | null {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException(&#x27;view&#x27;);\n }\n\n return this._view;\n }\n\n /**\n * Indicates to the associated readable byte stream that `bytesWritten` bytes were written into\n * {@link ReadableStreamBYOBRequest.view | view}, causing the result be surfaced to the consumer.\n *\n * After this method is called, {@link ReadableStreamBYOBRequest.view | view} will be transferred and no longer\n * modifiable.\n */\n respond(bytesWritten: number): void;\n respond(bytesWritten: number | undefined): void {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException(&#x27;respond&#x27;);\n }\n assertRequiredArgument(bytesWritten, 1, &#x27;respond&#x27;);\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, &#x27;First parameter&#x27;);\n\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError(&#x27;This BYOB request has been invalidated&#x27;);\n }\n\n if (IsDetachedBuffer(this._view!.buffer)) {\n throw new TypeError(`The BYOB request&#x27;s buffer has been detached and so cannot be used as a response`);\n }\n\n assert(this._view!.byteLength &gt; 0);\n assert(this._view!.buffer.byteLength &gt; 0);\n\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n }\n\n /**\n * Indicates to the associated readable byte stream that instead of writing into\n * {@link ReadableStreamBYOBRequest.view | view}, the underlying byte source is providing a new `ArrayBufferView`,\n * which will be given to the consumer of the readable byte stream.\n *\n * After this method is called, `view` will be transferred and no longer modifiable.\n */\n respondWithNewView(view: ArrayBufferView): void;\n respondWithNewView(view: NonShared&lt;ArrayBufferView&gt;): void {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException(&#x27;respondWithNewView&#x27;);\n }\n assertRequiredArgument(view, 1, &#x27;respondWithNewView&#x27;);\n\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError(&#x27;You can only respond with array buffer views&#x27;);\n }\n\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError(&#x27;This BYOB request has been invalidated&#x27;);\n }\n\n if (IsDetachedBuffer(view.buffer)) {\n throw new TypeError(&#x27;The given view\\&#x27;s buffer has been detached and so cannot be used as a response&#x27;);\n }\n\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n }\n}\n\nObject.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n});\nsetFunctionName(ReadableStreamBYOBRequest.prototype.respond, &#x27;respond&#x27;);\nsetFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, &#x27;respondWithNewView&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableStreamBYOBRequest&#x27;,\n configurable: true\n });\n}\n\ninterface ByteQueueElement {\n buffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n}\n\ntype PullIntoDescriptor&lt;T extends NonShared&lt;ArrayBufferView&gt; = NonShared&lt;ArrayBufferView&gt;&gt; =\n DefaultPullIntoDescriptor\n | BYOBPullIntoDescriptor&lt;T&gt;;\n\ninterface DefaultPullIntoDescriptor {\n buffer: ArrayBuffer;\n bufferByteLength: number;\n byteOffset: number;\n byteLength: number;\n bytesFilled: number;\n minimumFill: number;\n elementSize: number;\n viewConstructor: TypedArrayConstructor&lt;Uint8Array&gt;;\n readerType: &#x27;default&#x27; | &#x27;none&#x27;;\n}\n\ninterface BYOBPullIntoDescriptor&lt;T extends NonShared&lt;ArrayBufferView&gt; = NonShared&lt;ArrayBufferView&gt;&gt; {\n buffer: ArrayBuffer;\n bufferByteLength: number;\n byteOffset: number;\n byteLength: number;\n bytesFilled: number;\n minimumFill: number;\n elementSize: number;\n viewConstructor: ArrayBufferViewConstructor&lt;T&gt;;\n readerType: &#x27;byob&#x27; | &#x27;none&#x27;;\n}\n\n/**\n * Allows control of a {@link ReadableStream | readable byte stream}&#x27;s state and internal queue.\n *\n * @public\n */\nexport class ReadableByteStreamController {\n /** @internal */\n _controlledReadableByteStream!: ReadableByteStream;\n /** @internal */\n _queue!: SimpleQueue&lt;ByteQueueElement&gt;;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _closeRequested!: boolean;\n /** @internal */\n _pullAgain!: boolean;\n /** @internal */\n _pulling !: boolean;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _pullAlgorithm!: () =&gt; Promise&lt;void&gt;;\n /** @internal */\n _cancelAlgorithm!: (reason: any) =&gt; Promise&lt;void&gt;;\n /** @internal */\n _autoAllocateChunkSize: number | undefined;\n /** @internal */\n _byobRequest: ReadableStreamBYOBRequest | null;\n /** @internal */\n _pendingPullIntos!: SimpleQueue&lt;PullIntoDescriptor&gt;;\n\n private constructor() {\n throw new TypeError(&#x27;Illegal constructor&#x27;);\n }\n\n /**\n * Returns the current BYOB pull request, or `null` if there isn&#x27;t one.\n */\n get byobRequest(): ReadableStreamBYOBRequest | null {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException(&#x27;byobRequest&#x27;);\n }\n\n return ReadableByteStreamControllerGetBYOBRequest(this);\n }\n\n /**\n * Returns the desired size to fill the controlled stream&#x27;s internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize(): number | null {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException(&#x27;desiredSize&#x27;);\n }\n\n return ReadableByteStreamControllerGetDesiredSize(this);\n }\n\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close(): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException(&#x27;close&#x27;);\n }\n\n if (this._closeRequested) {\n throw new TypeError(&#x27;The stream has already been closed; do not close it again!&#x27;);\n }\n\n const state = this._controlledReadableByteStream._state;\n if (state !== &#x27;readable&#x27;) {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);\n }\n\n ReadableByteStreamControllerClose(this);\n }\n\n /**\n * Enqueues the given chunk chunk in the controlled readable stream.\n * The chunk has to be an `ArrayBufferView` instance, or else a `TypeError` will be thrown.\n */\n enqueue(chunk: ArrayBufferView): void;\n enqueue(chunk: NonShared&lt;ArrayBufferView&gt;): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException(&#x27;enqueue&#x27;);\n }\n\n assertRequiredArgument(chunk, 1, &#x27;enqueue&#x27;);\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError(&#x27;chunk must be an array buffer view&#x27;);\n }\n if (chunk.byteLength === 0) {\n throw new TypeError(&#x27;chunk must have non-zero byteLength&#x27;);\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(`chunk&#x27;s buffer must have non-zero byteLength`);\n }\n\n if (this._closeRequested) {\n throw new TypeError(&#x27;stream is closed or draining&#x27;);\n }\n\n const state = this._controlledReadableByteStream._state;\n if (state !== &#x27;readable&#x27;) {\n throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);\n }\n\n ReadableByteStreamControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e: any = undefined): void {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException(&#x27;error&#x27;);\n }\n\n ReadableByteStreamControllerError(this, e);\n }\n\n /** @internal */\n [CancelSteps](reason: any): Promise&lt;void&gt; {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n\n ResetQueue(this);\n\n const result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [PullSteps](readRequest: ReadRequest&lt;NonShared&lt;Uint8Array&gt;&gt;): void {\n const stream = this._controlledReadableByteStream;\n assert(ReadableStreamHasDefaultReader(stream));\n\n if (this._queueTotalSize &gt; 0) {\n assert(ReadableStreamGetNumReadRequests(stream) === 0);\n\n ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);\n return;\n }\n\n const autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n let buffer: ArrayBuffer;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n } catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n\n const pullIntoDescriptor: DefaultPullIntoDescriptor = {\n buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n minimumFill: 1,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: &#x27;default&#x27;\n };\n\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n }\n\n /** @internal */\n [ReleaseSteps](): void {\n if (this._pendingPullIntos.length &gt; 0) {\n const firstPullInto = this._pendingPullIntos.peek();\n firstPullInto.readerType = &#x27;none&#x27;;\n\n this._pendingPullIntos = new SimpleQueue();\n this._pendingPullIntos.push(firstPullInto);\n }\n }\n}\n\nObject.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(ReadableByteStreamController.prototype.close, &#x27;close&#x27;);\nsetFunctionName(ReadableByteStreamController.prototype.enqueue, &#x27;enqueue&#x27;);\nsetFunctionName(ReadableByteStreamController.prototype.error, &#x27;error&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableByteStreamController&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations for the ReadableByteStreamController.\n\nexport function IsReadableByteStreamController(x: any): x is ReadableByteStreamController {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_controlledReadableByteStream&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableByteStreamController;\n}\n\nfunction IsReadableStreamBYOBRequest(x: any): x is ReadableStreamBYOBRequest {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_associatedReadableByteStreamController&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableStreamBYOBRequest;\n}\n\nfunction ReadableByteStreamControllerCallPullIfNeeded(controller: ReadableByteStreamController): void {\n const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n\n assert(!controller._pullAgain);\n\n controller._pulling = true;\n\n // TODO: Test controller argument\n const pullPromise = controller._pullAlgorithm();\n uponPromise(\n pullPromise,\n () =&gt; {\n controller._pulling = false;\n\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n\n return null;\n },\n e =&gt; {\n ReadableByteStreamControllerError(controller, e);\n return null;\n }\n );\n}\n\nfunction ReadableByteStreamControllerClearPendingPullIntos(controller: ReadableByteStreamController) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n}\n\nfunction ReadableByteStreamControllerCommitPullIntoDescriptor&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n stream: ReadableByteStream,\n pullIntoDescriptor: PullIntoDescriptor&lt;T&gt;\n) {\n assert(stream._state !== &#x27;errored&#x27;);\n assert(pullIntoDescriptor.readerType !== &#x27;none&#x27;);\n\n let done = false;\n if (stream._state === &#x27;closed&#x27;) {\n assert(pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize === 0);\n done = true;\n }\n\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor&lt;T&gt;(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === &#x27;default&#x27;) {\n ReadableStreamFulfillReadRequest(stream, filledView as unknown as NonShared&lt;Uint8Array&gt;, done);\n } else {\n assert(pullIntoDescriptor.readerType === &#x27;byob&#x27;);\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n}\n\nfunction ReadableByteStreamControllerConvertPullIntoDescriptor&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n pullIntoDescriptor: PullIntoDescriptor&lt;T&gt;\n): T {\n const bytesFilled = pullIntoDescriptor.bytesFilled;\n const elementSize = pullIntoDescriptor.elementSize;\n\n assert(bytesFilled &lt;= pullIntoDescriptor.byteLength);\n assert(bytesFilled % elementSize === 0);\n\n return new pullIntoDescriptor.viewConstructor(\n pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize) as T;\n}\n\nfunction ReadableByteStreamControllerEnqueueChunkToQueue(controller: ReadableByteStreamController,\n buffer: ArrayBuffer,\n byteOffset: number,\n byteLength: number) {\n controller._queue.push({ buffer, byteOffset, byteLength });\n controller._queueTotalSize += byteLength;\n}\n\nfunction ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller: ReadableByteStreamController,\n buffer: ArrayBuffer,\n byteOffset: number,\n byteLength: number) {\n let clonedChunk;\n try {\n clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);\n } catch (cloneE) {\n ReadableByteStreamControllerError(controller, cloneE);\n throw cloneE;\n }\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);\n}\n\nfunction ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller: ReadableByteStreamController,\n firstDescriptor: PullIntoDescriptor) {\n assert(firstDescriptor.readerType === &#x27;none&#x27;);\n if (firstDescriptor.bytesFilled &gt; 0) {\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(\n controller,\n firstDescriptor.buffer,\n firstDescriptor.byteOffset,\n firstDescriptor.bytesFilled\n );\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n}\n\nfunction ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller: ReadableByteStreamController,\n pullIntoDescriptor: PullIntoDescriptor) {\n const maxBytesToCopy = Math.min(controller._queueTotalSize,\n pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n\n let totalBytesToCopyRemaining = maxBytesToCopy;\n let ready = false;\n assert(pullIntoDescriptor.bytesFilled &lt; pullIntoDescriptor.minimumFill);\n const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;\n const maxAlignedBytes = maxBytesFilled - remainderBytes;\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n if (maxAlignedBytes &gt;= pullIntoDescriptor.minimumFill) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n\n const queue = controller._queue;\n\n while (totalBytesToCopyRemaining &gt; 0) {\n const headOfQueue = queue.peek();\n\n const bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n\n const destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n } else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n\n if (!ready) {\n assert(controller._queueTotalSize === 0);\n assert(pullIntoDescriptor.bytesFilled &gt; 0);\n assert(pullIntoDescriptor.bytesFilled &lt; pullIntoDescriptor.minimumFill);\n }\n\n return ready;\n}\n\nfunction ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller: ReadableByteStreamController,\n size: number,\n pullIntoDescriptor: PullIntoDescriptor) {\n assert(controller._pendingPullIntos.length === 0 || controller._pendingPullIntos.peek() === pullIntoDescriptor);\n assert(controller._byobRequest === null);\n pullIntoDescriptor.bytesFilled += size;\n}\n\nfunction ReadableByteStreamControllerHandleQueueDrain(controller: ReadableByteStreamController) {\n assert(controller._controlledReadableByteStream._state === &#x27;readable&#x27;);\n\n if (controller._queueTotalSize === 0 &amp;&amp; controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n } else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n}\n\nfunction ReadableByteStreamControllerInvalidateBYOBRequest(controller: ReadableByteStreamController) {\n if (controller._byobRequest === null) {\n return;\n }\n\n controller._byobRequest._associatedReadableByteStreamController = undefined!;\n controller._byobRequest._view = null!;\n controller._byobRequest = null;\n}\n\nfunction ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller: ReadableByteStreamController) {\n assert(!controller._closeRequested);\n\n while (controller._pendingPullIntos.length &gt; 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n\n const pullIntoDescriptor = controller._pendingPullIntos.peek();\n assert(pullIntoDescriptor.readerType !== &#x27;none&#x27;);\n\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n\n ReadableByteStreamControllerCommitPullIntoDescriptor(\n controller._controlledReadableByteStream,\n pullIntoDescriptor\n );\n }\n }\n}\n\nfunction ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller: ReadableByteStreamController) {\n const reader = controller._controlledReadableByteStream._reader;\n assert(IsReadableStreamDefaultReader(reader));\n while (reader._readRequests.length &gt; 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n const readRequest = reader._readRequests.shift();\n ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);\n }\n}\n\nexport function ReadableByteStreamControllerPullInto&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n controller: ReadableByteStreamController,\n view: T,\n min: number,\n readIntoRequest: ReadIntoRequest&lt;T&gt;\n): void {\n const stream = controller._controlledReadableByteStream;\n\n const ctor = view.constructor as ArrayBufferViewConstructor&lt;T&gt;;\n const elementSize = arrayBufferViewElementSize(ctor);\n\n const { byteOffset, byteLength } = view;\n\n const minimumFill = min * elementSize;\n assert(minimumFill &gt;= elementSize &amp;&amp; minimumFill &lt;= byteLength);\n assert(minimumFill % elementSize === 0);\n\n let buffer: ArrayBuffer;\n try {\n buffer = TransferArrayBuffer(view.buffer);\n } catch (e) {\n readIntoRequest._errorSteps(e);\n return;\n }\n\n const pullIntoDescriptor: BYOBPullIntoDescriptor&lt;T&gt; = {\n buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset,\n byteLength,\n bytesFilled: 0,\n minimumFill,\n elementSize,\n viewConstructor: ctor,\n readerType: &#x27;byob&#x27;\n };\n\n if (controller._pendingPullIntos.length &gt; 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there&#x27;s at least 1 pending read(view)\n\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n\n if (stream._state === &#x27;closed&#x27;) {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n\n if (controller._queueTotalSize &gt; 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = ReadableByteStreamControllerConvertPullIntoDescriptor&lt;T&gt;(pullIntoDescriptor);\n\n ReadableByteStreamControllerHandleQueueDrain(controller);\n\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n\n if (controller._closeRequested) {\n const e = new TypeError(&#x27;Insufficient bytes to fill elements in the given buffer&#x27;);\n ReadableByteStreamControllerError(controller, e);\n\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n\n controller._pendingPullIntos.push(pullIntoDescriptor);\n\n ReadableStreamAddReadIntoRequest&lt;T&gt;(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nfunction ReadableByteStreamControllerRespondInClosedState(controller: ReadableByteStreamController,\n firstDescriptor: PullIntoDescriptor) {\n assert(firstDescriptor.bytesFilled % firstDescriptor.elementSize === 0);\n\n if (firstDescriptor.readerType === &#x27;none&#x27;) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n\n const stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) &gt; 0) {\n const pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n}\n\nfunction ReadableByteStreamControllerRespondInReadableState(controller: ReadableByteStreamController,\n bytesWritten: number,\n pullIntoDescriptor: PullIntoDescriptor) {\n assert(pullIntoDescriptor.bytesFilled + bytesWritten &lt;= pullIntoDescriptor.byteLength);\n\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n\n if (pullIntoDescriptor.readerType === &#x27;none&#x27;) {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n return;\n }\n\n if (pullIntoDescriptor.bytesFilled &lt; pullIntoDescriptor.minimumFill) {\n // A descriptor for a read() request that is not yet filled up to its minimum length will stay at the head\n // of the queue, so the underlying source can keep filling it.\n return;\n }\n\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize &gt; 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n ReadableByteStreamControllerEnqueueClonedChunkToQueue(\n controller,\n pullIntoDescriptor.buffer,\n end - remainderSize,\n remainderSize\n );\n }\n\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n}\n\nfunction ReadableByteStreamControllerRespondInternal(controller: ReadableByteStreamController, bytesWritten: number) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n assert(CanTransferArrayBuffer(firstDescriptor.buffer));\n\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n\n const state = controller._controlledReadableByteStream._state;\n if (state === &#x27;closed&#x27;) {\n assert(bytesWritten === 0);\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n } else {\n assert(state === &#x27;readable&#x27;);\n assert(bytesWritten &gt; 0);\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nfunction ReadableByteStreamControllerShiftPendingPullInto(\n controller: ReadableByteStreamController\n): PullIntoDescriptor {\n assert(controller._byobRequest === null);\n const descriptor = controller._pendingPullIntos.shift()!;\n return descriptor;\n}\n\nfunction ReadableByteStreamControllerShouldCallPull(controller: ReadableByteStreamController): boolean {\n const stream = controller._controlledReadableByteStream;\n\n if (stream._state !== &#x27;readable&#x27;) {\n return false;\n }\n\n if (controller._closeRequested) {\n return false;\n }\n\n if (!controller._started) {\n return false;\n }\n\n if (ReadableStreamHasDefaultReader(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) {\n return true;\n }\n\n if (ReadableStreamHasBYOBReader(stream) &amp;&amp; ReadableStreamGetNumReadIntoRequests(stream) &gt; 0) {\n return true;\n }\n\n const desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n assert(desiredSize !== null);\n if (desiredSize! &gt; 0) {\n return true;\n }\n\n return false;\n}\n\nfunction ReadableByteStreamControllerClearAlgorithms(controller: ReadableByteStreamController) {\n controller._pullAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n}\n\n// A client of ReadableByteStreamController may use these functions directly to bypass state check.\n\nexport function ReadableByteStreamControllerClose(controller: ReadableByteStreamController) {\n const stream = controller._controlledReadableByteStream;\n\n if (controller._closeRequested || stream._state !== &#x27;readable&#x27;) {\n return;\n }\n\n if (controller._queueTotalSize &gt; 0) {\n controller._closeRequested = true;\n\n return;\n }\n\n if (controller._pendingPullIntos.length &gt; 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {\n const e = new TypeError(&#x27;Insufficient bytes to fill elements in the given buffer&#x27;);\n ReadableByteStreamControllerError(controller, e);\n\n throw e;\n }\n }\n\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n}\n\nexport function ReadableByteStreamControllerEnqueue(\n controller: ReadableByteStreamController,\n chunk: NonShared&lt;ArrayBufferView&gt;\n) {\n const stream = controller._controlledReadableByteStream;\n\n if (controller._closeRequested || stream._state !== &#x27;readable&#x27;) {\n return;\n }\n\n const { buffer, byteOffset, byteLength } = chunk;\n if (IsDetachedBuffer(buffer)) {\n throw new TypeError(&#x27;chunk\\&#x27;s buffer is detached and so cannot be enqueued&#x27;);\n }\n const transferredBuffer = TransferArrayBuffer(buffer);\n\n if (controller._pendingPullIntos.length &gt; 0) {\n const firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) {\n throw new TypeError(\n &#x27;The BYOB request\\&#x27;s buffer has been detached and so cannot be filled with an enqueued chunk&#x27;\n );\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n if (firstPendingPullInto.readerType === &#x27;none&#x27;) {\n ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);\n }\n }\n\n if (ReadableStreamHasDefaultReader(stream)) {\n ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n assert(controller._pendingPullIntos.length === 0);\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n } else {\n assert(controller._queue.length === 0);\n if (controller._pendingPullIntos.length &gt; 0) {\n assert(controller._pendingPullIntos.peek().readerType === &#x27;default&#x27;);\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n const transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView as NonShared&lt;Uint8Array&gt;, false);\n }\n } else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n } else {\n assert(!IsReadableStreamLocked(stream));\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n}\n\nexport function ReadableByteStreamControllerError(controller: ReadableByteStreamController, e: any) {\n const stream = controller._controlledReadableByteStream;\n\n if (stream._state !== &#x27;readable&#x27;) {\n return;\n }\n\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\n\nexport function ReadableByteStreamControllerFillReadRequestFromQueue(\n controller: ReadableByteStreamController,\n readRequest: ReadRequest&lt;NonShared&lt;Uint8Array&gt;&gt;\n) {\n assert(controller._queueTotalSize &gt; 0);\n\n const entry = controller._queue.shift();\n controller._queueTotalSize -= entry.byteLength;\n\n ReadableByteStreamControllerHandleQueueDrain(controller);\n\n const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view as NonShared&lt;Uint8Array&gt;);\n}\n\nexport function ReadableByteStreamControllerGetBYOBRequest(\n controller: ReadableByteStreamController\n): ReadableStreamBYOBRequest | null {\n if (controller._byobRequest === null &amp;&amp; controller._pendingPullIntos.length &gt; 0) {\n const firstDescriptor = controller._pendingPullIntos.peek();\n const view = new Uint8Array(firstDescriptor.buffer,\n firstDescriptor.byteOffset + firstDescriptor.bytesFilled,\n firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n\n const byobRequest: ReadableStreamBYOBRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view as NonShared&lt;Uint8Array&gt;);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n}\n\nfunction ReadableByteStreamControllerGetDesiredSize(controller: ReadableByteStreamController): number | null {\n const state = controller._controlledReadableByteStream._state;\n\n if (state === &#x27;errored&#x27;) {\n return null;\n }\n if (state === &#x27;closed&#x27;) {\n return 0;\n }\n\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\nexport function ReadableByteStreamControllerRespond(controller: ReadableByteStreamController, bytesWritten: number) {\n assert(controller._pendingPullIntos.length &gt; 0);\n\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n\n if (state === &#x27;closed&#x27;) {\n if (bytesWritten !== 0) {\n throw new TypeError(&#x27;bytesWritten must be 0 when calling respond() on a closed stream&#x27;);\n }\n } else {\n assert(state === &#x27;readable&#x27;);\n if (bytesWritten === 0) {\n throw new TypeError(&#x27;bytesWritten must be greater than 0 when calling respond() on a readable stream&#x27;);\n }\n if (firstDescriptor.bytesFilled + bytesWritten &gt; firstDescriptor.byteLength) {\n throw new RangeError(&#x27;bytesWritten out of range&#x27;);\n }\n }\n\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n}\n\nexport function ReadableByteStreamControllerRespondWithNewView(controller: ReadableByteStreamController,\n view: NonShared&lt;ArrayBufferView&gt;) {\n assert(controller._pendingPullIntos.length &gt; 0);\n assert(!IsDetachedBuffer(view.buffer));\n\n const firstDescriptor = controller._pendingPullIntos.peek();\n const state = controller._controlledReadableByteStream._state;\n\n if (state === &#x27;closed&#x27;) {\n if (view.byteLength !== 0) {\n throw new TypeError(&#x27;The view\\&#x27;s length must be 0 when calling respondWithNewView() on a closed stream&#x27;);\n }\n } else {\n assert(state === &#x27;readable&#x27;);\n if (view.byteLength === 0) {\n throw new TypeError(\n &#x27;The view\\&#x27;s length must be greater than 0 when calling respondWithNewView() on a readable stream&#x27;\n );\n }\n }\n\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError(&#x27;The region specified by view does not match byobRequest&#x27;);\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError(&#x27;The buffer of view has different capacity than byobRequest&#x27;);\n }\n if (firstDescriptor.bytesFilled + view.byteLength &gt; firstDescriptor.byteLength) {\n throw new RangeError(&#x27;The region specified by view is larger than byobRequest&#x27;);\n }\n\n const viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n}\n\nexport function SetUpReadableByteStreamController(stream: ReadableByteStream,\n controller: ReadableByteStreamController,\n startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n pullAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n highWaterMark: number,\n autoAllocateChunkSize: number | undefined) {\n assert(stream._readableStreamController === undefined);\n if (autoAllocateChunkSize !== undefined) {\n assert(NumberIsInteger(autoAllocateChunkSize));\n assert(autoAllocateChunkSize &gt; 0);\n }\n\n controller._controlledReadableByteStream = stream;\n\n controller._pullAgain = false;\n controller._pulling = false;\n\n controller._byobRequest = null;\n\n // Need to set the slots so that the assert doesn&#x27;t fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._closeRequested = false;\n controller._started = false;\n\n controller._strategyHWM = highWaterMark;\n\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n\n controller._pendingPullIntos = new SimpleQueue();\n\n stream._readableStreamController = controller;\n\n const startResult = startAlgorithm();\n uponPromise(\n promiseResolvedWith(startResult),\n () =&gt; {\n controller._started = true;\n\n assert(!controller._pulling);\n assert(!controller._pullAgain);\n\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n return null;\n },\n r =&gt; {\n ReadableByteStreamControllerError(controller, r);\n return null;\n }\n );\n}\n\nexport function SetUpReadableByteStreamControllerFromUnderlyingSource(\n stream: ReadableByteStream,\n underlyingByteSource: ValidatedUnderlyingByteSource,\n highWaterMark: number\n) {\n const controller: ReadableByteStreamController = Object.create(ReadableByteStreamController.prototype);\n\n let startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;;\n let pullAlgorithm: () =&gt; Promise&lt;void&gt;;\n let cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;;\n\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = () =&gt; underlyingByteSource.start!(controller);\n } else {\n startAlgorithm = () =&gt; undefined;\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = () =&gt; underlyingByteSource.pull!(controller);\n } else {\n pullAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = reason =&gt; underlyingByteSource.cancel!(reason);\n } else {\n cancelAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n\n const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError(&#x27;autoAllocateChunkSize must be greater than 0&#x27;);\n }\n\n SetUpReadableByteStreamController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize\n );\n}\n\nfunction SetUpReadableStreamBYOBRequest(request: ReadableStreamBYOBRequest,\n controller: ReadableByteStreamController,\n view: NonShared&lt;ArrayBufferView&gt;) {\n assert(IsReadableByteStreamController(controller));\n assert(typeof view === &#x27;object&#x27;);\n assert(ArrayBuffer.isView(view));\n assert(!IsDetachedBuffer(view.buffer));\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n}\n\n// Helper functions for the ReadableStreamBYOBRequest.\n\nfunction byobRequestBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);\n}\n\n// Helper functions for the ReadableByteStreamController.\n\nfunction byteStreamControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);\n}\n&quot;, &quot;import { assertDictionary, convertUnsignedLongLongWithEnforceRange } from &#x27;./basic&#x27;;\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ReadableStreamGetReaderOptions,\n ValidatedReadableStreamBYOBReaderReadOptions\n} from &#x27;../readable-stream/reader-options&#x27;;\n\nexport function convertReaderOptions(options: ReadableStreamGetReaderOptions | null | undefined,\n context: string): ReadableStreamGetReaderOptions {\n assertDictionary(options, context);\n const mode = options?.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, `${context} has member &#x27;mode&#x27; that`)\n };\n}\n\nfunction convertReadableStreamReaderMode(mode: string, context: string): &#x27;byob&#x27; {\n mode = `${mode}`;\n if (mode !== &#x27;byob&#x27;) {\n throw new TypeError(`${context} &#x27;${mode}&#x27; is not a valid enumeration value for ReadableStreamReaderMode`);\n }\n return mode;\n}\n\nexport function convertByobReadOptions(\n options: ReadableStreamBYOBReaderReadOptions | null | undefined,\n context: string\n): ValidatedReadableStreamBYOBReaderReadOptions {\n assertDictionary(options, context);\n const min = options?.min ?? 1;\n return {\n min: convertUnsignedLongLongWithEnforceRange(\n min,\n `${context} has member &#x27;min&#x27; that`\n )\n };\n}\n&quot;, &quot;import assert from &#x27;../../stub/assert&#x27;;\nimport { SimpleQueue } from &#x27;../simple-queue&#x27;;\nimport {\n ReadableStreamReaderGenericCancel,\n ReadableStreamReaderGenericInitialize,\n ReadableStreamReaderGenericRelease,\n readerLockException\n} from &#x27;./generic-reader&#x27;;\nimport { IsReadableStreamLocked, type ReadableByteStream, type ReadableStream } from &#x27;../readable-stream&#x27;;\nimport {\n IsReadableByteStreamController,\n ReadableByteStreamController,\n ReadableByteStreamControllerPullInto\n} from &#x27;./byte-stream-controller&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport { newPromise, promiseRejectedWith } from &#x27;../helpers/webidl&#x27;;\nimport { assertRequiredArgument } from &#x27;../validators/basic&#x27;;\nimport { assertReadableStream } from &#x27;../validators/readable-stream&#x27;;\nimport { IsDetachedBuffer } from &#x27;../abstract-ops/ecmascript&#x27;;\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ValidatedReadableStreamBYOBReaderReadOptions\n} from &#x27;./reader-options&#x27;;\nimport { convertByobReadOptions } from &#x27;../validators/reader-options&#x27;;\nimport { isDataView, type NonShared, type TypedArray } from &#x27;../helpers/array-buffer-view&#x27;;\n\n/**\n * A result returned by {@link ReadableStreamBYOBReader.read}.\n *\n * @public\n */\nexport type ReadableStreamBYOBReadResult&lt;T extends ArrayBufferView&gt; = {\n done: false;\n value: T;\n} | {\n done: true;\n value: T | undefined;\n};\n\n// Abstract operations for the ReadableStream.\n\nexport function AcquireReadableStreamBYOBReader(stream: ReadableByteStream): ReadableStreamBYOBReader {\n return new ReadableStreamBYOBReader(stream as ReadableStream&lt;Uint8Array&gt;);\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamAddReadIntoRequest&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n stream: ReadableByteStream,\n readIntoRequest: ReadIntoRequest&lt;T&gt;\n): void {\n assert(IsReadableStreamBYOBReader(stream._reader));\n assert(stream._state === &#x27;readable&#x27; || stream._state === &#x27;closed&#x27;);\n\n (stream._reader! as ReadableStreamBYOBReader)._readIntoRequests.push(readIntoRequest);\n}\n\nexport function ReadableStreamFulfillReadIntoRequest(stream: ReadableByteStream,\n chunk: ArrayBufferView,\n done: boolean) {\n const reader = stream._reader as ReadableStreamBYOBReader;\n\n assert(reader._readIntoRequests.length &gt; 0);\n\n const readIntoRequest = reader._readIntoRequests.shift()!;\n if (done) {\n readIntoRequest._closeSteps(chunk);\n } else {\n readIntoRequest._chunkSteps(chunk);\n }\n}\n\nexport function ReadableStreamGetNumReadIntoRequests(stream: ReadableByteStream): number {\n return (stream._reader as ReadableStreamBYOBReader)._readIntoRequests.length;\n}\n\nexport function ReadableStreamHasBYOBReader(stream: ReadableByteStream): boolean {\n const reader = stream._reader;\n\n if (reader === undefined) {\n return false;\n }\n\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n\n return true;\n}\n\n// Readers\n\nexport interface ReadIntoRequest&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt; {\n _chunkSteps(chunk: T): void;\n\n _closeSteps(chunk: T | undefined): void;\n\n _errorSteps(e: any): void;\n}\n\n/**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\nexport class ReadableStreamBYOBReader {\n /** @internal */\n _ownerReadableStream!: ReadableByteStream;\n /** @internal */\n _closedPromise!: Promise&lt;undefined&gt;;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) =&gt; void;\n /** @internal */\n _closedPromise_reject?: (reason: any) =&gt; void;\n /** @internal */\n _readIntoRequests: SimpleQueue&lt;ReadIntoRequest&lt;any&gt;&gt;;\n\n constructor(stream: ReadableStream&lt;Uint8Array&gt;) {\n assertRequiredArgument(stream, 1, &#x27;ReadableStreamBYOBReader&#x27;);\n assertReadableStream(stream, &#x27;First parameter&#x27;);\n\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError(&#x27;This stream has already been locked for exclusive reading by another reader&#x27;);\n }\n\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError(&#x27;Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte &#x27; +\n &#x27;source&#x27;);\n }\n\n ReadableStreamReaderGenericInitialize(this, stream);\n\n this._readIntoRequests = new SimpleQueue();\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader&#x27;s lock is released before the stream finishes closing.\n */\n get closed(): Promise&lt;undefined&gt; {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException(&#x27;closed&#x27;));\n }\n\n return this._closedPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n cancel(reason: any = undefined): Promise&lt;void&gt; {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException(&#x27;cancel&#x27;));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException(&#x27;cancel&#x27;));\n }\n\n return ReadableStreamReaderGenericCancel(this, reason);\n }\n\n /**\n * Attempts to reads bytes into view, and returns a promise resolved with the result.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n read&lt;T extends ArrayBufferView&gt;(\n view: T,\n options?: ReadableStreamBYOBReaderReadOptions\n ): Promise&lt;ReadableStreamBYOBReadResult&lt;T&gt;&gt;;\n read&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n view: T,\n rawOptions: ReadableStreamBYOBReaderReadOptions | null | undefined = {}\n ): Promise&lt;ReadableStreamBYOBReadResult&lt;T&gt;&gt; {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException(&#x27;read&#x27;));\n }\n\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError(&#x27;view must be an array buffer view&#x27;));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError(&#x27;view must have non-zero byteLength&#x27;));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(`view&#x27;s buffer must have non-zero byteLength`));\n }\n if (IsDetachedBuffer(view.buffer)) {\n return promiseRejectedWith(new TypeError(&#x27;view\\&#x27;s buffer has been detached&#x27;));\n }\n\n let options: ValidatedReadableStreamBYOBReaderReadOptions;\n try {\n options = convertByobReadOptions(rawOptions, &#x27;options&#x27;);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const min = options.min;\n if (min === 0) {\n return promiseRejectedWith(new TypeError(&#x27;options.min must be greater than 0&#x27;));\n }\n if (!isDataView(view)) {\n if (min &gt; (view as unknown as TypedArray).length) {\n return promiseRejectedWith(new RangeError(&#x27;options.min must be less than or equal to view\\&#x27;s length&#x27;));\n }\n } else if (min &gt; view.byteLength) {\n return promiseRejectedWith(new RangeError(&#x27;options.min must be less than or equal to view\\&#x27;s byteLength&#x27;));\n }\n\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException(&#x27;read from&#x27;));\n }\n\n let resolvePromise!: (result: ReadableStreamBYOBReadResult&lt;T&gt;) =&gt; void;\n let rejectPromise!: (reason: any) =&gt; void;\n const promise = newPromise&lt;ReadableStreamBYOBReadResult&lt;T&gt;&gt;((resolve, reject) =&gt; {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n const readIntoRequest: ReadIntoRequest&lt;T&gt; = {\n _chunkSteps: chunk =&gt; resolvePromise({ value: chunk, done: false }),\n _closeSteps: chunk =&gt; resolvePromise({ value: chunk, done: true }),\n _errorSteps: e =&gt; rejectPromise(e)\n };\n ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);\n return promise;\n }\n\n /**\n * Releases the reader&#x27;s lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader&#x27;s lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader&#x27;s {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n releaseLock(): void {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException(&#x27;releaseLock&#x27;);\n }\n\n if (this._ownerReadableStream === undefined) {\n return;\n }\n\n ReadableStreamBYOBReaderRelease(this);\n }\n}\n\nObject.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n});\nsetFunctionName(ReadableStreamBYOBReader.prototype.cancel, &#x27;cancel&#x27;);\nsetFunctionName(ReadableStreamBYOBReader.prototype.read, &#x27;read&#x27;);\nsetFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, &#x27;releaseLock&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableStreamBYOBReader&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations for the readers.\n\nexport function IsReadableStreamBYOBReader(x: any): x is ReadableStreamBYOBReader {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_readIntoRequests&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableStreamBYOBReader;\n}\n\nexport function ReadableStreamBYOBReaderRead&lt;T extends NonShared&lt;ArrayBufferView&gt;&gt;(\n reader: ReadableStreamBYOBReader,\n view: T,\n min: number,\n readIntoRequest: ReadIntoRequest&lt;T&gt;\n): void {\n const stream = reader._ownerReadableStream;\n\n assert(stream !== undefined);\n\n stream._disturbed = true;\n\n if (stream._state === &#x27;errored&#x27;) {\n readIntoRequest._errorSteps(stream._storedError);\n } else {\n ReadableByteStreamControllerPullInto(\n stream._readableStreamController as ReadableByteStreamController,\n view,\n min,\n readIntoRequest\n );\n }\n}\n\nexport function ReadableStreamBYOBReaderRelease(reader: ReadableStreamBYOBReader) {\n ReadableStreamReaderGenericRelease(reader);\n const e = new TypeError(&#x27;Reader was released&#x27;);\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n}\n\nexport function ReadableStreamBYOBReaderErrorReadIntoRequests(reader: ReadableStreamBYOBReader, e: any) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest =&gt; {\n readIntoRequest._errorSteps(e);\n });\n}\n\n// Helper functions for the ReadableStreamBYOBReader.\n\nfunction byobReaderBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);\n}\n&quot;, &quot;import type { QueuingStrategy, QueuingStrategySizeCallback } from &#x27;../queuing-strategy&#x27;;\nimport NumberIsNaN from &#x27;../../stub/number-isnan&#x27;;\n\nexport function ExtractHighWaterMark(strategy: QueuingStrategy, defaultHWM: number): number {\n const { highWaterMark } = strategy;\n\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n\n if (NumberIsNaN(highWaterMark) || highWaterMark &lt; 0) {\n throw new RangeError(&#x27;Invalid highWaterMark&#x27;);\n }\n\n return highWaterMark;\n}\n\nexport function ExtractSizeAlgorithm&lt;T&gt;(strategy: QueuingStrategy&lt;T&gt;): QueuingStrategySizeCallback&lt;T&gt; {\n const { size } = strategy;\n\n if (!size) {\n return () =&gt; 1;\n }\n\n return size;\n}\n&quot;, &quot;import type { QueuingStrategy, QueuingStrategySizeCallback } from &#x27;../queuing-strategy&#x27;;\nimport { assertDictionary, assertFunction, convertUnrestrictedDouble } from &#x27;./basic&#x27;;\n\nexport function convertQueuingStrategy&lt;T&gt;(init: QueuingStrategy&lt;T&gt; | null | undefined,\n context: string): QueuingStrategy&lt;T&gt; {\n assertDictionary(init, context);\n const highWaterMark = init?.highWaterMark;\n const size = init?.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, `${context} has member &#x27;size&#x27; that`)\n };\n}\n\nfunction convertQueuingStrategySize&lt;T&gt;(fn: QueuingStrategySizeCallback&lt;T&gt;,\n context: string): QueuingStrategySizeCallback&lt;T&gt; {\n assertFunction(fn, context);\n return chunk =&gt; convertUnrestrictedDouble(fn(chunk));\n}\n&quot;, &quot;import { assertDictionary, assertFunction } from &#x27;./basic&#x27;;\nimport { promiseCall, reflectCall } from &#x27;../helpers/webidl&#x27;;\nimport type {\n UnderlyingSink,\n UnderlyingSinkAbortCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n ValidatedUnderlyingSink\n} from &#x27;../writable-stream/underlying-sink&#x27;;\nimport { WritableStreamDefaultController } from &#x27;../writable-stream&#x27;;\n\nexport function convertUnderlyingSink&lt;W&gt;(original: UnderlyingSink&lt;W&gt; | null,\n context: string): ValidatedUnderlyingSink&lt;W&gt; {\n assertDictionary(original, context);\n const abort = original?.abort;\n const close = original?.close;\n const start = original?.start;\n const type = original?.type;\n const write = original?.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original!, `${context} has member &#x27;abort&#x27; that`),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original!, `${context} has member &#x27;close&#x27; that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original!, `${context} has member &#x27;start&#x27; that`),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original!, `${context} has member &#x27;write&#x27; that`),\n type\n };\n}\n\nfunction convertUnderlyingSinkAbortCallback(\n fn: UnderlyingSinkAbortCallback,\n original: UnderlyingSink,\n context: string\n): (reason: any) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (reason: any) =&gt; promiseCall(fn, original, [reason]);\n}\n\nfunction convertUnderlyingSinkCloseCallback(\n fn: UnderlyingSinkCloseCallback,\n original: UnderlyingSink,\n context: string\n): () =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return () =&gt; promiseCall(fn, original, []);\n}\n\nfunction convertUnderlyingSinkStartCallback(\n fn: UnderlyingSinkStartCallback,\n original: UnderlyingSink,\n context: string\n): UnderlyingSinkStartCallback {\n assertFunction(fn, context);\n return (controller: WritableStreamDefaultController) =&gt; reflectCall(fn, original, [controller]);\n}\n\nfunction convertUnderlyingSinkWriteCallback&lt;W&gt;(\n fn: UnderlyingSinkWriteCallback&lt;W&gt;,\n original: UnderlyingSink&lt;W&gt;,\n context: string\n): (chunk: W, controller: WritableStreamDefaultController) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (chunk: W, controller: WritableStreamDefaultController) =&gt; promiseCall(fn, original, [chunk, controller]);\n}\n&quot;, &quot;import { IsWritableStream, WritableStream } from &#x27;../writable-stream&#x27;;\n\nexport function assertWritableStream(x: unknown, context: string): asserts x is WritableStream {\n if (!IsWritableStream(x)) {\n throw new TypeError(`${context} is not a WritableStream.`);\n }\n}\n&quot;, &quot;/**\n * A signal object that allows you to communicate with a request and abort it if required\n * via its associated `AbortController` object.\n *\n * @remarks\n * This interface is compatible with the `AbortSignal` interface defined in TypeScript&#x27;s DOM types.\n * It is redefined here, so it can be polyfilled without a DOM, for example with\n * {@link https://www.npmjs.com/package/abortcontroller-polyfill | abortcontroller-polyfill} in a Node environment.\n *\n * @public\n */\nexport interface AbortSignal {\n /**\n * Whether the request is aborted.\n */\n readonly aborted: boolean;\n\n /**\n * If aborted, returns the reason for aborting.\n */\n readonly reason?: any;\n\n /**\n * Add an event listener to be triggered when this signal becomes aborted.\n */\n addEventListener(type: &#x27;abort&#x27;, listener: () =&gt; void): void;\n\n /**\n * Remove an event listener that was previously added with {@link AbortSignal.addEventListener}.\n */\n removeEventListener(type: &#x27;abort&#x27;, listener: () =&gt; void): void;\n}\n\nexport function isAbortSignal(value: unknown): value is AbortSignal {\n if (typeof value !== &#x27;object&#x27; || value === null) {\n return false;\n }\n try {\n return typeof (value as AbortSignal).aborted === &#x27;boolean&#x27;;\n } catch {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n}\n\n/**\n * A controller object that allows you to abort an `AbortSignal` when desired.\n *\n * @remarks\n * This interface is compatible with the `AbortController` interface defined in TypeScript&#x27;s DOM types.\n * It is redefined here, so it can be polyfilled without a DOM, for example with\n * {@link https://www.npmjs.com/package/abortcontroller-polyfill | abortcontroller-polyfill} in a Node environment.\n *\n * @internal\n */\nexport interface AbortController {\n readonly signal: AbortSignal;\n\n abort(reason?: any): void;\n}\n\ninterface AbortControllerConstructor {\n new(): AbortController;\n}\n\nconst supportsAbortController = typeof (AbortController as any) === &#x27;function&#x27;;\n\n/**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\nexport function createAbortController(): AbortController | undefined {\n if (supportsAbortController) {\n return new (AbortController as AbortControllerConstructor)();\n }\n return undefined;\n}\n&quot;, &quot;import assert from &#x27;../stub/assert&#x27;;\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n uponPromise\n} from &#x27;./helpers/webidl&#x27;;\nimport {\n DequeueValue,\n EnqueueValueWithSize,\n PeekQueueValue,\n type QueuePair,\n ResetQueue\n} from &#x27;./abstract-ops/queue-with-sizes&#x27;;\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from &#x27;./queuing-strategy&#x27;;\nimport { SimpleQueue } from &#x27;./simple-queue&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;./helpers/miscellaneous&#x27;;\nimport { AbortSteps, ErrorSteps } from &#x27;./abstract-ops/internal-methods&#x27;;\nimport { IsNonNegativeNumber } from &#x27;./abstract-ops/miscellaneous&#x27;;\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from &#x27;./abstract-ops/queuing-strategy&#x27;;\nimport { convertQueuingStrategy } from &#x27;./validators/queuing-strategy&#x27;;\nimport type {\n UnderlyingSink,\n UnderlyingSinkAbortCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n ValidatedUnderlyingSink\n} from &#x27;./writable-stream/underlying-sink&#x27;;\nimport { assertObject, assertRequiredArgument } from &#x27;./validators/basic&#x27;;\nimport { convertUnderlyingSink } from &#x27;./validators/underlying-sink&#x27;;\nimport { assertWritableStream } from &#x27;./validators/writable-stream&#x27;;\nimport { type AbortController, type AbortSignal, createAbortController } from &#x27;./abort-signal&#x27;;\n\ntype WritableStreamState = &#x27;writable&#x27; | &#x27;closed&#x27; | &#x27;erroring&#x27; | &#x27;errored&#x27;;\n\ninterface WriteOrCloseRequest {\n _resolve: (value?: undefined) =&gt; void;\n _reject: (reason: any) =&gt; void;\n}\n\ntype WriteRequest = WriteOrCloseRequest;\ntype CloseRequest = WriteOrCloseRequest;\n\ninterface PendingAbortRequest {\n _promise: Promise&lt;undefined&gt;;\n _resolve: (value?: undefined) =&gt; void;\n _reject: (reason: any) =&gt; void;\n _reason: any;\n _wasAlreadyErroring: boolean;\n}\n\n/**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\nclass WritableStream&lt;W = any&gt; {\n /** @internal */\n _state!: WritableStreamState;\n /** @internal */\n _storedError: any;\n /** @internal */\n _writer: WritableStreamDefaultWriter&lt;W&gt; | undefined;\n /** @internal */\n _writableStreamController!: WritableStreamDefaultController&lt;W&gt;;\n /** @internal */\n _writeRequests!: SimpleQueue&lt;WriteRequest&gt;;\n /** @internal */\n _inFlightWriteRequest: WriteRequest | undefined;\n /** @internal */\n _closeRequest: CloseRequest | undefined;\n /** @internal */\n _inFlightCloseRequest: CloseRequest | undefined;\n /** @internal */\n _pendingAbortRequest: PendingAbortRequest | undefined;\n /** @internal */\n _backpressure!: boolean;\n\n constructor(underlyingSink?: UnderlyingSink&lt;W&gt;, strategy?: QueuingStrategy&lt;W&gt;);\n constructor(rawUnderlyingSink: UnderlyingSink&lt;W&gt; | null | undefined = {},\n rawStrategy: QueuingStrategy&lt;W&gt; | null | undefined = {}) {\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n } else {\n assertObject(rawUnderlyingSink, &#x27;First parameter&#x27;);\n }\n\n const strategy = convertQueuingStrategy(rawStrategy, &#x27;Second parameter&#x27;);\n const underlyingSink = convertUnderlyingSink(rawUnderlyingSink, &#x27;First parameter&#x27;);\n\n InitializeWritableStream(this);\n\n const type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError(&#x27;Invalid type is specified&#x27;);\n }\n\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get locked(): boolean {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException(&#x27;locked&#x27;);\n }\n\n return IsWritableStreamLocked(this);\n }\n\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n abort(reason: any = undefined): Promise&lt;void&gt; {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException(&#x27;abort&#x27;));\n }\n\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError(&#x27;Cannot abort a stream that already has a writer&#x27;));\n }\n\n return WritableStreamAbort(this, reason);\n }\n\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n close() {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException(&#x27;close&#x27;));\n }\n\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError(&#x27;Cannot close a stream that already has a writer&#x27;));\n }\n\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError(&#x27;Cannot close an already-closing stream&#x27;));\n }\n\n return WritableStreamClose(this);\n }\n\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n getWriter(): WritableStreamDefaultWriter&lt;W&gt; {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException(&#x27;getWriter&#x27;);\n }\n\n return AcquireWritableStreamDefaultWriter(this);\n }\n}\n\nObject.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n});\nsetFunctionName(WritableStream.prototype.abort, &#x27;abort&#x27;);\nsetFunctionName(WritableStream.prototype.close, &#x27;close&#x27;);\nsetFunctionName(WritableStream.prototype.getWriter, &#x27;getWriter&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, {\n value: &#x27;WritableStream&#x27;,\n configurable: true\n });\n}\n\nexport {\n AcquireWritableStreamDefaultWriter,\n CreateWritableStream,\n IsWritableStream,\n IsWritableStreamLocked,\n WritableStream,\n WritableStreamAbort,\n WritableStreamDefaultControllerErrorIfNeeded,\n WritableStreamDefaultWriterCloseWithErrorPropagation,\n WritableStreamDefaultWriterRelease,\n WritableStreamDefaultWriterWrite,\n WritableStreamCloseQueuedOrInFlight\n};\n\nexport type {\n UnderlyingSink,\n UnderlyingSinkStartCallback,\n UnderlyingSinkWriteCallback,\n UnderlyingSinkCloseCallback,\n UnderlyingSinkAbortCallback\n};\n\n// Abstract operations for the WritableStream.\n\nfunction AcquireWritableStreamDefaultWriter&lt;W&gt;(stream: WritableStream&lt;W&gt;): WritableStreamDefaultWriter&lt;W&gt; {\n return new WritableStreamDefaultWriter(stream);\n}\n\n// Throws if and only if startAlgorithm throws.\nfunction CreateWritableStream&lt;W&gt;(startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n writeAlgorithm: (chunk: W) =&gt; Promise&lt;void&gt;,\n closeAlgorithm: () =&gt; Promise&lt;void&gt;,\n abortAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n highWaterMark = 1,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;W&gt; = () =&gt; 1) {\n assert(IsNonNegativeNumber(highWaterMark));\n\n const stream: WritableStream&lt;W&gt; = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n\n const controller: WritableStreamDefaultController&lt;W&gt; = Object.create(WritableStreamDefaultController.prototype);\n\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm,\n abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n}\n\nfunction InitializeWritableStream&lt;W&gt;(stream: WritableStream&lt;W&gt;) {\n stream._state = &#x27;writable&#x27;;\n\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // &#x27;erroring&#x27; or &#x27;errored&#x27;. May be set to an undefined value.\n stream._storedError = undefined;\n\n stream._writer = undefined;\n\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined!;\n\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n}\n\nfunction IsWritableStream(x: unknown): x is WritableStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_writableStreamController&#x27;)) {\n return false;\n }\n\n return x instanceof WritableStream;\n}\n\nfunction IsWritableStreamLocked(stream: WritableStream): boolean {\n assert(IsWritableStream(stream));\n\n if (stream._writer === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamAbort(stream: WritableStream, reason: any): Promise&lt;undefined&gt; {\n if (stream._state === &#x27;closed&#x27; || stream._state === &#x27;errored&#x27;) {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n stream._writableStreamController._abortController?.abort(reason);\n\n // TypeScript narrows the type of `stream._state` down to &#x27;writable&#x27; | &#x27;erroring&#x27;,\n // but it doesn&#x27;t know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n const state = stream._state as WritableStreamState;\n\n if (state === &#x27;closed&#x27; || state === &#x27;errored&#x27;) {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n\n assert(state === &#x27;writable&#x27; || state === &#x27;erroring&#x27;);\n\n let wasAlreadyErroring = false;\n if (state === &#x27;erroring&#x27;) {\n wasAlreadyErroring = true;\n // reason will not be used, so don&#x27;t keep a reference to it.\n reason = undefined;\n }\n\n const promise = newPromise&lt;undefined&gt;((resolve, reject) =&gt; {\n stream._pendingAbortRequest = {\n _promise: undefined!,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest!._promise = promise;\n\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n\n return promise;\n}\n\nfunction WritableStreamClose(stream: WritableStream&lt;any&gt;): Promise&lt;undefined&gt; {\n const state = stream._state;\n if (state === &#x27;closed&#x27; || state === &#x27;errored&#x27;) {\n return promiseRejectedWith(new TypeError(\n `The stream (in ${state} state) is not in the writable state and cannot be closed`));\n }\n\n assert(state === &#x27;writable&#x27; || state === &#x27;erroring&#x27;);\n assert(!WritableStreamCloseQueuedOrInFlight(stream));\n\n const promise = newPromise&lt;undefined&gt;((resolve, reject) =&gt; {\n const closeRequest: CloseRequest = {\n _resolve: resolve,\n _reject: reject\n };\n\n stream._closeRequest = closeRequest;\n });\n\n const writer = stream._writer;\n if (writer !== undefined &amp;&amp; stream._backpressure &amp;&amp; state === &#x27;writable&#x27;) {\n defaultWriterReadyPromiseResolve(writer);\n }\n\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n\n return promise;\n}\n\n// WritableStream API exposed for controllers.\n\nfunction WritableStreamAddWriteRequest(stream: WritableStream): Promise&lt;undefined&gt; {\n assert(IsWritableStreamLocked(stream));\n assert(stream._state === &#x27;writable&#x27;);\n\n const promise = newPromise&lt;undefined&gt;((resolve, reject) =&gt; {\n const writeRequest: WriteRequest = {\n _resolve: resolve,\n _reject: reject\n };\n\n stream._writeRequests.push(writeRequest);\n });\n\n return promise;\n}\n\nfunction WritableStreamDealWithRejection(stream: WritableStream, error: any) {\n const state = stream._state;\n\n if (state === &#x27;writable&#x27;) {\n WritableStreamStartErroring(stream, error);\n return;\n }\n\n assert(state === &#x27;erroring&#x27;);\n WritableStreamFinishErroring(stream);\n}\n\nfunction WritableStreamStartErroring(stream: WritableStream, reason: any) {\n assert(stream._storedError === undefined);\n assert(stream._state === &#x27;writable&#x27;);\n\n const controller = stream._writableStreamController;\n assert(controller !== undefined);\n\n stream._state = &#x27;erroring&#x27;;\n stream._storedError = reason;\n const writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n\n if (!WritableStreamHasOperationMarkedInFlight(stream) &amp;&amp; controller._started) {\n WritableStreamFinishErroring(stream);\n }\n}\n\nfunction WritableStreamFinishErroring(stream: WritableStream) {\n assert(stream._state === &#x27;erroring&#x27;);\n assert(!WritableStreamHasOperationMarkedInFlight(stream));\n stream._state = &#x27;errored&#x27;;\n stream._writableStreamController[ErrorSteps]();\n\n const storedError = stream._storedError;\n stream._writeRequests.forEach(writeRequest =&gt; {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n\n const abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n\n const promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(\n promise,\n () =&gt; {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n },\n (reason: any) =&gt; {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return null;\n });\n}\n\nfunction WritableStreamFinishInFlightWrite(stream: WritableStream) {\n assert(stream._inFlightWriteRequest !== undefined);\n stream._inFlightWriteRequest!._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n}\n\nfunction WritableStreamFinishInFlightWriteWithError(stream: WritableStream, error: any) {\n assert(stream._inFlightWriteRequest !== undefined);\n stream._inFlightWriteRequest!._reject(error);\n stream._inFlightWriteRequest = undefined;\n\n assert(stream._state === &#x27;writable&#x27; || stream._state === &#x27;erroring&#x27;);\n\n WritableStreamDealWithRejection(stream, error);\n}\n\nfunction WritableStreamFinishInFlightClose(stream: WritableStream) {\n assert(stream._inFlightCloseRequest !== undefined);\n stream._inFlightCloseRequest!._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n\n const state = stream._state;\n\n assert(state === &#x27;writable&#x27; || state === &#x27;erroring&#x27;);\n\n if (state === &#x27;erroring&#x27;) {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n\n stream._state = &#x27;closed&#x27;;\n\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n\n assert(stream._pendingAbortRequest === undefined);\n assert(stream._storedError === undefined);\n}\n\nfunction WritableStreamFinishInFlightCloseWithError(stream: WritableStream, error: any) {\n assert(stream._inFlightCloseRequest !== undefined);\n stream._inFlightCloseRequest!._reject(error);\n stream._inFlightCloseRequest = undefined;\n\n assert(stream._state === &#x27;writable&#x27; || stream._state === &#x27;erroring&#x27;);\n\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n}\n\n// TODO(ricea): Fix alphabetical order.\nfunction WritableStreamCloseQueuedOrInFlight(stream: WritableStream): boolean {\n if (stream._closeRequest === undefined &amp;&amp; stream._inFlightCloseRequest === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamHasOperationMarkedInFlight(stream: WritableStream): boolean {\n if (stream._inFlightWriteRequest === undefined &amp;&amp; stream._inFlightCloseRequest === undefined) {\n return false;\n }\n\n return true;\n}\n\nfunction WritableStreamMarkCloseRequestInFlight(stream: WritableStream) {\n assert(stream._inFlightCloseRequest === undefined);\n assert(stream._closeRequest !== undefined);\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n}\n\nfunction WritableStreamMarkFirstWriteRequestInFlight(stream: WritableStream) {\n assert(stream._inFlightWriteRequest === undefined);\n assert(stream._writeRequests.length !== 0);\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n}\n\nfunction WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream: WritableStream) {\n assert(stream._state === &#x27;errored&#x27;);\n if (stream._closeRequest !== undefined) {\n assert(stream._inFlightCloseRequest === undefined);\n\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n const writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n}\n\nfunction WritableStreamUpdateBackpressure(stream: WritableStream, backpressure: boolean) {\n assert(stream._state === &#x27;writable&#x27;);\n assert(!WritableStreamCloseQueuedOrInFlight(stream));\n\n const writer = stream._writer;\n if (writer !== undefined &amp;&amp; backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n } else {\n assert(!backpressure);\n\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n\n stream._backpressure = backpressure;\n}\n\n/**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\nexport class WritableStreamDefaultWriter&lt;W = any&gt; {\n /** @internal */\n _ownerWritableStream: WritableStream&lt;W&gt;;\n /** @internal */\n _closedPromise!: Promise&lt;undefined&gt;;\n /** @internal */\n _closedPromise_resolve?: (value?: undefined) =&gt; void;\n /** @internal */\n _closedPromise_reject?: (reason: any) =&gt; void;\n /** @internal */\n _closedPromiseState!: &#x27;pending&#x27; | &#x27;resolved&#x27; | &#x27;rejected&#x27;;\n /** @internal */\n _readyPromise!: Promise&lt;undefined&gt;;\n /** @internal */\n _readyPromise_resolve?: (value?: undefined) =&gt; void;\n /** @internal */\n _readyPromise_reject?: (reason: any) =&gt; void;\n /** @internal */\n _readyPromiseState!: &#x27;pending&#x27; | &#x27;fulfilled&#x27; | &#x27;rejected&#x27;;\n\n constructor(stream: WritableStream&lt;W&gt;) {\n assertRequiredArgument(stream, 1, &#x27;WritableStreamDefaultWriter&#x27;);\n assertWritableStream(stream, &#x27;First parameter&#x27;);\n\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError(&#x27;This stream has already been locked for exclusive writing by another writer&#x27;);\n }\n\n this._ownerWritableStream = stream;\n stream._writer = this;\n\n const state = stream._state;\n\n if (state === &#x27;writable&#x27;) {\n if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n } else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n\n defaultWriterClosedPromiseInitialize(this);\n } else if (state === &#x27;erroring&#x27;) {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n } else if (state === &#x27;closed&#x27;) {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n } else {\n assert(state === &#x27;errored&#x27;);\n\n const storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writerโ€™s lock is released before the stream finishes closing.\n */\n get closed(): Promise&lt;undefined&gt; {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException(&#x27;closed&#x27;));\n }\n\n return this._closedPromise;\n }\n\n /**\n * Returns the desired size to fill the streamโ€™s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writerโ€™s lock is released.\n */\n get desiredSize(): number | null {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException(&#x27;desiredSize&#x27;);\n }\n\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException(&#x27;desiredSize&#x27;);\n }\n\n return WritableStreamDefaultWriterGetDesiredSize(this);\n }\n\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the streamโ€™s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writerโ€™s lock is released, the returned promise will become\n * rejected.\n */\n get ready(): Promise&lt;undefined&gt; {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException(&#x27;ready&#x27;));\n }\n\n return this._readyPromise;\n }\n\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n abort(reason: any = undefined): Promise&lt;void&gt; {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException(&#x27;abort&#x27;));\n }\n\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException(&#x27;abort&#x27;));\n }\n\n return WritableStreamDefaultWriterAbort(this, reason);\n }\n\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n close(): Promise&lt;void&gt; {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException(&#x27;close&#x27;));\n }\n\n const stream = this._ownerWritableStream;\n\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException(&#x27;close&#x27;));\n }\n\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError(&#x27;Cannot close an already-closing stream&#x27;));\n }\n\n return WritableStreamDefaultWriterClose(this);\n }\n\n /**\n * Releases the writerโ€™s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * Itโ€™s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n releaseLock(): void {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException(&#x27;releaseLock&#x27;);\n }\n\n const stream = this._ownerWritableStream;\n\n if (stream === undefined) {\n return;\n }\n\n assert(stream._writer !== undefined);\n\n WritableStreamDefaultWriterRelease(this);\n }\n\n /**\n * Writes the given chunk to the writable stream, by waiting until any previous writes have finished successfully,\n * and then sending the chunk to the underlying sink&#x27;s {@link UnderlyingSink.write | write()} method. It will return\n * a promise that fulfills with undefined upon a successful write, or rejects if the write fails or stream becomes\n * errored before the writing process is initiated.\n *\n * Note that what \&quot;success\&quot; means is up to the underlying sink; it might indicate simply that the chunk has been\n * accepted, and not necessarily that it is safely saved to its ultimate destination.\n */\n write(chunk: W): Promise&lt;void&gt;;\n write(chunk: W = undefined!): Promise&lt;void&gt; {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException(&#x27;write&#x27;));\n }\n\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException(&#x27;write to&#x27;));\n }\n\n return WritableStreamDefaultWriterWrite(this, chunk);\n }\n}\n\nObject.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n});\nsetFunctionName(WritableStreamDefaultWriter.prototype.abort, &#x27;abort&#x27;);\nsetFunctionName(WritableStreamDefaultWriter.prototype.close, &#x27;close&#x27;);\nsetFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, &#x27;releaseLock&#x27;);\nsetFunctionName(WritableStreamDefaultWriter.prototype.write, &#x27;write&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, {\n value: &#x27;WritableStreamDefaultWriter&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations for the WritableStreamDefaultWriter.\n\nfunction IsWritableStreamDefaultWriter&lt;W = any&gt;(x: any): x is WritableStreamDefaultWriter&lt;W&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_ownerWritableStream&#x27;)) {\n return false;\n }\n\n return x instanceof WritableStreamDefaultWriter;\n}\n\n// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n\nfunction WritableStreamDefaultWriterAbort(writer: WritableStreamDefaultWriter, reason: any) {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n return WritableStreamAbort(stream, reason);\n}\n\nfunction WritableStreamDefaultWriterClose(writer: WritableStreamDefaultWriter): Promise&lt;undefined&gt; {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n return WritableStreamClose(stream);\n}\n\nfunction WritableStreamDefaultWriterCloseWithErrorPropagation(writer: WritableStreamDefaultWriter): Promise&lt;undefined&gt; {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n const state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === &#x27;closed&#x27;) {\n return promiseResolvedWith(undefined);\n }\n\n if (state === &#x27;errored&#x27;) {\n return promiseRejectedWith(stream._storedError);\n }\n\n assert(state === &#x27;writable&#x27; || state === &#x27;erroring&#x27;);\n\n return WritableStreamDefaultWriterClose(writer);\n}\n\nfunction WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer: WritableStreamDefaultWriter, error: any) {\n if (writer._closedPromiseState === &#x27;pending&#x27;) {\n defaultWriterClosedPromiseReject(writer, error);\n } else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n}\n\nfunction WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer: WritableStreamDefaultWriter, error: any) {\n if (writer._readyPromiseState === &#x27;pending&#x27;) {\n defaultWriterReadyPromiseReject(writer, error);\n } else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n}\n\nfunction WritableStreamDefaultWriterGetDesiredSize(writer: WritableStreamDefaultWriter): number | null {\n const stream = writer._ownerWritableStream;\n const state = stream._state;\n\n if (state === &#x27;errored&#x27; || state === &#x27;erroring&#x27;) {\n return null;\n }\n\n if (state === &#x27;closed&#x27;) {\n return 0;\n }\n\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n}\n\nfunction WritableStreamDefaultWriterRelease(writer: WritableStreamDefaultWriter) {\n const stream = writer._ownerWritableStream;\n assert(stream !== undefined);\n assert(stream._writer === writer);\n\n const releasedError = new TypeError(\n `Writer was released and can no longer be used to monitor the stream&#x27;s closedness`);\n\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n\n // The state transitions to \&quot;errored\&quot; before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n\n stream._writer = undefined;\n writer._ownerWritableStream = undefined!;\n}\n\nfunction WritableStreamDefaultWriterWrite&lt;W&gt;(writer: WritableStreamDefaultWriter&lt;W&gt;, chunk: W): Promise&lt;undefined&gt; {\n const stream = writer._ownerWritableStream;\n\n assert(stream !== undefined);\n\n const controller = stream._writableStreamController;\n\n const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException(&#x27;write to&#x27;));\n }\n\n const state = stream._state;\n if (state === &#x27;errored&#x27;) {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === &#x27;closed&#x27;) {\n return promiseRejectedWith(new TypeError(&#x27;The stream is closing or closed and cannot be written to&#x27;));\n }\n if (state === &#x27;erroring&#x27;) {\n return promiseRejectedWith(stream._storedError);\n }\n\n assert(state === &#x27;writable&#x27;);\n\n const promise = WritableStreamAddWriteRequest(stream);\n\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n\n return promise;\n}\n\nconst closeSentinel: unique symbol = {} as any;\n\ntype QueueRecord&lt;W&gt; = W | typeof closeSentinel;\n\n/**\n * Allows control of a {@link WritableStream | writable stream}&#x27;s state and internal queue.\n *\n * @public\n */\nexport class WritableStreamDefaultController&lt;W = any&gt; {\n /** @internal */\n _controlledWritableStream!: WritableStream&lt;W&gt;;\n /** @internal */\n _queue!: SimpleQueue&lt;QueuePair&lt;QueueRecord&lt;W&gt;&gt;&gt;;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _abortReason: any;\n /** @internal */\n _abortController: AbortController | undefined;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _strategySizeAlgorithm!: QueuingStrategySizeCallback&lt;W&gt;;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _writeAlgorithm!: (chunk: W) =&gt; Promise&lt;void&gt;;\n /** @internal */\n _closeAlgorithm!: () =&gt; Promise&lt;void&gt;;\n /** @internal */\n _abortAlgorithm!: (reason: any) =&gt; Promise&lt;void&gt;;\n\n private constructor() {\n throw new TypeError(&#x27;Illegal constructor&#x27;);\n }\n\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}&#x27;s `reason` instead.\n */\n get abortReason(): any {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;abortReason&#x27;);\n }\n return this._abortReason;\n }\n\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get signal(): AbortSignal {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;signal&#x27;);\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don&#x27;t want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError(&#x27;WritableStreamDefaultController.prototype.signal is not supported&#x27;);\n }\n return this._abortController.signal;\n }\n\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink&#x27;s methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n error(e: any = undefined): void {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;error&#x27;);\n }\n const state = this._controlledWritableStream._state;\n if (state !== &#x27;writable&#x27;) {\n // The stream is closed, errored or will be soon. The sink can&#x27;t do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n\n WritableStreamDefaultControllerError(this, e);\n }\n\n /** @internal */\n [AbortSteps](reason: any): Promise&lt;void&gt; {\n const result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [ErrorSteps]() {\n ResetQueue(this);\n }\n}\n\nObject.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: &#x27;WritableStreamDefaultController&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations implementing interface required by the WritableStream.\n\nfunction IsWritableStreamDefaultController(x: any): x is WritableStreamDefaultController&lt;any&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_controlledWritableStream&#x27;)) {\n return false;\n }\n\n return x instanceof WritableStreamDefaultController;\n}\n\nfunction SetUpWritableStreamDefaultController&lt;W&gt;(stream: WritableStream&lt;W&gt;,\n controller: WritableStreamDefaultController&lt;W&gt;,\n startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n writeAlgorithm: (chunk: W) =&gt; Promise&lt;void&gt;,\n closeAlgorithm: () =&gt; Promise&lt;void&gt;,\n abortAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;W&gt;) {\n assert(IsWritableStream(stream));\n assert(stream._writableStreamController === undefined);\n\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n\n // Need to set the slots so that the assert doesn&#x27;t fire. In the spec the slots already exist implicitly.\n controller._queue = undefined!;\n controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n\n const startResult = startAlgorithm();\n const startPromise = promiseResolvedWith(startResult);\n uponPromise(\n startPromise,\n () =&gt; {\n assert(stream._state === &#x27;writable&#x27; || stream._state === &#x27;erroring&#x27;);\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n },\n r =&gt; {\n assert(stream._state === &#x27;writable&#x27; || stream._state === &#x27;erroring&#x27;);\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n return null;\n }\n );\n}\n\nfunction SetUpWritableStreamDefaultControllerFromUnderlyingSink&lt;W&gt;(stream: WritableStream&lt;W&gt;,\n underlyingSink: ValidatedUnderlyingSink&lt;W&gt;,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;W&gt;) {\n const controller = Object.create(WritableStreamDefaultController.prototype);\n\n let startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;;\n let writeAlgorithm: (chunk: W) =&gt; Promise&lt;void&gt;;\n let closeAlgorithm: () =&gt; Promise&lt;void&gt;;\n let abortAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;;\n\n if (underlyingSink.start !== undefined) {\n startAlgorithm = () =&gt; underlyingSink.start!(controller);\n } else {\n startAlgorithm = () =&gt; undefined;\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = chunk =&gt; underlyingSink.write!(chunk, controller);\n } else {\n writeAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = () =&gt; underlyingSink.close!();\n } else {\n closeAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = reason =&gt; underlyingSink.abort!(reason);\n } else {\n abortAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n\n SetUpWritableStreamDefaultController(\n stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm\n );\n}\n\n// ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\nfunction WritableStreamDefaultControllerClearAlgorithms(controller: WritableStreamDefaultController&lt;any&gt;) {\n controller._writeAlgorithm = undefined!;\n controller._closeAlgorithm = undefined!;\n controller._abortAlgorithm = undefined!;\n controller._strategySizeAlgorithm = undefined!;\n}\n\nfunction WritableStreamDefaultControllerClose&lt;W&gt;(controller: WritableStreamDefaultController&lt;W&gt;) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\n\nfunction WritableStreamDefaultControllerGetChunkSize&lt;W&gt;(controller: WritableStreamDefaultController&lt;W&gt;,\n chunk: W): number {\n try {\n return controller._strategySizeAlgorithm(chunk);\n } catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n}\n\nfunction WritableStreamDefaultControllerGetDesiredSize(controller: WritableStreamDefaultController&lt;any&gt;): number {\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\nfunction WritableStreamDefaultControllerWrite&lt;W&gt;(controller: WritableStreamDefaultController&lt;W&gt;,\n chunk: W,\n chunkSize: number) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n } catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n\n const stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; stream._state === &#x27;writable&#x27;) {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n}\n\n// Abstract operations for the WritableStreamDefaultController.\n\nfunction WritableStreamDefaultControllerAdvanceQueueIfNeeded&lt;W&gt;(controller: WritableStreamDefaultController&lt;W&gt;) {\n const stream = controller._controlledWritableStream;\n\n if (!controller._started) {\n return;\n }\n\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n\n const state = stream._state;\n assert(state !== &#x27;closed&#x27; &amp;&amp; state !== &#x27;errored&#x27;);\n if (state === &#x27;erroring&#x27;) {\n WritableStreamFinishErroring(stream);\n return;\n }\n\n if (controller._queue.length === 0) {\n return;\n }\n\n const value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n } else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n}\n\nfunction WritableStreamDefaultControllerErrorIfNeeded(controller: WritableStreamDefaultController&lt;any&gt;, error: any) {\n if (controller._controlledWritableStream._state === &#x27;writable&#x27;) {\n WritableStreamDefaultControllerError(controller, error);\n }\n}\n\nfunction WritableStreamDefaultControllerProcessClose(controller: WritableStreamDefaultController&lt;any&gt;) {\n const stream = controller._controlledWritableStream;\n\n WritableStreamMarkCloseRequestInFlight(stream);\n\n DequeueValue(controller);\n assert(controller._queue.length === 0);\n\n const sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(\n sinkClosePromise,\n () =&gt; {\n WritableStreamFinishInFlightClose(stream);\n return null;\n },\n reason =&gt; {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n return null;\n }\n );\n}\n\nfunction WritableStreamDefaultControllerProcessWrite&lt;W&gt;(controller: WritableStreamDefaultController&lt;W&gt;, chunk: W) {\n const stream = controller._controlledWritableStream;\n\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n\n const sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(\n sinkWritePromise,\n () =&gt; {\n WritableStreamFinishInFlightWrite(stream);\n\n const state = stream._state;\n assert(state === &#x27;writable&#x27; || state === &#x27;erroring&#x27;);\n\n DequeueValue(controller);\n\n if (!WritableStreamCloseQueuedOrInFlight(stream) &amp;&amp; state === &#x27;writable&#x27;) {\n const backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n return null;\n },\n reason =&gt; {\n if (stream._state === &#x27;writable&#x27;) {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n return null;\n }\n );\n}\n\nfunction WritableStreamDefaultControllerGetBackpressure(controller: WritableStreamDefaultController&lt;any&gt;): boolean {\n const desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize &lt;= 0;\n}\n\n// A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n\nfunction WritableStreamDefaultControllerError(controller: WritableStreamDefaultController&lt;any&gt;, error: any) {\n const stream = controller._controlledWritableStream;\n\n assert(stream._state === &#x27;writable&#x27;);\n\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n}\n\n// Helper functions for the WritableStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);\n}\n\n// Helper functions for the WritableStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);\n}\n\n\n// Helper functions for the WritableStreamDefaultWriter.\n\nfunction defaultWriterBrandCheckException(name: string): TypeError {\n return new TypeError(\n `WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);\n}\n\nfunction defaultWriterLockException(name: string): TypeError {\n return new TypeError(&#x27;Cannot &#x27; + name + &#x27; a stream using a released writer&#x27;);\n}\n\nfunction defaultWriterClosedPromiseInitialize(writer: WritableStreamDefaultWriter) {\n writer._closedPromise = newPromise((resolve, reject) =&gt; {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = &#x27;pending&#x27;;\n });\n}\n\nfunction defaultWriterClosedPromiseInitializeAsRejected(writer: WritableStreamDefaultWriter, reason: any) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n}\n\nfunction defaultWriterClosedPromiseInitializeAsResolved(writer: WritableStreamDefaultWriter) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n}\n\nfunction defaultWriterClosedPromiseReject(writer: WritableStreamDefaultWriter, reason: any) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n assert(writer._closedPromiseState === &#x27;pending&#x27;);\n\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = &#x27;rejected&#x27;;\n}\n\nfunction defaultWriterClosedPromiseResetToRejected(writer: WritableStreamDefaultWriter, reason: any) {\n assert(writer._closedPromise_resolve === undefined);\n assert(writer._closedPromise_reject === undefined);\n assert(writer._closedPromiseState !== &#x27;pending&#x27;);\n\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n}\n\nfunction defaultWriterClosedPromiseResolve(writer: WritableStreamDefaultWriter) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n assert(writer._closedPromiseState === &#x27;pending&#x27;);\n\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = &#x27;resolved&#x27;;\n}\n\nfunction defaultWriterReadyPromiseInitialize(writer: WritableStreamDefaultWriter) {\n writer._readyPromise = newPromise((resolve, reject) =&gt; {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = &#x27;pending&#x27;;\n}\n\nfunction defaultWriterReadyPromiseInitializeAsRejected(writer: WritableStreamDefaultWriter, reason: any) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n}\n\nfunction defaultWriterReadyPromiseInitializeAsResolved(writer: WritableStreamDefaultWriter) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n}\n\nfunction defaultWriterReadyPromiseReject(writer: WritableStreamDefaultWriter, reason: any) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = &#x27;rejected&#x27;;\n}\n\nfunction defaultWriterReadyPromiseReset(writer: WritableStreamDefaultWriter) {\n assert(writer._readyPromise_resolve === undefined);\n assert(writer._readyPromise_reject === undefined);\n\n defaultWriterReadyPromiseInitialize(writer);\n}\n\nfunction defaultWriterReadyPromiseResetToRejected(writer: WritableStreamDefaultWriter, reason: any) {\n assert(writer._readyPromise_resolve === undefined);\n assert(writer._readyPromise_reject === undefined);\n\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n}\n\nfunction defaultWriterReadyPromiseResolve(writer: WritableStreamDefaultWriter) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = &#x27;fulfilled&#x27;;\n}\n&quot;, &quot;/// &lt;reference lib=\&quot;dom\&quot; /&gt;\n\nfunction getGlobals(): typeof globalThis | undefined {\n if (typeof globalThis !== &#x27;undefined&#x27;) {\n return globalThis;\n } else if (typeof self !== &#x27;undefined&#x27;) {\n return self;\n } else if (typeof global !== &#x27;undefined&#x27;) {\n return global;\n }\n return undefined;\n}\n\nexport const globals = getGlobals();\n&quot;, &quot;/// &lt;reference types=\&quot;node\&quot; /&gt;\nimport { globals } from &#x27;../globals&#x27;;\nimport { setFunctionName } from &#x27;../lib/helpers/miscellaneous&#x27;;\n\ninterface DOMException extends Error {\n name: string;\n message: string;\n}\n\ntype DOMExceptionConstructor = new (message?: string, name?: string) =&gt; DOMException;\n\nfunction isDOMExceptionConstructor(ctor: unknown): ctor is DOMExceptionConstructor {\n if (!(typeof ctor === &#x27;function&#x27; || typeof ctor === &#x27;object&#x27;)) {\n return false;\n }\n if ((ctor as DOMExceptionConstructor).name !== &#x27;DOMException&#x27;) {\n return false;\n }\n try {\n new (ctor as DOMExceptionConstructor)();\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Support:\n * - Web browsers\n * - Node 18 and higher (https://github.com/nodejs/node/commit/e4b1fb5e6422c1ff151234bb9de792d45dd88d87)\n */\nfunction getFromGlobal(): DOMExceptionConstructor | undefined {\n const ctor = globals?.DOMException;\n return isDOMExceptionConstructor(ctor) ? ctor : undefined;\n}\n\n/**\n * Support:\n * - All platforms\n */\nfunction createPolyfill(): DOMExceptionConstructor {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const ctor = function DOMException(this: DOMException, message?: string, name?: string) {\n this.message = message || &#x27;&#x27;;\n this.name = name || &#x27;Error&#x27;;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n } as any;\n setFunctionName(ctor, &#x27;DOMException&#x27;);\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, &#x27;constructor&#x27;, { value: ctor, writable: true, configurable: true });\n return ctor;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nconst DOMException: DOMExceptionConstructor = getFromGlobal() || createPolyfill();\n\nexport { DOMException };\n&quot;, &quot;import { IsReadableStream, IsReadableStreamLocked, ReadableStream, ReadableStreamCancel } from &#x27;../readable-stream&#x27;;\nimport { AcquireReadableStreamDefaultReader, ReadableStreamDefaultReaderRead } from &#x27;./default-reader&#x27;;\nimport { ReadableStreamReaderGenericRelease } from &#x27;./generic-reader&#x27;;\nimport {\n AcquireWritableStreamDefaultWriter,\n IsWritableStream,\n IsWritableStreamLocked,\n WritableStream,\n WritableStreamAbort,\n WritableStreamCloseQueuedOrInFlight,\n WritableStreamDefaultWriterCloseWithErrorPropagation,\n WritableStreamDefaultWriterRelease,\n WritableStreamDefaultWriterWrite\n} from &#x27;../writable-stream&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\nimport {\n newPromise,\n PerformPromiseThen,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n uponFulfillment,\n uponPromise,\n uponRejection\n} from &#x27;../helpers/webidl&#x27;;\nimport { noop } from &#x27;../../utils&#x27;;\nimport { type AbortSignal, isAbortSignal } from &#x27;../abort-signal&#x27;;\nimport { DOMException } from &#x27;../../stub/dom-exception&#x27;;\n\nexport function ReadableStreamPipeTo&lt;T&gt;(source: ReadableStream&lt;T&gt;,\n dest: WritableStream&lt;T&gt;,\n preventClose: boolean,\n preventAbort: boolean,\n preventCancel: boolean,\n signal: AbortSignal | undefined): Promise&lt;undefined&gt; {\n assert(IsReadableStream(source));\n assert(IsWritableStream(dest));\n assert(typeof preventClose === &#x27;boolean&#x27;);\n assert(typeof preventAbort === &#x27;boolean&#x27;);\n assert(typeof preventCancel === &#x27;boolean&#x27;);\n assert(signal === undefined || isAbortSignal(signal));\n assert(!IsReadableStreamLocked(source));\n assert(!IsWritableStreamLocked(dest));\n\n const reader = AcquireReadableStreamDefaultReader&lt;T&gt;(source);\n const writer = AcquireWritableStreamDefaultWriter&lt;T&gt;(dest);\n\n source._disturbed = true;\n\n let shuttingDown = false;\n\n // This is used to keep track of the spec&#x27;s requirement that we wait for ongoing writes during shutdown.\n let currentWrite = promiseResolvedWith&lt;void&gt;(undefined);\n\n return newPromise((resolve, reject) =&gt; {\n let abortAlgorithm: () =&gt; void;\n if (signal !== undefined) {\n abortAlgorithm = () =&gt; {\n const error = signal.reason !== undefined ? signal.reason : new DOMException(&#x27;Aborted&#x27;, &#x27;AbortError&#x27;);\n const actions: Array&lt;() =&gt; Promise&lt;void&gt;&gt; = [];\n if (!preventAbort) {\n actions.push(() =&gt; {\n if (dest._state === &#x27;writable&#x27;) {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(() =&gt; {\n if (source._state === &#x27;readable&#x27;) {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(() =&gt; Promise.all(actions.map(action =&gt; action())), true, error);\n };\n\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n\n signal.addEventListener(&#x27;abort&#x27;, abortAlgorithm);\n }\n\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise&lt;void&gt;((resolveLoop, rejectLoop) =&gt; {\n function next(done: boolean) {\n if (done) {\n resolveLoop();\n } else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n\n next(false);\n });\n }\n\n function pipeStep(): Promise&lt;boolean&gt; {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n\n return PerformPromiseThen(writer._readyPromise, () =&gt; {\n return newPromise&lt;boolean&gt;((resolveRead, rejectRead) =&gt; {\n ReadableStreamDefaultReaderRead(\n reader,\n {\n _chunkSteps: chunk =&gt; {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: () =&gt; resolveRead(true),\n _errorSteps: rejectRead\n }\n );\n });\n });\n }\n\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, storedError =&gt; {\n if (!preventAbort) {\n shutdownWithAction(() =&gt; WritableStreamAbort(dest, storedError), true, storedError);\n } else {\n shutdown(true, storedError);\n }\n return null;\n });\n\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, storedError =&gt; {\n if (!preventCancel) {\n shutdownWithAction(() =&gt; ReadableStreamCancel(source, storedError), true, storedError);\n } else {\n shutdown(true, storedError);\n }\n return null;\n });\n\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, () =&gt; {\n if (!preventClose) {\n shutdownWithAction(() =&gt; WritableStreamDefaultWriterCloseWithErrorPropagation(writer));\n } else {\n shutdown();\n }\n return null;\n });\n\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === &#x27;closed&#x27;) {\n const destClosed = new TypeError(&#x27;the destination writable stream closed before all data could be piped to it&#x27;);\n\n if (!preventCancel) {\n shutdownWithAction(() =&gt; ReadableStreamCancel(source, destClosed), true, destClosed);\n } else {\n shutdown(true, destClosed);\n }\n }\n\n setPromiseIsHandledToTrue(pipeLoop());\n\n function waitForWritesToFinish(): Promise&lt;void&gt; {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n const oldCurrentWrite = currentWrite;\n return PerformPromiseThen(\n currentWrite,\n () =&gt; oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined\n );\n }\n\n function isOrBecomesErrored(stream: ReadableStream | WritableStream,\n promise: Promise&lt;void&gt;,\n action: (reason: any) =&gt; null) {\n if (stream._state === &#x27;errored&#x27;) {\n action(stream._storedError);\n } else {\n uponRejection(promise, action);\n }\n }\n\n function isOrBecomesClosed(stream: ReadableStream | WritableStream, promise: Promise&lt;void&gt;, action: () =&gt; null) {\n if (stream._state === &#x27;closed&#x27;) {\n action();\n } else {\n uponFulfillment(promise, action);\n }\n }\n\n function shutdownWithAction(action: () =&gt; Promise&lt;unknown&gt;, originalIsError?: boolean, originalError?: any) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n\n if (dest._state === &#x27;writable&#x27; &amp;&amp; !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n } else {\n doTheRest();\n }\n\n function doTheRest(): null {\n uponPromise(\n action(),\n () =&gt; finalize(originalIsError, originalError),\n newError =&gt; finalize(true, newError)\n );\n return null;\n }\n }\n\n function shutdown(isError?: boolean, error?: any) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n\n if (dest._state === &#x27;writable&#x27; &amp;&amp; !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), () =&gt; finalize(isError, error));\n } else {\n finalize(isError, error);\n }\n }\n\n function finalize(isError?: boolean, error?: any): null {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n\n if (signal !== undefined) {\n signal.removeEventListener(&#x27;abort&#x27;, abortAlgorithm);\n }\n if (isError) {\n reject(error);\n } else {\n resolve(undefined);\n }\n\n return null;\n }\n });\n}\n&quot;, &quot;import type { QueuingStrategySizeCallback } from &#x27;../queuing-strategy&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\nimport { DequeueValue, EnqueueValueWithSize, type QueuePair, ResetQueue } from &#x27;../abstract-ops/queue-with-sizes&#x27;;\nimport {\n ReadableStreamAddReadRequest,\n ReadableStreamFulfillReadRequest,\n ReadableStreamGetNumReadRequests,\n type ReadRequest\n} from &#x27;./default-reader&#x27;;\nimport { SimpleQueue } from &#x27;../simple-queue&#x27;;\nimport { IsReadableStreamLocked, ReadableStream, ReadableStreamClose, ReadableStreamError } from &#x27;../readable-stream&#x27;;\nimport type { ValidatedUnderlyingSource } from &#x27;./underlying-source&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport { CancelSteps, PullSteps, ReleaseSteps } from &#x27;../abstract-ops/internal-methods&#x27;;\nimport { promiseResolvedWith, uponPromise } from &#x27;../helpers/webidl&#x27;;\n\n/**\n * Allows control of a {@link ReadableStream | readable stream}&#x27;s state and internal queue.\n *\n * @public\n */\nexport class ReadableStreamDefaultController&lt;R&gt; {\n /** @internal */\n _controlledReadableStream!: ReadableStream&lt;R&gt;;\n /** @internal */\n _queue!: SimpleQueue&lt;QueuePair&lt;R&gt;&gt;;\n /** @internal */\n _queueTotalSize!: number;\n /** @internal */\n _started!: boolean;\n /** @internal */\n _closeRequested!: boolean;\n /** @internal */\n _pullAgain!: boolean;\n /** @internal */\n _pulling !: boolean;\n /** @internal */\n _strategySizeAlgorithm!: QueuingStrategySizeCallback&lt;R&gt;;\n /** @internal */\n _strategyHWM!: number;\n /** @internal */\n _pullAlgorithm!: () =&gt; Promise&lt;void&gt;;\n /** @internal */\n _cancelAlgorithm!: (reason: any) =&gt; Promise&lt;void&gt;;\n\n private constructor() {\n throw new TypeError(&#x27;Illegal constructor&#x27;);\n }\n\n /**\n * Returns the desired size to fill the controlled stream&#x27;s internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get desiredSize(): number | null {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;desiredSize&#x27;);\n }\n\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n }\n\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n close(): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;close&#x27;);\n }\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError(&#x27;The stream is not in a state that permits close&#x27;);\n }\n\n ReadableStreamDefaultControllerClose(this);\n }\n\n /**\n * Enqueues the given chunk `chunk` in the controlled readable stream.\n */\n enqueue(chunk: R): void;\n enqueue(chunk: R = undefined!): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;enqueue&#x27;);\n }\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError(&#x27;The stream is not in a state that permits enqueue&#x27;);\n }\n\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n error(e: any = undefined): void {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;error&#x27;);\n }\n\n ReadableStreamDefaultControllerError(this, e);\n }\n\n /** @internal */\n [CancelSteps](reason: any): Promise&lt;void&gt; {\n ResetQueue(this);\n const result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n }\n\n /** @internal */\n [PullSteps](readRequest: ReadRequest&lt;R&gt;): void {\n const stream = this._controlledReadableStream;\n\n if (this._queue.length &gt; 0) {\n const chunk = DequeueValue(this);\n\n if (this._closeRequested &amp;&amp; this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n } else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n\n readRequest._chunkSteps(chunk);\n } else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n }\n\n /** @internal */\n [ReleaseSteps](): void {\n // Do nothing.\n }\n}\n\nObject.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(ReadableStreamDefaultController.prototype.close, &#x27;close&#x27;);\nsetFunctionName(ReadableStreamDefaultController.prototype.enqueue, &#x27;enqueue&#x27;);\nsetFunctionName(ReadableStreamDefaultController.prototype.error, &#x27;error&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableStreamDefaultController&#x27;,\n configurable: true\n });\n}\n\n// Abstract operations for the ReadableStreamDefaultController.\n\nfunction IsReadableStreamDefaultController&lt;R = any&gt;(x: any): x is ReadableStreamDefaultController&lt;R&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_controlledReadableStream&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableStreamDefaultController;\n}\n\nfunction ReadableStreamDefaultControllerCallPullIfNeeded(controller: ReadableStreamDefaultController&lt;any&gt;): void {\n const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n\n assert(!controller._pullAgain);\n\n controller._pulling = true;\n\n const pullPromise = controller._pullAlgorithm();\n uponPromise(\n pullPromise,\n () =&gt; {\n controller._pulling = false;\n\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n\n return null;\n },\n e =&gt; {\n ReadableStreamDefaultControllerError(controller, e);\n return null;\n }\n );\n}\n\nfunction ReadableStreamDefaultControllerShouldCallPull(controller: ReadableStreamDefaultController&lt;any&gt;): boolean {\n const stream = controller._controlledReadableStream;\n\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n\n if (!controller._started) {\n return false;\n }\n\n if (IsReadableStreamLocked(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) {\n return true;\n }\n\n const desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n assert(desiredSize !== null);\n if (desiredSize! &gt; 0) {\n return true;\n }\n\n return false;\n}\n\nfunction ReadableStreamDefaultControllerClearAlgorithms(controller: ReadableStreamDefaultController&lt;any&gt;) {\n controller._pullAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n controller._strategySizeAlgorithm = undefined!;\n}\n\n// A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n\nexport function ReadableStreamDefaultControllerClose(controller: ReadableStreamDefaultController&lt;any&gt;) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n\n const stream = controller._controlledReadableStream;\n\n controller._closeRequested = true;\n\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n}\n\nexport function ReadableStreamDefaultControllerEnqueue&lt;R&gt;(\n controller: ReadableStreamDefaultController&lt;R&gt;,\n chunk: R\n): void {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n\n const stream = controller._controlledReadableStream;\n\n if (IsReadableStreamLocked(stream) &amp;&amp; ReadableStreamGetNumReadRequests(stream) &gt; 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n } else {\n let chunkSize;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n } catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n } catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n}\n\nexport function ReadableStreamDefaultControllerError(controller: ReadableStreamDefaultController&lt;any&gt;, e: any) {\n const stream = controller._controlledReadableStream;\n\n if (stream._state !== &#x27;readable&#x27;) {\n return;\n }\n\n ResetQueue(controller);\n\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n}\n\nexport function ReadableStreamDefaultControllerGetDesiredSize(\n controller: ReadableStreamDefaultController&lt;any&gt;\n): number | null {\n const state = controller._controlledReadableStream._state;\n\n if (state === &#x27;errored&#x27;) {\n return null;\n }\n if (state === &#x27;closed&#x27;) {\n return 0;\n }\n\n return controller._strategyHWM - controller._queueTotalSize;\n}\n\n// This is used in the implementation of TransformStream.\nexport function ReadableStreamDefaultControllerHasBackpressure(\n controller: ReadableStreamDefaultController&lt;any&gt;\n): boolean {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n\n return true;\n}\n\nexport function ReadableStreamDefaultControllerCanCloseOrEnqueue(\n controller: ReadableStreamDefaultController&lt;any&gt;\n): boolean {\n const state = controller._controlledReadableStream._state;\n\n if (!controller._closeRequested &amp;&amp; state === &#x27;readable&#x27;) {\n return true;\n }\n\n return false;\n}\n\nexport function SetUpReadableStreamDefaultController&lt;R&gt;(stream: ReadableStream&lt;R&gt;,\n controller: ReadableStreamDefaultController&lt;R&gt;,\n startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n pullAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;R&gt;) {\n assert(stream._readableStreamController === undefined);\n\n controller._controlledReadableStream = stream;\n\n controller._queue = undefined!;\n controller._queueTotalSize = undefined!;\n ResetQueue(controller);\n\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n stream._readableStreamController = controller;\n\n const startResult = startAlgorithm();\n uponPromise(\n promiseResolvedWith(startResult),\n () =&gt; {\n controller._started = true;\n\n assert(!controller._pulling);\n assert(!controller._pullAgain);\n\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n return null;\n },\n r =&gt; {\n ReadableStreamDefaultControllerError(controller, r);\n return null;\n }\n );\n}\n\nexport function SetUpReadableStreamDefaultControllerFromUnderlyingSource&lt;R&gt;(\n stream: ReadableStream&lt;R&gt;,\n underlyingSource: ValidatedUnderlyingSource&lt;R&gt;,\n highWaterMark: number,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;R&gt;\n) {\n const controller: ReadableStreamDefaultController&lt;R&gt; = Object.create(ReadableStreamDefaultController.prototype);\n\n let startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;;\n let pullAlgorithm: () =&gt; Promise&lt;void&gt;;\n let cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;;\n\n if (underlyingSource.start !== undefined) {\n startAlgorithm = () =&gt; underlyingSource.start!(controller);\n } else {\n startAlgorithm = () =&gt; undefined;\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = () =&gt; underlyingSource.pull!(controller);\n } else {\n pullAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = reason =&gt; underlyingSource.cancel!(reason);\n } else {\n cancelAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n\n SetUpReadableStreamDefaultController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm\n );\n}\n\n// Helper functions for the ReadableStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);\n}\n&quot;, &quot;import {\n CreateReadableByteStream,\n CreateReadableStream,\n type DefaultReadableStream,\n IsReadableStream,\n type ReadableByteStream,\n ReadableStream,\n ReadableStreamCancel,\n type ReadableStreamReader\n} from &#x27;../readable-stream&#x27;;\nimport { ReadableStreamReaderGenericRelease } from &#x27;./generic-reader&#x27;;\nimport {\n AcquireReadableStreamDefaultReader,\n IsReadableStreamDefaultReader,\n ReadableStreamDefaultReaderRead,\n type ReadRequest\n} from &#x27;./default-reader&#x27;;\nimport {\n AcquireReadableStreamBYOBReader,\n IsReadableStreamBYOBReader,\n ReadableStreamBYOBReaderRead,\n type ReadIntoRequest\n} from &#x27;./byob-reader&#x27;;\nimport assert from &#x27;../../stub/assert&#x27;;\nimport { newPromise, promiseResolvedWith, queueMicrotask, uponRejection } from &#x27;../helpers/webidl&#x27;;\nimport {\n ReadableStreamDefaultControllerClose,\n ReadableStreamDefaultControllerEnqueue,\n ReadableStreamDefaultControllerError\n} from &#x27;./default-controller&#x27;;\nimport {\n IsReadableByteStreamController,\n ReadableByteStreamControllerClose,\n ReadableByteStreamControllerEnqueue,\n ReadableByteStreamControllerError,\n ReadableByteStreamControllerGetBYOBRequest,\n ReadableByteStreamControllerRespond,\n ReadableByteStreamControllerRespondWithNewView\n} from &#x27;./byte-stream-controller&#x27;;\nimport { CreateArrayFromList } from &#x27;../abstract-ops/ecmascript&#x27;;\nimport { CloneAsUint8Array } from &#x27;../abstract-ops/miscellaneous&#x27;;\nimport type { NonShared } from &#x27;../helpers/array-buffer-view&#x27;;\n\nexport function ReadableStreamTee&lt;R&gt;(stream: ReadableStream&lt;R&gt;,\n cloneForBranch2: boolean): [ReadableStream&lt;R&gt;, ReadableStream&lt;R&gt;] {\n assert(IsReadableStream(stream));\n assert(typeof cloneForBranch2 === &#x27;boolean&#x27;);\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream as unknown as ReadableByteStream) as\n unknown as [ReadableStream&lt;R&gt;, ReadableStream&lt;R&gt;];\n }\n return ReadableStreamDefaultTee(stream, cloneForBranch2);\n}\n\nexport function ReadableStreamDefaultTee&lt;R&gt;(\n stream: ReadableStream&lt;R&gt;,\n cloneForBranch2: boolean\n): [DefaultReadableStream&lt;R&gt;, DefaultReadableStream&lt;R&gt;] {\n assert(IsReadableStream(stream));\n assert(typeof cloneForBranch2 === &#x27;boolean&#x27;);\n\n const reader = AcquireReadableStreamDefaultReader&lt;R&gt;(stream);\n\n let reading = false;\n let readAgain = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1: any;\n let reason2: any;\n let branch1: DefaultReadableStream&lt;R&gt;;\n let branch2: DefaultReadableStream&lt;R&gt;;\n\n let resolveCancelPromise: (value: undefined | Promise&lt;undefined&gt;) =&gt; void;\n const cancelPromise = newPromise&lt;undefined&gt;(resolve =&gt; {\n resolveCancelPromise = resolve;\n });\n\n function pullAlgorithm(): Promise&lt;void&gt; {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const readRequest: ReadRequest&lt;R&gt; = {\n _chunkSteps: chunk =&gt; {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() =&gt; {\n readAgain = false;\n const chunk1 = chunk;\n const chunk2 = chunk;\n\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we&#x27;ll need an implementation for serializable objects.\n // if (!canceled2 &amp;&amp; cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: () =&gt; {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () =&gt; {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n\n return promiseResolvedWith(undefined);\n }\n\n function cancel1Algorithm(reason: any): Promise&lt;void&gt; {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function cancel2Algorithm(reason: any): Promise&lt;void&gt; {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function startAlgorithm() {\n // do nothing\n }\n\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n\n uponRejection(reader._closedPromise, (r: any) =&gt; {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n\n return [branch1, branch2];\n}\n\nexport function ReadableByteStreamTee(stream: ReadableByteStream): [ReadableByteStream, ReadableByteStream] {\n assert(IsReadableStream(stream));\n assert(IsReadableByteStreamController(stream._readableStreamController));\n\n let reader: ReadableStreamReader&lt;NonShared&lt;Uint8Array&gt;&gt; = AcquireReadableStreamDefaultReader(stream);\n let reading = false;\n let readAgainForBranch1 = false;\n let readAgainForBranch2 = false;\n let canceled1 = false;\n let canceled2 = false;\n let reason1: any;\n let reason2: any;\n let branch1: ReadableByteStream;\n let branch2: ReadableByteStream;\n\n let resolveCancelPromise: (value: undefined | Promise&lt;undefined&gt;) =&gt; void;\n const cancelPromise = newPromise&lt;void&gt;(resolve =&gt; {\n resolveCancelPromise = resolve;\n });\n\n function forwardReaderError(thisReader: ReadableStreamReader&lt;NonShared&lt;Uint8Array&gt;&gt;) {\n uponRejection(thisReader._closedPromise, r =&gt; {\n if (thisReader !== reader) {\n return null;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n return null;\n });\n }\n\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n assert(reader._readIntoRequests.length === 0);\n ReadableStreamReaderGenericRelease(reader);\n\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n\n const readRequest: ReadRequest&lt;NonShared&lt;Uint8Array&gt;&gt; = {\n _chunkSteps: chunk =&gt; {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() =&gt; {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n\n const chunk1 = chunk;\n let chunk2 = chunk;\n if (!canceled1 &amp;&amp; !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n } catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n } else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: () =&gt; {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length &gt; 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length &gt; 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () =&gt; {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n\n function pullWithBYOBReader(view: NonShared&lt;ArrayBufferView&gt;, forBranch2: boolean) {\n if (IsReadableStreamDefaultReader&lt;NonShared&lt;Uint8Array&gt;&gt;(reader)) {\n assert(reader._readRequests.length === 0);\n ReadableStreamReaderGenericRelease(reader);\n\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n\n const byobBranch = forBranch2 ? branch2 : branch1;\n const otherBranch = forBranch2 ? branch1 : branch2;\n\n const readIntoRequest: ReadIntoRequest&lt;NonShared&lt;ArrayBufferView&gt;&gt; = {\n _chunkSteps: chunk =&gt; {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(() =&gt; {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n\n if (!otherCanceled) {\n let clonedChunk;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n } catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n } else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n } else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: chunk =&gt; {\n reading = false;\n\n const byobCanceled = forBranch2 ? canceled2 : canceled1;\n const otherCanceled = forBranch2 ? canceled1 : canceled2;\n\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n\n if (chunk !== undefined) {\n assert(chunk.byteLength === 0);\n\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled &amp;&amp; otherBranch._readableStreamController._pendingPullIntos.length &gt; 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: () =&gt; {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);\n }\n\n function pull1Algorithm(): Promise&lt;void&gt; {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n } else {\n pullWithBYOBReader(byobRequest._view!, false);\n }\n\n return promiseResolvedWith(undefined);\n }\n\n function pull2Algorithm(): Promise&lt;void&gt; {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n\n reading = true;\n\n const byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n } else {\n pullWithBYOBReader(byobRequest._view!, true);\n }\n\n return promiseResolvedWith(undefined);\n }\n\n function cancel1Algorithm(reason: any): Promise&lt;void&gt; {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function cancel2Algorithm(reason: any): Promise&lt;void&gt; {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n const compositeReason = CreateArrayFromList([reason1, reason2]);\n const cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n\n function startAlgorithm(): void {\n return;\n }\n\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n\n forwardReaderError(reader);\n\n return [branch1, branch2];\n}\n&quot;, &quot;import { typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport type { ReadableStreamDefaultReadResult } from &#x27;./default-reader&#x27;;\n\n/**\n * A common interface for a `ReadadableStream` implementation.\n *\n * @public\n */\nexport interface ReadableStreamLike&lt;R = any&gt; {\n readonly locked: boolean;\n\n getReader(): ReadableStreamDefaultReaderLike&lt;R&gt;;\n}\n\n/**\n * A common interface for a `ReadableStreamDefaultReader` implementation.\n *\n * @public\n */\nexport interface ReadableStreamDefaultReaderLike&lt;R = any&gt; {\n readonly closed: Promise&lt;undefined&gt;;\n\n cancel(reason?: any): Promise&lt;void&gt;;\n\n read(): Promise&lt;ReadableStreamDefaultReadResult&lt;R&gt;&gt;;\n\n releaseLock(): void;\n}\n\nexport function isReadableStreamLike&lt;R&gt;(stream: unknown): stream is ReadableStreamLike&lt;R&gt; {\n return typeIsObject(stream) &amp;&amp; typeof (stream as ReadableStreamLike&lt;R&gt;).getReader !== &#x27;undefined&#x27;;\n}\n&quot;, &quot;import { CreateReadableStream, type DefaultReadableStream } from &#x27;../readable-stream&#x27;;\nimport {\n isReadableStreamLike,\n type ReadableStreamDefaultReaderLike,\n type ReadableStreamLike\n} from &#x27;./readable-stream-like&#x27;;\nimport { ReadableStreamDefaultControllerClose, ReadableStreamDefaultControllerEnqueue } from &#x27;./default-controller&#x27;;\nimport { GetIterator, GetMethod, IteratorComplete, IteratorNext, IteratorValue } from &#x27;../abstract-ops/ecmascript&#x27;;\nimport { promiseRejectedWith, promiseResolvedWith, reflectCall, transformPromiseWith } from &#x27;../helpers/webidl&#x27;;\nimport { typeIsObject } from &#x27;../helpers/miscellaneous&#x27;;\nimport { noop } from &#x27;../../utils&#x27;;\n\nexport function ReadableStreamFrom&lt;R&gt;(\n source: Iterable&lt;R&gt; | AsyncIterable&lt;R&gt; | ReadableStreamLike&lt;R&gt;\n): DefaultReadableStream&lt;R&gt; {\n if (isReadableStreamLike(source)) {\n return ReadableStreamFromDefaultReader(source.getReader());\n }\n return ReadableStreamFromIterable(source);\n}\n\nexport function ReadableStreamFromIterable&lt;R&gt;(asyncIterable: Iterable&lt;R&gt; | AsyncIterable&lt;R&gt;): DefaultReadableStream&lt;R&gt; {\n let stream: DefaultReadableStream&lt;R&gt;;\n const iteratorRecord = GetIterator(asyncIterable, &#x27;async&#x27;);\n\n const startAlgorithm = noop;\n\n function pullAlgorithm(): Promise&lt;void&gt; {\n let nextResult;\n try {\n nextResult = IteratorNext(iteratorRecord);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const nextPromise = promiseResolvedWith(nextResult);\n return transformPromiseWith(nextPromise, iterResult =&gt; {\n if (!typeIsObject(iterResult)) {\n throw new TypeError(&#x27;The promise returned by the iterator.next() method must fulfill with an object&#x27;);\n }\n const done = IteratorComplete(iterResult);\n if (done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n } else {\n const value = IteratorValue(iterResult);\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n\n function cancelAlgorithm(reason: any): Promise&lt;void&gt; {\n const iterator = iteratorRecord.iterator;\n let returnMethod: (typeof iterator)[&#x27;return&#x27;] | undefined;\n try {\n returnMethod = GetMethod(iterator, &#x27;return&#x27;);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n if (returnMethod === undefined) {\n return promiseResolvedWith(undefined);\n }\n let returnResult: IteratorResult&lt;R&gt; | Promise&lt;IteratorResult&lt;R&gt;&gt;;\n try {\n returnResult = reflectCall(returnMethod, iterator, [reason]);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n const returnPromise = promiseResolvedWith(returnResult);\n return transformPromiseWith(returnPromise, iterResult =&gt; {\n if (!typeIsObject(iterResult)) {\n throw new TypeError(&#x27;The promise returned by the iterator.return() method must fulfill with an object&#x27;);\n }\n return undefined;\n });\n }\n\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n}\n\nexport function ReadableStreamFromDefaultReader&lt;R&gt;(\n reader: ReadableStreamDefaultReaderLike&lt;R&gt;\n): DefaultReadableStream&lt;R&gt; {\n let stream: DefaultReadableStream&lt;R&gt;;\n\n const startAlgorithm = noop;\n\n function pullAlgorithm(): Promise&lt;void&gt; {\n let readPromise;\n try {\n readPromise = reader.read();\n } catch (e) {\n return promiseRejectedWith(e);\n }\n return transformPromiseWith(readPromise, readResult =&gt; {\n if (!typeIsObject(readResult)) {\n throw new TypeError(&#x27;The promise returned by the reader.read() method must fulfill with an object&#x27;);\n }\n if (readResult.done) {\n ReadableStreamDefaultControllerClose(stream._readableStreamController);\n } else {\n const value = readResult.value;\n ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);\n }\n });\n }\n\n function cancelAlgorithm(reason: any): Promise&lt;void&gt; {\n try {\n return promiseResolvedWith(reader.cancel(reason));\n } catch (e) {\n return promiseRejectedWith(e);\n }\n }\n\n stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);\n return stream;\n}\n&quot;, &quot;import { assertDictionary, assertFunction, convertUnsignedLongLongWithEnforceRange } from &#x27;./basic&#x27;;\nimport type {\n ReadableStreamController,\n UnderlyingByteSource,\n UnderlyingDefaultOrByteSource,\n UnderlyingDefaultOrByteSourcePullCallback,\n UnderlyingDefaultOrByteSourceStartCallback,\n UnderlyingSource,\n UnderlyingSourceCancelCallback,\n ValidatedUnderlyingDefaultOrByteSource\n} from &#x27;../readable-stream/underlying-source&#x27;;\nimport { promiseCall, reflectCall } from &#x27;../helpers/webidl&#x27;;\n\nexport function convertUnderlyingDefaultOrByteSource&lt;R&gt;(\n source: UnderlyingSource&lt;R&gt; | UnderlyingByteSource | null,\n context: string\n): ValidatedUnderlyingDefaultOrByteSource&lt;R&gt; {\n assertDictionary(source, context);\n const original = source as (UnderlyingDefaultOrByteSource&lt;R&gt; | null);\n const autoAllocateChunkSize = original?.autoAllocateChunkSize;\n const cancel = original?.cancel;\n const pull = original?.pull;\n const start = original?.start;\n const type = original?.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(\n autoAllocateChunkSize,\n `${context} has member &#x27;autoAllocateChunkSize&#x27; that`\n ),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original!, `${context} has member &#x27;cancel&#x27; that`),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original!, `${context} has member &#x27;pull&#x27; that`),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original!, `${context} has member &#x27;start&#x27; that`),\n type: type === undefined ? undefined : convertReadableStreamType(type, `${context} has member &#x27;type&#x27; that`)\n };\n}\n\nfunction convertUnderlyingSourceCancelCallback(\n fn: UnderlyingSourceCancelCallback,\n original: UnderlyingDefaultOrByteSource,\n context: string\n): (reason: any) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (reason: any) =&gt; promiseCall(fn, original, [reason]);\n}\n\nfunction convertUnderlyingSourcePullCallback&lt;R&gt;(\n fn: UnderlyingDefaultOrByteSourcePullCallback&lt;R&gt;,\n original: UnderlyingDefaultOrByteSource&lt;R&gt;,\n context: string\n): (controller: ReadableStreamController&lt;R&gt;) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (controller: ReadableStreamController&lt;R&gt;) =&gt; promiseCall(fn, original, [controller]);\n}\n\nfunction convertUnderlyingSourceStartCallback&lt;R&gt;(\n fn: UnderlyingDefaultOrByteSourceStartCallback&lt;R&gt;,\n original: UnderlyingDefaultOrByteSource&lt;R&gt;,\n context: string\n): UnderlyingDefaultOrByteSourceStartCallback&lt;R&gt; {\n assertFunction(fn, context);\n return (controller: ReadableStreamController&lt;R&gt;) =&gt; reflectCall(fn, original, [controller]);\n}\n\nfunction convertReadableStreamType(type: string, context: string): &#x27;bytes&#x27; {\n type = `${type}`;\n if (type !== &#x27;bytes&#x27;) {\n throw new TypeError(`${context} &#x27;${type}&#x27; is not a valid enumeration value for ReadableStreamType`);\n }\n return type;\n}\n&quot;, &quot;import { assertDictionary } from &#x27;./basic&#x27;;\nimport type {\n ReadableStreamIteratorOptions,\n ValidatedReadableStreamIteratorOptions\n} from &#x27;../readable-stream/iterator-options&#x27;;\n\nexport function convertIteratorOptions(options: ReadableStreamIteratorOptions | null | undefined,\n context: string): ValidatedReadableStreamIteratorOptions {\n assertDictionary(options, context);\n const preventCancel = options?.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n}\n&quot;, &quot;import { assertDictionary } from &#x27;./basic&#x27;;\nimport type { StreamPipeOptions, ValidatedStreamPipeOptions } from &#x27;../readable-stream/pipe-options&#x27;;\nimport { type AbortSignal, isAbortSignal } from &#x27;../abort-signal&#x27;;\n\nexport function convertPipeOptions(options: StreamPipeOptions | null | undefined,\n context: string): ValidatedStreamPipeOptions {\n assertDictionary(options, context);\n const preventAbort = options?.preventAbort;\n const preventCancel = options?.preventCancel;\n const preventClose = options?.preventClose;\n const signal = options?.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, `${context} has member &#x27;signal&#x27; that`);\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal\n };\n}\n\nfunction assertAbortSignal(signal: unknown, context: string): asserts signal is AbortSignal {\n if (!isAbortSignal(signal)) {\n throw new TypeError(`${context} is not an AbortSignal.`);\n }\n}\n&quot;, &quot;import { assertDictionary, assertRequiredField } from &#x27;./basic&#x27;;\nimport { ReadableStream } from &#x27;../readable-stream&#x27;;\nimport { WritableStream } from &#x27;../writable-stream&#x27;;\nimport { assertReadableStream } from &#x27;./readable-stream&#x27;;\nimport { assertWritableStream } from &#x27;./writable-stream&#x27;;\n\nexport function convertReadableWritablePair&lt;RS extends ReadableStream, WS extends WritableStream&gt;(\n pair: { readable: RS; writable: WS } | null | undefined,\n context: string\n): { readable: RS; writable: WS } {\n assertDictionary(pair, context);\n\n const readable = pair?.readable;\n assertRequiredField(readable, &#x27;readable&#x27;, &#x27;ReadableWritablePair&#x27;);\n assertReadableStream(readable, `${context} has member &#x27;readable&#x27; that`);\n\n const writable = pair?.writable;\n assertRequiredField(writable, &#x27;writable&#x27;, &#x27;ReadableWritablePair&#x27;);\n assertWritableStream(writable, `${context} has member &#x27;writable&#x27; that`);\n\n return { readable, writable };\n}\n&quot;, &quot;import assert from &#x27;../stub/assert&#x27;;\nimport {\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n transformPromiseWith\n} from &#x27;./helpers/webidl&#x27;;\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from &#x27;./queuing-strategy&#x27;;\nimport { AcquireReadableStreamAsyncIterator, type ReadableStreamAsyncIterator } from &#x27;./readable-stream/async-iterator&#x27;;\nimport { defaultReaderClosedPromiseReject, defaultReaderClosedPromiseResolve } from &#x27;./readable-stream/generic-reader&#x27;;\nimport {\n AcquireReadableStreamDefaultReader,\n IsReadableStreamDefaultReader,\n ReadableStreamDefaultReader,\n ReadableStreamDefaultReaderErrorReadRequests,\n type ReadableStreamDefaultReadResult\n} from &#x27;./readable-stream/default-reader&#x27;;\nimport {\n AcquireReadableStreamBYOBReader,\n IsReadableStreamBYOBReader,\n ReadableStreamBYOBReader,\n ReadableStreamBYOBReaderErrorReadIntoRequests,\n type ReadableStreamBYOBReadResult\n} from &#x27;./readable-stream/byob-reader&#x27;;\nimport { ReadableStreamPipeTo } from &#x27;./readable-stream/pipe&#x27;;\nimport { ReadableStreamTee } from &#x27;./readable-stream/tee&#x27;;\nimport { ReadableStreamFrom } from &#x27;./readable-stream/from&#x27;;\nimport { IsWritableStream, IsWritableStreamLocked, WritableStream } from &#x27;./writable-stream&#x27;;\nimport { SimpleQueue } from &#x27;./simple-queue&#x27;;\nimport {\n ReadableByteStreamController,\n ReadableStreamBYOBRequest,\n SetUpReadableByteStreamController,\n SetUpReadableByteStreamControllerFromUnderlyingSource\n} from &#x27;./readable-stream/byte-stream-controller&#x27;;\nimport {\n ReadableStreamDefaultController,\n SetUpReadableStreamDefaultController,\n SetUpReadableStreamDefaultControllerFromUnderlyingSource\n} from &#x27;./readable-stream/default-controller&#x27;;\nimport type {\n UnderlyingByteSource,\n UnderlyingByteSourcePullCallback,\n UnderlyingByteSourceStartCallback,\n UnderlyingSource,\n UnderlyingSourceCancelCallback,\n UnderlyingSourcePullCallback,\n UnderlyingSourceStartCallback\n} from &#x27;./readable-stream/underlying-source&#x27;;\nimport { noop } from &#x27;../utils&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;./helpers/miscellaneous&#x27;;\nimport { CreateArrayFromList, SymbolAsyncIterator } from &#x27;./abstract-ops/ecmascript&#x27;;\nimport { CancelSteps } from &#x27;./abstract-ops/internal-methods&#x27;;\nimport { IsNonNegativeNumber } from &#x27;./abstract-ops/miscellaneous&#x27;;\nimport { assertObject, assertRequiredArgument } from &#x27;./validators/basic&#x27;;\nimport { convertQueuingStrategy } from &#x27;./validators/queuing-strategy&#x27;;\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from &#x27;./abstract-ops/queuing-strategy&#x27;;\nimport { convertUnderlyingDefaultOrByteSource } from &#x27;./validators/underlying-source&#x27;;\nimport type {\n ReadableStreamBYOBReaderReadOptions,\n ReadableStreamGetReaderOptions\n} from &#x27;./readable-stream/reader-options&#x27;;\nimport { convertReaderOptions } from &#x27;./validators/reader-options&#x27;;\nimport type { StreamPipeOptions, ValidatedStreamPipeOptions } from &#x27;./readable-stream/pipe-options&#x27;;\nimport type { ReadableStreamIteratorOptions } from &#x27;./readable-stream/iterator-options&#x27;;\nimport { convertIteratorOptions } from &#x27;./validators/iterator-options&#x27;;\nimport { convertPipeOptions } from &#x27;./validators/pipe-options&#x27;;\nimport type { ReadableWritablePair } from &#x27;./readable-stream/readable-writable-pair&#x27;;\nimport { convertReadableWritablePair } from &#x27;./validators/readable-writable-pair&#x27;;\nimport type { ReadableStreamDefaultReaderLike, ReadableStreamLike } from &#x27;./readable-stream/readable-stream-like&#x27;;\nimport type { NonShared } from &#x27;./helpers/array-buffer-view&#x27;;\n\nexport type DefaultReadableStream&lt;R = any&gt; = ReadableStream&lt;R&gt; &amp; {\n _readableStreamController: ReadableStreamDefaultController&lt;R&gt;\n};\n\nexport type ReadableByteStream = ReadableStream&lt;NonShared&lt;Uint8Array&gt;&gt; &amp; {\n _readableStreamController: ReadableByteStreamController\n};\n\ntype ReadableStreamState = &#x27;readable&#x27; | &#x27;closed&#x27; | &#x27;errored&#x27;;\n\n/**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\nexport class ReadableStream&lt;R = any&gt; implements AsyncIterable&lt;R&gt; {\n /** @internal */\n _state!: ReadableStreamState;\n /** @internal */\n _reader: ReadableStreamReader&lt;R&gt; | undefined;\n /** @internal */\n _storedError: any;\n /** @internal */\n _disturbed!: boolean;\n /** @internal */\n _readableStreamController!: ReadableStreamDefaultController&lt;R&gt; | ReadableByteStreamController;\n\n constructor(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number; size?: undefined });\n constructor(underlyingSource?: UnderlyingSource&lt;R&gt;, strategy?: QueuingStrategy&lt;R&gt;);\n constructor(rawUnderlyingSource: UnderlyingSource&lt;R&gt; | UnderlyingByteSource | null | undefined = {},\n rawStrategy: QueuingStrategy&lt;R&gt; | null | undefined = {}) {\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n } else {\n assertObject(rawUnderlyingSource, &#x27;First parameter&#x27;);\n }\n\n const strategy = convertQueuingStrategy(rawStrategy, &#x27;Second parameter&#x27;);\n const underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, &#x27;First parameter&#x27;);\n\n InitializeReadableStream(this);\n\n if (underlyingSource.type === &#x27;bytes&#x27;) {\n if (strategy.size !== undefined) {\n throw new RangeError(&#x27;The strategy for a byte stream cannot have a size function&#x27;);\n }\n const highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(\n this as unknown as ReadableByteStream,\n underlyingSource,\n highWaterMark\n );\n } else {\n assert(underlyingSource.type === undefined);\n const sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n const highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(\n this,\n underlyingSource,\n highWaterMark,\n sizeAlgorithm\n );\n }\n }\n\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get locked(): boolean {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException(&#x27;locked&#x27;);\n }\n\n return IsReadableStreamLocked(this);\n }\n\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source&#x27;s {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n cancel(reason: any = undefined): Promise&lt;void&gt; {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException(&#x27;cancel&#x27;));\n }\n\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError(&#x27;Cannot cancel a stream that already has a reader&#x27;));\n }\n\n return ReadableStreamCancel(this, reason);\n }\n\n /**\n * Creates a {@link ReadableStreamBYOBReader} and locks the stream to the new reader.\n *\n * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams,\n * i.e. streams which were constructed specifically with the ability to handle \&quot;bring your own buffer\&quot; reading.\n * The returned BYOB reader provides the ability to directly read individual chunks from the stream via its\n * {@link ReadableStreamBYOBReader.read | read()} method, into developer-supplied buffers, allowing more precise\n * control over allocation.\n */\n getReader({ mode }: { mode: &#x27;byob&#x27; }): ReadableStreamBYOBReader;\n /**\n * Creates a {@link ReadableStreamDefaultReader} and locks the stream to the new reader.\n * While the stream is locked, no other reader can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to consume a stream\n * in its entirety. By getting a reader for the stream, you can ensure nobody else can interleave reads with yours\n * or cancel the stream, which would interfere with your abstraction.\n */\n getReader(): ReadableStreamDefaultReader&lt;R&gt;;\n getReader(\n rawOptions: ReadableStreamGetReaderOptions | null | undefined = undefined\n ): ReadableStreamDefaultReader&lt;R&gt; | ReadableStreamBYOBReader {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException(&#x27;getReader&#x27;);\n }\n\n const options = convertReaderOptions(rawOptions, &#x27;First parameter&#x27;);\n\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n\n assert(options.mode === &#x27;byob&#x27;);\n return AcquireReadableStreamBYOBReader(this as unknown as ReadableByteStream);\n }\n\n /**\n * Provides a convenient, chainable way of piping this readable stream through a transform stream\n * (or any other `{ writable, readable }` pair). It simply {@link ReadableStream.pipeTo | pipes} the stream\n * into the writable side of the supplied pair, and returns the readable side for further use.\n *\n * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\n */\n pipeThrough&lt;RS extends ReadableStream&gt;(\n transform: { readable: RS; writable: WritableStream&lt;R&gt; },\n options?: StreamPipeOptions\n ): RS;\n pipeThrough&lt;RS extends ReadableStream&gt;(\n rawTransform: { readable: RS; writable: WritableStream&lt;R&gt; } | null | undefined,\n rawOptions: StreamPipeOptions | null | undefined = {}\n ): RS {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException(&#x27;pipeThrough&#x27;);\n }\n assertRequiredArgument(rawTransform, 1, &#x27;pipeThrough&#x27;);\n\n const transform = convertReadableWritablePair(rawTransform, &#x27;First parameter&#x27;);\n const options = convertPipeOptions(rawOptions, &#x27;Second parameter&#x27;);\n\n if (IsReadableStreamLocked(this)) {\n throw new TypeError(&#x27;ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream&#x27;);\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError(&#x27;ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream&#x27;);\n }\n\n const promise = ReadableStreamPipeTo(\n this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal\n );\n\n setPromiseIsHandledToTrue(promise);\n\n return transform.readable;\n }\n\n /**\n * Pipes this readable stream to a given writable stream. The way in which the piping process behaves under\n * various error conditions can be customized with a number of passed options. It returns a promise that fulfills\n * when the piping process completes successfully, or rejects if any errors were encountered.\n *\n * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\n */\n pipeTo(destination: WritableStream&lt;R&gt;, options?: StreamPipeOptions): Promise&lt;void&gt;;\n pipeTo(destination: WritableStream&lt;R&gt; | null | undefined,\n rawOptions: StreamPipeOptions | null | undefined = {}): Promise&lt;void&gt; {\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException(&#x27;pipeTo&#x27;));\n }\n\n if (destination === undefined) {\n return promiseRejectedWith(`Parameter 1 is required in &#x27;pipeTo&#x27;.`);\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(\n new TypeError(`ReadableStream.prototype.pipeTo&#x27;s first argument must be a WritableStream`)\n );\n }\n\n let options: ValidatedStreamPipeOptions;\n try {\n options = convertPipeOptions(rawOptions, &#x27;Second parameter&#x27;);\n } catch (e) {\n return promiseRejectedWith(e);\n }\n\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(\n new TypeError(&#x27;ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream&#x27;)\n );\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(\n new TypeError(&#x27;ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream&#x27;)\n );\n }\n\n return ReadableStreamPipeTo&lt;R&gt;(\n this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal\n );\n }\n\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream&#x27;s underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n tee(): [ReadableStream&lt;R&gt;, ReadableStream&lt;R&gt;] {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException(&#x27;tee&#x27;);\n }\n\n const branches = ReadableStreamTee(this, false);\n return CreateArrayFromList(branches);\n }\n\n /**\n * Asynchronously iterates over the chunks in the stream&#x27;s internal queue.\n *\n * Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader.\n * The lock will be released if the async iterator&#x27;s {@link ReadableStreamAsyncIterator.return | return()} method\n * is called, e.g. by breaking out of the loop.\n *\n * By default, calling the async iterator&#x27;s {@link ReadableStreamAsyncIterator.return | return()} method will also\n * cancel the stream. To prevent this, use the stream&#x27;s {@link ReadableStream.values | values()} method, passing\n * `true` for the `preventCancel` option.\n */\n values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator&lt;R&gt;;\n values(rawOptions: ReadableStreamIteratorOptions | null | undefined = undefined): ReadableStreamAsyncIterator&lt;R&gt; {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException(&#x27;values&#x27;);\n }\n\n const options = convertIteratorOptions(rawOptions, &#x27;First parameter&#x27;);\n return AcquireReadableStreamAsyncIterator&lt;R&gt;(this, options.preventCancel);\n }\n\n /**\n * {@inheritDoc ReadableStream.values}\n */\n [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator&lt;R&gt;;\n\n [SymbolAsyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator&lt;R&gt; {\n // Stub implementation, overridden below\n return this.values(options);\n }\n\n /**\n * Creates a new ReadableStream wrapping the provided iterable or async iterable.\n *\n * This can be used to adapt various kinds of objects into a readable stream,\n * such as an array, an async generator, or a Node.js readable stream.\n */\n static from&lt;R&gt;(asyncIterable: Iterable&lt;R&gt; | AsyncIterable&lt;R&gt; | ReadableStreamLike&lt;R&gt;): ReadableStream&lt;R&gt; {\n return ReadableStreamFrom(asyncIterable);\n }\n}\n\nObject.defineProperties(ReadableStream, {\n from: { enumerable: true }\n});\nObject.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n});\nsetFunctionName(ReadableStream.from, &#x27;from&#x27;);\nsetFunctionName(ReadableStream.prototype.cancel, &#x27;cancel&#x27;);\nsetFunctionName(ReadableStream.prototype.getReader, &#x27;getReader&#x27;);\nsetFunctionName(ReadableStream.prototype.pipeThrough, &#x27;pipeThrough&#x27;);\nsetFunctionName(ReadableStream.prototype.pipeTo, &#x27;pipeTo&#x27;);\nsetFunctionName(ReadableStream.prototype.tee, &#x27;tee&#x27;);\nsetFunctionName(ReadableStream.prototype.values, &#x27;values&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, {\n value: &#x27;ReadableStream&#x27;,\n configurable: true\n });\n}\nObject.defineProperty(ReadableStream.prototype, SymbolAsyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n});\n\nexport type {\n ReadableStreamAsyncIterator,\n ReadableStreamDefaultReadResult,\n ReadableStreamBYOBReadResult,\n ReadableStreamBYOBReaderReadOptions,\n UnderlyingByteSource,\n UnderlyingSource,\n UnderlyingSourceStartCallback,\n UnderlyingSourcePullCallback,\n UnderlyingSourceCancelCallback,\n UnderlyingByteSourceStartCallback,\n UnderlyingByteSourcePullCallback,\n StreamPipeOptions,\n ReadableWritablePair,\n ReadableStreamIteratorOptions,\n ReadableStreamLike,\n ReadableStreamDefaultReaderLike\n};\n\n// Abstract operations for the ReadableStream.\n\n// Throws if and only if startAlgorithm throws.\nexport function CreateReadableStream&lt;R&gt;(\n startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n pullAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n highWaterMark = 1,\n sizeAlgorithm: QueuingStrategySizeCallback&lt;R&gt; = () =&gt; 1\n): DefaultReadableStream&lt;R&gt; {\n assert(IsNonNegativeNumber(highWaterMark));\n\n const stream: DefaultReadableStream&lt;R&gt; = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n\n const controller: ReadableStreamDefaultController&lt;R&gt; = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(\n stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm\n );\n\n return stream;\n}\n\n// Throws if and only if startAlgorithm throws.\nexport function CreateReadableByteStream(\n startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n pullAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;\n): ReadableByteStream {\n const stream: ReadableByteStream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n\n const controller: ReadableByteStreamController = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n\n return stream;\n}\n\nfunction InitializeReadableStream(stream: ReadableStream) {\n stream._state = &#x27;readable&#x27;;\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n}\n\nexport function IsReadableStream(x: unknown): x is ReadableStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_readableStreamController&#x27;)) {\n return false;\n }\n\n return x instanceof ReadableStream;\n}\n\nexport function IsReadableStreamDisturbed(stream: ReadableStream): boolean {\n assert(IsReadableStream(stream));\n\n return stream._disturbed;\n}\n\nexport function IsReadableStreamLocked(stream: ReadableStream): boolean {\n assert(IsReadableStream(stream));\n\n if (stream._reader === undefined) {\n return false;\n }\n\n return true;\n}\n\n// ReadableStream API exposed for controllers.\n\nexport function ReadableStreamCancel&lt;R&gt;(stream: ReadableStream&lt;R&gt;, reason: any): Promise&lt;undefined&gt; {\n stream._disturbed = true;\n\n if (stream._state === &#x27;closed&#x27;) {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === &#x27;errored&#x27;) {\n return promiseRejectedWith(stream._storedError);\n }\n\n ReadableStreamClose(stream);\n\n const reader = stream._reader;\n if (reader !== undefined &amp;&amp; IsReadableStreamBYOBReader(reader)) {\n const readIntoRequests = reader._readIntoRequests;\n reader._readIntoRequests = new SimpleQueue();\n readIntoRequests.forEach(readIntoRequest =&gt; {\n readIntoRequest._closeSteps(undefined);\n });\n }\n\n const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n}\n\nexport function ReadableStreamClose&lt;R&gt;(stream: ReadableStream&lt;R&gt;): void {\n assert(stream._state === &#x27;readable&#x27;);\n\n stream._state = &#x27;closed&#x27;;\n\n const reader = stream._reader;\n\n if (reader === undefined) {\n return;\n }\n\n defaultReaderClosedPromiseResolve(reader);\n\n if (IsReadableStreamDefaultReader&lt;R&gt;(reader)) {\n const readRequests = reader._readRequests;\n reader._readRequests = new SimpleQueue();\n readRequests.forEach(readRequest =&gt; {\n readRequest._closeSteps();\n });\n }\n}\n\nexport function ReadableStreamError&lt;R&gt;(stream: ReadableStream&lt;R&gt;, e: any): void {\n assert(IsReadableStream(stream));\n assert(stream._state === &#x27;readable&#x27;);\n\n stream._state = &#x27;errored&#x27;;\n stream._storedError = e;\n\n const reader = stream._reader;\n\n if (reader === undefined) {\n return;\n }\n\n defaultReaderClosedPromiseReject(reader, e);\n\n if (IsReadableStreamDefaultReader&lt;R&gt;(reader)) {\n ReadableStreamDefaultReaderErrorReadRequests(reader, e);\n } else {\n assert(IsReadableStreamBYOBReader(reader));\n ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);\n }\n}\n\n// Readers\n\nexport type ReadableStreamReader&lt;R&gt; = ReadableStreamDefaultReader&lt;R&gt; | ReadableStreamBYOBReader;\n\nexport {\n ReadableStreamDefaultReader,\n ReadableStreamBYOBReader\n};\n\n// Controllers\n\nexport {\n ReadableStreamDefaultController,\n ReadableStreamBYOBRequest,\n ReadableByteStreamController\n};\n\n// Helper functions for the ReadableStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);\n}\n&quot;, &quot;import type { QueuingStrategyInit } from &#x27;../queuing-strategy&#x27;;\nimport { assertDictionary, assertRequiredField, convertUnrestrictedDouble } from &#x27;./basic&#x27;;\n\nexport function convertQueuingStrategyInit(init: QueuingStrategyInit | null | undefined,\n context: string): QueuingStrategyInit {\n assertDictionary(init, context);\n const highWaterMark = init?.highWaterMark;\n assertRequiredField(highWaterMark, &#x27;highWaterMark&#x27;, &#x27;QueuingStrategyInit&#x27;);\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n}\n&quot;, &quot;import type { QueuingStrategy, QueuingStrategyInit } from &#x27;./queuing-strategy&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;./helpers/miscellaneous&#x27;;\nimport { assertRequiredArgument } from &#x27;./validators/basic&#x27;;\nimport { convertQueuingStrategyInit } from &#x27;./validators/queuing-strategy-init&#x27;;\n\n// The size function must not have a prototype property nor be a constructor\nconst byteLengthSizeFunction = (chunk: ArrayBufferView): number =&gt; {\n return chunk.byteLength;\n};\nsetFunctionName(byteLengthSizeFunction, &#x27;size&#x27;);\n\n/**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\nexport default class ByteLengthQueuingStrategy implements QueuingStrategy&lt;ArrayBufferView&gt; {\n /** @internal */\n readonly _byteLengthQueuingStrategyHighWaterMark: number;\n\n constructor(options: QueuingStrategyInit) {\n assertRequiredArgument(options, 1, &#x27;ByteLengthQueuingStrategy&#x27;);\n options = convertQueuingStrategyInit(options, &#x27;First parameter&#x27;);\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark(): number {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException(&#x27;highWaterMark&#x27;);\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get size(): (chunk: ArrayBufferView) =&gt; number {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException(&#x27;size&#x27;);\n }\n return byteLengthSizeFunction;\n }\n}\n\nObject.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, {\n value: &#x27;ByteLengthQueuingStrategy&#x27;,\n configurable: true\n });\n}\n\n// Helper functions for the ByteLengthQueuingStrategy.\n\nfunction byteLengthBrandCheckException(name: string): TypeError {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);\n}\n\nexport function IsByteLengthQueuingStrategy(x: any): x is ByteLengthQueuingStrategy {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_byteLengthQueuingStrategyHighWaterMark&#x27;)) {\n return false;\n }\n\n return x instanceof ByteLengthQueuingStrategy;\n}\n&quot;, &quot;import type { QueuingStrategy, QueuingStrategyInit } from &#x27;./queuing-strategy&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;./helpers/miscellaneous&#x27;;\nimport { assertRequiredArgument } from &#x27;./validators/basic&#x27;;\nimport { convertQueuingStrategyInit } from &#x27;./validators/queuing-strategy-init&#x27;;\n\n// The size function must not have a prototype property nor be a constructor\nconst countSizeFunction = (): 1 =&gt; {\n return 1;\n};\nsetFunctionName(countSizeFunction, &#x27;size&#x27;);\n\n/**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\nexport default class CountQueuingStrategy implements QueuingStrategy&lt;any&gt; {\n /** @internal */\n readonly _countQueuingStrategyHighWaterMark!: number;\n\n constructor(options: QueuingStrategyInit) {\n assertRequiredArgument(options, 1, &#x27;CountQueuingStrategy&#x27;);\n options = convertQueuingStrategyInit(options, &#x27;First parameter&#x27;);\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n\n /**\n * Returns the high water mark provided to the constructor.\n */\n get highWaterMark(): number {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException(&#x27;highWaterMark&#x27;);\n }\n return this._countQueuingStrategyHighWaterMark;\n }\n\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get size(): (chunk: any) =&gt; 1 {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException(&#x27;size&#x27;);\n }\n return countSizeFunction;\n }\n}\n\nObject.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, {\n value: &#x27;CountQueuingStrategy&#x27;,\n configurable: true\n });\n}\n\n// Helper functions for the CountQueuingStrategy.\n\nfunction countBrandCheckException(name: string): TypeError {\n return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);\n}\n\nexport function IsCountQueuingStrategy(x: any): x is CountQueuingStrategy {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_countQueuingStrategyHighWaterMark&#x27;)) {\n return false;\n }\n\n return x instanceof CountQueuingStrategy;\n}\n&quot;, &quot;import { assertDictionary, assertFunction } from &#x27;./basic&#x27;;\nimport { promiseCall, reflectCall } from &#x27;../helpers/webidl&#x27;;\nimport type {\n Transformer,\n TransformerCancelCallback,\n TransformerFlushCallback,\n TransformerStartCallback,\n TransformerTransformCallback,\n ValidatedTransformer\n} from &#x27;../transform-stream/transformer&#x27;;\nimport { TransformStreamDefaultController } from &#x27;../transform-stream&#x27;;\n\nexport function convertTransformer&lt;I, O&gt;(original: Transformer&lt;I, O&gt; | null,\n context: string): ValidatedTransformer&lt;I, O&gt; {\n assertDictionary(original, context);\n const cancel = original?.cancel;\n const flush = original?.flush;\n const readableType = original?.readableType;\n const start = original?.start;\n const transform = original?.transform;\n const writableType = original?.writableType;\n return {\n cancel: cancel === undefined ?\n undefined :\n convertTransformerCancelCallback(cancel, original!, `${context} has member &#x27;cancel&#x27; that`),\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original!, `${context} has member &#x27;flush&#x27; that`),\n readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original!, `${context} has member &#x27;start&#x27; that`),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original!, `${context} has member &#x27;transform&#x27; that`),\n writableType\n };\n}\n\nfunction convertTransformerFlushCallback&lt;I, O&gt;(\n fn: TransformerFlushCallback&lt;O&gt;,\n original: Transformer&lt;I, O&gt;,\n context: string\n): (controller: TransformStreamDefaultController&lt;O&gt;) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (controller: TransformStreamDefaultController&lt;O&gt;) =&gt; promiseCall(fn, original, [controller]);\n}\n\nfunction convertTransformerStartCallback&lt;I, O&gt;(\n fn: TransformerStartCallback&lt;O&gt;,\n original: Transformer&lt;I, O&gt;,\n context: string\n): TransformerStartCallback&lt;O&gt; {\n assertFunction(fn, context);\n return (controller: TransformStreamDefaultController&lt;O&gt;) =&gt; reflectCall(fn, original, [controller]);\n}\n\nfunction convertTransformerTransformCallback&lt;I, O&gt;(\n fn: TransformerTransformCallback&lt;I, O&gt;,\n original: Transformer&lt;I, O&gt;,\n context: string\n): (chunk: I, controller: TransformStreamDefaultController&lt;O&gt;) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (chunk: I, controller: TransformStreamDefaultController&lt;O&gt;) =&gt; promiseCall(fn, original, [chunk, controller]);\n}\n\nfunction convertTransformerCancelCallback&lt;I, O&gt;(\n fn: TransformerCancelCallback,\n original: Transformer&lt;I, O&gt;,\n context: string\n): (reason: any) =&gt; Promise&lt;void&gt; {\n assertFunction(fn, context);\n return (reason: any) =&gt; promiseCall(fn, original, [reason]);\n}\n&quot;, &quot;import assert from &#x27;../stub/assert&#x27;;\nimport {\n newPromise,\n promiseRejectedWith,\n promiseResolvedWith,\n setPromiseIsHandledToTrue,\n transformPromiseWith,\n uponPromise\n} from &#x27;./helpers/webidl&#x27;;\nimport { CreateReadableStream, type DefaultReadableStream, ReadableStream } from &#x27;./readable-stream&#x27;;\nimport {\n ReadableStreamDefaultControllerCanCloseOrEnqueue,\n ReadableStreamDefaultControllerClose,\n ReadableStreamDefaultControllerEnqueue,\n ReadableStreamDefaultControllerError,\n ReadableStreamDefaultControllerGetDesiredSize,\n ReadableStreamDefaultControllerHasBackpressure\n} from &#x27;./readable-stream/default-controller&#x27;;\nimport type { QueuingStrategy, QueuingStrategySizeCallback } from &#x27;./queuing-strategy&#x27;;\nimport { CreateWritableStream, WritableStream, WritableStreamDefaultControllerErrorIfNeeded } from &#x27;./writable-stream&#x27;;\nimport { setFunctionName, typeIsObject } from &#x27;./helpers/miscellaneous&#x27;;\nimport { IsNonNegativeNumber } from &#x27;./abstract-ops/miscellaneous&#x27;;\nimport { convertQueuingStrategy } from &#x27;./validators/queuing-strategy&#x27;;\nimport { ExtractHighWaterMark, ExtractSizeAlgorithm } from &#x27;./abstract-ops/queuing-strategy&#x27;;\nimport type {\n Transformer,\n TransformerCancelCallback,\n TransformerFlushCallback,\n TransformerStartCallback,\n TransformerTransformCallback,\n ValidatedTransformer\n} from &#x27;./transform-stream/transformer&#x27;;\nimport { convertTransformer } from &#x27;./validators/transformer&#x27;;\n\n// Class TransformStream\n\n/**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\nexport class TransformStream&lt;I = any, O = any&gt; {\n /** @internal */\n _writable!: WritableStream&lt;I&gt;;\n /** @internal */\n _readable!: DefaultReadableStream&lt;O&gt;;\n /** @internal */\n _backpressure!: boolean;\n /** @internal */\n _backpressureChangePromise!: Promise&lt;void&gt;;\n /** @internal */\n _backpressureChangePromise_resolve!: () =&gt; void;\n /** @internal */\n _transformStreamController!: TransformStreamDefaultController&lt;O&gt;;\n\n constructor(\n transformer?: Transformer&lt;I, O&gt;,\n writableStrategy?: QueuingStrategy&lt;I&gt;,\n readableStrategy?: QueuingStrategy&lt;O&gt;\n );\n constructor(rawTransformer: Transformer&lt;I, O&gt; | null | undefined = {},\n rawWritableStrategy: QueuingStrategy&lt;I&gt; | null | undefined = {},\n rawReadableStrategy: QueuingStrategy&lt;O&gt; | null | undefined = {}) {\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n\n const writableStrategy = convertQueuingStrategy(rawWritableStrategy, &#x27;Second parameter&#x27;);\n const readableStrategy = convertQueuingStrategy(rawReadableStrategy, &#x27;Third parameter&#x27;);\n\n const transformer = convertTransformer(rawTransformer, &#x27;First parameter&#x27;);\n if (transformer.readableType !== undefined) {\n throw new RangeError(&#x27;Invalid readableType specified&#x27;);\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError(&#x27;Invalid writableType specified&#x27;);\n }\n\n const readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n const readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n\n let startPromise_resolve!: (value: void | PromiseLike&lt;void&gt;) =&gt; void;\n const startPromise = newPromise&lt;void&gt;(resolve =&gt; {\n startPromise_resolve = resolve;\n });\n\n InitializeTransformStream(\n this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm\n );\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n } else {\n startPromise_resolve(undefined);\n }\n }\n\n /**\n * The readable side of the transform stream.\n */\n get readable(): ReadableStream&lt;O&gt; {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException(&#x27;readable&#x27;);\n }\n\n return this._readable;\n }\n\n /**\n * The writable side of the transform stream.\n */\n get writable(): WritableStream&lt;I&gt; {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException(&#x27;writable&#x27;);\n }\n\n return this._writable;\n }\n}\n\nObject.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n});\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, {\n value: &#x27;TransformStream&#x27;,\n configurable: true\n });\n}\n\nexport type {\n Transformer,\n TransformerCancelCallback,\n TransformerStartCallback,\n TransformerFlushCallback,\n TransformerTransformCallback\n};\n\n// Transform Stream Abstract Operations\n\nexport function CreateTransformStream&lt;I, O&gt;(startAlgorithm: () =&gt; void | PromiseLike&lt;void&gt;,\n transformAlgorithm: (chunk: I) =&gt; Promise&lt;void&gt;,\n flushAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;,\n writableHighWaterMark = 1,\n writableSizeAlgorithm: QueuingStrategySizeCallback&lt;I&gt; = () =&gt; 1,\n readableHighWaterMark = 0,\n readableSizeAlgorithm: QueuingStrategySizeCallback&lt;O&gt; = () =&gt; 1) {\n assert(IsNonNegativeNumber(writableHighWaterMark));\n assert(IsNonNegativeNumber(readableHighWaterMark));\n\n const stream: TransformStream&lt;I, O&gt; = Object.create(TransformStream.prototype);\n\n let startPromise_resolve!: (value: void | PromiseLike&lt;void&gt;) =&gt; void;\n const startPromise = newPromise&lt;void&gt;(resolve =&gt; {\n startPromise_resolve = resolve;\n });\n\n InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark,\n readableSizeAlgorithm);\n\n const controller: TransformStreamDefaultController&lt;O&gt; = Object.create(TransformStreamDefaultController.prototype);\n\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n\n const startResult = startAlgorithm();\n startPromise_resolve(startResult);\n return stream;\n}\n\nfunction InitializeTransformStream&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;,\n startPromise: Promise&lt;void&gt;,\n writableHighWaterMark: number,\n writableSizeAlgorithm: QueuingStrategySizeCallback&lt;I&gt;,\n readableHighWaterMark: number,\n readableSizeAlgorithm: QueuingStrategySizeCallback&lt;O&gt;) {\n function startAlgorithm(): Promise&lt;void&gt; {\n return startPromise;\n }\n\n function writeAlgorithm(chunk: I): Promise&lt;void&gt; {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n\n function abortAlgorithm(reason: any): Promise&lt;void&gt; {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n\n function closeAlgorithm(): Promise&lt;void&gt; {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm,\n writableHighWaterMark, writableSizeAlgorithm);\n\n function pullAlgorithm(): Promise&lt;void&gt; {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n\n function cancelAlgorithm(reason: any): Promise&lt;void&gt; {\n return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);\n }\n\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark,\n readableSizeAlgorithm);\n\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined!;\n stream._backpressureChangePromise = undefined!;\n stream._backpressureChangePromise_resolve = undefined!;\n TransformStreamSetBackpressure(stream, true);\n\n stream._transformStreamController = undefined!;\n}\n\nfunction IsTransformStream(x: unknown): x is TransformStream {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_transformStreamController&#x27;)) {\n return false;\n }\n\n return x instanceof TransformStream;\n}\n\n// This is a no-op if both sides are already errored.\nfunction TransformStreamError(stream: TransformStream, e: any) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n}\n\nfunction TransformStreamErrorWritableAndUnblockWrite(stream: TransformStream, e: any) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n TransformStreamUnblockWrite(stream);\n}\n\nfunction TransformStreamUnblockWrite(stream: TransformStream) {\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n}\n\nfunction TransformStreamSetBackpressure(stream: TransformStream, backpressure: boolean) {\n // Passes also when called during construction.\n assert(stream._backpressure !== backpressure);\n\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n\n stream._backpressureChangePromise = newPromise(resolve =&gt; {\n stream._backpressureChangePromise_resolve = resolve;\n });\n\n stream._backpressure = backpressure;\n}\n\n// Class TransformStreamDefaultController\n\n/**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\nexport class TransformStreamDefaultController&lt;O&gt; {\n /** @internal */\n _controlledTransformStream: TransformStream&lt;any, O&gt;;\n /** @internal */\n _finishPromise: Promise&lt;undefined&gt; | undefined;\n /** @internal */\n _finishPromise_resolve?: (value?: undefined) =&gt; void;\n /** @internal */\n _finishPromise_reject?: (reason: any) =&gt; void;\n /** @internal */\n _transformAlgorithm: (chunk: any) =&gt; Promise&lt;void&gt;;\n /** @internal */\n _flushAlgorithm: () =&gt; Promise&lt;void&gt;;\n /** @internal */\n _cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;;\n\n private constructor() {\n throw new TypeError(&#x27;Illegal constructor&#x27;);\n }\n\n /**\n * Returns the desired size to fill the readable sideโ€™s internal queue. It can be negative, if the queue is over-full.\n */\n get desiredSize(): number | null {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;desiredSize&#x27;);\n }\n\n const readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n }\n\n /**\n * Enqueues the given chunk `chunk` in the readable side of the controlled transform stream.\n */\n enqueue(chunk: O): void;\n enqueue(chunk: O = undefined!): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;enqueue&#x27;);\n }\n\n TransformStreamDefaultControllerEnqueue(this, chunk);\n }\n\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n error(reason: any = undefined): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;error&#x27;);\n }\n\n TransformStreamDefaultControllerError(this, reason);\n }\n\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n terminate(): void {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException(&#x27;terminate&#x27;);\n }\n\n TransformStreamDefaultControllerTerminate(this);\n }\n}\n\nObject.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n});\nsetFunctionName(TransformStreamDefaultController.prototype.enqueue, &#x27;enqueue&#x27;);\nsetFunctionName(TransformStreamDefaultController.prototype.error, &#x27;error&#x27;);\nsetFunctionName(TransformStreamDefaultController.prototype.terminate, &#x27;terminate&#x27;);\nif (typeof Symbol.toStringTag === &#x27;symbol&#x27;) {\n Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, {\n value: &#x27;TransformStreamDefaultController&#x27;,\n configurable: true\n });\n}\n\n// Transform Stream Default Controller Abstract Operations\n\nfunction IsTransformStreamDefaultController&lt;O = any&gt;(x: any): x is TransformStreamDefaultController&lt;O&gt; {\n if (!typeIsObject(x)) {\n return false;\n }\n\n if (!Object.prototype.hasOwnProperty.call(x, &#x27;_controlledTransformStream&#x27;)) {\n return false;\n }\n\n return x instanceof TransformStreamDefaultController;\n}\n\nfunction SetUpTransformStreamDefaultController&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;,\n controller: TransformStreamDefaultController&lt;O&gt;,\n transformAlgorithm: (chunk: I) =&gt; Promise&lt;void&gt;,\n flushAlgorithm: () =&gt; Promise&lt;void&gt;,\n cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;) {\n assert(IsTransformStream(stream));\n assert(stream._transformStreamController === undefined);\n\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n\n controller._finishPromise = undefined;\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\nfunction SetUpTransformStreamDefaultControllerFromTransformer&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;,\n transformer: ValidatedTransformer&lt;I, O&gt;) {\n const controller: TransformStreamDefaultController&lt;O&gt; = Object.create(TransformStreamDefaultController.prototype);\n\n let transformAlgorithm: (chunk: I) =&gt; Promise&lt;void&gt;;\n let flushAlgorithm: () =&gt; Promise&lt;void&gt;;\n let cancelAlgorithm: (reason: any) =&gt; Promise&lt;void&gt;;\n\n if (transformer.transform !== undefined) {\n transformAlgorithm = chunk =&gt; transformer.transform!(chunk, controller);\n } else {\n transformAlgorithm = chunk =&gt; {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk as unknown as O);\n return promiseResolvedWith(undefined);\n } catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n }\n\n if (transformer.flush !== undefined) {\n flushAlgorithm = () =&gt; transformer.flush!(controller);\n } else {\n flushAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n\n if (transformer.cancel !== undefined) {\n cancelAlgorithm = reason =&gt; transformer.cancel!(reason);\n } else {\n cancelAlgorithm = () =&gt; promiseResolvedWith(undefined);\n }\n\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);\n}\n\nfunction TransformStreamDefaultControllerClearAlgorithms(controller: TransformStreamDefaultController&lt;any&gt;) {\n controller._transformAlgorithm = undefined!;\n controller._flushAlgorithm = undefined!;\n controller._cancelAlgorithm = undefined!;\n}\n\nfunction TransformStreamDefaultControllerEnqueue&lt;O&gt;(controller: TransformStreamDefaultController&lt;O&gt;, chunk: O) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError(&#x27;Readable side is not in a state that permits enqueue&#x27;);\n }\n\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n } catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n\n throw stream._readable._storedError;\n }\n\n const backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n assert(backpressure);\n TransformStreamSetBackpressure(stream, true);\n }\n}\n\nfunction TransformStreamDefaultControllerError(controller: TransformStreamDefaultController&lt;any&gt;, e: any) {\n TransformStreamError(controller._controlledTransformStream, e);\n}\n\nfunction TransformStreamDefaultControllerPerformTransform&lt;I, O&gt;(controller: TransformStreamDefaultController&lt;O&gt;,\n chunk: I) {\n const transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, r =&gt; {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n}\n\nfunction TransformStreamDefaultControllerTerminate&lt;O&gt;(controller: TransformStreamDefaultController&lt;O&gt;) {\n const stream = controller._controlledTransformStream;\n const readableController = stream._readable._readableStreamController;\n\n ReadableStreamDefaultControllerClose(readableController);\n\n const error = new TypeError(&#x27;TransformStream terminated&#x27;);\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n}\n\n// TransformStreamDefaultSink Algorithms\n\nfunction TransformStreamDefaultSinkWriteAlgorithm&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;, chunk: I): Promise&lt;void&gt; {\n assert(stream._writable._state === &#x27;writable&#x27;);\n\n const controller = stream._transformStreamController;\n\n if (stream._backpressure) {\n const backpressureChangePromise = stream._backpressureChangePromise;\n assert(backpressureChangePromise !== undefined);\n return transformPromiseWith(backpressureChangePromise, () =&gt; {\n const writable = stream._writable;\n const state = writable._state;\n if (state === &#x27;erroring&#x27;) {\n throw writable._storedError;\n }\n assert(state === &#x27;writable&#x27;);\n return TransformStreamDefaultControllerPerformTransform&lt;I, O&gt;(controller, chunk);\n });\n }\n\n return TransformStreamDefaultControllerPerformTransform&lt;I, O&gt;(controller, chunk);\n}\n\nfunction TransformStreamDefaultSinkAbortAlgorithm&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;, reason: any): Promise&lt;void&gt; {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n\n // Assign the _finishPromise now so that if _cancelAlgorithm calls readable.cancel() internally,\n // we don&#x27;t run the _cancelAlgorithm again.\n controller._finishPromise = newPromise((resolve, reject) =&gt; {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(cancelPromise, () =&gt; {\n if (readable._state === &#x27;errored&#x27;) {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n } else {\n ReadableStreamDefaultControllerError(readable._readableStreamController, reason);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r =&gt; {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\nfunction TransformStreamDefaultSinkCloseAlgorithm&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;): Promise&lt;void&gt; {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n const readable = stream._readable;\n\n // Assign the _finishPromise now so that if _flushAlgorithm calls readable.cancel() internally,\n // we don&#x27;t also run the _cancelAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) =&gt; {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(flushPromise, () =&gt; {\n if (readable._state === &#x27;errored&#x27;) {\n defaultControllerFinishPromiseReject(controller, readable._storedError);\n } else {\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r =&gt; {\n ReadableStreamDefaultControllerError(readable._readableStreamController, r);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\n// TransformStreamDefaultSource Algorithms\n\nfunction TransformStreamDefaultSourcePullAlgorithm(stream: TransformStream): Promise&lt;void&gt; {\n // Invariant. Enforced by the promises returned by start() and pull().\n assert(stream._backpressure);\n\n assert(stream._backpressureChangePromise !== undefined);\n\n TransformStreamSetBackpressure(stream, false);\n\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n}\n\nfunction TransformStreamDefaultSourceCancelAlgorithm&lt;I, O&gt;(stream: TransformStream&lt;I, O&gt;, reason: any): Promise&lt;void&gt; {\n const controller = stream._transformStreamController;\n if (controller._finishPromise !== undefined) {\n return controller._finishPromise;\n }\n\n // stream._writable cannot change after construction, so caching it across a call to user code is safe.\n const writable = stream._writable;\n\n // Assign the _finishPromise now so that if _flushAlgorithm calls writable.abort() or\n // writable.cancel() internally, we don&#x27;t run the _cancelAlgorithm again, or also run the\n // _flushAlgorithm.\n controller._finishPromise = newPromise((resolve, reject) =&gt; {\n controller._finishPromise_resolve = resolve;\n controller._finishPromise_reject = reject;\n });\n\n const cancelPromise = controller._cancelAlgorithm(reason);\n TransformStreamDefaultControllerClearAlgorithms(controller);\n\n uponPromise(cancelPromise, () =&gt; {\n if (writable._state === &#x27;errored&#x27;) {\n defaultControllerFinishPromiseReject(controller, writable._storedError);\n } else {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseResolve(controller);\n }\n return null;\n }, r =&gt; {\n WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);\n TransformStreamUnblockWrite(stream);\n defaultControllerFinishPromiseReject(controller, r);\n return null;\n });\n\n return controller._finishPromise;\n}\n\n// Helper functions for the TransformStreamDefaultController.\n\nfunction defaultControllerBrandCheckException(name: string): TypeError {\n return new TypeError(\n `TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);\n}\n\nexport function defaultControllerFinishPromiseResolve(controller: TransformStreamDefaultController&lt;any&gt;) {\n if (controller._finishPromise_resolve === undefined) {\n return;\n }\n\n controller._finishPromise_resolve();\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\nexport function defaultControllerFinishPromiseReject(controller: TransformStreamDefaultController&lt;any&gt;, reason: any) {\n if (controller._finishPromise_reject === undefined) {\n return;\n }\n\n setPromiseIsHandledToTrue(controller._finishPromise!);\n controller._finishPromise_reject(reason);\n controller._finishPromise_resolve = undefined;\n controller._finishPromise_reject = undefined;\n}\n\n// Helper functions for the TransformStream.\n\nfunction streamBrandCheckException(name: string): TypeError {\n return new TypeError(\n `TransformStream.prototype.${name} can only be used on a TransformStream`);\n}\n&quot;, &quot;/* c8 ignore start */\n// 64 KiB (same size chrome slice theirs blob into Uint8array&#x27;s)\nconst POOL_SIZE = 65536\n\nif (!globalThis.ReadableStream) {\n // `node:stream/web` got introduced in v16.5.0 as experimental\n // and it&#x27;s preferred over the polyfilled version. So we also\n // suppress the warning that gets emitted by NodeJS for using it.\n try {\n const process = require(&#x27;node:process&#x27;)\n const { emitWarning } = process\n try {\n process.emitWarning = () =&gt; {}\n Object.assign(globalThis, require(&#x27;node:stream/web&#x27;))\n process.emitWarning = emitWarning\n } catch (error) {\n process.emitWarning = emitWarning\n throw error\n }\n } catch (error) {\n // fallback to polyfill implementation\n Object.assign(globalThis, require(&#x27;web-streams-polyfill/dist/ponyfill.es2018.js&#x27;))\n }\n}\n\ntry {\n // Don&#x27;t use node: prefix for this, require+node: is not supported until node v14.14\n // Only `import()` can use prefix in 12.20 and later\n const { Blob } = require(&#x27;buffer&#x27;)\n if (Blob &amp;&amp; !Blob.prototype.stream) {\n Blob.prototype.stream = function name (params) {\n let position = 0\n const blob = this\n\n return new ReadableStream({\n type: &#x27;bytes&#x27;,\n async pull (ctrl) {\n const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n ctrl.enqueue(new Uint8Array(buffer))\n\n if (position === blob.size) {\n ctrl.close()\n }\n }\n })\n }\n }\n} catch (error) {}\n/* c8 ignore end */\n&quot;, &quot;/*! fetch-blob. MIT License. Jimmy W\u00E4rting &lt;https://jimmy.warting.se/opensource&gt; */\n\n// TODO (jimmywarting): in the feature use conditional loading with top level await (requires 14.x)\n// Node has recently added whatwg stream into core\n\nimport &#x27;./streams.cjs&#x27;\n\n// 64 KiB (same size chrome slice theirs blob into Uint8array&#x27;s)\nconst POOL_SIZE = 65536\n\n/** @param {(Blob | Uint8Array)[]} parts */\nasync function * toIterator (parts, clone = true) {\n for (const part of parts) {\n if (&#x27;stream&#x27; in part) {\n yield * (/** @type {AsyncIterableIterator&lt;Uint8Array&gt;} */ (part.stream()))\n } else if (ArrayBuffer.isView(part)) {\n if (clone) {\n let position = part.byteOffset\n const end = part.byteOffset + part.byteLength\n while (position !== end) {\n const size = Math.min(end - position, POOL_SIZE)\n const chunk = part.buffer.slice(position, position + size)\n position += chunk.byteLength\n yield new Uint8Array(chunk)\n }\n } else {\n yield part\n }\n /* c8 ignore next 10 */\n } else {\n // For blobs that have arrayBuffer but no stream method (nodes buffer.Blob)\n let position = 0, b = (/** @type {Blob} */ (part))\n while (position !== b.size) {\n const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE))\n const buffer = await chunk.arrayBuffer()\n position += buffer.byteLength\n yield new Uint8Array(buffer)\n }\n }\n }\n}\n\nconst _Blob = class Blob {\n /** @type {Array.&lt;(Blob|Uint8Array)&gt;} */\n #parts = []\n #type = &#x27;&#x27;\n #size = 0\n #endings = &#x27;transparent&#x27;\n\n /**\n * The Blob() constructor returns a new Blob object. The content\n * of the blob consists of the concatenation of the values given\n * in the parameter array.\n *\n * @param {*} blobParts\n * @param {{ type?: string, endings?: string }} [options]\n */\n constructor (blobParts = [], options = {}) {\n if (typeof blobParts !== &#x27;object&#x27; || blobParts === null) {\n throw new TypeError(&#x27;Failed to construct \\&#x27;Blob\\&#x27;: The provided value cannot be converted to a sequence.&#x27;)\n }\n\n if (typeof blobParts[Symbol.iterator] !== &#x27;function&#x27;) {\n throw new TypeError(&#x27;Failed to construct \\&#x27;Blob\\&#x27;: The object must have a callable @@iterator property.&#x27;)\n }\n\n if (typeof options !== &#x27;object&#x27; &amp;&amp; typeof options !== &#x27;function&#x27;) {\n throw new TypeError(&#x27;Failed to construct \\&#x27;Blob\\&#x27;: parameter 2 cannot convert to dictionary.&#x27;)\n }\n\n if (options === null) options = {}\n\n const encoder = new TextEncoder()\n for (const element of blobParts) {\n let part\n if (ArrayBuffer.isView(element)) {\n part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength))\n } else if (element instanceof ArrayBuffer) {\n part = new Uint8Array(element.slice(0))\n } else if (element instanceof Blob) {\n part = element\n } else {\n part = encoder.encode(`${element}`)\n }\n\n this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size\n this.#parts.push(part)\n }\n\n this.#endings = `${options.endings === undefined ? &#x27;transparent&#x27; : options.endings}`\n const type = options.type === undefined ? &#x27;&#x27; : String(options.type)\n this.#type = /^[\\x20-\\x7E]*$/.test(type) ? type : &#x27;&#x27;\n }\n\n /**\n * The Blob interface&#x27;s size property returns the\n * size of the Blob in bytes.\n */\n get size () {\n return this.#size\n }\n\n /**\n * The type property of a Blob object returns the MIME type of the file.\n */\n get type () {\n return this.#type\n }\n\n /**\n * The text() method in the Blob interface returns a Promise\n * that resolves with a string containing the contents of\n * the blob, interpreted as UTF-8.\n *\n * @return {Promise&lt;string&gt;}\n */\n async text () {\n // More optimized than using this.arrayBuffer()\n // that requires twice as much ram\n const decoder = new TextDecoder()\n let str = &#x27;&#x27;\n for await (const part of toIterator(this.#parts, false)) {\n str += decoder.decode(part, { stream: true })\n }\n // Remaining\n str += decoder.decode()\n return str\n }\n\n /**\n * The arrayBuffer() method in the Blob interface returns a\n * Promise that resolves with the contents of the blob as\n * binary data contained in an ArrayBuffer.\n *\n * @return {Promise&lt;ArrayBuffer&gt;}\n */\n async arrayBuffer () {\n // Easier way... Just a unnecessary overhead\n // const view = new Uint8Array(this.size);\n // await this.stream().getReader({mode: &#x27;byob&#x27;}).read(view);\n // return view.buffer;\n\n const data = new Uint8Array(this.size)\n let offset = 0\n for await (const chunk of toIterator(this.#parts, false)) {\n data.set(chunk, offset)\n offset += chunk.length\n }\n\n return data.buffer\n }\n\n stream () {\n const it = toIterator(this.#parts, true)\n\n return new globalThis.ReadableStream({\n // @ts-ignore\n type: &#x27;bytes&#x27;,\n async pull (ctrl) {\n const chunk = await it.next()\n chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value)\n },\n\n async cancel () {\n await it.return()\n }\n })\n }\n\n /**\n * The Blob interface&#x27;s slice() method creates and returns a\n * new Blob object which contains data from a subset of the\n * blob on which it&#x27;s called.\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [type]\n */\n slice (start = 0, end = this.size, type = &#x27;&#x27;) {\n const { size } = this\n\n let relativeStart = start &lt; 0 ? Math.max(size + start, 0) : Math.min(start, size)\n let relativeEnd = end &lt; 0 ? Math.max(size + end, 0) : Math.min(end, size)\n\n const span = Math.max(relativeEnd - relativeStart, 0)\n const parts = this.#parts\n const blobParts = []\n let added = 0\n\n for (const part of parts) {\n // don&#x27;t add the overflow to new blobParts\n if (added &gt;= span) {\n break\n }\n\n const size = ArrayBuffer.isView(part) ? part.byteLength : part.size\n if (relativeStart &amp;&amp; size &lt;= relativeStart) {\n // Skip the beginning and change the relative\n // start &amp; end position as we skip the unwanted parts\n relativeStart -= size\n relativeEnd -= size\n } else {\n let chunk\n if (ArrayBuffer.isView(part)) {\n chunk = part.subarray(relativeStart, Math.min(size, relativeEnd))\n added += chunk.byteLength\n } else {\n chunk = part.slice(relativeStart, Math.min(size, relativeEnd))\n added += chunk.size\n }\n relativeEnd -= size\n blobParts.push(chunk)\n relativeStart = 0 // All next sequential parts should start at 0\n }\n }\n\n const blob = new Blob([], { type: String(type).toLowerCase() })\n blob.#size = span\n blob.#parts = blobParts\n\n return blob\n }\n\n get [Symbol.toStringTag] () {\n return &#x27;Blob&#x27;\n }\n\n static [Symbol.hasInstance] (object) {\n return (\n object &amp;&amp;\n typeof object === &#x27;object&#x27; &amp;&amp;\n typeof object.constructor === &#x27;function&#x27; &amp;&amp;\n (\n typeof object.stream === &#x27;function&#x27; ||\n typeof object.arrayBuffer === &#x27;function&#x27;\n ) &amp;&amp;\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n }\n}\n\nObject.defineProperties(_Blob.prototype, {\n size: { enumerable: true },\n type: { enumerable: true },\n slice: { enumerable: true }\n})\n\n/** @type {typeof globalThis.Blob} */\nexport const Blob = _Blob\nexport default Blob\n&quot;, &quot;import Blob from &#x27;./index.js&#x27;\n\nconst _File = class File extends Blob {\n #lastModified = 0\n #name = &#x27;&#x27;\n\n /**\n * @param {*[]} fileBits\n * @param {string} fileName\n * @param {{lastModified?: number, type?: string}} options\n */// @ts-ignore\n constructor (fileBits, fileName, options = {}) {\n if (arguments.length &lt; 2) {\n throw new TypeError(`Failed to construct &#x27;File&#x27;: 2 arguments required, but only ${arguments.length} present.`)\n }\n super(fileBits, options)\n\n if (options === null) options = {}\n\n // Simulate WebIDL type casting for NaN value in lastModified option.\n const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified)\n if (!Number.isNaN(lastModified)) {\n this.#lastModified = lastModified\n }\n\n this.#name = String(fileName)\n }\n\n get name () {\n return this.#name\n }\n\n get lastModified () {\n return this.#lastModified\n }\n\n get [Symbol.toStringTag] () {\n return &#x27;File&#x27;\n }\n\n static [Symbol.hasInstance] (object) {\n return !!object &amp;&amp; object instanceof Blob &amp;&amp;\n /^(File)$/.test(object[Symbol.toStringTag])\n }\n}\n\n/** @type {typeof globalThis.File} */// @ts-ignore\nexport const File = _File\nexport default File\n&quot;, &quot;/*! formdata-polyfill. MIT License. Jimmy W\u00E4rting &lt;https://jimmy.warting.se/opensource&gt; */\n\nimport C from &#x27;fetch-blob&#x27;\nimport F from &#x27;fetch-blob/file.js&#x27;\n\nvar {toStringTag:t,iterator:i,hasInstance:h}=Symbol,\nr=Math.random,\nm=&#x27;append,set,get,getAll,delete,keys,values,entries,forEach,constructor&#x27;.split(&#x27;,&#x27;),\nf=(a,b,c)=&gt;(a+=&#x27;&#x27;,/^(Blob|File)$/.test(b &amp;&amp; b[t])?[(c=c!==void 0?c+&#x27;&#x27;:b[t]==&#x27;File&#x27;?b.name:&#x27;blob&#x27;,a),b.name!==c||b[t]==&#x27;blob&#x27;?new F([b],c,b):b]:[a,b+&#x27;&#x27;]),\ne=(c,f)=&gt;(f?c:c.replace(/\\r?\\n|\\r/g,&#x27;\\r\\n&#x27;)).replace(/\\n/g,&#x27;%0A&#x27;).replace(/\\r/g,&#x27;%0D&#x27;).replace(/\&quot;/g,&#x27;%22&#x27;),\nx=(n, a, e)=&gt;{if(a.length&lt;e){throw new TypeError(`Failed to execute &#x27;${n}&#x27; on &#x27;FormData&#x27;: ${e} arguments required, but only ${a.length} present.`)}}\n\nexport const File = F\n\n/** @type {typeof globalThis.FormData} */\nexport const FormData = class FormData {\n#d=[];\nconstructor(...a){if(a.length)throw new TypeError(`Failed to construct &#x27;FormData&#x27;: parameter 1 is not of type &#x27;HTMLFormElement&#x27;.`)}\nget [t]() {return &#x27;FormData&#x27;}\n[i](){return this.entries()}\nstatic [h](o) {return o&amp;&amp;typeof o===&#x27;object&#x27;&amp;&amp;o[t]===&#x27;FormData&#x27;&amp;&amp;!m.some(m=&gt;typeof o[m]!=&#x27;function&#x27;)}\nappend(...a){x(&#x27;append&#x27;,arguments,2);this.#d.push(f(...a))}\ndelete(a){x(&#x27;delete&#x27;,arguments,1);a+=&#x27;&#x27;;this.#d=this.#d.filter(([b])=&gt;b!==a)}\nget(a){x(&#x27;get&#x27;,arguments,1);a+=&#x27;&#x27;;for(var b=this.#d,l=b.length,c=0;c&lt;l;c++)if(b[c][0]===a)return b[c][1];return null}\ngetAll(a,b){x(&#x27;getAll&#x27;,arguments,1);b=[];a+=&#x27;&#x27;;this.#d.forEach(c=&gt;c[0]===a&amp;&amp;b.push(c[1]));return b}\nhas(a){x(&#x27;has&#x27;,arguments,1);a+=&#x27;&#x27;;return this.#d.some(b=&gt;b[0]===a)}\nforEach(a,b){x(&#x27;forEach&#x27;,arguments,1);for(var [c,d]of this)a.call(b,d,c,this)}\nset(...a){x(&#x27;set&#x27;,arguments,2);var b=[],c=!0;a=f(...a);this.#d.forEach(d=&gt;{d[0]===a[0]?c&amp;&amp;(c=!b.push(a)):b.push(d)});c&amp;&amp;b.push(a);this.#d=b}\n*entries(){yield*this.#d}\n*keys(){for(var[a]of this)yield a}\n*values(){for(var[,a]of this)yield a}}\n\n/** @param {FormData} F */\nexport function formDataToBlob (F,B=C){\nvar b=`${r()}${r()}`.replace(/\\./g, &#x27;&#x27;).slice(-28).padStart(32, &#x27;-&#x27;),c=[],p=`--${b}\\r\\nContent-Disposition: form-data; name=\&quot;`\nF.forEach((v,n)=&gt;typeof v==&#x27;string&#x27;\n?c.push(p+e(n)+`\&quot;\\r\\n\\r\\n${v.replace(/\\r(?!\\n)|(?&lt;!\\r)\\n/g, &#x27;\\r\\n&#x27;)}\\r\\n`)\n:c.push(p+e(n)+`\&quot;; filename=\&quot;${e(v.name, 1)}\&quot;\\r\\nContent-Type: ${v.type||\&quot;application/octet-stream\&quot;}\\r\\n\\r\\n`, v, &#x27;\\r\\n&#x27;))\nc.push(`--${b}--`)\nreturn new B(c,{type:\&quot;multipart/form-data; boundary=\&quot;+b})}\n&quot;, &quot;export class FetchBaseError extends Error {\n\tconstructor(message, type) {\n\t\tsuper(message);\n\t\t// Hide custom error implementation details from end-users\n\t\tError.captureStackTrace(this, this.constructor);\n\n\t\tthis.type = type;\n\t}\n\n\tget name() {\n\t\treturn this.constructor.name;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n}\n&quot;, &quot;\nimport {FetchBaseError} from &#x27;./base.js&#x27;;\n\n/**\n * @typedef {{ address?: string, code: string, dest?: string, errno: number, info?: object, message: string, path?: string, port?: number, syscall: string}} SystemError\n*/\n\n/**\n * FetchError interface for operational errors\n */\nexport class FetchError extends FetchBaseError {\n\t/**\n\t * @param {string} message - Error message for human\n\t * @param {string} [type] - Error type for machine\n\t * @param {SystemError} [systemError] - For Node.js system error\n\t */\n\tconstructor(message, type, systemError) {\n\t\tsuper(message, type);\n\t\t// When err.type is `system`, err.erroredSysCall contains system error and err.code contains system error code\n\t\tif (systemError) {\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tthis.code = this.errno = systemError.code;\n\t\t\tthis.erroredSysCall = systemError.syscall;\n\t\t}\n\t}\n}\n&quot;, &quot;/**\n * Is.js\n *\n * Object type checks.\n */\n\nconst NAME = Symbol.toStringTag;\n\n/**\n * Check if `obj` is a URLSearchParams object\n * ref: https://github.com/node-fetch/node-fetch/issues/296#issuecomment-307598143\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isURLSearchParameters = object =&gt; {\n\treturn (\n\t\ttypeof object === &#x27;object&#x27; &amp;&amp;\n\t\ttypeof object.append === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.delete === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.get === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.getAll === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.has === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.set === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.sort === &#x27;function&#x27; &amp;&amp;\n\t\tobject[NAME] === &#x27;URLSearchParams&#x27;\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isBlob = object =&gt; {\n\treturn (\n\t\tobject &amp;&amp;\n\t\ttypeof object === &#x27;object&#x27; &amp;&amp;\n\t\ttypeof object.arrayBuffer === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.type === &#x27;string&#x27; &amp;&amp;\n\t\ttypeof object.stream === &#x27;function&#x27; &amp;&amp;\n\t\ttypeof object.constructor === &#x27;function&#x27; &amp;&amp;\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n * @param {*} object - Object to check for\n * @return {boolean}\n */\nexport const isAbortSignal = object =&gt; {\n\treturn (\n\t\ttypeof object === &#x27;object&#x27; &amp;&amp; (\n\t\t\tobject[NAME] === &#x27;AbortSignal&#x27; ||\n\t\t\tobject[NAME] === &#x27;EventTarget&#x27;\n\t\t)\n\t);\n};\n\n/**\n * isDomainOrSubdomain reports whether sub is a subdomain (or exact match) of\n * the parent domain.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isDomainOrSubdomain = (destination, original) =&gt; {\n\tconst orig = new URL(original).hostname;\n\tconst dest = new URL(destination).hostname;\n\n\treturn orig === dest || orig.endsWith(`.${dest}`);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nexport const isSameProtocol = (destination, original) =&gt; {\n\tconst orig = new URL(original).protocol;\n\tconst dest = new URL(destination).protocol;\n\n\treturn orig === dest;\n};\n&quot;, &quot;/*! node-domexception. MIT License. Jimmy W\u00E4rting &lt;https://jimmy.warting.se/opensource&gt; */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require(&#x27;worker_threads&#x27;),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === &#x27;DOMException&#x27; &amp;&amp; (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n&quot;, &quot;import { statSync, createReadStream, promises as fs } from &#x27;node:fs&#x27;\nimport { basename } from &#x27;node:path&#x27;\nimport DOMException from &#x27;node-domexception&#x27;\n\nimport File from &#x27;./file.js&#x27;\nimport Blob from &#x27;./index.js&#x27;\n\nconst { stat } = fs\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst blobFromSync = (path, type) =&gt; fromBlob(statSync(path), path, type)\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise&lt;Blob&gt;}\n */\nconst blobFrom = (path, type) =&gt; stat(path).then(stat =&gt; fromBlob(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n * @returns {Promise&lt;File&gt;}\n */\nconst fileFrom = (path, type) =&gt; stat(path).then(stat =&gt; fromFile(stat, path, type))\n\n/**\n * @param {string} path filepath on the disk\n * @param {string} [type] mimetype to use\n */\nconst fileFromSync = (path, type) =&gt; fromFile(statSync(path), path, type)\n\n// @ts-ignore\nconst fromBlob = (stat, path, type = &#x27;&#x27;) =&gt; new Blob([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], { type })\n\n// @ts-ignore\nconst fromFile = (stat, path, type = &#x27;&#x27;) =&gt; new File([new BlobDataItem({\n path,\n size: stat.size,\n lastModified: stat.mtimeMs,\n start: 0\n})], basename(path), { type, lastModified: stat.mtimeMs })\n\n/**\n * This is a blob backed up by a file on the disk\n * with minium requirement. Its wrapped around a Blob as a blobPart\n * so you have no direct access to this.\n *\n * @private\n */\nclass BlobDataItem {\n #path\n #start\n\n constructor (options) {\n this.#path = options.path\n this.#start = options.start\n this.size = options.size\n this.lastModified = options.lastModified\n }\n\n /**\n * Slicing arguments is first validated and formatted\n * to not be out of range by Blob.prototype.slice\n */\n slice (start, end) {\n return new BlobDataItem({\n path: this.#path,\n lastModified: this.lastModified,\n size: end - start,\n start: this.#start + start\n })\n }\n\n async * stream () {\n const { mtimeMs } = await stat(this.#path)\n if (mtimeMs &gt; this.lastModified) {\n throw new DOMException(&#x27;The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.&#x27;, &#x27;NotReadableError&#x27;)\n }\n yield * createReadStream(this.#path, {\n start: this.#start,\n end: this.#start + this.size - 1\n })\n }\n\n get [Symbol.toStringTag] () {\n return &#x27;Blob&#x27;\n }\n}\n\nexport default blobFromSync\nexport { File, Blob, blobFrom, blobFromSync, fileFrom, fileFromSync }\n&quot;, &quot;import {File} from &#x27;fetch-blob/from.js&#x27;;\nimport {FormData} from &#x27;formdata-polyfill/esm.min.js&#x27;;\n\nlet s = 0;\nconst S = {\n\tSTART_BOUNDARY: s++,\n\tHEADER_FIELD_START: s++,\n\tHEADER_FIELD: s++,\n\tHEADER_VALUE_START: s++,\n\tHEADER_VALUE: s++,\n\tHEADER_VALUE_ALMOST_DONE: s++,\n\tHEADERS_ALMOST_DONE: s++,\n\tPART_DATA_START: s++,\n\tPART_DATA: s++,\n\tEND: s++\n};\n\nlet f = 1;\nconst F = {\n\tPART_BOUNDARY: f,\n\tLAST_BOUNDARY: f *= 2\n};\n\nconst LF = 10;\nconst CR = 13;\nconst SPACE = 32;\nconst HYPHEN = 45;\nconst COLON = 58;\nconst A = 97;\nconst Z = 122;\n\nconst lower = c =&gt; c | 0x20;\n\nconst noop = () =&gt; {};\n\nclass MultipartParser {\n\t/**\n\t * @param {string} boundary\n\t */\n\tconstructor(boundary) {\n\t\tthis.index = 0;\n\t\tthis.flags = 0;\n\n\t\tthis.onHeaderEnd = noop;\n\t\tthis.onHeaderField = noop;\n\t\tthis.onHeadersEnd = noop;\n\t\tthis.onHeaderValue = noop;\n\t\tthis.onPartBegin = noop;\n\t\tthis.onPartData = noop;\n\t\tthis.onPartEnd = noop;\n\n\t\tthis.boundaryChars = {};\n\n\t\tboundary = &#x27;\\r\\n--&#x27; + boundary;\n\t\tconst ui8a = new Uint8Array(boundary.length);\n\t\tfor (let i = 0; i &lt; boundary.length; i++) {\n\t\t\tui8a[i] = boundary.charCodeAt(i);\n\t\t\tthis.boundaryChars[ui8a[i]] = true;\n\t\t}\n\n\t\tthis.boundary = ui8a;\n\t\tthis.lookbehind = new Uint8Array(this.boundary.length + 8);\n\t\tthis.state = S.START_BOUNDARY;\n\t}\n\n\t/**\n\t * @param {Uint8Array} data\n\t */\n\twrite(data) {\n\t\tlet i = 0;\n\t\tconst length_ = data.length;\n\t\tlet previousIndex = this.index;\n\t\tlet {lookbehind, boundary, boundaryChars, index, state, flags} = this;\n\t\tconst boundaryLength = this.boundary.length;\n\t\tconst boundaryEnd = boundaryLength - 1;\n\t\tconst bufferLength = data.length;\n\t\tlet c;\n\t\tlet cl;\n\n\t\tconst mark = name =&gt; {\n\t\t\tthis[name + &#x27;Mark&#x27;] = i;\n\t\t};\n\n\t\tconst clear = name =&gt; {\n\t\t\tdelete this[name + &#x27;Mark&#x27;];\n\t\t};\n\n\t\tconst callback = (callbackSymbol, start, end, ui8a) =&gt; {\n\t\t\tif (start === undefined || start !== end) {\n\t\t\t\tthis[callbackSymbol](ui8a &amp;&amp; ui8a.subarray(start, end));\n\t\t\t}\n\t\t};\n\n\t\tconst dataCallback = (name, clear) =&gt; {\n\t\t\tconst markSymbol = name + &#x27;Mark&#x27;;\n\t\t\tif (!(markSymbol in this)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (clear) {\n\t\t\t\tcallback(name, this[markSymbol], i, data);\n\t\t\t\tdelete this[markSymbol];\n\t\t\t} else {\n\t\t\t\tcallback(name, this[markSymbol], data.length, data);\n\t\t\t\tthis[markSymbol] = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (i = 0; i &lt; length_; i++) {\n\t\t\tc = data[i];\n\n\t\t\tswitch (state) {\n\t\t\t\tcase S.START_BOUNDARY:\n\t\t\t\t\tif (index === boundary.length - 2) {\n\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else if (c !== CR) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (index - 1 === boundary.length - 2) {\n\t\t\t\t\t\tif (flags &amp; F.LAST_BOUNDARY &amp;&amp; c === HYPHEN) {\n\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t} else if (!(flags &amp; F.LAST_BOUNDARY) &amp;&amp; c === LF) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tcallback(&#x27;onPartBegin&#x27;);\n\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c !== boundary[index + 2]) {\n\t\t\t\t\t\tindex = -2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === boundary[index + 2]) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_FIELD_START:\n\t\t\t\t\tstate = S.HEADER_FIELD;\n\t\t\t\t\tmark(&#x27;onHeaderField&#x27;);\n\t\t\t\t\tindex = 0;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_FIELD:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tclear(&#x27;onHeaderField&#x27;);\n\t\t\t\t\t\tstate = S.HEADERS_ALMOST_DONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === COLON) {\n\t\t\t\t\t\tif (index === 1) {\n\t\t\t\t\t\t\t// empty header field\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdataCallback(&#x27;onHeaderField&#x27;, true);\n\t\t\t\t\t\tstate = S.HEADER_VALUE_START;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcl = lower(c);\n\t\t\t\t\tif (cl &lt; A || cl &gt; Z) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_START:\n\t\t\t\t\tif (c === SPACE) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tmark(&#x27;onHeaderValue&#x27;);\n\t\t\t\t\tstate = S.HEADER_VALUE;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_VALUE:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tdataCallback(&#x27;onHeaderValue&#x27;, true);\n\t\t\t\t\t\tcallback(&#x27;onHeaderEnd&#x27;);\n\t\t\t\t\t\tstate = S.HEADER_VALUE_ALMOST_DONE;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADERS_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback(&#x27;onHeadersEnd&#x27;);\n\t\t\t\t\tstate = S.PART_DATA_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.PART_DATA_START:\n\t\t\t\t\tstate = S.PART_DATA;\n\t\t\t\t\tmark(&#x27;onPartData&#x27;);\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.PART_DATA:\n\t\t\t\t\tpreviousIndex = index;\n\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t// boyer-moore derrived algorithm to safely skip non-boundary data\n\t\t\t\t\t\ti += boundaryEnd;\n\t\t\t\t\t\twhile (i &lt; bufferLength &amp;&amp; !(data[i] in boundaryChars)) {\n\t\t\t\t\t\t\ti += boundaryLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti -= boundaryEnd;\n\t\t\t\t\t\tc = data[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index &lt; boundary.length) {\n\t\t\t\t\t\tif (boundary[index] === c) {\n\t\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\t\tdataCallback(&#x27;onPartData&#x27;, true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === boundary.length) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\t\t// CR = part boundary\n\t\t\t\t\t\t\tflags |= F.PART_BOUNDARY;\n\t\t\t\t\t\t} else if (c === HYPHEN) {\n\t\t\t\t\t\t\t// HYPHEN = end boundary\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index - 1 === boundary.length) {\n\t\t\t\t\t\tif (flags &amp; F.PART_BOUNDARY) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tif (c === LF) {\n\t\t\t\t\t\t\t\t// unset the PART_BOUNDARY flag\n\t\t\t\t\t\t\t\tflags &amp;= ~F.PART_BOUNDARY;\n\t\t\t\t\t\t\t\tcallback(&#x27;onPartEnd&#x27;);\n\t\t\t\t\t\t\t\tcallback(&#x27;onPartBegin&#x27;);\n\t\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (flags &amp; F.LAST_BOUNDARY) {\n\t\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\t\tcallback(&#x27;onPartEnd&#x27;);\n\t\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index &gt; 0) {\n\t\t\t\t\t\t// when matching a possible boundary, keep a lookbehind reference\n\t\t\t\t\t\t// in case it turns out to be a false lead\n\t\t\t\t\t\tlookbehind[index - 1] = c;\n\t\t\t\t\t} else if (previousIndex &gt; 0) {\n\t\t\t\t\t\t// if our boundary turned out to be rubbish, the captured lookbehind\n\t\t\t\t\t\t// belongs to partData\n\t\t\t\t\t\tconst _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);\n\t\t\t\t\t\tcallback(&#x27;onPartData&#x27;, 0, previousIndex, _lookbehind);\n\t\t\t\t\t\tpreviousIndex = 0;\n\t\t\t\t\t\tmark(&#x27;onPartData&#x27;);\n\n\t\t\t\t\t\t// reconsider the current character even so it interrupted the sequence\n\t\t\t\t\t\t// it could be the beginning of a new sequence\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.END:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Unexpected state entered: ${state}`);\n\t\t\t}\n\t\t}\n\n\t\tdataCallback(&#x27;onHeaderField&#x27;);\n\t\tdataCallback(&#x27;onHeaderValue&#x27;);\n\t\tdataCallback(&#x27;onPartData&#x27;);\n\n\t\t// Update properties for the next call\n\t\tthis.index = index;\n\t\tthis.state = state;\n\t\tthis.flags = flags;\n\t}\n\n\tend() {\n\t\tif ((this.state === S.HEADER_FIELD_START &amp;&amp; this.index === 0) ||\n\t\t\t(this.state === S.PART_DATA &amp;&amp; this.index === this.boundary.length)) {\n\t\t\tthis.onPartEnd();\n\t\t} else if (this.state !== S.END) {\n\t\t\tthrow new Error(&#x27;MultipartParser.end(): stream ended unexpectedly&#x27;);\n\t\t}\n\t}\n}\n\nfunction _fileName(headerValue) {\n\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\tconst m = headerValue.match(/\\bfilename=(\&quot;(.*?)\&quot;|([^()&lt;&gt;@,;:\\\\\&quot;/[\\]?={}\\s\\t]+))($|;\\s)/i);\n\tif (!m) {\n\t\treturn;\n\t}\n\n\tconst match = m[2] || m[3] || &#x27;&#x27;;\n\tlet filename = match.slice(match.lastIndexOf(&#x27;\\\\&#x27;) + 1);\n\tfilename = filename.replace(/%22/g, &#x27;\&quot;&#x27;);\n\tfilename = filename.replace(/&amp;#(\\d{4});/g, (m, code) =&gt; {\n\t\treturn String.fromCharCode(code);\n\t});\n\treturn filename;\n}\n\nexport async function toFormData(Body, ct) {\n\tif (!/multipart/i.test(ct)) {\n\t\tthrow new TypeError(&#x27;Failed to fetch&#x27;);\n\t}\n\n\tconst m = ct.match(/boundary=(?:\&quot;([^\&quot;]+)\&quot;|([^;]+))/i);\n\n\tif (!m) {\n\t\tthrow new TypeError(&#x27;no or bad content-type header, no multipart boundary&#x27;);\n\t}\n\n\tconst parser = new MultipartParser(m[1] || m[2]);\n\n\tlet headerField;\n\tlet headerValue;\n\tlet entryValue;\n\tlet entryName;\n\tlet contentType;\n\tlet filename;\n\tconst entryChunks = [];\n\tconst formData = new FormData();\n\n\tconst onPartData = ui8a =&gt; {\n\t\tentryValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tconst appendToFile = ui8a =&gt; {\n\t\tentryChunks.push(ui8a);\n\t};\n\n\tconst appendFileToFormData = () =&gt; {\n\t\tconst file = new File(entryChunks, filename, {type: contentType});\n\t\tformData.append(entryName, file);\n\t};\n\n\tconst appendEntryToFormData = () =&gt; {\n\t\tformData.append(entryName, entryValue);\n\t};\n\n\tconst decoder = new TextDecoder(&#x27;utf-8&#x27;);\n\tdecoder.decode();\n\n\tparser.onPartBegin = function () {\n\t\tparser.onPartData = onPartData;\n\t\tparser.onPartEnd = appendEntryToFormData;\n\n\t\theaderField = &#x27;&#x27;;\n\t\theaderValue = &#x27;&#x27;;\n\t\tentryValue = &#x27;&#x27;;\n\t\tentryName = &#x27;&#x27;;\n\t\tcontentType = &#x27;&#x27;;\n\t\tfilename = null;\n\t\tentryChunks.length = 0;\n\t};\n\n\tparser.onHeaderField = function (ui8a) {\n\t\theaderField += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderValue = function (ui8a) {\n\t\theaderValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderEnd = function () {\n\t\theaderValue += decoder.decode();\n\t\theaderField = headerField.toLowerCase();\n\n\t\tif (headerField === &#x27;content-disposition&#x27;) {\n\t\t\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\t\t\tconst m = headerValue.match(/\\bname=(\&quot;([^\&quot;]*)\&quot;|([^()&lt;&gt;@,;:\\\\\&quot;/[\\]?={}\\s\\t]+))/i);\n\n\t\t\tif (m) {\n\t\t\t\tentryName = m[2] || m[3] || &#x27;&#x27;;\n\t\t\t}\n\n\t\t\tfilename = _fileName(headerValue);\n\n\t\t\tif (filename) {\n\t\t\t\tparser.onPartData = appendToFile;\n\t\t\t\tparser.onPartEnd = appendFileToFormData;\n\t\t\t}\n\t\t} else if (headerField === &#x27;content-type&#x27;) {\n\t\t\tcontentType = headerValue;\n\t\t}\n\n\t\theaderValue = &#x27;&#x27;;\n\t\theaderField = &#x27;&#x27;;\n\t};\n\n\tfor await (const chunk of Body) {\n\t\tparser.write(chunk);\n\t}\n\n\tparser.end();\n\n\treturn formData;\n}\n&quot;, &quot;\n/**\n * Body.js\n *\n * Body interface provides common methods for Request and Response\n */\n\nimport Stream, {PassThrough} from &#x27;node:stream&#x27;;\nimport {types, deprecate, promisify} from &#x27;node:util&#x27;;\nimport {Buffer} from &#x27;node:buffer&#x27;;\n\nimport Blob from &#x27;fetch-blob&#x27;;\nimport {FormData, formDataToBlob} from &#x27;formdata-polyfill/esm.min.js&#x27;;\n\nimport {FetchError} from &#x27;./errors/fetch-error.js&#x27;;\nimport {FetchBaseError} from &#x27;./errors/base.js&#x27;;\nimport {isBlob, isURLSearchParameters} from &#x27;./utils/is.js&#x27;;\n\nconst pipeline = promisify(Stream.pipeline);\nconst INTERNALS = Symbol(&#x27;Body internals&#x27;);\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Body {\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tlet boundary = null;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tbody = null;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t\t// Body is a URLSearchParams\n\t\t\tbody = Buffer.from(body.toString());\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t} else if (Buffer.isBuffer(body)) {\n\t\t\t// Body is Buffer\n\t\t} else if (types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tbody = Buffer.from(body);\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t\t} else if (body instanceof Stream) {\n\t\t\t// Body is stream\n\t\t} else if (body instanceof FormData) {\n\t\t\t// Body is FormData\n\t\t\tbody = formDataToBlob(body);\n\t\t\tboundary = body.type.split(&#x27;=&#x27;)[1];\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tbody = Buffer.from(String(body));\n\t\t}\n\n\t\tlet stream = body;\n\n\t\tif (Buffer.isBuffer(body)) {\n\t\t\tstream = Stream.Readable.from(body);\n\t\t} else if (isBlob(body)) {\n\t\t\tstream = Stream.Readable.from(body.stream());\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tbody,\n\t\t\tstream,\n\t\t\tboundary,\n\t\t\tdisturbed: false,\n\t\t\terror: null\n\t\t};\n\t\tthis.size = size;\n\n\t\tif (body instanceof Stream) {\n\t\t\tbody.on(&#x27;error&#x27;, error_ =&gt; {\n\t\t\t\tconst error = error_ instanceof FetchBaseError ?\n\t\t\t\t\terror_ :\n\t\t\t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, &#x27;system&#x27;, error_);\n\t\t\t\tthis[INTERNALS].error = error;\n\t\t\t});\n\t\t}\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS].stream;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return Promise\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\tasync formData() {\n\t\tconst ct = this.headers.get(&#x27;content-type&#x27;);\n\n\t\tif (ct.startsWith(&#x27;application/x-www-form-urlencoded&#x27;)) {\n\t\t\tconst formData = new FormData();\n\t\t\tconst parameters = new URLSearchParams(await this.text());\n\n\t\t\tfor (const [name, value] of parameters) {\n\t\t\t\tformData.append(name, value);\n\t\t\t}\n\n\t\t\treturn formData;\n\t\t}\n\n\t\tconst {toFormData} = await import(&#x27;./utils/multipart-parser.js&#x27;);\n\t\treturn toFormData(this.body, ct);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers &amp;&amp; this.headers.get(&#x27;content-type&#x27;)) || (this[INTERNALS].body &amp;&amp; this[INTERNALS].body.type) || &#x27;&#x27;;\n\t\tconst buf = await this.arrayBuffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\tconst text = await this.text();\n\t\treturn JSON.parse(text);\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn new TextDecoder().decode(buffer);\n\t}\n\n\t/**\n\t * Decode response as buffer (non-spec api)\n\t *\n\t * @return Promise\n\t */\n\tbuffer() {\n\t\treturn consumeBody(this);\n\t}\n}\n\nBody.prototype.buffer = deprecate(Body.prototype.buffer, &#x27;Please use \\&#x27;response.arrayBuffer()\\&#x27; instead of \\&#x27;response.buffer()\\&#x27;&#x27;, &#x27;node-fetch#buffer&#x27;);\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tdata: {get: deprecate(() =&gt; {},\n\t\t&#x27;data doesn\\&#x27;t exist, use json(), text(), arrayBuffer(), or body instead&#x27;,\n\t\t&#x27;https://github.com/node-fetch/node-fetch/issues/1000 (response)&#x27;)}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nasync function consumeBody(data) {\n\tif (data[INTERNALS].disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tdata[INTERNALS].disturbed = true;\n\n\tif (data[INTERNALS].error) {\n\t\tthrow data[INTERNALS].error;\n\t}\n\n\tconst {body} = data;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t/* c8 ignore next 3 */\n\tif (!(body instanceof Stream)) {\n\t\treturn Buffer.alloc(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\tconst accum = [];\n\tlet accumBytes = 0;\n\n\ttry {\n\t\tfor await (const chunk of body) {\n\t\t\tif (data.size &gt; 0 &amp;&amp; accumBytes + chunk.length &gt; data.size) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, &#x27;max-size&#x27;);\n\t\t\t\tbody.destroy(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t}\n\t} catch (error) {\n\t\tconst error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, &#x27;system&#x27;, error);\n\t\tthrow error_;\n\t}\n\n\tif (body.readableEnded === true || body._readableState.ended === true) {\n\t\ttry {\n\t\t\tif (accum.every(c =&gt; typeof c === &#x27;string&#x27;)) {\n\t\t\t\treturn Buffer.from(accum.join(&#x27;&#x27;));\n\t\t\t}\n\n\t\t\treturn Buffer.concat(accum, accumBytes);\n\t\t} catch (error) {\n\t\t\tthrow new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, &#x27;system&#x27;, error);\n\t\t}\n\t} else {\n\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`);\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @param String highWaterMark highWaterMark for both PassThrough body streams\n * @return Mixed\n */\nexport const clone = (instance, highWaterMark) =&gt; {\n\tlet p1;\n\tlet p2;\n\tlet {body} = instance[INTERNALS];\n\n\t// Don&#x27;t allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error(&#x27;cannot clone body after it is used&#x27;);\n\t}\n\n\t// Check that body is a stream and not form-data object\n\t// note: we can&#x27;t clone the form-data object without having it as a dependency\n\tif ((body instanceof Stream) &amp;&amp; (typeof body.getBoundary !== &#x27;function&#x27;)) {\n\t\t// Tee instance body\n\t\tp1 = new PassThrough({highWaterMark});\n\t\tp2 = new PassThrough({highWaterMark});\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// Set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].stream = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n};\n\nconst getNonSpecFormDataBoundary = deprecate(\n\tbody =&gt; body.getBoundary(),\n\t&#x27;form-data doesn\\&#x27;t follow the spec and requires special treatment. Use alternative package&#x27;,\n\t&#x27;https://github.com/node-fetch/node-fetch/issues/1167&#x27;\n);\n\n/**\n * Performs the operation \&quot;extract a `Content-Type` value from |object|\&quot; as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {any} body Any options.body input\n * @returns {string | null}\n */\nexport const extractContentType = (body, request) =&gt; {\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn null;\n\t}\n\n\t// Body is string\n\tif (typeof body === &#x27;string&#x27;) {\n\t\treturn &#x27;text/plain;charset=UTF-8&#x27;;\n\t}\n\n\t// Body is a URLSearchParams\n\tif (isURLSearchParameters(body)) {\n\t\treturn &#x27;application/x-www-form-urlencoded;charset=UTF-8&#x27;;\n\t}\n\n\t// Body is blob\n\tif (isBlob(body)) {\n\t\treturn body.type || null;\n\t}\n\n\t// Body is a Buffer (Buffer, ArrayBuffer or ArrayBufferView)\n\tif (Buffer.isBuffer(body) || types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {\n\t\treturn null;\n\t}\n\n\tif (body instanceof FormData) {\n\t\treturn `multipart/form-data; boundary=${request[INTERNALS].boundary}`;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body &amp;&amp; typeof body.getBoundary === &#x27;function&#x27;) {\n\t\treturn `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`;\n\t}\n\n\t// Body is stream - can&#x27;t really do much about this\n\tif (body instanceof Stream) {\n\t\treturn null;\n\t}\n\n\t// Body constructor defaults other things to string\n\treturn &#x27;text/plain;charset=UTF-8&#x27;;\n};\n\n/**\n * The Fetch Standard treats this as if \&quot;total bytes\&quot; is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {any} obj.body Body object from the Body instance.\n * @returns {number | null}\n */\nexport const getTotalBytes = request =&gt; {\n\tconst {body} = request[INTERNALS];\n\n\t// Body is null or undefined\n\tif (body === null) {\n\t\treturn 0;\n\t}\n\n\t// Body is Blob\n\tif (isBlob(body)) {\n\t\treturn body.size;\n\t}\n\n\t// Body is Buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn body.length;\n\t}\n\n\t// Detect form data input from form-data module\n\tif (body &amp;&amp; typeof body.getLengthSync === &#x27;function&#x27;) {\n\t\treturn body.hasKnownLength &amp;&amp; body.hasKnownLength() ? body.getLengthSync() : null;\n\t}\n\n\t// Body is stream\n\treturn null;\n};\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest The stream to write to.\n * @param obj.body Body object from the Body instance.\n * @returns {Promise&lt;void&gt;}\n */\nexport const writeToStream = async (dest, {body}) =&gt; {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\t// Body is stream\n\t\tawait pipeline(body, dest);\n\t}\n};\n&quot;, &quot;/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nimport {types} from &#x27;node:util&#x27;;\nimport http from &#x27;node:http&#x27;;\n\n/* c8 ignore next 9 */\nconst validateHeaderName = typeof http.validateHeaderName === &#x27;function&#x27; ?\n\thttp.validateHeaderName :\n\tname =&gt; {\n\t\tif (!/^[\\^`\\-\\w!#$%&amp;&#x27;*+.|~]+$/.test(name)) {\n\t\t\tconst error = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(error, &#x27;code&#x27;, {value: &#x27;ERR_INVALID_HTTP_TOKEN&#x27;});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/* c8 ignore next 9 */\nconst validateHeaderValue = typeof http.validateHeaderValue === &#x27;function&#x27; ?\n\thttp.validateHeaderValue :\n\t(name, value) =&gt; {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst error = new TypeError(`Invalid character in header content [\&quot;${name}\&quot;]`);\n\t\t\tObject.defineProperty(error, &#x27;code&#x27;, {value: &#x27;ERR_INVALID_CHAR&#x27;});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record&lt;string, string&gt; | Iterable&lt;readonly [string, string]&gt; | Iterable&lt;Iterable&lt;string&gt;&gt;} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n */\nexport default class Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value =&gt; [name, value]));\n\t\t\t}\n\t\t} else if (init == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\t\t// No op\n\t\t} else if (typeof init === &#x27;object&#x27; &amp;&amp; !types.isBoxedPrimitive(init)) {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\t\tif (method == null) {\n\t\t\t\t// Record&lt;ByteString, ByteString&gt;\n\t\t\t\tresult.push(...Object.entries(init));\n\t\t\t} else {\n\t\t\t\tif (typeof method !== &#x27;function&#x27;) {\n\t\t\t\t\tthrow new TypeError(&#x27;Header pairs must be iterable&#x27;);\n\t\t\t\t}\n\n\t\t\t\t// Sequence&lt;sequence&lt;ByteString&gt;&gt;\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tresult = [...init]\n\t\t\t\t\t.map(pair =&gt; {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof pair !== &#x27;object&#x27; || types.isBoxedPrimitive(pair)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new TypeError(&#x27;Each header pair must be an iterable object&#x27;);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t}).map(pair =&gt; {\n\t\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\t\tthrow new TypeError(&#x27;Each header pair must be a name/value tuple&#x27;);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError(&#x27;Failed to construct \\&#x27;Headers\\&#x27;: The provided value is not of type \\&#x27;(sequence&lt;sequence&lt;ByteString&gt;&gt; or record&lt;ByteString, ByteString&gt;)&#x27;);\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length &gt; 0 ?\n\t\t\t\tresult.map(([name, value]) =&gt; {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\tundefined;\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase &#x27;append&#x27;:\n\t\t\t\t\tcase &#x27;set&#x27;:\n\t\t\t\t\t\treturn (name, value) =&gt; {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase &#x27;delete&#x27;:\n\t\t\t\t\tcase &#x27;has&#x27;:\n\t\t\t\t\tcase &#x27;getAll&#x27;:\n\t\t\t\t\t\treturn name =&gt; {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase &#x27;keys&#x27;:\n\t\t\t\t\t\treturn () =&gt; {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t/* c8 ignore next */\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(&#x27;, &#x27;);\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield this.get(name);\n\t\t}\n\t}\n\n\t/**\n\t * @type {() =&gt; IterableIterator&lt;[string, string]&gt;}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, this.get(name)];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record&lt;string, string[]&gt;}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) =&gt; {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for(&#x27;nodejs.util.inspect.custom&#x27;)]() {\n\t\treturn [...this.keys()].reduce((result, key) =&gt; {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === &#x27;host&#x27;) {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length &gt; 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, {});\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t[&#x27;get&#x27;, &#x27;entries&#x27;, &#x27;forEach&#x27;, &#x27;values&#x27;].reduce((result, property) =&gt; {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, {})\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import(&#x27;http&#x27;).IncomingMessage[&#x27;rawHeaders&#x27;]} headers\n */\nexport function fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) =&gt; {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t\t.filter(([name, value]) =&gt; {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n&quot;, &quot;const redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nexport const isRedirect = code =&gt; {\n\treturn redirectStatus.has(code);\n};\n&quot;, &quot;/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nimport Headers from &#x27;./headers.js&#x27;;\nimport Body, {clone, extractContentType} from &#x27;./body.js&#x27;;\nimport {isRedirect} from &#x27;./utils/is-redirect.js&#x27;;\n\nconst INTERNALS = Symbol(&#x27;Response internals&#x27;);\n\n/**\n * Response class\n *\n * Ref: https://fetch.spec.whatwg.org/#response-class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nexport default class Response extends Body {\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq, no-negated-condition\n\t\tconst status = options.status != null ? options.status : 200;\n\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null &amp;&amp; !headers.has(&#x27;Content-Type&#x27;)) {\n\t\t\tconst contentType = extractContentType(body, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append(&#x27;Content-Type&#x27;, contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\ttype: &#x27;default&#x27;,\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || &#x27;&#x27;,\n\t\t\theaders,\n\t\t\tcounter: options.counter,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\tget type() {\n\t\treturn this[INTERNALS].type;\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS].url || &#x27;&#x27;;\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS].status &gt;= 200 &amp;&amp; this[INTERNALS].status &lt; 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS].counter &gt; 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @return Response\n\t */\n\tclone() {\n\t\treturn new Response(clone(this, this.highWaterMark), {\n\t\t\ttype: this.type,\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected,\n\t\t\tsize: this.size,\n\t\t\thighWaterMark: this.highWaterMark\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError(&#x27;Failed to execute \&quot;redirect\&quot; on \&quot;response\&quot;: Invalid status code&#x27;);\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tstatic error() {\n\t\tconst response = new Response(null, {status: 0, statusText: &#x27;&#x27;});\n\t\tresponse[INTERNALS].type = &#x27;error&#x27;;\n\t\treturn response;\n\t}\n\n\tstatic json(data = undefined, init = {}) {\n\t\tconst body = JSON.stringify(data);\n\n\t\tif (body === undefined) {\n\t\t\tthrow new TypeError(&#x27;data is not JSON serializable&#x27;);\n\t\t}\n\n\t\tconst headers = new Headers(init &amp;&amp; init.headers);\n\n\t\tif (!headers.has(&#x27;content-type&#x27;)) {\n\t\t\theaders.set(&#x27;content-type&#x27;, &#x27;application/json&#x27;);\n\t\t}\n\n\t\treturn new Response(body, {\n\t\t\t...init,\n\t\t\theaders\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn &#x27;Response&#x27;;\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\ttype: {enumerable: true},\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n&quot;, &quot;export const getSearch = parsedURL =&gt; {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === &#x27;#&#x27; ? &#x27;#&#x27; : &#x27;&#x27;);\n\treturn parsedURL.href[lastOffset - hash.length] === &#x27;?&#x27; ? &#x27;?&#x27; : &#x27;&#x27;;\n};\n&quot;, &quot;import {isIP} from &#x27;node:net&#x27;;\n\n/**\n * @external URL\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL}\n */\n\n/**\n * @module utils/referrer\n * @private\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy \u00A78.4. Strip url for use as a referrer}\n * @param {string} URL\n * @param {boolean} [originOnly=false]\n */\nexport function stripURLForUseAsAReferrer(url, originOnly = false) {\n\t// 1. If url is null, return no referrer.\n\tif (url == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\treturn &#x27;no-referrer&#x27;;\n\t}\n\n\turl = new URL(url);\n\n\t// 2. If url&#x27;s scheme is a local scheme, then return no referrer.\n\tif (/^(about|blob|data):$/.test(url.protocol)) {\n\t\treturn &#x27;no-referrer&#x27;;\n\t}\n\n\t// 3. Set url&#x27;s username to the empty string.\n\turl.username = &#x27;&#x27;;\n\n\t// 4. Set url&#x27;s password to null.\n\t// Note: `null` appears to be a mistake as this actually results in the password being `\&quot;null\&quot;`.\n\turl.password = &#x27;&#x27;;\n\n\t// 5. Set url&#x27;s fragment to null.\n\t// Note: `null` appears to be a mistake as this actually results in the fragment being `\&quot;#null\&quot;`.\n\turl.hash = &#x27;&#x27;;\n\n\t// 6. If the origin-only flag is true, then:\n\tif (originOnly) {\n\t\t// 6.1. Set url&#x27;s path to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the path being `\&quot;/null\&quot;`.\n\t\turl.pathname = &#x27;&#x27;;\n\n\t\t// 6.2. Set url&#x27;s query to null.\n\t\t// Note: `null` appears to be a mistake as this actually results in the query being `\&quot;?null\&quot;`.\n\t\turl.search = &#x27;&#x27;;\n\t}\n\n\t// 7. Return url.\n\treturn url;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy|enum ReferrerPolicy}\n */\nexport const ReferrerPolicy = new Set([\n\t&#x27;&#x27;,\n\t&#x27;no-referrer&#x27;,\n\t&#x27;no-referrer-when-downgrade&#x27;,\n\t&#x27;same-origin&#x27;,\n\t&#x27;origin&#x27;,\n\t&#x27;strict-origin&#x27;,\n\t&#x27;origin-when-cross-origin&#x27;,\n\t&#x27;strict-origin-when-cross-origin&#x27;,\n\t&#x27;unsafe-url&#x27;\n]);\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#default-referrer-policy|default referrer policy}\n */\nexport const DEFAULT_REFERRER_POLICY = &#x27;strict-origin-when-cross-origin&#x27;;\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#referrer-policies|Referrer Policy \u00A73. Referrer Policies}\n * @param {string} referrerPolicy\n * @returns {string} referrerPolicy\n */\nexport function validateReferrerPolicy(referrerPolicy) {\n\tif (!ReferrerPolicy.has(referrerPolicy)) {\n\t\tthrow new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);\n\t}\n\n\treturn referrerPolicy;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy|Referrer Policy \u00A73.2. Is origin potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \&quot;Potentially Trustworthy\&quot;, `false`: \&quot;Not Trustworthy\&quot;\n */\nexport function isOriginPotentiallyTrustworthy(url) {\n\t// 1. If origin is an opaque origin, return \&quot;Not Trustworthy\&quot;.\n\t// Not applicable\n\n\t// 2. Assert: origin is a tuple origin.\n\t// Not for implementations\n\n\t// 3. If origin&#x27;s scheme is either \&quot;https\&quot; or \&quot;wss\&quot;, return \&quot;Potentially Trustworthy\&quot;.\n\tif (/^(http|ws)s:$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 4. If origin&#x27;s host component matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return \&quot;Potentially Trustworthy\&quot;.\n\tconst hostIp = url.host.replace(/(^\\[)|(]$)/g, &#x27;&#x27;);\n\tconst hostIPVersion = isIP(hostIp);\n\n\tif (hostIPVersion === 4 &amp;&amp; /^127\\./.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\tif (hostIPVersion === 6 &amp;&amp; /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) {\n\t\treturn true;\n\t}\n\n\t// 5. If origin&#x27;s host component is \&quot;localhost\&quot; or falls within \&quot;.localhost\&quot;, and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return \&quot;Potentially Trustworthy\&quot;.\n\t// We are returning FALSE here because we cannot ensure conformance to\n\t// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)\n\tif (url.host === &#x27;localhost&#x27; || url.host.endsWith(&#x27;.localhost&#x27;)) {\n\t\treturn false;\n\t}\n\n\t// 6. If origin&#x27;s scheme component is file, return \&quot;Potentially Trustworthy\&quot;.\n\tif (url.protocol === &#x27;file:&#x27;) {\n\t\treturn true;\n\t}\n\n\t// 7. If origin&#x27;s scheme component is one which the user agent considers to be authenticated, return \&quot;Potentially Trustworthy\&quot;.\n\t// Not supported\n\n\t// 8. If origin has been configured as a trustworthy origin, return \&quot;Potentially Trustworthy\&quot;.\n\t// Not supported\n\n\t// 9. Return \&quot;Not Trustworthy\&quot;.\n\treturn false;\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy|Referrer Policy \u00A73.3. Is url potentially trustworthy?}\n * @param {external:URL} url\n * @returns `true`: \&quot;Potentially Trustworthy\&quot;, `false`: \&quot;Not Trustworthy\&quot;\n */\nexport function isUrlPotentiallyTrustworthy(url) {\n\t// 1. If url is \&quot;about:blank\&quot; or \&quot;about:srcdoc\&quot;, return \&quot;Potentially Trustworthy\&quot;.\n\tif (/^about:(blank|srcdoc)$/.test(url)) {\n\t\treturn true;\n\t}\n\n\t// 2. If url&#x27;s scheme is \&quot;data\&quot;, return \&quot;Potentially Trustworthy\&quot;.\n\tif (url.protocol === &#x27;data:&#x27;) {\n\t\treturn true;\n\t}\n\n\t// Note: The origin of blob: and filesystem: URLs is the origin of the context in which they were\n\t// created. Therefore, blobs created in a trustworthy origin will themselves be potentially\n\t// trustworthy.\n\tif (/^(blob|filesystem):$/.test(url.protocol)) {\n\t\treturn true;\n\t}\n\n\t// 3. Return the result of executing \u00A73.2 Is origin potentially trustworthy? on url&#x27;s origin.\n\treturn isOriginPotentiallyTrustworthy(url);\n}\n\n/**\n * Modifies the referrerURL to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request&#x27;s Referrer}, step 7\n * @callback module:utils/referrer~referrerURLCallback\n * @param {external:URL} referrerURL\n * @returns {external:URL} modified referrerURL\n */\n\n/**\n * Modifies the referrerOrigin to enforce any extra security policy considerations.\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request&#x27;s Referrer}, step 7\n * @callback module:utils/referrer~referrerOriginCallback\n * @param {external:URL} referrerOrigin\n * @returns {external:URL} modified referrerOrigin\n */\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy \u00A78.3. Determine request&#x27;s Referrer}\n * @param {Request} request\n * @param {object} o\n * @param {module:utils/referrer~referrerURLCallback} o.referrerURLCallback\n * @param {module:utils/referrer~referrerOriginCallback} o.referrerOriginCallback\n * @returns {external:URL} Request&#x27;s referrer\n */\nexport function determineRequestsReferrer(request, {referrerURLCallback, referrerOriginCallback} = {}) {\n\t// There are 2 notes in the specification about invalid pre-conditions. We return null, here, for\n\t// these cases:\n\t// &gt; Note: If request&#x27;s referrer is \&quot;no-referrer\&quot;, Fetch will not call into this algorithm.\n\t// &gt; Note: If request&#x27;s referrer policy is the empty string, Fetch will not call into this\n\t// &gt; algorithm.\n\tif (request.referrer === &#x27;no-referrer&#x27; || request.referrerPolicy === &#x27;&#x27;) {\n\t\treturn null;\n\t}\n\n\t// 1. Let policy be request&#x27;s associated referrer policy.\n\tconst policy = request.referrerPolicy;\n\n\t// 2. Let environment be request&#x27;s client.\n\t// not applicable to node.js\n\n\t// 3. Switch on request&#x27;s referrer:\n\tif (request.referrer === &#x27;about:client&#x27;) {\n\t\treturn &#x27;no-referrer&#x27;;\n\t}\n\n\t// \&quot;a URL\&quot;: Let referrerSource be request&#x27;s referrer.\n\tconst referrerSource = request.referrer;\n\n\t// 4. Let request&#x27;s referrerURL be the result of stripping referrerSource for use as a referrer.\n\tlet referrerURL = stripURLForUseAsAReferrer(referrerSource);\n\n\t// 5. Let referrerOrigin be the result of stripping referrerSource for use as a referrer, with the\n\t// origin-only flag set to true.\n\tlet referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true);\n\n\t// 6. If the result of serializing referrerURL is a string whose length is greater than 4096, set\n\t// referrerURL to referrerOrigin.\n\tif (referrerURL.toString().length &gt; 4096) {\n\t\treferrerURL = referrerOrigin;\n\t}\n\n\t// 7. The user agent MAY alter referrerURL or referrerOrigin at this point to enforce arbitrary\n\t// policy considerations in the interests of minimizing data leakage. For example, the user\n\t// agent could strip the URL down to an origin, modify its host, replace it with an empty\n\t// string, etc.\n\tif (referrerURLCallback) {\n\t\treferrerURL = referrerURLCallback(referrerURL);\n\t}\n\n\tif (referrerOriginCallback) {\n\t\treferrerOrigin = referrerOriginCallback(referrerOrigin);\n\t}\n\n\t// 8.Execute the statements corresponding to the value of policy:\n\tconst currentURL = new URL(request.url);\n\n\tswitch (policy) {\n\t\tcase &#x27;no-referrer&#x27;:\n\t\t\treturn &#x27;no-referrer&#x27;;\n\n\t\tcase &#x27;origin&#x27;:\n\t\t\treturn referrerOrigin;\n\n\t\tcase &#x27;unsafe-url&#x27;:\n\t\t\treturn referrerURL;\n\n\t\tcase &#x27;strict-origin&#x27;:\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request&#x27;s current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn &#x27;no-referrer&#x27;;\n\t\t\t}\n\n\t\t\t// 2. Return referrerOrigin.\n\t\t\treturn referrerOrigin.toString();\n\n\t\tcase &#x27;strict-origin-when-cross-origin&#x27;:\n\t\t\t// 1. If the origin of referrerURL and the origin of request&#x27;s current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. If referrerURL is a potentially trustworthy URL and request&#x27;s current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn &#x27;no-referrer&#x27;;\n\t\t\t}\n\n\t\t\t// 3. Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase &#x27;same-origin&#x27;:\n\t\t\t// 1. If the origin of referrerURL and the origin of request&#x27;s current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// 2. Return no referrer.\n\t\t\treturn &#x27;no-referrer&#x27;;\n\n\t\tcase &#x27;origin-when-cross-origin&#x27;:\n\t\t\t// 1. If the origin of referrerURL and the origin of request&#x27;s current URL are the same, then\n\t\t\t// return referrerURL.\n\t\t\tif (referrerURL.origin === currentURL.origin) {\n\t\t\t\treturn referrerURL;\n\t\t\t}\n\n\t\t\t// Return referrerOrigin.\n\t\t\treturn referrerOrigin;\n\n\t\tcase &#x27;no-referrer-when-downgrade&#x27;:\n\t\t\t// 1. If referrerURL is a potentially trustworthy URL and request&#x27;s current URL is not a\n\t\t\t// potentially trustworthy URL, then return no referrer.\n\t\t\tif (isUrlPotentiallyTrustworthy(referrerURL) &amp;&amp; !isUrlPotentiallyTrustworthy(currentURL)) {\n\t\t\t\treturn &#x27;no-referrer&#x27;;\n\t\t\t}\n\n\t\t\t// 2. Return referrerURL.\n\t\t\treturn referrerURL;\n\n\t\tdefault:\n\t\t\tthrow new TypeError(`Invalid referrerPolicy: ${policy}`);\n\t}\n}\n\n/**\n * @see {@link https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header|Referrer Policy \u00A78.1. Parse a referrer policy from a Referrer-Policy header}\n * @param {Headers} headers Response headers\n * @returns {string} policy\n */\nexport function parseReferrerPolicyFromHeader(headers) {\n\t// 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy`\n\t// and response\u2019s header list.\n\tconst policyTokens = (headers.get(&#x27;referrer-policy&#x27;) || &#x27;&#x27;).split(/[,\\s]+/);\n\n\t// 2. Let policy be the empty string.\n\tlet policy = &#x27;&#x27;;\n\n\t// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty\n\t// string, then set policy to token.\n\t// Note: This algorithm loops over multiple policy values to allow deployment of new policy\n\t// values with fallbacks for older user agents, as described in \u00A7 11.1 Unknown Policy Values.\n\tfor (const token of policyTokens) {\n\t\tif (token &amp;&amp; ReferrerPolicy.has(token)) {\n\t\t\tpolicy = token;\n\t\t}\n\t}\n\n\t// 4. Return policy.\n\treturn policy;\n}\n&quot;, &quot;/**\n * Request.js\n *\n * Request class contains server only options\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport {format as formatUrl} from &#x27;node:url&#x27;;\nimport {deprecate} from &#x27;node:util&#x27;;\nimport Headers from &#x27;./headers.js&#x27;;\nimport Body, {clone, extractContentType, getTotalBytes} from &#x27;./body.js&#x27;;\nimport {isAbortSignal} from &#x27;./utils/is.js&#x27;;\nimport {getSearch} from &#x27;./utils/get-search.js&#x27;;\nimport {\n\tvalidateReferrerPolicy, determineRequestsReferrer, DEFAULT_REFERRER_POLICY\n} from &#x27;./utils/referrer.js&#x27;;\n\nconst INTERNALS = Symbol(&#x27;Request internals&#x27;);\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {*} object\n * @return {boolean}\n */\nconst isRequest = object =&gt; {\n\treturn (\n\t\ttypeof object === &#x27;object&#x27; &amp;&amp;\n\t\ttypeof object[INTERNALS] === &#x27;object&#x27;\n\t);\n};\n\nconst doBadDataWarn = deprecate(() =&gt; {},\n\t&#x27;.data is not a valid RequestInit property, use .body instead&#x27;,\n\t&#x27;https://github.com/node-fetch/node-fetch/issues/1000 (request)&#x27;);\n\n/**\n * Request class\n *\n * Ref: https://fetch.spec.whatwg.org/#request-class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nexport default class Request extends Body {\n\tconstructor(input, init = {}) {\n\t\tlet parsedURL;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(input)) {\n\t\t\tparsedURL = new URL(input.url);\n\t\t} else {\n\t\t\tparsedURL = new URL(input);\n\t\t\tinput = {};\n\t\t}\n\n\t\tif (parsedURL.username !== &#x27;&#x27; || parsedURL.password !== &#x27;&#x27;) {\n\t\t\tthrow new TypeError(`${parsedURL} is an url with embedded credentials.`);\n\t\t}\n\n\t\tlet method = init.method || input.method || &#x27;GET&#x27;;\n\t\tif (/^(delete|get|head|options|post|put)$/i.test(method)) {\n\t\t\tmethod = method.toUpperCase();\n\t\t}\n\n\t\tif (!isRequest(init) &amp;&amp; &#x27;data&#x27; in init) {\n\t\t\tdoBadDataWarn();\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif ((init.body != null || (isRequest(input) &amp;&amp; input.body !== null)) &amp;&amp;\n\t\t\t(method === &#x27;GET&#x27; || method === &#x27;HEAD&#x27;)) {\n\t\t\tthrow new TypeError(&#x27;Request with GET/HEAD method cannot have body&#x27;);\n\t\t}\n\n\t\tconst inputBody = init.body ?\n\t\t\tinit.body :\n\t\t\t(isRequest(input) &amp;&amp; input.body !== null ?\n\t\t\t\tclone(input) :\n\t\t\t\tnull);\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody !== null &amp;&amp; !headers.has(&#x27;Content-Type&#x27;)) {\n\t\t\tconst contentType = extractContentType(inputBody, this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.set(&#x27;Content-Type&#x27;, contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ?\n\t\t\tinput.signal :\n\t\t\tnull;\n\t\tif (&#x27;signal&#x27; in init) {\n\t\t\tsignal = init.signal;\n\t\t}\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null &amp;&amp; !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError(&#x27;Expected signal to be an instanceof AbortSignal or EventTarget&#x27;);\n\t\t}\n\n\t\t// \u00A75.4, Request constructor steps, step 15.1\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tlet referrer = init.referrer == null ? input.referrer : init.referrer;\n\t\tif (referrer === &#x27;&#x27;) {\n\t\t\t// \u00A75.4, Request constructor steps, step 15.2\n\t\t\treferrer = &#x27;no-referrer&#x27;;\n\t\t} else if (referrer) {\n\t\t\t// \u00A75.4, Request constructor steps, step 15.3.1, 15.3.2\n\t\t\tconst parsedReferrer = new URL(referrer);\n\t\t\t// \u00A75.4, Request constructor steps, step 15.3.3, 15.3.4\n\t\t\treferrer = /^about:(\\/\\/)?client$/.test(parsedReferrer) ? &#x27;client&#x27; : parsedReferrer;\n\t\t} else {\n\t\t\treferrer = undefined;\n\t\t}\n\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || &#x27;follow&#x27;,\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal,\n\t\t\treferrer\n\t\t};\n\n\t\t// Node-fetch-only options\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\n\t\t// \u00A75.4, Request constructor steps, step 16.\n\t\t// Default is empty string per https://fetch.spec.whatwg.org/#concept-request-referrer-policy\n\t\tthis.referrerPolicy = init.referrerPolicy || input.referrerPolicy || &#x27;&#x27;;\n\t}\n\n\t/** @returns {string} */\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/** @returns {string} */\n\tget url() {\n\t\treturn formatUrl(this[INTERNALS].parsedURL);\n\t}\n\n\t/** @returns {Headers} */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/** @returns {AbortSignal} */\n\tget signal() {\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t// https://fetch.spec.whatwg.org/#dom-request-referrer\n\tget referrer() {\n\t\tif (this[INTERNALS].referrer === &#x27;no-referrer&#x27;) {\n\t\t\treturn &#x27;&#x27;;\n\t\t}\n\n\t\tif (this[INTERNALS].referrer === &#x27;client&#x27;) {\n\t\t\treturn &#x27;about:client&#x27;;\n\t\t}\n\n\t\tif (this[INTERNALS].referrer) {\n\t\t\treturn this[INTERNALS].referrer.toString();\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget referrerPolicy() {\n\t\treturn this[INTERNALS].referrerPolicy;\n\t}\n\n\tset referrerPolicy(referrerPolicy) {\n\t\tthis[INTERNALS].referrerPolicy = validateReferrerPolicy(referrerPolicy);\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return Request\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn &#x27;Request&#x27;;\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true},\n\treferrer: {enumerable: true},\n\treferrerPolicy: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param {Request} request - A Request instance\n * @return The options object to be passed to http.request\n */\nexport const getNodeRequestOptions = request =&gt; {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has(&#x27;Accept&#x27;)) {\n\t\theaders.set(&#x27;Accept&#x27;, &#x27;*/*&#x27;);\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null &amp;&amp; /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = &#x27;0&#x27;;\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === &#x27;number&#x27; &amp;&amp; !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set(&#x27;Content-Length&#x27;, contentLengthValue);\n\t}\n\n\t// 4.1. Main fetch, step 2.6\n\t// &gt; If request&#x27;s referrer policy is the empty string, then set request&#x27;s referrer policy to the\n\t// &gt; default referrer policy.\n\tif (request.referrerPolicy === &#x27;&#x27;) {\n\t\trequest.referrerPolicy = DEFAULT_REFERRER_POLICY;\n\t}\n\n\t// 4.1. Main fetch, step 2.7\n\t// &gt; If request&#x27;s referrer is not \&quot;no-referrer\&quot;, set request&#x27;s referrer to the result of invoking\n\t// &gt; determine request&#x27;s referrer.\n\tif (request.referrer &amp;&amp; request.referrer !== &#x27;no-referrer&#x27;) {\n\t\trequest[INTERNALS].referrer = determineRequestsReferrer(request);\n\t} else {\n\t\trequest[INTERNALS].referrer = &#x27;no-referrer&#x27;;\n\t}\n\n\t// 4.5. HTTP-network-or-cache fetch, step 6.9\n\t// &gt; If httpRequest&#x27;s referrer is a URL, then append `Referer`/httpRequest&#x27;s referrer, serialized\n\t// &gt; and isomorphic encoded, to httpRequest&#x27;s header list.\n\tif (request[INTERNALS].referrer instanceof URL) {\n\t\theaders.set(&#x27;Referer&#x27;, request.referrer);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has(&#x27;User-Agent&#x27;)) {\n\t\theaders.set(&#x27;User-Agent&#x27;, &#x27;node-fetch&#x27;);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress &amp;&amp; !headers.has(&#x27;Accept-Encoding&#x27;)) {\n\t\theaders.set(&#x27;Accept-Encoding&#x27;, &#x27;gzip, deflate, br&#x27;);\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === &#x27;function&#x27;) {\n\t\tagent = agent(parsedURL);\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Pass the full URL directly to request(), but overwrite the following\n\t// options:\n\tconst options = {\n\t\t// Overwrite search to retain trailing ? (issue #776)\n\t\tpath: parsedURL.pathname + search,\n\t\t// The following options are not expressed in the URL\n\t\tmethod: request.method,\n\t\theaders: headers[Symbol.for(&#x27;nodejs.util.inspect.custom&#x27;)](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn {\n\t\t/** @type {URL} */\n\t\tparsedURL,\n\t\toptions\n\t};\n};\n&quot;, &quot;import {FetchBaseError} from &#x27;./base.js&#x27;;\n\n/**\n * AbortError interface for cancelled requests\n */\nexport class AbortError extends FetchBaseError {\n\tconstructor(message, type = &#x27;aborted&#x27;) {\n\t\tsuper(message, type);\n\t}\n}\n&quot;, &quot;/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport http from &#x27;node:http&#x27;;\nimport https from &#x27;node:https&#x27;;\nimport zlib from &#x27;node:zlib&#x27;;\nimport Stream, {PassThrough, pipeline as pump} from &#x27;node:stream&#x27;;\nimport {Buffer} from &#x27;node:buffer&#x27;;\n\nimport dataUriToBuffer from &#x27;data-uri-to-buffer&#x27;;\n\nimport {writeToStream, clone} from &#x27;./body.js&#x27;;\nimport Response from &#x27;./response.js&#x27;;\nimport Headers, {fromRawHeaders} from &#x27;./headers.js&#x27;;\nimport Request, {getNodeRequestOptions} from &#x27;./request.js&#x27;;\nimport {FetchError} from &#x27;./errors/fetch-error.js&#x27;;\nimport {AbortError} from &#x27;./errors/abort-error.js&#x27;;\nimport {isRedirect} from &#x27;./utils/is-redirect.js&#x27;;\nimport {FormData} from &#x27;formdata-polyfill/esm.min.js&#x27;;\nimport {isDomainOrSubdomain, isSameProtocol} from &#x27;./utils/is.js&#x27;;\nimport {parseReferrerPolicyFromHeader} from &#x27;./utils/referrer.js&#x27;;\nimport {\n\tBlob,\n\tFile,\n\tfileFromSync,\n\tfileFrom,\n\tblobFromSync,\n\tblobFrom\n} from &#x27;fetch-blob/from.js&#x27;;\n\nexport {FormData, Headers, Request, Response, FetchError, AbortError, isRedirect};\nexport {Blob, File, fileFromSync, fileFrom, blobFromSync, blobFrom};\n\nconst supportedSchemas = new Set([&#x27;data:&#x27;, &#x27;http:&#x27;, &#x27;https:&#x27;]);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import(&#x27;./request&#x27;).default} url - Absolute url or Request instance\n * @param {*} [options_] - Fetch options\n * @return {Promise&lt;import(&#x27;./response&#x27;).default&gt;}\n */\nexport default async function fetch(url, options_) {\n\treturn new Promise((resolve, reject) =&gt; {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst {parsedURL, options} = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(parsedURL.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \&quot;${parsedURL.protocol.replace(/:$/, &#x27;&#x27;)}\&quot; is not supported.`);\n\t\t}\n\n\t\tif (parsedURL.protocol === &#x27;data:&#x27;) {\n\t\t\tconst data = dataUriToBuffer(request.url);\n\t\t\tconst response = new Response(data, {headers: {&#x27;Content-Type&#x27;: data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (parsedURL.protocol === &#x27;https:&#x27; ? https : http).request;\n\t\tconst {signal} = request;\n\t\tlet response = null;\n\n\t\tconst abort = () =&gt; {\n\t\t\tconst error = new AbortError(&#x27;The operation was aborted.&#x27;);\n\t\t\treject(error);\n\t\t\tif (request.body &amp;&amp; request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\n\t\t\tif (!response || !response.body) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.body.emit(&#x27;error&#x27;, error);\n\t\t};\n\n\t\tif (signal &amp;&amp; signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () =&gt; {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(parsedURL.toString(), options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener(&#x27;abort&#x27;, abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () =&gt; {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener(&#x27;abort&#x27;, abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on(&#x27;error&#x27;, error =&gt; {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, &#x27;system&#x27;, error));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, error =&gt; {\n\t\t\tif (response &amp;&amp; response.body) {\n\t\t\t\tresponse.body.destroy(error);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (process.version &lt; &#x27;v14&#x27;) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on(&#x27;socket&#x27;, s =&gt; {\n\t\t\t\tlet endedWithEventsCount;\n\t\t\t\ts.prependListener(&#x27;end&#x27;, () =&gt; {\n\t\t\t\t\tendedWithEventsCount = s._eventsCount;\n\t\t\t\t});\n\t\t\t\ts.prependListener(&#x27;close&#x27;, hadError =&gt; {\n\t\t\t\t\t// if end happened before close but the socket didn&#x27;t emit an error, do it now\n\t\t\t\t\tif (response &amp;&amp; endedWithEventsCount &lt; s._eventsCount &amp;&amp; !hadError) {\n\t\t\t\t\t\tconst error = new Error(&#x27;Premature close&#x27;);\n\t\t\t\t\t\terror.code = &#x27;ERR_STREAM_PREMATURE_CLOSE&#x27;;\n\t\t\t\t\t\tresponse.body.emit(&#x27;error&#x27;, error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on(&#x27;response&#x27;, response_ =&gt; {\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(response_.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get(&#x27;Location&#x27;);\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL(location, request.url);\n\t\t\t\t} catch {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== &#x27;manual&#x27;) {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, &#x27;invalid-redirect&#x27;));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase &#x27;error&#x27;:\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, &#x27;no-redirect&#x27;));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase &#x27;manual&#x27;:\n\t\t\t\t\t\t// Nothing to do\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase &#x27;follow&#x27;: {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter &gt;= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, &#x27;max-redirect&#x27;));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: clone(request),\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size,\n\t\t\t\t\t\t\treferrer: request.referrer,\n\t\t\t\t\t\t\treferrerPolicy: request.referrerPolicy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// when forwarding sensitive headers like \&quot;Authorization\&quot;,\n\t\t\t\t\t\t// \&quot;WWW-Authenticate\&quot;, and \&quot;Cookie\&quot; to untrusted targets,\n\t\t\t\t\t\t// headers will be ignored when following a redirect to a domain\n\t\t\t\t\t\t// that is not a subdomain match or exact match of the initial domain.\n\t\t\t\t\t\t// For example, a redirect from \&quot;foo.com\&quot; to either \&quot;foo.com\&quot; or \&quot;sub.foo.com\&quot;\n\t\t\t\t\t\t// will forward the sensitive headers, but a redirect to \&quot;bar.com\&quot; will not.\n\t\t\t\t\t\t// headers will also be ignored when following a redirect to a domain using\n\t\t\t\t\t\t// a different protocol. For example, a redirect from \&quot;https://foo.com\&quot; to \&quot;http://foo.com\&quot;\n\t\t\t\t\t\t// will not forward the sensitive headers\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of [&#x27;authorization&#x27;, &#x27;www-authenticate&#x27;, &#x27;cookie&#x27;, &#x27;cookie2&#x27;]) {\n\t\t\t\t\t\t\t\trequestOptions.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (response_.statusCode !== 303 &amp;&amp; request.body &amp;&amp; options_.body instanceof Stream.Readable) {\n\t\t\t\t\t\t\treject(new FetchError(&#x27;Cannot follow redirect with body being a readable stream&#x27;, &#x27;unsupported-redirect&#x27;));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) &amp;&amp; request.method === &#x27;POST&#x27;)) {\n\t\t\t\t\t\t\trequestOptions.method = &#x27;GET&#x27;;\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete(&#x27;content-length&#x27;);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 14\n\t\t\t\t\t\tconst responseReferrerPolicy = parseReferrerPolicyFromHeader(headers);\n\t\t\t\t\t\tif (responseReferrerPolicy) {\n\t\t\t\t\t\t\trequestOptions.referrerPolicy = responseReferrerPolicy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOptions)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option &#x27;${request.redirect}&#x27; is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once(&#x27;end&#x27;, () =&gt; {\n\t\t\t\t\tsignal.removeEventListener(&#x27;abort&#x27;, abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = pump(response_, new PassThrough(), error =&gt; {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version &lt; &#x27;v12.10&#x27;) {\n\t\t\t\tresponse_.on(&#x27;aborted&#x27;, abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get(&#x27;Content-Encoding&#x27;);\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === &#x27;HEAD&#x27; || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === &#x27;gzip&#x27; || codings === &#x27;x-gzip&#x27;) {\n\t\t\t\tbody = pump(body, zlib.createGunzip(zlibOptions), error =&gt; {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === &#x27;deflate&#x27; || codings === &#x27;x-deflate&#x27;) {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = pump(response_, new PassThrough(), error =&gt; {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\traw.once(&#x27;data&#x27;, chunk =&gt; {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] &amp; 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflate(), error =&gt; {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflateRaw(), error =&gt; {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.once(&#x27;end&#x27;, () =&gt; {\n\t\t\t\t\t// Some old IIS servers return zero-length OK deflate responses, so\n\t\t\t\t\t// &#x27;data&#x27; is never emitted. See https://github.com/node-fetch/node-fetch/pull/903\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === &#x27;br&#x27;) {\n\t\t\t\tbody = pump(body, zlib.createBrotliDecompress(), error =&gt; {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(body, responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\twriteToStream(request_, request).catch(reject);\n\t});\n}\n\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tconst LAST_CHUNK = Buffer.from(&#x27;0\\r\\n\\r\\n&#x27;);\n\n\tlet isChunkedTransfer = false;\n\tlet properLastChunkReceived = false;\n\tlet previousChunk;\n\n\trequest.on(&#x27;response&#x27;, response =&gt; {\n\t\tconst {headers} = response;\n\t\tisChunkedTransfer = headers[&#x27;transfer-encoding&#x27;] === &#x27;chunked&#x27; &amp;&amp; !headers[&#x27;content-length&#x27;];\n\t});\n\n\trequest.on(&#x27;socket&#x27;, socket =&gt; {\n\t\tconst onSocketClose = () =&gt; {\n\t\t\tif (isChunkedTransfer &amp;&amp; !properLastChunkReceived) {\n\t\t\t\tconst error = new Error(&#x27;Premature close&#x27;);\n\t\t\t\terror.code = &#x27;ERR_STREAM_PREMATURE_CLOSE&#x27;;\n\t\t\t\terrorCallback(error);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = buf =&gt; {\n\t\t\tproperLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;\n\n\t\t\t// Sometimes final 0-length chunk and end of message code are in separate packets\n\t\t\tif (!properLastChunkReceived &amp;&amp; previousChunk) {\n\t\t\t\tproperLastChunkReceived = (\n\t\t\t\t\tBuffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &amp;&amp;\n\t\t\t\t\tBuffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpreviousChunk = buf;\n\t\t};\n\n\t\tsocket.prependListener(&#x27;close&#x27;, onSocketClose);\n\t\tsocket.on(&#x27;data&#x27;, onData);\n\n\t\trequest.on(&#x27;close&#x27;, () =&gt; {\n\t\t\tsocket.removeListener(&#x27;close&#x27;, onSocketClose);\n\t\t\tsocket.removeListener(&#x27;data&#x27;, onData);\n\t\t});\n\t});\n}\n&quot;, &quot;// netlify/functions/lightx-proxy.js\r\n\r\n/**\r\n * Securely retrieves and validates environment variables at runtime\r\n * @param {string} key - Environment variable key\r\n * @param {boolean} required - Whether the variable is required\r\n * @returns {string|null} - The environment variable value or null if not found\r\n */\r\nfunction getSecureEnvVar(key, required = true) {\r\n const value = process.env[key];\r\n \r\n if (!value || value.trim() === &#x27;&#x27;) {\r\n if (required) {\r\n console.error(`Required environment variable ${key} is missing or empty`);\r\n return null;\r\n }\r\n console.warn(`Optional environment variable ${key} is not set`);\r\n return null;\r\n }\r\n \r\n // Basic validation for API key format (should be non-empty string)\r\n if (key.includes(&#x27;API_KEY&#x27;) &amp;&amp; value.length &lt; 10) {\r\n console.error(`Environment variable ${key} appears to be invalid (too short)`);\r\n return null;\r\n }\r\n \r\n return value.trim();\r\n}\r\n\r\n/**\r\n * Creates standardized error response\r\n * @param {number} statusCode - HTTP status code\r\n * @param {string} message - Error message\r\n * @param {string} details - Optional error details\r\n * @returns {Object} - Netlify function response object\r\n */\r\nfunction createErrorResponse(statusCode, message, details = null) {\r\n const response = {\r\n statusCode,\r\n headers: {\r\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\r\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\r\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;,\r\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27;\r\n },\r\n body: JSON.stringify({ \r\n error: message,\r\n ...(details &amp;&amp; { details })\r\n })\r\n };\r\n \r\n // Log error for debugging (without sensitive info)\r\n console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : &#x27;&#x27;}`);\r\n \r\n return response;\r\n}\r\n\r\nexports.handler = async function(event, context) {\r\n // Dynamic import for node-fetch ES module\r\n const { default: fetch } = await import(&#x27;node-fetch&#x27;);\r\n \r\n // Handle preflight OPTIONS request\r\n if (event.httpMethod === &#x27;OPTIONS&#x27;) {\r\n return {\r\n statusCode: 200,\r\n headers: {\r\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\r\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;,\r\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27;\r\n },\r\n body: &#x27;&#x27;\r\n };\r\n }\r\n \r\n // Only allow POST requests\r\n if (event.httpMethod !== &#x27;POST&#x27;) {\r\n return createErrorResponse(405, &#x27;Method Not Allowed&#x27;);\r\n }\r\n\r\n try {\r\n // Parse the request body\r\n let requestBody;\r\n try {\r\n requestBody = JSON.parse(event.body);\r\n } catch (parseError) {\r\n return createErrorResponse(400, &#x27;Invalid JSON in request body&#x27;, parseError.message);\r\n }\r\n \r\n const { endpoint, body } = requestBody;\r\n \r\n if (!endpoint) {\r\n return createErrorResponse(400, &#x27;Missing endpoint parameter&#x27;);\r\n }\r\n \r\n // Validate endpoint format\r\n if (typeof endpoint !== &#x27;string&#x27; || endpoint.trim() === &#x27;&#x27;) {\r\n return createErrorResponse(400, &#x27;Invalid endpoint parameter&#x27;);\r\n }\r\n \r\n // Construct the LightX API URL based on version\r\n // For v1 endpoints, the URL structure is different than v2\r\n let lightxUrl;\r\n if (endpoint.startsWith(&#x27;v1/&#x27;)) {\r\n // v1 endpoints use a different URL structure\r\n lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`;\r\n } else {\r\n // v2 and other endpoints use the external/api path\r\n lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`;\r\n }\r\n \r\n // Securely retrieve API key at runtime\r\n const apiKey = getSecureEnvVar(&#x27;LIGHTX_API_KEY&#x27;, true);\r\n \r\n if (!apiKey) {\r\n return createErrorResponse(500, &#x27;API key not configured or invalid&#x27;);\r\n }\r\n \r\n // Log request details (excluding sensitive info) - only in development\r\n const isDevelopment = getSecureEnvVar(&#x27;NODE_ENV&#x27;, false) !== &#x27;production&#x27;;\r\n if (isDevelopment) {\r\n console.log(`Making request to: ${lightxUrl}`);\r\n console.log(`Request body keys: ${Object.keys(body || {}).join(&#x27;, &#x27;)}`);\r\n console.log(`API key present: Yes`);\r\n }\r\n \r\n // Validate request body if present\r\n if (body &amp;&amp; typeof body !== &#x27;object&#x27;) {\r\n return createErrorResponse(400, &#x27;Request body must be an object&#x27;);\r\n }\r\n \r\n // Make the request to the LightX API with timeout\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() =&gt; controller.abort(), 30000); // 30 second timeout\r\n \r\n let response;\r\n try {\r\n response = await fetch(lightxUrl, {\r\n method: &#x27;POST&#x27;,\r\n headers: {\r\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\r\n &#x27;x-api-key&#x27;: apiKey,\r\n &#x27;User-Agent&#x27;: &#x27;ModernPhotoTools/1.0&#x27;\r\n },\r\n body: JSON.stringify(body || {}),\r\n signal: controller.signal\r\n });\r\n } catch (fetchError) {\r\n clearTimeout(timeoutId);\r\n if (fetchError.name === &#x27;AbortError&#x27;) {\r\n return createErrorResponse(408, &#x27;Request timeout&#x27;);\r\n }\r\n return createErrorResponse(502, &#x27;Failed to connect to LightX API&#x27;, fetchError.message);\r\n } finally {\r\n clearTimeout(timeoutId);\r\n }\r\n \r\n if (isDevelopment) {\r\n console.log(`Response status: ${response.status}`);\r\n console.log(`Response status text: ${response.statusText}`);\r\n }\r\n\r\n // Get the response data\r\n let data;\r\n try {\r\n data = await response.json();\r\n } catch (jsonError) {\r\n return createErrorResponse(502, &#x27;Invalid JSON response from LightX API&#x27;, jsonError.message);\r\n }\r\n \r\n // Return the response with proper headers\r\n return {\r\n statusCode: response.status,\r\n headers: {\r\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\r\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\r\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;,\r\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27;,\r\n &#x27;Cache-Control&#x27;: &#x27;no-cache, no-store, must-revalidate&#x27;\r\n },\r\n body: JSON.stringify(data)\r\n };\r\n } catch (error) {\r\n // Log full error details for debugging\r\n console.error(&#x27;Function error:&#x27;, {\r\n message: error.message,\r\n stack: error.stack,\r\n name: error.name\r\n });\r\n \r\n return createErrorResponse(500, &#x27;Internal server error&#x27;, error.message);\r\n }\r\n};&quot;], &quot;mappings&quot;: &quot;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,gBAAgB,KAAW;AAC1C,MAAI,CAAC,UAAU,KAAK,GAAG,GAAG;AACzB,UAAM,IAAI,UACT,kEAAkE;;AAKpE,QAAM,IAAI,QAAQ,UAAU,EAAE;AAG9B,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,MAAI,eAAe,MAAM,cAAc,GAAG;AACzC,UAAM,IAAI,UAAU,qBAAqB;;AAI1C,QAAM,OAAO,IAAI,UAAU,GAAG,UAAU,EAAE,MAAM,GAAG;AAEnD,MAAI,UAAU;AACd,MAAI,SAAS;AACb,QAAM,OAAO,KAAK,CAAC,KAAK;AACxB,MAAI,WAAW;AACf,WAASA,KAAI,GAAGA,KAAI,KAAK,QAAQA,MAAK;AACrC,QAAI,KAAKA,EAAC,MAAM,UAAU;AACzB,eAAS;eACA,KAAKA,EAAC,GAAG;AAClB,kBAAY,IAAM,KAAKA,EAAC,CAAC;AACzB,UAAI,KAAKA,EAAC,EAAE,QAAQ,UAAU,MAAM,GAAG;AACtC,kBAAU,KAAKA,EAAC,EAAE,UAAU,CAAC;;;;AAKhC,MAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,QAAQ;AAChC,gBAAY;AACZ,cAAU;;AAIX,QAAM,WAAW,SAAS,WAAW;AACrC,QAAM,OAAO,SAAS,IAAI,UAAU,aAAa,CAAC,CAAC;AACnD,QAAM,SAAS,OAAO,KAAK,MAAM,QAAQ;AAGzC,SAAO,OAAO;AACd,SAAO,WAAW;AAGlB,SAAO,UAAU;AAEjB,SAAO;AACR;AA3DA,IA6DA;AA7DA;;AA6DA,IAAA,eAAe;;;;;;;;;;;eCnECC,QAAI;AAClB,eAAO;MACT;ACCM,eAAU,aAAaC,IAAM;AACjC,eAAQ,OAAOA,OAAM,YAAYA,OAAM,QAAS,OAAOA,OAAM;MAC/D;AAEO,YAAM,iCAUPD;AAEU,eAAA,gBAAgB,IAAc,MAAY;AACxD,YAAI;AACF,iBAAO,eAAe,IAAI,QAAQ;YAChC,OAAO;YACP,cAAc;UACf,CAAA;iBACDE,KAAM;;MAIV;AC1BA,YAAM,kBAAkB;AACxB,YAAM,sBAAsB,QAAQ,UAAU;AAC9C,YAAM,wBAAwB,QAAQ,OAAO,KAAK,eAAe;AAG3D,eAAU,WAAc,UAGrB;AACP,eAAO,IAAI,gBAAgB,QAAQ;MACrC;AAGM,eAAU,oBAAuB,OAAyB;AAC9D,eAAO,WAAW,aAAW,QAAQ,KAAK,CAAC;MAC7C;AAGM,eAAU,oBAA+B,QAAW;AACxD,eAAO,sBAAsB,MAAM;MACrC;eAEgB,mBACd,SACA,aACA,YAA8D;AAG9D,eAAO,oBAAoB,KAAK,SAAS,aAAa,UAAU;MAClE;eAKgB,YACd,SACA,aACA,YAAsD;AACtD,2BACE,mBAAmB,SAAS,aAAa,UAAU,GACnD,QACA,8BAA8B;MAElC;AAEgB,eAAA,gBAAmB,SAAqB,aAAmD;AACzG,oBAAY,SAAS,WAAW;MAClC;AAEgB,eAAA,cAAc,SAA2B,YAAqD;AAC5G,oBAAY,SAAS,QAAW,UAAU;MAC5C;eAEgB,qBACd,SACA,oBACA,kBAAoE;AACpE,eAAO,mBAAmB,SAAS,oBAAoB,gBAAgB;MACzE;AAEM,eAAU,0BAA0B,SAAyB;AACjE,2BAAmB,SAAS,QAAW,8BAA8B;MACvE;AAEA,UAAI,kBAAkD,cAAW;AAC/D,YAAI,OAAO,mBAAmB,YAAY;AACxC,4BAAkB;eACb;AACL,gBAAM,kBAAkB,oBAAoB,MAAS;AACrD,4BAAkB,QAAM,mBAAmB,iBAAiB,EAAE;;AAEhE,eAAO,gBAAgB,QAAQ;MACjC;eAIgB,YAAmCC,IAAiC,GAAM,MAAO;AAC/F,YAAI,OAAOA,OAAM,YAAY;AAC3B,gBAAM,IAAI,UAAU,4BAA4B;;AAElD,eAAO,SAAS,UAAU,MAAM,KAAKA,IAAG,GAAG,IAAI;MACjD;eAEgB,YAAmCA,IACA,GACA,MAAO;AAIxD,YAAI;AACF,iBAAO,oBAAoB,YAAYA,IAAG,GAAG,IAAI,CAAC;iBAC3C,OAAO;AACd,iBAAO,oBAAoB,KAAK;;MAEpC;AC5FA,YAAM,uBAAuB;YAahB,YAAW;QAMtB,cAAA;AAHQ,eAAO,UAAG;AACV,eAAK,QAAG;AAId,eAAK,SAAS;YACZ,WAAW,CAAA;YACX,OAAO;;AAET,eAAK,QAAQ,KAAK;AAIlB,eAAK,UAAU;AAEf,eAAK,QAAQ;;QAGf,IAAI,SAAM;AACR,iBAAO,KAAK;;;;;;QAOd,KAAK,SAAU;AACb,gBAAM,UAAU,KAAK;AACrB,cAAI,UAAU;AAEd,cAAI,QAAQ,UAAU,WAAW,uBAAuB,GAAG;AACzD,sBAAU;cACR,WAAW,CAAA;cACX,OAAO;;;AAMX,kBAAQ,UAAU,KAAK,OAAO;AAC9B,cAAI,YAAY,SAAS;AACvB,iBAAK,QAAQ;AACb,oBAAQ,QAAQ;;AAElB,YAAE,KAAK;;;;QAKT,QAAK;AAGH,gBAAM,WAAW,KAAK;AACtB,cAAI,WAAW;AACf,gBAAM,YAAY,KAAK;AACvB,cAAI,YAAY,YAAY;AAE5B,gBAAM,WAAW,SAAS;AAC1B,gBAAM,UAAU,SAAS,SAAS;AAElC,cAAI,cAAc,sBAAsB;AAGtC,uBAAW,SAAS;AACpB,wBAAY;;AAId,YAAE,KAAK;AACP,eAAK,UAAU;AACf,cAAI,aAAa,UAAU;AACzB,iBAAK,SAAS;;AAIhB,mBAAS,SAAS,IAAI;AAEtB,iBAAO;;;;;;;;;;QAWT,QAAQ,UAA8B;AACpC,cAAIC,KAAI,KAAK;AACb,cAAI,OAAO,KAAK;AAChB,cAAI,WAAW,KAAK;AACpB,iBAAOA,OAAM,SAAS,UAAU,KAAK,UAAU,QAAW;AACxD,gBAAIA,OAAM,SAAS,QAAQ;AAGzB,qBAAO,KAAK;AACZ,yBAAW,KAAK;AAChB,cAAAA,KAAI;AACJ,kBAAI,SAAS,WAAW,GAAG;AACzB;;;AAGJ,qBAAS,SAASA,EAAC,CAAC;AACpB,cAAEA;;;;;QAMN,OAAI;AAGF,gBAAM,QAAQ,KAAK;AACnB,gBAAM,SAAS,KAAK;AACpB,iBAAO,MAAM,UAAU,MAAM;;MAEhC;AC1IM,YAAM,aAAa,OAAO,gBAAgB;AAC1C,YAAM,aAAa,OAAO,gBAAgB;AAC1C,YAAM,cAAc,OAAO,iBAAiB;AAC5C,YAAM,YAAY,OAAO,eAAe;AACxC,YAAM,eAAe,OAAO,kBAAkB;ACCrC,eAAA,sCAAyC,QAAiC,QAAyB;AACjH,eAAO,uBAAuB;AAC9B,eAAO,UAAU;AAEjB,YAAI,OAAO,WAAW,YAAY;AAChC,+CAAqC,MAAM;mBAClC,OAAO,WAAW,UAAU;AACrC,yDAA+C,MAAM;eAChD;AAGL,yDAA+C,QAAQ,OAAO,YAAY;;MAE9E;AAKgB,eAAA,kCAAkC,QAAmC,QAAW;AAC9F,cAAM,SAAS,OAAO;AAEtB,eAAO,qBAAqB,QAAQ,MAAM;MAC5C;AAEM,eAAU,mCAAmC,QAAiC;AAClF,cAAM,SAAS,OAAO;AAItB,YAAI,OAAO,WAAW,YAAY;AAChC,2CACE,QACA,IAAI,UAAU,kFAAkF,CAAC;eAC9F;AACL,oDACE,QACA,IAAI,UAAU,kFAAkF,CAAC;;AAGrG,eAAO,0BAA0B,YAAY,EAAC;AAE9C,eAAO,UAAU;AACjB,eAAO,uBAAuB;MAChC;AAIM,eAAU,oBAAoB,MAAY;AAC9C,eAAO,IAAI,UAAU,YAAY,OAAO,mCAAmC;MAC7E;AAIM,eAAU,qCAAqC,QAAiC;AACpF,eAAO,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACrD,iBAAO,yBAAyB;AAChC,iBAAO,wBAAwB;QACjC,CAAC;MACH;AAEgB,eAAA,+CAA+C,QAAmC,QAAW;AAC3G,6CAAqC,MAAM;AAC3C,yCAAiC,QAAQ,MAAM;MACjD;AAEM,eAAU,+CAA+C,QAAiC;AAC9F,6CAAqC,MAAM;AAC3C,0CAAkC,MAAM;MAC1C;AAEgB,eAAA,iCAAiC,QAAmC,QAAW;AAC7F,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,kCAA0B,OAAO,cAAc;AAC/C,eAAO,sBAAsB,MAAM;AACnC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;MACjC;AAEgB,eAAA,0CAA0C,QAAmC,QAAW;AAItG,uDAA+C,QAAQ,MAAM;MAC/D;AAEM,eAAU,kCAAkC,QAAiC;AACjF,YAAI,OAAO,2BAA2B,QAAW;AAC/C;;AAGF,eAAO,uBAAuB,MAAS;AACvC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;MACjC;AClGA,YAAM,iBAAyC,OAAO,YAAY,SAAUH,IAAC;AAC3E,eAAO,OAAOA,OAAM,YAAY,SAASA,EAAC;MAC5C;ACFA,YAAM,YAA+B,KAAK,SAAS,SAAU,GAAC;AAC5D,eAAO,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;MAC5C;ACDM,eAAU,aAAaA,IAAM;AACjC,eAAO,OAAOA,OAAM,YAAY,OAAOA,OAAM;MAC/C;AAEgB,eAAA,iBAAiB,KACA,SAAe;AAC9C,YAAI,QAAQ,UAAa,CAAC,aAAa,GAAG,GAAG;AAC3C,gBAAM,IAAI,UAAU,GAAG,OAAO,oBAAoB;;MAEtD;AAKgB,eAAA,eAAeA,IAAY,SAAe;AACxD,YAAI,OAAOA,OAAM,YAAY;AAC3B,gBAAM,IAAI,UAAU,GAAG,OAAO,qBAAqB;;MAEvD;AAGM,eAAU,SAASA,IAAM;AAC7B,eAAQ,OAAOA,OAAM,YAAYA,OAAM,QAAS,OAAOA,OAAM;MAC/D;AAEgB,eAAA,aAAaA,IACA,SAAe;AAC1C,YAAI,CAAC,SAASA,EAAC,GAAG;AAChB,gBAAM,IAAI,UAAU,GAAG,OAAO,oBAAoB;;MAEtD;eAEgB,uBAA0BA,IACA,UACA,SAAe;AACvD,YAAIA,OAAM,QAAW;AACnB,gBAAM,IAAI,UAAU,aAAa,QAAQ,oBAAoB,OAAO,IAAI;;MAE5E;eAEgB,oBAAuBA,IACA,OACA,SAAe;AACpD,YAAIA,OAAM,QAAW;AACnB,gBAAM,IAAI,UAAU,GAAG,KAAK,oBAAoB,OAAO,IAAI;;MAE/D;AAGM,eAAU,0BAA0B,OAAc;AACtD,eAAO,OAAO,KAAK;MACrB;AAEA,eAAS,mBAAmBA,IAAS;AACnC,eAAOA,OAAM,IAAI,IAAIA;MACvB;AAEA,eAAS,YAAYA,IAAS;AAC5B,eAAO,mBAAmB,UAAUA,EAAC,CAAC;MACxC;AAGgB,eAAA,wCAAwC,OAAgB,SAAe;AACrF,cAAM,aAAa;AACnB,cAAM,aAAa,OAAO;AAE1B,YAAIA,KAAI,OAAO,KAAK;AACpB,QAAAA,KAAI,mBAAmBA,EAAC;AAExB,YAAI,CAAC,eAAeA,EAAC,GAAG;AACtB,gBAAM,IAAI,UAAU,GAAG,OAAO,yBAAyB;;AAGzD,QAAAA,KAAI,YAAYA,EAAC;AAEjB,YAAIA,KAAI,cAAcA,KAAI,YAAY;AACpC,gBAAM,IAAI,UAAU,GAAG,OAAO,qCAAqC,UAAU,OAAO,UAAU,aAAa;;AAG7G,YAAI,CAAC,eAAeA,EAAC,KAAKA,OAAM,GAAG;AACjC,iBAAO;;AAQT,eAAOA;MACT;AC3FgB,eAAA,qBAAqBA,IAAY,SAAe;AAC9D,YAAI,CAAC,iBAAiBA,EAAC,GAAG;AACxB,gBAAM,IAAI,UAAU,GAAG,OAAO,2BAA2B;;MAE7D;ACwBM,eAAU,mCAAsC,QAAsB;AAC1E,eAAO,IAAI,4BAA4B,MAAM;MAC/C;AAIgB,eAAA,6BAAgC,QACA,aAA2B;AAIxE,eAAO,QAA4C,cAAc,KAAK,WAAW;MACpF;eAEgB,iCAAoC,QAA2B,OAAsB,MAAa;AAChH,cAAM,SAAS,OAAO;AAItB,cAAM,cAAc,OAAO,cAAc,MAAK;AAC9C,YAAI,MAAM;AACR,sBAAY,YAAW;eAClB;AACL,sBAAY,YAAY,KAAM;;MAElC;AAEM,eAAU,iCAAoC,QAAyB;AAC3E,eAAQ,OAAO,QAA2C,cAAc;MAC1E;AAEM,eAAU,+BAA+B,QAAsB;AACnE,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB,iBAAO;;AAGT,YAAI,CAAC,8BAA8B,MAAM,GAAG;AAC1C,iBAAO;;AAGT,eAAO;MACT;YAiBa,4BAA2B;QAYtC,YAAY,QAAyB;AACnC,iCAAuB,QAAQ,GAAG,6BAA6B;AAC/D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,gDAAsC,MAAM,MAAM;AAElD,eAAK,gBAAgB,IAAI,YAAW;;;;;;QAOtC,IAAI,SAAM;AACR,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,iBAAO,KAAK;;;;;QAMd,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,QAAQ,CAAC;;AAG1D,iBAAO,kCAAkC,MAAM,MAAM;;;;;;;QAQvD,OAAI;AACF,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,MAAM,CAAC;;AAGrE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,WAAW,CAAC;;AAG7D,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA+C,CAAC,SAAS,WAAU;AACjF,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,cAA8B;YAClC,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE;YAClE,aAAa,MAAM,eAAe,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;YAClE,aAAa,CAAAI,OAAK,cAAcA,EAAC;;AAEnC,0CAAgC,MAAM,WAAW;AACjD,iBAAO;;;;;;;;;;;QAYT,cAAW;AACT,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,cAAI,KAAK,yBAAyB,QAAW;AAC3C;;AAGF,6CAAmC,IAAI;;MAE1C;AAED,aAAO,iBAAiB,4BAA4B,WAAW;QAC7D,QAAQ,EAAE,YAAY,KAAI;QAC1B,MAAM,EAAE,YAAY,KAAI;QACxB,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,4BAA4B,UAAU,QAAQ,QAAQ;AACtE,sBAAgB,4BAA4B,UAAU,MAAM,MAAM;AAClE,sBAAgB,4BAA4B,UAAU,aAAa,aAAa;AAChF,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,4BAA4B,WAAW,OAAO,aAAa;UAC/E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,8BAAuCJ,IAAM;AAC3D,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,eAAe,GAAG;AAC7D,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEgB,eAAA,gCAAmC,QACA,aAA2B;AAC5E,cAAM,SAAS,OAAO;AAItB,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,UAAU;AAC9B,sBAAY,YAAW;mBACd,OAAO,WAAW,WAAW;AACtC,sBAAY,YAAY,OAAO,YAAY;eACtC;AAEL,iBAAO,0BAA0B,SAAS,EAAE,WAA+B;;MAE/E;AAEM,eAAU,mCAAmC,QAAmC;AACpF,2CAAmC,MAAM;AACzC,cAAMI,KAAI,IAAI,UAAU,qBAAqB;AAC7C,qDAA6C,QAAQA,EAAC;MACxD;AAEgB,eAAA,6CAA6C,QAAqCA,IAAM;AACtG,cAAM,eAAe,OAAO;AAC5B,eAAO,gBAAgB,IAAI,YAAW;AACtC,qBAAa,QAAQ,iBAAc;AACjC,sBAAY,YAAYA,EAAC;QAC3B,CAAC;MACH;AAIA,eAAS,iCAAiC,MAAY;AACpD,eAAO,IAAI,UACT,yCAAyC,IAAI,oDAAoD;MACrG;ACjQO,YAAM,yBACX,OAAO,eAAe,OAAO,eAAe,mBAAe;MAAA,CAAkC,EAAE,SAAS;YC6B7F,gCAA+B;QAM1C,YAAY,QAAwC,eAAsB;AAHlE,eAAe,kBAA4D;AAC3E,eAAW,cAAG;AAGpB,eAAK,UAAU;AACf,eAAK,iBAAiB;;QAGxB,OAAI;AACF,gBAAM,YAAY,MAAM,KAAK,WAAU;AACvC,eAAK,kBAAkB,KAAK,kBAC1B,qBAAqB,KAAK,iBAAiB,WAAW,SAAS,IAC/D,UAAS;AACX,iBAAO,KAAK;;QAGd,OAAO,OAAU;AACf,gBAAM,cAAc,MAAM,KAAK,aAAa,KAAK;AACjD,iBAAO,KAAK,kBACV,qBAAqB,KAAK,iBAAiB,aAAa,WAAW,IACnE,YAAW;;QAGP,aAAU;AAChB,cAAI,KAAK,aAAa;AACpB,mBAAO,QAAQ,QAAQ,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;;AAGzD,gBAAM,SAAS,KAAK;AAGpB,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA+C,CAAC,SAAS,WAAU;AACjF,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,cAA8B;YAClC,aAAa,WAAQ;AACnB,mBAAK,kBAAkB;AAGvBC,8BAAe,MAAM,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE,CAAC;;YAEpE,aAAa,MAAK;AAChB,mBAAK,kBAAkB;AACvB,mBAAK,cAAc;AACnB,iDAAmC,MAAM;AACzC,6BAAe,EAAE,OAAO,QAAW,MAAM,KAAI,CAAE;;YAEjD,aAAa,YAAS;AACpB,mBAAK,kBAAkB;AACvB,mBAAK,cAAc;AACnB,iDAAmC,MAAM;AACzC,4BAAc,MAAM;;;AAGxB,0CAAgC,QAAQ,WAAW;AACnD,iBAAO;;QAGD,aAAa,OAAU;AAC7B,cAAI,KAAK,aAAa;AACpB,mBAAO,QAAQ,QAAQ,EAAE,OAAO,MAAM,KAAI,CAAE;;AAE9C,eAAK,cAAc;AAEnB,gBAAM,SAAS,KAAK;AAIpB,cAAI,CAAC,KAAK,gBAAgB;AACxB,kBAAM,SAAS,kCAAkC,QAAQ,KAAK;AAC9D,+CAAmC,MAAM;AACzC,mBAAO,qBAAqB,QAAQ,OAAO,EAAE,OAAO,MAAM,KAAI,EAAG;;AAGnE,6CAAmC,MAAM;AACzC,iBAAO,oBAAoB,EAAE,OAAO,MAAM,KAAI,CAAE;;MAEnD;AAWD,YAAM,uCAAiF;QACrF,OAAI;AACF,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,uCAAuC,MAAM,CAAC;;AAE3E,iBAAO,KAAK,mBAAmB,KAAI;;QAGrC,OAAuD,OAAU;AAC/D,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,uCAAuC,QAAQ,CAAC;;AAE7E,iBAAO,KAAK,mBAAmB,OAAO,KAAK;;;AAG/C,aAAO,eAAe,sCAAsC,sBAAsB;AAIlE,eAAA,mCAAsC,QACA,eAAsB;AAC1E,cAAM,SAAS,mCAAsC,MAAM;AAC3D,cAAM,OAAO,IAAI,gCAAgC,QAAQ,aAAa;AACtE,cAAM,WAAmD,OAAO,OAAO,oCAAoC;AAC3G,iBAAS,qBAAqB;AAC9B,eAAO;MACT;AAEA,eAAS,8BAAuCL,IAAM;AACpD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,oBAAoB,GAAG;AAClE,iBAAO;;AAGT,YAAI;AAEF,iBAAQA,GAA+C,8BACrD;iBACFC,KAAM;AACN,iBAAO;;MAEX;AAIA,eAAS,uCAAuC,MAAY;AAC1D,eAAO,IAAI,UAAU,+BAA+B,IAAI,mDAAmD;MAC7G;AC9KA,YAAM,cAAmC,OAAO,SAAS,SAAUD,IAAC;AAElE,eAAOA,OAAMA;MACf;;ACQM,eAAU,oBAAqC,UAAW;AAG9D,eAAO,SAAS,MAAK;MACvB;AAEM,eAAU,mBAAmB,MACA,YACA,KACA,WACA,GAAS;AAC1C,YAAI,WAAW,IAAI,EAAE,IAAI,IAAI,WAAW,KAAK,WAAW,CAAC,GAAG,UAAU;MACxE;AAEO,UAAI,sBAAsB,CAAC,MAA+B;AAC/D,YAAI,OAAO,EAAE,aAAa,YAAY;AACpC,gCAAsB,YAAU,OAAO,SAAQ;mBACtC,OAAO,oBAAoB,YAAY;AAChD,gCAAsB,YAAU,gBAAgB,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAC,CAAE;eACzE;AAEL,gCAAsB,YAAU;;AAElC,eAAO,oBAAoB,CAAC;MAC9B;AAMO,UAAI,mBAAmB,CAAC,MAA2B;AACxD,YAAI,OAAO,EAAE,aAAa,WAAW;AACnC,6BAAmB,YAAU,OAAO;eAC/B;AAEL,6BAAmB,YAAU,OAAO,eAAe;;AAErD,eAAO,iBAAiB,CAAC;MAC3B;eAEgB,iBAAiB,QAAqB,OAAe,KAAW;AAG9E,YAAI,OAAO,OAAO;AAChB,iBAAO,OAAO,MAAM,OAAO,GAAG;;AAEhC,cAAM,SAAS,MAAM;AACrB,cAAM,QAAQ,IAAI,YAAY,MAAM;AACpC,2BAAmB,OAAO,GAAG,QAAQ,OAAO,MAAM;AAClD,eAAO;MACT;AAMgB,eAAA,UAAsC,UAAa,MAAO;AACxE,cAAM,OAAO,SAAS,IAAI;AAC1B,YAAI,SAAS,UAAa,SAAS,MAAM;AACvC,iBAAO;;AAET,YAAI,OAAO,SAAS,YAAY;AAC9B,gBAAM,IAAI,UAAU,GAAG,OAAO,IAAI,CAAC,oBAAoB;;AAEzD,eAAO;MACT;AAgBM,eAAU,4BAA+B,oBAAyC;AAKtF,cAAM,eAAe;UACnB,CAAC,OAAO,QAAQ,GAAG,MAAM,mBAAmB;;AAG9C,cAAM,iBAAiB,mBAAe;AACpC,iBAAO,OAAO;WACf;AAED,cAAM,aAAa,cAAc;AACjC,eAAO,EAAE,UAAU,eAAe,YAAY,MAAM,MAAK;MAC3D;AAGO,YAAM,uBACX,MAAA,KAAA,OAAO,mBAAa,QAAA,OAAA,SAAA,MACpB,KAAA,OAAO,SAAG,QAAA,OAAA,SAAA,SAAA,GAAA,KAAA,QAAG,sBAAsB,OAAC,QAAA,OAAA,SAAA,KACpC;AAeF,eAAS,YACP,KACA,OAAO,QACP,QAAqC;AAGrC,YAAI,WAAW,QAAW;AACxB,cAAI,SAAS,SAAS;AACpB,qBAAS,UAAU,KAAyB,mBAAmB;AAC/D,gBAAI,WAAW,QAAW;AACxB,oBAAM,aAAa,UAAU,KAAoB,OAAO,QAAQ;AAChE,oBAAM,qBAAqB,YAAY,KAAoB,QAAQ,UAAU;AAC7E,qBAAO,4BAA4B,kBAAkB;;iBAElD;AACL,qBAAS,UAAU,KAAoB,OAAO,QAAQ;;;AAG1D,YAAI,WAAW,QAAW;AACxB,gBAAM,IAAI,UAAU,4BAA4B;;AAElD,cAAM,WAAW,YAAY,QAAQ,KAAK,CAAA,CAAE;AAC5C,YAAI,CAAC,aAAa,QAAQ,GAAG;AAC3B,gBAAM,IAAI,UAAU,2CAA2C;;AAEjE,cAAM,aAAa,SAAS;AAC5B,eAAO,EAAE,UAAU,YAAY,MAAM,MAAK;MAC5C;AAIM,eAAU,aAAgB,gBAAsC;AACpE,cAAM,SAAS,YAAY,eAAe,YAAY,eAAe,UAAU,CAAA,CAAE;AACjF,YAAI,CAAC,aAAa,MAAM,GAAG;AACzB,gBAAM,IAAI,UAAU,kDAAkD;;AAExE,eAAO;MACT;AAEM,eAAU,iBACd,YAA4C;AAG5C,eAAO,QAAQ,WAAW,IAAI;MAChC;AAEM,eAAU,cAAiB,YAAkC;AAEjE,eAAO,WAAW;MACpB;AChLM,eAAU,oBAAoB,GAAS;AAC3C,YAAI,OAAO,MAAM,UAAU;AACzB,iBAAO;;AAGT,YAAI,YAAY,CAAC,GAAG;AAClB,iBAAO;;AAGT,YAAI,IAAI,GAAG;AACT,iBAAO;;AAGT,eAAO;MACT;AAEM,eAAU,kBAAkB,GAA6B;AAC7D,cAAM,SAAS,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU;AACnF,eAAO,IAAI,WAAW,MAAM;MAC9B;ACTM,eAAU,aAAgB,WAAuC;AAIrE,cAAM,OAAO,UAAU,OAAO,MAAK;AACnC,kBAAU,mBAAmB,KAAK;AAClC,YAAI,UAAU,kBAAkB,GAAG;AACjC,oBAAU,kBAAkB;;AAG9B,eAAO,KAAK;MACd;eAEgB,qBAAwB,WAAyC,OAAU,MAAY;AAGrG,YAAI,CAAC,oBAAoB,IAAI,KAAK,SAAS,UAAU;AACnD,gBAAM,IAAI,WAAW,sDAAsD;;AAG7E,kBAAU,OAAO,KAAK,EAAE,OAAO,KAAI,CAAE;AACrC,kBAAU,mBAAmB;MAC/B;AAEM,eAAU,eAAkB,WAAuC;AAIvE,cAAM,OAAO,UAAU,OAAO,KAAI;AAClC,eAAO,KAAK;MACd;AAEM,eAAU,WAAc,WAA4B;AAGxD,kBAAU,SAAS,IAAI,YAAW;AAClC,kBAAU,kBAAkB;MAC9B;ACxBA,eAAS,sBAAsB,MAAc;AAC3C,eAAO,SAAS;MAClB;AAEM,eAAU,WAAW,MAAqB;AAC9C,eAAO,sBAAsB,KAAK,WAAW;MAC/C;AAEM,eAAU,2BAAsD,MAAmC;AACvG,YAAI,sBAAsB,IAAI,GAAG;AAC/B,iBAAO;;AAET,eAAQ,KAA0C;MACpD;YCSa,0BAAyB;QAMpC,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,OAAI;AACN,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,MAAM;;AAG7C,iBAAO,KAAK;;QAWd,QAAQ,cAAgC;AACtC,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,SAAS;;AAEhD,iCAAuB,cAAc,GAAG,SAAS;AACjD,yBAAe,wCAAwC,cAAc,iBAAiB;AAEtF,cAAI,KAAK,4CAA4C,QAAW;AAC9D,kBAAM,IAAI,UAAU,wCAAwC;;AAG9D,cAAI,iBAAiB,KAAK,MAAO,MAAM,GAAG;AACxC,kBAAM,IAAI,UAAU,iFAAiF;;AAMvG,8CAAoC,KAAK,yCAAyC,YAAY;;QAWhG,mBAAmB,MAAgC;AACjD,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,+BAA+B,oBAAoB;;AAE3D,iCAAuB,MAAM,GAAG,oBAAoB;AAEpD,cAAI,CAAC,YAAY,OAAO,IAAI,GAAG;AAC7B,kBAAM,IAAI,UAAU,8CAA8C;;AAGpE,cAAI,KAAK,4CAA4C,QAAW;AAC9D,kBAAM,IAAI,UAAU,wCAAwC;;AAG9D,cAAI,iBAAiB,KAAK,MAAM,GAAG;AACjC,kBAAM,IAAI,UAAU,+EAAgF;;AAGtG,yDAA+C,KAAK,yCAAyC,IAAI;;MAEpG;AAED,aAAO,iBAAiB,0BAA0B,WAAW;QAC3D,SAAS,EAAE,YAAY,KAAI;QAC3B,oBAAoB,EAAE,YAAY,KAAI;QACtC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,sBAAgB,0BAA0B,UAAU,SAAS,SAAS;AACtE,sBAAgB,0BAA0B,UAAU,oBAAoB,oBAAoB;AAC5F,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,0BAA0B,WAAW,OAAO,aAAa;UAC7E,OAAO;UACP,cAAc;QACf,CAAA;MACH;YAyCa,6BAA4B;QA4BvC,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,cAAW;AACb,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,aAAa;;AAG7D,iBAAO,2CAA2C,IAAI;;;;;;QAOxD,IAAI,cAAW;AACb,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,aAAa;;AAG7D,iBAAO,2CAA2C,IAAI;;;;;;QAOxD,QAAK;AACH,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,OAAO;;AAGvD,cAAI,KAAK,iBAAiB;AACxB,kBAAM,IAAI,UAAU,4DAA4D;;AAGlF,gBAAM,QAAQ,KAAK,8BAA8B;AACjD,cAAI,UAAU,YAAY;AACxB,kBAAM,IAAI,UAAU,kBAAkB,KAAK,2DAA2D;;AAGxG,4CAAkC,IAAI;;QAQxC,QAAQ,OAAiC;AACvC,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,SAAS;;AAGzD,iCAAuB,OAAO,GAAG,SAAS;AAC1C,cAAI,CAAC,YAAY,OAAO,KAAK,GAAG;AAC9B,kBAAM,IAAI,UAAU,oCAAoC;;AAE1D,cAAI,MAAM,eAAe,GAAG;AAC1B,kBAAM,IAAI,UAAU,qCAAqC;;AAE3D,cAAI,MAAM,OAAO,eAAe,GAAG;AACjC,kBAAM,IAAI,UAAU,8CAA8C;;AAGpE,cAAI,KAAK,iBAAiB;AACxB,kBAAM,IAAI,UAAU,8BAA8B;;AAGpD,gBAAM,QAAQ,KAAK,8BAA8B;AACjD,cAAI,UAAU,YAAY;AACxB,kBAAM,IAAI,UAAU,kBAAkB,KAAK,gEAAgE;;AAG7G,8CAAoC,MAAM,KAAK;;;;;QAMjD,MAAMI,KAAS,QAAS;AACtB,cAAI,CAAC,+BAA+B,IAAI,GAAG;AACzC,kBAAM,wCAAwC,OAAO;;AAGvD,4CAAkC,MAAMA,EAAC;;;QAI3C,CAAC,WAAW,EAAE,QAAW;AACvB,4DAAkD,IAAI;AAEtD,qBAAW,IAAI;AAEf,gBAAM,SAAS,KAAK,iBAAiB,MAAM;AAC3C,sDAA4C,IAAI;AAChD,iBAAO;;;QAIT,CAAC,SAAS,EAAE,aAA+C;AACzD,gBAAM,SAAS,KAAK;AAGpB,cAAI,KAAK,kBAAkB,GAAG;AAG5B,iEAAqD,MAAM,WAAW;AACtE;;AAGF,gBAAM,wBAAwB,KAAK;AACnC,cAAI,0BAA0B,QAAW;AACvC,gBAAI;AACJ,gBAAI;AACF,uBAAS,IAAI,YAAY,qBAAqB;qBACvC,SAAS;AAChB,0BAAY,YAAY,OAAO;AAC/B;;AAGF,kBAAM,qBAAgD;cACpD;cACA,kBAAkB;cAClB,YAAY;cACZ,YAAY;cACZ,aAAa;cACb,aAAa;cACb,aAAa;cACb,iBAAiB;cACjB,YAAY;;AAGd,iBAAK,kBAAkB,KAAK,kBAAkB;;AAGhD,uCAA6B,QAAQ,WAAW;AAChD,uDAA6C,IAAI;;;QAInD,CAAC,YAAY,IAAC;AACZ,cAAI,KAAK,kBAAkB,SAAS,GAAG;AACrC,kBAAM,gBAAgB,KAAK,kBAAkB,KAAI;AACjD,0BAAc,aAAa;AAE3B,iBAAK,oBAAoB,IAAI,YAAW;AACxC,iBAAK,kBAAkB,KAAK,aAAa;;;MAG9C;AAED,aAAO,iBAAiB,6BAA6B,WAAW;QAC9D,OAAO,EAAE,YAAY,KAAI;QACzB,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;QAC/B,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,6BAA6B,UAAU,OAAO,OAAO;AACrE,sBAAgB,6BAA6B,UAAU,SAAS,SAAS;AACzE,sBAAgB,6BAA6B,UAAU,OAAO,OAAO;AACrE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,6BAA6B,WAAW,OAAO,aAAa;UAChF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,+BAA+BJ,IAAM;AACnD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,+BAA+B,GAAG;AAC7E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,4BAA4BA,IAAM;AACzC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,yCAAyC,GAAG;AACvF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,6CAA6C,YAAwC;AAC5F,cAAM,aAAa,2CAA2C,UAAU;AACxE,YAAI,CAAC,YAAY;AACf;;AAGF,YAAI,WAAW,UAAU;AACvB,qBAAW,aAAa;AACxB;;AAKF,mBAAW,WAAW;AAGtB,cAAM,cAAc,WAAW,eAAc;AAC7C,oBACE,aACA,MAAK;AACH,qBAAW,WAAW;AAEtB,cAAI,WAAW,YAAY;AACzB,uBAAW,aAAa;AACxB,yDAA6C,UAAU;;AAGzD,iBAAO;WAET,CAAAI,OAAI;AACF,4CAAkC,YAAYA,EAAC;AAC/C,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,kDAAkD,YAAwC;AACjG,0DAAkD,UAAU;AAC5D,mBAAW,oBAAoB,IAAI,YAAW;MAChD;AAEA,eAAS,qDACP,QACA,oBAAyC;AAKzC,YAAI,OAAO;AACX,YAAI,OAAO,WAAW,UAAU;AAE9B,iBAAO;;AAGT,cAAM,aAAa,sDAAyD,kBAAkB;AAC9F,YAAI,mBAAmB,eAAe,WAAW;AAC/C,2CAAiC,QAAQ,YAAgD,IAAI;eACxF;AAEL,+CAAqC,QAAQ,YAAY,IAAI;;MAEjE;AAEA,eAAS,sDACP,oBAAyC;AAEzC,cAAM,cAAc,mBAAmB;AACvC,cAAM,cAAc,mBAAmB;AAKvC,eAAO,IAAI,mBAAmB,gBAC5B,mBAAmB,QAAQ,mBAAmB,YAAY,cAAc,WAAW;MACvF;AAEA,eAAS,gDAAgD,YACA,QACA,YACA,YAAkB;AACzE,mBAAW,OAAO,KAAK,EAAE,QAAQ,YAAY,WAAU,CAAE;AACzD,mBAAW,mBAAmB;MAChC;AAEA,eAAS,sDAAsD,YACA,QACA,YACA,YAAkB;AAC/E,YAAI;AACJ,YAAI;AACF,wBAAc,iBAAiB,QAAQ,YAAY,aAAa,UAAU;iBACnE,QAAQ;AACf,4CAAkC,YAAY,MAAM;AACpD,gBAAM;;AAER,wDAAgD,YAAY,aAAa,GAAG,UAAU;MACxF;AAEA,eAAS,2DAA2D,YACA,iBAAmC;AAErG,YAAI,gBAAgB,cAAc,GAAG;AACnC,gEACE,YACA,gBAAgB,QAChB,gBAAgB,YAChB,gBAAgB,WAAW;;AAG/B,yDAAiD,UAAU;MAC7D;AAEA,eAAS,4DAA4D,YACA,oBAAsC;AACzG,cAAM,iBAAiB,KAAK,IAAI,WAAW,iBACX,mBAAmB,aAAa,mBAAmB,WAAW;AAC9F,cAAM,iBAAiB,mBAAmB,cAAc;AAExD,YAAI,4BAA4B;AAChC,YAAI,QAAQ;AAEZ,cAAM,iBAAiB,iBAAiB,mBAAmB;AAC3D,cAAM,kBAAkB,iBAAiB;AAGzC,YAAI,mBAAmB,mBAAmB,aAAa;AACrD,sCAA4B,kBAAkB,mBAAmB;AACjE,kBAAQ;;AAGV,cAAM,QAAQ,WAAW;AAEzB,eAAO,4BAA4B,GAAG;AACpC,gBAAM,cAAc,MAAM,KAAI;AAE9B,gBAAM,cAAc,KAAK,IAAI,2BAA2B,YAAY,UAAU;AAE9E,gBAAM,YAAY,mBAAmB,aAAa,mBAAmB;AACrE,6BAAmB,mBAAmB,QAAQ,WAAW,YAAY,QAAQ,YAAY,YAAY,WAAW;AAEhH,cAAI,YAAY,eAAe,aAAa;AAC1C,kBAAM,MAAK;iBACN;AACL,wBAAY,cAAc;AAC1B,wBAAY,cAAc;;AAE5B,qBAAW,mBAAmB;AAE9B,iEAAuD,YAAY,aAAa,kBAAkB;AAElG,uCAA6B;;AAS/B,eAAO;MACT;AAEA,eAAS,uDAAuD,YACA,MACA,oBAAsC;AAGpG,2BAAmB,eAAe;MACpC;AAEA,eAAS,6CAA6C,YAAwC;AAG5F,YAAI,WAAW,oBAAoB,KAAK,WAAW,iBAAiB;AAClE,sDAA4C,UAAU;AACtD,8BAAoB,WAAW,6BAA6B;eACvD;AACL,uDAA6C,UAAU;;MAE3D;AAEA,eAAS,kDAAkD,YAAwC;AACjG,YAAI,WAAW,iBAAiB,MAAM;AACpC;;AAGF,mBAAW,aAAa,0CAA0C;AAClE,mBAAW,aAAa,QAAQ;AAChC,mBAAW,eAAe;MAC5B;AAEA,eAAS,iEAAiE,YAAwC;AAGhH,eAAO,WAAW,kBAAkB,SAAS,GAAG;AAC9C,cAAI,WAAW,oBAAoB,GAAG;AACpC;;AAGF,gBAAM,qBAAqB,WAAW,kBAAkB,KAAI;AAG5D,cAAI,4DAA4D,YAAY,kBAAkB,GAAG;AAC/F,6DAAiD,UAAU;AAE3D,iEACE,WAAW,+BACX,kBAAkB;;;MAI1B;AAEA,eAAS,0DAA0D,YAAwC;AACzG,cAAM,SAAS,WAAW,8BAA8B;AAExD,eAAO,OAAO,cAAc,SAAS,GAAG;AACtC,cAAI,WAAW,oBAAoB,GAAG;AACpC;;AAEF,gBAAM,cAAc,OAAO,cAAc,MAAK;AAC9C,+DAAqD,YAAY,WAAW;;MAEhF;AAEM,eAAU,qCACd,YACA,MACA,KACA,iBAAmC;AAEnC,cAAM,SAAS,WAAW;AAE1B,cAAM,OAAO,KAAK;AAClB,cAAM,cAAc,2BAA2B,IAAI;AAEnD,cAAM,EAAE,YAAY,WAAU,IAAK;AAEnC,cAAM,cAAc,MAAM;AAI1B,YAAI;AACJ,YAAI;AACF,mBAAS,oBAAoB,KAAK,MAAM;iBACjCA,IAAG;AACV,0BAAgB,YAAYA,EAAC;AAC7B;;AAGF,cAAM,qBAAgD;UACpD;UACA,kBAAkB,OAAO;UACzB;UACA;UACA,aAAa;UACb;UACA;UACA,iBAAiB;UACjB,YAAY;;AAGd,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,qBAAW,kBAAkB,KAAK,kBAAkB;AAMpD,2CAAiC,QAAQ,eAAe;AACxD;;AAGF,YAAI,OAAO,WAAW,UAAU;AAC9B,gBAAM,YAAY,IAAI,KAAK,mBAAmB,QAAQ,mBAAmB,YAAY,CAAC;AACtF,0BAAgB,YAAY,SAAS;AACrC;;AAGF,YAAI,WAAW,kBAAkB,GAAG;AAClC,cAAI,4DAA4D,YAAY,kBAAkB,GAAG;AAC/F,kBAAM,aAAa,sDAAyD,kBAAkB;AAE9F,yDAA6C,UAAU;AAEvD,4BAAgB,YAAY,UAAU;AACtC;;AAGF,cAAI,WAAW,iBAAiB;AAC9B,kBAAMA,KAAI,IAAI,UAAU,yDAAyD;AACjF,8CAAkC,YAAYA,EAAC;AAE/C,4BAAgB,YAAYA,EAAC;AAC7B;;;AAIJ,mBAAW,kBAAkB,KAAK,kBAAkB;AAEpD,yCAAoC,QAAQ,eAAe;AAC3D,qDAA6C,UAAU;MACzD;AAEA,eAAS,iDAAiD,YACA,iBAAmC;AAG3F,YAAI,gBAAgB,eAAe,QAAQ;AACzC,2DAAiD,UAAU;;AAG7D,cAAM,SAAS,WAAW;AAC1B,YAAI,4BAA4B,MAAM,GAAG;AACvC,iBAAO,qCAAqC,MAAM,IAAI,GAAG;AACvD,kBAAM,qBAAqB,iDAAiD,UAAU;AACtF,iEAAqD,QAAQ,kBAAkB;;;MAGrF;AAEA,eAAS,mDAAmD,YACA,cACA,oBAAsC;AAGhG,+DAAuD,YAAY,cAAc,kBAAkB;AAEnG,YAAI,mBAAmB,eAAe,QAAQ;AAC5C,qEAA2D,YAAY,kBAAkB;AACzF,2EAAiE,UAAU;AAC3E;;AAGF,YAAI,mBAAmB,cAAc,mBAAmB,aAAa;AAGnE;;AAGF,yDAAiD,UAAU;AAE3D,cAAM,gBAAgB,mBAAmB,cAAc,mBAAmB;AAC1E,YAAI,gBAAgB,GAAG;AACrB,gBAAM,MAAM,mBAAmB,aAAa,mBAAmB;AAC/D,gEACE,YACA,mBAAmB,QACnB,MAAM,eACN,aAAa;;AAIjB,2BAAmB,eAAe;AAClC,6DAAqD,WAAW,+BAA+B,kBAAkB;AAEjH,yEAAiE,UAAU;MAC7E;AAEA,eAAS,4CAA4C,YAA0C,cAAoB;AACjH,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AAGzD,0DAAkD,UAAU;AAE5D,cAAM,QAAQ,WAAW,8BAA8B;AACvD,YAAI,UAAU,UAAU;AAEtB,2DAAiD,YAAY,eAAe;eACvE;AAGL,6DAAmD,YAAY,cAAc,eAAe;;AAG9F,qDAA6C,UAAU;MACzD;AAEA,eAAS,iDACP,YAAwC;AAGxC,cAAM,aAAa,WAAW,kBAAkB,MAAK;AACrD,eAAO;MACT;AAEA,eAAS,2CAA2C,YAAwC;AAC1F,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC,iBAAO;;AAGT,YAAI,WAAW,iBAAiB;AAC9B,iBAAO;;AAGT,YAAI,CAAC,WAAW,UAAU;AACxB,iBAAO;;AAGT,YAAI,+BAA+B,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAC1F,iBAAO;;AAGT,YAAI,4BAA4B,MAAM,KAAK,qCAAqC,MAAM,IAAI,GAAG;AAC3F,iBAAO;;AAGT,cAAM,cAAc,2CAA2C,UAAU;AAEzE,YAAI,cAAe,GAAG;AACpB,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,4CAA4C,YAAwC;AAC3F,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;MAChC;AAIM,eAAU,kCAAkC,YAAwC;AACxF,cAAM,SAAS,WAAW;AAE1B,YAAI,WAAW,mBAAmB,OAAO,WAAW,YAAY;AAC9D;;AAGF,YAAI,WAAW,kBAAkB,GAAG;AAClC,qBAAW,kBAAkB;AAE7B;;AAGF,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,gBAAM,uBAAuB,WAAW,kBAAkB,KAAI;AAC9D,cAAI,qBAAqB,cAAc,qBAAqB,gBAAgB,GAAG;AAC7E,kBAAMA,KAAI,IAAI,UAAU,yDAAyD;AACjF,8CAAkC,YAAYA,EAAC;AAE/C,kBAAMA;;;AAIV,oDAA4C,UAAU;AACtD,4BAAoB,MAAM;MAC5B;AAEgB,eAAA,oCACd,YACA,OAAiC;AAEjC,cAAM,SAAS,WAAW;AAE1B,YAAI,WAAW,mBAAmB,OAAO,WAAW,YAAY;AAC9D;;AAGF,cAAM,EAAE,QAAQ,YAAY,WAAU,IAAK;AAC3C,YAAI,iBAAiB,MAAM,GAAG;AAC5B,gBAAM,IAAI,UAAU,sDAAuD;;AAE7E,cAAM,oBAAoB,oBAAoB,MAAM;AAEpD,YAAI,WAAW,kBAAkB,SAAS,GAAG;AAC3C,gBAAM,uBAAuB,WAAW,kBAAkB,KAAI;AAC9D,cAAI,iBAAiB,qBAAqB,MAAM,GAAG;AACjD,kBAAM,IAAI,UACR,4FAA6F;;AAGjG,4DAAkD,UAAU;AAC5D,+BAAqB,SAAS,oBAAoB,qBAAqB,MAAM;AAC7E,cAAI,qBAAqB,eAAe,QAAQ;AAC9C,uEAA2D,YAAY,oBAAoB;;;AAI/F,YAAI,+BAA+B,MAAM,GAAG;AAC1C,oEAA0D,UAAU;AACpE,cAAI,iCAAiC,MAAM,MAAM,GAAG;AAElD,4DAAgD,YAAY,mBAAmB,YAAY,UAAU;iBAChG;AAEL,gBAAI,WAAW,kBAAkB,SAAS,GAAG;AAE3C,+DAAiD,UAAU;;AAE7D,kBAAM,kBAAkB,IAAI,WAAW,mBAAmB,YAAY,UAAU;AAChF,6CAAiC,QAAQ,iBAA0C,KAAK;;mBAEjF,4BAA4B,MAAM,GAAG;AAE9C,0DAAgD,YAAY,mBAAmB,YAAY,UAAU;AACrG,2EAAiE,UAAU;eACtE;AAEL,0DAAgD,YAAY,mBAAmB,YAAY,UAAU;;AAGvG,qDAA6C,UAAU;MACzD;AAEgB,eAAA,kCAAkC,YAA0CA,IAAM;AAChG,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC;;AAGF,0DAAkD,UAAU;AAE5D,mBAAW,UAAU;AACrB,oDAA4C,UAAU;AACtD,4BAAoB,QAAQA,EAAC;MAC/B;AAEgB,eAAA,qDACd,YACA,aAA+C;AAI/C,cAAM,QAAQ,WAAW,OAAO,MAAK;AACrC,mBAAW,mBAAmB,MAAM;AAEpC,qDAA6C,UAAU;AAEvD,cAAM,OAAO,IAAI,WAAW,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU;AAC5E,oBAAY,YAAY,IAA6B;MACvD;AAEM,eAAU,2CACd,YAAwC;AAExC,YAAI,WAAW,iBAAiB,QAAQ,WAAW,kBAAkB,SAAS,GAAG;AAC/E,gBAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,gBAAM,OAAO,IAAI,WAAW,gBAAgB,QAChB,gBAAgB,aAAa,gBAAgB,aAC7C,gBAAgB,aAAa,gBAAgB,WAAW;AAEpF,gBAAM,cAAyC,OAAO,OAAO,0BAA0B,SAAS;AAChG,yCAA+B,aAAa,YAAY,IAA6B;AACrF,qBAAW,eAAe;;AAE5B,eAAO,WAAW;MACpB;AAEA,eAAS,2CAA2C,YAAwC;AAC1F,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,WAAW;AACvB,iBAAO;;AAET,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,WAAW,eAAe,WAAW;MAC9C;AAEgB,eAAA,oCAAoC,YAA0C,cAAoB;AAGhH,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,UAAU;AACtB,cAAI,iBAAiB,GAAG;AACtB,kBAAM,IAAI,UAAU,kEAAkE;;eAEnF;AAEL,cAAI,iBAAiB,GAAG;AACtB,kBAAM,IAAI,UAAU,iFAAiF;;AAEvG,cAAI,gBAAgB,cAAc,eAAe,gBAAgB,YAAY;AAC3E,kBAAM,IAAI,WAAW,2BAA2B;;;AAIpD,wBAAgB,SAAS,oBAAoB,gBAAgB,MAAM;AAEnE,oDAA4C,YAAY,YAAY;MACtE;AAEgB,eAAA,+CAA+C,YACA,MAAgC;AAI7F,cAAM,kBAAkB,WAAW,kBAAkB,KAAI;AACzD,cAAM,QAAQ,WAAW,8BAA8B;AAEvD,YAAI,UAAU,UAAU;AACtB,cAAI,KAAK,eAAe,GAAG;AACzB,kBAAM,IAAI,UAAU,kFAAmF;;eAEpG;AAEL,cAAI,KAAK,eAAe,GAAG;AACzB,kBAAM,IAAI,UACR,iGAAkG;;;AAKxG,YAAI,gBAAgB,aAAa,gBAAgB,gBAAgB,KAAK,YAAY;AAChF,gBAAM,IAAI,WAAW,yDAAyD;;AAEhF,YAAI,gBAAgB,qBAAqB,KAAK,OAAO,YAAY;AAC/D,gBAAM,IAAI,WAAW,4DAA4D;;AAEnF,YAAI,gBAAgB,cAAc,KAAK,aAAa,gBAAgB,YAAY;AAC9E,gBAAM,IAAI,WAAW,yDAAyD;;AAGhF,cAAM,iBAAiB,KAAK;AAC5B,wBAAgB,SAAS,oBAAoB,KAAK,MAAM;AACxD,oDAA4C,YAAY,cAAc;MACxE;AAEgB,eAAA,kCAAkC,QACA,YACA,gBACA,eACA,iBACA,eACA,uBAAyC;AAOzF,mBAAW,gCAAgC;AAE3C,mBAAW,aAAa;AACxB,mBAAW,WAAW;AAEtB,mBAAW,eAAe;AAG1B,mBAAW,SAAS,WAAW,kBAAkB;AACjD,mBAAW,UAAU;AAErB,mBAAW,kBAAkB;AAC7B,mBAAW,WAAW;AAEtB,mBAAW,eAAe;AAE1B,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAE9B,mBAAW,yBAAyB;AAEpC,mBAAW,oBAAoB,IAAI,YAAW;AAE9C,eAAO,4BAA4B;AAEnC,cAAM,cAAc,eAAc;AAClC,oBACE,oBAAoB,WAAW,GAC/B,MAAK;AACH,qBAAW,WAAW;AAKtB,uDAA6C,UAAU;AACvD,iBAAO;WAET,CAAAE,OAAI;AACF,4CAAkC,YAAYA,EAAC;AAC/C,iBAAO;QACT,CAAC;MAEL;eAEgB,sDACd,QACA,sBACA,eAAqB;AAErB,cAAM,aAA2C,OAAO,OAAO,6BAA6B,SAAS;AAErG,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,qBAAqB,UAAU,QAAW;AAC5C,2BAAiB,MAAM,qBAAqB,MAAO,UAAU;eACxD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,qBAAqB,SAAS,QAAW;AAC3C,0BAAgB,MAAM,qBAAqB,KAAM,UAAU;eACtD;AACL,0BAAgB,MAAM,oBAAoB,MAAS;;AAErD,YAAI,qBAAqB,WAAW,QAAW;AAC7C,4BAAkB,YAAU,qBAAqB,OAAQ,MAAM;eAC1D;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,cAAM,wBAAwB,qBAAqB;AACnD,YAAI,0BAA0B,GAAG;AAC/B,gBAAM,IAAI,UAAU,8CAA8C;;AAGpE,0CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,qBAAqB;MAE5G;AAEA,eAAS,+BAA+B,SACA,YACA,MAAgC;AAKtE,gBAAQ,0CAA0C;AAClD,gBAAQ,QAAQ;MAClB;AAIA,eAAS,+BAA+B,MAAY;AAClD,eAAO,IAAI,UACT,uCAAuC,IAAI,kDAAkD;MACjG;AAIA,eAAS,wCAAwC,MAAY;AAC3D,eAAO,IAAI,UACT,0CAA0C,IAAI,qDAAqD;MACvG;AC1nCgB,eAAA,qBAAqB,SACA,SAAe;AAClD,yBAAiB,SAAS,OAAO;AACjC,cAAM,OAAO,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACtB,eAAO;UACL,MAAM,SAAS,SAAY,SAAY,gCAAgC,MAAM,GAAG,OAAO,yBAAyB;;MAEpH;AAEA,eAAS,gCAAgC,MAAc,SAAe;AACpE,eAAO,GAAG,IAAI;AACd,YAAI,SAAS,QAAQ;AACnB,gBAAM,IAAI,UAAU,GAAG,OAAO,KAAK,IAAI,iEAAiE;;AAE1G,eAAO;MACT;AAEgB,eAAA,uBACd,SACA,SAAe;;AAEf,yBAAiB,SAAS,OAAO;AACjC,cAAM,OAAML,MAAA,YAAA,QAAA,YAAA,SAAA,SAAA,QAAS,SAAO,QAAAA,QAAA,SAAAA,MAAA;AAC5B,eAAO;UACL,KAAK,wCACH,KACA,GAAG,OAAO,wBAAwB;;MAGxC;ACKM,eAAU,gCAAgC,QAA0B;AACxE,eAAO,IAAI,yBAAyB,MAAoC;MAC1E;AAIgB,eAAA,iCACd,QACA,iBAAmC;AAKlC,eAAO,QAAsC,kBAAkB,KAAK,eAAe;MACtF;eAEgB,qCAAqC,QACA,OACA,MAAa;AAChE,cAAM,SAAS,OAAO;AAItB,cAAM,kBAAkB,OAAO,kBAAkB,MAAK;AACtD,YAAI,MAAM;AACR,0BAAgB,YAAY,KAAK;eAC5B;AACL,0BAAgB,YAAY,KAAK;;MAErC;AAEM,eAAU,qCAAqC,QAA0B;AAC7E,eAAQ,OAAO,QAAqC,kBAAkB;MACxE;AAEM,eAAU,4BAA4B,QAA0B;AACpE,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB,iBAAO;;AAGT,YAAI,CAAC,2BAA2B,MAAM,GAAG;AACvC,iBAAO;;AAGT,eAAO;MACT;YAiBa,yBAAwB;QAYnC,YAAY,QAAkC;AAC5C,iCAAuB,QAAQ,GAAG,0BAA0B;AAC5D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,cAAI,CAAC,+BAA+B,OAAO,yBAAyB,GAAG;AACrE,kBAAM,IAAI,UAAU,6FACV;;AAGZ,gDAAsC,MAAM,MAAM;AAElD,eAAK,oBAAoB,IAAI,YAAW;;;;;;QAO1C,IAAI,SAAM;AACR,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,QAAQ,CAAC;;AAGpE,iBAAO,KAAK;;;;;QAMd,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,QAAQ,CAAC;;AAGpE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,QAAQ,CAAC;;AAG1D,iBAAO,kCAAkC,MAAM,MAAM;;QAYvD,KACE,MACA,aAAqE,CAAA,GAAE;AAEvE,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,mBAAO,oBAAoB,8BAA8B,MAAM,CAAC;;AAGlE,cAAI,CAAC,YAAY,OAAO,IAAI,GAAG;AAC7B,mBAAO,oBAAoB,IAAI,UAAU,mCAAmC,CAAC;;AAE/E,cAAI,KAAK,eAAe,GAAG;AACzB,mBAAO,oBAAoB,IAAI,UAAU,oCAAoC,CAAC;;AAEhF,cAAI,KAAK,OAAO,eAAe,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,6CAA6C,CAAC;;AAEzF,cAAI,iBAAiB,KAAK,MAAM,GAAG;AACjC,mBAAO,oBAAoB,IAAI,UAAU,iCAAkC,CAAC;;AAG9E,cAAI;AACJ,cAAI;AACF,sBAAU,uBAAuB,YAAY,SAAS;mBAC/CG,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,MAAM,QAAQ;AACpB,cAAI,QAAQ,GAAG;AACb,mBAAO,oBAAoB,IAAI,UAAU,oCAAoC,CAAC;;AAEhF,cAAI,CAAC,WAAW,IAAI,GAAG;AACrB,gBAAI,MAAO,KAA+B,QAAQ;AAChD,qBAAO,oBAAoB,IAAI,WAAW,yDAA0D,CAAC;;qBAE9F,MAAM,KAAK,YAAY;AAChC,mBAAO,oBAAoB,IAAI,WAAW,6DAA8D,CAAC;;AAG3G,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,oBAAoB,WAAW,CAAC;;AAG7D,cAAI;AACJ,cAAI;AACJ,gBAAM,UAAU,WAA4C,CAAC,SAAS,WAAU;AAC9E,6BAAiB;AACjB,4BAAgB;UAClB,CAAC;AACD,gBAAM,kBAAsC;YAC1C,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,MAAK,CAAE;YAClE,aAAa,WAAS,eAAe,EAAE,OAAO,OAAO,MAAM,KAAI,CAAE;YACjE,aAAa,CAAAA,OAAK,cAAcA,EAAC;;AAEnC,uCAA6B,MAAM,MAAM,KAAK,eAAe;AAC7D,iBAAO;;;;;;;;;;;QAYT,cAAW;AACT,cAAI,CAAC,2BAA2B,IAAI,GAAG;AACrC,kBAAM,8BAA8B,aAAa;;AAGnD,cAAI,KAAK,yBAAyB,QAAW;AAC3C;;AAGF,0CAAgC,IAAI;;MAEvC;AAED,aAAO,iBAAiB,yBAAyB,WAAW;QAC1D,QAAQ,EAAE,YAAY,KAAI;QAC1B,MAAM,EAAE,YAAY,KAAI;QACxB,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,yBAAyB,UAAU,QAAQ,QAAQ;AACnE,sBAAgB,yBAAyB,UAAU,MAAM,MAAM;AAC/D,sBAAgB,yBAAyB,UAAU,aAAa,aAAa;AAC7E,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,yBAAyB,WAAW,OAAO,aAAa;UAC5E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIM,eAAU,2BAA2BJ,IAAM;AAC/C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,mBAAmB,GAAG;AACjE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEM,eAAU,6BACd,QACA,MACA,KACA,iBAAmC;AAEnC,cAAM,SAAS,OAAO;AAItB,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,WAAW;AAC/B,0BAAgB,YAAY,OAAO,YAAY;eAC1C;AACL,+CACE,OAAO,2BACP,MACA,KACA,eAAe;;MAGrB;AAEM,eAAU,gCAAgC,QAAgC;AAC9E,2CAAmC,MAAM;AACzC,cAAMI,KAAI,IAAI,UAAU,qBAAqB;AAC7C,sDAA8C,QAAQA,EAAC;MACzD;AAEgB,eAAA,8CAA8C,QAAkCA,IAAM;AACpG,cAAM,mBAAmB,OAAO;AAChC,eAAO,oBAAoB,IAAI,YAAW;AAC1C,yBAAiB,QAAQ,qBAAkB;AACzC,0BAAgB,YAAYA,EAAC;QAC/B,CAAC;MACH;AAIA,eAAS,8BAA8B,MAAY;AACjD,eAAO,IAAI,UACT,sCAAsC,IAAI,iDAAiD;MAC/F;ACjUgB,eAAA,qBAAqB,UAA2B,YAAkB;AAChF,cAAM,EAAE,cAAa,IAAK;AAE1B,YAAI,kBAAkB,QAAW;AAC/B,iBAAO;;AAGT,YAAI,YAAY,aAAa,KAAK,gBAAgB,GAAG;AACnD,gBAAM,IAAI,WAAW,uBAAuB;;AAG9C,eAAO;MACT;AAEM,eAAU,qBAAwB,UAA4B;AAClE,cAAM,EAAE,KAAI,IAAK;AAEjB,YAAI,CAAC,MAAM;AACT,iBAAO,MAAM;;AAGf,eAAO;MACT;ACtBgB,eAAA,uBAA0B,MACA,SAAe;AACvD,yBAAiB,MAAM,OAAO;AAC9B,cAAM,gBAAgB,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AAC5B,cAAM,OAAO,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACnB,eAAO;UACL,eAAe,kBAAkB,SAAY,SAAY,0BAA0B,aAAa;UAChG,MAAM,SAAS,SAAY,SAAY,2BAA2B,MAAM,GAAG,OAAO,yBAAyB;;MAE/G;AAEA,eAAS,2BAA8B,IACA,SAAe;AACpD,uBAAe,IAAI,OAAO;AAC1B,eAAO,WAAS,0BAA0B,GAAG,KAAK,CAAC;MACrD;ACNgB,eAAA,sBAAyB,UACA,SAAe;AACtD,yBAAiB,UAAU,OAAO;AAClC,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,eAAO;UACL,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F,OAAO,UAAU,SACf,SACA,mCAAmC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC3F;;MAEJ;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,MAAM,YAAY,IAAI,UAAU,CAAA,CAAE;MAC3C;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAgD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAChG;AAEA,eAAS,mCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,OAAU,eAAgD,YAAY,IAAI,UAAU,CAAC,OAAO,UAAU,CAAC;MACjH;ACrEgB,eAAA,qBAAqBJ,IAAY,SAAe;AAC9D,YAAI,CAAC,iBAAiBA,EAAC,GAAG;AACxB,gBAAM,IAAI,UAAU,GAAG,OAAO,2BAA2B;;MAE7D;AC2BM,eAAUO,eAAc,OAAc;AAC1C,YAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,iBAAO;;AAET,YAAI;AACF,iBAAO,OAAQ,MAAsB,YAAY;iBACjDN,KAAM;AAEN,iBAAO;;MAEX;AAsBA,YAAM,0BAA0B,OAAQ,oBAA4B;eAOpD,wBAAqB;AACnC,YAAI,yBAAyB;AAC3B,iBAAO,IAAK,gBAA8C;;AAE5D,eAAO;MACT;MCnBA,MAAM,eAAc;QAuBlB,YAAY,oBAA0D,CAAA,GAC1D,cAAqD,CAAA,GAAE;AACjE,cAAI,sBAAsB,QAAW;AACnC,gCAAoB;iBACf;AACL,yBAAa,mBAAmB,iBAAiB;;AAGnD,gBAAM,WAAW,uBAAuB,aAAa,kBAAkB;AACvE,gBAAM,iBAAiB,sBAAsB,mBAAmB,iBAAiB;AAEjF,mCAAyB,IAAI;AAE7B,gBAAM,OAAO,eAAe;AAC5B,cAAI,SAAS,QAAW;AACtB,kBAAM,IAAI,WAAW,2BAA2B;;AAGlD,gBAAM,gBAAgB,qBAAqB,QAAQ;AACnD,gBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AAEtD,iEAAuD,MAAM,gBAAgB,eAAe,aAAa;;;;;QAM3G,IAAI,SAAM;AACR,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMO,4BAA0B,QAAQ;;AAG1C,iBAAO,uBAAuB,IAAI;;;;;;;;;;;QAYpC,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,OAAO,CAAC;;AAG/D,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,iDAAiD,CAAC;;AAG7F,iBAAO,oBAAoB,MAAM,MAAM;;;;;;;;;;QAWzC,QAAK;AACH,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,OAAO,CAAC;;AAG/D,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,iDAAiD,CAAC;;AAG7F,cAAI,oCAAoC,IAAI,GAAG;AAC7C,mBAAO,oBAAoB,IAAI,UAAU,wCAAwC,CAAC;;AAGpF,iBAAO,oBAAoB,IAAI;;;;;;;;;;QAWjC,YAAS;AACP,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,WAAW;;AAG7C,iBAAO,mCAAmC,IAAI;;MAEjD;AAED,aAAO,iBAAiB,eAAe,WAAW;QAChD,OAAO,EAAE,YAAY,KAAI;QACzB,OAAO,EAAE,YAAY,KAAI;QACzB,WAAW,EAAE,YAAY,KAAI;QAC7B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgB,eAAe,UAAU,OAAO,OAAO;AACvD,sBAAgB,eAAe,UAAU,OAAO,OAAO;AACvD,sBAAgB,eAAe,UAAU,WAAW,WAAW;AAC/D,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,eAAe,WAAW,OAAO,aAAa;UAClE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AA0BA,eAAS,mCAAsC,QAAyB;AACtE,eAAO,IAAI,4BAA4B,MAAM;MAC/C;AAGA,eAAS,qBAAwB,gBACA,gBACA,gBACA,gBACA,gBAAgB,GAChB,gBAAgD,MAAM,GAAC;AAGtF,cAAM,SAA4B,OAAO,OAAO,eAAe,SAAS;AACxE,iCAAyB,MAAM;AAE/B,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAE9G,6CAAqC,QAAQ,YAAY,gBAAgB,gBAAgB,gBACpD,gBAAgB,eAAe,aAAa;AACjF,eAAO;MACT;AAEA,eAAS,yBAA4B,QAAyB;AAC5D,eAAO,SAAS;AAIhB,eAAO,eAAe;AAEtB,eAAO,UAAU;AAIjB,eAAO,4BAA4B;AAInC,eAAO,iBAAiB,IAAI,YAAW;AAIvC,eAAO,wBAAwB;AAI/B,eAAO,gBAAgB;AAIvB,eAAO,wBAAwB;AAG/B,eAAO,uBAAuB;AAG9B,eAAO,gBAAgB;MACzB;AAEA,eAAS,iBAAiBR,IAAU;AAClC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,uBAAuB,QAAsB;AAGpD,YAAI,OAAO,YAAY,QAAW;AAChC,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,oBAAoB,QAAwB,QAAW;;AAC9D,YAAI,OAAO,WAAW,YAAY,OAAO,WAAW,WAAW;AAC7D,iBAAO,oBAAoB,MAAS;;AAEtC,eAAO,0BAA0B,eAAe;AAChD,SAAAC,MAAA,OAAO,0BAA0B,sBAAgB,QAAAA,QAAA,SAAA,SAAAA,IAAE,MAAM,MAAM;AAK/D,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,iBAAO,oBAAoB,MAAS;;AAEtC,YAAI,OAAO,yBAAyB,QAAW;AAC7C,iBAAO,OAAO,qBAAqB;;AAKrC,YAAI,qBAAqB;AACzB,YAAI,UAAU,YAAY;AACxB,+BAAqB;AAErB,mBAAS;;AAGX,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,iBAAO,uBAAuB;YAC5B,UAAU;YACV,UAAU;YACV,SAAS;YACT,SAAS;YACT,qBAAqB;;QAEzB,CAAC;AACD,eAAO,qBAAsB,WAAW;AAExC,YAAI,CAAC,oBAAoB;AACvB,sCAA4B,QAAQ,MAAM;;AAG5C,eAAO;MACT;AAEA,eAAS,oBAAoB,QAA2B;AACtD,cAAM,QAAQ,OAAO;AACrB,YAAI,UAAU,YAAY,UAAU,WAAW;AAC7C,iBAAO,oBAAoB,IAAI,UAC7B,kBAAkB,KAAK,2DAA2D,CAAC;;AAMvF,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,gBAAM,eAA6B;YACjC,UAAU;YACV,SAAS;;AAGX,iBAAO,gBAAgB;QACzB,CAAC;AAED,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,OAAO,iBAAiB,UAAU,YAAY;AACxE,2CAAiC,MAAM;;AAGzC,6CAAqC,OAAO,yBAAyB;AAErE,eAAO;MACT;AAIA,eAAS,8BAA8B,QAAsB;AAI3D,cAAM,UAAU,WAAsB,CAAC,SAAS,WAAU;AACxD,gBAAM,eAA6B;YACjC,UAAU;YACV,SAAS;;AAGX,iBAAO,eAAe,KAAK,YAAY;QACzC,CAAC;AAED,eAAO;MACT;AAEA,eAAS,gCAAgC,QAAwB,OAAU;AACzE,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY;AACxB,sCAA4B,QAAQ,KAAK;AACzC;;AAIF,qCAA6B,MAAM;MACrC;AAEA,eAAS,4BAA4B,QAAwB,QAAW;AAItE,cAAM,aAAa,OAAO;AAG1B,eAAO,SAAS;AAChB,eAAO,eAAe;AACtB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,gEAAsD,QAAQ,MAAM;;AAGtE,YAAI,CAAC,yCAAyC,MAAM,KAAK,WAAW,UAAU;AAC5E,uCAA6B,MAAM;;MAEvC;AAEA,eAAS,6BAA6B,QAAsB;AAG1D,eAAO,SAAS;AAChB,eAAO,0BAA0B,UAAU,EAAC;AAE5C,cAAM,cAAc,OAAO;AAC3B,eAAO,eAAe,QAAQ,kBAAe;AAC3C,uBAAa,QAAQ,WAAW;QAClC,CAAC;AACD,eAAO,iBAAiB,IAAI,YAAW;AAEvC,YAAI,OAAO,yBAAyB,QAAW;AAC7C,4DAAkD,MAAM;AACxD;;AAGF,cAAM,eAAe,OAAO;AAC5B,eAAO,uBAAuB;AAE9B,YAAI,aAAa,qBAAqB;AACpC,uBAAa,QAAQ,WAAW;AAChC,4DAAkD,MAAM;AACxD;;AAGF,cAAM,UAAU,OAAO,0BAA0B,UAAU,EAAE,aAAa,OAAO;AACjF,oBACE,SACA,MAAK;AACH,uBAAa,SAAQ;AACrB,4DAAkD,MAAM;AACxD,iBAAO;QACT,GACA,CAAC,WAAe;AACd,uBAAa,QAAQ,MAAM;AAC3B,4DAAkD,MAAM;AACxD,iBAAO;QACT,CAAC;MACL;AAEA,eAAS,kCAAkC,QAAsB;AAE/D,eAAO,sBAAuB,SAAS,MAAS;AAChD,eAAO,wBAAwB;MACjC;AAEA,eAAS,2CAA2C,QAAwB,OAAU;AAEpF,eAAO,sBAAuB,QAAQ,KAAK;AAC3C,eAAO,wBAAwB;AAI/B,wCAAgC,QAAQ,KAAK;MAC/C;AAEA,eAAS,kCAAkC,QAAsB;AAE/D,eAAO,sBAAuB,SAAS,MAAS;AAChD,eAAO,wBAAwB;AAE/B,cAAM,QAAQ,OAAO;AAIrB,YAAI,UAAU,YAAY;AAExB,iBAAO,eAAe;AACtB,cAAI,OAAO,yBAAyB,QAAW;AAC7C,mBAAO,qBAAqB,SAAQ;AACpC,mBAAO,uBAAuB;;;AAIlC,eAAO,SAAS;AAEhB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,4CAAkC,MAAM;;MAK5C;AAEA,eAAS,2CAA2C,QAAwB,OAAU;AAEpF,eAAO,sBAAuB,QAAQ,KAAK;AAC3C,eAAO,wBAAwB;AAK/B,YAAI,OAAO,yBAAyB,QAAW;AAC7C,iBAAO,qBAAqB,QAAQ,KAAK;AACzC,iBAAO,uBAAuB;;AAEhC,wCAAgC,QAAQ,KAAK;MAC/C;AAGA,eAAS,oCAAoC,QAAsB;AACjE,YAAI,OAAO,kBAAkB,UAAa,OAAO,0BAA0B,QAAW;AACpF,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,yCAAyC,QAAsB;AACtE,YAAI,OAAO,0BAA0B,UAAa,OAAO,0BAA0B,QAAW;AAC5F,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,uCAAuC,QAAsB;AAGpE,eAAO,wBAAwB,OAAO;AACtC,eAAO,gBAAgB;MACzB;AAEA,eAAS,4CAA4C,QAAsB;AAGzE,eAAO,wBAAwB,OAAO,eAAe,MAAK;MAC5D;AAEA,eAAS,kDAAkD,QAAsB;AAE/E,YAAI,OAAO,kBAAkB,QAAW;AAGtC,iBAAO,cAAc,QAAQ,OAAO,YAAY;AAChD,iBAAO,gBAAgB;;AAEzB,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,QAAW;AACxB,2CAAiC,QAAQ,OAAO,YAAY;;MAEhE;AAEA,eAAS,iCAAiC,QAAwB,cAAqB;AAIrF,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,iBAAiB,OAAO,eAAe;AACjE,cAAI,cAAc;AAChB,2CAA+B,MAAM;iBAChC;AAGL,6CAAiC,MAAM;;;AAI3C,eAAO,gBAAgB;MACzB;YAOa,4BAA2B;QAoBtC,YAAY,QAAyB;AACnC,iCAAuB,QAAQ,GAAG,6BAA6B;AAC/D,+BAAqB,QAAQ,iBAAiB;AAE9C,cAAI,uBAAuB,MAAM,GAAG;AAClC,kBAAM,IAAI,UAAU,6EAA6E;;AAGnG,eAAK,uBAAuB;AAC5B,iBAAO,UAAU;AAEjB,gBAAM,QAAQ,OAAO;AAErB,cAAI,UAAU,YAAY;AACxB,gBAAI,CAAC,oCAAoC,MAAM,KAAK,OAAO,eAAe;AACxE,kDAAoC,IAAI;mBACnC;AACL,4DAA8C,IAAI;;AAGpD,iDAAqC,IAAI;qBAChC,UAAU,YAAY;AAC/B,0DAA8C,MAAM,OAAO,YAAY;AACvE,iDAAqC,IAAI;qBAChC,UAAU,UAAU;AAC7B,0DAA8C,IAAI;AAClD,2DAA+C,IAAI;iBAC9C;AAGL,kBAAM,cAAc,OAAO;AAC3B,0DAA8C,MAAM,WAAW;AAC/D,2DAA+C,MAAM,WAAW;;;;;;;QAQpE,IAAI,SAAM;AACR,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,QAAQ,CAAC;;AAGvE,iBAAO,KAAK;;;;;;;;;;QAWd,IAAI,cAAW;AACb,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,cAAI,KAAK,yBAAyB,QAAW;AAC3C,kBAAM,2BAA2B,aAAa;;AAGhD,iBAAO,0CAA0C,IAAI;;;;;;;;;;QAWvD,IAAI,QAAK;AACP,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,iBAAO,KAAK;;;;;QAMd,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,2BAA2B,OAAO,CAAC;;AAGhE,iBAAO,iCAAiC,MAAM,MAAM;;;;;QAMtD,QAAK;AACH,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,gBAAM,SAAS,KAAK;AAEpB,cAAI,WAAW,QAAW;AACxB,mBAAO,oBAAoB,2BAA2B,OAAO,CAAC;;AAGhE,cAAI,oCAAoC,MAAM,GAAG;AAC/C,mBAAO,oBAAoB,IAAI,UAAU,wCAAwC,CAAC;;AAGpF,iBAAO,iCAAiC,IAAI;;;;;;;;;;;;QAa9C,cAAW;AACT,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,kBAAM,iCAAiC,aAAa;;AAGtD,gBAAM,SAAS,KAAK;AAEpB,cAAI,WAAW,QAAW;AACxB;;AAKF,6CAAmC,IAAI;;QAazC,MAAM,QAAW,QAAU;AACzB,cAAI,CAAC,8BAA8B,IAAI,GAAG;AACxC,mBAAO,oBAAoB,iCAAiC,OAAO,CAAC;;AAGtE,cAAI,KAAK,yBAAyB,QAAW;AAC3C,mBAAO,oBAAoB,2BAA2B,UAAU,CAAC;;AAGnE,iBAAO,iCAAiC,MAAM,KAAK;;MAEtD;AAED,aAAO,iBAAiB,4BAA4B,WAAW;QAC7D,OAAO,EAAE,YAAY,KAAI;QACzB,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;QAC/B,OAAO,EAAE,YAAY,KAAI;QACzB,QAAQ,EAAE,YAAY,KAAI;QAC1B,aAAa,EAAE,YAAY,KAAI;QAC/B,OAAO,EAAE,YAAY,KAAI;MAC1B,CAAA;AACD,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,sBAAgB,4BAA4B,UAAU,aAAa,aAAa;AAChF,sBAAgB,4BAA4B,UAAU,OAAO,OAAO;AACpE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,4BAA4B,WAAW,OAAO,aAAa;UAC/E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,8BAAuCD,IAAM;AACpD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,sBAAsB,GAAG;AACpE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAIA,eAAS,iCAAiC,QAAqC,QAAW;AACxF,cAAM,SAAS,OAAO;AAItB,eAAO,oBAAoB,QAAQ,MAAM;MAC3C;AAEA,eAAS,iCAAiC,QAAmC;AAC3E,cAAM,SAAS,OAAO;AAItB,eAAO,oBAAoB,MAAM;MACnC;AAEA,eAAS,qDAAqD,QAAmC;AAC/F,cAAM,SAAS,OAAO;AAItB,cAAM,QAAQ,OAAO;AACrB,YAAI,oCAAoC,MAAM,KAAK,UAAU,UAAU;AACrE,iBAAO,oBAAoB,MAAS;;AAGtC,YAAI,UAAU,WAAW;AACvB,iBAAO,oBAAoB,OAAO,YAAY;;AAKhD,eAAO,iCAAiC,MAAM;MAChD;AAEA,eAAS,uDAAuD,QAAqC,OAAU;AAC7G,YAAI,OAAO,wBAAwB,WAAW;AAC5C,2CAAiC,QAAQ,KAAK;eACzC;AACL,oDAA0C,QAAQ,KAAK;;MAE3D;AAEA,eAAS,sDAAsD,QAAqC,OAAU;AAC5G,YAAI,OAAO,uBAAuB,WAAW;AAC3C,0CAAgC,QAAQ,KAAK;eACxC;AACL,mDAAyC,QAAQ,KAAK;;MAE1D;AAEA,eAAS,0CAA0C,QAAmC;AACpF,cAAM,SAAS,OAAO;AACtB,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,aAAa,UAAU,YAAY;AAC/C,iBAAO;;AAGT,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,8CAA8C,OAAO,yBAAyB;MACvF;AAEA,eAAS,mCAAmC,QAAmC;AAC7E,cAAM,SAAS,OAAO;AAItB,cAAM,gBAAgB,IAAI,UACxB,kFAAkF;AAEpF,8DAAsD,QAAQ,aAAa;AAI3E,+DAAuD,QAAQ,aAAa;AAE5E,eAAO,UAAU;AACjB,eAAO,uBAAuB;MAChC;AAEA,eAAS,iCAAoC,QAAwC,OAAQ;AAC3F,cAAM,SAAS,OAAO;AAItB,cAAM,aAAa,OAAO;AAE1B,cAAM,YAAY,4CAA4C,YAAY,KAAK;AAE/E,YAAI,WAAW,OAAO,sBAAsB;AAC1C,iBAAO,oBAAoB,2BAA2B,UAAU,CAAC;;AAGnE,cAAM,QAAQ,OAAO;AACrB,YAAI,UAAU,WAAW;AACvB,iBAAO,oBAAoB,OAAO,YAAY;;AAEhD,YAAI,oCAAoC,MAAM,KAAK,UAAU,UAAU;AACrE,iBAAO,oBAAoB,IAAI,UAAU,0DAA0D,CAAC;;AAEtG,YAAI,UAAU,YAAY;AACxB,iBAAO,oBAAoB,OAAO,YAAY;;AAKhD,cAAM,UAAU,8BAA8B,MAAM;AAEpD,6CAAqC,YAAY,OAAO,SAAS;AAEjE,eAAO;MACT;AAEA,YAAM,gBAA+B,CAAA;YASxB,gCAA+B;QAwB1C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;;;;;QAU3C,IAAI,cAAW;AACb,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMS,uCAAqC,aAAa;;AAE1D,iBAAO,KAAK;;;;;QAMd,IAAI,SAAM;AACR,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,QAAQ;;AAErD,cAAI,KAAK,qBAAqB,QAAW;AAIvC,kBAAM,IAAI,UAAU,mEAAmE;;AAEzF,iBAAO,KAAK,iBAAiB;;;;;;;;;QAU/B,MAAML,KAAS,QAAS;AACtB,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMK,uCAAqC,OAAO;;AAEpD,gBAAM,QAAQ,KAAK,0BAA0B;AAC7C,cAAI,UAAU,YAAY;AAGxB;;AAGF,+CAAqC,MAAML,EAAC;;;QAI9C,CAAC,UAAU,EAAE,QAAW;AACtB,gBAAM,SAAS,KAAK,gBAAgB,MAAM;AAC1C,yDAA+C,IAAI;AACnD,iBAAO;;;QAIT,CAAC,UAAU,IAAC;AACV,qBAAW,IAAI;;MAElB;AAED,aAAO,iBAAiB,gCAAgC,WAAW;QACjE,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;QAC1B,OAAO,EAAE,YAAY,KAAI;MAC1B,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gCAAgC,WAAW,OAAO,aAAa;UACnF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,kCAAkCJ,IAAM;AAC/C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,qCAAwC,QACA,YACA,gBACA,gBACA,gBACA,gBACA,eACA,eAA6C;AAI5F,mBAAW,4BAA4B;AACvC,eAAO,4BAA4B;AAGnC,mBAAW,SAAS;AACpB,mBAAW,kBAAkB;AAC7B,mBAAW,UAAU;AAErB,mBAAW,eAAe;AAC1B,mBAAW,mBAAmB,sBAAqB;AACnD,mBAAW,WAAW;AAEtB,mBAAW,yBAAyB;AACpC,mBAAW,eAAe;AAE1B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAE7B,cAAM,eAAe,+CAA+C,UAAU;AAC9E,yCAAiC,QAAQ,YAAY;AAErD,cAAM,cAAc,eAAc;AAClC,cAAM,eAAe,oBAAoB,WAAW;AACpD,oBACE,cACA,MAAK;AAEH,qBAAW,WAAW;AACtB,8DAAoD,UAAU;AAC9D,iBAAO;WAET,CAAAM,OAAI;AAEF,qBAAW,WAAW;AACtB,0CAAgC,QAAQA,EAAC;AACzC,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,uDAA0D,QACA,gBACA,eACA,eAA6C;AAC9G,cAAM,aAAa,OAAO,OAAO,gCAAgC,SAAS;AAE1E,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,MAAM,eAAe,MAAO,UAAU;eAClD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,WAAS,eAAe,MAAO,OAAO,UAAU;eAC5D;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAEtD,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,MAAM,eAAe,MAAM;eACvC;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAEtD,YAAI,eAAe,UAAU,QAAW;AACtC,2BAAiB,YAAU,eAAe,MAAO,MAAM;eAClD;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAGtD,6CACE,QAAQ,YAAY,gBAAgB,gBAAgB,gBAAgB,gBAAgB,eAAe,aAAa;MAEpH;AAGA,eAAS,+CAA+C,YAAgD;AACtG,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,kBAAkB;AAC7B,mBAAW,yBAAyB;MACtC;AAEA,eAAS,qCAAwC,YAA8C;AAC7F,6BAAqB,YAAY,eAAe,CAAC;AACjD,4DAAoD,UAAU;MAChE;AAEA,eAAS,4CAA+C,YACA,OAAQ;AAC9D,YAAI;AACF,iBAAO,WAAW,uBAAuB,KAAK;iBACvC,YAAY;AACnB,uDAA6C,YAAY,UAAU;AACnE,iBAAO;;MAEX;AAEA,eAAS,8CAA8C,YAAgD;AACrG,eAAO,WAAW,eAAe,WAAW;MAC9C;AAEA,eAAS,qCAAwC,YACA,OACA,WAAiB;AAChE,YAAI;AACF,+BAAqB,YAAY,OAAO,SAAS;iBAC1C,UAAU;AACjB,uDAA6C,YAAY,QAAQ;AACjE;;AAGF,cAAM,SAAS,WAAW;AAC1B,YAAI,CAAC,oCAAoC,MAAM,KAAK,OAAO,WAAW,YAAY;AAChF,gBAAM,eAAe,+CAA+C,UAAU;AAC9E,2CAAiC,QAAQ,YAAY;;AAGvD,4DAAoD,UAAU;MAChE;AAIA,eAAS,oDAAuD,YAA8C;AAC5G,cAAM,SAAS,WAAW;AAE1B,YAAI,CAAC,WAAW,UAAU;AACxB;;AAGF,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,cAAM,QAAQ,OAAO;AAErB,YAAI,UAAU,YAAY;AACxB,uCAA6B,MAAM;AACnC;;AAGF,YAAI,WAAW,OAAO,WAAW,GAAG;AAClC;;AAGF,cAAM,QAAQ,eAAe,UAAU;AACvC,YAAI,UAAU,eAAe;AAC3B,sDAA4C,UAAU;eACjD;AACL,sDAA4C,YAAY,KAAK;;MAEjE;AAEA,eAAS,6CAA6C,YAAkD,OAAU;AAChH,YAAI,WAAW,0BAA0B,WAAW,YAAY;AAC9D,+CAAqC,YAAY,KAAK;;MAE1D;AAEA,eAAS,4CAA4C,YAAgD;AACnG,cAAM,SAAS,WAAW;AAE1B,+CAAuC,MAAM;AAE7C,qBAAa,UAAU;AAGvB,cAAM,mBAAmB,WAAW,gBAAe;AACnD,uDAA+C,UAAU;AACzD,oBACE,kBACA,MAAK;AACH,4CAAkC,MAAM;AACxC,iBAAO;WAET,YAAS;AACP,qDAA2C,QAAQ,MAAM;AACzD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,4CAA+C,YAAgD,OAAQ;AAC9G,cAAM,SAAS,WAAW;AAE1B,oDAA4C,MAAM;AAElD,cAAM,mBAAmB,WAAW,gBAAgB,KAAK;AACzD,oBACE,kBACA,MAAK;AACH,4CAAkC,MAAM;AAExC,gBAAM,QAAQ,OAAO;AAGrB,uBAAa,UAAU;AAEvB,cAAI,CAAC,oCAAoC,MAAM,KAAK,UAAU,YAAY;AACxE,kBAAM,eAAe,+CAA+C,UAAU;AAC9E,6CAAiC,QAAQ,YAAY;;AAGvD,8DAAoD,UAAU;AAC9D,iBAAO;WAET,YAAS;AACP,cAAI,OAAO,WAAW,YAAY;AAChC,2DAA+C,UAAU;;AAE3D,qDAA2C,QAAQ,MAAM;AACzD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,+CAA+C,YAAgD;AACtG,cAAM,cAAc,8CAA8C,UAAU;AAC5E,eAAO,eAAe;MACxB;AAIA,eAAS,qCAAqC,YAAkD,OAAU;AACxG,cAAM,SAAS,WAAW;AAI1B,uDAA+C,UAAU;AACzD,oCAA4B,QAAQ,KAAK;MAC3C;AAIA,eAASE,4BAA0B,MAAY;AAC7C,eAAO,IAAI,UAAU,4BAA4B,IAAI,uCAAuC;MAC9F;AAIA,eAASC,uCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,6CAA6C,IAAI,wDAAwD;MAC7G;AAKA,eAAS,iCAAiC,MAAY;AACpD,eAAO,IAAI,UACT,yCAAyC,IAAI,oDAAoD;MACrG;AAEA,eAAS,2BAA2B,MAAY;AAC9C,eAAO,IAAI,UAAU,YAAY,OAAO,mCAAmC;MAC7E;AAEA,eAAS,qCAAqC,QAAmC;AAC/E,eAAO,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACrD,iBAAO,yBAAyB;AAChC,iBAAO,wBAAwB;AAC/B,iBAAO,sBAAsB;QAC/B,CAAC;MACH;AAEA,eAAS,+CAA+C,QAAqC,QAAW;AACtG,6CAAqC,MAAM;AAC3C,yCAAiC,QAAQ,MAAM;MACjD;AAEA,eAAS,+CAA+C,QAAmC;AACzF,6CAAqC,MAAM;AAC3C,0CAAkC,MAAM;MAC1C;AAEA,eAAS,iCAAiC,QAAqC,QAAW;AACxF,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAIF,kCAA0B,OAAO,cAAc;AAC/C,eAAO,sBAAsB,MAAM;AACnC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;AAC/B,eAAO,sBAAsB;MAC/B;AAEA,eAAS,0CAA0C,QAAqC,QAAW;AAKjG,uDAA+C,QAAQ,MAAM;MAC/D;AAEA,eAAS,kCAAkC,QAAmC;AAC5E,YAAI,OAAO,2BAA2B,QAAW;AAC/C;;AAIF,eAAO,uBAAuB,MAAS;AACvC,eAAO,yBAAyB;AAChC,eAAO,wBAAwB;AAC/B,eAAO,sBAAsB;MAC/B;AAEA,eAAS,oCAAoC,QAAmC;AAC9E,eAAO,gBAAgB,WAAW,CAAC,SAAS,WAAU;AACpD,iBAAO,wBAAwB;AAC/B,iBAAO,uBAAuB;QAChC,CAAC;AACD,eAAO,qBAAqB;MAC9B;AAEA,eAAS,8CAA8C,QAAqC,QAAW;AACrG,4CAAoC,MAAM;AAC1C,wCAAgC,QAAQ,MAAM;MAChD;AAEA,eAAS,8CAA8C,QAAmC;AACxF,4CAAoC,MAAM;AAC1C,yCAAiC,MAAM;MACzC;AAEA,eAAS,gCAAgC,QAAqC,QAAW;AACvF,YAAI,OAAO,yBAAyB,QAAW;AAC7C;;AAGF,kCAA0B,OAAO,aAAa;AAC9C,eAAO,qBAAqB,MAAM;AAClC,eAAO,wBAAwB;AAC/B,eAAO,uBAAuB;AAC9B,eAAO,qBAAqB;MAC9B;AAEA,eAAS,+BAA+B,QAAmC;AAIzE,4CAAoC,MAAM;MAC5C;AAEA,eAAS,yCAAyC,QAAqC,QAAW;AAIhG,sDAA8C,QAAQ,MAAM;MAC9D;AAEA,eAAS,iCAAiC,QAAmC;AAC3E,YAAI,OAAO,0BAA0B,QAAW;AAC9C;;AAGF,eAAO,sBAAsB,MAAS;AACtC,eAAO,wBAAwB;AAC/B,eAAO,uBAAuB;AAC9B,eAAO,qBAAqB;MAC9B;ACz5CA,eAAS,aAAU;AACjB,YAAI,OAAO,eAAe,aAAa;AACrC,iBAAO;mBACE,OAAO,SAAS,aAAa;AACtC,iBAAO;mBACE,OAAO,WAAW,aAAa;AACxC,iBAAO;;AAET,eAAO;MACT;AAEO,YAAM,UAAU,WAAU;ACFjC,eAAS,0BAA0B,MAAa;AAC9C,YAAI,EAAE,OAAO,SAAS,cAAc,OAAO,SAAS,WAAW;AAC7D,iBAAO;;AAET,YAAK,KAAiC,SAAS,gBAAgB;AAC7D,iBAAO;;AAET,YAAI;AACF,cAAK,KAAgC;AACrC,iBAAO;iBACPR,KAAM;AACN,iBAAO;;MAEX;AAOA,eAAS,gBAAa;AACpB,cAAM,OAAO,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACtB,eAAO,0BAA0B,IAAI,IAAI,OAAO;MAClD;AAMA,eAAS,iBAAc;AAErB,cAAM,OAAO,SAASS,cAAiC,SAAkB,MAAa;AACpF,eAAK,UAAU,WAAW;AAC1B,eAAK,OAAO,QAAQ;AACpB,cAAI,MAAM,mBAAmB;AAC3B,kBAAM,kBAAkB,MAAM,KAAK,WAAW;;QAElD;AACA,wBAAgB,MAAM,cAAc;AACpC,aAAK,YAAY,OAAO,OAAO,MAAM,SAAS;AAC9C,eAAO,eAAe,KAAK,WAAW,eAAe,EAAE,OAAO,MAAM,UAAU,MAAM,cAAc,KAAI,CAAE;AACxG,eAAO;MACT;AAGA,YAAMA,gBAAwC,cAAa,KAAM,eAAc;AC5B/D,eAAA,qBAAwB,QACA,MACA,cACA,cACA,eACA,QAA+B;AAUrE,cAAM,SAAS,mCAAsC,MAAM;AAC3D,cAAM,SAAS,mCAAsC,IAAI;AAEzD,eAAO,aAAa;AAEpB,YAAI,eAAe;AAGnB,YAAI,eAAe,oBAA0B,MAAS;AAEtD,eAAO,WAAW,CAAC,SAAS,WAAU;AACpC,cAAI;AACJ,cAAI,WAAW,QAAW;AACxB,6BAAiB,MAAK;AACpB,oBAAM,QAAQ,OAAO,WAAW,SAAY,OAAO,SAAS,IAAIA,cAAa,WAAW,YAAY;AACpG,oBAAM,UAAsC,CAAA;AAC5C,kBAAI,CAAC,cAAc;AACjB,wBAAQ,KAAK,MAAK;AAChB,sBAAI,KAAK,WAAW,YAAY;AAC9B,2BAAO,oBAAoB,MAAM,KAAK;;AAExC,yBAAO,oBAAoB,MAAS;gBACtC,CAAC;;AAEH,kBAAI,CAAC,eAAe;AAClB,wBAAQ,KAAK,MAAK;AAChB,sBAAI,OAAO,WAAW,YAAY;AAChC,2BAAO,qBAAqB,QAAQ,KAAK;;AAE3C,yBAAO,oBAAoB,MAAS;gBACtC,CAAC;;AAEH,iCAAmB,MAAM,QAAQ,IAAI,QAAQ,IAAI,YAAU,OAAM,CAAE,CAAC,GAAG,MAAM,KAAK;YACpF;AAEA,gBAAI,OAAO,SAAS;AAClB,6BAAc;AACd;;AAGF,mBAAO,iBAAiB,SAAS,cAAc;;AAMjD,mBAAS,WAAQ;AACf,mBAAO,WAAiB,CAAC,aAAa,eAAc;AAClD,uBAAS,KAAK,MAAa;AACzB,oBAAI,MAAM;AACR,8BAAW;uBACN;AAGL,qCAAmB,SAAQ,GAAI,MAAM,UAAU;;;AAInD,mBAAK,KAAK;YACZ,CAAC;;AAGH,mBAAS,WAAQ;AACf,gBAAI,cAAc;AAChB,qBAAO,oBAAoB,IAAI;;AAGjC,mBAAO,mBAAmB,OAAO,eAAe,MAAK;AACnD,qBAAO,WAAoB,CAAC,aAAa,eAAc;AACrD,gDACE,QACA;kBACE,aAAa,WAAQ;AACnB,mCAAe,mBAAmB,iCAAiC,QAAQ,KAAK,GAAG,QAAWX,KAAI;AAClG,gCAAY,KAAK;;kBAEnB,aAAa,MAAM,YAAY,IAAI;kBACnC,aAAa;gBACd,CAAA;cAEL,CAAC;YACH,CAAC;;AAIH,6BAAmB,QAAQ,OAAO,gBAAgB,iBAAc;AAC9D,gBAAI,CAAC,cAAc;AACjB,iCAAmB,MAAM,oBAAoB,MAAM,WAAW,GAAG,MAAM,WAAW;mBAC7E;AACL,uBAAS,MAAM,WAAW;;AAE5B,mBAAO;UACT,CAAC;AAGD,6BAAmB,MAAM,OAAO,gBAAgB,iBAAc;AAC5D,gBAAI,CAAC,eAAe;AAClB,iCAAmB,MAAM,qBAAqB,QAAQ,WAAW,GAAG,MAAM,WAAW;mBAChF;AACL,uBAAS,MAAM,WAAW;;AAE5B,mBAAO;UACT,CAAC;AAGD,4BAAkB,QAAQ,OAAO,gBAAgB,MAAK;AACpD,gBAAI,CAAC,cAAc;AACjB,iCAAmB,MAAM,qDAAqD,MAAM,CAAC;mBAChF;AACL,uBAAQ;;AAEV,mBAAO;UACT,CAAC;AAGD,cAAI,oCAAoC,IAAI,KAAK,KAAK,WAAW,UAAU;AACzE,kBAAM,aAAa,IAAI,UAAU,6EAA6E;AAE9G,gBAAI,CAAC,eAAe;AAClB,iCAAmB,MAAM,qBAAqB,QAAQ,UAAU,GAAG,MAAM,UAAU;mBAC9E;AACL,uBAAS,MAAM,UAAU;;;AAI7B,oCAA0B,SAAQ,CAAE;AAEpC,mBAAS,wBAAqB;AAG5B,kBAAM,kBAAkB;AACxB,mBAAO,mBACL,cACA,MAAM,oBAAoB,eAAe,sBAAqB,IAAK,MAAS;;AAIhF,mBAAS,mBAAmB,QACA,SACA,QAA6B;AACvD,gBAAI,OAAO,WAAW,WAAW;AAC/B,qBAAO,OAAO,YAAY;mBACrB;AACL,4BAAc,SAAS,MAAM;;;AAIjC,mBAAS,kBAAkB,QAAyC,SAAwB,QAAkB;AAC5G,gBAAI,OAAO,WAAW,UAAU;AAC9B,qBAAM;mBACD;AACL,8BAAgB,SAAS,MAAM;;;AAInC,mBAAS,mBAAmB,QAAgC,iBAA2B,eAAmB;AACxG,gBAAI,cAAc;AAChB;;AAEF,2BAAe;AAEf,gBAAI,KAAK,WAAW,cAAc,CAAC,oCAAoC,IAAI,GAAG;AAC5E,8BAAgB,sBAAqB,GAAI,SAAS;mBAC7C;AACL,wBAAS;;AAGX,qBAAS,YAAS;AAChB,0BACE,OAAM,GACN,MAAM,SAAS,iBAAiB,aAAa,GAC7C,cAAY,SAAS,MAAM,QAAQ,CAAC;AAEtC,qBAAO;;;AAIX,mBAAS,SAAS,SAAmB,OAAW;AAC9C,gBAAI,cAAc;AAChB;;AAEF,2BAAe;AAEf,gBAAI,KAAK,WAAW,cAAc,CAAC,oCAAoC,IAAI,GAAG;AAC5E,8BAAgB,sBAAqB,GAAI,MAAM,SAAS,SAAS,KAAK,CAAC;mBAClE;AACL,uBAAS,SAAS,KAAK;;;AAI3B,mBAAS,SAAS,SAAmB,OAAW;AAC9C,+CAAmC,MAAM;AACzC,+CAAmC,MAAM;AAEzC,gBAAI,WAAW,QAAW;AACxB,qBAAO,oBAAoB,SAAS,cAAc;;AAEpD,gBAAI,SAAS;AACX,qBAAO,KAAK;mBACP;AACL,sBAAQ,MAAS;;AAGnB,mBAAO;;QAEX,CAAC;MACH;YCpOa,gCAA+B;QAwB1C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;;QAO3C,IAAI,cAAW;AACb,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMU,uCAAqC,aAAa;;AAG1D,iBAAO,8CAA8C,IAAI;;;;;;QAO3D,QAAK;AACH,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,OAAO;;AAGpD,cAAI,CAAC,iDAAiD,IAAI,GAAG;AAC3D,kBAAM,IAAI,UAAU,iDAAiD;;AAGvE,+CAAqC,IAAI;;QAO3C,QAAQ,QAAW,QAAU;AAC3B,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMA,uCAAqC,SAAS;;AAGtD,cAAI,CAAC,iDAAiD,IAAI,GAAG;AAC3D,kBAAM,IAAI,UAAU,mDAAmD;;AAGzE,iBAAO,uCAAuC,MAAM,KAAK;;;;;QAM3D,MAAML,KAAS,QAAS;AACtB,cAAI,CAAC,kCAAkC,IAAI,GAAG;AAC5C,kBAAMK,uCAAqC,OAAO;;AAGpD,+CAAqC,MAAML,EAAC;;;QAI9C,CAAC,WAAW,EAAE,QAAW;AACvB,qBAAW,IAAI;AACf,gBAAM,SAAS,KAAK,iBAAiB,MAAM;AAC3C,yDAA+C,IAAI;AACnD,iBAAO;;;QAIT,CAAC,SAAS,EAAE,aAA2B;AACrC,gBAAM,SAAS,KAAK;AAEpB,cAAI,KAAK,OAAO,SAAS,GAAG;AAC1B,kBAAM,QAAQ,aAAa,IAAI;AAE/B,gBAAI,KAAK,mBAAmB,KAAK,OAAO,WAAW,GAAG;AACpD,6DAA+C,IAAI;AACnD,kCAAoB,MAAM;mBACrB;AACL,8DAAgD,IAAI;;AAGtD,wBAAY,YAAY,KAAK;iBACxB;AACL,yCAA6B,QAAQ,WAAW;AAChD,4DAAgD,IAAI;;;;QAKxD,CAAC,YAAY,IAAC;;MAGf;AAED,aAAO,iBAAiB,gCAAgC,WAAW;QACjE,OAAO,EAAE,YAAY,KAAI;QACzB,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,gCAAgC,UAAU,OAAO,OAAO;AACxE,sBAAgB,gCAAgC,UAAU,SAAS,SAAS;AAC5E,sBAAgB,gCAAgC,UAAU,OAAO,OAAO;AACxE,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gCAAgC,WAAW,OAAO,aAAa;UACnF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,kCAA2CJ,IAAM;AACxD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,gDAAgD,YAAgD;AACvG,cAAM,aAAa,8CAA8C,UAAU;AAC3E,YAAI,CAAC,YAAY;AACf;;AAGF,YAAI,WAAW,UAAU;AACvB,qBAAW,aAAa;AACxB;;AAKF,mBAAW,WAAW;AAEtB,cAAM,cAAc,WAAW,eAAc;AAC7C,oBACE,aACA,MAAK;AACH,qBAAW,WAAW;AAEtB,cAAI,WAAW,YAAY;AACzB,uBAAW,aAAa;AACxB,4DAAgD,UAAU;;AAG5D,iBAAO;WAET,CAAAI,OAAI;AACF,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;MAEL;AAEA,eAAS,8CAA8C,YAAgD;AACrG,cAAM,SAAS,WAAW;AAE1B,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE,iBAAO;;AAGT,YAAI,CAAC,WAAW,UAAU;AACxB,iBAAO;;AAGT,YAAI,uBAAuB,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAClF,iBAAO;;AAGT,cAAM,cAAc,8CAA8C,UAAU;AAE5E,YAAI,cAAe,GAAG;AACpB,iBAAO;;AAGT,eAAO;MACT;AAEA,eAAS,+CAA+C,YAAgD;AACtG,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAC9B,mBAAW,yBAAyB;MACtC;AAIM,eAAU,qCAAqC,YAAgD;AACnG,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE;;AAGF,cAAM,SAAS,WAAW;AAE1B,mBAAW,kBAAkB;AAE7B,YAAI,WAAW,OAAO,WAAW,GAAG;AAClC,yDAA+C,UAAU;AACzD,8BAAoB,MAAM;;MAE9B;AAEgB,eAAA,uCACd,YACA,OAAQ;AAER,YAAI,CAAC,iDAAiD,UAAU,GAAG;AACjE;;AAGF,cAAM,SAAS,WAAW;AAE1B,YAAI,uBAAuB,MAAM,KAAK,iCAAiC,MAAM,IAAI,GAAG;AAClF,2CAAiC,QAAQ,OAAO,KAAK;eAChD;AACL,cAAI;AACJ,cAAI;AACF,wBAAY,WAAW,uBAAuB,KAAK;mBAC5C,YAAY;AACnB,iDAAqC,YAAY,UAAU;AAC3D,kBAAM;;AAGR,cAAI;AACF,iCAAqB,YAAY,OAAO,SAAS;mBAC1C,UAAU;AACjB,iDAAqC,YAAY,QAAQ;AACzD,kBAAM;;;AAIV,wDAAgD,UAAU;MAC5D;AAEgB,eAAA,qCAAqC,YAAkDA,IAAM;AAC3G,cAAM,SAAS,WAAW;AAE1B,YAAI,OAAO,WAAW,YAAY;AAChC;;AAGF,mBAAW,UAAU;AAErB,uDAA+C,UAAU;AACzD,4BAAoB,QAAQA,EAAC;MAC/B;AAEM,eAAU,8CACd,YAAgD;AAEhD,cAAM,QAAQ,WAAW,0BAA0B;AAEnD,YAAI,UAAU,WAAW;AACvB,iBAAO;;AAET,YAAI,UAAU,UAAU;AACtB,iBAAO;;AAGT,eAAO,WAAW,eAAe,WAAW;MAC9C;AAGM,eAAU,+CACd,YAAgD;AAEhD,YAAI,8CAA8C,UAAU,GAAG;AAC7D,iBAAO;;AAGT,eAAO;MACT;AAEM,eAAU,iDACd,YAAgD;AAEhD,cAAM,QAAQ,WAAW,0BAA0B;AAEnD,YAAI,CAAC,WAAW,mBAAmB,UAAU,YAAY;AACvD,iBAAO;;AAGT,eAAO;MACT;AAEgB,eAAA,qCAAwC,QACA,YACA,gBACA,eACA,iBACA,eACA,eAA6C;AAGnG,mBAAW,4BAA4B;AAEvC,mBAAW,SAAS;AACpB,mBAAW,kBAAkB;AAC7B,mBAAW,UAAU;AAErB,mBAAW,WAAW;AACtB,mBAAW,kBAAkB;AAC7B,mBAAW,aAAa;AACxB,mBAAW,WAAW;AAEtB,mBAAW,yBAAyB;AACpC,mBAAW,eAAe;AAE1B,mBAAW,iBAAiB;AAC5B,mBAAW,mBAAmB;AAE9B,eAAO,4BAA4B;AAEnC,cAAM,cAAc,eAAc;AAClC,oBACE,oBAAoB,WAAW,GAC/B,MAAK;AACH,qBAAW,WAAW;AAKtB,0DAAgD,UAAU;AAC1D,iBAAO;WAET,CAAAE,OAAI;AACF,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;MAEL;AAEM,eAAU,yDACd,QACA,kBACA,eACA,eAA6C;AAE7C,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAE9G,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,iBAAiB,UAAU,QAAW;AACxC,2BAAiB,MAAM,iBAAiB,MAAO,UAAU;eACpD;AACL,2BAAiB,MAAM;;AAEzB,YAAI,iBAAiB,SAAS,QAAW;AACvC,0BAAgB,MAAM,iBAAiB,KAAM,UAAU;eAClD;AACL,0BAAgB,MAAM,oBAAoB,MAAS;;AAErD,YAAI,iBAAiB,WAAW,QAAW;AACzC,4BAAkB,YAAU,iBAAiB,OAAQ,MAAM;eACtD;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,6CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,aAAa;MAEpG;AAIA,eAASG,uCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,6CAA6C,IAAI,wDAAwD;MAC7G;ACxXgB,eAAA,kBAAqB,QACA,iBAAwB;AAG3D,YAAI,+BAA+B,OAAO,yBAAyB,GAAG;AACpE,iBAAO,sBAAsB,MAAuC;;AAGtE,eAAO,yBAAyB,MAAuB;MACzD;AAEgB,eAAA,yBACd,QACA,iBAAwB;AAKxB,cAAM,SAAS,mCAAsC,MAAM;AAE3D,YAAI,UAAU;AACd,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI;AACJ,cAAM,gBAAgB,WAAsB,aAAU;AACpD,iCAAuB;QACzB,CAAC;AAED,iBAAS,gBAAa;AACpB,cAAI,SAAS;AACX,wBAAY;AACZ,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAA8B;YAClC,aAAa,WAAQ;AAInBJ,8BAAe,MAAK;AAClB,4BAAY;AACZ,sBAAM,SAAS;AACf,sBAAM,SAAS;AAQf,oBAAI,CAAC,WAAW;AACd,yDAAuC,QAAQ,2BAA2B,MAAM;;AAElF,oBAAI,CAAC,WAAW;AACd,yDAAuC,QAAQ,2BAA2B,MAAM;;AAGlF,0BAAU;AACV,oBAAI,WAAW;AACb,gCAAa;;cAEjB,CAAC;;YAEH,aAAa,MAAK;AAChB,wBAAU;AACV,kBAAI,CAAC,WAAW;AACd,qDAAqC,QAAQ,yBAAyB;;AAExE,kBAAI,CAAC,WAAW;AACd,qDAAqC,QAAQ,yBAAyB;;AAGxE,kBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,0CAAgC,QAAQ,WAAW;AAEnD,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAc;;AAIvB,kBAAU,qBAAqB,gBAAgB,eAAe,gBAAgB;AAC9E,kBAAU,qBAAqB,gBAAgB,eAAe,gBAAgB;AAE9E,sBAAc,OAAO,gBAAgB,CAACC,OAAU;AAC9C,+CAAqC,QAAQ,2BAA2BA,EAAC;AACzE,+CAAqC,QAAQ,2BAA2BA,EAAC;AACzE,cAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,iCAAqB,MAAS;;AAEhC,iBAAO;QACT,CAAC;AAED,eAAO,CAAC,SAAS,OAAO;MAC1B;AAEM,eAAU,sBAAsB,QAA0B;AAI9D,YAAI,SAAsD,mCAAmC,MAAM;AACnG,YAAI,UAAU;AACd,YAAI,sBAAsB;AAC1B,YAAI,sBAAsB;AAC1B,YAAI,YAAY;AAChB,YAAI,YAAY;AAChB,YAAI;AACJ,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI;AACJ,cAAM,gBAAgB,WAAiB,aAAU;AAC/C,iCAAuB;QACzB,CAAC;AAED,iBAAS,mBAAmB,YAAuD;AACjF,wBAAc,WAAW,gBAAgB,CAAAA,OAAI;AAC3C,gBAAI,eAAe,QAAQ;AACzB,qBAAO;;AAET,8CAAkC,QAAQ,2BAA2BA,EAAC;AACtE,8CAAkC,QAAQ,2BAA2BA,EAAC;AACtE,gBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,mCAAqB,MAAS;;AAEhC,mBAAO;UACT,CAAC;;AAGH,iBAAS,wBAAqB;AAC5B,cAAI,2BAA2B,MAAM,GAAG;AAEtC,+CAAmC,MAAM;AAEzC,qBAAS,mCAAmC,MAAM;AAClD,+BAAmB,MAAM;;AAG3B,gBAAM,cAAkD;YACtD,aAAa,WAAQ;AAInBD,8BAAe,MAAK;AAClB,sCAAsB;AACtB,sCAAsB;AAEtB,sBAAM,SAAS;AACf,oBAAI,SAAS;AACb,oBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,sBAAI;AACF,6BAAS,kBAAkB,KAAK;2BACzB,QAAQ;AACf,sDAAkC,QAAQ,2BAA2B,MAAM;AAC3E,sDAAkC,QAAQ,2BAA2B,MAAM;AAC3E,yCAAqB,qBAAqB,QAAQ,MAAM,CAAC;AACzD;;;AAIJ,oBAAI,CAAC,WAAW;AACd,sDAAoC,QAAQ,2BAA2B,MAAM;;AAE/E,oBAAI,CAAC,WAAW;AACd,sDAAoC,QAAQ,2BAA2B,MAAM;;AAG/E,0BAAU;AACV,oBAAI,qBAAqB;AACvB,iCAAc;2BACL,qBAAqB;AAC9B,iCAAc;;cAElB,CAAC;;YAEH,aAAa,MAAK;AAChB,wBAAU;AACV,kBAAI,CAAC,WAAW;AACd,kDAAkC,QAAQ,yBAAyB;;AAErE,kBAAI,CAAC,WAAW;AACd,kDAAkC,QAAQ,yBAAyB;;AAErE,kBAAI,QAAQ,0BAA0B,kBAAkB,SAAS,GAAG;AAClE,oDAAoC,QAAQ,2BAA2B,CAAC;;AAE1E,kBAAI,QAAQ,0BAA0B,kBAAkB,SAAS,GAAG;AAClE,oDAAoC,QAAQ,2BAA2B,CAAC;;AAE1E,kBAAI,CAAC,aAAa,CAAC,WAAW;AAC5B,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,0CAAgC,QAAQ,WAAW;;AAGrD,iBAAS,mBAAmB,MAAkC,YAAmB;AAC/E,cAAI,8BAAqD,MAAM,GAAG;AAEhE,+CAAmC,MAAM;AAEzC,qBAAS,gCAAgC,MAAM;AAC/C,+BAAmB,MAAM;;AAG3B,gBAAM,aAAa,aAAa,UAAU;AAC1C,gBAAM,cAAc,aAAa,UAAU;AAE3C,gBAAM,kBAA+D;YACnE,aAAa,WAAQ;AAInBA,8BAAe,MAAK;AAClB,sCAAsB;AACtB,sCAAsB;AAEtB,sBAAM,eAAe,aAAa,YAAY;AAC9C,sBAAM,gBAAgB,aAAa,YAAY;AAE/C,oBAAI,CAAC,eAAe;AAClB,sBAAI;AACJ,sBAAI;AACF,kCAAc,kBAAkB,KAAK;2BAC9B,QAAQ;AACf,sDAAkC,WAAW,2BAA2B,MAAM;AAC9E,sDAAkC,YAAY,2BAA2B,MAAM;AAC/E,yCAAqB,qBAAqB,QAAQ,MAAM,CAAC;AACzD;;AAEF,sBAAI,CAAC,cAAc;AACjB,mEAA+C,WAAW,2BAA2B,KAAK;;AAE5F,sDAAoC,YAAY,2BAA2B,WAAW;2BAC7E,CAAC,cAAc;AACxB,iEAA+C,WAAW,2BAA2B,KAAK;;AAG5F,0BAAU;AACV,oBAAI,qBAAqB;AACvB,iCAAc;2BACL,qBAAqB;AAC9B,iCAAc;;cAElB,CAAC;;YAEH,aAAa,WAAQ;AACnB,wBAAU;AAEV,oBAAM,eAAe,aAAa,YAAY;AAC9C,oBAAM,gBAAgB,aAAa,YAAY;AAE/C,kBAAI,CAAC,cAAc;AACjB,kDAAkC,WAAW,yBAAyB;;AAExE,kBAAI,CAAC,eAAe;AAClB,kDAAkC,YAAY,yBAAyB;;AAGzE,kBAAI,UAAU,QAAW;AAGvB,oBAAI,CAAC,cAAc;AACjB,iEAA+C,WAAW,2BAA2B,KAAK;;AAE5F,oBAAI,CAAC,iBAAiB,YAAY,0BAA0B,kBAAkB,SAAS,GAAG;AACxF,sDAAoC,YAAY,2BAA2B,CAAC;;;AAIhF,kBAAI,CAAC,gBAAgB,CAAC,eAAe;AACnC,qCAAqB,MAAS;;;YAGlC,aAAa,MAAK;AAChB,wBAAU;;;AAGd,uCAA6B,QAAQ,MAAM,GAAG,eAAe;;AAG/D,iBAAS,iBAAc;AACrB,cAAI,SAAS;AACX,kCAAsB;AACtB,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAAc,2CAA2C,QAAQ,yBAAyB;AAChG,cAAI,gBAAgB,MAAM;AACxB,kCAAqB;iBAChB;AACL,+BAAmB,YAAY,OAAQ,KAAK;;AAG9C,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAc;AACrB,cAAI,SAAS;AACX,kCAAsB;AACtB,mBAAO,oBAAoB,MAAS;;AAGtC,oBAAU;AAEV,gBAAM,cAAc,2CAA2C,QAAQ,yBAAyB;AAChG,cAAI,gBAAgB,MAAM;AACxB,kCAAqB;iBAChB;AACL,+BAAmB,YAAY,OAAQ,IAAI;;AAG7C,iBAAO,oBAAoB,MAAS;;AAGtC,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAiB,QAAW;AACnC,sBAAY;AACZ,oBAAU;AACV,cAAI,WAAW;AACb,kBAAM,kBAAkB,oBAAoB,CAAC,SAAS,OAAO,CAAC;AAC9D,kBAAM,eAAe,qBAAqB,QAAQ,eAAe;AACjE,iCAAqB,YAAY;;AAEnC,iBAAO;;AAGT,iBAAS,iBAAc;AACrB;;AAGF,kBAAU,yBAAyB,gBAAgB,gBAAgB,gBAAgB;AACnF,kBAAU,yBAAyB,gBAAgB,gBAAgB,gBAAgB;AAEnF,2BAAmB,MAAM;AAEzB,eAAO,CAAC,SAAS,OAAO;MAC1B;ACtZM,eAAU,qBAAwB,QAAe;AACrD,eAAO,aAAa,MAAM,KAAK,OAAQ,OAAiC,cAAc;MACxF;ACnBM,eAAU,mBACd,QAA8D;AAE9D,YAAI,qBAAqB,MAAM,GAAG;AAChC,iBAAO,gCAAgC,OAAO,UAAS,CAAE;;AAE3D,eAAO,2BAA2B,MAAM;MAC1C;AAEM,eAAU,2BAA8B,eAA6C;AACzF,YAAI;AACJ,cAAM,iBAAiB,YAAY,eAAe,OAAO;AAEzD,cAAM,iBAAiBN;AAEvB,iBAAS,gBAAa;AACpB,cAAI;AACJ,cAAI;AACF,yBAAa,aAAa,cAAc;mBACjCK,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,cAAc,oBAAoB,UAAU;AAClD,iBAAO,qBAAqB,aAAa,gBAAa;AACpD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,gFAAgF;;AAEtG,kBAAM,OAAO,iBAAiB,UAAU;AACxC,gBAAI,MAAM;AACR,mDAAqC,OAAO,yBAAyB;mBAChE;AACL,oBAAM,QAAQ,cAAc,UAAU;AACtC,qDAAuC,OAAO,2BAA2B,KAAK;;UAElF,CAAC;;AAGH,iBAAS,gBAAgB,QAAW;AAClC,gBAAM,WAAW,eAAe;AAChC,cAAI;AACJ,cAAI;AACF,2BAAe,UAAU,UAAU,QAAQ;mBACpCA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,cAAI,iBAAiB,QAAW;AAC9B,mBAAO,oBAAoB,MAAS;;AAEtC,cAAI;AACJ,cAAI;AACF,2BAAe,YAAY,cAAc,UAAU,CAAC,MAAM,CAAC;mBACpDA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,gBAAM,gBAAgB,oBAAoB,YAAY;AACtD,iBAAO,qBAAqB,eAAe,gBAAa;AACtD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,kFAAkF;;AAExG,mBAAO;UACT,CAAC;;AAGH,iBAAS,qBAAqB,gBAAgB,eAAe,iBAAiB,CAAC;AAC/E,eAAO;MACT;AAEM,eAAU,gCACd,QAA0C;AAE1C,YAAI;AAEJ,cAAM,iBAAiBL;AAEvB,iBAAS,gBAAa;AACpB,cAAI;AACJ,cAAI;AACF,0BAAc,OAAO,KAAI;mBAClBK,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAE9B,iBAAO,qBAAqB,aAAa,gBAAa;AACpD,gBAAI,CAAC,aAAa,UAAU,GAAG;AAC7B,oBAAM,IAAI,UAAU,8EAA8E;;AAEpG,gBAAI,WAAW,MAAM;AACnB,mDAAqC,OAAO,yBAAyB;mBAChE;AACL,oBAAM,QAAQ,WAAW;AACzB,qDAAuC,OAAO,2BAA2B,KAAK;;UAElF,CAAC;;AAGH,iBAAS,gBAAgB,QAAW;AAClC,cAAI;AACF,mBAAO,oBAAoB,OAAO,OAAO,MAAM,CAAC;mBACzCA,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;;AAIhC,iBAAS,qBAAqB,gBAAgB,eAAe,iBAAiB,CAAC;AAC/E,eAAO;MACT;ACvGgB,eAAA,qCACd,QACA,SAAe;AAEf,yBAAiB,QAAQ,OAAO;AAChC,cAAM,WAAW;AACjB,cAAM,wBAAwB,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxC,cAAM,SAAS,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACzB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,OAAO,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACvB,eAAO;UACL,uBAAuB,0BAA0B,SAC/C,SACA,wCACE,uBACA,GAAG,OAAO,0CAA0C;UAExD,QAAQ,WAAW,SACjB,SACA,sCAAsC,QAAQ,UAAW,GAAG,OAAO,2BAA2B;UAChG,MAAM,SAAS,SACb,SACA,oCAAoC,MAAM,UAAW,GAAG,OAAO,yBAAyB;UAC1F,OAAO,UAAU,SACf,SACA,qCAAqC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UAC7F,MAAM,SAAS,SAAY,SAAY,0BAA0B,MAAM,GAAG,OAAO,yBAAyB;;MAE9G;AAEA,eAAS,sCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;AAEA,eAAS,oCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAA4C,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAC5F;AAEA,eAAS,qCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAA4C,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MAC5F;AAEA,eAAS,0BAA0B,MAAc,SAAe;AAC9D,eAAO,GAAG,IAAI;AACd,YAAI,SAAS,SAAS;AACpB,gBAAM,IAAI,UAAU,GAAG,OAAO,KAAK,IAAI,2DAA2D;;AAEpG,eAAO;MACT;ACvEgB,eAAA,uBAAuB,SACA,SAAe;AACpD,yBAAiB,SAAS,OAAO;AACjC,cAAM,gBAAgB,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC/B,eAAO,EAAE,eAAe,QAAQ,aAAa,EAAC;MAChD;ACPgB,eAAA,mBAAmB,SACA,SAAe;AAChD,yBAAiB,SAAS,OAAO;AACjC,cAAM,eAAe,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC9B,cAAM,gBAAgB,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC/B,cAAM,eAAe,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AAC9B,cAAM,SAAS,YAAO,QAAP,YAAA,SAAA,SAAA,QAAS;AACxB,YAAI,WAAW,QAAW;AACxB,4BAAkB,QAAQ,GAAG,OAAO,2BAA2B;;AAEjE,eAAO;UACL,cAAc,QAAQ,YAAY;UAClC,eAAe,QAAQ,aAAa;UACpC,cAAc,QAAQ,YAAY;UAClC;;MAEJ;AAEA,eAAS,kBAAkB,QAAiB,SAAe;AACzD,YAAI,CAACG,eAAc,MAAM,GAAG;AAC1B,gBAAM,IAAI,UAAU,GAAG,OAAO,yBAAyB;;MAE3D;ACpBgB,eAAA,4BACd,MACA,SAAe;AAEf,yBAAiB,MAAM,OAAO;AAE9B,cAAM,WAAW,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACvB,4BAAoB,UAAU,YAAY,sBAAsB;AAChE,6BAAqB,UAAU,GAAG,OAAO,6BAA6B;AAEtE,cAAM,WAAW,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AACvB,4BAAoB,UAAU,YAAY,sBAAsB;AAChE,6BAAqB,UAAU,GAAG,OAAO,6BAA6B;AAEtE,eAAO,EAAE,UAAU,SAAQ;MAC7B;YCkEaI,gBAAc;QAczB,YAAY,sBAAqF,CAAA,GACrF,cAAqD,CAAA,GAAE;AACjE,cAAI,wBAAwB,QAAW;AACrC,kCAAsB;iBACjB;AACL,yBAAa,qBAAqB,iBAAiB;;AAGrD,gBAAM,WAAW,uBAAuB,aAAa,kBAAkB;AACvE,gBAAM,mBAAmB,qCAAqC,qBAAqB,iBAAiB;AAEpG,mCAAyB,IAAI;AAE7B,cAAI,iBAAiB,SAAS,SAAS;AACrC,gBAAI,SAAS,SAAS,QAAW;AAC/B,oBAAM,IAAI,WAAW,4DAA4D;;AAEnF,kBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AACtD,kEACE,MACA,kBACA,aAAa;iBAEV;AAEL,kBAAM,gBAAgB,qBAAqB,QAAQ;AACnD,kBAAM,gBAAgB,qBAAqB,UAAU,CAAC;AACtD,qEACE,MACA,kBACA,eACA,aAAa;;;;;;QAQnB,IAAI,SAAM;AACR,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMH,4BAA0B,QAAQ;;AAG1C,iBAAO,uBAAuB,IAAI;;;;;;;;QASpC,OAAO,SAAc,QAAS;AAC5B,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,QAAQ,CAAC;;AAGhE,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBAAoB,IAAI,UAAU,kDAAkD,CAAC;;AAG9F,iBAAO,qBAAqB,MAAM,MAAM;;QAsB1C,UACE,aAAgE,QAAS;AAEzE,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,WAAW;;AAG7C,gBAAM,UAAU,qBAAqB,YAAY,iBAAiB;AAElE,cAAI,QAAQ,SAAS,QAAW;AAC9B,mBAAO,mCAAmC,IAAI;;AAIhD,iBAAO,gCAAgC,IAAqC;;QAc9E,YACE,cACA,aAAmD,CAAA,GAAE;AAErD,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,aAAa;;AAE/C,iCAAuB,cAAc,GAAG,aAAa;AAErD,gBAAM,YAAY,4BAA4B,cAAc,iBAAiB;AAC7E,gBAAM,UAAU,mBAAmB,YAAY,kBAAkB;AAEjE,cAAI,uBAAuB,IAAI,GAAG;AAChC,kBAAM,IAAI,UAAU,gFAAgF;;AAEtG,cAAI,uBAAuB,UAAU,QAAQ,GAAG;AAC9C,kBAAM,IAAI,UAAU,gFAAgF;;AAGtG,gBAAM,UAAU,qBACd,MAAM,UAAU,UAAU,QAAQ,cAAc,QAAQ,cAAc,QAAQ,eAAe,QAAQ,MAAM;AAG7G,oCAA0B,OAAO;AAEjC,iBAAO,UAAU;;QAWnB,OAAO,aACA,aAAmD,CAAA,GAAE;AAC1D,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,mBAAO,oBAAoBA,4BAA0B,QAAQ,CAAC;;AAGhE,cAAI,gBAAgB,QAAW;AAC7B,mBAAO,oBAAoB,sCAAsC;;AAEnE,cAAI,CAAC,iBAAiB,WAAW,GAAG;AAClC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAI9F,cAAI;AACJ,cAAI;AACF,sBAAU,mBAAmB,YAAY,kBAAkB;mBACpDJ,IAAG;AACV,mBAAO,oBAAoBA,EAAC;;AAG9B,cAAI,uBAAuB,IAAI,GAAG;AAChC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAG9F,cAAI,uBAAuB,WAAW,GAAG;AACvC,mBAAO,oBACL,IAAI,UAAU,2EAA2E,CAAC;;AAI9F,iBAAO,qBACL,MAAM,aAAa,QAAQ,cAAc,QAAQ,cAAc,QAAQ,eAAe,QAAQ,MAAM;;;;;;;;;;;;;QAexG,MAAG;AACD,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMI,4BAA0B,KAAK;;AAGvC,gBAAM,WAAW,kBAAkB,IAAW;AAC9C,iBAAO,oBAAoB,QAAQ;;QAerC,OAAO,aAA+D,QAAS;AAC7E,cAAI,CAAC,iBAAiB,IAAI,GAAG;AAC3B,kBAAMA,4BAA0B,QAAQ;;AAG1C,gBAAM,UAAU,uBAAuB,YAAY,iBAAiB;AACpE,iBAAO,mCAAsC,MAAM,QAAQ,aAAa;;QAQ1E,CAAC,mBAAmB,EAAE,SAAuC;AAE3D,iBAAO,KAAK,OAAO,OAAO;;;;;;;;QAS5B,OAAO,KAAQ,eAAqE;AAClF,iBAAO,mBAAmB,aAAa;;MAE1C;AAED,aAAO,iBAAiBG,iBAAgB;QACtC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,aAAO,iBAAiBA,gBAAe,WAAW;QAChD,QAAQ,EAAE,YAAY,KAAI;QAC1B,WAAW,EAAE,YAAY,KAAI;QAC7B,aAAa,EAAE,YAAY,KAAI;QAC/B,QAAQ,EAAE,YAAY,KAAI;QAC1B,KAAK,EAAE,YAAY,KAAI;QACvB,QAAQ,EAAE,YAAY,KAAI;QAC1B,QAAQ,EAAE,YAAY,KAAI;MAC3B,CAAA;AACD,sBAAgBA,gBAAe,MAAM,MAAM;AAC3C,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,sBAAgBA,gBAAe,UAAU,WAAW,WAAW;AAC/D,sBAAgBA,gBAAe,UAAU,aAAa,aAAa;AACnE,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,sBAAgBA,gBAAe,UAAU,KAAK,KAAK;AACnD,sBAAgBA,gBAAe,UAAU,QAAQ,QAAQ;AACzD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAeA,gBAAe,WAAW,OAAO,aAAa;UAClE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AACA,aAAO,eAAeA,gBAAe,WAAW,qBAAqB;QACnE,OAAOA,gBAAe,UAAU;QAChC,UAAU;QACV,cAAc;MACf,CAAA;eAwBe,qBACd,gBACA,eACA,iBACA,gBAAgB,GAChB,gBAAgD,MAAM,GAAC;AAIvD,cAAM,SAAmC,OAAO,OAAOA,gBAAe,SAAS;AAC/E,iCAAyB,MAAM;AAE/B,cAAM,aAAiD,OAAO,OAAO,gCAAgC,SAAS;AAC9G,6CACE,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,eAAe,aAAa;AAGlG,eAAO;MACT;eAGgB,yBACd,gBACA,eACA,iBAA+C;AAE/C,cAAM,SAA6B,OAAO,OAAOA,gBAAe,SAAS;AACzE,iCAAyB,MAAM;AAE/B,cAAM,aAA2C,OAAO,OAAO,6BAA6B,SAAS;AACrG,0CAAkC,QAAQ,YAAY,gBAAgB,eAAe,iBAAiB,GAAG,MAAS;AAElH,eAAO;MACT;AAEA,eAAS,yBAAyB,QAAsB;AACtD,eAAO,SAAS;AAChB,eAAO,UAAU;AACjB,eAAO,eAAe;AACtB,eAAO,aAAa;MACtB;AAEM,eAAU,iBAAiBX,IAAU;AACzC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,2BAA2B,GAAG;AACzE,iBAAO;;AAGT,eAAOA,cAAaW;MACtB;AAQM,eAAU,uBAAuB,QAAsB;AAG3D,YAAI,OAAO,YAAY,QAAW;AAChC,iBAAO;;AAGT,eAAO;MACT;AAIgB,eAAA,qBAAwB,QAA2B,QAAW;AAC5E,eAAO,aAAa;AAEpB,YAAI,OAAO,WAAW,UAAU;AAC9B,iBAAO,oBAAoB,MAAS;;AAEtC,YAAI,OAAO,WAAW,WAAW;AAC/B,iBAAO,oBAAoB,OAAO,YAAY;;AAGhD,4BAAoB,MAAM;AAE1B,cAAM,SAAS,OAAO;AACtB,YAAI,WAAW,UAAa,2BAA2B,MAAM,GAAG;AAC9D,gBAAM,mBAAmB,OAAO;AAChC,iBAAO,oBAAoB,IAAI,YAAW;AAC1C,2BAAiB,QAAQ,qBAAkB;AACzC,4BAAgB,YAAY,MAAS;UACvC,CAAC;;AAGH,cAAM,sBAAsB,OAAO,0BAA0B,WAAW,EAAE,MAAM;AAChF,eAAO,qBAAqB,qBAAqBZ,KAAI;MACvD;AAEM,eAAU,oBAAuB,QAAyB;AAG9D,eAAO,SAAS;AAEhB,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB;;AAGF,0CAAkC,MAAM;AAExC,YAAI,8BAAiC,MAAM,GAAG;AAC5C,gBAAM,eAAe,OAAO;AAC5B,iBAAO,gBAAgB,IAAI,YAAW;AACtC,uBAAa,QAAQ,iBAAc;AACjC,wBAAY,YAAW;UACzB,CAAC;;MAEL;AAEgB,eAAA,oBAAuB,QAA2BK,IAAM;AAItE,eAAO,SAAS;AAChB,eAAO,eAAeA;AAEtB,cAAM,SAAS,OAAO;AAEtB,YAAI,WAAW,QAAW;AACxB;;AAGF,yCAAiC,QAAQA,EAAC;AAE1C,YAAI,8BAAiC,MAAM,GAAG;AAC5C,uDAA6C,QAAQA,EAAC;eACjD;AAEL,wDAA8C,QAAQA,EAAC;;MAE3D;AAqBA,eAASI,4BAA0B,MAAY;AAC7C,eAAO,IAAI,UAAU,4BAA4B,IAAI,uCAAuC;MAC9F;ACljBgB,eAAA,2BAA2B,MACA,SAAe;AACxD,yBAAiB,MAAM,OAAO;AAC9B,cAAM,gBAAgB,SAAI,QAAJ,SAAA,SAAA,SAAA,KAAM;AAC5B,4BAAoB,eAAe,iBAAiB,qBAAqB;AACzE,eAAO;UACL,eAAe,0BAA0B,aAAa;;MAE1D;ACLA,YAAM,yBAAyB,CAAC,UAAkC;AAChE,eAAO,MAAM;MACf;AACA,sBAAgB,wBAAwB,MAAM;MAOhC,MAAO,0BAAyB;QAI5C,YAAY,SAA4B;AACtC,iCAAuB,SAAS,GAAG,2BAA2B;AAC9D,oBAAU,2BAA2B,SAAS,iBAAiB;AAC/D,eAAK,0CAA0C,QAAQ;;;;;QAMzD,IAAI,gBAAa;AACf,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,8BAA8B,eAAe;;AAErD,iBAAO,KAAK;;;;;QAMd,IAAI,OAAI;AACN,cAAI,CAAC,4BAA4B,IAAI,GAAG;AACtC,kBAAM,8BAA8B,MAAM;;AAE5C,iBAAO;;MAEV;AAED,aAAO,iBAAiB,0BAA0B,WAAW;QAC3D,eAAe,EAAE,YAAY,KAAI;QACjC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,0BAA0B,WAAW,OAAO,aAAa;UAC7E,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,8BAA8B,MAAY;AACjD,eAAO,IAAI,UAAU,uCAAuC,IAAI,kDAAkD;MACpH;AAEM,eAAU,4BAA4BR,IAAM;AAChD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,yCAAyC,GAAG;AACvF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;ACpEA,YAAM,oBAAoB,MAAQ;AAChC,eAAO;MACT;AACA,sBAAgB,mBAAmB,MAAM;MAO3B,MAAO,qBAAoB;QAIvC,YAAY,SAA4B;AACtC,iCAAuB,SAAS,GAAG,sBAAsB;AACzD,oBAAU,2BAA2B,SAAS,iBAAiB;AAC/D,eAAK,qCAAqC,QAAQ;;;;;QAMpD,IAAI,gBAAa;AACf,cAAI,CAAC,uBAAuB,IAAI,GAAG;AACjC,kBAAM,yBAAyB,eAAe;;AAEhD,iBAAO,KAAK;;;;;;QAOd,IAAI,OAAI;AACN,cAAI,CAAC,uBAAuB,IAAI,GAAG;AACjC,kBAAM,yBAAyB,MAAM;;AAEvC,iBAAO;;MAEV;AAED,aAAO,iBAAiB,qBAAqB,WAAW;QACtD,eAAe,EAAE,YAAY,KAAI;QACjC,MAAM,EAAE,YAAY,KAAI;MACzB,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,qBAAqB,WAAW,OAAO,aAAa;UACxE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,yBAAyB,MAAY;AAC5C,eAAO,IAAI,UAAU,kCAAkC,IAAI,6CAA6C;MAC1G;AAEM,eAAU,uBAAuBA,IAAM;AAC3C,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,oCAAoC,GAAG;AAClF,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AC/DgB,eAAA,mBAAyB,UACA,SAAe;AACtD,yBAAiB,UAAU,OAAO;AAClC,cAAM,SAAS,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACzB,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,eAAe,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC/B,cAAM,QAAQ,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AACxB,cAAM,YAAY,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC5B,cAAM,eAAe,aAAQ,QAAR,aAAA,SAAA,SAAA,SAAU;AAC/B,eAAO;UACL,QAAQ,WAAW,SACjB,SACA,iCAAiC,QAAQ,UAAW,GAAG,OAAO,2BAA2B;UAC3F,OAAO,UAAU,SACf,SACA,gCAAgC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UACxF;UACA,OAAO,UAAU,SACf,SACA,gCAAgC,OAAO,UAAW,GAAG,OAAO,0BAA0B;UACxF,WAAW,cAAc,SACvB,SACA,oCAAoC,WAAW,UAAW,GAAG,OAAO,8BAA8B;UACpG;;MAEJ;AAEA,eAAS,gCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAoD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MACpG;AAEA,eAAS,gCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,eAAoD,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC;MACpG;AAEA,eAAS,oCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,OAAU,eAAoD,YAAY,IAAI,UAAU,CAAC,OAAO,UAAU,CAAC;MACrH;AAEA,eAAS,iCACP,IACA,UACA,SAAe;AAEf,uBAAe,IAAI,OAAO;AAC1B,eAAO,CAAC,WAAgB,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC;MAC5D;YC7Ba,gBAAe;QAmB1B,YAAY,iBAAuD,CAAA,GACvD,sBAA6D,CAAA,GAC7D,sBAA6D,CAAA,GAAE;AACzE,cAAI,mBAAmB,QAAW;AAChC,6BAAiB;;AAGnB,gBAAM,mBAAmB,uBAAuB,qBAAqB,kBAAkB;AACvF,gBAAM,mBAAmB,uBAAuB,qBAAqB,iBAAiB;AAEtF,gBAAM,cAAc,mBAAmB,gBAAgB,iBAAiB;AACxE,cAAI,YAAY,iBAAiB,QAAW;AAC1C,kBAAM,IAAI,WAAW,gCAAgC;;AAEvD,cAAI,YAAY,iBAAiB,QAAW;AAC1C,kBAAM,IAAI,WAAW,gCAAgC;;AAGvD,gBAAM,wBAAwB,qBAAqB,kBAAkB,CAAC;AACtE,gBAAM,wBAAwB,qBAAqB,gBAAgB;AACnE,gBAAM,wBAAwB,qBAAqB,kBAAkB,CAAC;AACtE,gBAAM,wBAAwB,qBAAqB,gBAAgB;AAEnE,cAAI;AACJ,gBAAM,eAAe,WAAiB,aAAU;AAC9C,mCAAuB;UACzB,CAAC;AAED,oCACE,MAAM,cAAc,uBAAuB,uBAAuB,uBAAuB,qBAAqB;AAEhH,+DAAqD,MAAM,WAAW;AAEtE,cAAI,YAAY,UAAU,QAAW;AACnC,iCAAqB,YAAY,MAAM,KAAK,0BAA0B,CAAC;iBAClE;AACL,iCAAqB,MAAS;;;;;;QAOlC,IAAI,WAAQ;AACV,cAAI,CAAC,kBAAkB,IAAI,GAAG;AAC5B,kBAAM,0BAA0B,UAAU;;AAG5C,iBAAO,KAAK;;;;;QAMd,IAAI,WAAQ;AACV,cAAI,CAAC,kBAAkB,IAAI,GAAG;AAC5B,kBAAM,0BAA0B,UAAU;;AAG5C,iBAAO,KAAK;;MAEf;AAED,aAAO,iBAAiB,gBAAgB,WAAW;QACjD,UAAU,EAAE,YAAY,KAAI;QAC5B,UAAU,EAAE,YAAY,KAAI;MAC7B,CAAA;AACD,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,gBAAgB,WAAW,OAAO,aAAa;UACnE,OAAO;UACP,cAAc;QACf,CAAA;MACH;AA0CA,eAAS,0BAAgC,QACA,cACA,uBACA,uBACA,uBACA,uBAAqD;AAC5F,iBAAS,iBAAc;AACrB,iBAAO;;AAGT,iBAAS,eAAe,OAAQ;AAC9B,iBAAO,yCAAyC,QAAQ,KAAK;;AAG/D,iBAAS,eAAe,QAAW;AACjC,iBAAO,yCAAyC,QAAQ,MAAM;;AAGhE,iBAAS,iBAAc;AACrB,iBAAO,yCAAyC,MAAM;;AAGxD,eAAO,YAAY,qBAAqB,gBAAgB,gBAAgB,gBAAgB,gBAChD,uBAAuB,qBAAqB;AAEpF,iBAAS,gBAAa;AACpB,iBAAO,0CAA0C,MAAM;;AAGzD,iBAAS,gBAAgB,QAAW;AAClC,iBAAO,4CAA4C,QAAQ,MAAM;;AAGnE,eAAO,YAAY,qBAAqB,gBAAgB,eAAe,iBAAiB,uBAChD,qBAAqB;AAG7D,eAAO,gBAAgB;AACvB,eAAO,6BAA6B;AACpC,eAAO,qCAAqC;AAC5C,uCAA+B,QAAQ,IAAI;AAE3C,eAAO,6BAA6B;MACtC;AAEA,eAAS,kBAAkBA,IAAU;AACnC,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,4BAA4B,GAAG;AAC1E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAGA,eAAS,qBAAqB,QAAyBI,IAAM;AAC3D,6CAAqC,OAAO,UAAU,2BAA2BA,EAAC;AAClF,oDAA4C,QAAQA,EAAC;MACvD;AAEA,eAAS,4CAA4C,QAAyBA,IAAM;AAClF,wDAAgD,OAAO,0BAA0B;AACjF,qDAA6C,OAAO,UAAU,2BAA2BA,EAAC;AAC1F,oCAA4B,MAAM;MACpC;AAEA,eAAS,4BAA4B,QAAuB;AAC1D,YAAI,OAAO,eAAe;AAIxB,yCAA+B,QAAQ,KAAK;;MAEhD;AAEA,eAAS,+BAA+B,QAAyB,cAAqB;AAIpF,YAAI,OAAO,+BAA+B,QAAW;AACnD,iBAAO,mCAAkC;;AAG3C,eAAO,6BAA6B,WAAW,aAAU;AACvD,iBAAO,qCAAqC;QAC9C,CAAC;AAED,eAAO,gBAAgB;MACzB;YASa,iCAAgC;QAgB3C,cAAA;AACE,gBAAM,IAAI,UAAU,qBAAqB;;;;;QAM3C,IAAI,cAAW;AACb,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,aAAa;;AAG1D,gBAAM,qBAAqB,KAAK,2BAA2B,UAAU;AACrE,iBAAO,8CAA8C,kBAAkB;;QAOzE,QAAQ,QAAW,QAAU;AAC3B,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,SAAS;;AAGtD,kDAAwC,MAAM,KAAK;;;;;;QAOrD,MAAM,SAAc,QAAS;AAC3B,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,OAAO;;AAGpD,gDAAsC,MAAM,MAAM;;;;;;QAOpD,YAAS;AACP,cAAI,CAAC,mCAAmC,IAAI,GAAG;AAC7C,kBAAM,qCAAqC,WAAW;;AAGxD,oDAA0C,IAAI;;MAEjD;AAED,aAAO,iBAAiB,iCAAiC,WAAW;QAClE,SAAS,EAAE,YAAY,KAAI;QAC3B,OAAO,EAAE,YAAY,KAAI;QACzB,WAAW,EAAE,YAAY,KAAI;QAC7B,aAAa,EAAE,YAAY,KAAI;MAChC,CAAA;AACD,sBAAgB,iCAAiC,UAAU,SAAS,SAAS;AAC7E,sBAAgB,iCAAiC,UAAU,OAAO,OAAO;AACzE,sBAAgB,iCAAiC,UAAU,WAAW,WAAW;AACjF,UAAI,OAAO,OAAO,gBAAgB,UAAU;AAC1C,eAAO,eAAe,iCAAiC,WAAW,OAAO,aAAa;UACpF,OAAO;UACP,cAAc;QACf,CAAA;MACH;AAIA,eAAS,mCAA4CJ,IAAM;AACzD,YAAI,CAAC,aAAaA,EAAC,GAAG;AACpB,iBAAO;;AAGT,YAAI,CAAC,OAAO,UAAU,eAAe,KAAKA,IAAG,4BAA4B,GAAG;AAC1E,iBAAO;;AAGT,eAAOA,cAAa;MACtB;AAEA,eAAS,sCAA4C,QACA,YACA,oBACA,gBACA,iBAA+C;AAIlG,mBAAW,6BAA6B;AACxC,eAAO,6BAA6B;AAEpC,mBAAW,sBAAsB;AACjC,mBAAW,kBAAkB;AAC7B,mBAAW,mBAAmB;AAE9B,mBAAW,iBAAiB;AAC5B,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAEA,eAAS,qDAA2D,QACA,aAAuC;AACzG,cAAM,aAAkD,OAAO,OAAO,iCAAiC,SAAS;AAEhH,YAAI;AACJ,YAAI;AACJ,YAAI;AAEJ,YAAI,YAAY,cAAc,QAAW;AACvC,+BAAqB,WAAS,YAAY,UAAW,OAAO,UAAU;eACjE;AACL,+BAAqB,WAAQ;AAC3B,gBAAI;AACF,sDAAwC,YAAY,KAAqB;AACzE,qBAAO,oBAAoB,MAAS;qBAC7B,kBAAkB;AACzB,qBAAO,oBAAoB,gBAAgB;;UAE/C;;AAGF,YAAI,YAAY,UAAU,QAAW;AACnC,2BAAiB,MAAM,YAAY,MAAO,UAAU;eAC/C;AACL,2BAAiB,MAAM,oBAAoB,MAAS;;AAGtD,YAAI,YAAY,WAAW,QAAW;AACpC,4BAAkB,YAAU,YAAY,OAAQ,MAAM;eACjD;AACL,4BAAkB,MAAM,oBAAoB,MAAS;;AAGvD,8CAAsC,QAAQ,YAAY,oBAAoB,gBAAgB,eAAe;MAC/G;AAEA,eAAS,gDAAgD,YAAiD;AACxG,mBAAW,sBAAsB;AACjC,mBAAW,kBAAkB;AAC7B,mBAAW,mBAAmB;MAChC;AAEA,eAAS,wCAA2C,YAAiD,OAAQ;AAC3G,cAAM,SAAS,WAAW;AAC1B,cAAM,qBAAqB,OAAO,UAAU;AAC5C,YAAI,CAAC,iDAAiD,kBAAkB,GAAG;AACzE,gBAAM,IAAI,UAAU,sDAAsD;;AAM5E,YAAI;AACF,iDAAuC,oBAAoB,KAAK;iBACzDI,IAAG;AAEV,sDAA4C,QAAQA,EAAC;AAErD,gBAAM,OAAO,UAAU;;AAGzB,cAAM,eAAe,+CAA+C,kBAAkB;AACtF,YAAI,iBAAiB,OAAO,eAAe;AAEzC,yCAA+B,QAAQ,IAAI;;MAE/C;AAEA,eAAS,sCAAsC,YAAmDA,IAAM;AACtG,6BAAqB,WAAW,4BAA4BA,EAAC;MAC/D;AAEA,eAAS,iDAAuD,YACA,OAAQ;AACtE,cAAM,mBAAmB,WAAW,oBAAoB,KAAK;AAC7D,eAAO,qBAAqB,kBAAkB,QAAW,CAAAE,OAAI;AAC3D,+BAAqB,WAAW,4BAA4BA,EAAC;AAC7D,gBAAMA;QACR,CAAC;MACH;AAEA,eAAS,0CAA6C,YAA+C;AACnG,cAAM,SAAS,WAAW;AAC1B,cAAM,qBAAqB,OAAO,UAAU;AAE5C,6CAAqC,kBAAkB;AAEvD,cAAM,QAAQ,IAAI,UAAU,4BAA4B;AACxD,oDAA4C,QAAQ,KAAK;MAC3D;AAIA,eAAS,yCAA+C,QAA+B,OAAQ;AAG7F,cAAM,aAAa,OAAO;AAE1B,YAAI,OAAO,eAAe;AACxB,gBAAM,4BAA4B,OAAO;AAEzC,iBAAO,qBAAqB,2BAA2B,MAAK;AAC1D,kBAAM,WAAW,OAAO;AACxB,kBAAM,QAAQ,SAAS;AACvB,gBAAI,UAAU,YAAY;AACxB,oBAAM,SAAS;;AAGjB,mBAAO,iDAAuD,YAAY,KAAK;UACjF,CAAC;;AAGH,eAAO,iDAAuD,YAAY,KAAK;MACjF;AAEA,eAAS,yCAA+C,QAA+B,QAAW;AAChG,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAIxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,gBAAgB,WAAW,iBAAiB,MAAM;AACxD,wDAAgD,UAAU;AAE1D,oBAAY,eAAe,MAAK;AAC9B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,iDAAqC,SAAS,2BAA2B,MAAM;AAC/E,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,+CAAqC,SAAS,2BAA2BA,EAAC;AAC1E,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAEA,eAAS,yCAA+C,QAA6B;AACnF,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAIxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,eAAe,WAAW,gBAAe;AAC/C,wDAAgD,UAAU;AAE1D,oBAAY,cAAc,MAAK;AAC7B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,iDAAqC,SAAS,yBAAyB;AACvE,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,+CAAqC,SAAS,2BAA2BA,EAAC;AAC1E,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAIA,eAAS,0CAA0C,QAAuB;AAMxE,uCAA+B,QAAQ,KAAK;AAG5C,eAAO,OAAO;MAChB;AAEA,eAAS,4CAAkD,QAA+B,QAAW;AACnG,cAAM,aAAa,OAAO;AAC1B,YAAI,WAAW,mBAAmB,QAAW;AAC3C,iBAAO,WAAW;;AAIpB,cAAM,WAAW,OAAO;AAKxB,mBAAW,iBAAiB,WAAW,CAAC,SAAS,WAAU;AACzD,qBAAW,yBAAyB;AACpC,qBAAW,wBAAwB;QACrC,CAAC;AAED,cAAM,gBAAgB,WAAW,iBAAiB,MAAM;AACxD,wDAAgD,UAAU;AAE1D,oBAAY,eAAe,MAAK;AAC9B,cAAI,SAAS,WAAW,WAAW;AACjC,iDAAqC,YAAY,SAAS,YAAY;iBACjE;AACL,yDAA6C,SAAS,2BAA2B,MAAM;AACvF,wCAA4B,MAAM;AAClC,kDAAsC,UAAU;;AAElD,iBAAO;WACN,CAAAA,OAAI;AACL,uDAA6C,SAAS,2BAA2BA,EAAC;AAClF,sCAA4B,MAAM;AAClC,+CAAqC,YAAYA,EAAC;AAClD,iBAAO;QACT,CAAC;AAED,eAAO,WAAW;MACpB;AAIA,eAAS,qCAAqC,MAAY;AACxD,eAAO,IAAI,UACT,8CAA8C,IAAI,yDAAyD;MAC/G;AAEM,eAAU,sCAAsC,YAAiD;AACrG,YAAI,WAAW,2BAA2B,QAAW;AACnD;;AAGF,mBAAW,uBAAsB;AACjC,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAEgB,eAAA,qCAAqC,YAAmD,QAAW;AACjH,YAAI,WAAW,0BAA0B,QAAW;AAClD;;AAGF,kCAA0B,WAAW,cAAe;AACpD,mBAAW,sBAAsB,MAAM;AACvC,mBAAW,yBAAyB;AACpC,mBAAW,wBAAwB;MACrC;AAIA,eAAS,0BAA0B,MAAY;AAC7C,eAAO,IAAI,UACT,6BAA6B,IAAI,wCAAwC;MAC7E;;;;;;;;;;;;;;;;;;;AC7pBA;AAAA;AAEA,QAAMM,aAAY;AAElB,QAAI,CAAC,WAAW,gBAAgB;AAI9B,UAAI;AACF,cAAMC,WAAU,QAAQ,SAAc;AACtC,cAAM,EAAE,YAAY,IAAIA;AACxB,YAAI;AACF,UAAAA,SAAQ,cAAc,MAAM;AAAA,UAAC;AAC7B,iBAAO,OAAO,YAAY,QAAQ,YAAiB,CAAC;AACpD,UAAAA,SAAQ,cAAc;AAAA,QACxB,SAAS,OAAO;AACd,UAAAA,SAAQ,cAAc;AACtB,gBAAM;AAAA,QACR;AAAA,MACF,SAAS,OAAO;AAEd,eAAO,OAAO,YAAY,yBAAuD;AAAA,MACnF;AAAA,IACF;AAEA,QAAI;AAGF,YAAM,EAAE,MAAAC,MAAK,IAAI,QAAQ,QAAQ;AACjC,UAAIA,SAAQ,CAACA,MAAK,UAAU,QAAQ;AAClC,QAAAA,MAAK,UAAU,SAAS,SAAS,KAAM,QAAQ;AAC7C,cAAI,WAAW;AACf,gBAAM,OAAO;AAEb,iBAAO,IAAI,eAAe;AAAA,YACxB,MAAM;AAAA,YACN,MAAM,KAAM,MAAM;AAChB,oBAAM,QAAQ,KAAK,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,WAAWF,UAAS,CAAC;AAC5E,oBAAM,SAAS,MAAM,MAAM,YAAY;AACvC,0BAAY,OAAO;AACnB,mBAAK,QAAQ,IAAI,WAAW,MAAM,CAAC;AAEnC,kBAAI,aAAa,KAAK,MAAM;AAC1B,qBAAK,MAAM;AAAA,cACb;AAAA,YACF;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AAAA,IAAC;AAAA;AAAA;;;ACtCjB,gBAAiB,WAAY,OAAOG,SAAQ,MAAM;AAChD,aAAW,QAAQ,OAAO;AACxB,QAAI,YAAY,MAAM;AACpB;AAAA;AAAA,QAA2D,KAAK,OAAO;AAAA;AAAA,IACzE,WAAW,YAAY,OAAO,IAAI,GAAG;AACnC,UAAIA,QAAO;AACT,YAAI,WAAW,KAAK;AACpB,cAAM,MAAM,KAAK,aAAa,KAAK;AACnC,eAAO,aAAa,KAAK;AACvB,gBAAM,OAAO,KAAK,IAAI,MAAM,UAAU,SAAS;AAC/C,gBAAM,QAAQ,KAAK,OAAO,MAAM,UAAU,WAAW,IAAI;AACzD,sBAAY,MAAM;AAClB,gBAAM,IAAI,WAAW,KAAK;AAAA,QAC5B;AAAA,MACF,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IAEF,OAAO;AAEL,UAAI,WAAW,GAAG;AAAA;AAAA,QAA0B;AAAA;AAC5C,aAAO,aAAa,EAAE,MAAM;AAC1B,cAAM,QAAQ,EAAE,MAAM,UAAU,KAAK,IAAI,EAAE,MAAM,WAAW,SAAS,CAAC;AACtE,cAAM,SAAS,MAAM,MAAM,YAAY;AACvC,oBAAY,OAAO;AACnB,cAAM,IAAI,WAAW,MAAM;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AACF;AAxCA,IAKA,gBAGM,WAkCA,OA8MOC,OACN;AAzPP;AAAA;AAKA,qBAAO;AAGP,IAAM,YAAY;AAkClB,IAAM,QAAQ,MAAM,KAAK;AAAA;AAAA,MAEvB,SAAS,CAAC;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUX,YAAa,YAAY,CAAC,GAAG,UAAU,CAAC,GAAG;AACzC,YAAI,OAAO,cAAc,YAAY,cAAc,MAAM;AACvD,gBAAM,IAAI,UAAU,mFAAqF;AAAA,QAC3G;AAEA,YAAI,OAAO,UAAU,OAAO,QAAQ,MAAM,YAAY;AACpD,gBAAM,IAAI,UAAU,kFAAoF;AAAA,QAC1G;AAEA,YAAI,OAAO,YAAY,YAAY,OAAO,YAAY,YAAY;AAChE,gBAAM,IAAI,UAAU,uEAAyE;AAAA,QAC/F;AAEA,YAAI,YAAY,KAAM,WAAU,CAAC;AAEjC,cAAM,UAAU,IAAI,YAAY;AAChC,mBAAW,WAAW,WAAW;AAC/B,cAAI;AACJ,cAAI,YAAY,OAAO,OAAO,GAAG;AAC/B,mBAAO,IAAI,WAAW,QAAQ,OAAO,MAAM,QAAQ,YAAY,QAAQ,aAAa,QAAQ,UAAU,CAAC;AAAA,UACzG,WAAW,mBAAmB,aAAa;AACzC,mBAAO,IAAI,WAAW,QAAQ,MAAM,CAAC,CAAC;AAAA,UACxC,WAAW,mBAAmB,MAAM;AAClC,mBAAO;AAAA,UACT,OAAO;AACL,mBAAO,QAAQ,OAAO,GAAG,OAAO,EAAE;AAAA,UACpC;AAEA,eAAK,SAAS,YAAY,OAAO,IAAI,IAAI,KAAK,aAAa,KAAK;AAChE,eAAK,OAAO,KAAK,IAAI;AAAA,QACvB;AAEA,aAAK,WAAW,GAAG,QAAQ,YAAY,SAAY,gBAAgB,QAAQ,OAAO;AAClF,cAAM,OAAO,QAAQ,SAAS,SAAY,KAAK,OAAO,QAAQ,IAAI;AAClE,aAAK,QAAQ,iBAAiB,KAAK,IAAI,IAAI,OAAO;AAAA,MACpD;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA;AAAA;AAAA;AAAA,MAKA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASA,MAAM,OAAQ;AAGZ,cAAM,UAAU,IAAI,YAAY;AAChC,YAAI,MAAM;AACV,yBAAiB,QAAQ,WAAW,KAAK,QAAQ,KAAK,GAAG;AACvD,iBAAO,QAAQ,OAAO,MAAM,EAAE,QAAQ,KAAK,CAAC;AAAA,QAC9C;AAEA,eAAO,QAAQ,OAAO;AACtB,eAAO;AAAA,MACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASA,MAAM,cAAe;AAMnB,cAAM,OAAO,IAAI,WAAW,KAAK,IAAI;AACrC,YAAI,SAAS;AACb,yBAAiB,SAAS,WAAW,KAAK,QAAQ,KAAK,GAAG;AACxD,eAAK,IAAI,OAAO,MAAM;AACtB,oBAAU,MAAM;AAAA,QAClB;AAEA,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,SAAU;AACR,cAAM,KAAK,WAAW,KAAK,QAAQ,IAAI;AAEvC,eAAO,IAAI,WAAW,eAAe;AAAA;AAAA,UAEnC,MAAM;AAAA,UACN,MAAM,KAAM,MAAM;AAChB,kBAAM,QAAQ,MAAM,GAAG,KAAK;AAC5B,kBAAM,OAAO,KAAK,MAAM,IAAI,KAAK,QAAQ,MAAM,KAAK;AAAA,UACtD;AAAA,UAEA,MAAM,SAAU;AACd,kBAAM,GAAG,OAAO;AAAA,UAClB;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAWA,MAAO,QAAQ,GAAG,MAAM,KAAK,MAAM,OAAO,IAAI;AAC5C,cAAM,EAAE,KAAK,IAAI;AAEjB,YAAI,gBAAgB,QAAQ,IAAI,KAAK,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,IAAI,OAAO,IAAI;AAChF,YAAI,cAAc,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI;AAExE,cAAM,OAAO,KAAK,IAAI,cAAc,eAAe,CAAC;AACpD,cAAM,QAAQ,KAAK;AACnB,cAAM,YAAY,CAAC;AACnB,YAAI,QAAQ;AAEZ,mBAAW,QAAQ,OAAO;AAExB,cAAI,SAAS,MAAM;AACjB;AAAA,UACF;AAEA,gBAAMC,QAAO,YAAY,OAAO,IAAI,IAAI,KAAK,aAAa,KAAK;AAC/D,cAAI,iBAAiBA,SAAQ,eAAe;AAG1C,6BAAiBA;AACjB,2BAAeA;AAAA,UACjB,OAAO;AACL,gBAAI;AACJ,gBAAI,YAAY,OAAO,IAAI,GAAG;AAC5B,sBAAQ,KAAK,SAAS,eAAe,KAAK,IAAIA,OAAM,WAAW,CAAC;AAChE,uBAAS,MAAM;AAAA,YACjB,OAAO;AACL,sBAAQ,KAAK,MAAM,eAAe,KAAK,IAAIA,OAAM,WAAW,CAAC;AAC7D,uBAAS,MAAM;AAAA,YACjB;AACA,2BAAeA;AACf,sBAAU,KAAK,KAAK;AACpB,4BAAgB;AAAA,UAClB;AAAA,QACF;AAEA,cAAM,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,OAAO,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9D,aAAK,QAAQ;AACb,aAAK,SAAS;AAEd,eAAO;AAAA,MACT;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,MAEA,QAAQ,OAAO,WAAW,EAAG,QAAQ;AACnC,eACE,UACA,OAAO,WAAW,YAClB,OAAO,OAAO,gBAAgB,eAE5B,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,gBAAgB,eAEhC,gBAAgB,KAAK,OAAO,OAAO,WAAW,CAAC;AAAA,MAEnD;AAAA,IACF;AAEA,WAAO,iBAAiB,MAAM,WAAW;AAAA,MACvC,MAAM,EAAE,YAAY,KAAK;AAAA,MACzB,MAAM,EAAE,YAAY,KAAK;AAAA,MACzB,OAAO,EAAE,YAAY,KAAK;AAAA,IAC5B,CAAC;AAGM,IAAMD,QAAO;AACpB,IAAO,qBAAQA;AAAA;AAAA;;;ACzPf,IAEM,OA6COE,OACN;AAhDP;AAAA;AAAA;AAEA,IAAM,QAAQ,MAAM,aAAa,mBAAK;AAAA,MACpC,gBAAgB;AAAA,MAChB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOR,YAAa,UAAU,UAAU,UAAU,CAAC,GAAG;AAC7C,YAAI,UAAU,SAAS,GAAG;AACxB,gBAAM,IAAI,UAAU,8DAA8D,UAAU,MAAM,WAAW;AAAA,QAC/G;AACA,cAAM,UAAU,OAAO;AAEvB,YAAI,YAAY,KAAM,WAAU,CAAC;AAGjC,cAAM,eAAe,QAAQ,iBAAiB,SAAY,KAAK,IAAI,IAAI,OAAO,QAAQ,YAAY;AAClG,YAAI,CAAC,OAAO,MAAM,YAAY,GAAG;AAC/B,eAAK,gBAAgB;AAAA,QACvB;AAEA,aAAK,QAAQ,OAAO,QAAQ;AAAA,MAC9B;AAAA,MAEA,IAAI,OAAQ;AACV,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,IAAI,eAAgB;AAClB,eAAO,KAAK;AAAA,MACd;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,MAEA,QAAQ,OAAO,WAAW,EAAG,QAAQ;AACnC,eAAO,CAAC,CAAC,UAAU,kBAAkB,sBACnC,WAAW,KAAK,OAAO,OAAO,WAAW,CAAC;AAAA,MAC9C;AAAA,IACF;AAGO,IAAMA,QAAO;AACpB,IAAO,eAAQA;AAAA;AAAA;;;ACfR,SAAS,eAAgBC,IAAE,IAAE,oBAAE;AACtC,MAAI,IAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG,EAAE,SAAS,IAAI,GAAG,GAAE,IAAE,CAAC,GAAE,IAAE,KAAK,CAAC;AAAA;AAClF,EAAAA,GAAE,QAAQ,CAAC,GAAE,MAAI,OAAO,KAAG,WAC1B,EAAE,KAAK,IAAE,EAAE,CAAC,IAAE;AAAA;AAAA,EAAY,EAAE,QAAQ,uBAAuB,MAAM,CAAC;AAAA,CAAM,IACxE,EAAE,KAAK,IAAE,EAAE,CAAC,IAAE,gBAAgB,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA,gBAAsB,EAAE,QAAM,0BAA0B;AAAA;AAAA,GAAY,GAAG,MAAM,CAAC;AACzH,IAAE,KAAK,KAAK,CAAC,IAAI;AACjB,SAAO,IAAI,EAAE,GAAE,EAAC,MAAK,mCAAiC,EAAC,CAAC;AAAC;AAvCzD,IAKiB,GAAW,GAAc,GAC1C,GACA,GACA,GACA,GACA,GAKa;AAfb;AAAA;AAEA;AACA;AAEA,KAAI,EAAC,aAAY,GAAE,UAAS,GAAE,aAAY,MAAG;AAA7C,IACA,IAAE,KAAK;AADP,IAEA,IAAE,uEAAuE,MAAM,GAAG;AAFlF,IAGA,IAAE,CAAC,GAAE,GAAE,OAAK,KAAG,IAAG,gBAAgB,KAAK,KAAK,EAAE,CAAC,CAAC,IAAE,EAAE,IAAE,MAAI,SAAO,IAAE,KAAG,EAAE,CAAC,KAAG,SAAO,EAAE,OAAK,QAAO,IAAG,EAAE,SAAO,KAAG,EAAE,CAAC,KAAG,SAAO,IAAI,aAAE,CAAC,CAAC,GAAE,GAAE,CAAC,IAAE,CAAC,IAAE,CAAC,GAAE,IAAE,EAAE;AAHtJ,IAIA,IAAE,CAAC,GAAEC,QAAKA,KAAE,IAAE,EAAE,QAAQ,aAAY,MAAM,GAAG,QAAQ,OAAM,KAAK,EAAE,QAAQ,OAAM,KAAK,EAAE,QAAQ,MAAK,KAAK;AAJzG,IAKA,IAAE,CAAC,GAAG,GAAGC,OAAI;AAAC,UAAG,EAAE,SAAOA,IAAE;AAAC,cAAM,IAAI,UAAU,sBAAsB,CAAC,oBAAoBA,EAAC,iCAAiC,EAAE,MAAM,WAAW;AAAA,MAAC;AAAA,IAAC;AAK5I,IAAM,WAAW,MAAMC,UAAS;AAAA,MACvC,KAAG,CAAC;AAAA,MACJ,eAAe,GAAE;AAAC,YAAG,EAAE,OAAO,OAAM,IAAI,UAAU,+EAA+E;AAAA,MAAC;AAAA,MAClI,KAAK,CAAC,IAAI;AAAC,eAAO;AAAA,MAAU;AAAA,MAC5B,CAAC,CAAC,IAAG;AAAC,eAAO,KAAK,QAAQ;AAAA,MAAC;AAAA,MAC3B,QAAQ,CAAC,EAAE,GAAG;AAAC,eAAO,KAAG,OAAO,MAAI,YAAU,EAAE,CAAC,MAAI,cAAY,CAAC,EAAE,KAAK,CAAAC,OAAG,OAAO,EAAEA,EAAC,KAAG,UAAU;AAAA,MAAC;AAAA,MACpG,UAAU,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,aAAK,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;AAAA,MAAC;AAAA,MAC1D,OAAO,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,aAAG;AAAG,aAAK,KAAG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAI,MAAI,CAAC;AAAA,MAAC;AAAA,MAC5E,IAAI,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,aAAG;AAAG,iBAAQ,IAAE,KAAK,IAAG,IAAE,EAAE,QAAO,IAAE,GAAE,IAAE,GAAE,IAAI,KAAG,EAAE,CAAC,EAAE,CAAC,MAAI,EAAE,QAAO,EAAE,CAAC,EAAE,CAAC;AAAE,eAAO;AAAA,MAAI;AAAA,MACpH,OAAO,GAAE,GAAE;AAAC,UAAE,UAAS,WAAU,CAAC;AAAE,YAAE,CAAC;AAAE,aAAG;AAAG,aAAK,GAAG,QAAQ,OAAG,EAAE,CAAC,MAAI,KAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAAE,eAAO;AAAA,MAAC;AAAA,MAClG,IAAI,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,aAAG;AAAG,eAAO,KAAK,GAAG,KAAK,OAAG,EAAE,CAAC,MAAI,CAAC;AAAA,MAAC;AAAA,MAClE,QAAQ,GAAE,GAAE;AAAC,UAAE,WAAU,WAAU,CAAC;AAAE,iBAAQ,CAAC,GAAE,CAAC,KAAI,KAAK,GAAE,KAAK,GAAE,GAAE,GAAE,IAAI;AAAA,MAAC;AAAA,MAC7E,OAAO,GAAE;AAAC,UAAE,OAAM,WAAU,CAAC;AAAE,YAAI,IAAE,CAAC,GAAE,IAAE;AAAG,YAAE,EAAE,GAAG,CAAC;AAAE,aAAK,GAAG,QAAQ,OAAG;AAAC,YAAE,CAAC,MAAI,EAAE,CAAC,IAAE,MAAI,IAAE,CAAC,EAAE,KAAK,CAAC,KAAG,EAAE,KAAK,CAAC;AAAA,QAAC,CAAC;AAAE,aAAG,EAAE,KAAK,CAAC;AAAE,aAAK,KAAG;AAAA,MAAC;AAAA,MAC3I,CAAC,UAAS;AAAC,eAAM,KAAK;AAAA,MAAE;AAAA,MACxB,CAAC,OAAM;AAAC,iBAAO,CAAC,CAAC,KAAI,KAAK,OAAM;AAAA,MAAC;AAAA,MACjC,CAAC,SAAQ;AAAC,iBAAO,CAAC,EAAC,CAAC,KAAI,KAAK,OAAM;AAAA,MAAC;AAAA,IAAC;AAAA;AAAA;;;AC9BrC,IAAa;AAAb;AAAA;AAAO,IAAM,iBAAN,cAA6B,MAAM;AAAA,MACzC,YAAY,SAAS,MAAM;AAC1B,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAE9C,aAAK,OAAO;AAAA,MACb;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,IACD;AAAA;AAAA;;;AChBA,IAUa;AAVb;AAAA;AACA;AASO,IAAM,aAAN,cAAyB,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM9C,YAAY,SAAS,MAAM,aAAa;AACvC,cAAM,SAAS,IAAI;AAEnB,YAAI,aAAa;AAEhB,eAAK,OAAO,KAAK,QAAQ,YAAY;AACrC,eAAK,iBAAiB,YAAY;AAAA,QACnC;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;ACzBA,IAMM,MAQO,uBAmBA,QAiBA,eAiBA,qBAcA;AAjFb;AAAA;AAMA,IAAM,OAAO,OAAO;AAQb,IAAM,wBAAwB,YAAU;AAC9C,aACC,OAAO,WAAW,YAClB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,QAAQ,cACtB,OAAO,OAAO,SAAS,cACvB,OAAO,IAAI,MAAM;AAAA,IAEnB;AAOO,IAAM,SAAS,YAAU;AAC/B,aACC,UACA,OAAO,WAAW,YAClB,OAAO,OAAO,gBAAgB,cAC9B,OAAO,OAAO,SAAS,YACvB,OAAO,OAAO,WAAW,cACzB,OAAO,OAAO,gBAAgB,cAC9B,gBAAgB,KAAK,OAAO,IAAI,CAAC;AAAA,IAEnC;AAOO,IAAM,gBAAgB,YAAU;AACtC,aACC,OAAO,WAAW,aACjB,OAAO,IAAI,MAAM,iBACjB,OAAO,IAAI,MAAM;AAAA,IAGpB;AAUO,IAAM,sBAAsB,CAAC,aAAa,aAAa;AAC7D,YAAM,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC/B,YAAM,OAAO,IAAI,IAAI,WAAW,EAAE;AAElC,aAAO,SAAS,QAAQ,KAAK,SAAS,IAAI,IAAI,EAAE;AAAA,IACjD;AASO,IAAM,iBAAiB,CAAC,aAAa,aAAa;AACxD,YAAM,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC/B,YAAM,OAAO,IAAI,IAAI,WAAW,EAAE;AAElC,aAAO,SAAS;AAAA,IACjB;AAAA;AAAA;;;ACtFA;AAAA,4CAAAC,UAAAC,SAAA;AAEA,QAAI,CAAC,WAAW,cAAc;AAC5B,UAAI;AACF,cAAM,EAAE,eAAe,IAAI,QAAQ,gBAAgB,GACnD,OAAO,IAAI,eAAe,EAAE,OAC5B,KAAK,IAAI,YAAY;AACrB,aAAK,YAAY,IAAI,CAAC,IAAI,EAAE,CAAC;AAAA,MAC/B,SAAS,KAAK;AACZ,YAAI,YAAY,SAAS,mBACvB,WAAW,eAAe,IAAI;AAAA,MAElC;AAAA,IACF;AAEA,IAAAA,QAAO,UAAU,WAAW;AAAA;AAAA;;;ACf5B,oBACA,kBACA,0BAKQ,MAMF,cAOA,UAOA,UAMA,cAGA,UAQA,UAcA;AA1DN;AAAA;AAAA,qBAA2D;AAC3D,uBAAyB;AACzB,+BAAyB;AAEzB;AACA;AAEA,KAAM,EAAE,SAAS,eAAAC;AAMjB,IAAM,eAAe,CAAC,MAAM,SAAS,aAAS,yBAAS,IAAI,GAAG,MAAM,IAAI;AAOxE,IAAM,WAAW,CAAC,MAAM,SAAS,KAAK,IAAI,EAAE,KAAK,CAAAC,UAAQ,SAASA,OAAM,MAAM,IAAI,CAAC;AAOnF,IAAM,WAAW,CAAC,MAAM,SAAS,KAAK,IAAI,EAAE,KAAK,CAAAA,UAAQ,SAASA,OAAM,MAAM,IAAI,CAAC;AAMnF,IAAM,eAAe,CAAC,MAAM,SAAS,aAAS,yBAAS,IAAI,GAAG,MAAM,IAAI;AAGxE,IAAM,WAAW,CAACA,OAAM,MAAM,OAAO,OAAO,IAAI,mBAAK,CAAC,IAAI,aAAa;AAAA,MACrE;AAAA,MACA,MAAMA,MAAK;AAAA,MACX,cAAcA,MAAK;AAAA,MACnB,OAAO;AAAA,IACT,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC;AAGb,IAAM,WAAW,CAACA,OAAM,MAAM,OAAO,OAAO,IAAI,aAAK,CAAC,IAAI,aAAa;AAAA,MACrE;AAAA,MACA,MAAMA,MAAK;AAAA,MACX,cAAcA,MAAK;AAAA,MACnB,OAAO;AAAA,IACT,CAAC,CAAC,OAAG,2BAAS,IAAI,GAAG,EAAE,MAAM,cAAcA,MAAK,QAAQ,CAAC;AASzD,IAAM,eAAN,MAAM,cAAa;AAAA,MACjB;AAAA,MACA;AAAA,MAEA,YAAa,SAAS;AACpB,aAAK,QAAQ,QAAQ;AACrB,aAAK,SAAS,QAAQ;AACtB,aAAK,OAAO,QAAQ;AACpB,aAAK,eAAe,QAAQ;AAAA,MAC9B;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,MAAO,OAAO,KAAK;AACjB,eAAO,IAAI,cAAa;AAAA,UACtB,MAAM,KAAK;AAAA,UACX,cAAc,KAAK;AAAA,UACnB,MAAM,MAAM;AAAA,UACZ,OAAO,KAAK,SAAS;AAAA,QACvB,CAAC;AAAA,MACH;AAAA,MAEA,OAAQ,SAAU;AAChB,cAAM,EAAE,QAAQ,IAAI,MAAM,KAAK,KAAK,KAAK;AACzC,YAAI,UAAU,KAAK,cAAc;AAC/B,gBAAM,IAAI,yBAAAC,QAAa,2IAA2I,kBAAkB;AAAA,QACtL;AACA,mBAAQ,iCAAiB,KAAK,OAAO;AAAA,UACnC,OAAO,KAAK;AAAA,UACZ,KAAK,KAAK,SAAS,KAAK,OAAO;AAAA,QACjC,CAAC;AAAA,MACH;AAAA,MAEA,KAAK,OAAO,WAAW,IAAK;AAC1B,eAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;;;AChGA;AAAA;AAAA;AAAA;AA+TA,SAAS,UAAU,aAAa;AAE/B,QAAMC,KAAI,YAAY,MAAM,4DAA4D;AACxF,MAAI,CAACA,IAAG;AACP;AAAA,EACD;AAEA,QAAM,QAAQA,GAAE,CAAC,KAAKA,GAAE,CAAC,KAAK;AAC9B,MAAI,WAAW,MAAM,MAAM,MAAM,YAAY,IAAI,IAAI,CAAC;AACtD,aAAW,SAAS,QAAQ,QAAQ,GAAG;AACvC,aAAW,SAAS,QAAQ,eAAe,CAACA,IAAG,SAAS;AACvD,WAAO,OAAO,aAAa,IAAI;AAAA,EAChC,CAAC;AACD,SAAO;AACR;AAEA,eAAsB,WAAWC,OAAM,IAAI;AAC1C,MAAI,CAAC,aAAa,KAAK,EAAE,GAAG;AAC3B,UAAM,IAAI,UAAU,iBAAiB;AAAA,EACtC;AAEA,QAAMD,KAAI,GAAG,MAAM,iCAAiC;AAEpD,MAAI,CAACA,IAAG;AACP,UAAM,IAAI,UAAU,sDAAsD;AAAA,EAC3E;AAEA,QAAM,SAAS,IAAI,gBAAgBA,GAAE,CAAC,KAAKA,GAAE,CAAC,CAAC;AAE/C,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,QAAM,cAAc,CAAC;AACrB,QAAM,WAAW,IAAI,SAAS;AAE9B,QAAM,aAAa,UAAQ;AAC1B,kBAAc,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EAClD;AAEA,QAAM,eAAe,UAAQ;AAC5B,gBAAY,KAAK,IAAI;AAAA,EACtB;AAEA,QAAM,uBAAuB,MAAM;AAClC,UAAM,OAAO,IAAI,aAAK,aAAa,UAAU,EAAC,MAAM,YAAW,CAAC;AAChE,aAAS,OAAO,WAAW,IAAI;AAAA,EAChC;AAEA,QAAM,wBAAwB,MAAM;AACnC,aAAS,OAAO,WAAW,UAAU;AAAA,EACtC;AAEA,QAAM,UAAU,IAAI,YAAY,OAAO;AACvC,UAAQ,OAAO;AAEf,SAAO,cAAc,WAAY;AAChC,WAAO,aAAa;AACpB,WAAO,YAAY;AAEnB,kBAAc;AACd,kBAAc;AACd,iBAAa;AACb,gBAAY;AACZ,kBAAc;AACd,eAAW;AACX,gBAAY,SAAS;AAAA,EACtB;AAEA,SAAO,gBAAgB,SAAU,MAAM;AACtC,mBAAe,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EACnD;AAEA,SAAO,gBAAgB,SAAU,MAAM;AACtC,mBAAe,QAAQ,OAAO,MAAM,EAAC,QAAQ,KAAI,CAAC;AAAA,EACnD;AAEA,SAAO,cAAc,WAAY;AAChC,mBAAe,QAAQ,OAAO;AAC9B,kBAAc,YAAY,YAAY;AAEtC,QAAI,gBAAgB,uBAAuB;AAE1C,YAAMA,KAAI,YAAY,MAAM,mDAAmD;AAE/E,UAAIA,IAAG;AACN,oBAAYA,GAAE,CAAC,KAAKA,GAAE,CAAC,KAAK;AAAA,MAC7B;AAEA,iBAAW,UAAU,WAAW;AAEhC,UAAI,UAAU;AACb,eAAO,aAAa;AACpB,eAAO,YAAY;AAAA,MACpB;AAAA,IACD,WAAW,gBAAgB,gBAAgB;AAC1C,oBAAc;AAAA,IACf;AAEA,kBAAc;AACd,kBAAc;AAAA,EACf;AAEA,mBAAiB,SAASC,OAAM;AAC/B,WAAO,MAAM,KAAK;AAAA,EACnB;AAEA,SAAO,IAAI;AAEX,SAAO;AACR;AA/aA,IAGI,GACE,GAaFC,IACE,GAKA,IACA,IACA,OACA,QACA,OACA,GACA,GAEA,OAEA,MAEA;AAnCN;AAAA;AAAA;AACA;AAEA,IAAI,IAAI;AACR,IAAM,IAAI;AAAA,MACT,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,MACpB,cAAc;AAAA,MACd,oBAAoB;AAAA,MACpB,cAAc;AAAA,MACd,0BAA0B;AAAA,MAC1B,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,KAAK;AAAA,IACN;AAEA,IAAIA,KAAI;AACR,IAAM,IAAI;AAAA,MACT,eAAeA;AAAA,MACf,eAAeA,MAAK;AAAA,IACrB;AAEA,IAAM,KAAK;AACX,IAAM,KAAK;AACX,IAAM,QAAQ;AACd,IAAM,SAAS;AACf,IAAM,QAAQ;AACd,IAAM,IAAI;AACV,IAAM,IAAI;AAEV,IAAM,QAAQ,OAAK,IAAI;AAEvB,IAAM,OAAO,MAAM;AAAA,IAAC;AAEpB,IAAM,kBAAN,MAAsB;AAAA;AAAA;AAAA;AAAA,MAIrB,YAAY,UAAU;AACrB,aAAK,QAAQ;AACb,aAAK,QAAQ;AAEb,aAAK,cAAc;AACnB,aAAK,gBAAgB;AACrB,aAAK,eAAe;AACpB,aAAK,gBAAgB;AACrB,aAAK,cAAc;AACnB,aAAK,aAAa;AAClB,aAAK,YAAY;AAEjB,aAAK,gBAAgB,CAAC;AAEtB,mBAAW,WAAW;AACtB,cAAM,OAAO,IAAI,WAAW,SAAS,MAAM;AAC3C,iBAASC,KAAI,GAAGA,KAAI,SAAS,QAAQA,MAAK;AACzC,eAAKA,EAAC,IAAI,SAAS,WAAWA,EAAC;AAC/B,eAAK,cAAc,KAAKA,EAAC,CAAC,IAAI;AAAA,QAC/B;AAEA,aAAK,WAAW;AAChB,aAAK,aAAa,IAAI,WAAW,KAAK,SAAS,SAAS,CAAC;AACzD,aAAK,QAAQ,EAAE;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA,MAKA,MAAM,MAAM;AACX,YAAIA,KAAI;AACR,cAAM,UAAU,KAAK;AACrB,YAAI,gBAAgB,KAAK;AACzB,YAAI,EAAC,YAAY,UAAU,eAAe,OAAO,OAAO,MAAK,IAAI;AACjE,cAAM,iBAAiB,KAAK,SAAS;AACrC,cAAM,cAAc,iBAAiB;AACrC,cAAM,eAAe,KAAK;AAC1B,YAAI;AACJ,YAAI;AAEJ,cAAM,OAAO,UAAQ;AACpB,eAAK,OAAO,MAAM,IAAIA;AAAA,QACvB;AAEA,cAAM,QAAQ,UAAQ;AACrB,iBAAO,KAAK,OAAO,MAAM;AAAA,QAC1B;AAEA,cAAM,WAAW,CAAC,gBAAgB,OAAO,KAAK,SAAS;AACtD,cAAI,UAAU,UAAa,UAAU,KAAK;AACzC,iBAAK,cAAc,EAAE,QAAQ,KAAK,SAAS,OAAO,GAAG,CAAC;AAAA,UACvD;AAAA,QACD;AAEA,cAAM,eAAe,CAAC,MAAMC,WAAU;AACrC,gBAAM,aAAa,OAAO;AAC1B,cAAI,EAAE,cAAc,OAAO;AAC1B;AAAA,UACD;AAEA,cAAIA,QAAO;AACV,qBAAS,MAAM,KAAK,UAAU,GAAGD,IAAG,IAAI;AACxC,mBAAO,KAAK,UAAU;AAAA,UACvB,OAAO;AACN,qBAAS,MAAM,KAAK,UAAU,GAAG,KAAK,QAAQ,IAAI;AAClD,iBAAK,UAAU,IAAI;AAAA,UACpB;AAAA,QACD;AAEA,aAAKA,KAAI,GAAGA,KAAI,SAASA,MAAK;AAC7B,cAAI,KAAKA,EAAC;AAEV,kBAAQ,OAAO;AAAA,YACd,KAAK,EAAE;AACN,kBAAI,UAAU,SAAS,SAAS,GAAG;AAClC,oBAAI,MAAM,QAAQ;AACjB,2BAAS,EAAE;AAAA,gBACZ,WAAW,MAAM,IAAI;AACpB;AAAA,gBACD;AAEA;AACA;AAAA,cACD,WAAW,QAAQ,MAAM,SAAS,SAAS,GAAG;AAC7C,oBAAI,QAAQ,EAAE,iBAAiB,MAAM,QAAQ;AAC5C,0BAAQ,EAAE;AACV,0BAAQ;AAAA,gBACT,WAAW,EAAE,QAAQ,EAAE,kBAAkB,MAAM,IAAI;AAClD,0BAAQ;AACR,2BAAS,aAAa;AACtB,0BAAQ,EAAE;AAAA,gBACX,OAAO;AACN;AAAA,gBACD;AAEA;AAAA,cACD;AAEA,kBAAI,MAAM,SAAS,QAAQ,CAAC,GAAG;AAC9B,wBAAQ;AAAA,cACT;AAEA,kBAAI,MAAM,SAAS,QAAQ,CAAC,GAAG;AAC9B;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN,sBAAQ,EAAE;AACV,mBAAK,eAAe;AACpB,sBAAQ;AAAA;AAAA,YAET,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb,sBAAM,eAAe;AACrB,wBAAQ,EAAE;AACV;AAAA,cACD;AAEA;AACA,kBAAI,MAAM,QAAQ;AACjB;AAAA,cACD;AAEA,kBAAI,MAAM,OAAO;AAChB,oBAAI,UAAU,GAAG;AAEhB;AAAA,gBACD;AAEA,6BAAa,iBAAiB,IAAI;AAClC,wBAAQ,EAAE;AACV;AAAA,cACD;AAEA,mBAAK,MAAM,CAAC;AACZ,kBAAI,KAAK,KAAK,KAAK,GAAG;AACrB;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,OAAO;AAChB;AAAA,cACD;AAEA,mBAAK,eAAe;AACpB,sBAAQ,EAAE;AAAA;AAAA,YAEX,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb,6BAAa,iBAAiB,IAAI;AAClC,yBAAS,aAAa;AACtB,wBAAQ,EAAE;AAAA,cACX;AAEA;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb;AAAA,cACD;AAEA,sBAAQ,EAAE;AACV;AAAA,YACD,KAAK,EAAE;AACN,kBAAI,MAAM,IAAI;AACb;AAAA,cACD;AAEA,uBAAS,cAAc;AACvB,sBAAQ,EAAE;AACV;AAAA,YACD,KAAK,EAAE;AACN,sBAAQ,EAAE;AACV,mBAAK,YAAY;AAAA;AAAA,YAElB,KAAK,EAAE;AACN,8BAAgB;AAEhB,kBAAI,UAAU,GAAG;AAEhB,gBAAAA,MAAK;AACL,uBAAOA,KAAI,gBAAgB,EAAE,KAAKA,EAAC,KAAK,gBAAgB;AACvD,kBAAAA,MAAK;AAAA,gBACN;AAEA,gBAAAA,MAAK;AACL,oBAAI,KAAKA,EAAC;AAAA,cACX;AAEA,kBAAI,QAAQ,SAAS,QAAQ;AAC5B,oBAAI,SAAS,KAAK,MAAM,GAAG;AAC1B,sBAAI,UAAU,GAAG;AAChB,iCAAa,cAAc,IAAI;AAAA,kBAChC;AAEA;AAAA,gBACD,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD,WAAW,UAAU,SAAS,QAAQ;AACrC;AACA,oBAAI,MAAM,IAAI;AAEb,2BAAS,EAAE;AAAA,gBACZ,WAAW,MAAM,QAAQ;AAExB,2BAAS,EAAE;AAAA,gBACZ,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD,WAAW,QAAQ,MAAM,SAAS,QAAQ;AACzC,oBAAI,QAAQ,EAAE,eAAe;AAC5B,0BAAQ;AACR,sBAAI,MAAM,IAAI;AAEb,6BAAS,CAAC,EAAE;AACZ,6BAAS,WAAW;AACpB,6BAAS,aAAa;AACtB,4BAAQ,EAAE;AACV;AAAA,kBACD;AAAA,gBACD,WAAW,QAAQ,EAAE,eAAe;AACnC,sBAAI,MAAM,QAAQ;AACjB,6BAAS,WAAW;AACpB,4BAAQ,EAAE;AACV,4BAAQ;AAAA,kBACT,OAAO;AACN,4BAAQ;AAAA,kBACT;AAAA,gBACD,OAAO;AACN,0BAAQ;AAAA,gBACT;AAAA,cACD;AAEA,kBAAI,QAAQ,GAAG;AAGd,2BAAW,QAAQ,CAAC,IAAI;AAAA,cACzB,WAAW,gBAAgB,GAAG;AAG7B,sBAAM,cAAc,IAAI,WAAW,WAAW,QAAQ,WAAW,YAAY,WAAW,UAAU;AAClG,yBAAS,cAAc,GAAG,eAAe,WAAW;AACpD,gCAAgB;AAChB,qBAAK,YAAY;AAIjB,gBAAAA;AAAA,cACD;AAEA;AAAA,YACD,KAAK,EAAE;AACN;AAAA,YACD;AACC,oBAAM,IAAI,MAAM,6BAA6B,KAAK,EAAE;AAAA,UACtD;AAAA,QACD;AAEA,qBAAa,eAAe;AAC5B,qBAAa,eAAe;AAC5B,qBAAa,YAAY;AAGzB,aAAK,QAAQ;AACb,aAAK,QAAQ;AACb,aAAK,QAAQ;AAAA,MACd;AAAA,MAEA,MAAM;AACL,YAAK,KAAK,UAAU,EAAE,sBAAsB,KAAK,UAAU,KACzD,KAAK,UAAU,EAAE,aAAa,KAAK,UAAU,KAAK,SAAS,QAAS;AACrE,eAAK,UAAU;AAAA,QAChB,WAAW,KAAK,UAAU,EAAE,KAAK;AAChC,gBAAM,IAAI,MAAM,kDAAkD;AAAA,QACnE;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;AC5HA,eAAe,YAAY,MAAM;AAChC,MAAI,KAAK,SAAS,EAAE,WAAW;AAC9B,UAAM,IAAI,UAAU,0BAA0B,KAAK,GAAG,EAAE;AAAA,EACzD;AAEA,OAAK,SAAS,EAAE,YAAY;AAE5B,MAAI,KAAK,SAAS,EAAE,OAAO;AAC1B,UAAM,KAAK,SAAS,EAAE;AAAA,EACvB;AAEA,QAAM,EAAC,KAAI,IAAI;AAGf,MAAI,SAAS,MAAM;AAClB,WAAO,0BAAO,MAAM,CAAC;AAAA,EACtB;AAGA,MAAI,EAAE,gBAAgB,mBAAAE,UAAS;AAC9B,WAAO,0BAAO,MAAM,CAAC;AAAA,EACtB;AAIA,QAAM,QAAQ,CAAC;AACf,MAAI,aAAa;AAEjB,MAAI;AACH,qBAAiB,SAAS,MAAM;AAC/B,UAAI,KAAK,OAAO,KAAK,aAAa,MAAM,SAAS,KAAK,MAAM;AAC3D,cAAM,QAAQ,IAAI,WAAW,mBAAmB,KAAK,GAAG,gBAAgB,KAAK,IAAI,IAAI,UAAU;AAC/F,aAAK,QAAQ,KAAK;AAClB,cAAM;AAAA,MACP;AAEA,oBAAc,MAAM;AACpB,YAAM,KAAK,KAAK;AAAA,IACjB;AAAA,EACD,SAAS,OAAO;AACf,UAAM,SAAS,iBAAiB,iBAAiB,QAAQ,IAAI,WAAW,+CAA+C,KAAK,GAAG,KAAK,MAAM,OAAO,IAAI,UAAU,KAAK;AACpK,UAAM;AAAA,EACP;AAEA,MAAI,KAAK,kBAAkB,QAAQ,KAAK,eAAe,UAAU,MAAM;AACtE,QAAI;AACH,UAAI,MAAM,MAAM,OAAK,OAAO,MAAM,QAAQ,GAAG;AAC5C,eAAO,0BAAO,KAAK,MAAM,KAAK,EAAE,CAAC;AAAA,MAClC;AAEA,aAAO,0BAAO,OAAO,OAAO,UAAU;AAAA,IACvC,SAAS,OAAO;AACf,YAAM,IAAI,WAAW,kDAAkD,KAAK,GAAG,KAAK,MAAM,OAAO,IAAI,UAAU,KAAK;AAAA,IACrH;AAAA,EACD,OAAO;AACN,UAAM,IAAI,WAAW,4DAA4D,KAAK,GAAG,EAAE;AAAA,EAC5F;AACD;AA1PA,IAOA,oBACA,kBACA,oBASM,UACA,WAWe,MAqOR,OA0BP,4BAgBO,oBAqDA,eAkCA;AApYb;AAAA;AAOA,yBAAkC;AAClC,uBAA0C;AAC1C,yBAAqB;AAErB;AACA;AAEA;AACA;AACA;AAEA,IAAM,eAAW,4BAAU,mBAAAA,QAAO,QAAQ;AAC1C,IAAM,YAAY,OAAO,gBAAgB;AAWzC,IAAqB,OAArB,MAA0B;AAAA,MACzB,YAAY,MAAM;AAAA,QACjB,OAAO;AAAA,MACR,IAAI,CAAC,GAAG;AACP,YAAI,WAAW;AAEf,YAAI,SAAS,MAAM;AAElB,iBAAO;AAAA,QACR,WAAW,sBAAsB,IAAI,GAAG;AAEvC,iBAAO,0BAAO,KAAK,KAAK,SAAS,CAAC;AAAA,QACnC,WAAW,OAAO,IAAI,GAAG;AAAA,QAEzB,WAAW,0BAAO,SAAS,IAAI,GAAG;AAAA,QAElC,WAAW,uBAAM,iBAAiB,IAAI,GAAG;AAExC,iBAAO,0BAAO,KAAK,IAAI;AAAA,QACxB,WAAW,YAAY,OAAO,IAAI,GAAG;AAEpC,iBAAO,0BAAO,KAAK,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AAAA,QACjE,WAAW,gBAAgB,mBAAAA,SAAQ;AAAA,QAEnC,WAAW,gBAAgB,UAAU;AAEpC,iBAAO,eAAe,IAAI;AAC1B,qBAAW,KAAK,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,QAClC,OAAO;AAGN,iBAAO,0BAAO,KAAK,OAAO,IAAI,CAAC;AAAA,QAChC;AAEA,YAAI,SAAS;AAEb,YAAI,0BAAO,SAAS,IAAI,GAAG;AAC1B,mBAAS,mBAAAA,QAAO,SAAS,KAAK,IAAI;AAAA,QACnC,WAAW,OAAO,IAAI,GAAG;AACxB,mBAAS,mBAAAA,QAAO,SAAS,KAAK,KAAK,OAAO,CAAC;AAAA,QAC5C;AAEA,aAAK,SAAS,IAAI;AAAA,UACjB;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX,OAAO;AAAA,QACR;AACA,aAAK,OAAO;AAEZ,YAAI,gBAAgB,mBAAAA,SAAQ;AAC3B,eAAK,GAAG,SAAS,YAAU;AAC1B,kBAAM,QAAQ,kBAAkB,iBAC/B,SACA,IAAI,WAAW,+CAA+C,KAAK,GAAG,KAAK,OAAO,OAAO,IAAI,UAAU,MAAM;AAC9G,iBAAK,SAAS,EAAE,QAAQ;AAAA,UACzB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAK,SAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,WAAW;AACd,eAAO,KAAK,SAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,cAAc;AACnB,cAAM,EAAC,QAAQ,YAAY,WAAU,IAAI,MAAM,YAAY,IAAI;AAC/D,eAAO,OAAO,MAAM,YAAY,aAAa,UAAU;AAAA,MACxD;AAAA,MAEA,MAAM,WAAW;AAChB,cAAM,KAAK,KAAK,QAAQ,IAAI,cAAc;AAE1C,YAAI,GAAG,WAAW,mCAAmC,GAAG;AACvD,gBAAM,WAAW,IAAI,SAAS;AAC9B,gBAAM,aAAa,IAAI,gBAAgB,MAAM,KAAK,KAAK,CAAC;AAExD,qBAAW,CAAC,MAAM,KAAK,KAAK,YAAY;AACvC,qBAAS,OAAO,MAAM,KAAK;AAAA,UAC5B;AAEA,iBAAO;AAAA,QACR;AAEA,cAAM,EAAC,YAAAC,YAAU,IAAI,MAAM;AAC3B,eAAOA,YAAW,KAAK,MAAM,EAAE;AAAA,MAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,KAAM,KAAK,WAAW,KAAK,QAAQ,IAAI,cAAc,KAAO,KAAK,SAAS,EAAE,QAAQ,KAAK,SAAS,EAAE,KAAK,QAAS;AACxH,cAAM,MAAM,MAAM,KAAK,YAAY;AAEnC,eAAO,IAAI,mBAAK,CAAC,GAAG,GAAG;AAAA,UACtB,MAAM;AAAA,QACP,CAAC;AAAA,MACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,OAAO,MAAM,KAAK,KAAK;AAC7B,eAAO,KAAK,MAAM,IAAI;AAAA,MACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM,OAAO;AACZ,cAAM,SAAS,MAAM,YAAY,IAAI;AACrC,eAAO,IAAI,YAAY,EAAE,OAAO,MAAM;AAAA,MACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,SAAS;AACR,eAAO,YAAY,IAAI;AAAA,MACxB;AAAA,IACD;AAEA,SAAK,UAAU,aAAS,4BAAU,KAAK,UAAU,QAAQ,sEAA0E,mBAAmB;AAGtJ,WAAO,iBAAiB,KAAK,WAAW;AAAA,MACvC,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,aAAa,EAAC,YAAY,KAAI;AAAA,MAC9B,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,MAAM,EAAC,SAAK;AAAA,QAAU,MAAM;AAAA,QAAC;AAAA,QAC5B;AAAA,QACA;AAAA,MAAiE,EAAC;AAAA,IACpE,CAAC;AA2EM,IAAM,QAAQ,CAAC,UAAU,kBAAkB;AACjD,UAAI;AACJ,UAAI;AACJ,UAAI,EAAC,KAAI,IAAI,SAAS,SAAS;AAG/B,UAAI,SAAS,UAAU;AACtB,cAAM,IAAI,MAAM,oCAAoC;AAAA,MACrD;AAIA,UAAK,gBAAgB,mBAAAD,WAAY,OAAO,KAAK,gBAAgB,YAAa;AAEzE,aAAK,IAAI,+BAAY,EAAC,cAAa,CAAC;AACpC,aAAK,IAAI,+BAAY,EAAC,cAAa,CAAC;AACpC,aAAK,KAAK,EAAE;AACZ,aAAK,KAAK,EAAE;AAEZ,iBAAS,SAAS,EAAE,SAAS;AAC7B,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,IACR;AAEA,IAAM,iCAA6B;AAAA,MAClC,UAAQ,KAAK,YAAY;AAAA,MACzB;AAAA,MACA;AAAA,IACD;AAYO,IAAM,qBAAqB,CAAC,MAAM,YAAY;AAEpD,UAAI,SAAS,MAAM;AAClB,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,SAAS,UAAU;AAC7B,eAAO;AAAA,MACR;AAGA,UAAI,sBAAsB,IAAI,GAAG;AAChC,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,IAAI,GAAG;AACjB,eAAO,KAAK,QAAQ;AAAA,MACrB;AAGA,UAAI,0BAAO,SAAS,IAAI,KAAK,uBAAM,iBAAiB,IAAI,KAAK,YAAY,OAAO,IAAI,GAAG;AACtF,eAAO;AAAA,MACR;AAEA,UAAI,gBAAgB,UAAU;AAC7B,eAAO,iCAAiC,QAAQ,SAAS,EAAE,QAAQ;AAAA,MACpE;AAGA,UAAI,QAAQ,OAAO,KAAK,gBAAgB,YAAY;AACnD,eAAO,gCAAgC,2BAA2B,IAAI,CAAC;AAAA,MACxE;AAGA,UAAI,gBAAgB,mBAAAA,SAAQ;AAC3B,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IACR;AAWO,IAAM,gBAAgB,aAAW;AACvC,YAAM,EAAC,KAAI,IAAI,QAAQ,SAAS;AAGhC,UAAI,SAAS,MAAM;AAClB,eAAO;AAAA,MACR;AAGA,UAAI,OAAO,IAAI,GAAG;AACjB,eAAO,KAAK;AAAA,MACb;AAGA,UAAI,0BAAO,SAAS,IAAI,GAAG;AAC1B,eAAO,KAAK;AAAA,MACb;AAGA,UAAI,QAAQ,OAAO,KAAK,kBAAkB,YAAY;AACrD,eAAO,KAAK,kBAAkB,KAAK,eAAe,IAAI,KAAK,cAAc,IAAI;AAAA,MAC9E;AAGA,aAAO;AAAA,IACR;AASO,IAAM,gBAAgB,OAAO,MAAM,EAAC,KAAI,MAAM;AACpD,UAAI,SAAS,MAAM;AAElB,aAAK,IAAI;AAAA,MACV,OAAO;AAEN,cAAM,SAAS,MAAM,IAAI;AAAA,MAC1B;AAAA,IACD;AAAA;AAAA;;;ACxJO,SAAS,eAAe,UAAU,CAAC,GAAG;AAC5C,SAAO,IAAI;AAAA,IACV,QAEE,OAAO,CAAC,QAAQ,OAAO,OAAO,UAAU;AACxC,UAAI,QAAQ,MAAM,GAAG;AACpB,eAAO,KAAK,MAAM,MAAM,OAAO,QAAQ,CAAC,CAAC;AAAA,MAC1C;AAEA,aAAO;AAAA,IACR,GAAG,CAAC,CAAC,EACJ,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM;AAC1B,UAAI;AACH,2BAAmB,IAAI;AACvB,4BAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,eAAO;AAAA,MACR,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD,CAAC;AAAA,EAEH;AACD;AA1QA,IAMAE,mBACA,kBAGM,oBAWA,qBAsBe;AA3CrB;AAAA;AAMA,IAAAA,oBAAoB;AACpB,uBAAiB;AAGjB,IAAM,qBAAqB,OAAO,iBAAAC,QAAK,uBAAuB,aAC7D,iBAAAA,QAAK,qBACL,UAAQ;AACP,UAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAC1C,cAAM,QAAQ,IAAI,UAAU,2CAA2C,IAAI,GAAG;AAC9E,eAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,yBAAwB,CAAC;AACtE,cAAM;AAAA,MACP;AAAA,IACD;AAGD,IAAM,sBAAsB,OAAO,iBAAAA,QAAK,wBAAwB,aAC/D,iBAAAA,QAAK,sBACL,CAAC,MAAM,UAAU;AAChB,UAAI,kCAAkC,KAAK,KAAK,GAAG;AAClD,cAAM,QAAQ,IAAI,UAAU,yCAAyC,IAAI,IAAI;AAC7E,eAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,mBAAkB,CAAC;AAChE,cAAM;AAAA,MACP;AAAA,IACD;AAcD,IAAqB,UAArB,MAAqB,iBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOpD,YAAY,MAAM;AAGjB,YAAI,SAAS,CAAC;AACd,YAAI,gBAAgB,UAAS;AAC5B,gBAAM,MAAM,KAAK,IAAI;AACrB,qBAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,GAAG,GAAG;AACjD,mBAAO,KAAK,GAAG,OAAO,IAAI,WAAS,CAAC,MAAM,KAAK,CAAC,CAAC;AAAA,UAClD;AAAA,QACD,WAAW,QAAQ,MAAM;AAAA,QAEzB,WAAW,OAAO,SAAS,YAAY,CAAC,wBAAM,iBAAiB,IAAI,GAAG;AACrE,gBAAM,SAAS,KAAK,OAAO,QAAQ;AAEnC,cAAI,UAAU,MAAM;AAEnB,mBAAO,KAAK,GAAG,OAAO,QAAQ,IAAI,CAAC;AAAA,UACpC,OAAO;AACN,gBAAI,OAAO,WAAW,YAAY;AACjC,oBAAM,IAAI,UAAU,+BAA+B;AAAA,YACpD;AAIA,qBAAS,CAAC,GAAG,IAAI,EACf,IAAI,UAAQ;AACZ,kBACC,OAAO,SAAS,YAAY,wBAAM,iBAAiB,IAAI,GACtD;AACD,sBAAM,IAAI,UAAU,6CAA6C;AAAA,cAClE;AAEA,qBAAO,CAAC,GAAG,IAAI;AAAA,YAChB,CAAC,EAAE,IAAI,UAAQ;AACd,kBAAI,KAAK,WAAW,GAAG;AACtB,sBAAM,IAAI,UAAU,6CAA6C;AAAA,cAClE;AAEA,qBAAO,CAAC,GAAG,IAAI;AAAA,YAChB,CAAC;AAAA,UACH;AAAA,QACD,OAAO;AACN,gBAAM,IAAI,UAAU,sIAAyI;AAAA,QAC9J;AAGA,iBACC,OAAO,SAAS,IACf,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;AAC7B,6BAAmB,IAAI;AACvB,8BAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,iBAAO,CAAC,OAAO,IAAI,EAAE,YAAY,GAAG,OAAO,KAAK,CAAC;AAAA,QAClD,CAAC,IACD;AAEF,cAAM,MAAM;AAIZ,eAAO,IAAI,MAAM,MAAM;AAAA,UACtB,IAAI,QAAQ,GAAG,UAAU;AACxB,oBAAQ,GAAG;AAAA,cACV,KAAK;AAAA,cACL,KAAK;AACJ,uBAAO,CAAC,MAAM,UAAU;AACvB,qCAAmB,IAAI;AACvB,sCAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,yBAAO,gBAAgB,UAAU,CAAC,EAAE;AAAA,oBACnC;AAAA,oBACA,OAAO,IAAI,EAAE,YAAY;AAAA,oBACzB,OAAO,KAAK;AAAA,kBACb;AAAA,gBACD;AAAA,cAED,KAAK;AAAA,cACL,KAAK;AAAA,cACL,KAAK;AACJ,uBAAO,UAAQ;AACd,qCAAmB,IAAI;AACvB,yBAAO,gBAAgB,UAAU,CAAC,EAAE;AAAA,oBACnC;AAAA,oBACA,OAAO,IAAI,EAAE,YAAY;AAAA,kBAC1B;AAAA,gBACD;AAAA,cAED,KAAK;AACJ,uBAAO,MAAM;AACZ,yBAAO,KAAK;AACZ,yBAAO,IAAI,IAAI,gBAAgB,UAAU,KAAK,KAAK,MAAM,CAAC,EAAE,KAAK;AAAA,gBAClE;AAAA,cAED;AACC,uBAAO,QAAQ,IAAI,QAAQ,GAAG,QAAQ;AAAA,YACxC;AAAA,UACD;AAAA,QACD,CAAC;AAAA,MAEF;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO,KAAK,YAAY;AAAA,MACzB;AAAA,MAEA,WAAW;AACV,eAAO,OAAO,UAAU,SAAS,KAAK,IAAI;AAAA,MAC3C;AAAA,MAEA,IAAI,MAAM;AACT,cAAM,SAAS,KAAK,OAAO,IAAI;AAC/B,YAAI,OAAO,WAAW,GAAG;AACxB,iBAAO;AAAA,QACR;AAEA,YAAI,QAAQ,OAAO,KAAK,IAAI;AAC5B,YAAI,sBAAsB,KAAK,IAAI,GAAG;AACrC,kBAAQ,MAAM,YAAY;AAAA,QAC3B;AAEA,eAAO;AAAA,MACR;AAAA,MAEA,QAAQ,UAAU,UAAU,QAAW;AACtC,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,kBAAQ,MAAM,UAAU,SAAS,CAAC,KAAK,IAAI,IAAI,GAAG,MAAM,IAAI,CAAC;AAAA,QAC9D;AAAA,MACD;AAAA,MAEA,CAAE,SAAS;AACV,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,gBAAM,KAAK,IAAI,IAAI;AAAA,QACpB;AAAA,MACD;AAAA;AAAA;AAAA;AAAA,MAKA,CAAE,UAAU;AACX,mBAAW,QAAQ,KAAK,KAAK,GAAG;AAC/B,gBAAM,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC;AAAA,QAC5B;AAAA,MACD;AAAA,MAEA,CAAC,OAAO,QAAQ,IAAI;AACnB,eAAO,KAAK,QAAQ;AAAA,MACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,MAAM;AACL,eAAO,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,QAAQ;AAC/C,iBAAO,GAAG,IAAI,KAAK,OAAO,GAAG;AAC7B,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AAAA,MACN;AAAA;AAAA;AAAA;AAAA,MAKA,CAAC,OAAO,IAAI,4BAA4B,CAAC,IAAI;AAC5C,eAAO,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,QAAQ;AAC/C,gBAAM,SAAS,KAAK,OAAO,GAAG;AAG9B,cAAI,QAAQ,QAAQ;AACnB,mBAAO,GAAG,IAAI,OAAO,CAAC;AAAA,UACvB,OAAO;AACN,mBAAO,GAAG,IAAI,OAAO,SAAS,IAAI,SAAS,OAAO,CAAC;AAAA,UACpD;AAEA,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AAAA,MACN;AAAA,IACD;AAMA,WAAO;AAAA,MACN,QAAQ;AAAA,MACR,CAAC,OAAO,WAAW,WAAW,QAAQ,EAAE,OAAO,CAAC,QAAQ,aAAa;AACpE,eAAO,QAAQ,IAAI,EAAC,YAAY,KAAI;AACpC,eAAO;AAAA,MACR,GAAG,CAAC,CAAC;AAAA,IACN;AAAA;AAAA;;;AC7OA,IAAM,gBAQO;AARb;AAAA;AAAA,IAAM,iBAAiB,oBAAI,IAAI,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG,CAAC;AAQjD,IAAM,aAAa,UAAQ;AACjC,aAAO,eAAe,IAAI,IAAI;AAAA,IAC/B;AAAA;AAAA;;;ACVA,IAUMC,YAWe;AArBrB;AAAA;AAMA;AACA;AACA;AAEA,IAAMA,aAAY,OAAO,oBAAoB;AAW7C,IAAqB,WAArB,MAAqB,kBAAiB,KAAK;AAAA,MAC1C,YAAY,OAAO,MAAM,UAAU,CAAC,GAAG;AACtC,cAAM,MAAM,OAAO;AAGnB,cAAM,SAAS,QAAQ,UAAU,OAAO,QAAQ,SAAS;AAEzD,cAAM,UAAU,IAAI,QAAQ,QAAQ,OAAO;AAE3C,YAAI,SAAS,QAAQ,CAAC,QAAQ,IAAI,cAAc,GAAG;AAClD,gBAAM,cAAc,mBAAmB,MAAM,IAAI;AACjD,cAAI,aAAa;AAChB,oBAAQ,OAAO,gBAAgB,WAAW;AAAA,UAC3C;AAAA,QACD;AAEA,aAAKA,UAAS,IAAI;AAAA,UACjB,MAAM;AAAA,UACN,KAAK,QAAQ;AAAA,UACb;AAAA,UACA,YAAY,QAAQ,cAAc;AAAA,UAClC;AAAA,UACA,SAAS,QAAQ;AAAA,UACjB,eAAe,QAAQ;AAAA,QACxB;AAAA,MACD;AAAA,MAEA,IAAI,OAAO;AACV,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,MAAM;AACT,eAAO,KAAKA,UAAS,EAAE,OAAO;AAAA,MAC/B;AAAA,MAEA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA,MAKA,IAAI,KAAK;AACR,eAAO,KAAKA,UAAS,EAAE,UAAU,OAAO,KAAKA,UAAS,EAAE,SAAS;AAAA,MAClE;AAAA,MAEA,IAAI,aAAa;AAChB,eAAO,KAAKA,UAAS,EAAE,UAAU;AAAA,MAClC;AAAA,MAEA,IAAI,aAAa;AAChB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,UAAU;AACb,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,gBAAgB;AACnB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,QAAQ;AACP,eAAO,IAAI,UAAS,MAAM,MAAM,KAAK,aAAa,GAAG;AAAA,UACpD,MAAM,KAAK;AAAA,UACX,KAAK,KAAK;AAAA,UACV,QAAQ,KAAK;AAAA,UACb,YAAY,KAAK;AAAA,UACjB,SAAS,KAAK;AAAA,UACd,IAAI,KAAK;AAAA,UACT,YAAY,KAAK;AAAA,UACjB,MAAM,KAAK;AAAA,UACX,eAAe,KAAK;AAAA,QACrB,CAAC;AAAA,MACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAO,SAAS,KAAK,SAAS,KAAK;AAClC,YAAI,CAAC,WAAW,MAAM,GAAG;AACxB,gBAAM,IAAI,WAAW,iEAAiE;AAAA,QACvF;AAEA,eAAO,IAAI,UAAS,MAAM;AAAA,UACzB,SAAS;AAAA,YACR,UAAU,IAAI,IAAI,GAAG,EAAE,SAAS;AAAA,UACjC;AAAA,UACA;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MAEA,OAAO,QAAQ;AACd,cAAM,WAAW,IAAI,UAAS,MAAM,EAAC,QAAQ,GAAG,YAAY,GAAE,CAAC;AAC/D,iBAASA,UAAS,EAAE,OAAO;AAC3B,eAAO;AAAA,MACR;AAAA,MAEA,OAAO,KAAK,OAAO,QAAW,OAAO,CAAC,GAAG;AACxC,cAAM,OAAO,KAAK,UAAU,IAAI;AAEhC,YAAI,SAAS,QAAW;AACvB,gBAAM,IAAI,UAAU,+BAA+B;AAAA,QACpD;AAEA,cAAM,UAAU,IAAI,QAAQ,QAAQ,KAAK,OAAO;AAEhD,YAAI,CAAC,QAAQ,IAAI,cAAc,GAAG;AACjC,kBAAQ,IAAI,gBAAgB,kBAAkB;AAAA,QAC/C;AAEA,eAAO,IAAI,UAAS,MAAM;AAAA,UACzB,GAAG;AAAA,UACH;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO;AAAA,MACR;AAAA,IACD;AAEA,WAAO,iBAAiB,SAAS,WAAW;AAAA,MAC3C,MAAM,EAAC,YAAY,KAAI;AAAA,MACvB,KAAK,EAAC,YAAY,KAAI;AAAA,MACtB,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,IAAI,EAAC,YAAY,KAAI;AAAA,MACrB,YAAY,EAAC,YAAY,KAAI;AAAA,MAC7B,YAAY,EAAC,YAAY,KAAI;AAAA,MAC7B,SAAS,EAAC,YAAY,KAAI;AAAA,MAC1B,OAAO,EAAC,YAAY,KAAI;AAAA,IACzB,CAAC;AAAA;AAAA;;;AC/JD,IAAa;AAAb;AAAA;AAAO,IAAM,YAAY,eAAa;AACrC,UAAI,UAAU,QAAQ;AACrB,eAAO,UAAU;AAAA,MAClB;AAEA,YAAM,aAAa,UAAU,KAAK,SAAS;AAC3C,YAAM,OAAO,UAAU,SAAS,UAAU,KAAK,UAAU,MAAM,MAAM,MAAM;AAC3E,aAAO,UAAU,KAAK,aAAa,KAAK,MAAM,MAAM,MAAM,MAAM;AAAA,IACjE;AAAA;AAAA;;;ACSO,SAAS,0BAA0B,KAAK,aAAa,OAAO;AAElE,MAAI,OAAO,MAAM;AAChB,WAAO;AAAA,EACR;AAEA,QAAM,IAAI,IAAI,GAAG;AAGjB,MAAI,uBAAuB,KAAK,IAAI,QAAQ,GAAG;AAC9C,WAAO;AAAA,EACR;AAGA,MAAI,WAAW;AAIf,MAAI,WAAW;AAIf,MAAI,OAAO;AAGX,MAAI,YAAY;AAGf,QAAI,WAAW;AAIf,QAAI,SAAS;AAAA,EACd;AAGA,SAAO;AACR;AA2BO,SAAS,uBAAuB,gBAAgB;AACtD,MAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACxC,UAAM,IAAI,UAAU,2BAA2B,cAAc,EAAE;AAAA,EAChE;AAEA,SAAO;AACR;AAOO,SAAS,+BAA+B,KAAK;AAQnD,MAAI,gBAAgB,KAAK,IAAI,QAAQ,GAAG;AACvC,WAAO;AAAA,EACR;AAGA,QAAM,SAAS,IAAI,KAAK,QAAQ,eAAe,EAAE;AACjD,QAAM,oBAAgB,sBAAK,MAAM;AAEjC,MAAI,kBAAkB,KAAK,SAAS,KAAK,MAAM,GAAG;AACjD,WAAO;AAAA,EACR;AAEA,MAAI,kBAAkB,KAAK,mCAAmC,KAAK,MAAM,GAAG;AAC3E,WAAO;AAAA,EACR;AAKA,MAAI,IAAI,SAAS,eAAe,IAAI,KAAK,SAAS,YAAY,GAAG;AAChE,WAAO;AAAA,EACR;AAGA,MAAI,IAAI,aAAa,SAAS;AAC7B,WAAO;AAAA,EACR;AASA,SAAO;AACR;AAOO,SAAS,4BAA4B,KAAK;AAEhD,MAAI,yBAAyB,KAAK,GAAG,GAAG;AACvC,WAAO;AAAA,EACR;AAGA,MAAI,IAAI,aAAa,SAAS;AAC7B,WAAO;AAAA,EACR;AAKA,MAAI,uBAAuB,KAAK,IAAI,QAAQ,GAAG;AAC9C,WAAO;AAAA,EACR;AAGA,SAAO,+BAA+B,GAAG;AAC1C;AA0BO,SAAS,0BAA0B,SAAS,EAAC,qBAAqB,uBAAsB,IAAI,CAAC,GAAG;AAMtG,MAAI,QAAQ,aAAa,iBAAiB,QAAQ,mBAAmB,IAAI;AACxE,WAAO;AAAA,EACR;AAGA,QAAM,SAAS,QAAQ;AAMvB,MAAI,QAAQ,aAAa,gBAAgB;AACxC,WAAO;AAAA,EACR;AAGA,QAAM,iBAAiB,QAAQ;AAG/B,MAAI,cAAc,0BAA0B,cAAc;AAI1D,MAAI,iBAAiB,0BAA0B,gBAAgB,IAAI;AAInE,MAAI,YAAY,SAAS,EAAE,SAAS,MAAM;AACzC,kBAAc;AAAA,EACf;AAMA,MAAI,qBAAqB;AACxB,kBAAc,oBAAoB,WAAW;AAAA,EAC9C;AAEA,MAAI,wBAAwB;AAC3B,qBAAiB,uBAAuB,cAAc;AAAA,EACvD;AAGA,QAAM,aAAa,IAAI,IAAI,QAAQ,GAAG;AAEtC,UAAQ,QAAQ;AAAA,IACf,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AACJ,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO,eAAe,SAAS;AAAA,IAEhC,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAIA,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,YAAY,WAAW,WAAW,QAAQ;AAC7C,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER,KAAK;AAGJ,UAAI,4BAA4B,WAAW,KAAK,CAAC,4BAA4B,UAAU,GAAG;AACzF,eAAO;AAAA,MACR;AAGA,aAAO;AAAA,IAER;AACC,YAAM,IAAI,UAAU,2BAA2B,MAAM,EAAE;AAAA,EACzD;AACD;AAOO,SAAS,8BAA8B,SAAS;AAGtD,QAAM,gBAAgB,QAAQ,IAAI,iBAAiB,KAAK,IAAI,MAAM,QAAQ;AAG1E,MAAI,SAAS;AAMb,aAAW,SAAS,cAAc;AACjC,QAAI,SAAS,eAAe,IAAI,KAAK,GAAG;AACvC,eAAS;AAAA,IACV;AAAA,EACD;AAGA,SAAO;AACR;AAnVA,qBA2Da,gBAeA;AA1Eb;AAAA;AAAA,sBAAmB;AA2DZ,IAAM,iBAAiB,oBAAI,IAAI;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAC;AAKM,IAAM,0BAA0B;AAAA;AAAA;;;AC1EvC,IAQA,iBACAC,mBASMC,YAQA,WAOA,eAae,SAmLR;AAjOb;AAAA;AAQA,sBAAkC;AAClC,IAAAD,oBAAwB;AACxB;AACA;AACA;AACA;AACA;AAIA,IAAMC,aAAY,OAAO,mBAAmB;AAQ5C,IAAM,YAAY,YAAU;AAC3B,aACC,OAAO,WAAW,YAClB,OAAO,OAAOA,UAAS,MAAM;AAAA,IAE/B;AAEA,IAAM,oBAAgB;AAAA,MAAU,MAAM;AAAA,MAAC;AAAA,MACtC;AAAA,MACA;AAAA,IAAgE;AAWjE,IAAqB,UAArB,MAAqB,iBAAgB,KAAK;AAAA,MACzC,YAAY,OAAO,OAAO,CAAC,GAAG;AAC7B,YAAI;AAGJ,YAAI,UAAU,KAAK,GAAG;AACrB,sBAAY,IAAI,IAAI,MAAM,GAAG;AAAA,QAC9B,OAAO;AACN,sBAAY,IAAI,IAAI,KAAK;AACzB,kBAAQ,CAAC;AAAA,QACV;AAEA,YAAI,UAAU,aAAa,MAAM,UAAU,aAAa,IAAI;AAC3D,gBAAM,IAAI,UAAU,GAAG,SAAS,uCAAuC;AAAA,QACxE;AAEA,YAAI,SAAS,KAAK,UAAU,MAAM,UAAU;AAC5C,YAAI,wCAAwC,KAAK,MAAM,GAAG;AACzD,mBAAS,OAAO,YAAY;AAAA,QAC7B;AAEA,YAAI,CAAC,UAAU,IAAI,KAAK,UAAU,MAAM;AACvC,wBAAc;AAAA,QACf;AAGA,aAAK,KAAK,QAAQ,QAAS,UAAU,KAAK,KAAK,MAAM,SAAS,UAC5D,WAAW,SAAS,WAAW,SAAS;AACzC,gBAAM,IAAI,UAAU,+CAA+C;AAAA,QACpE;AAEA,cAAM,YAAY,KAAK,OACtB,KAAK,OACJ,UAAU,KAAK,KAAK,MAAM,SAAS,OACnC,MAAM,KAAK,IACX;AAEF,cAAM,WAAW;AAAA,UAChB,MAAM,KAAK,QAAQ,MAAM,QAAQ;AAAA,QAClC,CAAC;AAED,cAAM,UAAU,IAAI,QAAQ,KAAK,WAAW,MAAM,WAAW,CAAC,CAAC;AAE/D,YAAI,cAAc,QAAQ,CAAC,QAAQ,IAAI,cAAc,GAAG;AACvD,gBAAM,cAAc,mBAAmB,WAAW,IAAI;AACtD,cAAI,aAAa;AAChB,oBAAQ,IAAI,gBAAgB,WAAW;AAAA,UACxC;AAAA,QACD;AAEA,YAAI,SAAS,UAAU,KAAK,IAC3B,MAAM,SACN;AACD,YAAI,YAAY,MAAM;AACrB,mBAAS,KAAK;AAAA,QACf;AAGA,YAAI,UAAU,QAAQ,CAAC,cAAc,MAAM,GAAG;AAC7C,gBAAM,IAAI,UAAU,gEAAgE;AAAA,QACrF;AAIA,YAAI,WAAW,KAAK,YAAY,OAAO,MAAM,WAAW,KAAK;AAC7D,YAAI,aAAa,IAAI;AAEpB,qBAAW;AAAA,QACZ,WAAW,UAAU;AAEpB,gBAAM,iBAAiB,IAAI,IAAI,QAAQ;AAEvC,qBAAW,wBAAwB,KAAK,cAAc,IAAI,WAAW;AAAA,QACtE,OAAO;AACN,qBAAW;AAAA,QACZ;AAEA,aAAKA,UAAS,IAAI;AAAA,UACjB;AAAA,UACA,UAAU,KAAK,YAAY,MAAM,YAAY;AAAA,UAC7C;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAGA,aAAK,SAAS,KAAK,WAAW,SAAa,MAAM,WAAW,SAAY,KAAK,MAAM,SAAU,KAAK;AAClG,aAAK,WAAW,KAAK,aAAa,SAAa,MAAM,aAAa,SAAY,OAAO,MAAM,WAAY,KAAK;AAC5G,aAAK,UAAU,KAAK,WAAW,MAAM,WAAW;AAChD,aAAK,QAAQ,KAAK,SAAS,MAAM;AACjC,aAAK,gBAAgB,KAAK,iBAAiB,MAAM,iBAAiB;AAClE,aAAK,qBAAqB,KAAK,sBAAsB,MAAM,sBAAsB;AAIjF,aAAK,iBAAiB,KAAK,kBAAkB,MAAM,kBAAkB;AAAA,MACtE;AAAA;AAAA,MAGA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,MAAM;AACT,mBAAO,gBAAAC,QAAU,KAAKD,UAAS,EAAE,SAAS;AAAA,MAC3C;AAAA;AAAA,MAGA,IAAI,UAAU;AACb,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,WAAW;AACd,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,SAAS;AACZ,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA;AAAA,MAGA,IAAI,WAAW;AACd,YAAI,KAAKA,UAAS,EAAE,aAAa,eAAe;AAC/C,iBAAO;AAAA,QACR;AAEA,YAAI,KAAKA,UAAS,EAAE,aAAa,UAAU;AAC1C,iBAAO;AAAA,QACR;AAEA,YAAI,KAAKA,UAAS,EAAE,UAAU;AAC7B,iBAAO,KAAKA,UAAS,EAAE,SAAS,SAAS;AAAA,QAC1C;AAEA,eAAO;AAAA,MACR;AAAA,MAEA,IAAI,iBAAiB;AACpB,eAAO,KAAKA,UAAS,EAAE;AAAA,MACxB;AAAA,MAEA,IAAI,eAAe,gBAAgB;AAClC,aAAKA,UAAS,EAAE,iBAAiB,uBAAuB,cAAc;AAAA,MACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,QAAQ;AACP,eAAO,IAAI,SAAQ,IAAI;AAAA,MACxB;AAAA,MAEA,KAAK,OAAO,WAAW,IAAI;AAC1B,eAAO;AAAA,MACR;AAAA,IACD;AAEA,WAAO,iBAAiB,QAAQ,WAAW;AAAA,MAC1C,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,KAAK,EAAC,YAAY,KAAI;AAAA,MACtB,SAAS,EAAC,YAAY,KAAI;AAAA,MAC1B,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,OAAO,EAAC,YAAY,KAAI;AAAA,MACxB,QAAQ,EAAC,YAAY,KAAI;AAAA,MACzB,UAAU,EAAC,YAAY,KAAI;AAAA,MAC3B,gBAAgB,EAAC,YAAY,KAAI;AAAA,IAClC,CAAC;AAQM,IAAM,wBAAwB,aAAW;AAC/C,YAAM,EAAC,UAAS,IAAI,QAAQA,UAAS;AACrC,YAAM,UAAU,IAAI,QAAQ,QAAQA,UAAS,EAAE,OAAO;AAGtD,UAAI,CAAC,QAAQ,IAAI,QAAQ,GAAG;AAC3B,gBAAQ,IAAI,UAAU,KAAK;AAAA,MAC5B;AAGA,UAAI,qBAAqB;AACzB,UAAI,QAAQ,SAAS,QAAQ,gBAAgB,KAAK,QAAQ,MAAM,GAAG;AAClE,6BAAqB;AAAA,MACtB;AAEA,UAAI,QAAQ,SAAS,MAAM;AAC1B,cAAM,aAAa,cAAc,OAAO;AAExC,YAAI,OAAO,eAAe,YAAY,CAAC,OAAO,MAAM,UAAU,GAAG;AAChE,+BAAqB,OAAO,UAAU;AAAA,QACvC;AAAA,MACD;AAEA,UAAI,oBAAoB;AACvB,gBAAQ,IAAI,kBAAkB,kBAAkB;AAAA,MACjD;AAKA,UAAI,QAAQ,mBAAmB,IAAI;AAClC,gBAAQ,iBAAiB;AAAA,MAC1B;AAKA,UAAI,QAAQ,YAAY,QAAQ,aAAa,eAAe;AAC3D,gBAAQA,UAAS,EAAE,WAAW,0BAA0B,OAAO;AAAA,MAChE,OAAO;AACN,gBAAQA,UAAS,EAAE,WAAW;AAAA,MAC/B;AAKA,UAAI,QAAQA,UAAS,EAAE,oBAAoB,KAAK;AAC/C,gBAAQ,IAAI,WAAW,QAAQ,QAAQ;AAAA,MACxC;AAGA,UAAI,CAAC,QAAQ,IAAI,YAAY,GAAG;AAC/B,gBAAQ,IAAI,cAAc,YAAY;AAAA,MACvC;AAGA,UAAI,QAAQ,YAAY,CAAC,QAAQ,IAAI,iBAAiB,GAAG;AACxD,gBAAQ,IAAI,mBAAmB,mBAAmB;AAAA,MACnD;AAEA,UAAI,EAAC,MAAK,IAAI;AACd,UAAI,OAAO,UAAU,YAAY;AAChC,gBAAQ,MAAM,SAAS;AAAA,MACxB;AAKA,YAAM,SAAS,UAAU,SAAS;AAIlC,YAAM,UAAU;AAAA;AAAA,QAEf,MAAM,UAAU,WAAW;AAAA;AAAA,QAE3B,QAAQ,QAAQ;AAAA,QAChB,SAAS,QAAQ,OAAO,IAAI,4BAA4B,CAAC,EAAE;AAAA,QAC3D,oBAAoB,QAAQ;AAAA,QAC5B;AAAA,MACD;AAEA,aAAO;AAAA;AAAA,QAEN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA;AAAA;;;ACxTA,IAKa;AALb;AAAA;AAAA;AAKO,IAAM,aAAN,cAAyB,eAAe;AAAA,MAC9C,YAAY,SAAS,OAAO,WAAW;AACtC,cAAM,SAAS,IAAI;AAAA,MACpB;AAAA,IACD;AAAA;AAAA;;;ACTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA,eAAO,MAA6B,KAAK,UAAU;AAClD,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEvC,UAAM,UAAU,IAAI,QAAQ,KAAK,QAAQ;AACzC,UAAM,EAAC,WAAW,QAAO,IAAI,sBAAsB,OAAO;AAC1D,QAAI,CAAC,iBAAiB,IAAI,UAAU,QAAQ,GAAG;AAC9C,YAAM,IAAI,UAAU,0BAA0B,GAAG,iBAAiB,UAAU,SAAS,QAAQ,MAAM,EAAE,CAAC,qBAAqB;AAAA,IAC5H;AAEA,QAAI,UAAU,aAAa,SAAS;AACnC,YAAM,OAAO,aAAgB,QAAQ,GAAG;AACxC,YAAME,YAAW,IAAI,SAAS,MAAM,EAAC,SAAS,EAAC,gBAAgB,KAAK,SAAQ,EAAC,CAAC;AAC9E,cAAQA,SAAQ;AAChB;AAAA,IACD;AAGA,UAAM,QAAQ,UAAU,aAAa,WAAW,kBAAAC,UAAQ,kBAAAC,SAAM;AAC9D,UAAM,EAAC,OAAM,IAAI;AACjB,QAAI,WAAW;AAEf,UAAM,QAAQ,MAAM;AACnB,YAAM,QAAQ,IAAI,WAAW,4BAA4B;AACzD,aAAO,KAAK;AACZ,UAAI,QAAQ,QAAQ,QAAQ,gBAAgB,oBAAAC,QAAO,UAAU;AAC5D,gBAAQ,KAAK,QAAQ,KAAK;AAAA,MAC3B;AAEA,UAAI,CAAC,YAAY,CAAC,SAAS,MAAM;AAChC;AAAA,MACD;AAEA,eAAS,KAAK,KAAK,SAAS,KAAK;AAAA,IAClC;AAEA,QAAI,UAAU,OAAO,SAAS;AAC7B,YAAM;AACN;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,YAAM;AACN,eAAS;AAAA,IACV;AAGA,UAAM,WAAW,KAAK,UAAU,SAAS,GAAG,OAAO;AAEnD,QAAI,QAAQ;AACX,aAAO,iBAAiB,SAAS,gBAAgB;AAAA,IAClD;AAEA,UAAM,WAAW,MAAM;AACtB,eAAS,MAAM;AACf,UAAI,QAAQ;AACX,eAAO,oBAAoB,SAAS,gBAAgB;AAAA,MACrD;AAAA,IACD;AAEA,aAAS,GAAG,SAAS,WAAS;AAC7B,aAAO,IAAI,WAAW,cAAc,QAAQ,GAAG,oBAAoB,MAAM,OAAO,IAAI,UAAU,KAAK,CAAC;AACpG,eAAS;AAAA,IACV,CAAC;AAED,wCAAoC,UAAU,WAAS;AACtD,UAAI,YAAY,SAAS,MAAM;AAC9B,iBAAS,KAAK,QAAQ,KAAK;AAAA,MAC5B;AAAA,IACD,CAAC;AAGD,QAAI,QAAQ,UAAU,OAAO;AAG5B,eAAS,GAAG,UAAU,CAAAC,OAAK;AAC1B,YAAI;AACJ,QAAAA,GAAE,gBAAgB,OAAO,MAAM;AAC9B,iCAAuBA,GAAE;AAAA,QAC1B,CAAC;AACD,QAAAA,GAAE,gBAAgB,SAAS,cAAY;AAEtC,cAAI,YAAY,uBAAuBA,GAAE,gBAAgB,CAAC,UAAU;AACnE,kBAAM,QAAQ,IAAI,MAAM,iBAAiB;AACzC,kBAAM,OAAO;AACb,qBAAS,KAAK,KAAK,SAAS,KAAK;AAAA,UAClC;AAAA,QACD,CAAC;AAAA,MACF,CAAC;AAAA,IACF;AAEA,aAAS,GAAG,YAAY,eAAa;AACpC,eAAS,WAAW,CAAC;AACrB,YAAM,UAAU,eAAe,UAAU,UAAU;AAGnD,UAAI,WAAW,UAAU,UAAU,GAAG;AAErC,cAAM,WAAW,QAAQ,IAAI,UAAU;AAGvC,YAAI,cAAc;AAClB,YAAI;AACH,wBAAc,aAAa,OAAO,OAAO,IAAI,IAAI,UAAU,QAAQ,GAAG;AAAA,QACvE,QAAQ;AAIP,cAAI,QAAQ,aAAa,UAAU;AAClC,mBAAO,IAAI,WAAW,wDAAwD,QAAQ,IAAI,kBAAkB,CAAC;AAC7G,qBAAS;AACT;AAAA,UACD;AAAA,QACD;AAGA,gBAAQ,QAAQ,UAAU;AAAA,UACzB,KAAK;AACJ,mBAAO,IAAI,WAAW,0EAA0E,QAAQ,GAAG,IAAI,aAAa,CAAC;AAC7H,qBAAS;AACT;AAAA,UACD,KAAK;AAEJ;AAAA,UACD,KAAK,UAAU;AAEd,gBAAI,gBAAgB,MAAM;AACzB;AAAA,YACD;AAGA,gBAAI,QAAQ,WAAW,QAAQ,QAAQ;AACtC,qBAAO,IAAI,WAAW,gCAAgC,QAAQ,GAAG,IAAI,cAAc,CAAC;AACpF,uBAAS;AACT;AAAA,YACD;AAIA,kBAAM,iBAAiB;AAAA,cACtB,SAAS,IAAI,QAAQ,QAAQ,OAAO;AAAA,cACpC,QAAQ,QAAQ;AAAA,cAChB,SAAS,QAAQ,UAAU;AAAA,cAC3B,OAAO,QAAQ;AAAA,cACf,UAAU,QAAQ;AAAA,cAClB,QAAQ,QAAQ;AAAA,cAChB,MAAM,MAAM,OAAO;AAAA,cACnB,QAAQ,QAAQ;AAAA,cAChB,MAAM,QAAQ;AAAA,cACd,UAAU,QAAQ;AAAA,cAClB,gBAAgB,QAAQ;AAAA,YACzB;AAWA,gBAAI,CAAC,oBAAoB,QAAQ,KAAK,WAAW,KAAK,CAAC,eAAe,QAAQ,KAAK,WAAW,GAAG;AAChG,yBAAW,QAAQ,CAAC,iBAAiB,oBAAoB,UAAU,SAAS,GAAG;AAC9E,+BAAe,QAAQ,OAAO,IAAI;AAAA,cACnC;AAAA,YACD;AAGA,gBAAI,UAAU,eAAe,OAAO,QAAQ,QAAQ,SAAS,gBAAgB,oBAAAD,QAAO,UAAU;AAC7F,qBAAO,IAAI,WAAW,4DAA4D,sBAAsB,CAAC;AACzG,uBAAS;AACT;AAAA,YACD;AAGA,gBAAI,UAAU,eAAe,QAAS,UAAU,eAAe,OAAO,UAAU,eAAe,QAAQ,QAAQ,WAAW,QAAS;AAClI,6BAAe,SAAS;AACxB,6BAAe,OAAO;AACtB,6BAAe,QAAQ,OAAO,gBAAgB;AAAA,YAC/C;AAGA,kBAAM,yBAAyB,8BAA8B,OAAO;AACpE,gBAAI,wBAAwB;AAC3B,6BAAe,iBAAiB;AAAA,YACjC;AAGA,oBAAQ,MAAM,IAAI,QAAQ,aAAa,cAAc,CAAC,CAAC;AACvD,qBAAS;AACT;AAAA,UACD;AAAA,UAEA;AACC,mBAAO,OAAO,IAAI,UAAU,oBAAoB,QAAQ,QAAQ,2CAA2C,CAAC;AAAA,QAC9G;AAAA,MACD;AAGA,UAAI,QAAQ;AACX,kBAAU,KAAK,OAAO,MAAM;AAC3B,iBAAO,oBAAoB,SAAS,gBAAgB;AAAA,QACrD,CAAC;AAAA,MACF;AAEA,UAAI,WAAO,oBAAAE,UAAK,WAAW,IAAI,gCAAY,GAAG,WAAS;AACtD,YAAI,OAAO;AACV,iBAAO,KAAK;AAAA,QACb;AAAA,MACD,CAAC;AAGD,UAAI,QAAQ,UAAU,UAAU;AAC/B,kBAAU,GAAG,WAAW,gBAAgB;AAAA,MACzC;AAEA,YAAM,kBAAkB;AAAA,QACvB,KAAK,QAAQ;AAAA,QACb,QAAQ,UAAU;AAAA,QAClB,YAAY,UAAU;AAAA,QACtB;AAAA,QACA,MAAM,QAAQ;AAAA,QACd,SAAS,QAAQ;AAAA,QACjB,eAAe,QAAQ;AAAA,MACxB;AAGA,YAAM,UAAU,QAAQ,IAAI,kBAAkB;AAU9C,UAAI,CAAC,QAAQ,YAAY,QAAQ,WAAW,UAAU,YAAY,QAAQ,UAAU,eAAe,OAAO,UAAU,eAAe,KAAK;AACvI,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAOA,YAAM,cAAc;AAAA,QACnB,OAAO,iBAAAC,QAAK;AAAA,QACZ,aAAa,iBAAAA,QAAK;AAAA,MACnB;AAGA,UAAI,YAAY,UAAU,YAAY,UAAU;AAC/C,mBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,aAAa,WAAW,GAAG,WAAS;AAC1D,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAGA,UAAI,YAAY,aAAa,YAAY,aAAa;AAGrD,cAAM,UAAM,oBAAAD,UAAK,WAAW,IAAI,gCAAY,GAAG,WAAS;AACvD,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,YAAI,KAAK,QAAQ,WAAS;AAEzB,eAAK,MAAM,CAAC,IAAI,QAAU,GAAM;AAC/B,uBAAO,oBAAAA,UAAK,MAAM,iBAAAC,QAAK,cAAc,GAAG,WAAS;AAChD,kBAAI,OAAO;AACV,uBAAO,KAAK;AAAA,cACb;AAAA,YACD,CAAC;AAAA,UACF,OAAO;AACN,uBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,iBAAiB,GAAG,WAAS;AACnD,kBAAI,OAAO;AACV,uBAAO,KAAK;AAAA,cACb;AAAA,YACD,CAAC;AAAA,UACF;AAEA,qBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,kBAAQ,QAAQ;AAAA,QACjB,CAAC;AACD,YAAI,KAAK,OAAO,MAAM;AAGrB,cAAI,CAAC,UAAU;AACd,uBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,oBAAQ,QAAQ;AAAA,UACjB;AAAA,QACD,CAAC;AACD;AAAA,MACD;AAGA,UAAI,YAAY,MAAM;AACrB,mBAAO,oBAAAD,UAAK,MAAM,iBAAAC,QAAK,uBAAuB,GAAG,WAAS;AACzD,cAAI,OAAO;AACV,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AACD,mBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,gBAAQ,QAAQ;AAChB;AAAA,MACD;AAGA,iBAAW,IAAI,SAAS,MAAM,eAAe;AAC7C,cAAQ,QAAQ;AAAA,IACjB,CAAC;AAGD,kBAAc,UAAU,OAAO,EAAE,MAAM,MAAM;AAAA,EAC9C,CAAC;AACF;AAEA,SAAS,oCAAoC,SAAS,eAAe;AACpE,QAAM,aAAa,2BAAO,KAAK,WAAW;AAE1C,MAAI,oBAAoB;AACxB,MAAI,0BAA0B;AAC9B,MAAI;AAEJ,UAAQ,GAAG,YAAY,cAAY;AAClC,UAAM,EAAC,QAAO,IAAI;AAClB,wBAAoB,QAAQ,mBAAmB,MAAM,aAAa,CAAC,QAAQ,gBAAgB;AAAA,EAC5F,CAAC;AAED,UAAQ,GAAG,UAAU,YAAU;AAC9B,UAAM,gBAAgB,MAAM;AAC3B,UAAI,qBAAqB,CAAC,yBAAyB;AAClD,cAAM,QAAQ,IAAI,MAAM,iBAAiB;AACzC,cAAM,OAAO;AACb,sBAAc,KAAK;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,SAAS,SAAO;AACrB,gCAA0B,2BAAO,QAAQ,IAAI,MAAM,EAAE,GAAG,UAAU,MAAM;AAGxE,UAAI,CAAC,2BAA2B,eAAe;AAC9C,kCACC,2BAAO,QAAQ,cAAc,MAAM,EAAE,GAAG,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,KACpE,2BAAO,QAAQ,IAAI,MAAM,EAAE,GAAG,WAAW,MAAM,CAAC,CAAC,MAAM;AAAA,MAEzD;AAEA,sBAAgB;AAAA,IACjB;AAEA,WAAO,gBAAgB,SAAS,aAAa;AAC7C,WAAO,GAAG,QAAQ,MAAM;AAExB,YAAQ,GAAG,SAAS,MAAM;AACzB,aAAO,eAAe,SAAS,aAAa;AAC5C,aAAO,eAAe,QAAQ,MAAM;AAAA,IACrC,CAAC;AAAA,EACF,CAAC;AACF;AAhaA,IAQAC,mBACA,mBACA,kBACAC,qBACAC,qBA0BM;AAtCN;AAAA;AAQA,IAAAF,oBAAiB;AACjB,wBAAkB;AAClB,uBAAiB;AACjB,IAAAC,sBAAoD;AACpD,IAAAC,sBAAqB;AAErB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA,IAAM,mBAAmB,oBAAI,IAAI,CAAC,SAAS,SAAS,QAAQ,CAAC;AAAA;AAAA;;;AC9B7D,SAAS,gBAAgB,KAAK,WAAW,MAAM;AAC7C,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAE7B,MAAI,CAAC,SAAS,MAAM,KAAK,MAAM,IAAI;AACjC,QAAI,UAAU;AACZ,cAAQ,MAAM,iCAAiC,GAAG,sBAAsB;AACxE,aAAO;AAAA,IACT;AACA,YAAQ,KAAK,iCAAiC,GAAG,aAAa;AAC9D,WAAO;AAAA,EACT;AAGA,MAAI,IAAI,SAAS,SAAS,KAAK,MAAM,SAAS,IAAI;AAChD,YAAQ,MAAM,wBAAwB,GAAG,oCAAoC;AAC7E,WAAO;AAAA,EACT;AAEA,SAAO,MAAM,KAAK;AACpB;AASA,SAAS,oBAAoB,YAAY,SAAS,UAAU,MAAM;AAChE,QAAM,WAAW;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,+BAA+B;AAAA,MAC/B,gCAAgC;AAAA,MAChC,gCAAgC;AAAA,IAClC;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,OAAO;AAAA,MACP,GAAI,WAAW,EAAE,QAAQ;AAAA,IAC3B,CAAC;AAAA,EACH;AAGA,UAAQ,MAAM,SAAS,UAAU,KAAK,OAAO,GAAG,UAAU,MAAM,OAAO,KAAK,EAAE,EAAE;AAEhF,SAAO;AACT;AAEA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,QAAM,EAAE,SAASC,OAAM,IAAI,MAAM;AAGjC,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAGA,MAAI,MAAM,eAAe,QAAQ;AAC/B,WAAO,oBAAoB,KAAK,oBAAoB;AAAA,EACtD;AAEA,MAAI;AAEF,QAAI;AACJ,QAAI;AACF,oBAAc,KAAK,MAAM,MAAM,IAAI;AAAA,IACrC,SAAS,YAAY;AACnB,aAAO,oBAAoB,KAAK,gCAAgC,WAAW,OAAO;AAAA,IACpF;AAEA,UAAM,EAAE,UAAU,KAAK,IAAI;AAE3B,QAAI,CAAC,UAAU;AACb,aAAO,oBAAoB,KAAK,4BAA4B;AAAA,IAC9D;AAGA,QAAI,OAAO,aAAa,YAAY,SAAS,KAAK,MAAM,IAAI;AAC1D,aAAO,oBAAoB,KAAK,4BAA4B;AAAA,IAC9D;AAIA,QAAI;AACJ,QAAI,SAAS,WAAW,KAAK,GAAG;AAE9B,kBAAY,6CAA6C,QAAQ;AAAA,IACnE,OAAO;AAEL,kBAAY,6CAA6C,QAAQ;AAAA,IACnE;AAGA,UAAM,SAAS,gBAAgB,kBAAkB,IAAI;AAErD,QAAI,CAAC,QAAQ;AACX,aAAO,oBAAoB,KAAK,mCAAmC;AAAA,IACrE;AAGA,UAAM,gBAAgB,gBAAgB,YAAY,KAAK,MAAM;AAC7D,QAAI,eAAe;AACjB,cAAQ,IAAI,sBAAsB,SAAS,EAAE;AAC7C,cAAQ,IAAI,sBAAsB,OAAO,KAAK,QAAQ,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;AACtE,cAAQ,IAAI,sBAAsB;AAAA,IACpC;AAGA,QAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,aAAO,oBAAoB,KAAK,gCAAgC;AAAA,IAClE;AAGA,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,YAAY,WAAW,MAAM,WAAW,MAAM,GAAG,GAAK;AAE5D,QAAI;AACJ,QAAI;AACF,iBAAW,MAAMA,OAAM,WAAW;AAAA,QAChC,QAAQ;AAAA,QACR,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,aAAa;AAAA,UACb,cAAc;AAAA,QAChB;AAAA,QACA,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC;AAAA,QAC/B,QAAQ,WAAW;AAAA,MACrB,CAAC;AAAA,IACH,SAAS,YAAY;AACnB,mBAAa,SAAS;AACtB,UAAI,WAAW,SAAS,cAAc;AACpC,eAAO,oBAAoB,KAAK,iBAAiB;AAAA,MACnD;AACA,aAAO,oBAAoB,KAAK,mCAAmC,WAAW,OAAO;AAAA,IACvF,UAAE;AACA,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,eAAe;AACjB,cAAQ,IAAI,oBAAoB,SAAS,MAAM,EAAE;AACjD,cAAQ,IAAI,yBAAyB,SAAS,UAAU,EAAE;AAAA,IAC5D;AAGA,QAAI;AACJ,QAAI;AACF,aAAO,MAAM,SAAS,KAAK;AAAA,IAC7B,SAAS,WAAW;AAClB,aAAO,oBAAoB,KAAK,yCAAyC,UAAU,OAAO;AAAA,IAC5F;AAGA,WAAO;AAAA,MACL,YAAY,SAAS;AAAA,MACrB,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,QAChC,iBAAiB;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,IAAI;AAAA,IAC3B;AAAA,EACF,SAAS,OAAO;AAEd,YAAQ,MAAM,mBAAmB;AAAA,MAC/B,SAAS,MAAM;AAAA,MACf,OAAO,MAAM;AAAA,MACb,MAAM,MAAM;AAAA,IACd,CAAC;AAED,WAAO,oBAAoB,KAAK,yBAAyB,MAAM,OAAO;AAAA,EACxE;AACF;&quot;, &quot;names&quot;: [&quot;i&quot;, &quot;noop&quot;, &quot;x&quot;, &quot;_a&quot;, &quot;F&quot;, &quot;i&quot;, &quot;e&quot;, &quot;queueMicrotask&quot;, &quot;r&quot;, &quot;isAbortSignal&quot;, &quot;streamBrandCheckException&quot;, &quot;defaultControllerBrandCheckException&quot;, &quot;DOMException&quot;, &quot;ReadableStream&quot;, &quot;POOL_SIZE&quot;, &quot;process&quot;, &quot;Blob&quot;, &quot;clone&quot;, &quot;Blob&quot;, &quot;size&quot;, &quot;File&quot;, &quot;F&quot;, &quot;f&quot;, &quot;e&quot;, &quot;FormData&quot;, &quot;m&quot;, &quot;exports&quot;, &quot;module&quot;, &quot;fs&quot;, &quot;stat&quot;, &quot;DOMException&quot;, &quot;m&quot;, &quot;Body&quot;, &quot;f&quot;, &quot;i&quot;, &quot;clear&quot;, &quot;Stream&quot;, &quot;toFormData&quot;, &quot;import_node_util&quot;, &quot;http&quot;, &quot;INTERNALS&quot;, &quot;import_node_util&quot;, &quot;INTERNALS&quot;, &quot;formatUrl&quot;, &quot;response&quot;, &quot;https&quot;, &quot;http&quot;, &quot;Stream&quot;, &quot;s&quot;, &quot;pump&quot;, &quot;zlib&quot;, &quot;import_node_http&quot;, &quot;import_node_stream&quot;, &quot;import_node_buffer&quot;, &quot;fetch&quot;] } </div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ package.json</div> <div class="content">{&quot;type&quot;:&quot;commonjs&quot;}</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ sitemap</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ___netlify-telemetry.mjs</div> <div class="content"> var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from&quot;module&quot;;const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=&gt;typeof require&lt;&quot;u&quot;?require:typeof Proxy&lt;&quot;u&quot;?new Proxy(r,{get:(e,t)=&gt;(typeof require&lt;&quot;u&quot;?require:e)[t]}):r)(function(r){if(typeof require&lt;&quot;u&quot;)return require.apply(this,arguments);throw Error(&#x27;Dynamic require of &quot;&#x27;+r+&#x27;&quot; is not supported&#x27;)});var p=(r,e)=&gt;()=&gt;(r&amp;&amp;(e=r(r=0)),e);var T=(r,e)=&gt;()=&gt;(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=&gt;{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=&gt;{if(e&amp;&amp;typeof e==&quot;object&quot;||typeof e==&quot;function&quot;)for(let s of lz(e))!uz.call(r,s)&amp;&amp;s!==t&amp;&amp;xu(r,s,{get:()=&gt;e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=&gt;(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,&quot;default&quot;,{value:r,enumerable:!0}):t,r)),ee=r=&gt;NR(xu({},&quot;__esModule&quot;,{value:!0}),r);var CR,PR=p(()=&gt;{CR=typeof globalThis==&quot;object&quot;?globalThis:global});var IR=p(()=&gt;{PR()});var bR=p(()=&gt;{IR()});var cn,hm=p(()=&gt;{cn=&quot;1.9.0&quot;});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&amp;&amp;s.patch&lt;=u.patch?i(l):a(l):s.minor&lt;=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=&gt;{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&amp;&amp;(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&amp;&amp;s!==void 0?s:{version:cn};if(!o&amp;&amp;a[r]){var i=new Error(&quot;@opentelemetry/api: Attempted duplicate registration of API: &quot;+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error(&quot;@opentelemetry/api: Registration of version v&quot;+a.version+&quot; for &quot;+r+&quot; does not match previously registered API v&quot;+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug(&quot;@opentelemetry/api: Registered a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug(&quot;@opentelemetry/api: Unregistering a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;);var t=Fa[Va];t&amp;&amp;delete t[r]}var pz,Va,Fa,Ei=p(()=&gt;{bR();hm();MR();pz=cn.split(&quot;.&quot;)[0],Va=Symbol.for(&quot;opentelemetry.js.api.&quot;+pz),Fa=CR});function Ga(r,e,t){var o=xt(&quot;diag&quot;);if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=&gt;{Ei();dz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||&quot;DiagComponentLogger&quot;}return r.prototype.debug=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;debug&quot;,this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;error&quot;,this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;info&quot;,this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;warn&quot;,this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;verbose&quot;,this._namespace,e)},r})()});var H,Mu=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.ERROR=30]=&quot;ERROR&quot;,r[r.WARN=50]=&quot;WARN&quot;,r[r.INFO=60]=&quot;INFO&quot;,r[r.DEBUG=70]=&quot;DEBUG&quot;,r[r.VERBOSE=80]=&quot;VERBOSE&quot;,r[r.ALL=9999]=&quot;ALL&quot;})(H||(H={}))});function UR(r,e){r&lt;H.NONE?r=H.NONE:r&gt;H.ALL&amp;&amp;(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a==&quot;function&quot;&amp;&amp;r&gt;=s?a.bind(e):function(){}}return{error:t(&quot;error&quot;,H.ERROR),warn:t(&quot;warn&quot;,H.WARN),info:t(&quot;info&quot;,H.INFO),debug:t(&quot;debug&quot;,H.DEBUG),verbose:t(&quot;verbose&quot;,H.VERBOSE)}}var kR=p(()=&gt;{Mu()});var _z,Ez,mz,ft,mi=p(()=&gt;{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz=&quot;diag&quot;,ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i&lt;arguments.length;i++)a[i]=arguments[i];var n=xt(&quot;diag&quot;);if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&amp;&amp;(a={logLevel:H.INFO}),s===t){var c=new Error(&quot;Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation&quot;);return t.error((i=c.stack)!==null&amp;&amp;i!==void 0?i:c.message),!1}typeof a==&quot;number&quot;&amp;&amp;(a={logLevel:a});var u=xt(&quot;diag&quot;),f=UR((n=a.logLevel)!==null&amp;&amp;n!==void 0?n:H.INFO,s);if(u&amp;&amp;!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&amp;&amp;l!==void 0?l:&quot;&lt;failed to generate stacktrace&gt;&quot;;u.warn(&quot;Current logger will be overwritten from &quot;+_),f.warn(&quot;Current logger will overwrite one already registered from &quot;+_)}return Ir(&quot;diag&quot;,f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e(&quot;verbose&quot;),t.debug=e(&quot;debug&quot;),t.info=e(&quot;info&quot;),t.warn=e(&quot;warn&quot;),t.error=e(&quot;error&quot;)}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=&gt;{Tz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s&lt;arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&amp;&amp;!n.done&amp;&amp;(t=i.return)&amp;&amp;t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=&gt;{FR=Symbol(&quot;BaggageEntryMetadata&quot;)});function HR(r){return r===void 0&amp;&amp;(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!=&quot;string&quot;&amp;&amp;(gz.error(&quot;Cannot create baggage metadata from unknown type: &quot;+typeof r),r=&quot;&quot;),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=&gt;{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=&gt;{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=&gt;{Em=[{n:&quot;error&quot;,c:&quot;error&quot;},{n:&quot;warn&quot;,c:&quot;warn&quot;},{n:&quot;info&quot;,c:&quot;info&quot;},{n:&quot;debug&quot;,c:&quot;debug&quot;},{n:&quot;verbose&quot;,c:&quot;trace&quot;}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a&lt;arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!=&quot;function&quot;&amp;&amp;(i=console.log),typeof i==&quot;function&quot;)return i.apply(console,s)}}}for(var t=0;t&lt;Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=&gt;{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=&gt;{(function(r){r[r.INT=0]=&quot;INT&quot;,r[r.DOUBLE=1]=&quot;DOUBLE&quot;})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=&gt;{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&amp;&amp;(r[e]=t)}}});var kz,Bz,YR,zR=p(()=&gt;{Ha();kz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a&lt;arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=&gt;{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm=&quot;context&quot;,Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i&lt;arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.SAMPLED=1]=&quot;SAMPLED&quot;})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=&gt;{ym();ja=&quot;0000000000000000&quot;,Ya=&quot;00000000000000000000000000000000&quot;,Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=&gt;{Fu();Pn=(function(){function r(e){e===void 0&amp;&amp;(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=&gt;{Ha();Gu();qa();Om=De(&quot;OpenTelemetry Context Key SPAN&quot;)});function Mt(r){return Hz.test(r)&amp;&amp;r!==Ya}function Si(r){return qz.test(r)&amp;&amp;r!==ja}function xe(r){return Mt(r.traceId)&amp;&amp;Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=&gt;{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r==&quot;object&quot;&amp;&amp;typeof r.spanId==&quot;string&quot;&amp;&amp;typeof r.traceId==&quot;string&quot;&amp;&amp;typeof r.traceFlags==&quot;number&quot;}var Rm,Yu,Nm=p(()=&gt;{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&amp;&amp;(o=Rm.active());var s=!!(t!=null&amp;&amp;t.root);if(s)return new Pn;var a=o&amp;&amp;qu(o);return jz(a)&amp;&amp;xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length&lt;2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=&gt;{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=&gt;{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=&gt;{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&amp;&amp;s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(ke||(ke={}))});var qt,eN=p(()=&gt;{(function(r){r[r.INTERNAL=0]=&quot;INTERNAL&quot;,r[r.SERVER=1]=&quot;SERVER&quot;,r[r.CLIENT=2]=&quot;CLIENT&quot;,r[r.PRODUCER=3]=&quot;PRODUCER&quot;,r[r.CONSUMER=4]=&quot;CONSUMER&quot;})(qt||(qt={}))});var jt,tN=p(()=&gt;{(function(r){r[r.UNSET=0]=&quot;UNSET&quot;,r[r.OK=1]=&quot;OK&quot;,r[r.ERROR=2]=&quot;ERROR&quot;})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&amp;&amp;!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=&gt;{Im=&quot;[_0-9a-z-*/]&quot;,Kz=&quot;[a-z]&quot;+Im+&quot;{0,255}&quot;,$z=&quot;[a-z0-9]&quot;+Im+&quot;{0,240}@[a-z]&quot;+Im+&quot;{0,13}&quot;,Xz=new RegExp(&quot;^(?:&quot;+Kz+&quot;|&quot;+$z+&quot;)$&quot;),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=&gt;{iN();oN=32,Qz=512,sN=&quot;,&quot;,aN=&quot;=&quot;,lN=(function(){function r(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length&gt;Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&amp;&amp;nN(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;oN&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=&gt;{cN()});var he,pN=p(()=&gt;{qa();he=Cn.getInstance()});var S,dN=p(()=&gt;{mi();S=ft.instance()});var Zz,hN,_N=p(()=&gt;{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=&gt;{_N();Ei();mi();bm=&quot;metrics&quot;,EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=&gt;{mN();gi=EN.getInstance()});var SN,gN=p(()=&gt;{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=&gt;{qa();Ha();Lm=De(&quot;OpenTelemetry Baggage Key&quot;)});var Mm,eK,RN,NN=p(()=&gt;{Ei();gN();gm();AN();_m();mi();Mm=&quot;propagation&quot;,eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&amp;&amp;(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&amp;&amp;(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=&gt;{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=&gt;{Ei();Pm();ju();Am();mi();wm=&quot;trace&quot;,PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&amp;&amp;this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=&gt;{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=&gt;Du,DiagLogLevel:()=&gt;H,INVALID_SPANID:()=&gt;ja,INVALID_SPAN_CONTEXT:()=&gt;Uo,INVALID_TRACEID:()=&gt;Ya,ProxyTracer:()=&gt;zu,ProxyTracerProvider:()=&gt;Ka,ROOT_CONTEXT:()=&gt;wu,SamplingDecision:()=&gt;ke,SpanKind:()=&gt;qt,SpanStatusCode:()=&gt;jt,TraceFlags:()=&gt;se,ValueType:()=&gt;Ot,baggageEntryMetadataFromString:()=&gt;Lr,context:()=&gt;he,createContextKey:()=&gt;De,createNoopMeter:()=&gt;ku,createTraceState:()=&gt;uN,default:()=&gt;tK,defaultTextMapGetter:()=&gt;Bu,defaultTextMapSetter:()=&gt;Vu,diag:()=&gt;S,isSpanContextValid:()=&gt;xe,isValidSpanId:()=&gt;Si,isValidTraceId:()=&gt;Mt,metrics:()=&gt;gi,propagation:()=&gt;Ue,trace:()=&gt;ie});var tK,P=p(()=&gt;{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o&lt;t;o++){var s=r[o];s&amp;&amp;(e[String(s).toUpperCase().replace(/[-.]/g,&quot;_&quot;)]=s)}return e}var Dm=p(()=&gt;{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=&gt;{Dm();MN=&quot;aws.lambda.invoked_arn&quot;,wN=&quot;db.system&quot;,DN=&quot;db.connection_string&quot;,UN=&quot;db.user&quot;,kN=&quot;db.jdbc.driver_classname&quot;,BN=&quot;db.name&quot;,VN=&quot;db.statement&quot;,FN=&quot;db.operation&quot;,GN=&quot;db.mssql.instance_name&quot;,HN=&quot;db.cassandra.keyspace&quot;,qN=&quot;db.cassandra.page_size&quot;,jN=&quot;db.cassandra.consistency_level&quot;,YN=&quot;db.cassandra.table&quot;,zN=&quot;db.cassandra.idempotence&quot;,KN=&quot;db.cassandra.speculative_execution_count&quot;,$N=&quot;db.cassandra.coordinator.id&quot;,XN=&quot;db.cassandra.coordinator.dc&quot;,WN=&quot;db.hbase.namespace&quot;,JN=&quot;db.redis.database_index&quot;,QN=&quot;db.mongodb.collection&quot;,ZN=&quot;db.sql.table&quot;,eC=&quot;exception.type&quot;,tC=&quot;exception.message&quot;,rC=&quot;exception.stacktrace&quot;,nC=&quot;exception.escaped&quot;,iC=&quot;faas.trigger&quot;,oC=&quot;faas.execution&quot;,sC=&quot;faas.document.collection&quot;,aC=&quot;faas.document.operation&quot;,lC=&quot;faas.document.time&quot;,cC=&quot;faas.document.name&quot;,uC=&quot;faas.time&quot;,fC=&quot;faas.cron&quot;,pC=&quot;faas.coldstart&quot;,dC=&quot;faas.invoked_name&quot;,hC=&quot;faas.invoked_provider&quot;,_C=&quot;faas.invoked_region&quot;,EC=&quot;net.transport&quot;,mC=&quot;net.peer.ip&quot;,TC=&quot;net.peer.port&quot;,SC=&quot;net.peer.name&quot;,gC=&quot;net.host.ip&quot;,vC=&quot;net.host.port&quot;,yC=&quot;net.host.name&quot;,OC=&quot;net.host.connection.type&quot;,AC=&quot;net.host.connection.subtype&quot;,RC=&quot;net.host.carrier.name&quot;,NC=&quot;net.host.carrier.mcc&quot;,CC=&quot;net.host.carrier.mnc&quot;,PC=&quot;net.host.carrier.icc&quot;,IC=&quot;peer.service&quot;,bC=&quot;enduser.id&quot;,LC=&quot;enduser.role&quot;,xC=&quot;enduser.scope&quot;,MC=&quot;thread.id&quot;,wC=&quot;thread.name&quot;,DC=&quot;code.function&quot;,UC=&quot;code.namespace&quot;,kC=&quot;code.filepath&quot;,BC=&quot;code.lineno&quot;,VC=&quot;http.method&quot;,FC=&quot;http.url&quot;,GC=&quot;http.target&quot;,HC=&quot;http.host&quot;,qC=&quot;http.scheme&quot;,jC=&quot;http.status_code&quot;,YC=&quot;http.flavor&quot;,zC=&quot;http.user_agent&quot;,KC=&quot;http.request_content_length&quot;,$C=&quot;http.request_content_length_uncompressed&quot;,XC=&quot;http.response_content_length&quot;,WC=&quot;http.response_content_length_uncompressed&quot;,JC=&quot;http.server_name&quot;,QC=&quot;http.route&quot;,ZC=&quot;http.client_ip&quot;,eP=&quot;aws.dynamodb.table_names&quot;,tP=&quot;aws.dynamodb.consumed_capacity&quot;,rP=&quot;aws.dynamodb.item_collection_metrics&quot;,nP=&quot;aws.dynamodb.provisioned_read_capacity&quot;,iP=&quot;aws.dynamodb.provisioned_write_capacity&quot;,oP=&quot;aws.dynamodb.consistent_read&quot;,sP=&quot;aws.dynamodb.projection&quot;,aP=&quot;aws.dynamodb.limit&quot;,lP=&quot;aws.dynamodb.attributes_to_get&quot;,cP=&quot;aws.dynamodb.index_name&quot;,uP=&quot;aws.dynamodb.select&quot;,fP=&quot;aws.dynamodb.global_secondary_indexes&quot;,pP=&quot;aws.dynamodb.local_secondary_indexes&quot;,dP=&quot;aws.dynamodb.exclusive_start_table&quot;,hP=&quot;aws.dynamodb.table_count&quot;,_P=&quot;aws.dynamodb.scan_forward&quot;,EP=&quot;aws.dynamodb.segment&quot;,mP=&quot;aws.dynamodb.total_segments&quot;,TP=&quot;aws.dynamodb.count&quot;,SP=&quot;aws.dynamodb.scanned_count&quot;,gP=&quot;aws.dynamodb.attribute_definitions&quot;,vP=&quot;aws.dynamodb.global_secondary_index_updates&quot;,yP=&quot;messaging.system&quot;,OP=&quot;messaging.destination&quot;,AP=&quot;messaging.destination_kind&quot;,RP=&quot;messaging.temp_destination&quot;,NP=&quot;messaging.protocol&quot;,CP=&quot;messaging.protocol_version&quot;,PP=&quot;messaging.url&quot;,IP=&quot;messaging.message_id&quot;,bP=&quot;messaging.conversation_id&quot;,LP=&quot;messaging.message_payload_size_bytes&quot;,xP=&quot;messaging.message_payload_compressed_size_bytes&quot;,MP=&quot;messaging.operation&quot;,wP=&quot;messaging.consumer_id&quot;,DP=&quot;messaging.rabbitmq.routing_key&quot;,UP=&quot;messaging.kafka.message_key&quot;,kP=&quot;messaging.kafka.consumer_group&quot;,BP=&quot;messaging.kafka.client_id&quot;,VP=&quot;messaging.kafka.partition&quot;,FP=&quot;messaging.kafka.tombstone&quot;,GP=&quot;rpc.system&quot;,HP=&quot;rpc.service&quot;,qP=&quot;rpc.method&quot;,jP=&quot;rpc.grpc.status_code&quot;,YP=&quot;rpc.jsonrpc.version&quot;,zP=&quot;rpc.jsonrpc.request_id&quot;,KP=&quot;rpc.jsonrpc.error_code&quot;,$P=&quot;rpc.jsonrpc.error_message&quot;,XP=&quot;message.type&quot;,WP=&quot;message.id&quot;,JP=&quot;message.compressed_size&quot;,QP=&quot;message.uncompressed_size&quot;,rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP=&quot;other_sql&quot;,eI=&quot;mssql&quot;,tI=&quot;mysql&quot;,rI=&quot;oracle&quot;,nI=&quot;db2&quot;,iI=&quot;postgresql&quot;,oI=&quot;redshift&quot;,sI=&quot;hive&quot;,aI=&quot;cloudscape&quot;,lI=&quot;hsqldb&quot;,cI=&quot;progress&quot;,uI=&quot;maxdb&quot;,fI=&quot;hanadb&quot;,pI=&quot;ingres&quot;,dI=&quot;firstsql&quot;,hI=&quot;edb&quot;,_I=&quot;cache&quot;,EI=&quot;adabas&quot;,mI=&quot;firebird&quot;,TI=&quot;derby&quot;,SI=&quot;filemaker&quot;,gI=&quot;informix&quot;,vI=&quot;instantdb&quot;,yI=&quot;interbase&quot;,OI=&quot;mariadb&quot;,AI=&quot;netezza&quot;,RI=&quot;pervasive&quot;,NI=&quot;pointbase&quot;,CI=&quot;sqlite&quot;,PI=&quot;sybase&quot;,II=&quot;teradata&quot;,bI=&quot;vertica&quot;,LI=&quot;h2&quot;,xI=&quot;coldfusion&quot;,MI=&quot;cassandra&quot;,wI=&quot;hbase&quot;,DI=&quot;mongodb&quot;,UI=&quot;redis&quot;,kI=&quot;couchbase&quot;,BI=&quot;couchdb&quot;,VI=&quot;cosmosdb&quot;,FI=&quot;dynamodb&quot;,GI=&quot;neo4j&quot;,HI=&quot;geode&quot;,qI=&quot;elasticsearch&quot;,jI=&quot;memcached&quot;,YI=&quot;cockroachdb&quot;,gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI=&quot;all&quot;,KI=&quot;each_quorum&quot;,$I=&quot;quorum&quot;,XI=&quot;local_quorum&quot;,WI=&quot;one&quot;,JI=&quot;two&quot;,QI=&quot;three&quot;,ZI=&quot;local_one&quot;,eb=&quot;any&quot;,tb=&quot;serial&quot;,rb=&quot;local_serial&quot;,hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb=&quot;datasource&quot;,ib=&quot;http&quot;,ob=&quot;pubsub&quot;,sb=&quot;timer&quot;,ab=&quot;other&quot;,NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb=&quot;insert&quot;,cb=&quot;edit&quot;,ub=&quot;delete&quot;,xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb=&quot;alibaba_cloud&quot;,pb=&quot;aws&quot;,db=&quot;azure&quot;,hb=&quot;gcp&quot;,UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b=&quot;ip_tcp&quot;,Eb=&quot;ip_udp&quot;,mb=&quot;ip&quot;,Tb=&quot;unix&quot;,Sb=&quot;pipe&quot;,gb=&quot;inproc&quot;,vb=&quot;other&quot;,GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb=&quot;wifi&quot;,Ob=&quot;wired&quot;,Ab=&quot;cell&quot;,Rb=&quot;unavailable&quot;,Nb=&quot;unknown&quot;,XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb=&quot;gprs&quot;,Pb=&quot;edge&quot;,Ib=&quot;umts&quot;,bb=&quot;cdma&quot;,Lb=&quot;evdo_0&quot;,xb=&quot;evdo_a&quot;,Mb=&quot;cdma2000_1xrtt&quot;,wb=&quot;hsdpa&quot;,Db=&quot;hsupa&quot;,Ub=&quot;hspa&quot;,kb=&quot;iden&quot;,Bb=&quot;evdo_b&quot;,Vb=&quot;lte&quot;,Fb=&quot;ehrpd&quot;,Gb=&quot;hspap&quot;,Hb=&quot;gsm&quot;,qb=&quot;td_scdma&quot;,jb=&quot;iwlan&quot;,Yb=&quot;nr&quot;,zb=&quot;nrnsa&quot;,Kb=&quot;lte_ca&quot;,t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b=&quot;1.0&quot;,Xb=&quot;1.1&quot;,Wb=&quot;2.0&quot;,Jb=&quot;SPDY&quot;,Qb=&quot;QUIC&quot;,O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb=&quot;queue&quot;,eL=&quot;topic&quot;,I8=Zb,b8=eL,L8=Be([Zb,eL]),tL=&quot;receive&quot;,rL=&quot;process&quot;,x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL=&quot;SENT&quot;,vL=&quot;RECEIVED&quot;,Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=&gt;{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=&gt;{Dm();AL=&quot;cloud.provider&quot;,RL=&quot;cloud.account.id&quot;,NL=&quot;cloud.region&quot;,CL=&quot;cloud.availability_zone&quot;,PL=&quot;cloud.platform&quot;,IL=&quot;aws.ecs.container.arn&quot;,bL=&quot;aws.ecs.cluster.arn&quot;,LL=&quot;aws.ecs.launchtype&quot;,xL=&quot;aws.ecs.task.arn&quot;,ML=&quot;aws.ecs.task.family&quot;,wL=&quot;aws.ecs.task.revision&quot;,DL=&quot;aws.eks.cluster.arn&quot;,UL=&quot;aws.log.group.names&quot;,kL=&quot;aws.log.group.arns&quot;,BL=&quot;aws.log.stream.names&quot;,VL=&quot;aws.log.stream.arns&quot;,FL=&quot;container.name&quot;,GL=&quot;container.id&quot;,HL=&quot;container.runtime&quot;,qL=&quot;container.image.name&quot;,jL=&quot;container.image.tag&quot;,YL=&quot;deployment.environment&quot;,zL=&quot;device.id&quot;,KL=&quot;device.model.identifier&quot;,$L=&quot;device.model.name&quot;,XL=&quot;faas.name&quot;,WL=&quot;faas.id&quot;,JL=&quot;faas.version&quot;,QL=&quot;faas.instance&quot;,ZL=&quot;faas.max_memory&quot;,e0=&quot;host.id&quot;,t0=&quot;host.name&quot;,r0=&quot;host.type&quot;,n0=&quot;host.arch&quot;,i0=&quot;host.image.name&quot;,o0=&quot;host.image.id&quot;,s0=&quot;host.image.version&quot;,a0=&quot;k8s.cluster.name&quot;,l0=&quot;k8s.node.name&quot;,c0=&quot;k8s.node.uid&quot;,u0=&quot;k8s.namespace.name&quot;,f0=&quot;k8s.pod.uid&quot;,p0=&quot;k8s.pod.name&quot;,d0=&quot;k8s.container.name&quot;,h0=&quot;k8s.replicaset.uid&quot;,_0=&quot;k8s.replicaset.name&quot;,E0=&quot;k8s.deployment.uid&quot;,m0=&quot;k8s.deployment.name&quot;,T0=&quot;k8s.statefulset.uid&quot;,S0=&quot;k8s.statefulset.name&quot;,g0=&quot;k8s.daemonset.uid&quot;,v0=&quot;k8s.daemonset.name&quot;,y0=&quot;k8s.job.uid&quot;,O0=&quot;k8s.job.name&quot;,A0=&quot;k8s.cronjob.uid&quot;,R0=&quot;k8s.cronjob.name&quot;,N0=&quot;os.type&quot;,C0=&quot;os.description&quot;,P0=&quot;os.name&quot;,I0=&quot;os.version&quot;,b0=&quot;process.pid&quot;,L0=&quot;process.executable.name&quot;,x0=&quot;process.executable.path&quot;,M0=&quot;process.command&quot;,w0=&quot;process.command_line&quot;,D0=&quot;process.command_args&quot;,U0=&quot;process.owner&quot;,k0=&quot;process.runtime.name&quot;,B0=&quot;process.runtime.version&quot;,V0=&quot;process.runtime.description&quot;,F0=&quot;service.name&quot;,G0=&quot;service.namespace&quot;,H0=&quot;service.instance.id&quot;,q0=&quot;service.version&quot;,j0=&quot;telemetry.sdk.name&quot;,Y0=&quot;telemetry.sdk.language&quot;,z0=&quot;telemetry.sdk.version&quot;,K0=&quot;telemetry.auto.version&quot;,$0=&quot;webengine.name&quot;,X0=&quot;webengine.version&quot;,W0=&quot;webengine.description&quot;,r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0=&quot;alibaba_cloud&quot;,Q0=&quot;aws&quot;,Z0=&quot;azure&quot;,ex=&quot;gcp&quot;,f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx=&quot;alibaba_cloud_ecs&quot;,rx=&quot;alibaba_cloud_fc&quot;,nx=&quot;aws_ec2&quot;,ix=&quot;aws_ecs&quot;,ox=&quot;aws_eks&quot;,sx=&quot;aws_lambda&quot;,ax=&quot;aws_elastic_beanstalk&quot;,lx=&quot;azure_vm&quot;,cx=&quot;azure_container_instances&quot;,ux=&quot;azure_aks&quot;,fx=&quot;azure_functions&quot;,px=&quot;azure_app_service&quot;,dx=&quot;gcp_compute_engine&quot;,hx=&quot;gcp_cloud_run&quot;,_x=&quot;gcp_kubernetes_engine&quot;,Ex=&quot;gcp_cloud_functions&quot;,mx=&quot;gcp_app_engine&quot;,E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx=&quot;ec2&quot;,Sx=&quot;fargate&quot;,w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx=&quot;amd64&quot;,vx=&quot;arm32&quot;,yx=&quot;arm64&quot;,Ox=&quot;ia64&quot;,Ax=&quot;ppc32&quot;,Rx=&quot;ppc64&quot;,Nx=&quot;x86&quot;,k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx=&quot;windows&quot;,Px=&quot;linux&quot;,Ix=&quot;darwin&quot;,bx=&quot;freebsd&quot;,Lx=&quot;netbsd&quot;,xx=&quot;openbsd&quot;,Mx=&quot;dragonflybsd&quot;,wx=&quot;hpux&quot;,Dx=&quot;aix&quot;,Ux=&quot;solaris&quot;,kx=&quot;z_os&quot;,Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx=&quot;cpp&quot;,Vx=&quot;dotnet&quot;,Fx=&quot;erlang&quot;,Gx=&quot;go&quot;,Hx=&quot;java&quot;,qx=&quot;nodejs&quot;,jx=&quot;php&quot;,Yx=&quot;python&quot;,zx=&quot;ruby&quot;,Kx=&quot;webjs&quot;,n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=&gt;{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=&gt;{d9=&quot;aspnetcore.rate_limiting.result&quot;,h9=&quot;acquired&quot;,_9=&quot;endpoint_limiter&quot;,E9=&quot;global_limiter&quot;,m9=&quot;request_canceled&quot;,T9=&quot;telemetry.sdk.language&quot;,S9=&quot;cpp&quot;,g9=&quot;dotnet&quot;,v9=&quot;erlang&quot;,y9=&quot;go&quot;,O9=&quot;java&quot;,A9=&quot;nodejs&quot;,R9=&quot;php&quot;,N9=&quot;python&quot;,C9=&quot;ruby&quot;,P9=&quot;rust&quot;,I9=&quot;swift&quot;,b9=&quot;webjs&quot;,L9=&quot;telemetry.sdk.name&quot;,x9=&quot;telemetry.sdk.version&quot;,M9=&quot;aspnetcore.diagnostics.handler.type&quot;,w9=&quot;aspnetcore.diagnostics.exception.result&quot;,D9=&quot;aborted&quot;,U9=&quot;handled&quot;,k9=&quot;skipped&quot;,B9=&quot;unhandled&quot;,V9=&quot;aspnetcore.rate_limiting.policy&quot;,F9=&quot;aspnetcore.request.is_unhandled&quot;,G9=&quot;aspnetcore.routing.is_fallback&quot;,H9=&quot;aspnetcore.routing.match_status&quot;,q9=&quot;failure&quot;,j9=&quot;success&quot;,Y9=&quot;client.address&quot;,z9=&quot;client.port&quot;,K9=&quot;error.type&quot;,$9=&quot;_OTHER&quot;,X9=&quot;exception.escaped&quot;,W9=&quot;exception.message&quot;,J9=&quot;exception.stacktrace&quot;,Q9=&quot;exception.type&quot;,Z9=function(r){return&quot;http.request.header.&quot;+r},eJ=&quot;http.request.method&quot;,tJ=&quot;_OTHER&quot;,rJ=&quot;CONNECT&quot;,nJ=&quot;DELETE&quot;,iJ=&quot;GET&quot;,oJ=&quot;HEAD&quot;,sJ=&quot;OPTIONS&quot;,aJ=&quot;PATCH&quot;,lJ=&quot;POST&quot;,cJ=&quot;PUT&quot;,uJ=&quot;TRACE&quot;,fJ=&quot;http.request.method_original&quot;,pJ=&quot;http.request.resend_count&quot;,dJ=function(r){return&quot;http.response.header.&quot;+r},hJ=&quot;http.response.status_code&quot;,_J=&quot;http.route&quot;,EJ=&quot;jvm.gc.action&quot;,mJ=&quot;jvm.gc.name&quot;,TJ=&quot;jvm.memory.pool.name&quot;,SJ=&quot;jvm.memory.type&quot;,gJ=&quot;heap&quot;,vJ=&quot;non_heap&quot;,yJ=&quot;jvm.thread.daemon&quot;,OJ=&quot;jvm.thread.state&quot;,AJ=&quot;blocked&quot;,RJ=&quot;new&quot;,NJ=&quot;runnable&quot;,CJ=&quot;terminated&quot;,PJ=&quot;timed_waiting&quot;,IJ=&quot;waiting&quot;,bJ=&quot;network.local.address&quot;,LJ=&quot;network.local.port&quot;,xJ=&quot;network.peer.address&quot;,MJ=&quot;network.peer.port&quot;,wJ=&quot;network.protocol.name&quot;,DJ=&quot;network.protocol.version&quot;,UJ=&quot;network.transport&quot;,kJ=&quot;pipe&quot;,BJ=&quot;quic&quot;,VJ=&quot;tcp&quot;,FJ=&quot;udp&quot;,GJ=&quot;unix&quot;,HJ=&quot;network.type&quot;,qJ=&quot;ipv4&quot;,jJ=&quot;ipv6&quot;,YJ=&quot;otel.scope.name&quot;,zJ=&quot;otel.scope.version&quot;,KJ=&quot;otel.status_code&quot;,$J=&quot;ERROR&quot;,XJ=&quot;OK&quot;,WJ=&quot;otel.status_description&quot;,JJ=&quot;server.address&quot;,QJ=&quot;server.port&quot;,ZJ=&quot;service.name&quot;,eQ=&quot;service.version&quot;,tQ=&quot;signalr.connection.status&quot;,rQ=&quot;app_shutdown&quot;,nQ=&quot;normal_closure&quot;,iQ=&quot;timeout&quot;,oQ=&quot;signalr.transport&quot;,sQ=&quot;long_polling&quot;,aQ=&quot;server_sent_events&quot;,lQ=&quot;web_sockets&quot;,cQ=&quot;url.fragment&quot;,uQ=&quot;url.full&quot;,fQ=&quot;url.path&quot;,pQ=&quot;url.query&quot;,dQ=&quot;url.scheme&quot;,hQ=&quot;user_agent.original&quot;});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=&gt;{_Q=&quot;aspnetcore.diagnostics.exceptions&quot;,EQ=&quot;aspnetcore.rate_limiting.active_request_leases&quot;,mQ=&quot;aspnetcore.rate_limiting.queued_requests&quot;,TQ=&quot;aspnetcore.rate_limiting.request.time_in_queue&quot;,SQ=&quot;aspnetcore.rate_limiting.request_lease.duration&quot;,gQ=&quot;aspnetcore.rate_limiting.requests&quot;,vQ=&quot;aspnetcore.routing.match_attempts&quot;,yQ=&quot;http.client.request.duration&quot;,OQ=&quot;http.server.request.duration&quot;,AQ=&quot;jvm.class.count&quot;,RQ=&quot;jvm.class.loaded&quot;,NQ=&quot;jvm.class.unloaded&quot;,CQ=&quot;jvm.cpu.count&quot;,PQ=&quot;jvm.cpu.recent_utilization&quot;,IQ=&quot;jvm.cpu.time&quot;,bQ=&quot;jvm.gc.duration&quot;,LQ=&quot;jvm.memory.committed&quot;,xQ=&quot;jvm.memory.limit&quot;,MQ=&quot;jvm.memory.used&quot;,wQ=&quot;jvm.memory.used_after_last_gc&quot;,DQ=&quot;jvm.thread.count&quot;,UQ=&quot;kestrel.active_connections&quot;,kQ=&quot;kestrel.active_tls_handshakes&quot;,BQ=&quot;kestrel.connection.duration&quot;,VQ=&quot;kestrel.queued_connections&quot;,FQ=&quot;kestrel.queued_requests&quot;,GQ=&quot;kestrel.rejected_connections&quot;,HQ=&quot;kestrel.tls_handshake.duration&quot;,qQ=&quot;kestrel.upgraded_connections&quot;,jQ=&quot;signalr.server.active_connections&quot;,YQ=&quot;signalr.server.connection.duration&quot;});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=&gt;D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=&gt;U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=&gt;k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=&gt;B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=&gt;h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=&gt;_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=&gt;E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=&gt;m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=&gt;q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=&gt;j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=&gt;w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=&gt;M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=&gt;V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=&gt;d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=&gt;F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=&gt;G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=&gt;H9,ATTR_CLIENT_ADDRESS:()=&gt;Y9,ATTR_CLIENT_PORT:()=&gt;z9,ATTR_ERROR_TYPE:()=&gt;K9,ATTR_EXCEPTION_ESCAPED:()=&gt;X9,ATTR_EXCEPTION_MESSAGE:()=&gt;W9,ATTR_EXCEPTION_STACKTRACE:()=&gt;J9,ATTR_EXCEPTION_TYPE:()=&gt;Q9,ATTR_HTTP_REQUEST_HEADER:()=&gt;Z9,ATTR_HTTP_REQUEST_METHOD:()=&gt;eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=&gt;fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=&gt;pJ,ATTR_HTTP_RESPONSE_HEADER:()=&gt;dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=&gt;hJ,ATTR_HTTP_ROUTE:()=&gt;_J,ATTR_JVM_GC_ACTION:()=&gt;EJ,ATTR_JVM_GC_NAME:()=&gt;mJ,ATTR_JVM_MEMORY_POOL_NAME:()=&gt;TJ,ATTR_JVM_MEMORY_TYPE:()=&gt;SJ,ATTR_JVM_THREAD_DAEMON:()=&gt;yJ,ATTR_JVM_THREAD_STATE:()=&gt;OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=&gt;bJ,ATTR_NETWORK_LOCAL_PORT:()=&gt;LJ,ATTR_NETWORK_PEER_ADDRESS:()=&gt;xJ,ATTR_NETWORK_PEER_PORT:()=&gt;MJ,ATTR_NETWORK_PROTOCOL_NAME:()=&gt;wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=&gt;DJ,ATTR_NETWORK_TRANSPORT:()=&gt;UJ,ATTR_NETWORK_TYPE:()=&gt;HJ,ATTR_OTEL_SCOPE_NAME:()=&gt;YJ,ATTR_OTEL_SCOPE_VERSION:()=&gt;zJ,ATTR_OTEL_STATUS_CODE:()=&gt;KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=&gt;WJ,ATTR_SERVER_ADDRESS:()=&gt;JJ,ATTR_SERVER_PORT:()=&gt;QJ,ATTR_SERVICE_NAME:()=&gt;ZJ,ATTR_SERVICE_VERSION:()=&gt;eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=&gt;tQ,ATTR_SIGNALR_TRANSPORT:()=&gt;oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=&gt;T9,ATTR_TELEMETRY_SDK_NAME:()=&gt;L9,ATTR_TELEMETRY_SDK_VERSION:()=&gt;x9,ATTR_URL_FRAGMENT:()=&gt;cQ,ATTR_URL_FULL:()=&gt;uQ,ATTR_URL_PATH:()=&gt;fQ,ATTR_URL_QUERY:()=&gt;pQ,ATTR_URL_SCHEME:()=&gt;dQ,ATTR_USER_AGENT_ORIGINAL:()=&gt;hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=&gt;w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=&gt;D7,AwsEcsLaunchtypeValues:()=&gt;U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=&gt;E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=&gt;m7,CLOUDPLATFORMVALUES_AWS_EC2:()=&gt;T7,CLOUDPLATFORMVALUES_AWS_ECS:()=&gt;S7,CLOUDPLATFORMVALUES_AWS_EKS:()=&gt;g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=&gt;y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=&gt;v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=&gt;R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=&gt;C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=&gt;A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=&gt;N7,CLOUDPLATFORMVALUES_AZURE_VM:()=&gt;O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=&gt;x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=&gt;L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=&gt;I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=&gt;P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=&gt;b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;f7,CLOUDPROVIDERVALUES_AWS:()=&gt;p7,CLOUDPROVIDERVALUES_AZURE:()=&gt;d7,CLOUDPROVIDERVALUES_GCP:()=&gt;h7,CloudPlatformValues:()=&gt;M7,CloudProviderValues:()=&gt;_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=&gt;hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=&gt;yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=&gt;_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=&gt;vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=&gt;mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=&gt;AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=&gt;TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=&gt;EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=&gt;OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=&gt;gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=&gt;SW,DBSYSTEMVALUES_ADABAS:()=&gt;kX,DBSYSTEMVALUES_CACHE:()=&gt;UX,DBSYSTEMVALUES_CASSANDRA:()=&gt;eW,DBSYSTEMVALUES_CLOUDSCAPE:()=&gt;PX,DBSYSTEMVALUES_COCKROACHDB:()=&gt;pW,DBSYSTEMVALUES_COLDFUSION:()=&gt;ZX,DBSYSTEMVALUES_COSMOSDB:()=&gt;sW,DBSYSTEMVALUES_COUCHBASE:()=&gt;iW,DBSYSTEMVALUES_COUCHDB:()=&gt;oW,DBSYSTEMVALUES_DB2:()=&gt;AX,DBSYSTEMVALUES_DERBY:()=&gt;VX,DBSYSTEMVALUES_DYNAMODB:()=&gt;aW,DBSYSTEMVALUES_EDB:()=&gt;DX,DBSYSTEMVALUES_ELASTICSEARCH:()=&gt;uW,DBSYSTEMVALUES_FILEMAKER:()=&gt;FX,DBSYSTEMVALUES_FIREBIRD:()=&gt;BX,DBSYSTEMVALUES_FIRSTSQL:()=&gt;wX,DBSYSTEMVALUES_GEODE:()=&gt;cW,DBSYSTEMVALUES_H2:()=&gt;QX,DBSYSTEMVALUES_HANADB:()=&gt;xX,DBSYSTEMVALUES_HBASE:()=&gt;tW,DBSYSTEMVALUES_HIVE:()=&gt;CX,DBSYSTEMVALUES_HSQLDB:()=&gt;IX,DBSYSTEMVALUES_INFORMIX:()=&gt;GX,DBSYSTEMVALUES_INGRES:()=&gt;MX,DBSYSTEMVALUES_INSTANTDB:()=&gt;HX,DBSYSTEMVALUES_INTERBASE:()=&gt;qX,DBSYSTEMVALUES_MARIADB:()=&gt;jX,DBSYSTEMVALUES_MAXDB:()=&gt;LX,DBSYSTEMVALUES_MEMCACHED:()=&gt;fW,DBSYSTEMVALUES_MONGODB:()=&gt;rW,DBSYSTEMVALUES_MSSQL:()=&gt;vX,DBSYSTEMVALUES_MYSQL:()=&gt;yX,DBSYSTEMVALUES_NEO4J:()=&gt;lW,DBSYSTEMVALUES_NETEZZA:()=&gt;YX,DBSYSTEMVALUES_ORACLE:()=&gt;OX,DBSYSTEMVALUES_OTHER_SQL:()=&gt;gX,DBSYSTEMVALUES_PERVASIVE:()=&gt;zX,DBSYSTEMVALUES_POINTBASE:()=&gt;KX,DBSYSTEMVALUES_POSTGRESQL:()=&gt;RX,DBSYSTEMVALUES_PROGRESS:()=&gt;bX,DBSYSTEMVALUES_REDIS:()=&gt;nW,DBSYSTEMVALUES_REDSHIFT:()=&gt;NX,DBSYSTEMVALUES_SQLITE:()=&gt;$X,DBSYSTEMVALUES_SYBASE:()=&gt;XX,DBSYSTEMVALUES_TERADATA:()=&gt;WX,DBSYSTEMVALUES_VERTICA:()=&gt;JX,DbCassandraConsistencyLevelValues:()=&gt;RW,DbSystemValues:()=&gt;dW,ERROR_TYPE_VALUE_OTHER:()=&gt;$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=&gt;wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=&gt;MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=&gt;xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;UW,FAASINVOKEDPROVIDERVALUES_AWS:()=&gt;kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=&gt;BW,FAASINVOKEDPROVIDERVALUES_GCP:()=&gt;VW,FAASTRIGGERVALUES_DATASOURCE:()=&gt;NW,FAASTRIGGERVALUES_HTTP:()=&gt;CW,FAASTRIGGERVALUES_OTHER:()=&gt;bW,FAASTRIGGERVALUES_PUBSUB:()=&gt;PW,FAASTRIGGERVALUES_TIMER:()=&gt;IW,FaasDocumentOperationValues:()=&gt;DW,FaasInvokedProviderValues:()=&gt;FW,FaasTriggerValues:()=&gt;LW,HOSTARCHVALUES_AMD64:()=&gt;k7,HOSTARCHVALUES_ARM32:()=&gt;B7,HOSTARCHVALUES_ARM64:()=&gt;V7,HOSTARCHVALUES_IA64:()=&gt;F7,HOSTARCHVALUES_PPC32:()=&gt;G7,HOSTARCHVALUES_PPC64:()=&gt;H7,HOSTARCHVALUES_X86:()=&gt;q7,HTTPFLAVORVALUES_HTTP_1_0:()=&gt;O8,HTTPFLAVORVALUES_HTTP_1_1:()=&gt;A8,HTTPFLAVORVALUES_HTTP_2_0:()=&gt;R8,HTTPFLAVORVALUES_QUIC:()=&gt;C8,HTTPFLAVORVALUES_SPDY:()=&gt;N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=&gt;rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=&gt;nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=&gt;iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=&gt;oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=&gt;sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=&gt;tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=&gt;aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=&gt;lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=&gt;cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=&gt;uJ,HostArchValues:()=&gt;j7,HttpFlavorValues:()=&gt;P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=&gt;gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=&gt;vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=&gt;AJ,JVM_THREAD_STATE_VALUE_NEW:()=&gt;RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=&gt;NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=&gt;CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=&gt;PJ,JVM_THREAD_STATE_VALUE_WAITING:()=&gt;IJ,MESSAGETYPEVALUES_RECEIVED:()=&gt;e5,MESSAGETYPEVALUES_SENT:()=&gt;Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=&gt;I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=&gt;b8,MESSAGINGOPERATIONVALUES_PROCESS:()=&gt;M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=&gt;x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=&gt;_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=&gt;EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=&gt;mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=&gt;gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=&gt;SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=&gt;TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=&gt;vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=&gt;yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=&gt;OQ,METRIC_JVM_CLASS_COUNT:()=&gt;AQ,METRIC_JVM_CLASS_LOADED:()=&gt;RQ,METRIC_JVM_CLASS_UNLOADED:()=&gt;NQ,METRIC_JVM_CPU_COUNT:()=&gt;CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=&gt;PQ,METRIC_JVM_CPU_TIME:()=&gt;IQ,METRIC_JVM_GC_DURATION:()=&gt;bQ,METRIC_JVM_MEMORY_COMMITTED:()=&gt;LQ,METRIC_JVM_MEMORY_LIMIT:()=&gt;xQ,METRIC_JVM_MEMORY_USED:()=&gt;MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=&gt;wQ,METRIC_JVM_THREAD_COUNT:()=&gt;DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=&gt;UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=&gt;kQ,METRIC_KESTREL_CONNECTION_DURATION:()=&gt;BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=&gt;VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=&gt;FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=&gt;GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=&gt;HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=&gt;qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=&gt;jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=&gt;YQ,MessageTypeValues:()=&gt;t5,MessagingDestinationKindValues:()=&gt;L8,MessagingOperationValues:()=&gt;w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=&gt;i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=&gt;a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=&gt;r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=&gt;h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=&gt;o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=&gt;s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=&gt;p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=&gt;t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=&gt;E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=&gt;l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=&gt;u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=&gt;_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=&gt;c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=&gt;f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=&gt;T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=&gt;d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=&gt;v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=&gt;S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=&gt;g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=&gt;m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=&gt;n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=&gt;JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=&gt;QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=&gt;ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=&gt;XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=&gt;WW,NETTRANSPORTVALUES_INPROC:()=&gt;zW,NETTRANSPORTVALUES_IP:()=&gt;qW,NETTRANSPORTVALUES_IP_TCP:()=&gt;GW,NETTRANSPORTVALUES_IP_UDP:()=&gt;HW,NETTRANSPORTVALUES_OTHER:()=&gt;KW,NETTRANSPORTVALUES_PIPE:()=&gt;YW,NETTRANSPORTVALUES_UNIX:()=&gt;jW,NETWORK_TRANSPORT_VALUE_PIPE:()=&gt;kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=&gt;BJ,NETWORK_TRANSPORT_VALUE_TCP:()=&gt;VJ,NETWORK_TRANSPORT_VALUE_UDP:()=&gt;FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=&gt;GJ,NETWORK_TYPE_VALUE_IPV4:()=&gt;qJ,NETWORK_TYPE_VALUE_IPV6:()=&gt;jJ,NetHostConnectionSubtypeValues:()=&gt;y8,NetHostConnectionTypeValues:()=&gt;e8,NetTransportValues:()=&gt;$W,OSTYPEVALUES_AIX:()=&gt;Z7,OSTYPEVALUES_DARWIN:()=&gt;K7,OSTYPEVALUES_DRAGONFLYBSD:()=&gt;J7,OSTYPEVALUES_FREEBSD:()=&gt;$7,OSTYPEVALUES_HPUX:()=&gt;Q7,OSTYPEVALUES_LINUX:()=&gt;z7,OSTYPEVALUES_NETBSD:()=&gt;X7,OSTYPEVALUES_OPENBSD:()=&gt;W7,OSTYPEVALUES_SOLARIS:()=&gt;e9,OSTYPEVALUES_WINDOWS:()=&gt;Y7,OSTYPEVALUES_Z_OS:()=&gt;t9,OTEL_STATUS_CODE_VALUE_ERROR:()=&gt;$J,OTEL_STATUS_CODE_VALUE_OK:()=&gt;XJ,OsTypeValues:()=&gt;r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=&gt;Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=&gt;G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=&gt;U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=&gt;W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=&gt;V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=&gt;j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=&gt;$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=&gt;B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=&gt;F8,RPCGRPCSTATUSCODEVALUES_OK:()=&gt;D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=&gt;z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=&gt;H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=&gt;q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=&gt;J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=&gt;X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=&gt;K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=&gt;k8,RpcGrpcStatusCodeValues:()=&gt;Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=&gt;P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=&gt;F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=&gt;R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=&gt;v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=&gt;B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=&gt;M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=&gt;L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=&gt;G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=&gt;I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=&gt;y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=&gt;C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=&gt;x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=&gt;N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=&gt;O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=&gt;A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=&gt;V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=&gt;D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=&gt;U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=&gt;b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=&gt;w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=&gt;g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=&gt;k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=&gt;rK,SEMATTRS_CODE_FILEPATH:()=&gt;n$,SEMATTRS_CODE_FUNCTION:()=&gt;t$,SEMATTRS_CODE_LINENO:()=&gt;i$,SEMATTRS_CODE_NAMESPACE:()=&gt;r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=&gt;dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=&gt;TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=&gt;mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=&gt;_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=&gt;fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=&gt;pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=&gt;EK,SEMATTRS_DB_CASSANDRA_TABLE:()=&gt;hK,SEMATTRS_DB_CONNECTION_STRING:()=&gt;iK,SEMATTRS_DB_HBASE_NAMESPACE:()=&gt;SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=&gt;sK,SEMATTRS_DB_MONGODB_COLLECTION:()=&gt;vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=&gt;uK,SEMATTRS_DB_NAME:()=&gt;aK,SEMATTRS_DB_OPERATION:()=&gt;cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=&gt;gK,SEMATTRS_DB_SQL_TABLE:()=&gt;yK,SEMATTRS_DB_STATEMENT:()=&gt;lK,SEMATTRS_DB_SYSTEM:()=&gt;nK,SEMATTRS_DB_USER:()=&gt;oK,SEMATTRS_ENDUSER_ID:()=&gt;WK,SEMATTRS_ENDUSER_ROLE:()=&gt;JK,SEMATTRS_ENDUSER_SCOPE:()=&gt;QK,SEMATTRS_EXCEPTION_ESCAPED:()=&gt;OK,SEMATTRS_EXCEPTION_MESSAGE:()=&gt;Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=&gt;Um,SEMATTRS_EXCEPTION_TYPE:()=&gt;Xa,SEMATTRS_FAAS_COLDSTART:()=&gt;xK,SEMATTRS_FAAS_CRON:()=&gt;LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=&gt;NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=&gt;IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=&gt;CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=&gt;PK,SEMATTRS_FAAS_EXECUTION:()=&gt;RK,SEMATTRS_FAAS_INVOKED_NAME:()=&gt;MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=&gt;wK,SEMATTRS_FAAS_INVOKED_REGION:()=&gt;DK,SEMATTRS_FAAS_TIME:()=&gt;bK,SEMATTRS_FAAS_TRIGGER:()=&gt;AK,SEMATTRS_HTTP_CLIENT_IP:()=&gt;S$,SEMATTRS_HTTP_FLAVOR:()=&gt;f$,SEMATTRS_HTTP_HOST:()=&gt;l$,SEMATTRS_HTTP_METHOD:()=&gt;o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=&gt;d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=&gt;_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;E$,SEMATTRS_HTTP_ROUTE:()=&gt;T$,SEMATTRS_HTTP_SCHEME:()=&gt;c$,SEMATTRS_HTTP_SERVER_NAME:()=&gt;m$,SEMATTRS_HTTP_STATUS_CODE:()=&gt;u$,SEMATTRS_HTTP_TARGET:()=&gt;a$,SEMATTRS_HTTP_URL:()=&gt;s$,SEMATTRS_HTTP_USER_AGENT:()=&gt;p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=&gt;mX,SEMATTRS_MESSAGE_ID:()=&gt;EX,SEMATTRS_MESSAGE_TYPE:()=&gt;_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=&gt;TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=&gt;eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=&gt;W$,SEMATTRS_MESSAGING_DESTINATION:()=&gt;q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=&gt;j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=&gt;iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=&gt;nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=&gt;rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=&gt;oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=&gt;sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=&gt;X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=&gt;Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=&gt;J$,SEMATTRS_MESSAGING_OPERATION:()=&gt;Z$,SEMATTRS_MESSAGING_PROTOCOL:()=&gt;z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=&gt;K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=&gt;tX,SEMATTRS_MESSAGING_SYSTEM:()=&gt;H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=&gt;Y$,SEMATTRS_MESSAGING_URL:()=&gt;$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=&gt;$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=&gt;zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=&gt;KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=&gt;YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=&gt;jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=&gt;qK,SEMATTRS_NET_HOST_IP:()=&gt;FK,SEMATTRS_NET_HOST_NAME:()=&gt;HK,SEMATTRS_NET_HOST_PORT:()=&gt;GK,SEMATTRS_NET_PEER_IP:()=&gt;kK,SEMATTRS_NET_PEER_NAME:()=&gt;VK,SEMATTRS_NET_PEER_PORT:()=&gt;BK,SEMATTRS_NET_TRANSPORT:()=&gt;UK,SEMATTRS_PEER_SERVICE:()=&gt;XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=&gt;uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=&gt;dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=&gt;hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=&gt;pX,SEMATTRS_RPC_JSONRPC_VERSION:()=&gt;fX,SEMATTRS_RPC_METHOD:()=&gt;cX,SEMATTRS_RPC_SERVICE:()=&gt;lX,SEMATTRS_RPC_SYSTEM:()=&gt;aX,SEMATTRS_THREAD_ID:()=&gt;ZK,SEMATTRS_THREAD_NAME:()=&gt;e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=&gt;l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=&gt;a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=&gt;c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=&gt;u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=&gt;f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=&gt;p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=&gt;d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=&gt;_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=&gt;h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=&gt;m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=&gt;E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=&gt;n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=&gt;o5,SEMRESATTRS_CLOUD_PLATFORM:()=&gt;s5,SEMRESATTRS_CLOUD_PROVIDER:()=&gt;r5,SEMRESATTRS_CLOUD_REGION:()=&gt;i5,SEMRESATTRS_CONTAINER_ID:()=&gt;S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=&gt;v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=&gt;y5,SEMRESATTRS_CONTAINER_NAME:()=&gt;T5,SEMRESATTRS_CONTAINER_RUNTIME:()=&gt;g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=&gt;O5,SEMRESATTRS_DEVICE_ID:()=&gt;A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=&gt;R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=&gt;N5,SEMRESATTRS_FAAS_ID:()=&gt;P5,SEMRESATTRS_FAAS_INSTANCE:()=&gt;b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=&gt;L5,SEMRESATTRS_FAAS_NAME:()=&gt;C5,SEMRESATTRS_FAAS_VERSION:()=&gt;I5,SEMRESATTRS_HOST_ARCH:()=&gt;Vm,SEMRESATTRS_HOST_ID:()=&gt;km,SEMRESATTRS_HOST_IMAGE_ID:()=&gt;w5,SEMRESATTRS_HOST_IMAGE_NAME:()=&gt;M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=&gt;D5,SEMRESATTRS_HOST_NAME:()=&gt;Bm,SEMRESATTRS_HOST_TYPE:()=&gt;x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=&gt;U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=&gt;H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=&gt;e7,SEMRESATTRS_K8S_CRONJOB_UID:()=&gt;Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=&gt;W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=&gt;X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=&gt;z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=&gt;Y5,SEMRESATTRS_K8S_JOB_NAME:()=&gt;Q5,SEMRESATTRS_K8S_JOB_UID:()=&gt;J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=&gt;V5,SEMRESATTRS_K8S_NODE_NAME:()=&gt;k5,SEMRESATTRS_K8S_NODE_UID:()=&gt;B5,SEMRESATTRS_K8S_POD_NAME:()=&gt;G5,SEMRESATTRS_K8S_POD_UID:()=&gt;F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=&gt;j5,SEMRESATTRS_K8S_REPLICASET_UID:()=&gt;q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=&gt;$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=&gt;K5,SEMRESATTRS_OS_DESCRIPTION:()=&gt;t7,SEMRESATTRS_OS_NAME:()=&gt;r7,SEMRESATTRS_OS_TYPE:()=&gt;Fm,SEMRESATTRS_OS_VERSION:()=&gt;Gm,SEMRESATTRS_PROCESS_COMMAND:()=&gt;Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=&gt;zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=&gt;n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=&gt;qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=&gt;jm,SEMRESATTRS_PROCESS_OWNER:()=&gt;Km,SEMRESATTRS_PROCESS_PID:()=&gt;Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=&gt;Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=&gt;st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=&gt;ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=&gt;$m,SEMRESATTRS_SERVICE_NAME:()=&gt;at,SEMRESATTRS_SERVICE_NAMESPACE:()=&gt;i7,SEMRESATTRS_SERVICE_VERSION:()=&gt;o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=&gt;s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=&gt;ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=&gt;Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=&gt;ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=&gt;c7,SEMRESATTRS_WEBENGINE_NAME:()=&gt;a7,SEMRESATTRS_WEBENGINE_VERSION:()=&gt;l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=&gt;rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=&gt;nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=&gt;iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=&gt;sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=&gt;aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=&gt;lQ,SemanticAttributes:()=&gt;SX,SemanticResourceAttributes:()=&gt;u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=&gt;n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=&gt;i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=&gt;o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=&gt;s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=&gt;a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=&gt;wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=&gt;l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=&gt;c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=&gt;u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=&gt;f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=&gt;S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=&gt;g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=&gt;v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=&gt;y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=&gt;O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=&gt;A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=&gt;R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=&gt;N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=&gt;C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=&gt;P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=&gt;I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=&gt;b9,TelemetrySdkLanguageValues:()=&gt;p9});var Ve=p(()=&gt;{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=&gt;{P();Zm=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Zu,SM=p(()=&gt;{Zu=&quot;baggage&quot;});function tf(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function rf(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function il(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;il(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var eT=p(()=&gt;{P()});var nf,yM=p(()=&gt;{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=tf(a);i.length&gt;0&amp;&amp;o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=il(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=&gt;{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var NM=p(()=&gt;{P()});function sf(){return r=&gt;{S.error(EZ(r))}}function EZ(r){return typeof r==&quot;string&quot;?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=&gt;{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=&gt;{nT();CM=sf()});var Vo,oT=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)&gt;-1}function yZ(r){return vZ.indexOf(r)&gt;-1}function AZ(r){return OZ.indexOf(r)&gt;-1}function RZ(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=PZ[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=&gt;{P();oT();TZ=&quot;,&quot;,SZ=[&quot;OTEL_SDK_DISABLED&quot;];vZ=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];OZ=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=&gt;{lT()});var cf,bM=p(()=&gt;{cf=typeof globalThis==&quot;object&quot;?globalThis:global});function LM(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var cT=p(()=&gt;{});function ff(r){return Buffer.from(uf(r)).toString(&quot;base64&quot;)}var xM=p(()=&gt;{cT()});function MM(r){return function(){for(let t=0;t&lt;r/4;t++)pf.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(pf[t]&gt;0);t++)t===r-1&amp;&amp;(pf[r-1]=1);return pf.toString(&quot;hex&quot;,0,r)}}var Go,pf,wM=p(()=&gt;{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from&quot;perf_hooks&quot;;var In,DM=p(()=&gt;{In=bZ});var df,uT=p(()=&gt;{df=&quot;1.29.0&quot;});var bn,UM=p(()=&gt;{uT();Ve();bn={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=&gt;{});var BM=p(()=&gt;{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=&gt;{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!=&quot;number&quot;){let e=In;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r==&quot;number&quot;?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r==&quot;number&quot;)return r&lt;Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function zM(r){return mf(r)||typeof r==&quot;number&quot;||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=_f&amp;&amp;(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=&gt;{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Tf||(Tf={}))});var Sf,XM=p(()=&gt;{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&amp;&amp;!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=&gt;{hT=&quot;[_0-9a-z-*/]&quot;,MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=&gt;{QM();ZM=32,BZ=512,ew=&quot;,&quot;,tw=&quot;=&quot;,qo=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length&gt;BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&amp;&amp;JM(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;ZM&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=&gt;{P();nl();_T();cl=&quot;traceparent&quot;,ul=&quot;tracestate&quot;,VZ=&quot;00&quot;,FZ=&quot;(?!ff)[\\da-f]{2}&quot;,GZ=&quot;(?![0]{32})[\\da-f]{32}&quot;,HZ=&quot;(?![0]{16})[\\da-f]{16}&quot;,qZ=&quot;[\\da-f]{2}&quot;,jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&amp;&amp;o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new qo(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=&gt;{P();mT=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(vf||(vf={}))});var Ai,TT=p(()=&gt;{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Ln,ST=p(()=&gt;{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var yf,aw=p(()=&gt;{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=&gt;{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;cw.call(t)===XZ}function QZ(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&amp;&amp;Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&amp;&amp;(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=&gt;{YZ=&quot;[object Object]&quot;,zZ=&quot;[object Null]&quot;,KZ=&quot;[object Undefined]&quot;,$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t&gt;ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Af(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&amp;&amp;fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r==&quot;function&quot;}function fl(r){return!Af(r)&amp;&amp;!Rf(r)&amp;&amp;!mw(r)&amp;&amp;typeof r==&quot;object&quot;}function Af(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=&gt;{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var pl,gw=p(()=&gt;{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=&gt;{});function Ow(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Aw=p(()=&gt;{});var Nf,Rw=p(()=&gt;{Nf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=&gt;{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=&gt;{he.with(Qu(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Pw=p(()=&gt;{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=&gt;Ai,AlwaysOnSampler:()=&gt;Ln,AnchoredClock:()=&gt;of,BindOnceFuture:()=&gt;Cf,CompositePropagator:()=&gt;Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;ol,DEFAULT_ENVIRONMENT:()=&gt;al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;aT,ExportResultCode:()=&gt;Tf,ParentBasedSampler:()=&gt;yf,RPCType:()=&gt;vf,RandomIdGenerator:()=&gt;Go,SDK_INFO:()=&gt;bn,TRACE_PARENT_HEADER:()=&gt;cl,TRACE_STATE_HEADER:()=&gt;ul,TimeoutError:()=&gt;pl,TraceIdRatioBasedSampler:()=&gt;Of,TraceState:()=&gt;qo,TracesSamplerValues:()=&gt;Vo,VERSION:()=&gt;df,W3CBaggagePropagator:()=&gt;nf,W3CTraceContextPropagator:()=&gt;gf,_globalThis:()=&gt;cf,addHrTimes:()=&gt;dT,baggageUtils:()=&gt;iee,callWithTimeout:()=&gt;Sw,deleteRPCMetadata:()=&gt;iw,getEnv:()=&gt;Fo,getEnvWithoutDefaults:()=&gt;lf,getRPCMetadata:()=&gt;ow,getTimeOrigin:()=&gt;Ef,globalErrorHandler:()=&gt;af,hexToBase64:()=&gt;ff,hexToBinary:()=&gt;uf,hrTime:()=&gt;pT,hrTimeDuration:()=&gt;GM,hrTimeToMicroseconds:()=&gt;YM,hrTimeToMilliseconds:()=&gt;jM,hrTimeToNanoseconds:()=&gt;qM,hrTimeToTimeStamp:()=&gt;HM,internal:()=&gt;oee,isAttributeKey:()=&gt;tT,isAttributeValue:()=&gt;rT,isTimeInput:()=&gt;zM,isTimeInputHrTime:()=&gt;mf,isTracingSuppressed:()=&gt;At,isUrlIgnored:()=&gt;vw,isWrapped:()=&gt;Ow,loggingErrorHandler:()=&gt;sf,merge:()=&gt;_w,millisToHrTime:()=&gt;Ho,otperformance:()=&gt;In,parseEnvironment:()=&gt;ll,parseTraceParent:()=&gt;ET,sanitizeAttributes:()=&gt;AM,setGlobalErrorHandler:()=&gt;PM,setRPCMetadata:()=&gt;nw,suppressTracing:()=&gt;Qu,timeInputToHrTime:()=&gt;FM,unrefTimer:()=&gt;hf,unsuppressTracing:()=&gt;TM,urlMatches:()=&gt;yT});var iee,oee,xr=p(()=&gt;{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=&gt;{(function(r){r[r.UNSPECIFIED=0]=&quot;UNSPECIFIED&quot;,r[r.TRACE=1]=&quot;TRACE&quot;,r[r.TRACE2=2]=&quot;TRACE2&quot;,r[r.TRACE3=3]=&quot;TRACE3&quot;,r[r.TRACE4=4]=&quot;TRACE4&quot;,r[r.DEBUG=5]=&quot;DEBUG&quot;,r[r.DEBUG2=6]=&quot;DEBUG2&quot;,r[r.DEBUG3=7]=&quot;DEBUG3&quot;,r[r.DEBUG4=8]=&quot;DEBUG4&quot;,r[r.INFO=9]=&quot;INFO&quot;,r[r.INFO2=10]=&quot;INFO2&quot;,r[r.INFO3=11]=&quot;INFO3&quot;,r[r.INFO4=12]=&quot;INFO4&quot;,r[r.WARN=13]=&quot;WARN&quot;,r[r.WARN2=14]=&quot;WARN2&quot;,r[r.WARN3=15]=&quot;WARN3&quot;,r[r.WARN4=16]=&quot;WARN4&quot;,r[r.ERROR=17]=&quot;ERROR&quot;,r[r.ERROR2=18]=&quot;ERROR2&quot;,r[r.ERROR3=19]=&quot;ERROR3&quot;,r[r.ERROR4=20]=&quot;ERROR4&quot;,r[r.FATAL=21]=&quot;FATAL&quot;,r[r.FATAL2=22]=&quot;FATAL2&quot;,r[r.FATAL3=23]=&quot;FATAL3&quot;,r[r.FATAL4=24]=&quot;FATAL4&quot;})(If||(If={}))});var Ni,jo,bf=p(()=&gt;{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=&gt;{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=&gt;{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=&gt;{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&amp;&amp;s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=&gt;{xf=typeof globalThis==&quot;object&quot;?globalThis:global});var Lw=p(()=&gt;{bw()});var xw=p(()=&gt;{Lw()});function Mw(r,e,t){return o=&gt;o===r?e:t}var hl,Ko,RT,ww=p(()=&gt;{xw();hl=Symbol.for(&quot;io.opentelemetry.js.api.logs&quot;),Ko=xf;RT=1});var Mf,Dw=p(()=&gt;{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&amp;&amp;t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=&gt;jo,NOOP_LOGGER_PROVIDER:()=&gt;Yo,NoopLogger:()=&gt;Ni,NoopLoggerProvider:()=&gt;dl,ProxyLogger:()=&gt;zo,ProxyLoggerProvider:()=&gt;Ci,SeverityNumber:()=&gt;If,logs:()=&gt;_l});var _l,El=p(()=&gt;{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=&gt;{P();see=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var Fw=p(()=&gt;{});function Gw(){return r=&gt;{S.error(lee(r))}}function lee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=&gt;{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=&gt;{Hw();uee=Gw()});var Df,jw=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Df||(Df={}))});function dee(r){return pee.indexOf(r)&gt;-1}function _ee(r){return hee.indexOf(r)&gt;-1}function mee(r){return Eee.indexOf(r)&gt;-1}function Tee(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=vee[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=&gt;{P();jw();fee=&quot;,&quot;,pee=[&quot;OTEL_SDK_DISABLED&quot;];hee=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];Eee=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=&gt;{NT()});import{performance as Oee}from&quot;perf_hooks&quot;;var Pi,$w=p(()=&gt;{Pi=Oee});var Xw,Ww=p(()=&gt;{Xw=&quot;1.29.0&quot;});var Ii,Jw=p(()=&gt;{Ww();Ve();Ii={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=&gt;{});var Zw=p(()=&gt;{Kw();$w();Jw();Qw()});var CT=p(()=&gt;{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!=&quot;number&quot;){let e=Pi;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r==&quot;number&quot;?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r==&quot;number&quot;)return r&lt;PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=e1&amp;&amp;(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=&gt;{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;s1.call(t)===wee}function kee(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Bee(r){return r==null?r===void 0?xee:Lee:bi&amp;&amp;bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&amp;&amp;(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=&gt;{bee=&quot;[object Object]&quot;,Lee=&quot;[object Null]&quot;,xee=&quot;[object Undefined]&quot;,Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t&gt;Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&amp;&amp;gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r==&quot;function&quot;}function gl(r){return!Vf(r)&amp;&amp;!Ff(r)&amp;&amp;!d1(r)&amp;&amp;typeof r==&quot;object&quot;}function Vf(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=&gt;{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Gf,_1=p(()=&gt;{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=&gt;{Hf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=&gt;{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=&gt;{he.with(kw(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var S1=p(()=&gt;{P();Bw()});var qf,cr=p(()=&gt;{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=&gt;{});var v1=p(()=&gt;{g1()});var y1=p(()=&gt;{v1()});var Mn,O1=p(()=&gt;{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=&gt;{O1()});var Wo,MT=p(()=&gt;{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&amp;&amp;xe(_)&amp;&amp;(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&amp;&amp;!(typeof t==&quot;object&quot;&amp;&amp;!Array.isArray(t)&amp;&amp;Object.keys(t).length&gt;0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length&gt;=this._logRecordLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&amp;&amp;S.warn(&quot;Dropping extra attributes.&quot;),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&amp;&amp;S.warn(&quot;Can not execute the operation on emitted log record&quot;),this._isReadonly}}});var Yf,R1=p(()=&gt;{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&amp;&amp;e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&amp;&amp;s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;i!==void 0?i:$o}}var P1=p(()=&gt;{cr()});var zf,I1=p(()=&gt;{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=&gt;vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=&gt;o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=&gt;e.shutdown()))}}});var Jo,wT=p(()=&gt;{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=&gt;{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=&gt;{P();El();A1();cr();R1();P1();I1();b1();qee=&quot;unknown&quot;;$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn(&quot;A shutdown LoggerProvider cannot provide a Logger&quot;),jo;e||S.warn(&quot;Logger requested without instrumentation scope name.&quot;);let s=e||qee,a=`${s}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&amp;&amp;this._sharedState.activeProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current log record processor&quot;,t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn(&quot;invalid attempt to force flush after LoggerProvider shutdown&quot;),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn(&quot;shutdown may only be called once per LoggerProvider&quot;),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=&gt;{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=&gt;{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=&gt;qf._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Yt.SUCCESS&amp;&amp;Mr((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(this._unresolvedExports.delete(a),s()),Mr);a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=&gt;{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=&gt;{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&amp;&amp;o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&amp;&amp;s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&amp;&amp;a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&amp;&amp;i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length&gt;=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a&lt;s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=&gt;{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=&gt;e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;{this._flushOneBatch().then(()=&gt;{this._finishedLogRecords.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(e=&gt;{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=&gt;qf._export(this._exporter,e).then(s=&gt;{var a;s.code!==Yt.SUCCESS&amp;&amp;Mr((a=s.error)!==null&amp;&amp;a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=&gt;s.resource).filter(s=&gt;s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=&gt;{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=&gt;{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=&gt;{U1()});var B1=p(()=&gt;{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=&gt;Qo,ConsoleLogRecordExporter:()=&gt;Xf,InMemoryLogRecordExporter:()=&gt;Jf,LogRecord:()=&gt;Wo,LoggerProvider:()=&gt;$f,NoopLogRecordProcessor:()=&gt;Jo,SimpleLogRecordProcessor:()=&gt;Wf});var UT=p(()=&gt;{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=&gt;{(function(r){r[r.DELTA=0]=&quot;DELTA&quot;,r[r.CUMULATIVE=1]=&quot;CUMULATIVE&quot;})(ur||(ur={}))});var lt,Zo=p(()=&gt;{(function(r){r[r.HISTOGRAM=0]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=1]=&quot;EXPONENTIAL_HISTOGRAM&quot;,r[r.GAUGE=2]=&quot;GAUGE&quot;,r[r.SUM=3]=&quot;SUM&quot;})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?&quot;&quot;:(e=e.sort(),JSON.stringify(e.map(t=&gt;[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&amp;&amp;e!==void 0?e:&quot;&quot;}:${(t=r.schemaUrl)!==null&amp;&amp;t!==void 0?t:&quot;&quot;}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=&gt;{try{return{status:&quot;fulfilled&quot;,value:await e}}catch(t){return{status:&quot;rejected&quot;,reason:t}}}))}function H1(r){return r.status===&quot;rejected&quot;}function kT(r,e){let t=[];return r.forEach(o=&gt;{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o&gt;=t;){let a=t+Math.trunc((o-t)/2);r[a]&lt;e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=&gt;{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=&gt;{(function(r){r[r.DROP=0]=&quot;DROP&quot;,r[r.SUM=1]=&quot;SUM&quot;,r[r.LAST_VALUE=2]=&quot;LAST_VALUE&quot;,r[r.HISTOGRAM=3]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=4]=&quot;EXPONENTIAL_HISTOGRAM&quot;})(zt||(zt={}))});var yl,z1=p(()=&gt;{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: &quot;${r}&quot;. The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&amp;&amp;o!==void 0?o:&quot;&quot;,unit:(s=t==null?void 0:t.unit)!==null&amp;&amp;s!==void 0?s:&quot;&quot;,valueType:(a=t==null?void 0:t.valueType)!==null&amp;&amp;a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&amp;&amp;i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&amp;&amp;t!==void 0?t:e.name,description:(o=r.description)!==null&amp;&amp;o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&amp;&amp;r.unit===e.unit&amp;&amp;r.type===e.type&amp;&amp;r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=&gt;{P();fr();(function(r){r.COUNTER=&quot;COUNTER&quot;,r.GAUGE=&quot;GAUGE&quot;,r.HISTOGRAM=&quot;HISTOGRAM&quot;,r.UP_DOWN_COUNTER=&quot;UP_DOWN_COUNTER&quot;,r.OBSERVABLE_COUNTER=&quot;OBSERVABLE_COUNTER&quot;,r.OBSERVABLE_GAUGE=&quot;OBSERVABLE_GAUGE&quot;,r.OBSERVABLE_UP_DOWN_COUNTER=&quot;OBSERVABLE_UP_DOWN_COUNTER&quot;})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=&gt;0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=&gt;{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&amp;&amp;(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u&lt;a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&amp;&amp;(o.hasMinMax&amp;&amp;s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&amp;&amp;(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&amp;&amp;(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l&lt;a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=&gt;{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&amp;&amp;this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=&gt;this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e&lt;t&amp;&amp;(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e&lt;this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e&gt;=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1&lt;&lt;e,s=0,a=0;for(let i=this.indexStart;i&lt;=this.indexEnd;){let n=i%o;n&lt;0&amp;&amp;(n+=o);for(let l=n;l&lt;o&amp;&amp;s&lt;t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart&gt;&gt;=e,this.indexEnd&gt;&gt;=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&amp;&amp;(e&gt;0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&amp;&amp;this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s&lt;o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]&gt;=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&amp;2146435072)&gt;&gt;20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&amp;1048575)*Math.pow(2,32)+o}var Al,VT=p(()=&gt;{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r&gt;&gt;1,r|=r&gt;&gt;2,r|=r&gt;&gt;4,r|=r&gt;&gt;8,r|=r&gt;&gt;16,r++,r}var np=p(()=&gt;{});var Dr,ip=p(()=&gt;{Dr=class extends Error{}});var op,eD=p(()=&gt;{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e&lt;Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o&gt;&gt;this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e&lt;t)throw new Dr(`underflow: ${e} is &lt; minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e&gt;o)throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${o}`);return Rl(1,e&lt;&lt;this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022&gt;&gt;this._shift;return this._shift&lt;2&amp;&amp;e--,e}_maxNormalLowerBoundaryIndex(){return 1023&gt;&gt;this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=&gt;{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e&lt;=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)&lt;&lt;this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t&gt;=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e&gt;=t){if(e===t)return 2*Math.exp((e-(1&lt;&lt;this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e&lt;=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1&lt;&lt;this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is &lt; minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022&lt;&lt;this._scale}_maxNormalLowerBoundaryIndex(){return(1024&lt;&lt;this._scale)-1}}});function HT(r){if(r&gt;nD||r&lt;rD)throw new Dr(`expected scale &gt;= ${rD} &amp;&amp; &lt;= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=&gt;{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=&gt;e&gt;10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=&gt;{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize&lt;qT&amp;&amp;(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e&gt;this._max&amp;&amp;(this._max=e),e&lt;this._min&amp;&amp;(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e&gt;0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&amp;&amp;(e.min&lt;this.min&amp;&amp;(this._min=e.min),e.max&gt;this.max&amp;&amp;(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s&lt;e.indexStart&amp;&amp;e.indexEnd-s&gt;=this._maxSize?(a=!0,n=s,i=e.indexEnd):s&gt;e.indexEnd&amp;&amp;s-e.indexStart&gt;=this._maxSize&amp;&amp;(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&amp;&amp;(e.indexStart=e.indexEnd=e.indexBase=t),t&lt;e.indexStart){let a=e.indexEnd-t;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexStart=t}else if(t&gt;e.indexEnd){let a=t-e.indexStart;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s&lt;0&amp;&amp;(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i&gt;this._maxSize&amp;&amp;(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t&gt;=this._maxSize;)e&gt;&gt;=1,t&gt;&gt;=1,o++;return o}_downscale(e){if(e===0)return;if(e&lt;0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart&gt;&gt;s,e.indexEnd&gt;&gt;s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++)this._incrementIndexBy(e,a+n&gt;&gt;i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++){let c=(a+n&gt;&gt;i)-e.indexBase;c&lt;0&amp;&amp;(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=&gt;{P();Qee=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function lD(){return r=&gt;{S.error(Zee(r))}}function Zee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=&gt;{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=&gt;{cD();tte=lD()});var fD,pD=p(()=&gt;{fD=&quot;1.29.0&quot;});var xi,dD=p(()=&gt;{pD();Ve();xi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=&gt;{});var _D=p(()=&gt;{dD();hD()});var ED=p(()=&gt;{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=&gt;{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(pr||(pr={}))});function SD(r,e){return new Promise(t=&gt;{he.with(sD(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var gD=p(()=&gt;{P();aD()});var vD,Dn=p(()=&gt;{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=&gt;{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=&gt;{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&amp;&amp;e&lt;0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&amp;&amp;o&gt;s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=&gt;{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=&gt;{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error(&quot;ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array&quot;);e=e.concat(),e=e.sort((a,i)=&gt;a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&amp;&amp;(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=&gt;{cp();Zf();ID=r=&gt;mt.Default(),up=r=&gt;ur.CUMULATIVE});var us,YT=p(()=&gt;{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&amp;&amp;t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&amp;&amp;o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&amp;&amp;s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error(&quot;MetricReader can not be bound to a MeterProvider again.&quot;);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error(&quot;MetricReader is not bound to a MetricProducer&quot;);if(this._shutdown)throw new Error(&quot;MetricReader is shutdown&quot;);let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=&gt;n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=&gt;n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=&gt;n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error(&quot;Cannot call shutdown twice.&quot;);return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn(&quot;Cannot forceFlush on already shutdown MetricReader.&quot;);return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=&gt;{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;=0)throw Error(&quot;exportIntervalMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportTimeoutMillis&lt;=0)throw Error(&quot;exportTimeoutMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;e.exportTimeoutMillis)throw Error(&quot;exportIntervalMillis must be greater than or equal to exportTimeoutMillis&quot;);this._exportInterval=(s=e.exportIntervalMillis)!==null&amp;&amp;s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&amp;&amp;a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error(&quot;Export took longer than %s milliseconds and timed out.&quot;,this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length&gt;0&amp;&amp;S.error(&quot;PeriodicExportingMetricReader: metrics collection errors&quot;,...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug(&quot;Error while resolving async portion of resource: &quot;,i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=&gt;{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&amp;&amp;clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=&gt;{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=&gt;t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=&gt;t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=&gt;{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&amp;&amp;t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=&gt;{});var wD=p(()=&gt;{MD()});var DD=p(()=&gt;{wD()});var kn,UD=p(()=&gt;{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=&gt;{UD()});var _p,BD=p(()=&gt;{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=&gt;this._matchInstrument(s.instrumentSelector,e)&amp;&amp;this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&amp;&amp;e.getNameFilter().match(t.name)&amp;&amp;e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&amp;&amp;(t.version===void 0||e.getVersionFilter().match(t.version))&amp;&amp;(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=&gt;{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e&lt;0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e&lt;0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=&gt;{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=&gt;{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=&gt;{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=&gt;{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={&quot;otel.metric.overflow&quot;:!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size&gt;=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=&gt;this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=&gt;{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size&gt;=this._cardinalityLimit&amp;&amp;(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=&gt;{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=&gt;{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&amp;&amp;(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=&gt;{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=&gt;{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t=&quot;&quot;;return r.unit!==e.unit&amp;&amp;(t+=` - Unit &#x27;${r.unit}&#x27; does not match &#x27;${e.unit}&#x27; `),r.type!==e.type&amp;&amp;(t+=` - Type &#x27;${r.type}&#x27; does not match &#x27;${e.type}&#x27; `),r.valueType!==e.valueType&amp;&amp;(t+=` - Value Type &#x27;${r.valueType}&#x27; does not match &#x27;${e.valueType}&#x27; `),r.description!==e.description&amp;&amp;(t+=` - Description &#x27;${r.description}&#x27; does not match &#x27;${e.description}&#x27; `),t}function hte(r,e){return` - use valueType &#x27;${r.valueType}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function _te(r,e){return` - use unit &#x27;${r.unit}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27;`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27; - OR - create a new view with the name ${r.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):&quot;&quot;}var GD=p(()=&gt;{});var Np,HD=p(()=&gt;{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&amp;&amp;(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&amp;&amp;(e.description.length&gt;a.description.length&amp;&amp;s.updateDescription(e.description),S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=&gt;{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=&gt;{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=&gt;{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&amp;&amp;(s=new Dt,this._buffer.set(e,s)),typeof t!=&quot;number&quot;){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(t)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=&gt;{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)&gt;=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o&lt;0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error(&quot;BatchObservableCallback is not associated with valid instruments&quot;,t);return}this._findBatchCallback(e,o)&gt;=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s&lt;0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=&gt;n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=&gt;{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s._metricStorages.forEach(n=&gt;{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=&gt;{let a=new Ip,i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s.forEach(n=&gt;{let l=a._buffer.get(n);l!=null&amp;&amp;n._metricStorages.forEach(c=&gt;{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=&gt;o.callback===e&amp;&amp;o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=&gt;o.callback===e&amp;&amp;q1(o.instruments,t))}}});var Lp,zD=p(()=&gt;{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=&gt;{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=&gt;this._allowedAttributeNames.includes(s)).forEach(s=&gt;o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=&gt;{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=&gt;n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=&gt;{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=&gt;{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=&gt;{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&amp;&amp;(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=&gt;{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=&gt;{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&amp;&amp;o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&amp;&amp;s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&amp;&amp;s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=&gt;{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&amp;&amp;t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&amp;&amp;e.views.length&gt;0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&amp;&amp;e.readers.length&gt;0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t=&quot;&quot;,o={}){return this._shutdown?(S.warn(&quot;A shutdown MeterProvider cannot provide a Meter&quot;),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn(&quot;shutdown may only be called once per MeterProvider&quot;);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn(&quot;invalid attempt to force flush after MeterProvider shutdown&quot;);return}await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=&gt;{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e===&quot;*&quot;?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,&quot;\\$&amp;&quot;).replace(&quot;*&quot;,&quot;.*&quot;)}$`}static hasWildcard(e){return e.includes(&quot;*&quot;)}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=&gt;{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&amp;&amp;t!==void 0?t:&quot;*&quot;),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=&gt;{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&amp;&amp;r.instrumentType==null&amp;&amp;r.instrumentUnit==null&amp;&amp;r.meterName==null&amp;&amp;r.meterVersion==null&amp;&amp;r.meterSchemaUrl==null}var Fp,ZD=p(()=&gt;{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error(&quot;Cannot create view with no selector arguments supplied&quot;);if(e.name!=null&amp;&amp;((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error(&quot;Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.&quot;);e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&amp;&amp;t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=&gt;mt,AggregationTemporality:()=&gt;ur,ConsoleMetricExporter:()=&gt;dp,DataPointType:()=&gt;lt,DefaultAggregation:()=&gt;Ll,DropAggregation:()=&gt;as,ExplicitBucketHistogramAggregation:()=&gt;Il,ExponentialHistogramAggregation:()=&gt;bl,HistogramAggregation:()=&gt;cs,InMemoryMetricExporter:()=&gt;pp,InstrumentType:()=&gt;_e,LastValueAggregation:()=&gt;ls,MeterProvider:()=&gt;Up,MetricReader:()=&gt;us,PeriodicExportingMetricReader:()=&gt;fp,SumAggregation:()=&gt;wi,TimeoutError:()=&gt;Li,View:()=&gt;Fp});var Gp=p(()=&gt;{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=&gt;{&quot;use strict&quot;;Object.defineProperty(Hp,&quot;__esModule&quot;,{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V(&quot;events&quot;),Ote=[&quot;addListener&quot;,&quot;on&quot;,&quot;once&quot;,&quot;prependListener&quot;,&quot;prependOnceListener&quot;],tS=class{constructor(){this._kOtListeners=Symbol(&quot;OtListeners&quot;),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t==&quot;function&quot;?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=&gt;t.apply(this,a))};return Object.defineProperty(s,&quot;length&quot;,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=&gt;{t[s]!==void 0&amp;&amp;(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener==&quot;function&quot;&amp;&amp;(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off==&quot;function&quot;&amp;&amp;(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners==&quot;function&quot;&amp;&amp;(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&amp;&amp;(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&amp;&amp;delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&amp;&amp;(n=s._createPatchMap(e));let l=n[a];l===void 0&amp;&amp;(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=&gt;{&quot;use strict&quot;;Object.defineProperty(qp,&quot;__esModule&quot;,{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V(&quot;async_hooks&quot;),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&amp;&amp;e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t===&quot;TIMERWRAP&quot;)return;let o=this._stack[this._stack.length-1];o!==void 0&amp;&amp;this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&amp;&amp;this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=&gt;{&quot;use strict&quot;;Object.defineProperty(jp,&quot;__esModule&quot;,{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V(&quot;async_hooks&quot;),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&amp;&amp;e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=&gt;{&quot;use strict&quot;;Object.defineProperty(ms,&quot;__esModule&quot;,{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,&quot;AsyncHooksContextManager&quot;,{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,&quot;AsyncLocalStorageContextManager&quot;,{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=&gt;{P();Ts=De(&quot;OpenTelemetry Context Key B3 Debug Flag&quot;)});var Ss,gs,vs,ys,Yp,Os,sS=p(()=&gt;{Ss=&quot;b3&quot;,gs=&quot;x-b3-traceid&quot;,vs=&quot;x-b3-spanid&quot;,ys=&quot;x-b3-sampled&quot;,Yp=&quot;x-b3-parentspanid&quot;,Os=&quot;x-b3-flags&quot;});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t==&quot;string&quot;?t.padStart(32,&quot;0&quot;):&quot;&quot;}function kte(r,e){let t=Kp(r,e,vs);return typeof t==&quot;string&quot;?t:&quot;&quot;}function nU(r,e){return Kp(r,e,Os)===&quot;1&quot;?&quot;1&quot;:void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)===&quot;1&quot;||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=&gt;{P();xr();oS();sS();xte=new Set([!0,&quot;true&quot;,&quot;True&quot;,&quot;1&quot;,1]),Mte=new Set([!1,&quot;false&quot;,&quot;False&quot;,&quot;0&quot;,0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a===&quot;1&quot;?o.set(t,Os,a):s.traceFlags!==void 0&amp;&amp;o.set(t,ys,(se.SAMPLED&amp;s.traceFlags)===se.SAMPLED?&quot;1&quot;:&quot;0&quot;)}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&amp;&amp;Si(a)&amp;&amp;wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&amp;&amp;Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=&gt;{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte=&quot;0&quot;.repeat(16),Gte=new Set([&quot;d&quot;,&quot;1&quot;]),Hte=&quot;d&quot;;$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&amp;1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,&quot;b3&quot;,i)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;),a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&amp;&amp;(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return[&quot;b3&quot;]}}});var As,aS=p(()=&gt;{(function(r){r[r.SINGLE_HEADER=0]=&quot;SINGLE_HEADER&quot;,r[r.MULTI_HEADER=1]=&quot;MULTI_HEADER&quot;})(As||(As={}))});var Xp,sU=p(()=&gt;{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;);return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=&gt;As,B3Propagator:()=&gt;Xp,B3_CONTEXT_HEADER:()=&gt;Ss,X_B3_FLAGS:()=&gt;Os,X_B3_PARENT_SPAN_ID:()=&gt;Yp,X_B3_SAMPLED:()=&gt;ys,X_B3_SPAN_ID:()=&gt;vs,X_B3_TRACE_ID:()=&gt;gs});var lU=p(()=&gt;{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=&gt;{P();cU=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Wp,uU=p(()=&gt;{Wp=&quot;baggage&quot;});function pU(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function dU(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function hU(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}var _U=p(()=&gt;{P()});var Ul,EU=p(()=&gt;{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=pU(a);i.length&gt;0&amp;&amp;o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=hU(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var SU=p(()=&gt;{P()});function gU(){return r=&gt;{S.error($te(r))}}function $te(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=&gt;{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=&gt;{vU();Wte=gU()});var Ut,cS=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)&gt;-1}function tre(r){return ere.indexOf(r)&gt;-1}function nre(r){return rre.indexOf(r)&gt;-1}function ire(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=are[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=&gt;{P();cS();Jte=&quot;,&quot;,Qte=[&quot;OTEL_SDK_DISABLED&quot;];ere=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rre=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=&gt;{uS()});import{performance as cre}from&quot;perf_hooks&quot;;var dr,NU=p(()=&gt;{dr=cre});var CU,PU=p(()=&gt;{CU=&quot;1.29.0&quot;});var ki,IU=p(()=&gt;{PU();Ve();ki={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=&gt;{});var LU=p(()=&gt;{RU();NU();IU();bU()});var fS=p(()=&gt;{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!=&quot;number&quot;){let e=dr;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r==&quot;number&quot;?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function nd(r){return rd(r)||typeof r==&quot;number&quot;||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=pS&amp;&amp;(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=&gt;{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Xt||(Xt={}))});var Vl,wU=p(()=&gt;{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&amp;&amp;!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=&gt;{_S=&quot;[_0-9a-z-*/]&quot;,Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=&gt;{kU();BU=32,vre=512,VU=&quot;,&quot;,FU=&quot;=&quot;,od=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length&gt;vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&amp;&amp;UU(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;BU&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=&gt;{P();Dl();GU();sd=&quot;traceparent&quot;,ad=&quot;tracestate&quot;,yre=&quot;00&quot;,Ore=&quot;(?!ff)[\\da-f]{2}&quot;,Are=&quot;(?![0]{32})[\\da-f]{32}&quot;,Rre=&quot;(?![0]{16})[\\da-f]{16}&quot;,Nre=&quot;[\\da-f]{2}&quot;,Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&amp;&amp;o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new od(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;jU.call(t)===xre}function Dre(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&amp;&amp;Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&amp;&amp;(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=&gt;{Pre=&quot;[object Object]&quot;,Ire=&quot;[object Null]&quot;,bre=&quot;[object Undefined]&quot;,Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t&gt;Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(ld(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&amp;&amp;Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r==&quot;function&quot;}function Gl(r){return!ld(r)&amp;&amp;!cd(r)&amp;&amp;!JU(r)&amp;&amp;typeof r==&quot;object&quot;}function ld(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=&gt;{$U();Vre=20});var ud,ZU=p(()=&gt;{ud=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=&gt;{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=&gt;{he.with(wl(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var rk=p(()=&gt;{P();Dl()});var nk,kt=p(()=&gt;{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=&gt;{ik=&quot;exception&quot;});var Cs,SS=p(()=&gt;{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&amp;&amp;this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length&gt;=this._spanLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn(&quot;No events allowed.&quot;),this._droppedEventsCount++,this;this.events.length&gt;=this._spanLimits.eventCountLimit&amp;&amp;(this._droppedEventsCount===0&amp;&amp;S.debug(&quot;Dropping extra events.&quot;),this.events.shift(),this._droppedEventsCount++),nd(t)&amp;&amp;(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&amp;&amp;typeof e.message!=&quot;string&quot;&amp;&amp;(S.warn(`Dropping invalid status.message of type &#x27;${typeof e.message}&#x27;, expected &#x27;string&#x27;`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]&lt;0&amp;&amp;(S.warn(&quot;Inconsistent start and end time, startTime &gt; endTime. Setting span duration to 0ms.&quot;,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount&gt;0&amp;&amp;S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==&quot;number&quot;&amp;&amp;e&lt;=dr.now())return dS(e+this._performanceOffset);if(typeof e==&quot;number&quot;)return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e==&quot;string&quot;?o[Wa]=e:e&amp;&amp;(e.code?o[Xa]=e.code.toString():e.name&amp;&amp;(o[Xa]=e.name),e.message&amp;&amp;(o[Wa]=e.message),e.stack&amp;&amp;(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&amp;&amp;S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(hr||(hr={}))});var Ur,fd=p(()=&gt;{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Wt,pd=p(()=&gt;{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var Gn,gS=p(()=&gt;{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=&gt;{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value &quot;${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}&quot;.`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG===&quot;&quot;)return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e&lt;0||e&gt;1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=&gt;{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&amp;&amp;t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&amp;&amp;s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&amp;&amp;l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&amp;&amp;u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=&gt;{OS();kt()});var hd,ck=p(()=&gt;{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==&quot;number&quot;?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==&quot;number&quot;?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==&quot;number&quot;?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==&quot;number&quot;?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)!==0&amp;&amp;this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=&gt;this.onShutdown()).then(()=&gt;this._flushAll()).then(()=&gt;this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length&gt;=this._maxQueueSize){this._droppedSpansCount===0&amp;&amp;S.debug(&quot;maxQueueSize reached, dropping spans&quot;),this._droppedSpansCount++;return}this._droppedSpansCount&gt;0&amp;&amp;(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a&lt;i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=&gt;{let o=setTimeout(()=&gt;{t(new Error(&quot;Timeout&quot;))},this._exportTimeoutMillis);he.with(wl(he.active()),()=&gt;{let s;this._finishedSpans.length&lt;=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=&gt;this._exporter.export(s,n=&gt;{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&amp;&amp;l!==void 0?l:new Error(&quot;BatchSpanProcessor: span export failed&quot;))}),i=null;for(let n=0,l=s.length;n&lt;l;n++){let c=s[n];c.resource.asyncAttributesPending&amp;&amp;c.resource.waitForAsyncAttributes&amp;&amp;(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=&gt;{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=&gt;{this._isExporting=!0,this._flushOneBatch().finally(()=&gt;{this._isExporting=!1,this._finishedSpans.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(t=&gt;{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length&gt;=this._maxExportBatchSize)return e();this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=&gt;{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t&lt;r/4;t++)_d.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(_d[t]&gt;0);t++)t===r-1&amp;&amp;(_d[r-1]=1);return _d.toString(&quot;hex&quot;,0,r)}}var qn,_d,pk=p(()=&gt;{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=&gt;{uk();pk()});var Ed=p(()=&gt;{dk()});var Is,hk=p(()=&gt;{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&amp;&amp;(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug(&quot;Instrumentation suppressed, returning Noop Span&quot;),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&amp;&amp;s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&amp;&amp;a!==void 0?a:[]).map(z=&gt;({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&amp;&amp;i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug(&quot;Recording is off, propagating context in a non-recording span&quot;),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length&lt;2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=&gt;{});var Ek=p(()=&gt;{_k()});var mk=p(()=&gt;{Ek()});var jn,Tk=p(()=&gt;{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=&gt;{Tk()});var ql,gk=p(()=&gt;{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=&gt;{Promise.all(e).then(()=&gt;{t()}).catch(o=&gt;{Kt(o||new Error(&quot;MultiSpanProcessor: forceFlush failed&quot;)),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=&gt;{Promise.all(e).then(()=&gt;{t()},o)})}}});var bs,RS=p(()=&gt;{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=&gt;{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]=&quot;resolved&quot;,r[r.timeout=1]=&quot;timeout&quot;,r[r.error=2]=&quot;error&quot;,r[r.unresolved=3]=&quot;unresolved&quot;})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&amp;&amp;t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&amp;&amp;(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&amp;&amp;o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&amp;&amp;this.activeSpanProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current span processor&quot;,t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&amp;&amp;(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&amp;&amp;he.setGlobalContextManager(e.contextManager),e.propagator&amp;&amp;Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=&gt;new Promise(s=&gt;{let a,i=setTimeout(()=&gt;{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=&gt;{clearTimeout(i),a!==pn.timeout&amp;&amp;(a=pn.resolved,s(a))}).catch(n=&gt;{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=&gt;{Promise.all(t).then(a=&gt;{let i=a.filter(n=&gt;n!==pn.resolved);i.length&gt;0?s(i):o()}).catch(a=&gt;s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=&gt;{let a=this._getPropagator(s);return a||S.warn(`Propagator &quot;${s}&quot; requested through environment variable is unavailable.`),a}).reduce((s,a)=&gt;(a&amp;&amp;s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e===&quot;none&quot;||e===&quot;&quot;)return;let t=this._getSpanExporter(e);return t||S.error(`Exporter &quot;${e}&quot; requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([[&quot;tracecontext&quot;,()=&gt;new Fl],[&quot;baggage&quot;,()=&gt;new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=&gt;{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=&gt;{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedSpans.push(...e),setTimeout(()=&gt;t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=&gt;{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&amp;&amp;await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)===0)return;let s=()=&gt;nk._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Xt.SUCCESS&amp;&amp;Kt((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=&gt;{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(a!=null&amp;&amp;this._unresolvedExports.delete(a),s()),i=&gt;Kt(i));a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=&gt;Ur,AlwaysOnSampler:()=&gt;Wt,BasicTracerProvider:()=&gt;Ls,BatchSpanProcessor:()=&gt;Hn,ConsoleSpanExporter:()=&gt;Td,ForceFlushState:()=&gt;pn,InMemorySpanExporter:()=&gt;Sd,NoopSpanProcessor:()=&gt;bs,ParentBasedSampler:()=&gt;Gn,RandomIdGenerator:()=&gt;qn,SamplingDecision:()=&gt;hr,SimpleSpanProcessor:()=&gt;gd,Span:()=&gt;Cs,TraceIdRatioBasedSampler:()=&gt;Fi,Tracer:()=&gt;Is});var Gi=p(()=&gt;{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=&gt;{&quot;use strict&quot;;var qre=&quot;2.0.0&quot;,jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=[&quot;major&quot;,&quot;premajor&quot;,&quot;minor&quot;,&quot;preminor&quot;,&quot;patch&quot;,&quot;prepatch&quot;,&quot;prerelease&quot;];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=&gt;{&quot;use strict&quot;;var $re=typeof process==&quot;object&quot;&amp;&amp;process.env&amp;&amp;process.env.NODE_DEBUG&amp;&amp;/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=&gt;console.error(&quot;SEMVER&quot;,...r):()=&gt;{};Nk.exports=$re});var Ms=T((kr,Ck)=&gt;{&quot;use strict&quot;;var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS=&quot;[a-zA-Z0-9-]&quot;,rne=[[&quot;\\s&quot;,1],[&quot;\\d&quot;,Wre],[CS,Xre]],nne=r=&gt;{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=&gt;{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?&quot;g&quot;:void 0),Zre[s]=new RegExp(o,t?&quot;g&quot;:void 0)};re(&quot;NUMERICIDENTIFIER&quot;,&quot;0|[1-9]\\d*&quot;);re(&quot;NUMERICIDENTIFIERLOOSE&quot;,&quot;\\d+&quot;);re(&quot;NONNUMERICIDENTIFIER&quot;,`\\d*[a-zA-Z-]${CS}*`);re(&quot;MAINVERSION&quot;,`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re(&quot;MAINVERSIONLOOSE&quot;,`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASEIDENTIFIER&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re(&quot;PRERELEASEIDENTIFIERLOOSE&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASE&quot;,`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re(&quot;PRERELEASELOOSE&quot;,`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re(&quot;BUILDIDENTIFIER&quot;,`${CS}+`);re(&quot;BUILD&quot;,`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re(&quot;FULLPLAIN&quot;,`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re(&quot;FULL&quot;,`^${D[U.FULLPLAIN]}$`);re(&quot;LOOSEPLAIN&quot;,`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re(&quot;LOOSE&quot;,`^${D[U.LOOSEPLAIN]}$`);re(&quot;GTLT&quot;,&quot;((?:&lt;|&gt;)?=?)&quot;);re(&quot;XRANGEIDENTIFIERLOOSE&quot;,`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re(&quot;XRANGEIDENTIFIER&quot;,`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re(&quot;XRANGEPLAIN&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGEPLAINLOOSE&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re(&quot;XRANGELOOSE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COERCEPLAIN&quot;,`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re(&quot;COERCE&quot;,`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re(&quot;COERCEFULL&quot;,D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re(&quot;COERCERTL&quot;,D[U.COERCE],!0);re(&quot;COERCERTLFULL&quot;,D[U.COERCEFULL],!0);re(&quot;LONETILDE&quot;,&quot;(?:~&gt;?)&quot;);re(&quot;TILDETRIM&quot;,`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace=&quot;$1~&quot;;re(&quot;TILDE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re(&quot;TILDELOOSE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;LONECARET&quot;,&quot;(?:\\^)&quot;);re(&quot;CARETTRIM&quot;,`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace=&quot;$1^&quot;;re(&quot;CARET&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re(&quot;CARETLOOSE&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COMPARATORLOOSE&quot;,`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re(&quot;COMPARATOR&quot;,`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re(&quot;COMPARATORTRIM&quot;,`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace=&quot;$1$2$3&quot;;re(&quot;HYPHENRANGE&quot;,`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re(&quot;HYPHENRANGELOOSE&quot;,`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re(&quot;STAR&quot;,&quot;(&lt;|&gt;)?=?\\s*\\*&quot;);re(&quot;GTE0&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0\\s*$&quot;);re(&quot;GTE0PRE&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0-0\\s*$&quot;)});var vd=T((c1e,Pk)=&gt;{&quot;use strict&quot;;var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=&gt;r?typeof r!=&quot;object&quot;?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=&gt;{&quot;use strict&quot;;var Ik=/^[0-9]+$/,bk=(r,e)=&gt;{let t=Ik.test(r),o=Ik.test(e);return t&amp;&amp;o&amp;&amp;(r=+r,e=+e),r===e?0:t&amp;&amp;!o?-1:o&amp;&amp;!t?1:r&lt;e?-1:1},ane=(r,e)=&gt;bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=&gt;{&quot;use strict&quot;;var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!=&quot;string&quot;)throw new TypeError(`Invalid version. Must be a string. Got type &quot;${typeof e}&quot;.`);if(e.length&gt;xk)throw new TypeError(`version is longer than ${xk} characters`);yd(&quot;SemVer&quot;,e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major&gt;Od||this.major&lt;0)throw new TypeError(&quot;Invalid major version&quot;);if(this.minor&gt;Od||this.minor&lt;0)throw new TypeError(&quot;Invalid minor version&quot;);if(this.patch&gt;Od||this.patch&lt;0)throw new TypeError(&quot;Invalid patch version&quot;);o[4]?this.prerelease=o[4].split(&quot;.&quot;).map(s=&gt;{if(/^[0-9]+$/.test(s)){let a=+s;if(a&gt;=0&amp;&amp;a&lt;Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split(&quot;.&quot;):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&amp;&amp;(this.version+=`-${this.prerelease.join(&quot;.&quot;)}`),this.version}toString(){return this.version}compare(e){if(yd(&quot;SemVer.compare&quot;,this.version,this.options,e),!(e instanceof r)){if(typeof e==&quot;string&quot;&amp;&amp;e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&amp;&amp;!e.prerelease.length)return-1;if(!this.prerelease.length&amp;&amp;e.prerelease.length)return 1;if(!this.prerelease.length&amp;&amp;!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd(&quot;prerelease compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd(&quot;build compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith(&quot;pre&quot;)){if(!t&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier is empty&quot;);if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case&quot;premajor&quot;:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(&quot;pre&quot;,t,o);break;case&quot;preminor&quot;:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(&quot;pre&quot;,t,o);break;case&quot;prepatch&quot;:this.prerelease.length=0,this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;prerelease&quot;:this.prerelease.length===0&amp;&amp;this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;release&quot;:if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case&quot;major&quot;:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&amp;&amp;this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case&quot;minor&quot;:(this.patch!==0||this.prerelease.length===0)&amp;&amp;this.minor++,this.patch=0,this.prerelease=[];break;case&quot;patch&quot;:this.prerelease.length===0&amp;&amp;this.patch++,this.prerelease=[];break;case&quot;pre&quot;:{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a&gt;=0;)typeof this.prerelease[a]==&quot;number&quot;&amp;&amp;(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(&quot;.&quot;)&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier already exists&quot;);this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&amp;&amp;(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&amp;&amp;(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&amp;&amp;(this.raw+=`+${this.build.join(&quot;.&quot;)}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=&gt;{&quot;use strict&quot;;var wk=pt(),cne=(r,e,t=!1)=&gt;{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=&gt;{&quot;use strict&quot;;var une=Hi(),fne=(r,e)=&gt;{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=&gt;{&quot;use strict&quot;;var pne=Hi(),dne=(r,e)=&gt;{let t=pne(r.trim().replace(/^[=v]+/,&quot;&quot;),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=&gt;{&quot;use strict&quot;;var Fk=pt(),hne=(r,e,t,o,s)=&gt;{typeof t==&quot;string&quot;&amp;&amp;(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=&gt;{&quot;use strict&quot;;var qk=Hi(),_ne=(r,e)=&gt;{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s&gt;0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&amp;&amp;!l){if(!n.patch&amp;&amp;!n.minor)return&quot;major&quot;;if(n.compareMain(i)===0)return n.minor&amp;&amp;!n.patch?&quot;minor&quot;:&quot;patch&quot;}let u=l?&quot;pre&quot;:&quot;&quot;;return t.major!==o.major?u+&quot;major&quot;:t.minor!==o.minor?u+&quot;minor&quot;:t.patch!==o.patch?u+&quot;patch&quot;:&quot;prerelease&quot;};jk.exports=_ne});var Kk=T((m1e,zk)=&gt;{&quot;use strict&quot;;var Ene=pt(),mne=(r,e)=&gt;new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=&gt;{&quot;use strict&quot;;var Tne=pt(),Sne=(r,e)=&gt;new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=&gt;{&quot;use strict&quot;;var gne=pt(),vne=(r,e)=&gt;new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=&gt;{&quot;use strict&quot;;var yne=Hi(),One=(r,e)=&gt;{let t=yne(r,e);return t&amp;&amp;t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=&gt;{&quot;use strict&quot;;var eB=pt(),Ane=(r,e,t)=&gt;new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=&gt;{&quot;use strict&quot;;var Rne=Jt(),Nne=(r,e,t)=&gt;Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=&gt;{&quot;use strict&quot;;var Cne=Jt(),Pne=(r,e)=&gt;Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=&gt;{&quot;use strict&quot;;var sB=pt(),Ine=(r,e,t)=&gt;{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=&gt;{&quot;use strict&quot;;var bne=Nd(),Lne=(r,e)=&gt;r.sort((t,o)=&gt;bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=&gt;{&quot;use strict&quot;;var xne=Nd(),Mne=(r,e)=&gt;r.sort((t,o)=&gt;xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=&gt;{&quot;use strict&quot;;var wne=Jt(),Dne=(r,e,t)=&gt;wne(r,e,t)&gt;0;pB.exports=Dne});var Cd=T((P1e,dB)=&gt;{&quot;use strict&quot;;var Une=Jt(),kne=(r,e,t)=&gt;Une(r,e,t)&lt;0;dB.exports=kne});var bS=T((I1e,hB)=&gt;{&quot;use strict&quot;;var Bne=Jt(),Vne=(r,e,t)=&gt;Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=&gt;{&quot;use strict&quot;;var Fne=Jt(),Gne=(r,e,t)=&gt;Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=&gt;{&quot;use strict&quot;;var Hne=Jt(),qne=(r,e,t)=&gt;Hne(r,e,t)&gt;=0;EB.exports=qne});var Id=T((x1e,mB)=&gt;{&quot;use strict&quot;;var jne=Jt(),Yne=(r,e,t)=&gt;jne(r,e,t)&lt;=0;mB.exports=Yne});var xS=T((M1e,TB)=&gt;{&quot;use strict&quot;;var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=&gt;{switch(e){case&quot;===&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r===t;case&quot;!==&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r!==t;case&quot;&quot;:case&quot;=&quot;:case&quot;==&quot;:return zne(r,t,o);case&quot;!=&quot;:return Kne(r,t,o);case&quot;&gt;&quot;:return $ne(r,t,o);case&quot;&gt;=&quot;:return Xne(r,t,o);case&quot;&lt;&quot;:return Wne(r,t,o);case&quot;&lt;=&quot;:return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=&gt;{&quot;use strict&quot;;var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=&gt;{if(r instanceof Zne)return r;if(typeof r==&quot;number&quot;&amp;&amp;(r=String(r)),typeof r!=&quot;string&quot;)return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&amp;&amp;(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&amp;&amp;(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||&quot;0&quot;,a=t[4]||&quot;0&quot;,i=e.includePrerelease&amp;&amp;t[5]?`-${t[5]}`:&quot;&quot;,n=e.includePrerelease&amp;&amp;t[6]?`+${t[6]}`:&quot;&quot;;return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=&gt;{&quot;use strict&quot;;var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&amp;&amp;t!==void 0){if(this.map.size&gt;=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=&gt;{&quot;use strict&quot;;var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie,&quot; &quot;),this.set=this.raw.split(&quot;||&quot;).map(o=&gt;this.parseRange(o.trim())).filter(o=&gt;o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length&gt;1){let o=this.set[0];if(this.set=this.set.filter(s=&gt;!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length&gt;1){for(let s of this.set)if(s.length===1&amp;&amp;fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=&quot;&quot;;for(let e=0;e&lt;this.set.length;e++){e&gt;0&amp;&amp;(this.formatted+=&quot;||&quot;);let t=this.set[e];for(let o=0;o&lt;t.length;o++)o&gt;0&amp;&amp;(this.formatted+=&quot; &quot;),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&amp;&amp;cie)|(this.options.loose&amp;&amp;uie))+&quot;:&quot;+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be(&quot;hyphen replace&quot;,e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be(&quot;comparator trim&quot;,e),e=e.replace(Rt[Tt.TILDETRIM],aie),be(&quot;tilde trim&quot;,e),e=e.replace(Rt[Tt.CARETTRIM],lie),be(&quot;caret trim&quot;,e);let n=e.split(&quot; &quot;).map(f=&gt;pie(f,this.options)).join(&quot; &quot;).split(/\s+/).map(f=&gt;gie(f,this.options));a&amp;&amp;(n=n.filter(f=&gt;(be(&quot;loose invalid filter&quot;,f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be(&quot;range list&quot;,n);let l=new Map,c=n.map(f=&gt;new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size&gt;1&amp;&amp;l.has(&quot;&quot;)&amp;&amp;l.delete(&quot;&quot;);let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Range is required&quot;);return this.set.some(o=&gt;RB(o,t)&amp;&amp;e.set.some(s=&gt;RB(s,t)&amp;&amp;o.every(a=&gt;s.every(i=&gt;a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==&quot;string&quot;)try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t&lt;this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=&gt;r.value===&quot;&lt;0.0.0-0&quot;,fie=r=&gt;r.value===&quot;&quot;,RB=(r,e)=&gt;{let t=!0,o=r.slice(),s=o.pop();for(;t&amp;&amp;o.length;)t=o.every(a=&gt;s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=&gt;(be(&quot;comp&quot;,r,e),r=_ie(r,e),be(&quot;caret&quot;,r),r=die(r,e),be(&quot;tildes&quot;,r),r=mie(r,e),be(&quot;xrange&quot;,r),r=Sie(r,e),be(&quot;stars&quot;,r),r),St=r=&gt;!r||r.toLowerCase()===&quot;x&quot;||r===&quot;*&quot;,die=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;hie(t,e)).join(&quot; &quot;),hie=(r,e)=&gt;{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=&gt;{be(&quot;tilde&quot;,r,o,s,a,i,n);let l;return St(s)?l=&quot;&quot;:St(a)?l=`&gt;=${s}.0.0 &lt;${+s+1}.0.0-0`:St(i)?l=`&gt;=${s}.${a}.0 &lt;${s}.${+a+1}.0-0`:n?(be(&quot;replaceTilde pr&quot;,n),l=`&gt;=${s}.${a}.${i}-${n} &lt;${s}.${+a+1}.0-0`):l=`&gt;=${s}.${a}.${i} &lt;${s}.${+a+1}.0-0`,be(&quot;tilde return&quot;,l),l})},_ie=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;Eie(t,e)).join(&quot; &quot;),Eie=(r,e)=&gt;{be(&quot;caret&quot;,r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?&quot;-0&quot;:&quot;&quot;;return r.replace(t,(s,a,i,n,l)=&gt;{be(&quot;caret&quot;,r,s,a,i,n,l);let c;return St(a)?c=&quot;&quot;:St(i)?c=`&gt;=${a}.0.0${o} &lt;${+a+1}.0.0-0`:St(n)?a===&quot;0&quot;?c=`&gt;=${a}.${i}.0${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.0${o} &lt;${+a+1}.0.0-0`:l?(be(&quot;replaceCaret pr&quot;,l),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${+a+1}.0.0-0`):(be(&quot;no pr&quot;),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n} &lt;${+a+1}.0.0-0`),be(&quot;caret return&quot;,c),c})},mie=(r,e)=&gt;(be(&quot;replaceXRanges&quot;,r,e),r.split(/\s+/).map(t=&gt;Tie(t,e)).join(&quot; &quot;)),Tie=(r,e)=&gt;{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=&gt;{be(&quot;xRange&quot;,r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s===&quot;=&quot;&amp;&amp;_&amp;&amp;(s=&quot;&quot;),l=e.includePrerelease?&quot;-0&quot;:&quot;&quot;,c?s===&quot;&gt;&quot;||s===&quot;&lt;&quot;?o=&quot;&lt;0.0.0-0&quot;:o=&quot;*&quot;:s&amp;&amp;_?(u&amp;&amp;(i=0),n=0,s===&quot;&gt;&quot;?(s=&quot;&gt;=&quot;,u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s===&quot;&lt;=&quot;&amp;&amp;(s=&quot;&lt;&quot;,u?a=+a+1:i=+i+1),s===&quot;&lt;&quot;&amp;&amp;(l=&quot;-0&quot;),o=`${s+a}.${i}.${n}${l}`):u?o=`&gt;=${a}.0.0${l} &lt;${+a+1}.0.0-0`:f&amp;&amp;(o=`&gt;=${a}.${i}.0${l} &lt;${a}.${+i+1}.0-0`),be(&quot;xRange return&quot;,o),o})},Sie=(r,e)=&gt;(be(&quot;replaceStars&quot;,r,e),r.trim().replace(Rt[Tt.STAR],&quot;&quot;)),gie=(r,e)=&gt;(be(&quot;replaceGTE0&quot;,r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],&quot;&quot;)),vie=r=&gt;(e,t,o,s,a,i,n,l,c,u,f,_)=&gt;(St(o)?t=&quot;&quot;:St(s)?t=`&gt;=${o}.0.0${r?&quot;-0&quot;:&quot;&quot;}`:St(a)?t=`&gt;=${o}.${s}.0${r?&quot;-0&quot;:&quot;&quot;}`:i?t=`&gt;=${t}`:t=`&gt;=${t}${r?&quot;-0&quot;:&quot;&quot;}`,St(c)?l=&quot;&quot;:St(u)?l=`&lt;${+c+1}.0.0-0`:St(f)?l=`&lt;${c}.${+u+1}.0-0`:_?l=`&lt;=${c}.${u}.${f}-${_}`:r?l=`&lt;${c}.${u}.${+f+1}-0`:l=`&lt;=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=&gt;{for(let o=0;o&lt;r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&amp;&amp;!t.includePrerelease){for(let o=0;o&lt;r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&amp;&amp;r[o].semver.prerelease.length&gt;0){let s=r[o].semver;if(s.major===e.major&amp;&amp;s.minor===e.minor&amp;&amp;s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=&gt;{&quot;use strict&quot;;var $l=Symbol(&quot;SemVer ANY&quot;),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(&quot; &quot;),kS(&quot;comparator&quot;,e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value=&quot;&quot;:this.value=this.operator+this.semver.version,kS(&quot;comp&quot;,this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:&quot;&quot;,this.operator===&quot;=&quot;&amp;&amp;(this.operator=&quot;&quot;),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS(&quot;Comparator.test&quot;,e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e==&quot;string&quot;)try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Comparator is required&quot;);return this.operator===&quot;&quot;?this.value===&quot;&quot;?!0:new LB(e.value,t).test(this.value):e.operator===&quot;&quot;?e.value===&quot;&quot;?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&amp;&amp;(this.value===&quot;&lt;0.0.0-0&quot;||e.value===&quot;&lt;0.0.0-0&quot;)||!t.includePrerelease&amp;&amp;(this.value.startsWith(&quot;&lt;0.0.0&quot;)||e.value.startsWith(&quot;&lt;0.0.0&quot;))?!1:!!(this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)||this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||this.semver.version===e.semver.version&amp;&amp;this.operator.includes(&quot;=&quot;)&amp;&amp;e.operator.includes(&quot;=&quot;)||US(this.semver,&quot;&lt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||US(this.semver,&quot;&gt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=&gt;{&quot;use strict&quot;;var Oie=Qt(),Aie=(r,e,t)=&gt;{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=&gt;{&quot;use strict&quot;;var Rie=Qt(),Nie=(r,e)=&gt;new Rie(r,e).set.map(t=&gt;t.map(o=&gt;o.value).join(&quot; &quot;).trim().split(&quot; &quot;));wB.exports=Nie});var kB=T((F1e,UB)=&gt;{&quot;use strict&quot;;var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===-1)&amp;&amp;(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=&gt;{&quot;use strict&quot;;var bie=pt(),Lie=Qt(),xie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===1)&amp;&amp;(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=&gt;{&quot;use strict&quot;;var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=&gt;{r=new Mie(r,e);let t=new VS(&quot;0.0.0&quot;);if(r.test(t)||(t=new VS(&quot;0.0.0-0&quot;),r.test(t)))return t;t=null;for(let o=0;o&lt;r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=&gt;{let n=new VS(i.semver.version);switch(i.operator){case&quot;&gt;&quot;:n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case&quot;&quot;:case&quot;&gt;=&quot;:(!a||FB(n,a))&amp;&amp;(a=n);break;case&quot;&lt;&quot;:case&quot;&lt;=&quot;:break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&amp;&amp;(!t||FB(t,a))&amp;&amp;(t=a)}return t&amp;&amp;r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=&gt;{&quot;use strict&quot;;var Die=Qt(),Uie=(r,e)=&gt;{try{return new Die(r,e).range||&quot;*&quot;}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=&gt;{&quot;use strict&quot;;var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=&gt;{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case&quot;&gt;&quot;:s=YB,a=Gie,i=zB,n=&quot;&gt;&quot;,l=&quot;&gt;=&quot;;break;case&quot;&lt;&quot;:s=zB,a=Hie,i=YB,n=&quot;&lt;&quot;,l=&quot;&lt;=&quot;;break;default:throw new TypeError(&#x27;Must provide a hilo val of &quot;&lt;&quot; or &quot;&gt;&quot;&#x27;)}if(Fie(r,e,o))return!1;for(let c=0;c&lt;e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=&gt;{m.semver===Bie&amp;&amp;(m=new KB(&quot;&gt;=0.0.0&quot;)),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&amp;&amp;(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&amp;&amp;a(r,_.semver))return!1;if(_.operator===l&amp;&amp;i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=&gt;{&quot;use strict&quot;;var jie=xd(),Yie=(r,e,t)=&gt;jie(r,e,&quot;&gt;&quot;,t);XB.exports=Yie});var QB=T((z1e,JB)=&gt;{&quot;use strict&quot;;var zie=xd(),Kie=(r,e,t)=&gt;zie(r,e,&quot;&lt;&quot;,t);JB.exports=Kie});var tV=T((K1e,eV)=&gt;{&quot;use strict&quot;;var ZB=Qt(),$ie=(r,e,t)=&gt;(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=&gt;{&quot;use strict&quot;;var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=&gt;{let o=[],s=null,a=null,i=r.sort((u,f)=&gt;Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&amp;&amp;o.push([s,a]),a=null,s=null);s&amp;&amp;o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&amp;&amp;u===i[0]?n.push(&quot;*&quot;):f?u===i[0]?n.push(`&lt;=${f}`):n.push(`${u} - ${f}`):n.push(`&gt;=${u}`);let l=n.join(&quot; || &quot;),c=typeof e.raw==&quot;string&quot;?e.raw:String(e);return l.length&lt;c.length?l:e}});var cV=T((X1e,lV)=&gt;{&quot;use strict&quot;;var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=&gt;{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(&quot;&gt;=0.0.0-0&quot;)],oV=[new GS(&quot;&gt;=0.0.0&quot;)],Zie=(r,e,t)=&gt;{if(r===e)return!0;if(r.length===1&amp;&amp;r[0].semver===FS){if(e.length===1&amp;&amp;e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&amp;&amp;e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;?s=sV(s,m,t):m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;?a=aV(a,m,t):o.add(m.semver);if(o.size&gt;1)return null;let i;if(s&amp;&amp;a){if(i=HS(s.semver,a.semver,t),i&gt;0)return null;if(i===0&amp;&amp;(s.operator!==&quot;&gt;=&quot;||a.operator!==&quot;&lt;=&quot;))return null}for(let m of o){if(s&amp;&amp;!Wl(m,String(s),t)||a&amp;&amp;!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&amp;&amp;!t.includePrerelease&amp;&amp;a.semver.prerelease.length?a.semver:!1,_=s&amp;&amp;!t.includePrerelease&amp;&amp;s.semver.prerelease.length?s.semver:!1;f&amp;&amp;f.prerelease.length===1&amp;&amp;a.operator===&quot;&lt;&quot;&amp;&amp;f.prerelease[0]===0&amp;&amp;(f=!1);for(let m of e){if(u=u||m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;,c=c||m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;,s){if(_&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===_.major&amp;&amp;m.semver.minor===_.minor&amp;&amp;m.semver.patch===_.patch&amp;&amp;(_=!1),m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;){if(n=sV(s,m,t),n===m&amp;&amp;n!==s)return!1}else if(s.operator===&quot;&gt;=&quot;&amp;&amp;!Wl(s.semver,String(m),t))return!1}if(a){if(f&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===f.major&amp;&amp;m.semver.minor===f.minor&amp;&amp;m.semver.patch===f.patch&amp;&amp;(f=!1),m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;){if(l=aV(a,m,t),l===m&amp;&amp;l!==a)return!1}else if(a.operator===&quot;&lt;=&quot;&amp;&amp;!Wl(a.semver,String(m),t))return!1}if(!m.operator&amp;&amp;(a||s)&amp;&amp;i!==0)return!1}return!(s&amp;&amp;c&amp;&amp;!a&amp;&amp;i!==0||a&amp;&amp;u&amp;&amp;!s&amp;&amp;i!==0||_||f)},sV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&gt;0?r:o&lt;0||e.operator===&quot;&gt;&quot;&amp;&amp;r.operator===&quot;&gt;=&quot;?e:r},aV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&lt;0?r:o&gt;0||e.operator===&quot;&lt;&quot;&amp;&amp;r.operator===&quot;&lt;=&quot;?e:r};lV.exports=Jie});var jS=T((W1e,pV)=&gt;{&quot;use strict&quot;;var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(&quot;:&quot;);if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,&quot;0&quot;),n=s.padStart(16,&quot;0&quot;),l=Boe.test(a)?parseInt(a,16)&amp;1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=&gt;{P();xr();dV=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},hV=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},YS=&quot;uber-trace-id&quot;,Md=&quot;uberctx&quot;,_V=(function(){function r(e){typeof e==&quot;string&quot;?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&amp;&amp;At(e)===!1){var l=&quot;0&quot;+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+&quot;:&quot;+i.spanId+&quot;:0:&quot;+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+&quot;-&quot;+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&amp;&amp;!u.done&amp;&amp;(a=c.return)&amp;&amp;a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+&quot;-&quot;)}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c==&quot;string&quot;){var _=Voe(c);_&amp;&amp;(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&amp;&amp;n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&amp;&amp;(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&amp;&amp;!y.done&amp;&amp;(a=O.return)&amp;&amp;a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=&gt;_V,UBER_BAGGAGE_HEADER_PREFIX:()=&gt;Md,UBER_TRACE_ID_HEADER:()=&gt;YS});var TV=p(()=&gt;{EV()});var vV=T(Ud=&gt;{&quot;use strict&quot;;Object.defineProperty(Ud,&quot;__esModule&quot;,{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,&quot;14.8.0&quot;)?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,[&quot;b3&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],[&quot;b3multi&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],[&quot;jaeger&quot;,()=&gt;new Goe.JaegerPropagator]])});var zS=T(fe=&gt;{&quot;use strict&quot;;Object.defineProperty(fe,&quot;__esModule&quot;,{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,&quot;NodeTracerProvider&quot;,{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,&quot;AlwaysOffSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,&quot;AlwaysOnSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,&quot;BasicTracerProvider&quot;,{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,&quot;BatchSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,&quot;ConsoleSpanExporter&quot;,{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,&quot;ForceFlushState&quot;,{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,&quot;InMemorySpanExporter&quot;,{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,&quot;NoopSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,&quot;ParentBasedSampler&quot;,{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,&quot;RandomIdGenerator&quot;,{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,&quot;SamplingDecision&quot;,{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,&quot;SimpleSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,&quot;Span&quot;,{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,&quot;TraceIdRatioBasedSampler&quot;,{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,&quot;Tracer&quot;,{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=&gt;{});var OV=p(()=&gt;{yV()});var KS=p(()=&gt;{OV()});var Ce,dn=p(()=&gt;{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=&gt;{AV=r=&gt;{switch(r){case&quot;arm&quot;:return&quot;arm32&quot;;case&quot;ppc&quot;:return&quot;ppc32&quot;;case&quot;x64&quot;:return&quot;amd64&quot;;default:return r}},RV=r=&gt;{switch(r){case&quot;sunos&quot;:return&quot;solaris&quot;;case&quot;win32&quot;:return&quot;windows&quot;;default:return r}}});import*as NV from&quot;child_process&quot;;import*as CV from&quot;util&quot;;var Us,kd=p(()=&gt;{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=&gt;qoe});async function qoe(){try{let e=(await Us(&#x27;ioreg -rd1 -c &quot;IOPlatformExpertDevice&quot;&#x27;)).stdout.split(` `).find(o=&gt;o.includes(&quot;IOPlatformUUID&quot;));if(!e)return&quot;&quot;;let t=e.split(&#x27;&quot; = &quot;&#x27;);if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var IV=p(()=&gt;{kd();P()});var bV={};Ae(bV,{getMachineId:()=&gt;Yoe});import{promises as joe}from&quot;fs&quot;;async function Yoe(){let r=[&quot;/etc/machine-id&quot;,&quot;/var/lib/dbus/machine-id&quot;];for(let e of r)try{return(await joe.readFile(e,{encoding:&quot;utf8&quot;})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var LV=p(()=&gt;{P()});var xV={};Ae(xV,{getMachineId:()=&gt;Koe});import{promises as zoe}from&quot;fs&quot;;async function Koe(){try{return(await zoe.readFile(&quot;/etc/hostid&quot;,{encoding:&quot;utf8&quot;})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us(&quot;kenv -q smbios.system.uuid&quot;)).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var MV=p(()=&gt;{kd();P()});var wV={};Ae(wV,{getMachineId:()=&gt;$oe});import*as Bd from&quot;process&quot;;async function $oe(){let r=&quot;QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid&quot;,e=&quot;%windir%\\System32\\REG.exe&quot;;Bd.arch===&quot;ia32&quot;&amp;&amp;&quot;PROCESSOR_ARCHITEW6432&quot;in Bd.env&amp;&amp;(e=&quot;%windir%\\sysnative\\cmd.exe /c &quot;+e);try{let o=(await Us(`${e} ${r}`)).stdout.split(&quot;REG_SZ&quot;);if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var DV=p(()=&gt;{kd();P()});var UV={};Ae(UV,{getMachineId:()=&gt;Xoe});async function Xoe(){return S.debug(&quot;could not read machine-id: unsupported platform&quot;),&quot;&quot;}var kV=p(()=&gt;{P()});import*as BV from&quot;process&quot;;var qi,VV=p(()=&gt;{switch(BV.platform){case&quot;darwin&quot;:({getMachineId:qi}=(IV(),ee(PV)));break;case&quot;linux&quot;:({getMachineId:qi}=(LV(),ee(bV)));break;case&quot;freebsd&quot;:({getMachineId:qi}=(MV(),ee(xV)));break;case&quot;win32&quot;:({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from&quot;os&quot;;var XS,ji,WS=p(()=&gt;{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=&gt;{let t={};return e&amp;&amp;(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=&gt;{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from&quot;os&quot;;var QS,Yi,ZS=p(()=&gt;{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=&gt;{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from&quot;os&quot;;var tg,zi,rg=p(()=&gt;{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:&quot;nodejs&quot;,[Ja]:&quot;Node.js&quot;};process.argv.length&gt;1&amp;&amp;(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=&gt;{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from&quot;crypto&quot;;var ig,ec,jV=p(()=&gt;{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=&gt;{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=&gt;{YV()});var og,tc,sg=p(()=&gt;{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator&lt;&quot;u&quot;&amp;&amp;((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&amp;&amp;((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:&quot;browser&quot;,[Ja]:&quot;Web Browser&quot;,[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===&quot;&quot;?(S.debug(&quot;BrowserDetector failed: Unable to find required browser resources. &quot;),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=&gt;{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=&gt;{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=&quot;,&quot;,this._LABEL_KEY_VALUE_SPLITTER=&quot;=&quot;,this._ERROR_MESSAGE_INVALID_CHARS=&quot;should be a ASCII string with a length greater than 0 and not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;,this._ERROR_MESSAGE_INVALID_VALUE=&quot;should be a ASCII string with a length not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&amp;&amp;(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^&quot;|&quot;$/).join(&quot;&quot;),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length&lt;=this._MAX_LENGTH&amp;&amp;this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t&lt;e.length;t++){let o=e.charCodeAt(t);if(o&lt;33||o===44||o===59||o===92||o&gt;126)return!1}return!0}_isValidAndNotEmpty(e){return e.length&gt;0&amp;&amp;this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=&gt;{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=&gt;{zV();KV();$V();sg();ug()});var WV,JV=p(()=&gt;{WV=r=&gt;r!==null&amp;&amp;typeof r==&quot;object&quot;&amp;&amp;typeof r.then==&quot;function&quot;});var QV,ZV,e2,t2=p(()=&gt;{dn();P();JV();QV=async(r={})=&gt;{let e=await Promise.all((r.detectors||[]).map(async t=&gt;{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=&gt;t.merge(o),Ce.empty())},ZV=(r={})=&gt;{var e;let t=((e=r.detectors)!==null&amp;&amp;e!==void 0?e:[]).map(s=&gt;{try{let a=s.detect(r),i;if(WV(a)){let n=async()=&gt;{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=&gt;S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=&gt;s.merge(a),Ce.empty());return o.waitForAsyncAttributes&amp;&amp;o.waitForAsyncAttributes().then(()=&gt;{e2(t)}),o},e2=r=&gt;{r.forEach(e=&gt;{if(Object.keys(e.attributes).length&gt;0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=&gt;Ce,browserDetector:()=&gt;lg,browserDetectorSync:()=&gt;tc,defaultServiceName:()=&gt;Ds,detectResources:()=&gt;QV,detectResourcesSync:()=&gt;ZV,envDetector:()=&gt;pg,envDetectorSync:()=&gt;rc,hostDetector:()=&gt;Jl,hostDetectorSync:()=&gt;ji,osDetector:()=&gt;Ql,osDetectorSync:()=&gt;Yi,processDetector:()=&gt;Zl,processDetectorSync:()=&gt;zi,serviceInstanceIdDetectorSync:()=&gt;ec});var Fd=p(()=&gt;{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s&lt;a;s++){let i=r[s];e&amp;&amp;i.setTracerProvider(e),t&amp;&amp;i.setMeterProvider(t),o&amp;&amp;i.setLoggerProvider&amp;&amp;i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=&gt;e.disable())}var i2=p(()=&gt;{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&amp;&amp;t!==void 0?t:[];return r2(i,o,s,a),()=&gt;{n2(i)}}var s2=p(()=&gt;{P();El();i2()});var hg=T((FUe,c2)=&gt;{&quot;use strict&quot;;function dg(r){return typeof r==&quot;function&quot;}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&amp;&amp;r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&amp;&amp;r.logger&amp;&amp;(dg(r.logger)?vt=r.logger:vt(&quot;new logger isn&#x27;t a function, not replacing&quot;))}function a2(r,e,t){if(!r||!r[e]){vt(&quot;no original function &quot;+e+&quot; to wrap&quot;);return}if(!t){vt(&quot;no wrapper function&quot;),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt(&quot;original object and wrapper must be functions&quot;);return}var o=r[e],s=t(o,e);return nc(s,&quot;__original&quot;,o),nc(s,&quot;__unwrap&quot;,function(){r[e]===s&amp;&amp;nc(r,e,o)}),nc(s,&quot;__wrapped&quot;,!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to wrap on modules&quot;);return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt(&quot;no function to unwrap.&quot;),vt(new Error().stack);return}if(!r[e].__unwrap)vt(&quot;no original to unwrap to -- has &quot;+e+&quot; already been unwrapped?&quot;);else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to unwrap on modules&quot;);return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=&gt;{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&amp;&amp;e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error(&quot;Error running span customization hook due to exception in handler&quot;,{triggerName:t},a)}}}});var p2=T((jUe,f2)=&gt;{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t===&quot;string&quot;&amp;&amp;r.length&gt;0)return ose(r);if(t===&quot;number&quot;&amp;&amp;isFinite(r))return e.long?ase(r):sse(r);throw new Error(&quot;val is not a non-empty string or a valid number. val=&quot;+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length&gt;100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||&quot;ms&quot;).toLowerCase();switch(o){case&quot;years&quot;:case&quot;year&quot;:case&quot;yrs&quot;:case&quot;yr&quot;:case&quot;y&quot;:return t*ise;case&quot;weeks&quot;:case&quot;week&quot;:case&quot;w&quot;:return t*nse;case&quot;days&quot;:case&quot;day&quot;:case&quot;d&quot;:return t*Ki;case&quot;hours&quot;:case&quot;hour&quot;:case&quot;hrs&quot;:case&quot;hr&quot;:case&quot;h&quot;:return t*Vs;case&quot;minutes&quot;:case&quot;minute&quot;:case&quot;mins&quot;:case&quot;min&quot;:case&quot;m&quot;:return t*Bs;case&quot;seconds&quot;:case&quot;second&quot;:case&quot;secs&quot;:case&quot;sec&quot;:case&quot;s&quot;:return t*ks;case&quot;milliseconds&quot;:case&quot;millisecond&quot;:case&quot;msecs&quot;:case&quot;msec&quot;:case&quot;ms&quot;:return t;default:return}}}}function sse(r){var e=Math.abs(r);return e&gt;=Ki?Math.round(r/Ki)+&quot;d&quot;:e&gt;=Vs?Math.round(r/Vs)+&quot;h&quot;:e&gt;=Bs?Math.round(r/Bs)+&quot;m&quot;:e&gt;=ks?Math.round(r/ks)+&quot;s&quot;:r+&quot;ms&quot;}function ase(r){var e=Math.abs(r);return e&gt;=Ki?Hd(r,e,Ki,&quot;day&quot;):e&gt;=Vs?Hd(r,e,Vs,&quot;hour&quot;):e&gt;=Bs?Hd(r,e,Bs,&quot;minute&quot;):e&gt;=ks?Hd(r,e,ks,&quot;second&quot;):r+&quot; ms&quot;}function Hd(r,e,t,o){var s=e&gt;=t*1.5;return Math.round(r/t)+&quot; &quot;+o+(s?&quot;s&quot;:&quot;&quot;)}});var _g=T((YUe,d2)=&gt;{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=&gt;{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_&lt;u.length;_++)f=(f&lt;&lt;5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!=&quot;string&quot;&amp;&amp;A.unshift(&quot;%O&quot;);let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=&gt;{if(B===&quot;%%&quot;)return&quot;%&quot;;N++;let te=t.formatters[G];if(typeof te==&quot;function&quot;){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,&quot;enabled&quot;,{enumerable:!0,configurable:!1,get:()=&gt;_!==null?_:(m!==t.namespaces&amp;&amp;(m=t.namespaces,O=t.enabled(u)),O),set:A=&gt;{_=A}}),typeof t.init==&quot;function&quot;&amp;&amp;t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f&gt;&quot;u&quot;?&quot;:&quot;:f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u==&quot;string&quot;?u:&quot;&quot;).trim().replace(/\s+/g,&quot;,&quot;).split(&quot;,&quot;).filter(Boolean);for(let _ of f)_[0]===&quot;-&quot;?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_&lt;u.length;)if(m&lt;f.length&amp;&amp;(f[m]===u[_]||f[m]===&quot;*&quot;))f[m]===&quot;*&quot;?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m&lt;f.length&amp;&amp;f[m]===&quot;*&quot;;)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=&gt;&quot;-&quot;+f)].join(&quot;,&quot;);return t.enable(&quot;&quot;),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;)}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=&gt;{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=&gt;{let r=!1;return()=&gt;{r||(r=!0,console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;))}})();Nt.colors=[&quot;#0000CC&quot;,&quot;#0000FF&quot;,&quot;#0033CC&quot;,&quot;#0033FF&quot;,&quot;#0066CC&quot;,&quot;#0066FF&quot;,&quot;#0099CC&quot;,&quot;#0099FF&quot;,&quot;#00CC00&quot;,&quot;#00CC33&quot;,&quot;#00CC66&quot;,&quot;#00CC99&quot;,&quot;#00CCCC&quot;,&quot;#00CCFF&quot;,&quot;#3300CC&quot;,&quot;#3300FF&quot;,&quot;#3333CC&quot;,&quot;#3333FF&quot;,&quot;#3366CC&quot;,&quot;#3366FF&quot;,&quot;#3399CC&quot;,&quot;#3399FF&quot;,&quot;#33CC00&quot;,&quot;#33CC33&quot;,&quot;#33CC66&quot;,&quot;#33CC99&quot;,&quot;#33CCCC&quot;,&quot;#33CCFF&quot;,&quot;#6600CC&quot;,&quot;#6600FF&quot;,&quot;#6633CC&quot;,&quot;#6633FF&quot;,&quot;#66CC00&quot;,&quot;#66CC33&quot;,&quot;#9900CC&quot;,&quot;#9900FF&quot;,&quot;#9933CC&quot;,&quot;#9933FF&quot;,&quot;#99CC00&quot;,&quot;#99CC33&quot;,&quot;#CC0000&quot;,&quot;#CC0033&quot;,&quot;#CC0066&quot;,&quot;#CC0099&quot;,&quot;#CC00CC&quot;,&quot;#CC00FF&quot;,&quot;#CC3300&quot;,&quot;#CC3333&quot;,&quot;#CC3366&quot;,&quot;#CC3399&quot;,&quot;#CC33CC&quot;,&quot;#CC33FF&quot;,&quot;#CC6600&quot;,&quot;#CC6633&quot;,&quot;#CC9900&quot;,&quot;#CC9933&quot;,&quot;#CCCC00&quot;,&quot;#CCCC33&quot;,&quot;#FF0000&quot;,&quot;#FF0033&quot;,&quot;#FF0066&quot;,&quot;#FF0099&quot;,&quot;#FF00CC&quot;,&quot;#FF00FF&quot;,&quot;#FF3300&quot;,&quot;#FF3333&quot;,&quot;#FF3366&quot;,&quot;#FF3399&quot;,&quot;#FF33CC&quot;,&quot;#FF33FF&quot;,&quot;#FF6600&quot;,&quot;#FF6633&quot;,&quot;#FF9900&quot;,&quot;#FF9933&quot;,&quot;#FFCC00&quot;,&quot;#FFCC33&quot;];function cse(){if(typeof window&lt;&quot;u&quot;&amp;&amp;window.process&amp;&amp;(window.process.type===&quot;renderer&quot;||window.process.__nwjs))return!0;if(typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document&lt;&quot;u&quot;&amp;&amp;document.documentElement&amp;&amp;document.documentElement.style&amp;&amp;document.documentElement.style.WebkitAppearance||typeof window&lt;&quot;u&quot;&amp;&amp;window.console&amp;&amp;(window.console.firebug||window.console.exception&amp;&amp;window.console.table)||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&amp;&amp;parseInt(r[1],10)&gt;=31||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?&quot;%c&quot;:&quot;&quot;)+this.namespace+(this.useColors?&quot; %c&quot;:&quot; &quot;)+r[0]+(this.useColors?&quot;%c &quot;:&quot; &quot;)+&quot;+&quot;+qd.exports.humanize(this.diff),!this.useColors)return;let e=&quot;color: &quot;+this.color;r.splice(1,0,e,&quot;color: inherit&quot;);let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=&gt;{s!==&quot;%%&quot;&amp;&amp;(t++,s===&quot;%c&quot;&amp;&amp;(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=&gt;{});function fse(r){try{r?Nt.storage.setItem(&quot;debug&quot;,r):Nt.storage.removeItem(&quot;debug&quot;)}catch{}}function pse(){let r;try{r=Nt.storage.getItem(&quot;debug&quot;)||Nt.storage.getItem(&quot;DEBUG&quot;)}catch{}return!r&amp;&amp;typeof process&lt;&quot;u&quot;&amp;&amp;&quot;env&quot;in process&amp;&amp;(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return&quot;[UnexpectedJSONParseError]: &quot;+e.message}}});var E2=T((zUe,_2)=&gt;{&quot;use strict&quot;;_2.exports=(r,e=process.argv)=&gt;{let t=r.startsWith(&quot;-&quot;)?&quot;&quot;:r.length===1?&quot;-&quot;:&quot;--&quot;,o=e.indexOf(t+r),s=e.indexOf(&quot;--&quot;);return o!==-1&amp;&amp;(s===-1||o&lt;s)}});var S2=T((KUe,T2)=&gt;{&quot;use strict&quot;;var _se=V(&quot;os&quot;),m2=V(&quot;tty&quot;),Zt=E2(),{env:Ze}=process,zn;Zt(&quot;no-color&quot;)||Zt(&quot;no-colors&quot;)||Zt(&quot;color=false&quot;)||Zt(&quot;color=never&quot;)?zn=0:(Zt(&quot;color&quot;)||Zt(&quot;colors&quot;)||Zt(&quot;color=true&quot;)||Zt(&quot;color=always&quot;))&amp;&amp;(zn=1);&quot;FORCE_COLOR&quot;in Ze&amp;&amp;(Ze.FORCE_COLOR===&quot;true&quot;?zn=1:Ze.FORCE_COLOR===&quot;false&quot;?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r&gt;=2,has16m:r&gt;=3}}function mg(r,e){if(zn===0)return 0;if(Zt(&quot;color=16m&quot;)||Zt(&quot;color=full&quot;)||Zt(&quot;color=truecolor&quot;))return 3;if(Zt(&quot;color=256&quot;))return 2;if(r&amp;&amp;!e&amp;&amp;zn===void 0)return 0;let t=zn||0;if(Ze.TERM===&quot;dumb&quot;)return t;if(process.platform===&quot;win32&quot;){let o=_se.release().split(&quot;.&quot;);return Number(o[0])&gt;=10&amp;&amp;Number(o[2])&gt;=10586?Number(o[2])&gt;=14931?3:2:1}if(&quot;CI&quot;in Ze)return[&quot;TRAVIS&quot;,&quot;CIRCLECI&quot;,&quot;APPVEYOR&quot;,&quot;GITLAB_CI&quot;,&quot;GITHUB_ACTIONS&quot;,&quot;BUILDKITE&quot;].some(o=&gt;o in Ze)||Ze.CI_NAME===&quot;codeship&quot;?1:t;if(&quot;TEAMCITY_VERSION&quot;in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM===&quot;truecolor&quot;)return 3;if(&quot;TERM_PROGRAM&quot;in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||&quot;&quot;).split(&quot;.&quot;)[0],10);switch(Ze.TERM_PROGRAM){case&quot;iTerm.app&quot;:return o&gt;=3?3:2;case&quot;Apple_Terminal&quot;:return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||&quot;COLORTERM&quot;in Ze?1:t}function Ese(r){let e=mg(r,r&amp;&amp;r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=&gt;{var mse=V(&quot;tty&quot;),jd=V(&quot;util&quot;);et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=&gt;{},&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;);et.colors=[6,2,3,4,5,1];try{let r=S2();r&amp;&amp;(r.stderr||r).level&gt;=2&amp;&amp;(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=&gt;/^debug_/i.test(r)).reduce((r,e)=&gt;{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=&gt;a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o===&quot;null&quot;?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return&quot;colors&quot;in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s=&quot;\x1B[3&quot;+(o&lt;8?o:&quot;8;5;&quot;+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+&quot;m+&quot;+Yd.exports.humanize(this.diff)+&quot;\x1B[0m&quot;)}else r[0]=gse()+e+&quot; &quot;+r[0]}function gse(){return et.inspectOpts.hideDate?&quot;&quot;:new Date().toISOString()+&quot; &quot;}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t&lt;e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=&gt;e.trim()).join(&quot; &quot;)};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=&gt;{typeof process&gt;&quot;u&quot;||process.type===&quot;renderer&quot;||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=&gt;{&quot;use strict&quot;;var Sg=V(&quot;path&quot;).sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf(&quot;node_modules&quot;);if(t!==-1&amp;&amp;e[t+1]){for(var o=e[t+1][0]===&quot;@&quot;,s=o?e[t+1]+&quot;/&quot;+e[t+2]:e[t+1],a=o?3:2,i=&quot;&quot;,n=t+a-1,l=0;l&lt;=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c=&quot;&quot;,u=e.length-1,f=t+a;f&lt;=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=&gt;{&quot;use strict&quot;;var Rse=V(&quot;os&quot;);A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform===&quot;win32&quot;?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform===&quot;darwin&quot;?e||(t?&quot;/Users/&quot;+t:null):process.platform===&quot;linux&quot;?e||(process.getuid()===0?&quot;/root&quot;:t?&quot;/home/&quot;+t:null):e||null}});var yg=T((JUe,R2)=&gt;{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=&gt;{&quot;use strict&quot;;var Nse=process.platform===&quot;win32&quot;,Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=&gt;{var I2=V(&quot;path&quot;),C2=I2.parse||N2(),P2=function(e,t){var o=&quot;/&quot;;/^([A-Za-z]:)/.test(e)?o=&quot;&quot;:/^\\\\/.test(e)&amp;&amp;(o=&quot;\\\\&quot;);for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&amp;&amp;t.moduleDirectory?[].concat(t.moduleDirectory):[&quot;node_modules&quot;];if(t&amp;&amp;typeof t.paths==&quot;function&quot;)return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&amp;&amp;t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=&gt;{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=&gt;{&quot;use strict&quot;;var Lse=&quot;Function.prototype.bind called on incompatible &quot;,xse=Object.prototype.toString,Mse=Math.max,wse=&quot;[object Function]&quot;,x2=function(e,t){for(var o=[],s=0;s&lt;e.length;s+=1)o[s]=e[s];for(var a=0;a&lt;t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s&lt;e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t=&quot;&quot;,o=0;o&lt;r.length;o+=1)t+=r[o],o+1&lt;r.length&amp;&amp;(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!=&quot;function&quot;||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l&lt;i;l++)n[l]=&quot;$&quot;+l;if(s=Function(&quot;binder&quot;,&quot;return function (&quot;+Use(n,&quot;,&quot;)+&quot;){ return binder.apply(this,arguments); }&quot;)(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=&gt;{&quot;use strict&quot;;var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=&gt;{&quot;use strict&quot;;var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=&gt;{Gse.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:[&quot;&gt;= 22.13 &amp;&amp; &lt; 23&quot;,&quot;&gt;= 23.4&quot;],_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var sc=T((oke,H2)=&gt;{&quot;use strict&quot;;var Hse=B2();function qse(r,e){for(var t=r.split(&quot;.&quot;),o=e.split(&quot; &quot;),s=o.length&gt;1?o[0]:&quot;=&quot;,a=(o.length&gt;1?o[1]:o[0]).split(&quot;.&quot;),i=0;i&lt;3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s===&quot;&lt;&quot;?n&lt;l:s===&quot;&gt;=&quot;?n&gt;=l:!1}return s===&quot;&gt;=&quot;}function F2(r,e){var t=e.split(/ ?&amp;&amp; ?/);if(t.length===0)return!1;for(var o=0;o&lt;t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e==&quot;boolean&quot;)return e;var t=typeof r&gt;&quot;u&quot;?process.versions&amp;&amp;process.versions.node:r;if(typeof t!=&quot;string&quot;)throw new TypeError(typeof r&gt;&quot;u&quot;?&quot;Unable to determine current node version&quot;:&quot;If provided, a valid node version is required&quot;);if(e&amp;&amp;typeof e==&quot;object&quot;){for(var o=0;o&lt;e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&amp;&amp;jse(t,G2[e])}});var Y2=T((ske,j2)=&gt;{var $i=V(&quot;fs&quot;),Yse=vg(),ze=V(&quot;path&quot;),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!==&quot;win32&quot;&amp;&amp;$i.realpath&amp;&amp;typeof $i.realpath.native==&quot;function&quot;?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,&quot;.node_modules&quot;),ze.join(q2,&quot;.node_libraries&quot;)]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&amp;&amp;o.code!==&quot;ENOENT&quot;?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&amp;&amp;o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a&lt;s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t==&quot;function&quot;&amp;&amp;(s=a,a={}),typeof e!=&quot;string&quot;){var i=new TypeError(&quot;Path must be a string.&quot;);return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&amp;&amp;a.readPackage){var _=new TypeError(&quot;`readFile` and `readPackage` are mutually exclusive.&quot;);return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[&quot;.js&quot;],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(F+=&quot;/&quot;),/\/$/.test(e)&amp;&amp;F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&amp;&amp;Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);C.code=&quot;MODULE_NOT_FOUND&quot;,s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);Y.code=&quot;MODULE_NOT_FOUND&quot;,s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E==&quot;function&quot;&amp;&amp;(C=E,E=void 0);var Q=[&quot;&quot;].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&amp;&amp;Te&amp;&amp;a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([&quot;&quot;].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===&quot;&quot;||v===&quot;/&quot;||process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,&quot;package.json&quot;);n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&amp;&amp;W(J);var Ne=ce;Ne&amp;&amp;a.packageFilter&amp;&amp;(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C==&quot;function&quot;&amp;&amp;(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,&quot;package.json&quot;);n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,&quot;index&quot;),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&amp;&amp;a.packageFilter&amp;&amp;(Z=a.packageFilter(Z,J)),Z&amp;&amp;Z.main){if(typeof Z.main!=&quot;string&quot;){var je=new TypeError(&quot;package \u201C&quot;+Z.name+&quot;\u201D `main` must be a string&quot;);return je.code=&quot;INVALID_PACKAGE_MAIN&quot;,E(je)}(Z.main===&quot;.&quot;||Z.main===&quot;./&quot;)&amp;&amp;(Z.main=&quot;index&quot;),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,&quot;index&quot;),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,&quot;index&quot;),Ye,E)})});return}B(ze.join(v,&quot;/index&quot;),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=&gt;{nae.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:&quot;&gt;= 23.4&quot;,_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var W2=T((lke,X2)=&gt;{&quot;use strict&quot;;var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&amp;&amp;($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=&gt;{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=&gt;{var sae=sc(),Xi=V(&quot;fs&quot;),dt=V(&quot;path&quot;),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!==&quot;win32&quot;&amp;&amp;Xi.realpathSync&amp;&amp;typeof Xi.realpathSync.native==&quot;function&quot;?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,&quot;.node_modules&quot;),dt.join(Z2,&quot;.node_libraries&quot;)]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!==&quot;ENOENT&quot;)throw t}return e},lc=function(e,t,o){return o&amp;&amp;o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a&lt;s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Path must be a string.&quot;);var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&amp;&amp;o.readPackageSync)throw new TypeError(&quot;`readFileSync` and `readPackageSync` are mutually exclusive.&quot;);var c=o.packageIterator,u=o.extensions||[&quot;.js&quot;],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(y+=&quot;/&quot;);var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&amp;&amp;sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+m+&quot;&#x27;&quot;);throw M.code=&quot;MODULE_NOT_FOUND&quot;,M;function F(G){var te=N(dt.dirname(G));if(te&amp;&amp;te.dir&amp;&amp;te.pkg&amp;&amp;o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&amp;&amp;(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v&lt;u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===&quot;&quot;||G===&quot;/&quot;)&amp;&amp;!(process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(G))&amp;&amp;!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),&quot;package.json&quot;);if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),&quot;/package.json&quot;);if(s(te)){try{var $=l(a,te)}catch{}if($&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),$&amp;&amp;$.main){if(typeof $.main!=&quot;string&quot;){var le=new TypeError(&quot;package \u201C&quot;+$.name+&quot;\u201D `main` must be a string&quot;);throw le.code=&quot;INVALID_PACKAGE_MAIN&quot;,le}($.main===&quot;.&quot;||$.main===&quot;./&quot;)&amp;&amp;($.main=&quot;index&quot;);try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,&quot;/index&quot;))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v&lt;le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=&gt;{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=&gt;{Tae.exports={name:&quot;require-in-the-middle&quot;,version:&quot;7.5.2&quot;,description:&quot;Module to hook into the Node.js require function&quot;,main:&quot;index.js&quot;,types:&quot;types/index.d.ts&quot;,dependencies:{debug:&quot;^4.3.5&quot;,&quot;module-details-from-path&quot;:&quot;^1.0.3&quot;,resolve:&quot;^1.22.8&quot;},devDependencies:{&quot;@babel/core&quot;:&quot;^7.9.0&quot;,&quot;@babel/preset-env&quot;:&quot;^7.9.5&quot;,&quot;@babel/preset-typescript&quot;:&quot;^7.9.0&quot;,&quot;@babel/register&quot;:&quot;^7.9.0&quot;,&quot;ipp-printer&quot;:&quot;^1.0.0&quot;,patterns:&quot;^1.0.3&quot;,roundround:&quot;^0.2.0&quot;,semver:&quot;^6.3.0&quot;,standard:&quot;^14.3.1&quot;,tape:&quot;^4.11.0&quot;},scripts:{test:&quot;npm run test:lint &amp;&amp; npm run test:tape &amp;&amp; npm run test:babel&quot;,&quot;test:lint&quot;:&quot;standard&quot;,&quot;test:tape&quot;:&quot;tape test/*.js&quot;,&quot;test:babel&quot;:&quot;node test/babel/babel-register.js&quot;},repository:{type:&quot;git&quot;,url:&quot;git+https://github.com/nodejs/require-in-the-middle.git&quot;},keywords:[&quot;require&quot;,&quot;hook&quot;,&quot;shim&quot;,&quot;shimmer&quot;,&quot;shimming&quot;,&quot;patch&quot;,&quot;monkey&quot;,&quot;monkeypatch&quot;,&quot;module&quot;,&quot;load&quot;],files:[&quot;types&quot;],author:&quot;Thomas Watson Steen &lt;w@tson.dk&gt; (https://twitter.com/wa7son)&quot;,license:&quot;MIT&quot;,bugs:{url:&quot;https://github.com/nodejs/require-in-the-middle/issues&quot;},homepage:&quot;https://github.com/nodejs/require-in-the-middle#readme&quot;,engines:{node:&quot;&gt;=8.6.0&quot;}}});var Lg=T((dke,bg)=&gt;{&quot;use strict&quot;;var Gs=V(&quot;path&quot;),_r=V(&quot;module&quot;),Fe=y2()(&quot;require-in-the-middle&quot;),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=&gt;r.startsWith(&quot;node:&quot;)?!0:(Pg===void 0&amp;&amp;(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(&quot;.&quot;).map(Number);e===8&amp;&amp;t&lt;8?Fs=o=&gt;o===&quot;http2&quot;?!0:!!r.core[o]:Fs=o=&gt;!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&amp;&amp;V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol(&quot;RitmExports&quot;)}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&amp;&amp;this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&amp;&amp;s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe(&#x27;non-core module is unexpectedly not in require.cache: &quot;%s&quot;&#x27;,e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null),typeof _r._resolveFilename!=&quot;function&quot;){console.error(&quot;Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!&quot;,typeof _r._resolveFilename),console.error(&quot;Please report this error as an issue related to Node.js %s at %s&quot;,process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe(&quot;registering require hook&quot;),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe(&quot;ignoring require call - module is soft-unhooked&quot;),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule==&quot;function&quot;&amp;&amp;(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe(&quot;ignoring process.getBuiltinModule call - module is soft-unhooked&quot;),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith(&quot;node:&quot;)){let M=u.slice(5);Fs(M)&amp;&amp;(_=M)}}else{if(c)return Fe(&quot;call to process.getBuiltinModule with unknown built-in id&quot;),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe(&#x27;Module._resolveFilename(&quot;%s&quot;) threw %j, calling original Module.require&#x27;,u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe(&quot;processing %s module require(&#x27;%s&#x27;): %s&quot;,f===!0?&quot;core&quot;:&quot;non-core&quot;,u,_),o._cache.has(_,f)===!0)return Fe(&quot;returning already patched cached module: %s&quot;,_),o._cache.get(_,f);let y=s.has(_);y===!1&amp;&amp;s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe(&quot;module is in the process of being patched already - ignoring: %s&quot;,_),A;if(s.delete(_),f===!0){if(i===!0&amp;&amp;r.includes(_)===!1)return Fe(&quot;ignoring core module not on whitelist: %s&quot;,_),A;m=_}else if(i===!0&amp;&amp;r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe(&quot;could not parse filename: %s&quot;,_),A;m=M.name,O=M.basedir;let F=yae(M);Fe(&quot;resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)&quot;,m,u,F,O);let N=!1;if(i){if(!u.startsWith(&quot;.&quot;)&amp;&amp;r.includes(u)&amp;&amp;(m=u,N=!0),!r.includes(m)&amp;&amp;!r.includes(F))return A;r.includes(F)&amp;&amp;F!==m&amp;&amp;(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe(&quot;could not resolve module: %s&quot;,m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe(&quot;preparing to process require of internal file: %s&quot;,m);else return Fe(&quot;ignoring require of non-main module file: %s&quot;,z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe(&quot;calling require hook: %s&quot;,m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe(&quot;returning module: %s&quot;,m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe(&quot;require unhook successful&quot;)):Fe(&quot;require unhook unsuccessful&quot;),process.getBuiltinModule!==void 0&amp;&amp;(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe(&quot;process.getBuiltinModule unhook successful&quot;)):Fe(&quot;process.getBuiltinModule unhook unsuccessful&quot;))};function yae(r){let e=Gs.sep!==&quot;/&quot;?r.path.split(Gs.sep).join(&quot;/&quot;):r.path;return Gs.posix.join(r.name,e).replace(vae,&quot;&quot;)}});var Xd,Wd,iF=p(()=&gt;{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split(&quot;/&quot;)){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split(&quot;/&quot;)){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&amp;&amp;i&amp;&amp;a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&amp;&amp;a.sort((n,l)=&gt;n.insertedId-l.insertedId),a.map(({hook:n})=&gt;n))}}});import*as xg from&quot;path&quot;;function Aae(r){return xg.sep!==&quot;/&quot;?r.split(xg.sep).join(&quot;/&quot;):r}var sF,Oae,Jd,aF=p(()=&gt;{sF=Nn(Lg());iF();Oae=[&quot;afterEach&quot;,&quot;after&quot;,&quot;beforeEach&quot;,&quot;before&quot;,&quot;describe&quot;,&quot;it&quot;].every(r=&gt;typeof global[r]==&quot;function&quot;),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=&gt;{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&amp;&amp;e!==void 0?e:new r}}});var dF=T(Wi=&gt;{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return&quot;Module&quot;;let t=cF.get(r)[e];if(typeof t==&quot;function&quot;)return t()},defineProperty(r,e,t){if(!(&quot;value&quot;in t))throw new Error(&quot;Getters/setters are not supported for exports property descriptors.&quot;);return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=&gt;i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=&gt;{var hF=V(&quot;path&quot;),Iae=gg(),{fileURLToPath:_F}=V(&quot;url&quot;),{MessageChannel:bae}=V(&quot;worker_threads&quot;),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=&gt;r(e,t))}function TF(r){let e=wg.indexOf(r);e&gt;-1&amp;&amp;wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&amp;&amp;s!==e&amp;&amp;(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=&gt;{t++,r.postMessage(n)},r.on(&quot;message&quot;,()=&gt;{t--,o&amp;&amp;t&lt;=0&amp;&amp;o()}).unref();function s(){let n=setInterval(()=&gt;{},1e3),l=new Promise(c=&gt;{o=c}).then(()=&gt;{clearInterval(n)});return t===0&amp;&amp;o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null);let o=e?e.internals===!0:!1;Dg&amp;&amp;Array.isArray(r)&amp;&amp;Dg(r),this._iitmHook=(s,a)=&gt;{let i=s,n=s.startsWith(&quot;node:&quot;),l;if(n)s=s.replace(/^node:/,&quot;&quot;);else{if(s.startsWith(&quot;file://&quot;))try{s=_F(s)}catch{}let c=Iae(s);c&amp;&amp;(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&amp;&amp;!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}function Qd(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Ug=p(()=&gt;{});import*as hn from&quot;path&quot;;import{types as yF}from&quot;util&quot;;import{readFileSync as Dae}from&quot;fs&quot;;function OF(r,e,t){return typeof e&gt;&quot;u&quot;?r.includes(&quot;*&quot;):r.some(o=&gt;(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=&gt;{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=&gt;{if(Qd(a[i])&amp;&amp;this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=&gt;yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(l=&gt;{i.forEach(c=&gt;{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(n=&gt;{i.forEach(l=&gt;{this._unwrap(n,l)})})};let s=this.init();s&amp;&amp;!Array.isArray(s)&amp;&amp;(s=[s]),this._modules=s||[],this._config.enabled&amp;&amp;this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=&gt;{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&amp;&amp;this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,&quot;package.json&quot;),{encoding:&quot;utf8&quot;}),o=JSON.parse(t).version;return typeof o==&quot;string&quot;?o:void 0}catch{S.warn(&quot;Failed extracting version&quot;,e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for nodejs core module on require hook&quot;,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&amp;&amp;typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for module on require hook&quot;,{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&amp;&amp;a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=&gt;u.name===l).filter(u=&gt;OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=&gt;(f.moduleExports=u,this._enabled?(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on require hook&quot;,{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length&gt;0){for(let e of this._modules){typeof e.patch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=&gt;{if(!l&amp;&amp;hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=&gt;this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module file on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from&quot;path&quot;;var PF=p(()=&gt;{});var IF=p(()=&gt;{CF();PF()});var kg=p(()=&gt;{IF()});var eh,bF=p(()=&gt;{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=&gt;{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=&gt;qs,InstrumentationNodeModuleDefinition:()=&gt;eh,InstrumentationNodeModuleFile:()=&gt;th,isWrapped:()=&gt;Qd,registerInstrumentations:()=&gt;o2,safeExecuteInTheMiddle:()=&gt;gF,safeExecuteInTheMiddleAsync:()=&gt;vF});var MF=p(()=&gt;{s2();kg();bF();LF();Ug()});var Br,wF=p(()=&gt;{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=&gt;{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name=&quot;OTLPExporterError&quot;,a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&amp;&amp;Number.isFinite(r)&amp;&amp;r&gt;0)return r;throw new Error(&quot;Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: &#x27;&quot;+r+&quot;&#x27;)&quot;)}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&amp;&amp;o!==void 0?o:e.timeoutMillis)!==null&amp;&amp;s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&amp;&amp;a!==void 0?a:e.concurrencyLimit)!==null&amp;&amp;i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&amp;&amp;n!==void 0?n:e.compression)!==null&amp;&amp;l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:&quot;none&quot;}}var pc=p(()=&gt;{});var sh,DF=p(()=&gt;{(function(r){r.NONE=&quot;none&quot;,r.GZIP=&quot;gzip&quot;})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=&gt;{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error(&quot;Concurrency Limit reached&quot;);this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length&gt;=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function BF(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Vg(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Vg(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var FF=p(()=&gt;{P()});var Er,GF=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Er||(Er={}))});var dc,Fg=p(()=&gt;{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,&quot;partialSuccess&quot;)}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn(&quot;Received Partial Success response:&quot;,JSON.stringify(r.partialSuccess))}}}var qF=p(()=&gt;{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=&gt;{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:&quot;OTLPExportDelegate&quot;})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug(&quot;items to be sent&quot;,e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error(&quot;Concurrent export limit reached&quot;)});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error(&quot;Nothing to send&quot;)});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status===&quot;success&quot;){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn(&quot;Export succeeded but could not deserialize response - is the response specification compliant?&quot;,i,a.data)}t({code:Er.SUCCESS});return}else if(a.status===&quot;failure&quot;&amp;&amp;a.error){t({code:Er.FAILED,error:a.error});return}else a.status===&quot;retryable&quot;?t({code:Er.FAILED,error:new Ji(&quot;Export failed with retryable status&quot;)}):t({code:Er.FAILED,error:new Ji(&quot;Export failed with unknown error&quot;)})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug(&quot;shutdown started&quot;),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=&gt;{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=&gt;sh,OTLPExporterBase:()=&gt;Br,OTLPExporterError:()=&gt;Ji,createOtlpNetworkExportDelegate:()=&gt;jF,getSharedConfigurationDefaults:()=&gt;oh,mergeOtlpSharedConfigurationWithDefaults:()=&gt;ih});var _n=p(()=&gt;{wF();rh();pc();DF();YF()});function zF(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var KF=p(()=&gt;{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=&gt;{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=&gt;{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=&gt;{XF();Xae=typeof BigInt&lt;&quot;u&quot;?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=&gt;{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]=&quot;SPAN_KIND_UNSPECIFIED&quot;,r[r.SPAN_KIND_INTERNAL=1]=&quot;SPAN_KIND_INTERNAL&quot;,r[r.SPAN_KIND_SERVER=2]=&quot;SPAN_KIND_SERVER&quot;,r[r.SPAN_KIND_CLIENT=3]=&quot;SPAN_KIND_CLIENT&quot;,r[r.SPAN_KIND_PRODUCER=4]=&quot;SPAN_KIND_PRODUCER&quot;,r[r.SPAN_KIND_CONSUMER=5]=&quot;SPAN_KIND_CONSUMER&quot;})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;ph(t,o))}}:{}}var Ys=p(()=&gt;{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=&gt;{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=&gt;{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=&gt;{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=&gt;({scope:js(t.scope),metrics:t.metrics.map(o=&gt;rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=&gt;nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=&gt;{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=&gt;rG(t,e))}}var Eh=p(()=&gt;{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a=&quot;&quot;,schemaUrl:i=&quot;&quot;}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=&gt;({resource:zs(o),scopeLogs:Array.from(s,([,a])=&gt;({scope:js(a[0].instrumentationScope),logRecords:a.map(i=&gt;cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}var mh=p(()=&gt;{Ec();Ys();hh()});var Yg=T((sVe,iG)=&gt;{&quot;use strict&quot;;iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s&lt;arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&amp;&amp;(a=!1,l(c))}})}});var lG=T(aG=&gt;{&quot;use strict&quot;;var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4&gt;1&amp;&amp;e.charAt(t)===&quot;=&quot;;)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr&lt;64;)sG[Ws[mr]=mr&lt;26?mr+65:mr&lt;52?mr+71:mr&lt;62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t&lt;o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c&gt;&gt;2],l=(c&amp;3)&lt;&lt;4,n=1;break;case 1:a[i++]=Ws[l|c&gt;&gt;4],l=(c&amp;15)&lt;&lt;2,n=2;break;case 2:a[i++]=Ws[l|c&gt;&gt;6],a[i++]=Ws[c&amp;63],n=0;break}i&gt;8191&amp;&amp;((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&amp;&amp;(a[i++]=Ws[l],a[i++]=61,n===1&amp;&amp;(a[i++]=61)),s?(i&amp;&amp;s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join(&quot;&quot;)):String.fromCharCode.apply(String,a.slice(0,i))};var oG=&quot;invalid encoding&quot;;Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n&lt;e.length;){var l=e.charCodeAt(n++);if(l===61&amp;&amp;a&gt;1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i&lt;&lt;2|(l&amp;48)&gt;&gt;4,i=l,a=2;break;case 2:t[o++]=(i&amp;15)&lt;&lt;4|(l&amp;60)&gt;&gt;2,i=l,a=3;break;case 3:t[o++]=(i&amp;3)&lt;&lt;6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=&gt;{&quot;use strict&quot;;cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s&lt;o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s&lt;arguments.length;)o.push(arguments[s++]);for(s=0;s&lt;t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=&gt;{&quot;use strict&quot;;EG.exports=fG(fG);function fG(r){return typeof Float32Array&lt;&quot;u&quot;?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s&lt;0?1:0;if(n&amp;&amp;(s=-s),s===0)o(1/s&gt;0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s&gt;34028234663852886e22)o((n&lt;&lt;31|2139095040)&gt;&gt;&gt;0,a,i);else if(s&lt;11754943508222875e-54)o((n&lt;&lt;31|Math.round(s/1401298464324817e-60))&gt;&gt;&gt;0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&amp;8388607;o((n&lt;&lt;31|l+127&lt;&lt;23|c)&gt;&gt;&gt;0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i&gt;&gt;31)*2+1,l=i&gt;&gt;&gt;23&amp;255,c=i&amp;8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array&lt;&quot;u&quot;?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i&lt;0?1:0;if(c&amp;&amp;(i=-i),i===0)o(0,n,l+s),o(1/i&gt;0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i&gt;17976931348623157e292)o(0,n,l+s),o((c&lt;&lt;31|2146435072)&gt;&gt;&gt;0,n,l+a);else{var u;if(i&lt;22250738585072014e-324)u=i/5e-324,o(u&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|u/4294967296)&gt;&gt;&gt;0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&amp;&amp;(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|f+1023&lt;&lt;20|u*1048576&amp;1048575)&gt;&gt;&gt;0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c&gt;&gt;31)*2+1,f=c&gt;&gt;&gt;20&amp;2047,_=4294967296*(c&amp;1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}function dG(r,e,t){e[t]=r&gt;&gt;&gt;24,e[t+1]=r&gt;&gt;&gt;16&amp;255,e[t+2]=r&gt;&gt;&gt;8&amp;255,e[t+3]=r&amp;255}function hG(r,e){return(r[e]|r[e+1]&lt;&lt;8|r[e+2]&lt;&lt;16|r[e+3]&lt;&lt;24)&gt;&gt;&gt;0}function _G(r,e){return(r[e]&lt;&lt;24|r[e+1]&lt;&lt;16|r[e+2]&lt;&lt;8|r[e+3])&gt;&gt;&gt;0}});var zg=T((exports,module)=&gt;{&quot;use strict&quot;;module.exports=inquire;function inquire(moduleName){try{var mod=eval(&quot;quire&quot;.replace(/^/,&quot;re&quot;))(moduleName);if(mod&amp;&amp;(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=&gt;{&quot;use strict&quot;;var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s&lt;e.length;++s)o=e.charCodeAt(s),o&lt;128?t+=1:o&lt;2048?t+=2:(o&amp;64512)===55296&amp;&amp;(e.charCodeAt(s+1)&amp;64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s&lt;1)return&quot;&quot;;for(var a=null,i=[],n=0,l;t&lt;o;)l=e[t++],l&lt;128?i[n++]=l:l&gt;191&amp;&amp;l&lt;224?i[n++]=(l&amp;31)&lt;&lt;6|e[t++]&amp;63:l&gt;239&amp;&amp;l&lt;365?(l=((l&amp;7)&lt;&lt;18|(e[t++]&amp;63)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63)-65536,i[n++]=55296+(l&gt;&gt;10),i[n++]=56320+(l&amp;1023)):i[n++]=(l&amp;15)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63,n&gt;8191&amp;&amp;((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&amp;&amp;a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join(&quot;&quot;)):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n&lt;e.length;++n)a=e.charCodeAt(n),a&lt;128?t[o++]=a:a&lt;2048?(t[o++]=a&gt;&gt;6|192,t[o++]=a&amp;63|128):(a&amp;64512)===55296&amp;&amp;((i=e.charCodeAt(n+1))&amp;64512)===56320?(a=65536+((a&amp;1023)&lt;&lt;10)+(i&amp;1023),++n,t[o++]=a&gt;&gt;18|240,t[o++]=a&gt;&gt;12&amp;63|128,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128):(t[o++]=a&gt;&gt;12|224,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128);return o-s}});var vG=T((fVe,gG)=&gt;{&quot;use strict&quot;;gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o&gt;&gt;&gt;1,a=null,i=o;return function(l){if(l&lt;1||l&gt;s)return r(l);i+l&gt;o&amp;&amp;(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&amp;7&amp;&amp;(i=(i|7)+1),c}}});var OG=T((pVe,yG)=&gt;{&quot;use strict&quot;;yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r&gt;&gt;&gt;0,this.hi=e&gt;&gt;&gt;0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash=&quot;\0\0\0\0\0\0\0\0&quot;;tt.fromNumber=function(e){if(e===0)return Qi;var t=e&lt;0;t&amp;&amp;(e=-e);var o=e&gt;&gt;&gt;0,s=(e-o)/4294967296&gt;&gt;&gt;0;return t&amp;&amp;(s=~s&gt;&gt;&gt;0,o=~o&gt;&gt;&gt;0,++o&gt;4294967295&amp;&amp;(o=0,++s&gt;4294967295&amp;&amp;(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e==&quot;number&quot;)return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low&gt;&gt;&gt;0,e.high&gt;&gt;&gt;0):Qi};tt.prototype.toNumber=function(e){if(!e&amp;&amp;this.hi&gt;&gt;&gt;31){var t=~this.lo+1&gt;&gt;&gt;0,o=~this.hi&gt;&gt;&gt;0;return t||(o=o+1&gt;&gt;&gt;0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)&lt;&lt;8|$n.call(e,2)&lt;&lt;16|$n.call(e,3)&lt;&lt;24)&gt;&gt;&gt;0,($n.call(e,4)|$n.call(e,5)&lt;&lt;8|$n.call(e,6)&lt;&lt;16|$n.call(e,7)&lt;&lt;24)&gt;&gt;&gt;0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&amp;255,this.lo&gt;&gt;&gt;8&amp;255,this.lo&gt;&gt;&gt;16&amp;255,this.lo&gt;&gt;&gt;24,this.hi&amp;255,this.hi&gt;&gt;&gt;8&amp;255,this.hi&gt;&gt;&gt;16&amp;255,this.hi&gt;&gt;&gt;24)};tt.prototype.zzEncode=function(){var e=this.hi&gt;&gt;31;return this.hi=((this.hi&lt;&lt;1|this.lo&gt;&gt;&gt;31)^e)&gt;&gt;&gt;0,this.lo=(this.lo&lt;&lt;1^e)&gt;&gt;&gt;0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&amp;1);return this.lo=((this.lo&gt;&gt;&gt;1|this.hi&lt;&lt;31)^e)&gt;&gt;&gt;0,this.hi=(this.hi&gt;&gt;&gt;1^e)&gt;&gt;&gt;0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo&gt;&gt;&gt;28|this.hi&lt;&lt;4)&gt;&gt;&gt;0,o=this.hi&gt;&gt;&gt;24;return o===0?t===0?e&lt;16384?e&lt;128?1:2:e&lt;2097152?3:4:t&lt;16384?t&lt;128?5:6:t&lt;2097152?7:8:o&lt;128?9:10}});var Fr=T($g=&gt;{&quot;use strict&quot;;var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global&lt;&quot;u&quot;&amp;&amp;global&amp;&amp;global.process&amp;&amp;global.process.versions&amp;&amp;global.process.versions.node);K.global=K.isNode&amp;&amp;global||typeof window&lt;&quot;u&quot;&amp;&amp;window||typeof self&lt;&quot;u&quot;&amp;&amp;self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e==&quot;number&quot;&amp;&amp;isFinite(e)&amp;&amp;Math.floor(e)===e};K.isString=function(e){return typeof e==&quot;string&quot;||e instanceof String};K.isObject=function(e){return e&amp;&amp;typeof e==&quot;object&quot;};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&amp;&amp;e.hasOwnProperty(t)?typeof o!=&quot;object&quot;||(Array.isArray(o)?o.length:Object.keys(o).length)&gt;0:!1};K.Buffer=(function(){try{var r=K.inquire(&quot;buffer&quot;).Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e==&quot;number&quot;?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array&gt;&quot;u&quot;?e:new Uint8Array(e)};K.Array=typeof Uint8Array&lt;&quot;u&quot;?Uint8Array:Array;K.Long=K.global.dcodeIO&amp;&amp;K.global.dcodeIO.Long||K.global.Long||K.inquire(&quot;long&quot;);K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s&lt;o.length;++s)(r[o[s]]===void 0||!t)&amp;&amp;(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,&quot;message&quot;,{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,&quot;stack&quot;,{value:new Error().stack||&quot;&quot;}),o&amp;&amp;AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+&quot;: &quot;+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG(&quot;ProtocolError&quot;);K.oneOfGetter=function(e){for(var t={},o=0;o&lt;e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a&gt;-1;--a)if(t[s[a]]===1&amp;&amp;this[s[a]]!==void 0&amp;&amp;this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o&lt;e.length;++o)e[o]!==t&amp;&amp;delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&amp;&amp;r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=&gt;{&quot;use strict&quot;;IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&amp;&amp;(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&amp;255}function _le(r,e,t){for(;r&gt;127;)e[t++]=r&amp;127|128,r&gt;&gt;&gt;=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e&gt;&gt;&gt;0)&lt;128?1:e&lt;16384?2:e&lt;2097152?3:e&lt;268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e&lt;0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e&lt;&lt;1^e&gt;&gt;31)&gt;&gt;&gt;0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&amp;127|128,r.lo=(r.lo&gt;&gt;&gt;7|r.hi&lt;&lt;25)&gt;&gt;&gt;0,r.hi&gt;&gt;&gt;=7;for(;r.lo&gt;127;)e[t++]=r.lo&amp;127|128,r.lo=r.lo&gt;&gt;&gt;7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e&gt;&gt;&gt;0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s&lt;e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length&gt;&gt;&gt;0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&amp;&amp;(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=&gt;{&quot;use strict&quot;;LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&amp;&amp;Xn.Buffer.prototype instanceof Uint8Array&amp;&amp;Xn.Buffer.prototype.set.name===&quot;set&quot;?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s&lt;e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&amp;&amp;(e=Xn._Buffer_from(e,&quot;base64&quot;));var t=e.length&gt;&gt;&gt;0;return this.uint32(t),t&amp;&amp;this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length&lt;40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&amp;&amp;this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=&gt;{&quot;use strict&quot;;kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError(&quot;index out of range: &quot;+r.pos+&quot; + &quot;+(e||1)+&quot; &gt; &quot;+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array&lt;&quot;u&quot;?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)}:function(e){if(Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&amp;127)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;14)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;21)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;15)&lt;&lt;28)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128))return e;if((this.pos+=5)&gt;this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e&gt;&gt;&gt;1^-(e&amp;1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos&gt;4){for(;e&lt;4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;28)&gt;&gt;&gt;0,r.hi=(r.hi|(this.buf[this.pos]&amp;127)&gt;&gt;4)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;e=0}else{for(;e&lt;3;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,r}if(this.len-this.pos&gt;4){for(;e&lt;5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}else for(;e&lt;5;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}throw Error(&quot;invalid varint encoding&quot;)}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]&lt;&lt;8|r[e-2]&lt;&lt;16|r[e-1]&lt;&lt;24)&gt;&gt;&gt;0}Ge.prototype.fixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8&gt;this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8&gt;this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o&gt;this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e==&quot;number&quot;){if(this.pos+e&gt;this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos&gt;=this.len)throw Sr(this);while(this.buf[this.pos++]&amp;128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&amp;7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error(&quot;invalid wire type &quot;+r+&quot; at offset &quot;+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?&quot;toLong&quot;:&quot;toNumber&quot;;Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=&gt;{&quot;use strict&quot;;FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&amp;&amp;(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(&quot;utf-8&quot;,this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=&gt;{&quot;use strict&quot;;HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!=&quot;function&quot;)throw TypeError(&quot;rpcImpl must be a function&quot;);nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError(&quot;request must be specified&quot;);var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error(&quot;already ended&quot;))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?&quot;encodeDelimited&quot;:&quot;encode&quot;](s).finish(),function(l,c){if(l)return i.emit(&quot;error&quot;,l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?&quot;decodeDelimited&quot;:&quot;decode&quot;](c)}catch(u){return i.emit(&quot;error&quot;,u,e),a(u)}return i.emit(&quot;data&quot;,c,e),a(null,c)})}catch(n){i.emit(&quot;error&quot;,n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&amp;&amp;(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(&quot;end&quot;).off()),this}});var iv=T(jG=&gt;{&quot;use strict&quot;;var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=&gt;{&quot;use strict&quot;;YG.exports={}});var sv=T(KG=&gt;{&quot;use strict&quot;;var Ct=KG;Ct.build=&quot;minimal&quot;;Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=&gt;{&quot;use strict&quot;;$G.exports=sv()});var JG=T((OVe,WG)=&gt;{&quot;use strict&quot;;var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;intValue&quot;,&quot;doubleValue&quot;,&quot;arrayValue&quot;,&quot;kvlistValue&quot;,&quot;bytesValue&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;stringValue&quot;)&amp;&amp;l.uint32(10).string(n.stringValue),n.boolValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;boolValue&quot;)&amp;&amp;l.uint32(16).bool(n.boolValue),n.intValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;intValue&quot;)&amp;&amp;l.uint32(24).int64(n.intValue),n.doubleValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;doubleValue&quot;)&amp;&amp;l.uint32(33).double(n.doubleValue),n.arrayValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;arrayValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;kvlistValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;bytesValue&quot;)&amp;&amp;l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(l.value=1,!h.isString(n.stringValue)))return&quot;stringValue: string expected&quot;;if(n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.boolValue!=&quot;boolean&quot;)return&quot;boolValue: boolean expected&quot;}if(n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.intValue)&amp;&amp;!(n.intValue&amp;&amp;h.isInteger(n.intValue.low)&amp;&amp;h.isInteger(n.intValue.high)))return&quot;intValue: integer|Long expected&quot;}if(n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.doubleValue!=&quot;number&quot;)return&quot;doubleValue: number expected&quot;}if(n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return&quot;arrayValue.&quot;+c}}if(n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return&quot;kvlistValue.&quot;+c}}if(n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!(n.bytesValue&amp;&amp;typeof n.bytesValue.length==&quot;number&quot;||h.isString(n.bytesValue)))return&quot;bytesValue: buffer expected&quot;}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&amp;&amp;(l.stringValue=String(n.stringValue)),n.boolValue!=null&amp;&amp;(l.boolValue=!!n.boolValue),n.intValue!=null&amp;&amp;(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue==&quot;string&quot;?l.intValue=parseInt(n.intValue,10):typeof n.intValue==&quot;number&quot;?l.intValue=n.intValue:typeof n.intValue==&quot;object&quot;&amp;&amp;(l.intValue=new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber())),n.doubleValue!=null&amp;&amp;(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected&quot;);l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected&quot;);l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&amp;&amp;(typeof n.bytesValue==&quot;string&quot;?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length&gt;=0&amp;&amp;(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(c.stringValue=n.stringValue,l.oneofs&amp;&amp;(c.value=&quot;stringValue&quot;)),n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)&amp;&amp;(c.boolValue=n.boolValue,l.oneofs&amp;&amp;(c.value=&quot;boolValue&quot;)),n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)&amp;&amp;(typeof n.intValue==&quot;number&quot;?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber():n.intValue,l.oneofs&amp;&amp;(c.value=&quot;intValue&quot;)),n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)&amp;&amp;(c.doubleValue=l.json&amp;&amp;!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&amp;&amp;(c.value=&quot;doubleValue&quot;)),n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)&amp;&amp;(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&amp;&amp;(c.value=&quot;arrayValue&quot;)),n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)&amp;&amp;(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&amp;&amp;(c.value=&quot;kvlistValue&quot;)),n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)&amp;&amp;(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&amp;&amp;(c.value=&quot;bytesValue&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.common.v1.AnyValue&quot;},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.ArrayValue&quot;},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValueList&quot;},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;key&quot;)&amp;&amp;n.uint32(10).string(i.key),i.value!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;value&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;!h.isString(i.key))return&quot;key: string expected&quot;;if(i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return&quot;value.&quot;+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&amp;&amp;(n.key=String(i.key)),i.value!=null){if(typeof i.value!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValue.value: object expected&quot;);n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.key=&quot;&quot;,l.value=null),i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;(l.key=i.key),i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)&amp;&amp;(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValue&quot;},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(10).string(i.name),i.version!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;version&quot;)&amp;&amp;n.uint32(18).string(i.version),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;!h.isString(i.version))return&quot;version: string expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&amp;&amp;(n.name=String(i.name)),i.version!=null&amp;&amp;(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.name=&quot;&quot;,l.version=&quot;&quot;,l.droppedAttributesCount=0),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;(l.version=i.version),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.InstrumentationScope&quot;},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.droppedAttributesCount=0),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.resource.v1.Resource&quot;},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&amp;&amp;i.resourceSpans.length)for(var l=0;l&lt;i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceSpans&amp;&amp;c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceSpans!=null&amp;&amp;i.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(i.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var n=0;n&lt;i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return&quot;resourceSpans.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected&quot;);n.resourceSpans=[];for(var l=0;l&lt;i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected&quot;);n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceSpans=[]),i.resourceSpans&amp;&amp;i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c&lt;i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.TracesData&quot;},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&amp;&amp;i.scopeSpans.length)for(var l=0;l&lt;i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&amp;&amp;c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeSpans!=null&amp;&amp;i.hasOwnProperty(&quot;scopeSpans&quot;)){if(!Array.isArray(i.scopeSpans))return&quot;scopeSpans: array expected&quot;;for(var l=0;l&lt;i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return&quot;scopeSpans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected&quot;);n.scopeSpans=[];for(var l=0;l&lt;i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected&quot;);n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeSpans=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&amp;&amp;i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c&lt;i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ResourceSpans&quot;},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&amp;&amp;i.spans.length)for(var l=0;l&lt;i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&amp;&amp;c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.spans!=null&amp;&amp;i.hasOwnProperty(&quot;spans&quot;)){if(!Array.isArray(i.spans))return&quot;spans: array expected&quot;;for(var l=0;l&lt;i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return&quot;spans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected&quot;);n.spans=[];for(var l=0;l&lt;i.spans.length;++l){if(typeof i.spans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected&quot;);n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.spans=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&amp;&amp;i.spans.length){l.spans=[];for(var c=0;c&lt;i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ScopeSpans&quot;},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(10).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(18).bytes(i.spanId),i.traceState!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceState&quot;)&amp;&amp;n.uint32(26).string(i.traceState),i.parentSpanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;parentSpanId&quot;)&amp;&amp;n.uint32(34).bytes(i.parentSpanId),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(42).string(i.name),i.kind!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;kind&quot;)&amp;&amp;n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;endTimeUnixNano&quot;)&amp;&amp;n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&amp;&amp;i.events.length)for(var l=0;l&lt;i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedEventsCount&quot;)&amp;&amp;n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&amp;&amp;i.links.length)for(var l=0;l&lt;i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedLinksCount&quot;)&amp;&amp;n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;status&quot;)&amp;&amp;d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&amp;&amp;c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&amp;&amp;c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId)))return&quot;traceId: buffer expected&quot;;if(i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId)))return&quot;spanId: buffer expected&quot;;if(i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(i.traceState))return&quot;traceState: string expected&quot;;if(i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;!(i.parentSpanId&amp;&amp;typeof i.parentSpanId.length==&quot;number&quot;||h.isString(i.parentSpanId)))return&quot;parentSpanId: buffer expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;))switch(i.kind){default:return&quot;kind: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.endTimeUnixNano)&amp;&amp;!(i.endTimeUnixNano&amp;&amp;h.isInteger(i.endTimeUnixNano.low)&amp;&amp;h.isInteger(i.endTimeUnixNano.high)))return&quot;endTimeUnixNano: integer|Long expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount))return&quot;droppedAttributesCount: integer expected&quot;;if(i.events!=null&amp;&amp;i.hasOwnProperty(&quot;events&quot;)){if(!Array.isArray(i.events))return&quot;events: array expected&quot;;for(var n=0;n&lt;i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return&quot;events.&quot;+l}}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;!h.isInteger(i.droppedEventsCount))return&quot;droppedEventsCount: integer expected&quot;;if(i.links!=null&amp;&amp;i.hasOwnProperty(&quot;links&quot;)){if(!Array.isArray(i.links))return&quot;links: array expected&quot;;for(var n=0;n&lt;i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return&quot;links.&quot;+l}}if(i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;!h.isInteger(i.droppedLinksCount))return&quot;droppedLinksCount: integer expected&quot;;if(i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return&quot;status.&quot;+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),i.traceState!=null&amp;&amp;(n.traceState=String(i.traceState)),i.parentSpanId!=null&amp;&amp;(typeof i.parentSpanId==&quot;string&quot;?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length&gt;=0&amp;&amp;(n.parentSpanId=i.parentSpanId)),i.name!=null&amp;&amp;(n.name=String(i.name)),i.kind){default:if(typeof i.kind==&quot;number&quot;){n.kind=i.kind;break}break;case&quot;SPAN_KIND_UNSPECIFIED&quot;:case 0:n.kind=0;break;case&quot;SPAN_KIND_INTERNAL&quot;:case 1:n.kind=1;break;case&quot;SPAN_KIND_SERVER&quot;:case 2:n.kind=2;break;case&quot;SPAN_KIND_CLIENT&quot;:case 3:n.kind=3;break;case&quot;SPAN_KIND_PRODUCER&quot;:case 4:n.kind=4;break;case&quot;SPAN_KIND_CONSUMER&quot;:case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.endTimeUnixNano!=null&amp;&amp;(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano==&quot;string&quot;?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano==&quot;number&quot;?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano==&quot;object&quot;&amp;&amp;(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.events){if(!Array.isArray(i.events))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: array expected&quot;);n.events=[];for(var l=0;l&lt;i.events.length;++l){if(typeof i.events[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: object expected&quot;);n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&amp;&amp;(n.droppedEventsCount=i.droppedEventsCount&gt;&gt;&gt;0),i.links){if(!Array.isArray(i.links))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: array expected&quot;);n.links=[];for(var l=0;l&lt;i.links.length;++l){if(typeof i.links[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: object expected&quot;);n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&amp;&amp;(n.droppedLinksCount=i.droppedLinksCount&gt;&gt;&gt;0),i.status!=null){if(typeof i.status!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.status: object expected&quot;);n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),l.traceState=&quot;&quot;,n.bytes===String?l.parentSpanId=&quot;&quot;:(l.parentSpanId=[],n.bytes!==Array&amp;&amp;(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name=&quot;&quot;,l.kind=n.enums===String?&quot;SPAN_KIND_UNSPECIFIED&quot;:0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?&quot;0&quot;:0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(l.traceState=i.traceState),i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;)&amp;&amp;(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;(typeof i.endTimeUnixNano==&quot;number&quot;?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.endTimeUnixNano),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.events&amp;&amp;i.events.length){l.events=[];for(var u=0;u&lt;i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;(l.droppedEventsCount=i.droppedEventsCount),i.links&amp;&amp;i.links.length){l.links=[];for(var u=0;u&lt;i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)&amp;&amp;(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Span&quot;},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;SPAN_KIND_UNSPECIFIED&quot;]=0,i[a[1]=&quot;SPAN_KIND_INTERNAL&quot;]=1,i[a[2]=&quot;SPAN_KIND_SERVER&quot;]=2,i[a[3]=&quot;SPAN_KIND_CLIENT&quot;]=3,i[a[4]=&quot;SPAN_KIND_PRODUCER&quot;]=4,i[a[5]=&quot;SPAN_KIND_CONSUMER&quot;]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(18).string(n.name),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.name!=null&amp;&amp;(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.name=&quot;&quot;,c.droppedAttributesCount=0}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Event&quot;},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(10).bytes(n.traceId),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(18).bytes(n.spanId),n.traceState!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceState&quot;)&amp;&amp;l.uint32(26).string(n.traceState),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId)))return&quot;traceId: buffer expected&quot;;if(n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId)))return&quot;spanId: buffer expected&quot;;if(n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(n.traceState))return&quot;traceState: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceState!=null&amp;&amp;(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults&amp;&amp;(l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),c.traceState=&quot;&quot;,c.droppedAttributesCount=0),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(c.traceState=n.traceState),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var u=0;u&lt;n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Link&quot;},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;message&quot;)&amp;&amp;n.uint32(18).string(i.message),i.code!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;code&quot;)&amp;&amp;n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;!h.isString(i.message))return&quot;message: string expected&quot;;if(i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;))switch(i.code){default:return&quot;code: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&amp;&amp;(n.message=String(i.message)),i.code){default:if(typeof i.code==&quot;number&quot;){n.code=i.code;break}break;case&quot;STATUS_CODE_UNSET&quot;:case 0:n.code=0;break;case&quot;STATUS_CODE_OK&quot;:case 1:n.code=1;break;case&quot;STATUS_CODE_ERROR&quot;:case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.message=&quot;&quot;,l.code=n.enums===String?&quot;STATUS_CODE_UNSET&quot;:0),i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;(l.message=i.message),i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;)&amp;&amp;(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Status&quot;},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;STATUS_CODE_UNSET&quot;]=0,i[a[1]=&quot;STATUS_CODE_OK&quot;]=1,i[a[2]=&quot;STATUS_CODE_ERROR&quot;]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&amp;&amp;n.resourceSpans.length)for(var c=0;c&lt;n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceSpans&amp;&amp;u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceSpans!=null&amp;&amp;n.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(n.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var l=0;l&lt;n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return&quot;resourceSpans.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected&quot;);l.resourceSpans=[];for(var c=0;c&lt;n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected&quot;);l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceSpans=[]),n.resourceSpans&amp;&amp;n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u&lt;n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest&quot;},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse&quot;},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedSpans&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;!h.isInteger(n.rejectedSpans)&amp;&amp;!(n.rejectedSpans&amp;&amp;h.isInteger(n.rejectedSpans.low)&amp;&amp;h.isInteger(n.rejectedSpans.high))?&quot;rejectedSpans: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&amp;&amp;(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans==&quot;string&quot;?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans==&quot;number&quot;?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans==&quot;object&quot;&amp;&amp;(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;(typeof n.rejectedSpans==&quot;number&quot;?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber():n.rejectedSpans),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess&quot;},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&amp;&amp;n.resourceMetrics.length)for(var c=0;c&lt;n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceMetrics&amp;&amp;u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceMetrics!=null&amp;&amp;n.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(n.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var l=0;l&lt;n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return&quot;resourceMetrics.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected&quot;);l.resourceMetrics=[];for(var c=0;c&lt;n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected&quot;);l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceMetrics=[]),n.resourceMetrics&amp;&amp;n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u&lt;n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest&quot;},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse&quot;},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedDataPoints&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;!h.isInteger(n.rejectedDataPoints)&amp;&amp;!(n.rejectedDataPoints&amp;&amp;h.isInteger(n.rejectedDataPoints.low)&amp;&amp;h.isInteger(n.rejectedDataPoints.high))?&quot;rejectedDataPoints: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&amp;&amp;(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints==&quot;string&quot;?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints==&quot;number&quot;?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints==&quot;object&quot;&amp;&amp;(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;(typeof n.rejectedDataPoints==&quot;number&quot;?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess&quot;},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&amp;&amp;n.resourceLogs.length)for(var c=0;c&lt;n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceLogs&amp;&amp;u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceLogs!=null&amp;&amp;n.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(n.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var l=0;l&lt;n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return&quot;resourceLogs.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected&quot;);l.resourceLogs=[];for(var c=0;c&lt;n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected&quot;);l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceLogs=[]),n.resourceLogs&amp;&amp;n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u&lt;n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest&quot;},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse&quot;},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedLogRecords&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;!h.isInteger(n.rejectedLogRecords)&amp;&amp;!(n.rejectedLogRecords&amp;&amp;h.isInteger(n.rejectedLogRecords.low)&amp;&amp;h.isInteger(n.rejectedLogRecords.high))?&quot;rejectedLogRecords: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&amp;&amp;(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords==&quot;string&quot;?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords==&quot;number&quot;?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords==&quot;object&quot;&amp;&amp;(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;(typeof n.rejectedLogRecords==&quot;number&quot;?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess&quot;},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&amp;&amp;i.resourceMetrics.length)for(var l=0;l&lt;i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceMetrics&amp;&amp;c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(i.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var n=0;n&lt;i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return&quot;resourceMetrics.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected&quot;);n.resourceMetrics=[];for(var l=0;l&lt;i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected&quot;);n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceMetrics=[]),i.resourceMetrics&amp;&amp;i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c&lt;i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.MetricsData&quot;},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&amp;&amp;i.scopeMetrics.length)for(var l=0;l&lt;i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&amp;&amp;c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;scopeMetrics&quot;)){if(!Array.isArray(i.scopeMetrics))return&quot;scopeMetrics: array expected&quot;;for(var l=0;l&lt;i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return&quot;scopeMetrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected&quot;);n.scopeMetrics=[];for(var l=0;l&lt;i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected&quot;);n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeMetrics=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&amp;&amp;i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c&lt;i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ResourceMetrics&quot;},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&amp;&amp;i.metrics.length)for(var l=0;l&lt;i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&amp;&amp;c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.metrics!=null&amp;&amp;i.hasOwnProperty(&quot;metrics&quot;)){if(!Array.isArray(i.metrics))return&quot;metrics: array expected&quot;;for(var l=0;l&lt;i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return&quot;metrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected&quot;);n.metrics=[];for(var l=0;l&lt;i.metrics.length;++l){if(typeof i.metrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected&quot;);n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.metrics=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&amp;&amp;i.metrics.length){l.metrics=[];for(var c=0;c&lt;i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ScopeMetrics&quot;},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,&quot;data&quot;,{get:h.oneOfGetter(a=[&quot;gauge&quot;,&quot;sum&quot;,&quot;histogram&quot;,&quot;exponentialHistogram&quot;,&quot;summary&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(10).string(n.name),n.description!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;description&quot;)&amp;&amp;l.uint32(18).string(n.description),n.unit!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;unit&quot;)&amp;&amp;l.uint32(26).string(n.unit),n.gauge!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;gauge&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;histogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;exponentialHistogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;summary&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;!h.isString(n.description))return&quot;description: string expected&quot;;if(n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;!h.isString(n.unit))return&quot;unit: string expected&quot;;if(n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return&quot;gauge.&quot;+c}}if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return&quot;sum.&quot;+c}}if(n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return&quot;histogram.&quot;+c}}if(n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return&quot;exponentialHistogram.&quot;+c}}if(n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return&quot;summary.&quot;+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&amp;&amp;(l.name=String(n.name)),n.description!=null&amp;&amp;(l.description=String(n.description)),n.unit!=null&amp;&amp;(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.gauge: object expected&quot;);l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.sum: object expected&quot;);l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.histogram: object expected&quot;);l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected&quot;);l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.summary: object expected&quot;);l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.name=&quot;&quot;,c.description=&quot;&quot;,c.unit=&quot;&quot;),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;(c.description=n.description),n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;(c.unit=n.unit),n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)&amp;&amp;(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&amp;&amp;(c.data=&quot;gauge&quot;)),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&amp;&amp;(c.data=&quot;sum&quot;)),n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)&amp;&amp;(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&amp;&amp;(c.data=&quot;histogram&quot;)),n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)&amp;&amp;(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&amp;&amp;(c.data=&quot;exponentialHistogram&quot;)),n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)&amp;&amp;(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&amp;&amp;(c.data=&quot;summary&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Metric&quot;},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Gauge&quot;},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;isMonotonic&quot;)&amp;&amp;n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;typeof i.isMonotonic!=&quot;boolean&quot;?&quot;isMonotonic: boolean expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&amp;&amp;(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0,l.isMonotonic=!1),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Sum&quot;},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Histogram&quot;},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogram&quot;},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Summary&quot;},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;]=0,a[s[1]=&quot;AGGREGATION_TEMPORALITY_DELTA&quot;]=1,a[s[2]=&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;DATA_POINT_FLAGS_DO_NOT_USE&quot;]=0,a[s[1]=&quot;DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK&quot;]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(33).double(n.asDouble),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.NumberDataPoint&quot;},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.bucketCounts!=null&amp;&amp;n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c&lt;n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&amp;&amp;n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c&lt;n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(89).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 9:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&amp;&amp;u.bucketCounts.length||(u.bucketCounts=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&amp;&amp;u.explicitBounds.length||(u.explicitBounds=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.bucketCounts!=null&amp;&amp;n.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(n.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&amp;&amp;!(n.bucketCounts[c]&amp;&amp;h.isInteger(n.bucketCounts[c].low)&amp;&amp;h.isInteger(n.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}if(n.explicitBounds!=null&amp;&amp;n.hasOwnProperty(&quot;explicitBounds&quot;)){if(!Array.isArray(n.explicitBounds))return&quot;explicitBounds: array expected&quot;;for(var c=0;c&lt;n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!=&quot;number&quot;)return&quot;explicitBounds: number[] expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected&quot;);l.bucketCounts=[];for(var c=0;c&lt;n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]==&quot;string&quot;?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]==&quot;number&quot;?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]==&quot;object&quot;&amp;&amp;(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low&gt;&gt;&gt;0,n.bucketCounts[c].high&gt;&gt;&gt;0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected&quot;);l.explicitBounds=[];for(var c=0;c&lt;n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.bucketCounts&amp;&amp;n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f&lt;n.bucketCounts.length;++f)typeof n.bucketCounts[f]==&quot;number&quot;?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low&gt;&gt;&gt;0,n.bucketCounts[f].high&gt;&gt;&gt;0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&amp;&amp;n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f&lt;n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&amp;&amp;!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.HistogramDataPoint&quot;},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.scale!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;scale&quot;)&amp;&amp;l.uint32(48).sint32(n.scale),n.zeroCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroCount&quot;)&amp;&amp;l.uint32(57).fixed64(n.zeroCount),n.positive!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;positive&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;negative&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(97).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(105).double(n.max),n.zeroThreshold!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroThreshold&quot;)&amp;&amp;l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;!h.isInteger(n.scale))return&quot;scale: integer expected&quot;;if(n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;!h.isInteger(n.zeroCount)&amp;&amp;!(n.zeroCount&amp;&amp;h.isInteger(n.zeroCount.low)&amp;&amp;h.isInteger(n.zeroCount.high)))return&quot;zeroCount: integer|Long expected&quot;;if(n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return&quot;positive.&quot;+u}if(n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return&quot;negative.&quot;+u}if(n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags))return&quot;flags: integer expected&quot;;if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;typeof n.zeroThreshold!=&quot;number&quot;?&quot;zeroThreshold: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.scale!=null&amp;&amp;(l.scale=n.scale|0),n.zeroCount!=null&amp;&amp;(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount==&quot;string&quot;?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount==&quot;number&quot;?l.zeroCount=n.zeroCount:typeof n.zeroCount==&quot;object&quot;&amp;&amp;(l.zeroCount=new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber())),n.positive!=null){if(typeof n.positive!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected&quot;);l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected&quot;);l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),n.zeroThreshold!=null&amp;&amp;(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?&quot;0&quot;:0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;(c.scale=n.scale),n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;(typeof n.zeroCount==&quot;number&quot;?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber():n.zeroCount),n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)&amp;&amp;(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)&amp;&amp;(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;(c.zeroThreshold=l.json&amp;&amp;!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint&quot;},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c&lt;l.length;++c)n[l[c]]!=null&amp;&amp;(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&amp;&amp;Object.hasOwnProperty.call(l,&quot;offset&quot;)&amp;&amp;c.uint32(8).sint32(l.offset),l.bucketCounts!=null&amp;&amp;l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u&lt;l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos&lt;u;){var _=l.uint32();switch(_&gt;&gt;&gt;3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&amp;&amp;f.bucketCounts.length||(f.bucketCounts=[]),(_&amp;7)===2)for(var m=l.uint32()+l.pos;l.pos&lt;m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&amp;7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!=&quot;object&quot;||l===null)return&quot;object expected&quot;;if(l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;!h.isInteger(l.offset))return&quot;offset: integer expected&quot;;if(l.bucketCounts!=null&amp;&amp;l.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(l.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&amp;&amp;!(l.bucketCounts[c]&amp;&amp;h.isInteger(l.bucketCounts[c].low)&amp;&amp;h.isInteger(l.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&amp;&amp;(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected&quot;);c.bucketCounts=[];for(var u=0;u&lt;l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]==&quot;string&quot;?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]==&quot;number&quot;?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]==&quot;object&quot;&amp;&amp;(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low&gt;&gt;&gt;0,l.bucketCounts[u].high&gt;&gt;&gt;0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&amp;&amp;(u.bucketCounts=[]),c.defaults&amp;&amp;(u.offset=0),l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;(u.offset=l.offset),l.bucketCounts&amp;&amp;l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f&lt;l.bucketCounts.length;++f)typeof l.bucketCounts[f]==&quot;number&quot;?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low&gt;&gt;&gt;0,l.bucketCounts[f].high&gt;&gt;&gt;0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&amp;&amp;(l=&quot;type.googleapis.com&quot;),l+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets&quot;},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;count&quot;)&amp;&amp;n.uint32(33).fixed64(i.count),i.sum!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;sum&quot;)&amp;&amp;n.uint32(41).double(i.sum),i.quantileValues!=null&amp;&amp;i.quantileValues.length)for(var l=0;l&lt;i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 7:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&amp;&amp;c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(i.count)&amp;&amp;!(i.count&amp;&amp;h.isInteger(i.count.low)&amp;&amp;h.isInteger(i.count.high)))return&quot;count: integer|Long expected&quot;;if(i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;typeof i.sum!=&quot;number&quot;)return&quot;sum: number expected&quot;;if(i.quantileValues!=null&amp;&amp;i.hasOwnProperty(&quot;quantileValues&quot;)){if(!Array.isArray(i.quantileValues))return&quot;quantileValues: array expected&quot;;for(var n=0;n&lt;i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return&quot;quantileValues.&quot;+l}}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.count!=null&amp;&amp;(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count==&quot;string&quot;?n.count=parseInt(i.count,10):typeof i.count==&quot;number&quot;?n.count=i.count:typeof i.count==&quot;object&quot;&amp;&amp;(n.count=new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber())),i.sum!=null&amp;&amp;(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected&quot;);n.quantileValues=[];for(var l=0;l&lt;i.quantileValues.length;++l){if(typeof i.quantileValues[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected&quot;);n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?&quot;0&quot;:0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof i.count==&quot;number&quot;?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber():i.count),i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l.sum=n.json&amp;&amp;!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&amp;&amp;i.quantileValues.length){l.quantileValues=[];for(var u=0;u&lt;i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint&quot;},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;quantile&quot;)&amp;&amp;l.uint32(9).double(n.quantile),n.value!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;value&quot;)&amp;&amp;l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;typeof n.quantile!=&quot;number&quot;?&quot;quantile: number expected&quot;:n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;typeof n.value!=&quot;number&quot;?&quot;value: number expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&amp;&amp;(l.quantile=Number(n.quantile)),n.value!=null&amp;&amp;(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.quantile=0,c.value=0),n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;(c.quantile=l.json&amp;&amp;!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;(c.value=l.json&amp;&amp;!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile&quot;},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(25).double(n.asDouble),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(34).bytes(n.spanId),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(42).bytes(n.traceId),n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&amp;&amp;n.filteredAttributes.length)for(var c=0;c&lt;n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.filteredAttributes&amp;&amp;u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.filteredAttributes!=null&amp;&amp;n.hasOwnProperty(&quot;filteredAttributes&quot;)){if(!Array.isArray(n.filteredAttributes))return&quot;filteredAttributes: array expected&quot;;for(var c=0;c&lt;n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return&quot;filteredAttributes.&quot;+u}}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}return n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId))?&quot;spanId: buffer expected&quot;:n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId))?&quot;traceId: buffer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected&quot;);l.filteredAttributes=[];for(var c=0;c&lt;n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected&quot;);l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.filteredAttributes&amp;&amp;n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f&lt;n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Exemplar&quot;},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&amp;&amp;i.resourceLogs.length)for(var l=0;l&lt;i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceLogs&amp;&amp;c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceLogs!=null&amp;&amp;i.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(i.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var n=0;n&lt;i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return&quot;resourceLogs.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected&quot;);n.resourceLogs=[];for(var l=0;l&lt;i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected&quot;);n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceLogs=[]),i.resourceLogs&amp;&amp;i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c&lt;i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogsData&quot;},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&amp;&amp;i.scopeLogs.length)for(var l=0;l&lt;i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&amp;&amp;c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeLogs!=null&amp;&amp;i.hasOwnProperty(&quot;scopeLogs&quot;)){if(!Array.isArray(i.scopeLogs))return&quot;scopeLogs: array expected&quot;;for(var l=0;l&lt;i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return&quot;scopeLogs.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected&quot;);n.scopeLogs=[];for(var l=0;l&lt;i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected&quot;);n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeLogs=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&amp;&amp;i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c&lt;i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ResourceLogs&quot;},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&amp;&amp;i.logRecords.length)for(var l=0;l&lt;i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&amp;&amp;c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.logRecords!=null&amp;&amp;i.hasOwnProperty(&quot;logRecords&quot;)){if(!Array.isArray(i.logRecords))return&quot;logRecords: array expected&quot;;for(var l=0;l&lt;i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return&quot;logRecords.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected&quot;);n.logRecords=[];for(var l=0;l&lt;i.logRecords.length;++l){if(typeof i.logRecords[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected&quot;);n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.logRecords=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&amp;&amp;i.logRecords.length){l.logRecords=[];for(var c=0;c&lt;i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ScopeLogs&quot;},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;]=0,a[s[1]=&quot;SEVERITY_NUMBER_TRACE&quot;]=1,a[s[2]=&quot;SEVERITY_NUMBER_TRACE2&quot;]=2,a[s[3]=&quot;SEVERITY_NUMBER_TRACE3&quot;]=3,a[s[4]=&quot;SEVERITY_NUMBER_TRACE4&quot;]=4,a[s[5]=&quot;SEVERITY_NUMBER_DEBUG&quot;]=5,a[s[6]=&quot;SEVERITY_NUMBER_DEBUG2&quot;]=6,a[s[7]=&quot;SEVERITY_NUMBER_DEBUG3&quot;]=7,a[s[8]=&quot;SEVERITY_NUMBER_DEBUG4&quot;]=8,a[s[9]=&quot;SEVERITY_NUMBER_INFO&quot;]=9,a[s[10]=&quot;SEVERITY_NUMBER_INFO2&quot;]=10,a[s[11]=&quot;SEVERITY_NUMBER_INFO3&quot;]=11,a[s[12]=&quot;SEVERITY_NUMBER_INFO4&quot;]=12,a[s[13]=&quot;SEVERITY_NUMBER_WARN&quot;]=13,a[s[14]=&quot;SEVERITY_NUMBER_WARN2&quot;]=14,a[s[15]=&quot;SEVERITY_NUMBER_WARN3&quot;]=15,a[s[16]=&quot;SEVERITY_NUMBER_WARN4&quot;]=16,a[s[17]=&quot;SEVERITY_NUMBER_ERROR&quot;]=17,a[s[18]=&quot;SEVERITY_NUMBER_ERROR2&quot;]=18,a[s[19]=&quot;SEVERITY_NUMBER_ERROR3&quot;]=19,a[s[20]=&quot;SEVERITY_NUMBER_ERROR4&quot;]=20,a[s[21]=&quot;SEVERITY_NUMBER_FATAL&quot;]=21,a[s[22]=&quot;SEVERITY_NUMBER_FATAL2&quot;]=22,a[s[23]=&quot;SEVERITY_NUMBER_FATAL3&quot;]=23,a[s[24]=&quot;SEVERITY_NUMBER_FATAL4&quot;]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;LOG_RECORD_FLAGS_DO_NOT_USE&quot;]=0,a[s[255]=&quot;LOG_RECORD_FLAGS_TRACE_FLAGS_MASK&quot;]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityNumber&quot;)&amp;&amp;n.uint32(16).int32(i.severityNumber),i.severityText!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityText&quot;)&amp;&amp;n.uint32(26).string(i.severityText),i.body!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;body&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(69).fixed32(i.flags),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(74).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;observedTimeUnixNano&quot;)&amp;&amp;n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.observedTimeUnixNano)&amp;&amp;!(i.observedTimeUnixNano&amp;&amp;h.isInteger(i.observedTimeUnixNano.low)&amp;&amp;h.isInteger(i.observedTimeUnixNano.high)))return&quot;observedTimeUnixNano: integer|Long expected&quot;;if(i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;))switch(i.severityNumber){default:return&quot;severityNumber: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;!h.isString(i.severityText))return&quot;severityText: string expected&quot;;if(i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return&quot;body.&quot;+n}if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return&quot;attributes.&quot;+n}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId))?&quot;traceId: buffer expected&quot;:i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId))?&quot;spanId: buffer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.observedTimeUnixNano!=null&amp;&amp;(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano==&quot;string&quot;?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano==&quot;number&quot;?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano==&quot;object&quot;&amp;&amp;(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber==&quot;number&quot;){n.severityNumber=i.severityNumber;break}break;case&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:case 0:n.severityNumber=0;break;case&quot;SEVERITY_NUMBER_TRACE&quot;:case 1:n.severityNumber=1;break;case&quot;SEVERITY_NUMBER_TRACE2&quot;:case 2:n.severityNumber=2;break;case&quot;SEVERITY_NUMBER_TRACE3&quot;:case 3:n.severityNumber=3;break;case&quot;SEVERITY_NUMBER_TRACE4&quot;:case 4:n.severityNumber=4;break;case&quot;SEVERITY_NUMBER_DEBUG&quot;:case 5:n.severityNumber=5;break;case&quot;SEVERITY_NUMBER_DEBUG2&quot;:case 6:n.severityNumber=6;break;case&quot;SEVERITY_NUMBER_DEBUG3&quot;:case 7:n.severityNumber=7;break;case&quot;SEVERITY_NUMBER_DEBUG4&quot;:case 8:n.severityNumber=8;break;case&quot;SEVERITY_NUMBER_INFO&quot;:case 9:n.severityNumber=9;break;case&quot;SEVERITY_NUMBER_INFO2&quot;:case 10:n.severityNumber=10;break;case&quot;SEVERITY_NUMBER_INFO3&quot;:case 11:n.severityNumber=11;break;case&quot;SEVERITY_NUMBER_INFO4&quot;:case 12:n.severityNumber=12;break;case&quot;SEVERITY_NUMBER_WARN&quot;:case 13:n.severityNumber=13;break;case&quot;SEVERITY_NUMBER_WARN2&quot;:case 14:n.severityNumber=14;break;case&quot;SEVERITY_NUMBER_WARN3&quot;:case 15:n.severityNumber=15;break;case&quot;SEVERITY_NUMBER_WARN4&quot;:case 16:n.severityNumber=16;break;case&quot;SEVERITY_NUMBER_ERROR&quot;:case 17:n.severityNumber=17;break;case&quot;SEVERITY_NUMBER_ERROR2&quot;:case 18:n.severityNumber=18;break;case&quot;SEVERITY_NUMBER_ERROR3&quot;:case 19:n.severityNumber=19;break;case&quot;SEVERITY_NUMBER_ERROR4&quot;:case 20:n.severityNumber=20;break;case&quot;SEVERITY_NUMBER_FATAL&quot;:case 21:n.severityNumber=21;break;case&quot;SEVERITY_NUMBER_FATAL2&quot;:case 22:n.severityNumber=22;break;case&quot;SEVERITY_NUMBER_FATAL3&quot;:case 23:n.severityNumber=23;break;case&quot;SEVERITY_NUMBER_FATAL4&quot;:case 24:n.severityNumber=24;break}if(i.severityText!=null&amp;&amp;(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.body: object expected&quot;);n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(l.severityNumber=n.enums===String?&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:0,l.severityText=&quot;&quot;,l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?&quot;0&quot;:0}if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;)&amp;&amp;(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;(l.severityText=i.severityText),i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)&amp;&amp;(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;(typeof i.observedTimeUnixNano==&quot;number&quot;?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogRecord&quot;},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=&gt;{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=&gt;{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=&gt;gle.decode(r)},QG={serializeRequest:r=&gt;{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=&gt;yle.decode(r)},Rh={serializeRequest:r=&gt;{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=&gt;Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=&gt;{_h();Eh();mh();Nh={serializeRequest:r=&gt;{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=&gt;{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=&gt;{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=&gt;fh,JsonLogsSerializer:()=&gt;Ch,JsonMetricsSerializer:()=&gt;e3,JsonTraceSerializer:()=&gt;Nh,ProtobufLogsSerializer:()=&gt;Ah,ProtobufMetricsSerializer:()=&gt;QG,ProtobufTraceSerializer:()=&gt;Rh,createExportLogsServiceRequest:()=&gt;Xs,createExportMetricsServiceRequest:()=&gt;$s,createExportTraceServiceRequest:()=&gt;Ks,encodeAsLongBits:()=&gt;uh,encodeAsString:()=&gt;jg,getOtlpEncoder:()=&gt;Kn,hrTimeToNanos:()=&gt;ch,toLongBits:()=&gt;qg});var to=p(()=&gt;{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=&gt;{r3=&quot;0.56.0&quot;});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e&gt;0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t&gt;=0?t:0}}var s3=p(()=&gt;{});var c3={};Ae(c3,{compressAndSend:()=&gt;l3,createHttpAgent:()=&gt;Ile,sendWithHttp:()=&gt;Cle});import*as Ph from&quot;http&quot;;import*as Ih from&quot;https&quot;;import*as a3 from&quot;zlib&quot;;import{Readable as Nle}from&quot;stream&quot;;function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(&quot;.&quot;)[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:&quot;POST&quot;,headers:lv({},r.headers()),agent:e},l=a.protocol===&quot;http:&quot;?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on(&quot;data&quot;,function(m){return _.push(m)}),f.on(&quot;end&quot;,function(){if(f.statusCode&amp;&amp;f.statusCode&lt;299)o({status:&quot;success&quot;,data:Buffer.concat(_)});else if(f.statusCode&amp;&amp;i3(f.statusCode))o({status:&quot;retryable&quot;,retryInMillis:o3(f.headers[&quot;retry-after&quot;])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:&quot;failure&quot;,error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:&quot;failure&quot;,error:new Error(&quot;Request Timeout&quot;)})}),c.on(&quot;error&quot;,function(f){o({status:&quot;failure&quot;,error:f})});var u=i&gt;=14?&quot;close&quot;:&quot;abort&quot;;c.on(u,function(){o({status:&quot;failure&quot;,error:new Error(&quot;Request timed out&quot;)})}),l3(c,r.compression,t,function(f){o({status:&quot;failure&quot;,error:f})})}function l3(r,e,t,o){var s=Ple(t);e===&quot;gzip&quot;&amp;&amp;(r.setHeader(&quot;Content-Encoding&quot;,&quot;gzip&quot;),s=s.on(&quot;error&quot;,o).pipe(a3.createGzip()).on(&quot;error&quot;,o)),s.pipe(r).on(&quot;error&quot;,o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol===&quot;http:&quot;?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=&gt;{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=&gt;{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&amp;&amp;(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=&gt;{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status===&quot;retryable&quot;&amp;&amp;i&gt;0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&amp;&amp;o!==void 0?o:l,u=s-Date.now(),c&gt;u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=&gt;{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&amp;&amp;t!==&quot;&quot;){var o=Number(t);if(!Number.isNaN(o)&amp;&amp;Number.isFinite(o)&amp;&amp;o&gt;0)return o;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected number greater than 0 (actual: &quot;+t+&quot;)&quot;)}}function Gle(r){var e=m3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_TIMEOUT&quot;),t=m3(&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;);return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==&quot;&quot;){if(t==null||t===&quot;none&quot;||t===&quot;gzip&quot;)return t;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected &#x27;none&#x27; or &#x27;gzip&#x27; (actual: &#x27;&quot;+t+&quot;&#x27;)&quot;)}}function Hle(r){var e=T3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_COMPRESSION&quot;),t=T3(&quot;OTEL_EXPORTER_OTLP_COMPRESSION&quot;);return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=&gt;{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&amp;&amp;e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i&lt;&quot;u&quot;?t[a]=String(i):S.warn(&#x27;Header &quot;&#x27;+a+&#x27;&quot; has invalid value (&#x27;+i+&quot;) and will be ignored&quot;)}),t}}var qle,g3=p(()=&gt;{P();qle=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&amp;&amp;Object.assign(s,e()),r!=null&amp;&amp;Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error(&quot;Configuration: Could not parse user-provided export URL: &#x27;&quot;+r+&quot;&#x27;&quot;)}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&amp;&amp;a!==void 0?a:e.agentOptions)!==null&amp;&amp;i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:&quot;http://localhost:4318/&quot;+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=&gt;{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_HEADERS&quot;])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}}function $le(r,e){try{new URL(r)}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}r.endsWith(&quot;/&quot;)||(r=r+&quot;/&quot;),r+=e;try{new URL(r)}catch{S.warn(&quot;Configuration: Provided URL appended with &#x27;&quot;+e+&quot;&#x27; is not a valid URL, using &#x27;undefined&#x27; instead of &#x27;&quot;+r+&quot;&#x27;&quot;);return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return $le(t,r)}function Wle(r){var e,t=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_ENDPOINT&quot;])===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&amp;&amp;t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=&gt;{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&amp;&amp;(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&amp;&amp;(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&amp;&amp;S.warn(&quot;Metadata cannot be set when using http&quot;),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=&gt;{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=&gt;qr,createOtlpHttpExportDelegate:()=&gt;Hr,getSharedConfigurationFromEnvironment:()=&gt;bh});var Js=p(()=&gt;{E3();cv();N3()});var Qs,P3=p(()=&gt;{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${r3}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Ch))}}});var I3=p(()=&gt;{P3()});var b3=p(()=&gt;{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=&gt;Qs});var x3=p(()=&gt;{b3()});var ue=T(tr=&gt;{&quot;use strict&quot;;Object.defineProperty(tr,&quot;__esModule&quot;,{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]=&quot;OK&quot;,r[r.CANCELLED=1]=&quot;CANCELLED&quot;,r[r.UNKNOWN=2]=&quot;UNKNOWN&quot;,r[r.INVALID_ARGUMENT=3]=&quot;INVALID_ARGUMENT&quot;,r[r.DEADLINE_EXCEEDED=4]=&quot;DEADLINE_EXCEEDED&quot;,r[r.NOT_FOUND=5]=&quot;NOT_FOUND&quot;,r[r.ALREADY_EXISTS=6]=&quot;ALREADY_EXISTS&quot;,r[r.PERMISSION_DENIED=7]=&quot;PERMISSION_DENIED&quot;,r[r.RESOURCE_EXHAUSTED=8]=&quot;RESOURCE_EXHAUSTED&quot;,r[r.FAILED_PRECONDITION=9]=&quot;FAILED_PRECONDITION&quot;,r[r.ABORTED=10]=&quot;ABORTED&quot;,r[r.OUT_OF_RANGE=11]=&quot;OUT_OF_RANGE&quot;,r[r.UNIMPLEMENTED=12]=&quot;UNIMPLEMENTED&quot;,r[r.INTERNAL=13]=&quot;INTERNAL&quot;,r[r.UNAVAILABLE=14]=&quot;UNAVAILABLE&quot;,r[r.DATA_LOSS=15]=&quot;DATA_LOSS&quot;,r[r.UNAUTHENTICATED=16]=&quot;UNAUTHENTICATED&quot;})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]=&quot;DEBUG&quot;,r[r.INFO=1]=&quot;INFO&quot;,r[r.ERROR=2]=&quot;ERROR&quot;,r[r.NONE=3]=&quot;NONE&quot;})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]=&quot;DEADLINE&quot;,r[r.CENSUS_STATS_CONTEXT=2]=&quot;CENSUS_STATS_CONTEXT&quot;,r[r.CENSUS_TRACING_CONTEXT=4]=&quot;CENSUS_TRACING_CONTEXT&quot;,r[r.CANCELLATION=8]=&quot;CANCELLATION&quot;,r[r.DEFAULTS=65535]=&quot;DEFAULTS&quot;})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=&gt;{Qle.exports={name:&quot;@grpc/grpc-js&quot;,version:&quot;1.13.4&quot;,description:&quot;gRPC Library for Node - pure JS implementation&quot;,homepage:&quot;https://grpc.io/&quot;,repository:&quot;https://github.com/grpc/grpc-node/tree/master/packages/grpc-js&quot;,main:&quot;build/src/index.js&quot;,engines:{node:&quot;&gt;=12.10.0&quot;},keywords:[],author:{name:&quot;Google Inc.&quot;},types:&quot;build/src/index.d.ts&quot;,license:&quot;Apache-2.0&quot;,devDependencies:{&quot;@grpc/proto-loader&quot;:&quot;file:../proto-loader&quot;,&quot;@types/gulp&quot;:&quot;^4.0.17&quot;,&quot;@types/gulp-mocha&quot;:&quot;0.0.37&quot;,&quot;@types/lodash&quot;:&quot;^4.14.202&quot;,&quot;@types/mocha&quot;:&quot;^10.0.6&quot;,&quot;@types/ncp&quot;:&quot;^2.0.8&quot;,&quot;@types/node&quot;:&quot;&gt;=20.11.20&quot;,&quot;@types/pify&quot;:&quot;^5.0.4&quot;,&quot;@types/semver&quot;:&quot;^7.5.8&quot;,&quot;@typescript-eslint/eslint-plugin&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/parser&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/typescript-estree&quot;:&quot;^7.1.0&quot;,&quot;clang-format&quot;:&quot;^1.8.0&quot;,eslint:&quot;^8.42.0&quot;,&quot;eslint-config-prettier&quot;:&quot;^8.8.0&quot;,&quot;eslint-plugin-node&quot;:&quot;^11.1.0&quot;,&quot;eslint-plugin-prettier&quot;:&quot;^4.2.1&quot;,execa:&quot;^2.0.3&quot;,gulp:&quot;^4.0.2&quot;,&quot;gulp-mocha&quot;:&quot;^6.0.0&quot;,lodash:&quot;^4.17.21&quot;,madge:&quot;^5.0.1&quot;,&quot;mocha-jenkins-reporter&quot;:&quot;^0.4.1&quot;,ncp:&quot;^2.0.0&quot;,pify:&quot;^4.0.1&quot;,prettier:&quot;^2.8.8&quot;,rimraf:&quot;^3.0.2&quot;,semver:&quot;^7.6.0&quot;,&quot;ts-node&quot;:&quot;^10.9.2&quot;,typescript:&quot;^5.3.3&quot;},contributors:[{name:&quot;Google Inc.&quot;}],scripts:{build:&quot;npm run compile&quot;,clean:&quot;rimraf ./build&quot;,compile:&quot;tsc -p .&quot;,format:&#x27;clang-format -i -style=&quot;{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}&quot; src/*.ts test/*.ts&#x27;,lint:&quot;eslint src/*.ts test/*.ts&quot;,prepare:&quot;npm run generate-types &amp;&amp; npm run compile&quot;,test:&quot;gulp test&quot;,check:&quot;npm run lint&quot;,fix:&quot;eslint --fix src/*.ts test/*.ts&quot;,pretest:&quot;npm run generate-types &amp;&amp; npm run generate-test-types &amp;&amp; npm run compile&quot;,posttest:&quot;npm run check &amp;&amp; madge -c ./build/src&quot;,&quot;generate-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto&quot;,&quot;generate-test-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto&quot;},dependencies:{&quot;@grpc/proto-loader&quot;:&quot;^0.7.13&quot;,&quot;@js-sdsl/ordered-map&quot;:&quot;^4.4.2&quot;},files:[&quot;src/**/*.ts&quot;,&quot;build/src/**/*.{js,d.ts,js.map}&quot;,&quot;proto/*.proto&quot;,&quot;LICENSE&quot;,&quot;deps/envoy-api/envoy/api/v2/**/*.proto&quot;,&quot;deps/envoy-api/envoy/config/**/*.proto&quot;,&quot;deps/envoy-api/envoy/service/**/*.proto&quot;,&quot;deps/envoy-api/envoy/type/**/*.proto&quot;,&quot;deps/udpa/udpa/**/*.proto&quot;,&quot;deps/googleapis/google/api/*.proto&quot;,&quot;deps/googleapis/google/rpc/*.proto&quot;,&quot;deps/protoc-gen-validate/validate/**/*.proto&quot;]}});var Pe=T(Bt=&gt;{&quot;use strict&quot;;var fv,pv,dv,hv;Object.defineProperty(Bt,&quot;__esModule&quot;,{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V(&quot;process&quot;),ece=uv().version,tce={error:(r,...e)=&gt;{console.error(&quot;E &quot;+r,...e)},info:(r,...e)=&gt;{console.error(&quot;I &quot;+r,...e)},debug:(r,...e)=&gt;{console.error(&quot;D &quot;+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&amp;&amp;fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&amp;&amp;pv!==void 0?pv:&quot;&quot;;switch(rce.toUpperCase()){case&quot;DEBUG&quot;:Zs=Wn.LogVerbosity.DEBUG;break;case&quot;INFO&quot;:Zs=Wn.LogVerbosity.INFO;break;case&quot;ERROR&quot;:Zs=Wn.LogVerbosity.ERROR;break;case&quot;NONE&quot;:Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=&gt;no;Bt.getLogger=nce;var ice=r=&gt;{no=r};Bt.setLogger=ice;var oce=r=&gt;{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=&gt;{let t;if(r&gt;=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&amp;&amp;t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&amp;&amp;dv!==void 0?dv:process.env.GRPC_TRACE)!==null&amp;&amp;hv!==void 0?hv:&quot;&quot;,_v=new Set,U3=new Set;for(let r of ace.split(&quot;,&quot;))r.startsWith(&quot;-&quot;)?U3.add(r.substring(1)):_v.add(r);var lce=_v.has(&quot;all&quot;);function cce(r,e,t){k3(e)&amp;&amp;(0,Bt.log)(r,new Date().toISOString()+&quot; | v&quot;+ece+&quot; &quot;+Zle.pid+&quot; | &quot;+e+&quot; | &quot;+t)}function k3(r){return!U3.has(r)&amp;&amp;(lce||_v.has(r))}});var Mh=T(xh=&gt;{&quot;use strict&quot;;Object.defineProperty(xh,&quot;__esModule&quot;,{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r==&quot;object&quot;&amp;&amp;r!==null&amp;&amp;&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;?r.code:null}});var ht=T(Dh=&gt;{&quot;use strict&quot;;Object.defineProperty(Dh,&quot;__esModule&quot;,{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith(&quot;-bin&quot;)}function Sce(r){return!r.startsWith(&quot;grpc-&quot;)}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error(&#x27;Metadata key &quot;&#x27;+r+&#x27;&quot; contains illegal characters&#x27;);if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error(&quot;keys that end with &#x27;-bin&#x27; must have Buffer values&quot;)}else{if(Buffer.isBuffer(e))throw new Error(&quot;keys that don&#x27;t end with &#x27;-bin&#x27; must have String values&quot;);if(!Tce(e))throw new Error(&#x27;Metadata string value &quot;&#x27;+e+&#x27;&quot; contains illegal characters&#x27;)}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length&gt;0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=&gt;Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===&quot;:&quot;)continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=&gt;{t.add(o,Buffer.from(a,&quot;base64&quot;))}):s!==void 0&amp;&amp;(Sce(o)?s.split(&quot;,&quot;).forEach(a=&gt;{t.add(o,Buffer.from(a.trim(),&quot;base64&quot;))}):t.add(o,Buffer.from(s,&quot;base64&quot;))):Array.isArray(s)?s.forEach(a=&gt;{t.add(o,a)}):s!==void 0&amp;&amp;t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=&gt;Buffer.isBuffer(r)?r.toString(&quot;base64&quot;):r});var kh=T(Uh=&gt;{&quot;use strict&quot;;Object.defineProperty(Uh,&quot;__esModule&quot;,{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return&quot;getRequestHeaders&quot;in r&amp;&amp;typeof r.getRequestHeaders==&quot;function&quot;}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=&gt;{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=&gt;{e.getRequestMetadata(t.service_url,(n,l)=&gt;{if(n){i(n);return}if(!l){i(new Error(&quot;Headers not set by metadata plugin&quot;));return}a(l)})}),s.then(a=&gt;{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=&gt;{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=&gt;s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=&gt;t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=&gt;{this.metadataGenerator(e,(s,a)=&gt;{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=&gt;{&quot;use strict&quot;;Object.defineProperty(gc,&quot;__esModule&quot;,{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V(&quot;fs&quot;);gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&amp;&amp;(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=&gt;{&quot;use strict&quot;;Object.defineProperty(ta,&quot;__esModule&quot;,{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith(&quot;[&quot;)){let e=r.indexOf(&quot;]&quot;);if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(&quot;:&quot;)===-1)return null;if(r.length&gt;e+1)if(r[e+1]===&quot;:&quot;){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(&quot;:&quot;);return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(&quot;:&quot;)?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e=&quot;&quot;;return r.scheme!==void 0&amp;&amp;(e+=r.scheme+&quot;:&quot;),r.authority!==void 0&amp;&amp;(e+=&quot;//&quot;+r.authority+&quot;/&quot;),e+=r.path,e}});var jr=T(io=&gt;{&quot;use strict&quot;;Object.defineProperty(io,&quot;__esModule&quot;,{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=&gt;{&quot;use strict&quot;;Object.defineProperty(yc,&quot;__esModule&quot;,{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V(&quot;tls&quot;),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&amp;&amp;!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,&quot;Root certificate&quot;),Rv(t,&quot;Private key&quot;),Rv(o,&quot;Certificate chain&quot;),t&amp;&amp;!o)throw new Error(&quot;Private key must be given with accompanying certificate chain&quot;);if(!t&amp;&amp;o)throw new Error(&quot;Certificate chain must be given with accompanying private key&quot;);let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&amp;&amp;a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error(&quot;Cannot compose insecure credentials&quot;)}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=&gt;Promise.resolve(),getCallCredentials:()=&gt;o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if(&quot;grpc.http_connect_target&quot;in o){let f=(0,H3.parseUri)(o[&quot;grpc.http_connect_target&quot;]);f&amp;&amp;(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&amp;&amp;s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&amp;&amp;(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&amp;&amp;(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=[&quot;h2&quot;],o[&quot;grpc.ssl_target_name_override&quot;]){let f=o[&quot;grpc.ssl_target_name_override&quot;],_=(a=i.checkServerIdentity)!==null&amp;&amp;a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=&gt;_(f,O),i.servername=f}else i.servername=u;return o[&quot;grpc-node.tls_enable_trace&quot;]&amp;&amp;(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=&gt;{let a=(0,vc.connect)(t,()=&gt;{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&amp;&amp;i!==void 0)||i)&amp;&amp;!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on(&quot;error&quot;,i=&gt;{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&amp;&amp;this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&amp;&amp;(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&amp;&amp;(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&amp;&amp;this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=&gt;{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&amp;&amp;!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,&quot;Failed to createSecureContext with error &quot;+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=&gt;{let o=this.parent.getLatestSecureContext();if(!o){t(new Error(&quot;Failed to load credentials&quot;));return}r.closed&amp;&amp;t(new Error(&quot;Socket closed while loading credentials&quot;));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=&gt;{t(new Error(&quot;Socket closed&quot;))},n=c=&gt;{t(c)},l=(0,vc.connect)(a,()=&gt;{var c;if(l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&amp;&amp;c!==void 0)||c)&amp;&amp;!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error(&quot;Cannot compose insecure credentials&quot;)}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&amp;&amp;this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=&gt;{&quot;use strict&quot;;Object.defineProperty(Yr,&quot;__esModule&quot;,{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&amp;&amp;o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&amp;&amp;a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&amp;&amp;n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&amp;&amp;c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&amp;&amp;f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error(&quot;Provided load balancing config has multiple conflicting entries&quot;);let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error(&quot;No default load balancer type registered&quot;);return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,&quot;Config parsing failed with error&quot;,o.message);continue}return e&amp;&amp;Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=&gt;{&quot;use strict&quot;;Object.defineProperty(Rc,&quot;__esModule&quot;,{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V(&quot;os&quot;),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce=&quot;node&quot;;function Xce(r){if(&quot;service&quot;in r&amp;&amp;r.service!==&quot;&quot;){if(typeof r.service!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if(&quot;method&quot;in r&amp;&amp;r.method!==&quot;&quot;){if(typeof r.method!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if(&quot;method&quot;in r&amp;&amp;r.method!==void 0)throw new Error(&quot;Invalid method config name: method set with empty or unset service&quot;);return{}}}function Wce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config retry policy: maxAttempts must be an integer at least 2&quot;);if(!(&quot;initialBackoff&quot;in r)||typeof r.initialBackoff!=&quot;string&quot;||!Hh.test(r.initialBackoff))throw new Error(&quot;Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;maxBackoff&quot;in r)||typeof r.maxBackoff!=&quot;string&quot;||!Hh.test(r.maxBackoff))throw new Error(&quot;Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;backoffMultiplier&quot;in r)||typeof r.backoffMultiplier!=&quot;number&quot;||r.backoffMultiplier&lt;=0)throw new Error(&quot;Invalid method config retry policy: backoffMultiplier must be a number greater than 0&quot;);if(!(&quot;retryableStatusCodes&quot;in r&amp;&amp;Array.isArray(r.retryableStatusCodes)))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes is required&quot;);if(r.retryableStatusCodes.length===0)throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes must be non-empty&quot;);for(let e of r.retryableStatusCodes)if(typeof e==&quot;number&quot;){if(!Object.values(Gh.Status).includes(e))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not in status code range&quot;)}else if(typeof e==&quot;string&quot;){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value must be a string or number&quot;);return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config hedging policy: maxAttempts must be an integer at least 2&quot;);if(&quot;hedgingDelay&quot;in r&amp;&amp;(typeof r.hedgingDelay!=&quot;string&quot;||!Hh.test(r.hedgingDelay)))throw new Error(&quot;Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s&quot;);if(&quot;nonFatalStatusCodes&quot;in r&amp;&amp;Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t==&quot;number&quot;){if(!Object.values(Gh.Status).includes(t))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not in status code range&quot;)}else if(typeof t==&quot;string&quot;){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number&quot;);let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&amp;&amp;(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&amp;&amp;(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!(&quot;name&quot;in r)||!Array.isArray(r.name))throw new Error(&quot;Invalid method config: invalid name array&quot;);for(let o of r.name)t.name.push(Xce(o));if(&quot;waitForReady&quot;in r){if(typeof r.waitForReady!=&quot;boolean&quot;)throw new Error(&quot;Invalid method config: invalid waitForReady&quot;);t.waitForReady=r.waitForReady}if(&quot;timeout&quot;in r)if(typeof r.timeout==&quot;object&quot;){if(!(&quot;seconds&quot;in r.timeout)||typeof r.timeout.seconds!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.seconds&quot;);if(!(&quot;nanos&quot;in r.timeout)||typeof r.timeout.nanos!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.nanos&quot;);t.timeout=r.timeout}else if(typeof r.timeout==&quot;string&quot;&amp;&amp;Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(&quot;.&quot;);t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&amp;&amp;e!==void 0?e:0)|0}}else throw new Error(&quot;Invalid method config: invalid timeout&quot;);if(&quot;maxRequestBytes&quot;in r){if(typeof r.maxRequestBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxRequestBytes=r.maxRequestBytes}if(&quot;maxResponseBytes&quot;in r){if(typeof r.maxResponseBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxResponseBytes=r.maxResponseBytes}if(&quot;retryPolicy&quot;in r){if(&quot;hedgingPolicy&quot;in r)throw new Error(&quot;Invalid method config: retryPolicy and hedgingPolicy cannot both be specified&quot;);t.retryPolicy=Wce(r.retryPolicy)}else&quot;hedgingPolicy&quot;in r&amp;&amp;(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!(&quot;maxTokens&quot;in r)||typeof r.maxTokens!=&quot;number&quot;||r.maxTokens&lt;=0||r.maxTokens&gt;1e3)throw new Error(&quot;Invalid retryThrottling: maxTokens must be a number in (0, 1000]&quot;);if(!(&quot;tokenRatio&quot;in r)||typeof r.tokenRatio!=&quot;number&quot;||r.tokenRatio&lt;=0)throw new Error(&quot;Invalid retryThrottling: tokenRatio must be a number greater than 0&quot;);return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r==&quot;object&quot;&amp;&amp;r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length&gt;1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error(&quot;Invalid loadBalancingConfig: load balancing policy name required&quot;);return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if(&quot;loadBalancingPolicy&quot;in r)if(typeof r.loadBalancingPolicy==&quot;string&quot;)e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error(&quot;Invalid service config: invalid loadBalancingPolicy&quot;);if(&quot;loadBalancingConfig&quot;in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error(&quot;Invalid service config: invalid loadBalancingConfig&quot;);if(&quot;methodConfig&quot;in r&amp;&amp;Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));&quot;retryThrottling&quot;in r&amp;&amp;(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&amp;&amp;s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!(&quot;serviceConfig&quot;in r))throw new Error(&quot;Invalid service config choice: missing service config&quot;);let e={serviceConfig:z3(r.serviceConfig)};if(&quot;clientLanguage&quot;in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o==&quot;string&quot;)e.clientLanguage.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;);if(&quot;clientHostname&quot;in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o==&quot;string&quot;)e.clientHostname.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;);if(&quot;percentage&quot;in r)if(typeof r.percentage==&quot;number&quot;&amp;&amp;0&lt;=r.percentage&amp;&amp;r.percentage&lt;=100)e.percentage=r.percentage;else throw new Error(&quot;Invalid service config choice: invalid percentage&quot;);let t=[&quot;clientLanguage&quot;,&quot;percentage&quot;,&quot;clientHostname&quot;,&quot;serviceConfig&quot;];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error(&quot;Invalid service config list&quot;);for(let t of r){let o=eue(t);if(!(typeof o.percentage==&quot;number&quot;&amp;&amp;e&gt;o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&amp;&amp;(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&amp;&amp;(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error(&quot;No matching service config found&quot;)}function rue(r,e){for(let t of r)if(t.length&gt;0&amp;&amp;t[0].startsWith(&quot;grpc_config=&quot;)){let o=t.join(&quot;&quot;).substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=&gt;{&quot;use strict&quot;;Object.defineProperty(qh,&quot;__esModule&quot;,{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]=&quot;IDLE&quot;,r[r.CONNECTING=1]=&quot;CONNECTING&quot;,r[r.READY=2]=&quot;READY&quot;,r[r.TRANSIENT_FAILURE=3]=&quot;TRANSIENT_FAILURE&quot;,r[r.SHUTDOWN=4]=&quot;SHUTDOWN&quot;})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=&gt;{&quot;use strict&quot;;Object.defineProperty(Qn,&quot;__esModule&quot;,{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]=&quot;COMPLETE&quot;,r[r.QUEUE=1]=&quot;QUEUE&quot;,r[r.TRANSIENT_FAILURE=2]=&quot;TRANSIENT_FAILURE&quot;,r[r.DROP=3]=&quot;DROP&quot;})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:&quot;No connection established&quot;,metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=&gt;{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=&gt;{&quot;use strict&quot;;Object.defineProperty(zh,&quot;__esModule&quot;,{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue=&quot;backoff&quot;,lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&amp;&amp;(t.initialDelay&amp;&amp;(this.initialDelay=t.initialDelay),t.multiplier&amp;&amp;(this.multiplier=t.multiplier),t.jitter&amp;&amp;(this.jitter=t.jitter),t.maxDelay&amp;&amp;(this.maxDelay=t.maxDelay)),this.trace(&quot;constructed initialDelay=&quot;+this.initialDelay+&quot; multiplier=&quot;+this.multiplier+&quot; jitter=&quot;+this.jitter+&quot; maxDelay=&quot;+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=&gt;{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,&quot;{&quot;+this.id+&quot;} &quot;+e)}runTimer(e){var t,o;this.trace(&quot;runTimer(delay=&quot;+e+&quot;)&quot;),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=&gt;{this.trace(&quot;timer fired&quot;),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace(&quot;runOnce()&quot;),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace(&quot;stop()&quot;),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(&quot;reset() running=&quot;+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e&lt;t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=&gt;{&quot;use strict&quot;;Object.defineProperty(Kh,&quot;__esModule&quot;,{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue=&quot;child_load_balancer_helper&quot;,Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&amp;&amp;t!==void 0?t:this.parent.currentChild;this.child===o&amp;&amp;this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&amp;&amp;this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&amp;&amp;(this.currentChild.exitIdle(),this.pendingChild&amp;&amp;this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&amp;&amp;(this.currentChild.resetBackoff(),this.pendingChild&amp;&amp;this.pendingChild.resetBackoff())}destroy(){this.currentChild&amp;&amp;(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&amp;&amp;(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=&gt;{&quot;use strict&quot;;Object.defineProperty(Xh,&quot;__esModule&quot;,{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue=&quot;resolving_load_balancer&quot;;function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=[&quot;SERVICE_AND_METHOD&quot;,&quot;SERVICE&quot;,&quot;EMPTY&quot;];function Cue(r,e,t,o){for(let s of t.name)switch(o){case&quot;EMPTY&quot;:if(!s.service&amp;&amp;!s.method)return!0;break;case&quot;SERVICE&quot;:if(s.service===r&amp;&amp;!s.method)return!0;break;case&quot;SERVICE_AND_METHOD&quot;:if(s.service===r&amp;&amp;s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split(&quot;/&quot;).filter(l=&gt;l.length&gt;0),i=(o=a[0])!==null&amp;&amp;o!==void 0?o:&quot;&quot;,n=(s=a[1])!==null&amp;&amp;s!==void 0?s:&quot;&quot;;if(r&amp;&amp;r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o[&quot;grpc.service_config&quot;]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o[&quot;grpc.service_config&quot;])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=&gt;{this.backoffTimeout.isRunning()?($3(&quot;requestReresolution delayed by backoff timer until &quot;+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=&gt;{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=&gt;{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&amp;&amp;_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:&quot;All load balancer options in service config are not compatible&quot;,metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=&gt;{this.handleResolutionFailure(n)}},o);let i={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new Sue.BackoffTimeout(()=&gt;{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&amp;&amp;this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+&quot; &quot;+It.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&amp;&amp;(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&amp;&amp;(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&amp;&amp;(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error(&quot;updateAddressList not supported on ResolvingLoadBalancer&quot;)}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return&quot;resolving_load_balancer&quot;}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=&gt;{&quot;use strict&quot;;Object.defineProperty(Pc,&quot;__esModule&quot;,{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={&quot;grpc.ssl_target_name_override&quot;:!0,&quot;grpc.primary_user_agent&quot;:!0,&quot;grpc.secondary_user_agent&quot;:!0,&quot;grpc.default_authority&quot;:!0,&quot;grpc.keepalive_time_ms&quot;:!0,&quot;grpc.keepalive_timeout_ms&quot;:!0,&quot;grpc.keepalive_permit_without_calls&quot;:!0,&quot;grpc.service_config&quot;:!0,&quot;grpc.max_concurrent_streams&quot;:!0,&quot;grpc.initial_reconnect_backoff_ms&quot;:!0,&quot;grpc.max_reconnect_backoff_ms&quot;:!0,&quot;grpc.use_local_subchannel_pool&quot;:!0,&quot;grpc.max_send_message_length&quot;:!0,&quot;grpc.max_receive_message_length&quot;:!0,&quot;grpc.enable_http_proxy&quot;:!0,&quot;grpc.enable_channelz&quot;:!0,&quot;grpc.dns_min_time_between_resolutions_ms&quot;:!0,&quot;grpc.enable_retries&quot;:!0,&quot;grpc.per_rpc_retry_buffer_size&quot;:!0,&quot;grpc.retry_buffer_size&quot;:!0,&quot;grpc.max_connection_age_ms&quot;:!0,&quot;grpc.max_connection_age_grace_ms&quot;:!0,&quot;grpc-node.max_session_memory&quot;:!0,&quot;grpc.service_config_disable_resolution&quot;:!0,&quot;grpc.client_idle_timeout_ms&quot;:!0,&quot;grpc-node.tls_enable_trace&quot;:!0,&quot;grpc.lb.ring_hash.ring_size_cap&quot;:!0,&quot;grpc-node.retry_max_attempts_limit&quot;:!0,&quot;grpc-node.flow_control_window&quot;:!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s&lt;t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=&gt;{&quot;use strict&quot;;Object.defineProperty(gr,&quot;__esModule&quot;,{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V(&quot;net&quot;);function bc(r){return&quot;port&quot;in r}function Wh(r,e){return!r&amp;&amp;!e?!0:!r||!e?!1:bc(r)?bc(e)&amp;&amp;r.host===e.host&amp;&amp;r.port===e.port:!bc(e)&amp;&amp;r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?&quot;[&quot;+r.host+&quot;]:&quot;+r.port:r.host+&quot;:&quot;+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t&lt;r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return&quot;[&quot;+r.addresses.map(Q3).join(&quot;, &quot;)+&quot;]&quot;}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&amp;&amp;(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=&gt;Hue});function na(r,e){if(typeof e!=&quot;function&quot;&amp;&amp;e!==null)throw new TypeError(&quot;Class extends value &quot;+String(e)+&quot; is not a constructor or null&quot;);kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;i&amp;&amp;(i=0,c[0]&amp;&amp;(t=0)),t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError(&quot;Iterator access denied!&quot;)}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=&gt;{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&amp;&amp;(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&amp;&amp;(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&amp;&amp;e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&amp;&amp;(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&amp;&amp;(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&amp;&amp;r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&amp;&amp;(this.O+=this.t.O),this.i&amp;&amp;(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&amp;&amp;(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,&quot;length&quot;,{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&amp;&amp;(t=function(a,i){return a&lt;i?-1:a&gt;i?1:0}),o===void 0&amp;&amp;(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)t=t.i;else if(a&gt;0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)s=t,t=t.i;else if(a&gt;0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&amp;&amp;s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&amp;&amp;s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&amp;&amp;s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&amp;&amp;s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&amp;&amp;(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t==&quot;number&quot;?t:void 0,s=typeof t==&quot;function&quot;?t:void 0,a=typeof t&gt;&quot;u&quot;?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&amp;&amp;a.push(n),s&amp;&amp;s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&amp;&amp;(t.t.h=o),t.i&amp;&amp;(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&amp;&amp;(t.t.h=s),t.i&amp;&amp;(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&amp;&amp;(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n&gt;0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c&lt;0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f&gt;0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m&lt;0&amp;&amp;(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O&gt;0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O&lt;0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s&lt;0)t=t.i;else if(s&gt;0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&amp;&amp;ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)&gt;0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)&lt;0?(s.u=o,!0):!1:this.g(i,o)&gt;=0||this.g(a,o)&lt;=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&amp;&amp;ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&amp;&amp;t.next():(!s||o.t===void 0)&amp;&amp;t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&amp;&amp;ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&amp;&amp;ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,&quot;index&quot;,{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&amp;&amp;(s+=t.t.O);t!==o;){var a=t.h;t===a.i&amp;&amp;(s+=1,a.t&amp;&amp;(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,&quot;pointer&quot;,{get:function(){this.C===this.A&amp;&amp;ao();var t=this;return new Proxy([],{get:function(o,s){return s===&quot;0&quot;?t.C.u:s===&quot;1&quot;?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!==&quot;1&quot;)throw new TypeError(&quot;prop must be 1&quot;);return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&amp;&amp;(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s&lt;t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=&gt;{&quot;use strict&quot;;Object.defineProperty(Jh,&quot;__esModule&quot;,{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=&gt;{&quot;use strict&quot;;Object.defineProperty(vr,&quot;__esModule&quot;,{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V(&quot;events&quot;),Hv=V(&quot;stream&quot;),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=&gt;{&quot;use strict&quot;;Object.defineProperty(xc,&quot;__esModule&quot;,{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&amp;&amp;this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=&gt;{&quot;use strict&quot;;Object.defineProperty(yr,&quot;__esModule&quot;,{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name=&quot;InterceptorConfigurationError&quot;,Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveStatus:(r,e)=&gt;{e(r)}},Mc={start:(r,e,t)=&gt;{t(r,e)},sendMessage:(r,e)=&gt;{e(r)},halfClose:r=&gt;{r()},cancel:r=&gt;{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&amp;&amp;o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&amp;&amp;s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&amp;&amp;a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&amp;&amp;i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=&gt;{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&amp;&amp;(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&amp;&amp;this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(u=&gt;{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&amp;&amp;i!==void 0?i:(u=&gt;{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&amp;&amp;l!==void 0?l:(u=&gt;{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=&gt;{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&amp;&amp;_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&amp;&amp;m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&amp;&amp;O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=&gt;{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&amp;&amp;o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&amp;&amp;s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&amp;&amp;u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=&gt;{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=&gt;{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=&gt;{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(n=&gt;{}),onReceiveMessage:n=&gt;{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=&gt;{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length&gt;0&amp;&amp;r.clientInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(r.callInterceptors.length&gt;0&amp;&amp;r.callInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.&quot;);let s=[];r.callInterceptors.length&gt;0||r.callInterceptorProviders.length&gt;0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=&gt;c=&gt;l(c,n),n=&gt;Wue(o,n,e))(a)}});var Zv=T(t_=&gt;{&quot;use strict&quot;;Object.defineProperty(t_,&quot;__esModule&quot;,{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r==&quot;function&quot;}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||&quot;no stack trace available&quot;}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&amp;&amp;s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&amp;&amp;a!==void 0?a:[],delete o.interceptor_providers,this[oa].length&gt;0&amp;&amp;this[sa].length&gt;0)throw new Error(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=&gt;{if(s){t(new Error(&quot;Failed to connect before the deadline&quot;));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error(&quot;The channel has been closed&quot;));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error(&quot;The channel has been closed&quot;))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&amp;&amp;t instanceof Object&amp;&amp;Jv(o)))throw new Error(&quot;Incorrect arguments passed&quot;);return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&amp;&amp;(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&amp;&amp;l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&amp;&amp;c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=&gt;{m.emit(&quot;metadata&quot;,F)},onReceiveMessage(F){A!==null&amp;&amp;y.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit(&quot;status&quot;,F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=&gt;{_.emit(&quot;metadata&quot;,M)},onReceiveMessage(M){y!==null&amp;&amp;O.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit(&quot;status&quot;,M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit(&quot;metadata&quot;,I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit(&quot;status&quot;,I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&amp;&amp;(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&amp;&amp;i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&amp;&amp;n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit(&quot;metadata&quot;,A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit(&quot;status&quot;,A)}}}),f}};t_.Client=Qv});var ry=T(r_=&gt;{&quot;use strict&quot;;Object.defineProperty(r_,&quot;__esModule&quot;,{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return[&quot;__proto__&quot;,&quot;prototype&quot;,&quot;constructor&quot;].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=&gt;{if(ty(s))return;let a=r[s],i;if(typeof s==&quot;string&quot;&amp;&amp;s.charAt(0)===&quot;$&quot;)throw new Error(&quot;Method names cannot start with $&quot;);a.requestStream?a.responseStream?i=&quot;bidi&quot;:i=&quot;client_stream&quot;:a.responseStream?i=&quot;server_stream&quot;:i=&quot;unary&quot;;let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&amp;&amp;!ty(a.originalName)&amp;&amp;(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return&quot;format&quot;in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(&quot;.&quot;);if(s.some(n=&gt;ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=&gt;{var ife=1/0,ofe=&quot;[object Symbol]&quot;,sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_=&quot;\\ud800-\\udfff&quot;,mH=&quot;\\u0300-\\u036f\\ufe20-\\ufe23&quot;,TH=&quot;\\u20d0-\\u20f0&quot;,SH=&quot;\\u2700-\\u27bf&quot;,gH=&quot;a-z\\xdf-\\xf6\\xf8-\\xff&quot;,lfe=&quot;\\xac\\xb1\\xd7\\xf7&quot;,cfe=&quot;\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf&quot;,ufe=&quot;\\u2000-\\u206f&quot;,ffe=&quot; \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000&quot;,vH=&quot;A-Z\\xc0-\\xd6\\xd8-\\xde&quot;,yH=&quot;\\ufe0e\\ufe0f&quot;,OH=lfe+cfe+ufe+ffe,iy=&quot;[&#x27;\u2019]&quot;,pfe=&quot;[&quot;+i_+&quot;]&quot;,uH=&quot;[&quot;+OH+&quot;]&quot;,n_=&quot;[&quot;+mH+TH+&quot;]&quot;,AH=&quot;\\d+&quot;,dfe=&quot;[&quot;+SH+&quot;]&quot;,RH=&quot;[&quot;+gH+&quot;]&quot;,NH=&quot;[^&quot;+i_+OH+AH+SH+gH+vH+&quot;]&quot;,ny=&quot;\\ud83c[\\udffb-\\udfff]&quot;,hfe=&quot;(?:&quot;+n_+&quot;|&quot;+ny+&quot;)&quot;,CH=&quot;[^&quot;+i_+&quot;]&quot;,oy=&quot;(?:\\ud83c[\\udde6-\\uddff]){2}&quot;,sy=&quot;[\\ud800-\\udbff][\\udc00-\\udfff]&quot;,la=&quot;[&quot;+vH+&quot;]&quot;,PH=&quot;\\u200d&quot;,fH=&quot;(?:&quot;+RH+&quot;|&quot;+NH+&quot;)&quot;,_fe=&quot;(?:&quot;+la+&quot;|&quot;+NH+&quot;)&quot;,pH=&quot;(?:&quot;+iy+&quot;(?:d|ll|m|re|s|t|ve))?&quot;,dH=&quot;(?:&quot;+iy+&quot;(?:D|LL|M|RE|S|T|VE))?&quot;,IH=hfe+&quot;?&quot;,bH=&quot;[&quot;+yH+&quot;]?&quot;,Efe=&quot;(?:&quot;+PH+&quot;(?:&quot;+[CH,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+bH+IH+&quot;)*&quot;,LH=bH+IH+Efe,mfe=&quot;(?:&quot;+[dfe,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+LH,Tfe=&quot;(?:&quot;+[CH+n_+&quot;?&quot;,n_,oy,sy,pfe].join(&quot;|&quot;)+&quot;)&quot;,Sfe=RegExp(iy,&quot;g&quot;),gfe=RegExp(n_,&quot;g&quot;),vfe=RegExp(ny+&quot;(?=&quot;+ny+&quot;)|&quot;+Tfe+LH,&quot;g&quot;),yfe=RegExp([la+&quot;?&quot;+RH+&quot;+&quot;+pH+&quot;(?=&quot;+[uH,la,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,_fe+&quot;+&quot;+dH+&quot;(?=&quot;+[uH,la+fH,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,la+&quot;?&quot;+fH+&quot;+&quot;+pH,la+&quot;+&quot;+dH,AH,mfe].join(&quot;|&quot;),&quot;g&quot;),Ofe=RegExp(&quot;[&quot;+PH+i_+mH+TH+yH+&quot;]&quot;),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:&quot;A&quot;,\u00C1:&quot;A&quot;,\u00C2:&quot;A&quot;,\u00C3:&quot;A&quot;,\u00C4:&quot;A&quot;,\u00C5:&quot;A&quot;,\u00E0:&quot;a&quot;,\u00E1:&quot;a&quot;,\u00E2:&quot;a&quot;,\u00E3:&quot;a&quot;,\u00E4:&quot;a&quot;,\u00E5:&quot;a&quot;,\u00C7:&quot;C&quot;,\u00E7:&quot;c&quot;,\u00D0:&quot;D&quot;,\u00F0:&quot;d&quot;,\u00C8:&quot;E&quot;,\u00C9:&quot;E&quot;,\u00CA:&quot;E&quot;,\u00CB:&quot;E&quot;,\u00E8:&quot;e&quot;,\u00E9:&quot;e&quot;,\u00EA:&quot;e&quot;,\u00EB:&quot;e&quot;,\u00CC:&quot;I&quot;,\u00CD:&quot;I&quot;,\u00CE:&quot;I&quot;,\u00CF:&quot;I&quot;,\u00EC:&quot;i&quot;,\u00ED:&quot;i&quot;,\u00EE:&quot;i&quot;,\u00EF:&quot;i&quot;,\u00D1:&quot;N&quot;,\u00F1:&quot;n&quot;,\u00D2:&quot;O&quot;,\u00D3:&quot;O&quot;,\u00D4:&quot;O&quot;,\u00D5:&quot;O&quot;,\u00D6:&quot;O&quot;,\u00D8:&quot;O&quot;,\u00F2:&quot;o&quot;,\u00F3:&quot;o&quot;,\u00F4:&quot;o&quot;,\u00F5:&quot;o&quot;,\u00F6:&quot;o&quot;,\u00F8:&quot;o&quot;,\u00D9:&quot;U&quot;,\u00DA:&quot;U&quot;,\u00DB:&quot;U&quot;,\u00DC:&quot;U&quot;,\u00F9:&quot;u&quot;,\u00FA:&quot;u&quot;,\u00FB:&quot;u&quot;,\u00FC:&quot;u&quot;,\u00DD:&quot;Y&quot;,\u00FD:&quot;y&quot;,\u00FF:&quot;y&quot;,\u00C6:&quot;Ae&quot;,\u00E6:&quot;ae&quot;,\u00DE:&quot;Th&quot;,\u00FE:&quot;th&quot;,\u00DF:&quot;ss&quot;,\u0100:&quot;A&quot;,\u0102:&quot;A&quot;,\u0104:&quot;A&quot;,\u0101:&quot;a&quot;,\u0103:&quot;a&quot;,\u0105:&quot;a&quot;,\u0106:&quot;C&quot;,\u0108:&quot;C&quot;,\u010A:&quot;C&quot;,\u010C:&quot;C&quot;,\u0107:&quot;c&quot;,\u0109:&quot;c&quot;,\u010B:&quot;c&quot;,\u010D:&quot;c&quot;,\u010E:&quot;D&quot;,\u0110:&quot;D&quot;,\u010F:&quot;d&quot;,\u0111:&quot;d&quot;,\u0112:&quot;E&quot;,\u0114:&quot;E&quot;,\u0116:&quot;E&quot;,\u0118:&quot;E&quot;,\u011A:&quot;E&quot;,\u0113:&quot;e&quot;,\u0115:&quot;e&quot;,\u0117:&quot;e&quot;,\u0119:&quot;e&quot;,\u011B:&quot;e&quot;,\u011C:&quot;G&quot;,\u011E:&quot;G&quot;,\u0120:&quot;G&quot;,\u0122:&quot;G&quot;,\u011D:&quot;g&quot;,\u011F:&quot;g&quot;,\u0121:&quot;g&quot;,\u0123:&quot;g&quot;,\u0124:&quot;H&quot;,\u0126:&quot;H&quot;,\u0125:&quot;h&quot;,\u0127:&quot;h&quot;,\u0128:&quot;I&quot;,\u012A:&quot;I&quot;,\u012C:&quot;I&quot;,\u012E:&quot;I&quot;,\u0130:&quot;I&quot;,\u0129:&quot;i&quot;,\u012B:&quot;i&quot;,\u012D:&quot;i&quot;,\u012F:&quot;i&quot;,\u0131:&quot;i&quot;,\u0134:&quot;J&quot;,\u0135:&quot;j&quot;,\u0136:&quot;K&quot;,\u0137:&quot;k&quot;,\u0138:&quot;k&quot;,\u0139:&quot;L&quot;,\u013B:&quot;L&quot;,\u013D:&quot;L&quot;,\u013F:&quot;L&quot;,\u0141:&quot;L&quot;,\u013A:&quot;l&quot;,\u013C:&quot;l&quot;,\u013E:&quot;l&quot;,\u0140:&quot;l&quot;,\u0142:&quot;l&quot;,\u0143:&quot;N&quot;,\u0145:&quot;N&quot;,\u0147:&quot;N&quot;,\u014A:&quot;N&quot;,\u0144:&quot;n&quot;,\u0146:&quot;n&quot;,\u0148:&quot;n&quot;,\u014B:&quot;n&quot;,\u014C:&quot;O&quot;,\u014E:&quot;O&quot;,\u0150:&quot;O&quot;,\u014D:&quot;o&quot;,\u014F:&quot;o&quot;,\u0151:&quot;o&quot;,\u0154:&quot;R&quot;,\u0156:&quot;R&quot;,\u0158:&quot;R&quot;,\u0155:&quot;r&quot;,\u0157:&quot;r&quot;,\u0159:&quot;r&quot;,\u015A:&quot;S&quot;,\u015C:&quot;S&quot;,\u015E:&quot;S&quot;,\u0160:&quot;S&quot;,\u015B:&quot;s&quot;,\u015D:&quot;s&quot;,\u015F:&quot;s&quot;,\u0161:&quot;s&quot;,\u0162:&quot;T&quot;,\u0164:&quot;T&quot;,\u0166:&quot;T&quot;,\u0163:&quot;t&quot;,\u0165:&quot;t&quot;,\u0167:&quot;t&quot;,\u0168:&quot;U&quot;,\u016A:&quot;U&quot;,\u016C:&quot;U&quot;,\u016E:&quot;U&quot;,\u0170:&quot;U&quot;,\u0172:&quot;U&quot;,\u0169:&quot;u&quot;,\u016B:&quot;u&quot;,\u016D:&quot;u&quot;,\u016F:&quot;u&quot;,\u0171:&quot;u&quot;,\u0173:&quot;u&quot;,\u0174:&quot;W&quot;,\u0175:&quot;w&quot;,\u0176:&quot;Y&quot;,\u0177:&quot;y&quot;,\u0178:&quot;Y&quot;,\u0179:&quot;Z&quot;,\u017B:&quot;Z&quot;,\u017D:&quot;Z&quot;,\u017A:&quot;z&quot;,\u017C:&quot;z&quot;,\u017E:&quot;z&quot;,\u0132:&quot;IJ&quot;,\u0133:&quot;ij&quot;,\u0152:&quot;Oe&quot;,\u0153:&quot;oe&quot;,\u0149:&quot;&#x27;n&quot;,\u017F:&quot;ss&quot;},Nfe=typeof global==&quot;object&quot;&amp;&amp;global&amp;&amp;global.Object===Object&amp;&amp;global,Cfe=typeof self==&quot;object&quot;&amp;&amp;self&amp;&amp;self.Object===Object&amp;&amp;self,Pfe=Nfe||Cfe||Function(&quot;return this&quot;)();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&amp;&amp;a&amp;&amp;(t=r[++s]);++s&lt;a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split(&quot;&quot;)}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e&lt;0&amp;&amp;(e=-e&gt;s?0:s+e),t=t&gt;s?s:t,t&lt;0&amp;&amp;(t+=s),s=e&gt;t?0:t-e&gt;&gt;&gt;0,e&gt;&gt;&gt;=0;for(var a=Array(s);++o&lt;s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r==&quot;string&quot;)return r;if(zfe(r))return EH?EH.call(r):&quot;&quot;;var e=r+&quot;&quot;;return e==&quot;0&quot;&amp;&amp;1/r==-ife?&quot;-0&quot;:e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&amp;&amp;t&gt;=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(&quot;&quot;):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,&quot;&quot;)),r,&quot;&quot;)}}function Yfe(r){return!!r&amp;&amp;typeof r==&quot;object&quot;}function zfe(r){return typeof r==&quot;symbol&quot;||Yfe(r)&amp;&amp;Vfe.call(r)==ofe}function o_(r){return r==null?&quot;&quot;:Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&amp;&amp;r.replace(afe,Mfe).replace(gfe,&quot;&quot;)}var Wfe=qfe(&quot;toUpperCase&quot;);function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=&gt;{&quot;use strict&quot;;DH.exports=ay;function ay(r,e){typeof r==&quot;string&quot;&amp;&amp;(e=r,r=void 0);var t=[];function o(a){if(typeof a!=&quot;string&quot;){var i=s();if(ay.verbose&amp;&amp;console.log(&quot;codegen: &quot;+i),i=&quot;return &quot;+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u&lt;n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case&quot;d&quot;:case&quot;f&quot;:return String(Number(A));case&quot;i&quot;:return String(Math.floor(A));case&quot;j&quot;:return JSON.stringify(A);case&quot;s&quot;:return String(A)}return&quot;%&quot;}),_!==f.length)throw Error(&quot;parameter count mismatch&quot;);return t.push(a),o}function s(a){return&quot;function &quot;+(a||e||&quot;&quot;)+&quot;(&quot;+(r&amp;&amp;r.join(&quot;,&quot;)||&quot;&quot;)+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=&gt;{&quot;use strict&quot;;kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe(&quot;fs&quot;);function Uc(r,e,t){return typeof e==&quot;function&quot;?(t=e,e={}):e||(e={}),t?!e.xhr&amp;&amp;ly&amp;&amp;ly.readFile?ly.readFile(r,function(s,a){return s&amp;&amp;typeof XMLHttpRequest&lt;&quot;u&quot;?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString(&quot;utf8&quot;))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&amp;&amp;s.status!==200)return o(Error(&quot;status &quot;+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n&lt;s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&amp;255)}return o(null,typeof Uint8Array&lt;&quot;u&quot;?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&amp;&amp;(&quot;overrideMimeType&quot;in s&amp;&amp;s.overrideMimeType(&quot;text/plain; charset=x-user-defined&quot;),s.responseType=&quot;arraybuffer&quot;),s.open(&quot;GET&quot;,e),s.send()}});var GH=T(FH=&gt;{&quot;use strict&quot;;var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,&quot;/&quot;).replace(/\/{2,}/g,&quot;/&quot;);var t=e.split(&quot;/&quot;),o=VH(e),s=&quot;&quot;;o&amp;&amp;(s=t.shift()+&quot;/&quot;);for(var a=0;a&lt;t.length;)t[a]===&quot;..&quot;?a&gt;0&amp;&amp;t[a-1]!==&quot;..&quot;?t.splice(--a,2):o?t.splice(a,1):++a:t[a]===&quot;.&quot;?t.splice(a,1):++a;return s+t.join(&quot;/&quot;)};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,&quot;&quot;)).length?cy(e+&quot;/&quot;+t):t)}});var ua=T((iFe,jH)=&gt;{&quot;use strict&quot;;jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className=&quot;Namespace&quot;;var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&amp;&amp;r.length){for(var t={},o=0;o&lt;r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(typeof e[o]!=&quot;string&quot;&amp;&amp;e[o][0]&lt;=t&amp;&amp;e[o][1]&gt;t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,&quot;nestedArray&quot;,{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject([&quot;options&quot;,this.options,&quot;nested&quot;,HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s&lt;o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&amp;&amp;this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&amp;&amp;this.nested[e]instanceof co)return this.nested[e].values;throw Error(&quot;no such enum: &quot;+e)};pe.prototype.add=function(e){if(!(e instanceof fy&amp;&amp;e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError(&quot;object must be a valid nested object&quot;);if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&amp;&amp;e instanceof pe&amp;&amp;!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s&lt;o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError(&quot;object must be a ReflectionObject&quot;);if(e.parent!==this)throw Error(e+&quot; is not a member of &quot;+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(&quot;.&quot;);else if(!Array.isArray(e))throw TypeError(&quot;illegal path&quot;);if(e&amp;&amp;e.length&amp;&amp;e[0]===&quot;&quot;)throw Error(&quot;path must be relative&quot;);for(var o=this;e.length&gt;0;){var s=e.shift();if(o.nested&amp;&amp;o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error(&quot;path conflicts with non-namespace objects&quot;)}else o.add(o=new pe(s))}return t&amp;&amp;o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t&lt;e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t==&quot;boolean&quot;?(o=t,t=void 0):t&amp;&amp;!Array.isArray(t)&amp;&amp;(t=[t]),a_.isString(e)&amp;&amp;e.length){if(e===&quot;.&quot;)return this.root;e=e.split(&quot;.&quot;)}else if(!e.length)return this;var s=e.join(&quot;.&quot;);if(e[0]===&quot;&quot;)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&amp;&amp;this.root._fullyQualifiedObjects[&quot;.&quot;+s];if(a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)||(a=this._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&amp;&amp;(e=e.slice(1),s=o._lookupImpl(e,e.join(&quot;.&quot;)));else for(var a=0;a&lt;this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&amp;&amp;(o=this._nestedArray[a]._lookupImpl(e,t))&amp;&amp;(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error(&quot;no such type: &quot;+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error(&quot;no such Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error(&quot;no such Type or Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error(&quot;no such Service &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=&gt;{&quot;use strict&quot;;YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className=&quot;MapField&quot;;var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError(&quot;keyType must be a string&quot;);this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject([&quot;keyType&quot;,this.keyType,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error(&quot;invalid key type: &quot;+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o==&quot;function&quot;?o=kc.decorateType(o).name:o&amp;&amp;typeof o==&quot;object&quot;&amp;&amp;(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=&gt;{&quot;use strict&quot;;zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className=&quot;Method&quot;;var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&amp;&amp;(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError(&quot;type must be a string&quot;);if(!fa.isString(t))throw TypeError(&quot;requestType must be a string&quot;);if(!fa.isString(o))throw TypeError(&quot;responseType must be a string&quot;);dy.call(this,r,i),this.type=e||&quot;rpc&quot;,this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject([&quot;type&quot;,this.type!==&quot;rpc&quot;&amp;&amp;this.type||void 0,&quot;requestType&quot;,this.requestType,&quot;requestStream&quot;,this.requestStream,&quot;responseType&quot;,this.responseType,&quot;responseStream&quot;,this.responseStream,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0,&quot;parsedOptions&quot;,this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=&gt;{&quot;use strict&quot;;$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className=&quot;Service&quot;;var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a&lt;s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&amp;&amp;o.addJSON(t.nested),t.edition&amp;&amp;(o._edition=t.edition),o.comment=t.comment,o._defaultEdition=&quot;proto3&quot;,o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;methods&quot;,Sn.arrayToJSON(this.methodsArray,e)||{},&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Object.defineProperty(Vt.prototype,&quot;methodsArray&quot;,{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t&lt;e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a&lt;this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,&quot;&quot;);s[n]=Bc.codegen([&quot;r&quot;,&quot;c&quot;],Bc.isReserved(n)?n+&quot;_&quot;:n)(&quot;return this.rpcCall(m,q,s,r,c)&quot;)({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=&gt;{&quot;use strict&quot;;XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t&lt;e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=&gt;{&quot;use strict&quot;;JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return&quot;missing required &#x27;&quot;+r.name+&quot;&#x27;&quot;}function spe(r){for(var e=WH.codegen([&quot;r&quot;,&quot;l&quot;,&quot;e&quot;],r.name+&quot;$decode&quot;)(&quot;if(!(r instanceof Reader))&quot;)(&quot;r=Reader.create(r)&quot;)(&quot;var c=l===undefined?r.len:r.pos+l,m=new this.ctor&quot;+(r.fieldsArray.filter(function(n){return n.map}).length?&quot;,k,value&quot;:&quot;&quot;))(&quot;while(r.pos&lt;c){&quot;)(&quot;var t=r.uint32()&quot;)(&quot;if(t===e)&quot;)(&quot;break&quot;)(&quot;switch(t&gt;&gt;&gt;3){&quot;),t=0;t&lt;r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?&quot;int32&quot;:o.type,a=&quot;m&quot;+WH.safeProp(o.name);e(&quot;case %i: {&quot;,o.id),o.map?(e(&quot;if(%s===util.emptyObject)&quot;,a)(&quot;%s={}&quot;,a)(&quot;var c2 = r.uint32()+r.pos&quot;),gn.defaults[o.keyType]!==void 0?e(&quot;k=%j&quot;,gn.defaults[o.keyType]):e(&quot;k=null&quot;),gn.defaults[s]!==void 0?e(&quot;value=%j&quot;,gn.defaults[s]):e(&quot;value=null&quot;),e(&quot;while(r.pos&lt;c2){&quot;)(&quot;var tag2=r.uint32()&quot;)(&quot;switch(tag2&gt;&gt;&gt;3){&quot;)(&quot;case 1: k=r.%s(); break&quot;,o.keyType)(&quot;case 2:&quot;),gn.basic[s]===void 0?e(&quot;value=types[%i].decode(r,r.uint32())&quot;,t):e(&quot;value=r.%s()&quot;,s),e(&quot;break&quot;)(&quot;default:&quot;)(&quot;r.skipType(tag2&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),gn.long[o.keyType]!==void 0?e(&#x27;%s[typeof k===&quot;object&quot;?util.longToHash(k):k]=value&#x27;,a):e(&quot;%s[k]=value&quot;,a)):o.repeated?(e(&quot;if(!(%s&amp;&amp;%s.length))&quot;,a,a)(&quot;%s=[]&quot;,a),gn.packed[s]!==void 0&amp;&amp;e(&quot;if((t&amp;7)===2){&quot;)(&quot;var c2=r.uint32()+r.pos&quot;)(&quot;while(r.pos&lt;c2)&quot;)(&quot;%s.push(r.%s())&quot;,a,s)(&quot;}else&quot;),gn.basic[s]===void 0?e(o.delimited?&quot;%s.push(types[%i].decode(r,undefined,((t&amp;~7)|4)))&quot;:&quot;%s.push(types[%i].decode(r,r.uint32()))&quot;,a,t):e(&quot;%s.push(r.%s())&quot;,a,s)):gn.basic[s]===void 0?e(o.delimited?&quot;%s=types[%i].decode(r,undefined,((t&amp;~7)|4))&quot;:&quot;%s=types[%i].decode(r,r.uint32())&quot;,a,t):e(&quot;%s=r.%s()&quot;,a,s),e(&quot;break&quot;)(&quot;}&quot;)}for(e(&quot;default:&quot;)(&quot;r.skipType(t&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),t=0;t&lt;r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&amp;&amp;e(&quot;if(!m.hasOwnProperty(%j))&quot;,i.name)(&quot;throw util.ProtocolError(%j,{instance:m})&quot;,ope(i))}return e(&quot;return m&quot;)}});var Ty=T((uFe,QH)=&gt;{&quot;use strict&quot;;QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+&quot;: &quot;+e+(r.repeated&amp;&amp;e!==&quot;array&quot;?&quot;[]&quot;:r.map&amp;&amp;e!==&quot;object&quot;?&quot;{k:&quot;+r.keyType+&quot;}&quot;:&quot;&quot;)+&quot; expected&quot;}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r(&quot;switch(%s){&quot;,o)(&quot;default:&quot;)(&quot;return%j&quot;,ir(e,&quot;enum value&quot;));for(var s=Object.keys(e.resolvedType.values),a=0;a&lt;s.length;++a)r(&quot;case %i:&quot;,e.resolvedType.values[s[a]]);r(&quot;break&quot;)(&quot;}&quot;)}else r(&quot;{&quot;)(&quot;var e=types[%i].verify(%s);&quot;,t,o)(&quot;if(e)&quot;)(&quot;return%j+e&quot;,e.name+&quot;.&quot;)(&quot;}&quot;);else switch(e.type){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.isInteger(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;integer&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.isInteger(%s)&amp;&amp;!(%s&amp;&amp;util.isInteger(%s.low)&amp;&amp;util.isInteger(%s.high)))&quot;,o,o,o,o)(&quot;return%j&quot;,ir(e,&quot;integer|Long&quot;));break;case&quot;float&quot;:case&quot;double&quot;:r(&#x27;if(typeof %s!==&quot;number&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;number&quot;));break;case&quot;bool&quot;:r(&#x27;if(typeof %s!==&quot;boolean&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;boolean&quot;));break;case&quot;string&quot;:r(&quot;if(!util.isString(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;string&quot;));break;case&quot;bytes&quot;:r(&#x27;if(!(%s&amp;&amp;typeof %s.length===&quot;number&quot;||util.isString(%s)))&#x27;,o,o,o)(&quot;return%j&quot;,ir(e,&quot;buffer&quot;));break}return r}function lpe(r,e,t){switch(e.keyType){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.key32Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer key&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.key64Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer|Long key&quot;));break;case&quot;bool&quot;:r(&quot;if(!util.key2Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;boolean key&quot;));break}return r}function cpe(r){var e=Ey.codegen([&quot;m&quot;],r.name+&quot;$verify&quot;)(&#x27;if(typeof m!==&quot;object&quot;||m===null)&#x27;)(&quot;return%j&quot;,&quot;object expected&quot;),t=r.oneofsArray,o={};t.length&amp;&amp;e(&quot;var p={}&quot;);for(var s=0;s&lt;r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i=&quot;m&quot;+Ey.safeProp(a.name);if(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,i,a.name),a.map)e(&quot;if(!util.isObject(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;object&quot;))(&quot;var k=Object.keys(%s)&quot;,i)(&quot;for(var i=0;i&lt;k.length;++i){&quot;),lpe(e,a,&quot;k[i]&quot;),my(e,a,s,i+&quot;[k[i]]&quot;)(&quot;}&quot;);else if(a.repeated)e(&quot;if(!Array.isArray(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;array&quot;))(&quot;for(var i=0;i&lt;%s.length;++i){&quot;,i),my(e,a,s,i+&quot;[i]&quot;)(&quot;}&quot;);else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&amp;&amp;e(&quot;if(p%s===1)&quot;,n)(&quot;return%j&quot;,a.partOf.name+&quot;: multiple values&quot;),o[a.partOf.name]=1,e(&quot;p%s=1&quot;,n)}my(e,a,s,i)}a.optional&amp;&amp;e(&quot;}&quot;)}return e(&quot;return null&quot;)}});var vy=T(eq=&gt;{&quot;use strict&quot;;var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r(&quot;switch(d%s){&quot;,o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]===e.typeDefault&amp;&amp;!s&amp;&amp;(r(&quot;default:&quot;)(&#x27;if(typeof(d%s)===&quot;number&quot;){m%s=d%s;break}&#x27;,o,o,o),e.repeated||r(&quot;break&quot;),s=!0),r(&quot;case%j:&quot;,i[n])(&quot;case %i:&quot;,a[i[n]])(&quot;m%s=%j&quot;,o,a[i[n]])(&quot;break&quot;);r(&quot;}&quot;)}else r(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,o)(&quot;throw TypeError(%j)&quot;,e.fullName+&quot;: object expected&quot;)(&quot;m%s=types[%i].fromObject(d%s)&quot;,o,t,o);else{var l=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;m%s=Number(d%s)&quot;,o,o);break;case&quot;uint32&quot;:case&quot;fixed32&quot;:r(&quot;m%s=d%s&gt;&gt;&gt;0&quot;,o,o);break;case&quot;int32&quot;:case&quot;sint32&quot;:case&quot;sfixed32&quot;:r(&quot;m%s=d%s|0&quot;,o,o);break;case&quot;uint64&quot;:l=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(util.Long)&quot;)(&quot;(m%s=util.Long.fromValue(d%s)).unsigned=%j&quot;,o,o,l)(&#x27;else if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;m%s=parseInt(d%s,10)&quot;,o,o)(&#x27;else if(typeof d%s===&quot;number&quot;)&#x27;,o)(&quot;m%s=d%s&quot;,o,o)(&#x27;else if(typeof d%s===&quot;object&quot;)&#x27;,o)(&quot;m%s=new util.LongBits(d%s.low&gt;&gt;&gt;0,d%s.high&gt;&gt;&gt;0).toNumber(%s)&quot;,o,o,o,l?&quot;true&quot;:&quot;&quot;);break;case&quot;bytes&quot;:r(&#x27;if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)&quot;,o,o,o)(&quot;else if(d%s.length &gt;= 0)&quot;,o)(&quot;m%s=d%s&quot;,o,o);break;case&quot;string&quot;:r(&quot;m%s=String(d%s)&quot;,o,o);break;case&quot;bool&quot;:r(&quot;m%s=Boolean(d%s)&quot;,o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen([&quot;d&quot;],e.name+&quot;$fromObject&quot;)(&quot;if(d instanceof this.ctor)&quot;)(&quot;return d&quot;);if(!t.length)return o(&quot;return new this.ctor&quot;);o(&quot;var m=new this.ctor&quot;);for(var s=0;s&lt;t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o(&quot;if(d%s){&quot;,i)(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: object expected&quot;)(&quot;m%s={}&quot;,i)(&quot;for(var ks=Object.keys(d%s),i=0;i&lt;ks.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[ks[i]]&quot;)(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(o(&quot;if(d%s){&quot;,i)(&quot;if(!Array.isArray(d%s))&quot;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: array expected&quot;)(&quot;m%s=[]&quot;,i)(&quot;for(var i=0;i&lt;d%s.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[i]&quot;)(&quot;}&quot;)(&quot;}&quot;)):(a.resolvedType instanceof Vc||o(&quot;if(d%s!=null){&quot;,i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o(&quot;}&quot;))}return o(&quot;return m&quot;)};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r(&quot;d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s&quot;,o,t,o,o,t,o,o):r(&quot;d%s=types[%i].toObject(m%s,o)&quot;,o,t,o);else{var s=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;d%s=o.json&amp;&amp;!isFinite(m%s)?String(m%s):m%s&quot;,o,o,o,o);break;case&quot;uint64&quot;:s=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&#x27;if(typeof m%s===&quot;number&quot;)&#x27;,o)(&quot;d%s=o.longs===String?String(m%s):m%s&quot;,o,o,o)(&quot;else&quot;)(&quot;d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low&gt;&gt;&gt;0,m%s.high&gt;&gt;&gt;0).toNumber(%s):m%s&quot;,o,o,o,o,s?&quot;true&quot;:&quot;&quot;,o);break;case&quot;bytes&quot;:r(&quot;d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s&quot;,o,o,o,o,o);break;default:r(&quot;d%s=m%s&quot;,o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()(&quot;return {}&quot;);for(var o=$r.codegen([&quot;m&quot;,&quot;o&quot;],e.name+&quot;$toObject&quot;)(&quot;if(!o)&quot;)(&quot;o={}&quot;)(&quot;var d={}&quot;),s=[],a=[],i=[],n=0;n&lt;t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o(&quot;if(o.arrays||o.defaults){&quot;),n=0;n&lt;s.length;++n)o(&quot;d%s=[]&quot;,$r.safeProp(s[n].name));o(&quot;}&quot;)}if(a.length){for(o(&quot;if(o.objects||o.defaults){&quot;),n=0;n&lt;a.length;++n)o(&quot;d%s={}&quot;,$r.safeProp(a[n].name));o(&quot;}&quot;)}if(i.length){for(o(&quot;if(o.defaults){&quot;),n=0;n&lt;i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o(&quot;d%s=o.enums===String?%j:%j&quot;,c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o(&quot;if(util.Long){&quot;)(&quot;var n=new util.Long(%i,%i,%j)&quot;,l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)(&quot;d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n&quot;,c)(&quot;}else&quot;)(&quot;d%s=o.longs===String?%j:%i&quot;,c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u=&quot;[&quot;+Array.prototype.slice.call(l.typeDefault).join(&quot;,&quot;)+&quot;]&quot;;o(&quot;if(o.bytes===String)d%s=%j&quot;,c,String.fromCharCode.apply(String,l.typeDefault))(&quot;else{&quot;)(&quot;d%s=%s&quot;,c,u)(&quot;if(o.bytes!==Array)d%s=util.newBuffer(d%s)&quot;,c,c)(&quot;}&quot;)}else o(&quot;d%s=%j&quot;,c,l.typeDefault)}o(&quot;}&quot;)}var f=!1;for(n=0;n&lt;t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o(&quot;var ks2&quot;)),o(&quot;if(m%s&amp;&amp;(ks2=Object.keys(m%s)).length){&quot;,c,c)(&quot;d%s={}&quot;,c)(&quot;for(var j=0;j&lt;ks2.length;++j){&quot;),gy(o,l,_,c+&quot;[ks2[j]]&quot;)(&quot;}&quot;)):l.repeated?(o(&quot;if(m%s&amp;&amp;m%s.length){&quot;,c,c)(&quot;d%s=[]&quot;,c)(&quot;for(var j=0;j&lt;m%s.length;++j){&quot;,c),gy(o,l,_,c+&quot;[j]&quot;)(&quot;}&quot;)):(o(&quot;if(m%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,c,l.name),gy(o,l,_,c),l.partOf&amp;&amp;o(&quot;if(o.oneofs)&quot;)(&quot;d%s=%j&quot;,$r.safeProp(l.partOf.name),l.name)),o(&quot;}&quot;)}return o(&quot;return d&quot;)}});var yy=T(tq=&gt;{&quot;use strict&quot;;var upe=tq,fpe=f_();upe[&quot;.google.protobuf.Any&quot;]={fromObject:function(r){if(r&amp;&amp;r[&quot;@type&quot;]){var e=r[&quot;@type&quot;].substring(r[&quot;@type&quot;].lastIndexOf(&quot;/&quot;)+1),t=this.lookup(e);if(t){var o=r[&quot;@type&quot;].charAt(0)===&quot;.&quot;?r[&quot;@type&quot;].slice(1):r[&quot;@type&quot;];return o.indexOf(&quot;/&quot;)===-1&amp;&amp;(o=&quot;/&quot;+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t=&quot;type.googleapis.com/&quot;,o=&quot;&quot;,s=&quot;&quot;;if(e&amp;&amp;e.json&amp;&amp;r.type_url&amp;&amp;r.value){s=r.type_url.substring(r.type_url.lastIndexOf(&quot;/&quot;)+1),o=r.type_url.substring(0,r.type_url.lastIndexOf(&quot;/&quot;)+1);var a=this.lookup(s);a&amp;&amp;(r=a.decode(r.value))}if(!(r instanceof this.ctor)&amp;&amp;r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]===&quot;.&quot;?r.$type.fullName.slice(1):r.$type.fullName;return o===&quot;&quot;&amp;&amp;(o=t),s=o+n,i[&quot;@type&quot;]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=&gt;{&quot;use strict&quot;;nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className=&quot;Type&quot;;var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e&lt;r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error(&quot;duplicate id &quot;+o+&quot; in &quot;+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t&lt;this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t&lt;this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&amp;&amp;Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen([&quot;p&quot;],e.name),o=0,s;o&lt;e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t(&quot;this%s={}&quot;,_t.safeProp(s.name)):s.repeated&amp;&amp;t(&quot;this%s=[]&quot;,_t.safeProp(s.name));return t(&quot;if(p)for(var ks=Object.keys(p),i=0;i&lt;ks.length;++i)if(p[ks[i]]!=null)&quot;)(&quot;this[ks[i]]=p[ks[i]]&quot;)};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a&lt;s.length;++a)o.add((typeof t.fields[s[a]].keyType&lt;&quot;u&quot;?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a&lt;s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a&lt;s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&amp;&amp;t.extensions.length&amp;&amp;(o.extensions=t.extensions),t.reserved&amp;&amp;t.reserved.length&amp;&amp;(o.reserved=t.reserved),t.group&amp;&amp;(o.group=!0),t.comment&amp;&amp;(o.comment=t.comment),t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;oneofs&quot;,or.arrayToJSON(this.oneofsArray,e),&quot;fields&quot;,or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},&quot;extensions&quot;,this.extensions&amp;&amp;this.extensions.length?this.extensions:void 0,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;group&quot;,this.group||void 0,&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o&lt;e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o&lt;t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&amp;&amp;this.oneofs[e]||this.nested&amp;&amp;this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);if(e instanceof p_&amp;&amp;e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(&quot;duplicate id &quot;+e.id+&quot; in &quot;+this);if(this.isReservedId(e.id))throw Error(&quot;id &quot;+e.id+&quot; is reserved in &quot;+this);if(this.isReservedName(e.name))throw Error(&quot;name &#x27;&quot;+e.name+&quot;&#x27; is reserved in &quot;+this);return e.parent&amp;&amp;e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&amp;&amp;e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o&lt;this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&amp;&amp;t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=&gt;{&quot;use strict&quot;;sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className=&quot;Root&quot;;var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,&quot;&quot;,r),this.deferred=[],this.files=[],this._edition=&quot;proto2&quot;,this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&amp;&amp;t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t==&quot;function&quot;&amp;&amp;(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&amp;&amp;O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf(&quot;google/protobuf/&quot;);if(O&gt;-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&amp;&amp;O.charAt(0)===&quot;{&quot;&amp;&amp;(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I&lt;y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&amp;&amp;c(A);if(y.weakImports)for(I=0;I&lt;y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&amp;&amp;c(A,!0)}}catch(M){i(M)}!a&amp;&amp;!u&amp;&amp;i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)&gt;-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString(&quot;utf8&quot;)}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&amp;&amp;(e=[e]);for(var f=0,_;f&lt;e.length;++f)(_=s.resolvePath(&quot;&quot;,e[f]))&amp;&amp;c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error(&quot;not supported&quot;);return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(&quot;unresolvable extensions: &quot;+this.deferred.map(function(e){return&quot;&#x27;extend &quot;+e.extend+&quot;&#x27; in &quot;+e.parent.fullName}).join(&quot;, &quot;));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&amp;&amp;!e.extensionField&amp;&amp;(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&amp;&amp;(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t&lt;this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o&lt;e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&amp;&amp;(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&amp;&amp;(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t&gt;-1&amp;&amp;this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&amp;&amp;delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o&lt;e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&amp;&amp;delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=&gt;{&quot;use strict&quot;;var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire(&quot;fs&quot;);He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s&lt;t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o&lt;e.length;){var s=e[o++],a=e[o++];a!==void 0&amp;&amp;(t[s]=a)}return t};var vpe=/\\/g,ype=/&quot;/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?&#x27;[&quot;&#x27;+e.replace(vpe,&quot;\\\\&quot;).replace(ype,&#x27;\\&quot;&#x27;)+&#x27;&quot;]&#x27;:&quot;.&quot;+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&amp;&amp;e.$type.name!==t&amp;&amp;(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,&quot;$type&quot;,{value:o,enumerable:!1}),Object.defineProperty(e.prototype,&quot;$type&quot;,{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly(&quot;Enum&quot;+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,&quot;$type&quot;,{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c===&quot;__proto__&quot;||c===&quot;prototype&quot;)return i;if(n.length&gt;0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&amp;&amp;s)return i;u&amp;&amp;(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!=&quot;object&quot;)throw TypeError(&quot;dst must be an object&quot;);if(!t)throw TypeError(&quot;path must be specified&quot;);return t=t.split(&quot;.&quot;),a(e,t,o)};Object.defineProperty(He,&quot;decorateRoot&quot;,{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=&gt;{&quot;use strict&quot;;var Gc=cq,Rpe=rt(),Npe=[&quot;double&quot;,&quot;float&quot;,&quot;int32&quot;,&quot;uint32&quot;,&quot;sint32&quot;,&quot;fixed32&quot;,&quot;sfixed32&quot;,&quot;int64&quot;,&quot;uint64&quot;,&quot;sint64&quot;,&quot;fixed64&quot;,&quot;sfixed64&quot;,&quot;bool&quot;,&quot;string&quot;,&quot;bytes&quot;];function Hc(r,e){var t=0,o={};for(e|=0;t&lt;r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,&quot;&quot;,Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=&gt;{&quot;use strict&quot;;fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className=&quot;Field&quot;;var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&amp;&amp;(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e&lt;0)throw TypeError(&quot;id must be a non-negative integer&quot;);if(!Ke.isString(t))throw TypeError(&quot;type must be a string&quot;);if(o!==void 0&amp;&amp;!Cpe.test(o=o.toString().toLowerCase()))throw TypeError(&quot;rule must be a string rule&quot;);if(s!==void 0&amp;&amp;!Ke.isString(s))throw TypeError(&quot;extend must be a string&quot;);o===&quot;proto3_optional&quot;&amp;&amp;(o=&quot;optional&quot;),this.rule=o&amp;&amp;o!==&quot;optional&quot;?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o===&quot;repeated&quot;,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t===&quot;bytes&quot;,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,&quot;required&quot;,{get:function(){return this._features.field_presence===&quot;LEGACY_REQUIRED&quot;}});Object.defineProperty(nt.prototype,&quot;optional&quot;,{get:function(){return!this.required}});Object.defineProperty(nt.prototype,&quot;delimited&quot;,{get:function(){return this.resolvedType instanceof qc&amp;&amp;this._features.message_encoding===&quot;DELIMITED&quot;}});Object.defineProperty(nt.prototype,&quot;packed&quot;,{get:function(){return this._features.repeated_field_encoding===&quot;PACKED&quot;}});Object.defineProperty(nt.prototype,&quot;hasPresence&quot;,{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==&quot;IMPLICIT&quot;}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;rule&quot;,this.rule!==&quot;optional&quot;&amp;&amp;this.rule||void 0,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&amp;&amp;this.options.proto3_optional&amp;&amp;(this.typeDefault=null),this.options&amp;&amp;this.options.default!=null&amp;&amp;(this.typeDefault=this.options.default,this.resolvedType instanceof uq&amp;&amp;typeof this.typeDefault==&quot;string&quot;&amp;&amp;(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&amp;&amp;(this.options.packed!==void 0&amp;&amp;this.resolvedType&amp;&amp;!(this.resolvedType instanceof uq)&amp;&amp;delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)===&quot;u&quot;),Object.freeze&amp;&amp;Object.freeze(this.typeDefault);else if(this.bytes&amp;&amp;typeof this.typeDefault==&quot;string&quot;){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&amp;&amp;(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!==&quot;proto2&quot;&amp;&amp;e!==&quot;proto3&quot;)return{};var t={};if(this.rule===&quot;required&quot;&amp;&amp;(t.field_presence=&quot;LEGACY_REQUIRED&quot;),this.parent&amp;&amp;xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(&quot;.&quot;).pop());o&amp;&amp;o instanceof qc&amp;&amp;o.group&amp;&amp;(t.message_encoding=&quot;DELIMITED&quot;)}return this.getOption(&quot;packed&quot;)===!0?t.repeated_field_encoding=&quot;PACKED&quot;:this.getOption(&quot;packed&quot;)===!1&amp;&amp;(t.repeated_field_encoding=&quot;EXPANDED&quot;),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t==&quot;function&quot;?t=Ke.decorateType(t).name:t&amp;&amp;typeof t==&quot;object&quot;&amp;&amp;(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=&gt;{&quot;use strict&quot;;hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className=&quot;OneOf&quot;;var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError(&quot;fieldNames must be an Array&quot;);this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject([&quot;options&quot;,this.options,&quot;oneof&quot;,this.oneof,&quot;comment&quot;,t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e&lt;r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);return e.parent&amp;&amp;e.parent!==this.parent&amp;&amp;e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);var t=this.fieldsArray.indexOf(e);if(t&lt;0)throw Error(e+&quot; is not a member of &quot;+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t&gt;-1&amp;&amp;this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o&lt;this.oneof.length;++o){var s=e.get(this.oneof[o]);s&amp;&amp;!s.partOf&amp;&amp;(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t&lt;this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&amp;&amp;o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,&quot;isProto3Optional&quot;,{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&amp;&amp;r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t&lt;arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=&gt;{&quot;use strict&quot;;_q.exports=ct;ct.className=&quot;ReflectionObject&quot;;var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:&quot;OPEN&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;},bpe={enum_type:&quot;CLOSED&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;LEGACY_BEST_EFFORT&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;EXPANDED&quot;,utf8_validation:&quot;NONE&quot;},Lpe={enum_type:&quot;OPEN&quot;,field_presence:&quot;IMPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;};function ct(r,e){if(!Yc.isString(r))throw TypeError(&quot;name must be a string&quot;);if(e&amp;&amp;!Yc.isObject(e))throw TypeError(&quot;options must be an object&quot;);this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition=&quot;proto2&quot;,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(&quot;.&quot;)}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&amp;&amp;this.parent!==e&amp;&amp;this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&amp;&amp;t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&amp;&amp;t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&amp;&amp;(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error(&quot;Unknown edition for &quot;+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e===&quot;proto2&quot;)t=Object.assign({},bpe);else if(e===&quot;proto3&quot;)t=Object.assign({},Lpe);else if(e===&quot;2023&quot;)t=Object.assign({},Ipe);else throw new Error(&quot;Unknown edition: &quot;+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error(&quot;Unable to find a parent for &quot;+this.fullName);this.extensionField&amp;&amp;(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&amp;&amp;(this.getOption(e)!==t&amp;&amp;(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s&lt;o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+&quot; &quot;+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===&quot;proto3&quot;))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=&gt;{&quot;use strict&quot;;mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className=&quot;Enum&quot;;var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&amp;&amp;typeof e!=&quot;object&quot;)throw TypeError(&quot;values must be an object&quot;);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n&lt;i.length;++n)typeof e[i[n]]==&quot;number&quot;&amp;&amp;(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=&gt;{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&amp;&amp;this.valuesOptions[t]&amp;&amp;this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,this.options,&quot;valuesOptions&quot;,this.valuesOptions,&quot;values&quot;,this.values,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;comment&quot;,t?this.comment:void 0,&quot;comments&quot;,t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);if(!y_.isInteger(t))throw TypeError(&quot;id must be an integer&quot;);if(this.values[e]!==void 0)throw Error(&quot;duplicate name &#x27;&quot;+e+&quot;&#x27; in &quot;+this);if(this.isReservedId(t))throw Error(&quot;id &quot;+t+&quot; is reserved in &quot;+this);if(this.isReservedName(e))throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; is reserved in &quot;+this);if(this.valuesById[t]!==void 0){if(!(this.options&amp;&amp;this.options.allow_alias))throw Error(&quot;duplicate id &quot;+t+&quot; in &quot;+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&amp;&amp;(this.valuesOptions===void 0&amp;&amp;(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);var t=this.values[e];if(t==null)throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; does not exist in &quot;+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&amp;&amp;delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=&gt;{&quot;use strict&quot;;Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r(&quot;types[%i].encode(%s,w.uint32(%i)).uint32(%i)&quot;,t,o,(e.id&lt;&lt;3|3)&gt;&gt;&gt;0,(e.id&lt;&lt;3|4)&gt;&gt;&gt;0):r(&quot;types[%i].encode(%s,w.uint32(%i).fork()).ldelim()&quot;,t,o,(e.id&lt;&lt;3|2)&gt;&gt;&gt;0)}function Mpe(r){for(var e=Dy.codegen([&quot;m&quot;,&quot;w&quot;],r.name+&quot;$encode&quot;)(&quot;if(!w)&quot;)(&quot;w=Writer.create()&quot;),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t&lt;s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?&quot;int32&quot;:a.type,l=wy.basic[n];o=&quot;m&quot;+Dy.safeProp(a.name),a.map?(e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j)){&quot;,o,a.name)(&quot;for(var ks=Object.keys(%s),i=0;i&lt;ks.length;++i){&quot;,o)(&quot;w.uint32(%i).fork().uint32(%i).%s(ks[i])&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e(&quot;types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()&quot;,i,o):e(&quot;.uint32(%i).%s(%s[ks[i]]).ldelim()&quot;,16|l,n,o),e(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(e(&quot;if(%s!=null&amp;&amp;%s.length){&quot;,o,o),a.packed&amp;&amp;wy.packed[n]!==void 0?e(&quot;w.uint32(%i).fork()&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0)(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o)(&quot;w.%s(%s[i])&quot;,n,o)(&quot;w.ldelim()&quot;):(e(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o),l===void 0?Tq(e,a,i,o+&quot;[i]&quot;):e(&quot;w.uint32(%i).%s(%s[i])&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o)),e(&quot;}&quot;)):(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j))&quot;,o,a.name),l===void 0?Tq(e,a,i,o):e(&quot;w.uint32(%i).%s(%s)&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o))}return e(&quot;return w&quot;)}});var vq=T((yFe,gq)=&gt;{&quot;use strict&quot;;var de=gq.exports=sv();de.build=&quot;light&quot;;function wpe(r,e,t){return typeof e==&quot;function&quot;?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=&gt;{&quot;use strict&quot;;Aq.exports=Oq;var Uy=/[\s{}=;:[\],&#x27;&quot;()&lt;&gt;]/g,Upe=/(?:&quot;([^&quot;\\]*(?:\\.[^&quot;\\]*)*)&quot;)/g,kpe=/(?:&#x27;([^&#x27;\\]*(?:\\.[^&#x27;\\]*)*)&#x27;)/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:&quot;\0&quot;,r:&quot;\r&quot;,n:` `,t:&quot; &quot;};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case&quot;\\&quot;:case&quot;&quot;:return t;default:return qpe[t]||&quot;&quot;}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error(&quot;illegal &quot;+N+&quot; (line &quot;+s+&quot;)&quot;)}function u(){var N=l===&quot;&#x27;&quot;?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c(&quot;string&quot;);return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$&lt;0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===&quot; &quot;||le===&quot; &quot;);for(var v=r.substring(N,z).split(Fpe),W=0;W&lt;v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,&quot;&quot;).trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z&lt;o&amp;&amp;f(z)!==` `;)z++;return z}function y(){if(n.length&gt;0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&amp;&amp;($=!0,++s),++t===o)return null;if(f(t)===&quot;/&quot;){if(++t===o)throw c(&quot;comment&quot;);if(f(t)===&quot;/&quot;)if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&amp;&amp;(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)===&quot;/&quot;;f(++t)!==` `;)if(t===o)return null;++t,te&amp;&amp;(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))===&quot;*&quot;){G=t+1,te=e||f(G)===&quot;*&quot;;do{if(B===` `&amp;&amp;++s,++t===o)throw c(&quot;comment&quot;);z=B,B=f(t)}while(z!==&quot;*&quot;||B!==&quot;/&quot;);++t,te&amp;&amp;(_(G,t-2,$),$=!0),N=!0}else return&quot;/&quot;}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le&lt;o&amp;&amp;!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W===&#x27;&quot;&#x27;||W===&quot;&#x27;&quot;)&amp;&amp;(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c(&quot;token &#x27;&quot;+B+&quot;&#x27;, &#x27;&quot;+N+&quot;&#x27; expected&quot;);return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&amp;&amp;(e||B.type===&quot;*&quot;||B.lineEmpty)&amp;&amp;(z=B.leading?B.text:null)):(a&lt;N&amp;&amp;I(),B=i[N],delete i[N],B&amp;&amp;!B.lineEmpty&amp;&amp;(e||B.type===&quot;/&quot;)&amp;&amp;(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},&quot;line&quot;,{get:function(){return s}})}});var bq=T((AFe,Iq)=&gt;{&quot;use strict&quot;;Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O=&quot;proto2&quot;,y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=&gt;{L._edition=O,Object.keys(I).forEach(b=&gt;{L.getOption(b)===void 0&amp;&amp;L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error(&quot;illegal &quot;+(b||&quot;token&quot;)+&quot; &#x27;&quot;+L+&quot;&#x27; (&quot;+(j?j+&quot;, &quot;:&quot;&quot;)+&quot;line &quot;+s.line+&quot;)&quot;)}function z(){var L=[],b;do{if((b=a())!==&#x27;&quot;&#x27;&amp;&amp;b!==&quot;&#x27;&quot;)throw N(b);L.push(a()),l(b),b=n()}while(b===&#x27;&quot;&#x27;||b===&quot;&#x27;&quot;);return L.join(&quot;&quot;)}function B(L){var b=a();switch(b){case&quot;&#x27;&quot;:case&#x27;&quot;&#x27;:return i(b),z();case&quot;true&quot;:case&quot;TRUE&quot;:return!0;case&quot;false&quot;:case&quot;FALSE&quot;:return!1}try{return te(b,!0)}catch{if(L&amp;&amp;Wr.test(b))return b;throw N(b,&quot;value&quot;)}}function G(L,b){var x,j;do if(b&amp;&amp;((x=n())===&#x27;&quot;&#x27;||x===&quot;&#x27;&quot;)){var q=z();if(L.push(q),O&gt;=2023)throw N(q,&quot;id&quot;)}else try{L.push([j=$(a()),l(&quot;to&quot;,!0)?$(a()):j])}catch(Le){if(b&amp;&amp;Wr.test(x)&amp;&amp;O&gt;=2023)L.push(x);else throw Le}while(l(&quot;,&quot;,!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&amp;&amp;(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut===&quot;option&quot;)Z(ne,ut),l(&quot;;&quot;);else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)===&quot;-&quot;&amp;&amp;(x=-1,L=L.substring(1)),L){case&quot;inf&quot;:case&quot;INF&quot;:case&quot;Inf&quot;:return x*(1/0);case&quot;nan&quot;:case&quot;NAN&quot;:case&quot;Nan&quot;:case&quot;NaN&quot;:return NaN;case&quot;0&quot;:return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,&quot;number&quot;,b)}function $(L,b){switch(L){case&quot;max&quot;:case&quot;MAX&quot;:case&quot;Max&quot;:return 536870911;case&quot;0&quot;:return 0}if(!b&amp;&amp;L.charAt(0)===&quot;-&quot;)throw N(L,&quot;id&quot;);if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,&quot;id&quot;)}function le(){if(f!==void 0)throw N(&quot;package&quot;);if(f=a(),!Wr.test(f))throw N(f,&quot;name&quot;);y=y.define(f),l(&quot;;&quot;)}function v(){var L=n(),b;switch(L){case&quot;weak&quot;:b=m||(m=[]),a();break;case&quot;public&quot;:a();default:b=_||(_=[]);break}L=z(),l(&quot;;&quot;),b.push(L)}function W(){if(l(&quot;=&quot;),O=z(),O&lt;2023)throw N(O,&quot;syntax&quot;);l(&quot;;&quot;)}function R(){if(l(&quot;=&quot;),O=z(),![&quot;2023&quot;].includes(O))throw N(O,&quot;edition&quot;);l(&quot;;&quot;)}function E(L,b){switch(b){case&quot;option&quot;:return Z(L,b),l(&quot;;&quot;),!0;case&quot;message&quot;:return Q(L,b),!0;case&quot;enum&quot;:return Me(L,b),!0;case&quot;service&quot;:return wo(L,b),!0;case&quot;extend&quot;:return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&amp;&amp;(typeof L.comment!=&quot;string&quot;&amp;&amp;(L.comment=c()),L.filename=vn.filename),l(&quot;{&quot;,!0)){for(var q;(q=a())!==&quot;}&quot;;)b(q);l(&quot;;&quot;,!0)}else x&amp;&amp;x(),l(&quot;;&quot;),L&amp;&amp;(typeof L.comment!=&quot;string&quot;||o)&amp;&amp;(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,&quot;type name&quot;);var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case&quot;map&quot;:ce(x,q);break;case&quot;required&quot;:if(O!==&quot;proto2&quot;)throw N(q);case&quot;repeated&quot;:Y(x,q);break;case&quot;optional&quot;:if(O===&quot;proto3&quot;)Y(x,&quot;proto3_optional&quot;);else{if(O!==&quot;proto2&quot;)throw N(q);Y(x,&quot;optional&quot;)}break;case&quot;oneof&quot;:Ne(x,q);break;case&quot;extensions&quot;:G(x.extensions||(x.extensions=[]));break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(x,&quot;optional&quot;);break}}),L.add(x),L===y&amp;&amp;A.push(x)}function Y(L,b,x){var j=a();if(j===&quot;group&quot;){J(L,b);return}for(;j.endsWith(&quot;.&quot;)||n().startsWith(&quot;.&quot;);)j+=a();if(!Wr.test(j))throw N(j,&quot;type&quot;);var q=a();if(!Xr.test(q))throw N(q,&quot;name&quot;);q=M(q),l(&quot;=&quot;);var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et===&quot;option&quot;)Z(ne,Et),l(&quot;;&quot;);else throw N(Et)},function(){We(ne)}),b===&quot;proto3_optional&quot;){var Le=new Pq(&quot;_&quot;+q);ne.setOption(&quot;proto3_optional&quot;,!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&amp;&amp;A.push(ne)}function J(L,b){if(O&gt;=2023)throw N(&quot;group&quot;);var x=a();if(!Xr.test(x))throw N(x,&quot;name&quot;);var j=By.lcFirst(x);x===j&amp;&amp;(x=By.ucFirst(x)),l(&quot;=&quot;);var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case&quot;option&quot;:Z(ne,Et),l(&quot;;&quot;);break;case&quot;required&quot;:case&quot;repeated&quot;:Y(ne,Et);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(ne,&quot;proto3_optional&quot;):Y(ne,&quot;optional&quot;);break;case&quot;message&quot;:Q(ne,Et);break;case&quot;enum&quot;:Me(ne,Et);break;case&quot;reserved&quot;:G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l(&quot;&lt;&quot;);var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,&quot;type&quot;);l(&quot;,&quot;);var x=a();if(!Wr.test(x))throw N(x,&quot;type&quot;);l(&quot;&gt;&quot;);var j=a();if(!Xr.test(j))throw N(j,&quot;name&quot;);l(&quot;=&quot;);var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le===&quot;option&quot;)Z(q,Le),l(&quot;;&quot;);else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new Pq(M(b));C(x,function(q){q===&quot;option&quot;?(Z(x,q),l(&quot;;&quot;)):(i(q),Y(x,&quot;optional&quot;))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new zpe(b);C(x,function(q){switch(q){case&quot;option&quot;:Z(x,q),l(&quot;;&quot;);break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&amp;&amp;(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&amp;&amp;A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,&quot;name&quot;);l(&quot;=&quot;);var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne===&quot;option&quot;)Z(j,ne),l(&quot;;&quot;);else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b===&quot;option&quot;&amp;&amp;(b=a());b!==&quot;=&quot;;){if(b===&quot;(&quot;){var ne=a();l(&quot;)&quot;),b=&quot;(&quot;+ne+&quot;)&quot;}if(q){if(q=!1,b.includes(&quot;.&quot;)&amp;&amp;!b.includes(&quot;(&quot;)){var Le=b.split(&quot;.&quot;);x=Le[0]+&quot;.&quot;,b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&amp;&amp;j[0]===&quot;.&quot;?j.slice(1):j,x=x&amp;&amp;x[x.length-1]===&quot;.&quot;?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l(&quot;{&quot;,!0)){for(var x={};!l(&quot;}&quot;,!0);){if(!Xr.test(Ye=a()))throw N(Ye,&quot;name&quot;);if(Ye===null)throw N(Ye,&quot;end of input&quot;);var j,q=Ye;if(l(&quot;:&quot;,!0),n()===&quot;{&quot;)j=je(L,b+&quot;.&quot;+Ye);else if(n()===&quot;[&quot;){j=[];var ne;if(l(&quot;[&quot;,!0)){do ne=B(!0),j.push(ne);while(l(&quot;,&quot;,!0));l(&quot;]&quot;),typeof ne&lt;&quot;u&quot;&amp;&amp;me(L,b+&quot;.&quot;+Ye,ne)}}else j=B(!0),me(L,b+&quot;.&quot;+Ye,j);var Le=x[q];Le&amp;&amp;(j=[].concat(Le).concat(j)),x[q]=j,l(&quot;,&quot;,!0),l(&quot;;&quot;,!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&amp;&amp;/^features\./.test(b)){I[b]=x;return}L.setOption&amp;&amp;L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&amp;&amp;L.setParsedOption(b,x,j)}function We(L){if(l(&quot;[&quot;,!0)){do Z(L,&quot;option&quot;);while(l(&quot;,&quot;,!0));l(&quot;]&quot;)}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,&quot;service name&quot;);var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q===&quot;rpc&quot;)Do(x,q);else throw N(q)}),L.add(x),L===y&amp;&amp;A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var q=b,ne,Le,ut,Et;if(l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Le=!0),!Wr.test(b=a())||(ne=b,l(&quot;)&quot;),l(&quot;returns&quot;),l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(&quot;)&quot;);var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm===&quot;option&quot;)Z(Lu,dm),l(&quot;;&quot;);else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,&quot;reference&quot;);var x=b;C(null,function(q){switch(q){case&quot;required&quot;:case&quot;repeated&quot;:Y(L,q,x);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(L,&quot;proto3_optional&quot;,x):Y(L,&quot;optional&quot;,x);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(L,&quot;optional&quot;,x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case&quot;package&quot;:if(!u)throw N(Ye);le();break;case&quot;import&quot;:if(!u)throw N(Ye);v();break;case&quot;syntax&quot;:if(!u)throw N(Ye);W();break;case&quot;edition&quot;:if(!u)throw N(Ye);R();break;case&quot;option&quot;:Z(y,Ye),l(&quot;;&quot;,!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=&gt;{&quot;use strict&quot;;xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r=&quot;google/protobuf/&quot;+r+&quot;.proto&quot;,e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr(&quot;any&quot;,{Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}}});var Lq;Nr(&quot;duration&quot;,{Duration:Lq={fields:{seconds:{type:&quot;int64&quot;,id:1},nanos:{type:&quot;int32&quot;,id:2}}}});Nr(&quot;timestamp&quot;,{Timestamp:Lq});Nr(&quot;empty&quot;,{Empty:{fields:{}}});Nr(&quot;struct&quot;,{Struct:{fields:{fields:{keyType:&quot;string&quot;,type:&quot;Value&quot;,id:1}}},Value:{oneofs:{kind:{oneof:[&quot;nullValue&quot;,&quot;numberValue&quot;,&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;structValue&quot;,&quot;listValue&quot;]}},fields:{nullValue:{type:&quot;NullValue&quot;,id:1},numberValue:{type:&quot;double&quot;,id:2},stringValue:{type:&quot;string&quot;,id:3},boolValue:{type:&quot;bool&quot;,id:4},structValue:{type:&quot;Struct&quot;,id:5},listValue:{type:&quot;ListValue&quot;,id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:&quot;repeated&quot;,type:&quot;Value&quot;,id:1}}}});Nr(&quot;wrappers&quot;,{DoubleValue:{fields:{value:{type:&quot;double&quot;,id:1}}},FloatValue:{fields:{value:{type:&quot;float&quot;,id:1}}},Int64Value:{fields:{value:{type:&quot;int64&quot;,id:1}}},UInt64Value:{fields:{value:{type:&quot;uint64&quot;,id:1}}},Int32Value:{fields:{value:{type:&quot;int32&quot;,id:1}}},UInt32Value:{fields:{value:{type:&quot;uint32&quot;,id:1}}},BoolValue:{fields:{value:{type:&quot;bool&quot;,id:1}}},StringValue:{fields:{value:{type:&quot;string&quot;,id:1}}},BytesValue:{fields:{value:{type:&quot;bytes&quot;,id:1}}}});Nr(&quot;field_mask&quot;,{FieldMask:{fields:{paths:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=&gt;{&quot;use strict&quot;;var ii=wq.exports=vq();ii.build=&quot;full&quot;;ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=&gt;{&quot;use strict&quot;;Uq.exports=Dq()});var Vy=T((PFe,ode)=&gt;{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:&quot;google.golang.org/protobuf/types/descriptorpb&quot;,java_package:&quot;com.google.protobuf&quot;,java_outer_classname:&quot;DescriptorProtos&quot;,csharp_namespace:&quot;Google.Protobuf.Reflection&quot;,objc_class_prefix:&quot;GPB&quot;,cc_enable_arenas:!0,optimize_for:&quot;SPEED&quot;},nested:{FileDescriptorSet:{edition:&quot;proto2&quot;,fields:{file:{rule:&quot;repeated&quot;,type:&quot;FileDescriptorProto&quot;,id:1}},extensions:[[536e6,536e6]]},Edition:{edition:&quot;proto2&quot;,values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},package:{type:&quot;string&quot;,id:2},dependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},publicDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:10},weakDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:11},optionDependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:15},messageType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:4},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:5},service:{rule:&quot;repeated&quot;,type:&quot;ServiceDescriptorProto&quot;,id:6},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:7},options:{type:&quot;FileOptions&quot;,id:8},sourceCodeInfo:{type:&quot;SourceCodeInfo&quot;,id:9},syntax:{type:&quot;string&quot;,id:12},edition:{type:&quot;Edition&quot;,id:14}}},DescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},field:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:2},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:6},nestedType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:3},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:4},extensionRange:{rule:&quot;repeated&quot;,type:&quot;ExtensionRange&quot;,id:5},oneofDecl:{rule:&quot;repeated&quot;,type:&quot;OneofDescriptorProto&quot;,id:8},options:{type:&quot;MessageOptions&quot;,id:7},reservedRange:{rule:&quot;repeated&quot;,type:&quot;ReservedRange&quot;,id:9},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:10},visibility:{type:&quot;SymbolVisibility&quot;,id:11}},nested:{ExtensionRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2},options:{type:&quot;ExtensionRangeOptions&quot;,id:3}}},ReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},ExtensionRangeOptions:{edition:&quot;proto2&quot;,fields:{uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999},declaration:{rule:&quot;repeated&quot;,type:&quot;Declaration&quot;,id:2,options:{retention:&quot;RETENTION_SOURCE&quot;}},features:{type:&quot;FeatureSet&quot;,id:50},verification:{type:&quot;VerificationState&quot;,id:3,options:{default:&quot;UNVERIFIED&quot;,retention:&quot;RETENTION_SOURCE&quot;}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:&quot;int32&quot;,id:1},fullName:{type:&quot;string&quot;,id:2},type:{type:&quot;string&quot;,id:3},reserved:{type:&quot;bool&quot;,id:5},repeated:{type:&quot;bool&quot;,id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:3},label:{type:&quot;Label&quot;,id:4},type:{type:&quot;Type&quot;,id:5},typeName:{type:&quot;string&quot;,id:6},extendee:{type:&quot;string&quot;,id:2},defaultValue:{type:&quot;string&quot;,id:7},oneofIndex:{type:&quot;int32&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},options:{type:&quot;FieldOptions&quot;,id:8},proto3Optional:{type:&quot;bool&quot;,id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},options:{type:&quot;OneofOptions&quot;,id:2}}},EnumDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},value:{rule:&quot;repeated&quot;,type:&quot;EnumValueDescriptorProto&quot;,id:2},options:{type:&quot;EnumOptions&quot;,id:3},reservedRange:{rule:&quot;repeated&quot;,type:&quot;EnumReservedRange&quot;,id:4},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:5},visibility:{type:&quot;SymbolVisibility&quot;,id:6}},nested:{EnumReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},EnumValueDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{type:&quot;EnumValueOptions&quot;,id:3}}},ServiceDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},method:{rule:&quot;repeated&quot;,type:&quot;MethodDescriptorProto&quot;,id:2},options:{type:&quot;ServiceOptions&quot;,id:3}}},MethodDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},inputType:{type:&quot;string&quot;,id:2},outputType:{type:&quot;string&quot;,id:3},options:{type:&quot;MethodOptions&quot;,id:4},clientStreaming:{type:&quot;bool&quot;,id:5},serverStreaming:{type:&quot;bool&quot;,id:6}}},FileOptions:{edition:&quot;proto2&quot;,fields:{javaPackage:{type:&quot;string&quot;,id:1},javaOuterClassname:{type:&quot;string&quot;,id:8},javaMultipleFiles:{type:&quot;bool&quot;,id:10},javaGenerateEqualsAndHash:{type:&quot;bool&quot;,id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:&quot;bool&quot;,id:27},optimizeFor:{type:&quot;OptimizeMode&quot;,id:9,options:{default:&quot;SPEED&quot;}},goPackage:{type:&quot;string&quot;,id:11},ccGenericServices:{type:&quot;bool&quot;,id:16},javaGenericServices:{type:&quot;bool&quot;,id:17},pyGenericServices:{type:&quot;bool&quot;,id:18},deprecated:{type:&quot;bool&quot;,id:23},ccEnableArenas:{type:&quot;bool&quot;,id:31,options:{default:!0}},objcClassPrefix:{type:&quot;string&quot;,id:36},csharpNamespace:{type:&quot;string&quot;,id:37},swiftPrefix:{type:&quot;string&quot;,id:39},phpClassPrefix:{type:&quot;string&quot;,id:40},phpNamespace:{type:&quot;string&quot;,id:41},phpMetadataNamespace:{type:&quot;string&quot;,id:44},rubyPackage:{type:&quot;string&quot;,id:45},features:{type:&quot;FeatureSet&quot;,id:50},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],&quot;php_generic_services&quot;,[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:&quot;proto2&quot;,fields:{messageSetWireFormat:{type:&quot;bool&quot;,id:1},noStandardDescriptorAccessor:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},mapEntry:{type:&quot;bool&quot;,id:7},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:11,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:12},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:&quot;proto2&quot;,fields:{ctype:{type:&quot;CType&quot;,id:1,options:{default:&quot;STRING&quot;}},packed:{type:&quot;bool&quot;,id:2},jstype:{type:&quot;JSType&quot;,id:6,options:{default:&quot;JS_NORMAL&quot;}},lazy:{type:&quot;bool&quot;,id:5},unverifiedLazy:{type:&quot;bool&quot;,id:15},deprecated:{type:&quot;bool&quot;,id:3},weak:{type:&quot;bool&quot;,id:10,options:{deprecated:!0}},debugRedact:{type:&quot;bool&quot;,id:16},retention:{type:&quot;OptionRetention&quot;,id:17},targets:{rule:&quot;repeated&quot;,type:&quot;OptionTargetType&quot;,id:19},editionDefaults:{rule:&quot;repeated&quot;,type:&quot;EditionDefault&quot;,id:20},features:{type:&quot;FeatureSet&quot;,id:21},featureSupport:{type:&quot;FeatureSupport&quot;,id:22},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},value:{type:&quot;string&quot;,id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:&quot;Edition&quot;,id:1},editionDeprecated:{type:&quot;Edition&quot;,id:2},deprecationWarning:{type:&quot;string&quot;,id:3},editionRemoved:{type:&quot;Edition&quot;,id:4}}}}},OneofOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:1},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:&quot;proto2&quot;,fields:{allowAlias:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:6,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:7},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:1},features:{type:&quot;FeatureSet&quot;,id:2},debugRedact:{type:&quot;bool&quot;,id:3},featureSupport:{type:&quot;FieldOptions.FeatureSupport&quot;,id:4},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:34},deprecated:{type:&quot;bool&quot;,id:33},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:33},idempotencyLevel:{type:&quot;IdempotencyLevel&quot;,id:34,options:{default:&quot;IDEMPOTENCY_UNKNOWN&quot;}},features:{type:&quot;FeatureSet&quot;,id:35},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:&quot;proto2&quot;,fields:{name:{rule:&quot;repeated&quot;,type:&quot;NamePart&quot;,id:2},identifierValue:{type:&quot;string&quot;,id:3},positiveIntValue:{type:&quot;uint64&quot;,id:4},negativeIntValue:{type:&quot;int64&quot;,id:5},doubleValue:{type:&quot;double&quot;,id:6},stringValue:{type:&quot;bytes&quot;,id:7},aggregateValue:{type:&quot;string&quot;,id:8}},nested:{NamePart:{fields:{namePart:{rule:&quot;required&quot;,type:&quot;string&quot;,id:1},isExtension:{rule:&quot;required&quot;,type:&quot;bool&quot;,id:2}}}}},FeatureSet:{edition:&quot;proto2&quot;,fields:{fieldPresence:{type:&quot;FieldPresence&quot;,id:1,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.value&quot;:&quot;EXPLICIT&quot;}},enumType:{type:&quot;EnumType&quot;,id:2,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;OPEN&quot;}},repeatedFieldEncoding:{type:&quot;RepeatedFieldEncoding&quot;,id:3,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;PACKED&quot;}},utf8Validation:{type:&quot;Utf8Validation&quot;,id:4,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;VERIFY&quot;}},messageEncoding:{type:&quot;MessageEncoding&quot;,id:5,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_LEGACY&quot;,&quot;edition_defaults.value&quot;:&quot;LENGTH_PREFIXED&quot;}},jsonFormat:{type:&quot;JsonFormat&quot;,id:6,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;ALLOW&quot;}},enforceNamingStyle:{type:&quot;EnforceNamingStyle&quot;,id:7,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_METHOD&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;STYLE2024&quot;}},defaultSymbolVisibility:{type:&quot;VisibilityFeature.DefaultSymbolVisibility&quot;,id:8,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;EXPORT_TOP_LEVEL&quot;}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:&quot;proto2&quot;,fields:{defaults:{rule:&quot;repeated&quot;,type:&quot;FeatureSetEditionDefault&quot;,id:1},minimumEdition:{type:&quot;Edition&quot;,id:4},maximumEdition:{type:&quot;Edition&quot;,id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},overridableFeatures:{type:&quot;FeatureSet&quot;,id:4},fixedFeatures:{type:&quot;FeatureSet&quot;,id:5}},reserved:[[1,1],[2,2],&quot;features&quot;]}}},SourceCodeInfo:{edition:&quot;proto2&quot;,fields:{location:{rule:&quot;repeated&quot;,type:&quot;Location&quot;,id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},span:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:2,options:{packed:!0}},leadingComments:{type:&quot;string&quot;,id:3},trailingComments:{type:&quot;string&quot;,id:4},leadingDetachedComments:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:6}}}}},GeneratedCodeInfo:{edition:&quot;proto2&quot;,fields:{annotation:{rule:&quot;repeated&quot;,type:&quot;Annotation&quot;,id:1}},nested:{Annotation:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},sourceFile:{type:&quot;string&quot;,id:2},begin:{type:&quot;int32&quot;,id:3},end:{type:&quot;int32&quot;,id:4},semantic:{type:&quot;Semantic&quot;,id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:&quot;proto2&quot;,values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=&gt;{&quot;use strict&quot;;var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(&quot;.google.protobuf&quot;);var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a&lt;e.file.length;++a){s=t,(o=e.file[a]).package&amp;&amp;o.package.length&amp;&amp;(s=t.define(o.package));var n=Ede(o);if(o.name&amp;&amp;o.name.length&amp;&amp;t.files.push(s.filename=o.name),o.messageType)for(i=0;i&lt;o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i&lt;o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i&lt;o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i&lt;o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i&lt;c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,&quot;_&quot;)||&quot;root&quot;)+&quot;.proto&quot;});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s&lt;r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&amp;&amp;Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&amp;&amp;e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:&quot;Type&quot;+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a&lt;e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a&lt;e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty(&quot;oneofIndex&quot;)&amp;&amp;s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a&lt;e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a&lt;e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&amp;&amp;e.nestedType[a].options.mapEntry&amp;&amp;s.setOption(&quot;map_entry&quot;,!0);if(e.enumType)for(a=0;a&lt;e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&amp;&amp;e.extensionRange.length)for(s.extensions=[],a=0;a&lt;e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&amp;&amp;e.reservedRange.length||e.reservedName&amp;&amp;e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a&lt;e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a&lt;e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o&lt;this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&amp;&amp;Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:&quot;key&quot;,number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:&quot;value&quot;,number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o&lt;this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o&lt;this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&amp;&amp;t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o&lt;this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o&lt;this.reserved.length;++o)typeof this.reserved[o]==&quot;string&quot;?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e)),typeof e.number!=&quot;number&quot;)throw Error(&quot;missing field id&quot;);var s;e.typeName&amp;&amp;e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a=&quot;required&quot;;break;case 3:a=&quot;repeated&quot;;break;default:throw Error(&quot;illegal label: &quot;+e.label)}var i=e.extendee;e.extendee!==void 0&amp;&amp;(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:&quot;field&quot;+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&amp;&amp;(n.options.proto3_optional=!0),e.defaultValue&amp;&amp;e.defaultValue.length){var l=e.defaultValue;switch(l){case&quot;true&quot;:case&quot;TRUE&quot;:l=!0;break;case&quot;false&quot;:case&quot;FALSE&quot;:l=!1;break;default:var c=lde.exec(l);c&amp;&amp;(l=parseInt(l));break}n.setOption(&quot;default&quot;,l)}return hde(e.type)&amp;&amp;(t===&quot;proto3&quot;?e.options&amp;&amp;!e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!1):(!t||t===&quot;proto2&quot;)&amp;&amp;e.options&amp;&amp;e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule===&quot;repeated&quot;?t.label=3:this.required&amp;&amp;e===&quot;proto2&quot;?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&amp;&amp;(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))&lt;0)throw Error(&quot;missing oneof&quot;);return this.options&amp;&amp;(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&amp;&amp;(t.defaultValue=String(this.options.default)),this.options.proto3_optional&amp;&amp;(t.proto3_optional=!0)),e===&quot;proto3&quot;?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e===&quot;proto2&quot;)&amp;&amp;this.packed&amp;&amp;((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a&lt;e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&amp;&amp;i.length?i:&quot;NAME&quot;+n]=n}var l=new yn(e.name&amp;&amp;e.name.length?e.name:&quot;Enum&quot;+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t&lt;o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&amp;&amp;e.name.length?e.name:&quot;oneof&quot;+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&amp;&amp;e.name.length?e.name:&quot;Service&quot;+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a&lt;e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t&lt;this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&amp;&amp;e.name.length?e.name:&quot;Method&quot;+pde++,&quot;rpc&quot;,e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return&quot;double&quot;;case 2:return&quot;float&quot;;case 3:return&quot;int64&quot;;case 4:return&quot;uint64&quot;;case 5:return&quot;int32&quot;;case 6:return&quot;fixed64&quot;;case 7:return&quot;fixed32&quot;;case 8:return&quot;bool&quot;;case 9:return&quot;string&quot;;case 12:return&quot;bytes&quot;;case 13:return&quot;uint32&quot;;case 15:return&quot;sfixed32&quot;;case 16:return&quot;sfixed64&quot;;case 17:return&quot;sint32&quot;;case 18:return&quot;sint64&quot;}throw Error(&quot;illegal type: &quot;+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case&quot;double&quot;:return 1;case&quot;float&quot;:return 2;case&quot;int64&quot;:return 3;case&quot;uint64&quot;:return 4;case&quot;int32&quot;:return 5;case&quot;fixed64&quot;:return 6;case&quot;fixed32&quot;:return 7;case&quot;bool&quot;:return 8;case&quot;string&quot;:return 9;case&quot;bytes&quot;:return 12;case&quot;uint32&quot;:return 13;case&quot;sfixed32&quot;:return 15;case&quot;sfixed64&quot;:return 16;case&quot;sint32&quot;:return 17;case&quot;sint64&quot;:return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error(&quot;illegal type: &quot;+r)}function Vq(r,e){for(var t={},o=0,s,a;o&lt;e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!==&quot;uninterpretedOption&quot;&amp;&amp;Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s&lt;o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&amp;&amp;!Array.isArray(t[i])&amp;&amp;(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split(&quot;.&quot;),o=e.fullName.split(&quot;.&quot;),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&amp;&amp;e instanceof kq)for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&amp;&amp;n!==e)break;++a}else for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];++s,++a);return o.slice(a).join(&quot;.&quot;)}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return&quot;_&quot;+t.toLowerCase()})}function Ede(r){if(r.syntax===&quot;editions&quot;)switch(r.edition){case ae.Edition.EDITION_2023:return&quot;2023&quot;;default:throw new Error(&quot;Unsupported edition &quot;+r.edition)}return r.syntax===&quot;proto3&quot;?&quot;proto3&quot;:&quot;proto2&quot;}function mde(r,e){if(r)if(r===&quot;proto2&quot;||r===&quot;proto3&quot;)e.syntax=r;else switch(e.syntax=&quot;editions&quot;,r){case&quot;2023&quot;:e.edition=ae.Edition.EDITION_2023;break;default:throw new Error(&quot;Unsupported edition &quot;+r)}}});var jq=T((IFe,Tde)=&gt;{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:&quot;string&quot;,id:1},methods:{rule:&quot;repeated&quot;,type:&quot;Method&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},version:{type:&quot;string&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},mixins:{rule:&quot;repeated&quot;,type:&quot;Mixin&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Method:{fields:{name:{type:&quot;string&quot;,id:1},requestTypeUrl:{type:&quot;string&quot;,id:2},requestStreaming:{type:&quot;bool&quot;,id:3},responseTypeUrl:{type:&quot;string&quot;,id:4},responseStreaming:{type:&quot;bool&quot;,id:5},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Mixin:{fields:{name:{type:&quot;string&quot;,id:1},root:{type:&quot;string&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=&gt;{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var zq=T((LFe,gde)=&gt;{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:&quot;string&quot;,id:1},fields:{rule:&quot;repeated&quot;,type:&quot;Field&quot;,id:2},oneofs:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},syntax:{type:&quot;Syntax&quot;,id:6}}},Field:{fields:{kind:{type:&quot;Kind&quot;,id:1},cardinality:{type:&quot;Cardinality&quot;,id:2},number:{type:&quot;int32&quot;,id:3},name:{type:&quot;string&quot;,id:4},typeUrl:{type:&quot;string&quot;,id:6},oneofIndex:{type:&quot;int32&quot;,id:7},packed:{type:&quot;bool&quot;,id:8},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},defaultValue:{type:&quot;string&quot;,id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:&quot;string&quot;,id:1},enumvalue:{rule:&quot;repeated&quot;,type:&quot;EnumValue&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},sourceContext:{type:&quot;SourceContext&quot;,id:4},syntax:{type:&quot;Syntax&quot;,id:5}}},EnumValue:{fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var Wq=T(si=&gt;{&quot;use strict&quot;;Object.defineProperty(si,&quot;__esModule&quot;,{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V(&quot;fs&quot;),$q=V(&quot;path&quot;),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=&gt;{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error(&quot;The includeDirs option must be an array&quot;));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error(&quot;The includeDirs option must be an array&quot;);Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common(&quot;api&quot;,r.nested.google.nested.protobuf.nested),ha.common(&quot;descriptor&quot;,e.nested.google.nested.protobuf.nested),ha.common(&quot;source_context&quot;,t.nested.google.nested.protobuf.nested),ha.common(&quot;type&quot;,o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=&gt;{(function(r,e){function t(o){return o.default||o}typeof define==&quot;function&quot;&amp;&amp;define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c==&quot;object&quot;?(e($c),typeof Gy==&quot;object&quot;&amp;&amp;(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis&lt;&quot;u&quot;?globalThis:typeof self&lt;&quot;u&quot;?self:$c,function(r){&quot;use strict&quot;;Object.defineProperty(r,&quot;__esModule&quot;,{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,&quot;__isLong__&quot;,{value:!0});function o(R){return(R&amp;&amp;R.__isLong__)===!0}function s(R){var E=Math.clz32(R&amp;-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R&gt;&gt;&gt;=0,(Y=0&lt;=R&amp;&amp;R&lt;256)&amp;&amp;(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&amp;&amp;(i[R]=C),C)):(R|=0,(Y=-128&lt;=R&amp;&amp;R&lt;128)&amp;&amp;(Q=a[R],Q)?Q:(C=c(R,R&lt;0?-1:0,!1),Y&amp;&amp;(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R&lt;0)return N;if(R&gt;=A)return $}else{if(R&lt;=-I)return le;if(R+1&gt;=I)return te}return R&lt;0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error(&quot;empty string&quot;);if(typeof E==&quot;number&quot;?(C=E,E=!1):E=!!E,R===&quot;NaN&quot;||R===&quot;Infinity&quot;||R===&quot;+Infinity&quot;||R===&quot;-Infinity&quot;)return E?N:F;if(C=C||10,C&lt;2||36&lt;C)throw RangeError(&quot;radix&quot;);var Q;if((Q=R.indexOf(&quot;-&quot;))&gt;0)throw Error(&quot;interior hyphen&quot;);if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce&lt;R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne&lt;8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R==&quot;number&quot;?l(R,E):typeof R==&quot;string&quot;?f(R,E):c(R.low,R.high,typeof E==&quot;boolean&quot;?E:R.unsigned)}t.fromValue=_;var m=65536,O=1&lt;&lt;24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low&gt;&gt;&gt;0:this.low},v.toNumber=function(){return this.unsigned?(this.high&gt;&gt;&gt;0)*y+(this.low&gt;&gt;&gt;0):this.high*y+(this.low&gt;&gt;&gt;0)},v.toString=function(E){if(E=E||10,E&lt;2||36&lt;E)throw RangeError(&quot;radix&quot;);if(this.isZero())return&quot;0&quot;;if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return&quot;-&quot;+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne=&quot;&quot;;;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()&gt;&gt;&gt;0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length&lt;6;)Z=&quot;0&quot;+Z;Ne=&quot;&quot;+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high&gt;&gt;&gt;0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low&gt;&gt;&gt;0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C&gt;0&amp;&amp;(E&amp;1&lt;&lt;C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high&gt;&gt;21;return E?this.unsigned?!1:E===-1&amp;&amp;!(this.low===0&amp;&amp;this.high===-2097152):!0},v.isZero=function(){return this.high===0&amp;&amp;this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&amp;&amp;this.high&lt;0},v.isPositive=function(){return this.unsigned||this.high&gt;=0},v.isOdd=function(){return(this.low&amp;1)===1},v.isEven=function(){return(this.low&amp;1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&amp;&amp;this.high&gt;&gt;&gt;31===1&amp;&amp;E.high&gt;&gt;&gt;31===1?!1:this.high===E.high&amp;&amp;this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)&lt;0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)&lt;=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)&gt;0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)&gt;=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&amp;&amp;!Q?-1:!C&amp;&amp;Q?1:this.unsigned?E.high&gt;&gt;&gt;0&gt;this.high&gt;&gt;&gt;0||E.high===this.high&amp;&amp;E.low&gt;&gt;&gt;0&gt;this.low&gt;&gt;&gt;0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&amp;&amp;this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high&gt;&gt;&gt;16,Q=this.high&amp;65535,Y=this.low&gt;&gt;&gt;16,J=this.low&amp;65535,ce=E.high&gt;&gt;&gt;16,Ne=E.high&amp;65535,Me=E.low&gt;&gt;&gt;16,Te=E.low&amp;65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y+Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q+Ne,Z+=je&gt;&gt;&gt;16,je&amp;=65535,Z+=C+ce,Z&amp;=65535,c(me&lt;&lt;16|we,Z&lt;&lt;16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&amp;&amp;E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high&gt;&gt;&gt;16,Y=this.high&amp;65535,J=this.low&gt;&gt;&gt;16,ce=this.low&amp;65535,Ne=E.high&gt;&gt;&gt;16,Me=E.high&amp;65535,Te=E.low&gt;&gt;&gt;16,Z=E.low&amp;65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We&gt;&gt;&gt;16,We&amp;=65535,we+=J*Z,me+=we&gt;&gt;&gt;16,we&amp;=65535,we+=ce*Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y*Z,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=J*Te,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=ce*Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&amp;=65535,c(we&lt;&lt;16|We,je&lt;&lt;16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error(&quot;division by zero&quot;);if(e){if(!this.unsigned&amp;&amp;this.high===-2147483648&amp;&amp;E.low===-1&amp;&amp;E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne&lt;=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&amp;&amp;(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&amp;E.low,this.high&amp;E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&lt;&lt;E,this.high&lt;&lt;E|this.low&gt;&gt;&gt;32-E,this.unsigned):c(0,this.low&lt;&lt;E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;E,this.unsigned):c(this.high&gt;&gt;E-32,this.high&gt;=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;&gt;E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high&gt;&gt;&gt;E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.unsigned)):(E-=32,C=32-E,c(this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.unsigned)):(E-=32,C=32-E,c(this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&amp;255,C&gt;&gt;&gt;8&amp;255,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;24,E&amp;255,E&gt;&gt;&gt;8&amp;255,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E&gt;&gt;&gt;24,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;8&amp;255,E&amp;255,C&gt;&gt;&gt;24,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;8&amp;255,C&amp;255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]&lt;&lt;8|E[2]&lt;&lt;16|E[3]&lt;&lt;24,E[4]|E[5]&lt;&lt;8|E[6]&lt;&lt;16|E[7]&lt;&lt;24,C)},t.fromBytesBE=function(E,C){return new t(E[4]&lt;&lt;24|E[5]&lt;&lt;16|E[6]&lt;&lt;8|E[7],E[0]&lt;&lt;24|E[1]&lt;&lt;16|E[2]&lt;&lt;8|E[3],C)},typeof BigInt==&quot;function&quot;&amp;&amp;(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E&gt;&gt;BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E==&quot;bigint&quot;?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low&gt;&gt;&gt;0),C=BigInt(this.unsigned?this.high&gt;&gt;&gt;0:this.high);return C&lt;&lt;BigInt(32)|E});var W=r.default=t})});var ij=T(Je=&gt;{&quot;use strict&quot;;Object.defineProperty(Je,&quot;__esModule&quot;,{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return&quot;@type&quot;in r&amp;&amp;typeof r[&quot;@type&quot;]==&quot;string&quot;}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN=&quot;IDEMPOTENCY_UNKNOWN&quot;,r.NO_SIDE_EFFECTS=&quot;NO_SIDE_EFFECTS&quot;,r.IDEMPOTENT=&quot;IDEMPOTENT&quot;})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===&quot;&quot;?e:r+&quot;.&quot;+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&amp;&amp;typeof r.nested&lt;&quot;u&quot;?Object.keys(r.nested).map(o=&gt;rj(r.nested[o],t)).reduce((o,s)=&gt;o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=&gt;{for(let[o,s]of Object.entries(t))switch(o){case&quot;uninterpreted_option&quot;:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:&quot;/&quot;+e+&quot;/&quot;+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 DescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 EnumDescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error(&quot;Type mismatch in reflection object handling&quot;)}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor(&quot;proto3&quot;).file.map(a=&gt;Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,&quot;&quot;))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=&gt;N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=&gt;{&quot;use strict&quot;;Object.defineProperty(Ie,&quot;__esModule&quot;,{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V(&quot;net&quot;),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)===&quot;channel&quot;?o:void 0,childSubchannel:(o==null?void 0:o.kind)===&quot;subchannel&quot;?o:void 0}),this.events.length&gt;=oj*2&amp;&amp;(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=&gt;({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&amp;&amp;(o.count-=1,o.count===0&amp;&amp;t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=&gt;{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=&gt;{let n=t(),l={id:n,name:s,kind:r};return i&amp;&amp;o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_(&quot;channel&quot;);Ie.registerChannelzSubchannel=x_(&quot;subchannel&quot;);Ie.registerChannelzServer=x_(&quot;server&quot;);Ie.registerChannelzSocket=x_(&quot;socket&quot;);function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r===&quot;&quot;)return[];let e=r.split(&quot;:&quot;).map(o=&gt;Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&amp;&amp;r.toLowerCase().startsWith(&quot;::ffff:&quot;)&amp;&amp;(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(&quot;.&quot;).map(e=&gt;Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf(&quot;::&quot;);o===-1?(e=r,t=&quot;&quot;):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:&quot;CONNECTING&quot;};case Xc.ConnectivityState.IDLE:return{state:&quot;IDLE&quot;};case Xc.ConnectivityState.READY:return{state:&quot;READY&quot;};case Xc.ConnectivityState.SHUTDOWN:return{state:&quot;SHUTDOWN&quot;};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:&quot;TRANSIENT_FAILURE&quot;};default:return{state:&quot;UNKNOWN&quot;}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=&gt;{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=&gt;{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No channel data found for id &quot;+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&amp;&amp;o.length&lt;t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=&gt;{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&amp;&amp;a.length&lt;t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No subchannel data found for id &quot;+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=&gt;{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:&quot;tcpip_address&quot;,tcpip_address:{ip_address:(e=Kde(r.host))!==null&amp;&amp;e!==void 0?e:void 0,port:r.port}}:{address:&quot;uds_address&quot;,uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No socket data found for id &quot;+n});return}let c=l.getInfo(),u=c.security?{model:&quot;tls&quot;,tls:{cipher_suite:c.security.cipherSuiteStandardName?&quot;standard_name&quot;:&quot;other_name&quot;,standard_name:(t=c.security.cipherSuiteStandardName)!==null&amp;&amp;t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&amp;&amp;o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&amp;&amp;s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&amp;&amp;a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&amp;&amp;i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&amp;&amp;l.length&lt;a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r(&quot;channelz.proto&quot;,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=&gt;{&quot;use strict&quot;;Object.defineProperty(w_,&quot;__esModule&quot;,{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe=&quot;subchannel&quot;,she=~(1&lt;&lt;31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new rhe.BackoffTimeout(()=&gt;{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;i!==void 0?i:-1,o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Subchannel created&quot;),this.trace(&quot;Subchannel constructed with options &quot;+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,&quot;subchannel_refcount&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[&quot;grpc.keepalive_time_ms&quot;]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{&quot;grpc.keepalive_time_ms&quot;:t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&amp;&amp;this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=&gt;{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&amp;&amp;this.keepaliveTime&gt;0&amp;&amp;(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]+&#x27; with error &quot;&#x27;+o+&#x27;&quot;&#x27;):this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]),this.channelzEnabled&amp;&amp;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=&gt;{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount-1)),this.refcount-=1,this.refcount===0&amp;&amp;(this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Shutting down&quot;),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error(&quot;Cannot create call, subchannel not READY&quot;);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=&gt;{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=&gt;{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e&gt;this.keepaliveTime&amp;&amp;(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=&gt;{&quot;use strict&quot;;var eO;Object.defineProperty(D_,&quot;__esModule&quot;,{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&amp;&amp;eO!==void 0?eO:&quot;false&quot;)===&quot;true&quot;});var oO=T(Eo=&gt;{&quot;use strict&quot;;Object.defineProperty(Eo,&quot;__esModule&quot;,{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V(&quot;dns&quot;),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V(&quot;net&quot;),uhe=Nc(),Tj=_j(),fhe=&quot;dns_resolver&quot;;function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn(&quot;Resolver constructed for target &quot;+(0,ai.uriToString)(e)),e.authority&amp;&amp;this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&amp;&amp;s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&amp;&amp;a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o[&quot;grpc.service_config_disable_resolution&quot;]===1&amp;&amp;(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoff=new uhe.BackoffTimeout(()=&gt;{this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o[&quot;grpc.dns_min_time_between_resolutions_ms&quot;])!==null&amp;&amp;i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=&gt;{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn(&quot;Returning IP address for target &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn(&quot;Failed to parse DNS address &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn(&quot;Looking up DNS hostname &quot;+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=&gt;{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=&gt;({addresses:[s]}));let o=&quot;[&quot;+t.map(s=&gt;s.host+&quot;:&quot;+s.port).join(&quot;,&quot;)+&quot;]&quot;;if(tn(&quot;Resolved addresses for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=&gt;{this.pendingLookupPromise!==null&amp;&amp;(tn(&quot;Resolution error for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&amp;&amp;this.pendingTxtPromise===null&amp;&amp;(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=&gt;{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&amp;&amp;this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=&gt;{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn(&quot;Using alternative DNS resolver.&quot;);let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=&gt;s.status===&quot;rejected&quot;))throw new Error(o[0].reason);return o.reduce((s,a)=&gt;a.status===&quot;fulfilled&quot;?[...s,...a.value]:s,[]).map(s=&gt;({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=&gt;({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn(&quot;Using alternative DNS resolver.&quot;),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=&gt;{this.stopNextResolutionTimer(),this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&amp;&amp;(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&amp;&amp;(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn(&#x27;resolution update delayed by &quot;min time between resolutions&quot; rate limit&#x27;):tn(&quot;resolution update delayed by backoff timer until &quot;+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)(&quot;dns&quot;,iO),(0,Ej.registerDefaultScheme)(&quot;dns&quot;)}});var sO=T(Zc=&gt;{&quot;use strict&quot;;Object.defineProperty(Zc,&quot;__esModule&quot;,{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V(&quot;net&quot;),hhe=V(&quot;http&quot;),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V(&quot;url&quot;),mhe=oO(),The=&quot;proxy&quot;;function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r=&quot;&quot;,e=&quot;&quot;;if(process.env.grpc_proxy)e=&quot;grpc_proxy&quot;,r=process.env.grpc_proxy;else if(process.env.https_proxy)e=&quot;https_proxy&quot;,r=process.env.https_proxy;else if(process.env.http_proxy)e=&quot;http_proxy&quot;,r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of &quot;${e}&quot; env var`),{}}if(t.protocol!==&quot;http:&quot;)return(0,Jc.log)(_a.LogVerbosity.ERROR,`&quot;${t.protocol}&quot; scheme not supported in proxy URI`),{};let o=null;t.username&amp;&amp;(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,&quot;userinfo found in proxy URI&quot;),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===&quot;&quot;&amp;&amp;(a=&quot;80&quot;);let i={address:`${s}:${a}`};return o&amp;&amp;(i.creds=o),Ea(&quot;Proxy server &quot;+i.address+&quot; set by environment variable &quot;+e),i}function ghe(){let r=process.env.no_grpc_proxy,e=&quot;no_grpc_proxy&quot;;return r||(r=process.env.no_proxy,e=&quot;no_proxy&quot;),r?(Ea(&quot;No proxy server list set by environment variable &quot;+e),r.split(&quot;,&quot;)):[]}function vj(r){let e=r.split(&quot;/&quot;);if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t&lt;0||t&gt;32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(&quot;.&quot;).reduce((e,t)=&gt;(e&lt;&lt;8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1&lt;&lt;32-r.prefixLength;return(yj(e)&amp;o)===(t&amp;o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&amp;&amp;t&amp;&amp;vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e[&quot;grpc.enable_http_proxy&quot;])!==null&amp;&amp;t!==void 0?t:1)===0||r.scheme===&quot;unix&quot;)return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea(&quot;Not using proxy for target in no_proxy list: &quot;+(0,Qc.uriToString)(r)),o;let n={&quot;grpc.http_connect_target&quot;:(0,Qc.uriToString)(r)};return s.creds&amp;&amp;(n[&quot;grpc.http_connect_creds&quot;]=s.creds),{target:{scheme:&quot;dns&quot;,path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!(&quot;grpc.http_connect_target&quot;in e))return Promise.resolve(null);let o=e[&quot;grpc.http_connect_target&quot;],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&amp;&amp;t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:&quot;CONNECT&quot;,path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,&quot;grpc.http_connect_creds&quot;in e&amp;&amp;(l[&quot;Proxy-Authorization&quot;]=&quot;Basic &quot;+Buffer.from(e[&quot;grpc.http_connect_creds&quot;]).toString(&quot;base64&quot;)),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea(&quot;Using proxy &quot;+c+&quot; to connect to &quot;+n.path),new Promise((u,f)=&gt;{let _=hhe.request(n);_.once(&quot;connect&quot;,(m,O,y)=&gt;{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea(&quot;Successfully connected to &quot;+n.path+&quot; through proxy &quot;+c),y.length&gt;0&amp;&amp;O.unshift(y),Ea(&quot;Successfully established a plaintext connection to &quot;+n.path+&quot; through proxy &quot;+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to &quot;+n.path+&quot; through proxy &quot;+c+&quot; with status &quot;+m.statusCode),f())}),_.once(&quot;error&quot;,m=&gt;{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to proxy &quot;+c+&quot; with error &quot;+m.message),f()}),_.end()})}});var lO=T(U_=&gt;{&quot;use strict&quot;;Object.defineProperty(U_,&quot;__esModule&quot;,{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]=&quot;NO_DATA&quot;,r[r.READING_SIZE=1]=&quot;READING_SIZE&quot;,r[r.READING_MESSAGE=2]=&quot;READING_MESSAGE&quot;})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t&lt;e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&amp;&amp;this.readMessageSize&gt;this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining&gt;0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error(&quot;Unexpected read state&quot;)}return s}};U_.StreamDecoder=aO});var Oj=T(k_=&gt;{&quot;use strict&quot;;Object.defineProperty(k_,&quot;__esModule&quot;,{value:!0});k_.Http2SubchannelCall=void 0;var An=V(&quot;http2&quot;),Rhe=V(&quot;os&quot;),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe=&quot;subchannel_call&quot;;function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return&quot;Unknown system error &quot;+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on(&quot;response&quot;,(l,c)=&gt;{let u=&quot;&quot;;for(let f of Object.keys(l))u+=&quot; &quot;+f+&quot;: &quot;+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[&quot;:status&quot;],c&amp;An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on(&quot;trailers&quot;,l=&gt;{this.handleTrailers(l)}),e.on(&quot;data&quot;,l=&gt;{if(this.statusOutput)return;this.trace(&quot;receive HTTP/2 data frame of length &quot;+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace(&quot;parsed message of length &quot;+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on(&quot;end&quot;,()=&gt;{this.readsClosed=!0,this.maybeOutputStatus()}),e.on(&quot;close&quot;,()=&gt;{this.serverEndedCall=!0,process.nextTick(()=&gt;{var l;if(this.trace(&quot;HTTP/2 stream closed with code &quot;+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u=&quot;&quot;;switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u=&quot;Stream refused by server&quot;;break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u=&quot;Connection dropped&quot;):(c=Oe.Status.CANCELLED,u=&quot;Call cancelled&quot;);break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u=&quot;Bandwidth exhausted or memory limit exceeded&quot;;break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u=&quot;Protocol not secure enough&quot;;break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code===&quot;ECONNRESET&quot;||this.internalError.code===&quot;ETIMEDOUT&quot;?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on(&quot;error&quot;,l=&gt;{l.code!==&quot;ERR_HTTP2_STREAM_ERROR&quot;&amp;&amp;(this.trace(&quot;Node error event: message=&quot;+l.message+&quot; code=&quot;+l.code+&quot; errno=&quot;+bhe(l.errno)+&quot; syscall=&quot;+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=&gt;{this.endCall({code:Oe.Status.UNAVAILABLE,details:&quot;Connection dropped&quot;,metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace(&quot;ended with status: code=&quot;+this.finalStatus.code+&#x27; details=&quot;&#x27;+this.finalStatus.details+&#x27;&quot;&#x27;),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=&gt;{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,&quot;[&quot;+this.callId+&quot;] &quot;+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&amp;&amp;(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&amp;&amp;(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&amp;&amp;this.unpushedReadMessages.length===0&amp;&amp;!this.isReadFilterPending&amp;&amp;!this.isPushPending)&amp;&amp;this.outputStatus()}push(e){this.trace(&quot;pushing to reader message of length &quot;+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=&gt;{this.isPushPending=!1,!this.statusOutput&amp;&amp;(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace(&quot;unpushedReadMessages.push message of length &quot;+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t=&quot;&quot;;for(let i of Object.keys(e))t+=&quot; &quot;+i+&quot;: &quot;+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s[&quot;grpc-status&quot;]==&quot;string&quot;){let i=Number(s[&quot;grpc-status&quot;]);this.trace(&quot;received status code &quot;+i+&quot; from server&quot;),o.remove(&quot;grpc-status&quot;);let n=&quot;&quot;;if(typeof s[&quot;grpc-message&quot;]==&quot;string&quot;){try{n=decodeURI(s[&quot;grpc-message&quot;])}catch{n=s[&quot;grpc-message&quot;]}o.remove(&quot;grpc-message&quot;),this.trace(&#x27;received status details string &quot;&#x27;+n+&#x27;&quot; from server&#x27;)}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:&quot;No status information received&quot;,metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace(&quot;close http2 stream with code &quot;+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&amp;&amp;this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length&gt;0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length);let o=s=&gt;{process.nextTick(()=&gt;{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)===&quot;ERR_STREAM_WRITE_AFTER_END&quot;&amp;&amp;(i=Oe.Status.INTERNAL),s&amp;&amp;this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace(&quot;sending data chunk of length &quot;+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace(&quot;end() called&quot;),this.trace(&quot;calling end() on HTTP/2 stream&quot;),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=&gt;{&quot;use strict&quot;;Object.defineProperty(fO,&quot;__esModule&quot;,{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=&gt;{&quot;use strict&quot;;Object.defineProperty(F_,&quot;__esModule&quot;,{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V(&quot;http2&quot;),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V(&quot;net&quot;),Uhe=Oj(),khe=pO(),hO=&quot;transport&quot;,Bhe=&quot;transport_flowctrl&quot;,Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from(&quot;too_many_pings&quot;,&quot;ascii&quot;),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o[&quot;grpc.primary_user_agent&quot;],`grpc-node-js/${Vhe}`,o[&quot;grpc.secondary_user_agent&quot;]].filter(a=&gt;a).join(&quot; &quot;),&quot;grpc.keepalive_time_ms&quot;in o?this.keepaliveTimeMs=o[&quot;grpc.keepalive_time_ms&quot;]:this.keepaliveTimeMs=-1,&quot;grpc.keepalive_timeout_ms&quot;in o?this.keepaliveTimeoutMs=o[&quot;grpc.keepalive_timeout_ms&quot;]:this.keepaliveTimeoutMs=zhe,&quot;grpc.keepalive_permit_without_calls&quot;in o?this.keepaliveWithoutCalls=o[&quot;grpc.keepalive_permit_without_calls&quot;]===1:this.keepaliveWithoutCalls=!1,e.once(&quot;close&quot;,()=&gt;{this.trace(&quot;session closed&quot;),this.handleDisconnect()}),e.once(&quot;goaway&quot;,(a,i,n)=&gt;{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&amp;&amp;n&amp;&amp;n.equals(Khe)&amp;&amp;(l=!0),this.trace(&quot;connection closed by GOAWAY with code &quot;+a+&quot; and data &quot;+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once(&quot;error&quot;,a=&gt;{this.trace(&quot;connection closed with error &quot;+a.message),this.handleDisconnect()}),e.socket.once(&quot;close&quot;,a=&gt;{this.trace(&quot;connection closed. hadError=&quot;+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&amp;&amp;(e.on(&quot;remoteSettings&quot;,a=&gt;{this.trace(&quot;new settings received&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))}),e.on(&quot;localSettings&quot;,a=&gt;{this.trace(&quot;local settings acknowledged by remote&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))})),this.keepaliveWithoutCalls&amp;&amp;this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&amp;&amp;e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&amp;&amp;&quot;raw&quot;in f?f.raw:null,remoteCertificate:_&amp;&amp;&quot;raw&quot;in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&amp;&amp;t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&amp;&amp;o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;transport_internals&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=&gt;t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=&gt;{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&amp;&amp;this.keepaliveTimeMs&gt;0&amp;&amp;(this.keepaliveWithoutCalls||this.activeCalls.size&gt;0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(&quot;keepaliveTimeout is not null&quot;);return}this.channelzEnabled&amp;&amp;(this.keepalivesSent+=1),this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o=&quot;&quot;;try{this.session.ping((a,i,n)=&gt;{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace(&quot;Ping failed with error &quot;+a.message),this.handleDisconnect()):(this.keepaliveTrace(&quot;Received ping response&quot;),this.maybeStartKeepalivePingTimer())})||(o=&quot;Ping returned false&quot;)}catch(s){o=(s instanceof Error?s.message:&quot;&quot;)||&quot;Unknown error&quot;}o&amp;&amp;(this.keepaliveTrace(&quot;Ping send failed: &quot;+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&amp;&amp;(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&amp;&amp;(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&amp;&amp;this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&amp;&amp;(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]=&quot;application/grpc&quot;,i[Hhe]=&quot;POST&quot;,i[qhe]=o,i[jhe]=&quot;trailers&quot;;let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace(&quot;local window size: &quot;+this.session.state.localWindowSize+&quot; remote window size: &quot;+this.session.state.remoteWindowSize),this.internalsTrace(&quot;session.closed=&quot;+this.session.closed+&quot; session.destroyed=&quot;+this.session.destroyed+&quot; session.socket.destroyed=&quot;+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=&gt;{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=&gt;{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+&quot; &quot;+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(&quot;Connection closed before starting HTTP/2 handshake&quot;):new Promise((s,a)=&gt;{let i=null,n=this.channelTarget;if(&quot;grpc.http_connect_target&quot;in o){let A=(0,dO.parseUri)(o[&quot;grpc.http_connect_target&quot;]);A&amp;&amp;(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?&quot;https&quot;:&quot;http&quot;,c=(0,whe.getDefaultAuthority)(n),u=()=&gt;{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=&gt;{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=&gt;{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace(&quot;connection failed with error &quot;+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=&gt;e.socket};o[&quot;grpc-node.flow_control_window&quot;]!==void 0&amp;&amp;(_.settings={initialWindowSize:o[&quot;grpc-node.flow_control_window&quot;]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O=&quot;Failed to connect&quot;,y=!1;m.unref(),m.once(&quot;remoteSettings&quot;,()=&gt;{m.removeAllListeners(),e.socket.removeListener(&quot;close&quot;,u),e.socket.removeListener(&quot;error&quot;,f),s(new _O(m,t,o,i)),this.session=null}),m.once(&quot;close&quot;,u),m.once(&quot;error&quot;,f),e.socket.once(&quot;close&quot;,u),e.socket.once(&quot;error&quot;,f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=&gt;o||new Promise((s,a)=&gt;{let i=()=&gt;{a(new Error(&quot;Socket closed&quot;))},n=c=&gt;{a(c)},l=Dhe.connect(e,()=&gt;{l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),s(l)});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+&quot; Waiting for secureConnector to be ready&quot;),await t.waitForReady(),this.trace(i+&quot; secureConnector is ready&quot;),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+&quot; Established TCP connection&quot;),a=await t.connect(s),this.trace(i+&quot; Established secure connection&quot;),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=&gt;{&quot;use strict&quot;;Object.defineProperty(ru,&quot;__esModule&quot;,{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=&gt;!a.subchannel.unrefIfOneRef());s.length&gt;0&amp;&amp;(e=!1),this.pool[t]=s}e&amp;&amp;this.cleanupTimer!==null&amp;&amp;(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&amp;&amp;(this.cleanupTimer=setInterval(()=&gt;{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&amp;&amp;(0,$he.channelOptionsEqual)(o,l.channelArguments)&amp;&amp;s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=&gt;{&quot;use strict&quot;;Object.defineProperty(Ta,&quot;__esModule&quot;,{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=&gt;e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=&gt;{&quot;use strict&quot;;Object.defineProperty(H_,&quot;__esModule&quot;,{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]=&quot;identity&quot;,r[r.deflate=1]=&quot;deflate&quot;,r[r.gzip=2]=&quot;gzip&quot;})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=&gt;{&quot;use strict&quot;;Object.defineProperty(q_,&quot;__esModule&quot;,{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=&gt;{&quot;use strict&quot;;Object.defineProperty(va,&quot;__esModule&quot;,{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V(&quot;zlib&quot;),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=&gt;typeof r==&quot;number&quot;&amp;&amp;typeof Pj.CompressionAlgorithms[r]==&quot;string&quot;,ga=class{async writeMessage(e,t){let o=e;t&amp;&amp;(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&amp;&amp;(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error(&#x27;Received compressed message but &quot;grpc-encoding&quot; header was identity&#x27;))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.deflate(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createInflate();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.gzip(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createGunzip();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case&quot;identity&quot;:return new mo;case&quot;deflate&quot;:return new OO(e);case&quot;gzip&quot;:return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;;let i=e[&quot;grpc.default_compression_algorithm&quot;];if(this.maxReceiveMessageLength=(o=e[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e[&quot;grpc.max_send_message_length&quot;])!==null&amp;&amp;s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(&quot;,&quot;);(!l||l.includes(n))&amp;&amp;(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set(&quot;grpc-accept-encoding&quot;,&quot;identity,deflate,gzip&quot;),t.set(&quot;accept-encoding&quot;,&quot;identity&quot;),this.currentCompressionAlgorithm===&quot;identity&quot;?t.remove(&quot;grpc-encoding&quot;):t.set(&quot;grpc-encoding&quot;,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(&quot;grpc-encoding&quot;);if(t.length&gt;0){let s=t[0];typeof s==&quot;string&quot;&amp;&amp;(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove(&quot;grpc-encoding&quot;);let o=e.get(&quot;grpc-accept-encoding&quot;)[0];return o&amp;&amp;(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(&quot;,&quot;).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;)),e.remove(&quot;grpc-accept-encoding&quot;),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&amp;&amp;o.message.length&gt;this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&amp;&amp;t!==void 0?t:0)&amp;2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=&gt;{&quot;use strict&quot;;Object.defineProperty(To,&quot;__esModule&quot;,{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o&lt;e&amp;&amp;(e=o)}return e}var s_e=[[&quot;m&quot;,1],[&quot;S&quot;,1e3],[&quot;M&quot;,60*1e3],[&quot;H&quot;,3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&amp;&amp;(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a&lt;1e8)return String(Math.ceil(a))+o}throw new Error(&quot;Deadline is too far in the future&quot;)}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o&lt;0?0:o&gt;l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?&quot;&quot;+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+&quot;s&quot;}});var z_=T(CO=&gt;{&quot;use strict&quot;;Object.defineProperty(CO,&quot;__esModule&quot;,{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=&gt;{&quot;use strict&quot;;Object.defineProperty(X_,&quot;__esModule&quot;,{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V(&quot;http2&quot;),m_e=&quot;load_balancing_call&quot;,IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split(&quot;/&quot;),f=&quot;&quot;;u.length&gt;=2&amp;&amp;(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&amp;&amp;c!==void 0?c:&quot;localhost&quot;;this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime&gt;this.startTime&amp;&amp;(!((e=this.metadata)===null||e===void 0)&amp;&amp;e.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(&quot;Waiting for LB pick&quot;),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error(&quot;doPick called before start&quot;);this.trace(&quot;Pick called&quot;);let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?&quot;(&quot;+s.subchannel.getChannelzRef().id+&quot;) &quot;+s.subchannel.getAddress():&quot;&quot;+s.subchannel;switch(this.trace(&quot;Pick result: &quot;+iu.PickResultType[s.pickResultType]+&quot; subchannel: &quot;+a+&quot; status: &quot;+((e=s.status)===null||e===void 0?void 0:e.code)+&quot; &quot;+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=&gt;{var u;if(this.ended){this.trace(&quot;Credentials metadata generation finished after call ended&quot;);return}if(o.merge(c),o.get(&quot;authorization&quot;).length&gt;1&amp;&amp;this.outputStatus({code:K_.Status.INTERNAL,details:&#x27;&quot;authorization&quot; metadata cannot have multiple values&#x27;,metadata:new $_.Metadata},&quot;PROCESSED&quot;),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace(&quot;Picked subchannel &quot;+a+&quot; has state &quot;+bj.ConnectivityState[s.subchannel.getConnectivityState()]+&quot; after getting credentials metadata. Retrying pick&quot;),this.doPick();return}this.deadline!==1/0&amp;&amp;o.set(&quot;grpc-timeout&quot;,(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=&gt;{this.trace(&quot;Received message&quot;),this.listener.onReceiveMessage(f)},onReceiveStatus:f=&gt;{this.trace(&quot;Received status&quot;),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,&quot;REFUSED&quot;):this.outputStatus(f,&quot;PROCESSED&quot;)}}),this.childStartTime=new Date}catch(f){this.trace(&quot;Failed to start call on picked subchannel &quot;+a+&quot; with error &quot;+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:&quot;Failed to start HTTP/2 stream with error &quot;+f.message,metadata:new $_.Metadata},&quot;NOT_STARTED&quot;);return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace(&quot;Created child call [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage&amp;&amp;this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&amp;&amp;this.child.halfClose()},c=&gt;{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code==&quot;number&quot;?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},&quot;PROCESSED&quot;)});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:n,details:l,metadata:s.status.metadata},&quot;DROP&quot;)});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:c,details:u,metadata:s.status.metadata},&quot;PROCESSED&quot;)})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},&quot;PROCESSED&quot;)}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=&gt;{&quot;use strict&quot;;Object.defineProperty(W_,&quot;__esModule&quot;,{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e=&quot;resolving_call&quot;,bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=&gt;{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&amp;&amp;(o.flags&amp;So.Propagate.CANCELLATION&amp;&amp;o.parentCall.on(&quot;cancelled&quot;,()=&gt;{this.cancelWithStatus(So.Status.CANCELLED,&quot;Cancelled by parent call&quot;)}),o.flags&amp;So.Propagate.DEADLINE&amp;&amp;(this.trace(&quot;Propagating deadline from parent: &quot;+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace(&quot;Created&quot;),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(&quot;Deadline: &quot;+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(&quot;Deadline will be reached in &quot;+e+&quot;ms&quot;);let t=()=&gt;{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,&quot;Deadline exceeded&quot;);return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime&gt;this.deadlineStartTime&amp;&amp;o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime&gt;this.configReceivedTime&amp;&amp;o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push(&quot;waiting for metadata filters&quot;)):o.push(&quot;waiting for name resolution&quot;),this.child&amp;&amp;o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(&quot;,&quot;))};e&lt;=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(&quot;ended with status: code=&quot;+t.code+&#x27; details=&quot;&#x27;+t.details+&#x27;&quot;&#x27;),this.statusWatchers.forEach(o=&gt;o(t)),process.nextTick(()=&gt;{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error(&quot;sendMessageonChild called with child not populated&quot;);let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=&gt;{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&amp;&amp;o.halfClose()},s=&gt;{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error(&quot;getConfig called before start&quot;);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===&quot;NONE&quot;){this.channel.queueCallForConfig(this);return}else if(e.type===&quot;ERROR&quot;){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,&quot;Failed to route call to method &quot;+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=&gt;{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(&quot;Created child [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=&gt;{this.trace(&quot;Received message&quot;),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=&gt;{this.trace(&quot;Finished filtering received message&quot;),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&amp;&amp;this.outputStatus(this.pendingChildStatus)},a=&gt;{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=&gt;{this.trace(&quot;Received status&quot;),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&amp;&amp;this.child.halfClose()},o=&gt;{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child&amp;&amp;!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=&gt;{&quot;use strict&quot;;Object.defineProperty(li,&quot;__esModule&quot;,{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e=&quot;retrying_call&quot;,xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens&gt;this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;return this.limitPerCall-s&lt;e||this.totalLimit-this.totalAllocated&lt;e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;if(s&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&amp;&amp;t!==void 0?t:0;if(this.totalAllocated&lt;o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO=&quot;grpc-previous-rpc-attempts&quot;,N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()[&quot;grpc-node.retry_max_attempts_limit&quot;])!==null&amp;&amp;u!==void 0?u:N_e;if(e.getOptions()[&quot;grpc.enable_retries&quot;]===0)this.state=&quot;NO_RETRY&quot;,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=&quot;RETRY&quot;;let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state=&quot;HEDGING&quot;,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state=&quot;TRANSPARENT_ONLY&quot;,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length&gt;1&amp;&amp;e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime&gt;this.startTime&amp;&amp;e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}reportStatus(e){this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=&gt;{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():&quot;unknown&quot;}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&amp;&amp;t!==void 0?t:{entryType:&quot;FREED&quot;,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==&quot;COMMITTED&quot;)return;let e;this.underlyingCalls[this.committedCallIndex].state===&quot;COMPLETED&quot;?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t&lt;e;t++){let o=this.getBufferEntry(t);o.allocated&amp;&amp;this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!==&quot;COMMITTED&quot;){this.trace(&quot;Committing call [&quot;+this.underlyingCalls[e].call.getCallNumber()+&quot;] at index &quot;+e),this.state=&quot;COMMITTED&quot;,(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s&lt;this.underlyingCalls.length;s++)s!==e&amp;&amp;this.underlyingCalls[s].state!==&quot;COMPLETED&quot;&amp;&amp;(this.underlyingCalls[s].state=&quot;COMPLETED&quot;,this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,&quot;Discarded in favor of other hedged attempt&quot;));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===&quot;COMMITTED&quot;)return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state===&quot;ACTIVE&quot;&amp;&amp;s.nextMessageToSend&gt;e&amp;&amp;(e=s.nextMessageToSend,t=o);t===-1?this.state=&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=&gt;{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!==&quot;RETRY&quot;){t(!1);return}if(this.attempts&gt;=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=&gt;{var s,a;if(this.state!==&quot;RETRY&quot;){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&amp;&amp;a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(&quot;Retry attempt denied by throttling policy&quot;),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case&quot;COMMITTED&quot;:case&quot;NO_RETRY&quot;:case&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;HEDGING&quot;:if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&amp;&amp;s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=&gt;{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&amp;&amp;(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case&quot;RETRY&quot;:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=&gt;{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(&quot;grpc-retry-pushback-ms&quot;);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state===&quot;COMPLETED&quot;)return;if(this.trace(&quot;state=&quot;+this.state+&quot; handling status with progress &quot;+e.progress+&quot; from child [&quot;+this.underlyingCalls[t].call.getCallNumber()+&quot;] in state &quot;+this.underlyingCalls[t].state),this.underlyingCalls[t].state=&quot;COMPLETED&quot;,e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;NO_RETRY&quot;){this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;COMMITTED&quot;){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case&quot;NOT_STARTED&quot;:this.startNewAttempt();break;case&quot;REFUSED&quot;:this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case&quot;DROP&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;PROCESSED&quot;:this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state===&quot;HEDGING&quot;&amp;&amp;this.callConfig.methodConfig.hedgingPolicy&amp;&amp;(this.attempts&gt;=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&amp;&amp;clearTimeout(this.hedgingTimer),this.state!==&quot;HEDGING&quot;||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts&gt;=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&amp;&amp;e!==void 0?e:&quot;0s&quot;,i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=&gt;{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(&quot;Created child call [&quot;+e.getCallNumber()+&quot;] for attempt &quot;+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:&quot;ACTIVE&quot;,call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o&gt;0&amp;&amp;s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=&gt;{this.trace(&quot;Received metadata from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),a=!0,o&gt;0&amp;&amp;i.set(LO,`${o}`),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMetadata(i)},onReceiveMessage:i=&gt;{this.trace(&quot;Received message from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMessage(i)},onReceiveStatus:i=&gt;{this.trace(&quot;Received status from child [&quot;+e.getCallNumber()+&quot;]&quot;),!a&amp;&amp;o&gt;0&amp;&amp;i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&amp;&amp;e.startRead()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!==&quot;COMPLETED&quot;&amp;&amp;this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case&quot;MESSAGE&quot;:t.call.sendMessageWithContext({callback:s=&gt;{this.handleChildWriteCompleted(e)}},o.message.message);break;case&quot;HALF_CLOSE&quot;:t.nextMessageToSend+=1,t.call.halfClose();break;case&quot;FREED&quot;:break}}}sendMessageWithContext(e,t){var o;this.trace(&quot;write() called with message of length &quot;+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:&quot;MESSAGE&quot;,message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state===&quot;ACTIVE&quot;&amp;&amp;l.nextMessageToSend===a&amp;&amp;l.call.sendMessageWithContext({callback:c=&gt;{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===&quot;ACTIVE&quot;&amp;&amp;n.nextMessageToSend===a&amp;&amp;n.call.sendMessageWithContext({callback:l=&gt;{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace(&quot;startRead called&quot;),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)===&quot;ACTIVE&quot;&amp;&amp;e.call.startRead()}halfClose(){this.trace(&quot;halfClose called&quot;);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:&quot;HALF_CLOSE&quot;,allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;t.nextMessageToSend===e&amp;&amp;(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=&gt;{&quot;use strict&quot;;Object.defineProperty(Q_,&quot;__esModule&quot;,{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=&gt;{this.healthy&amp;&amp;this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&amp;&amp;this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&amp;&amp;(this.healthy=e,this.child.isHealthy()&amp;&amp;this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=&gt;{&quot;use strict&quot;;Object.defineProperty(vo,&quot;__esModule&quot;,{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1&lt;&lt;24,q_e=1&lt;&lt;20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=&gt;{t.throttleKeepalive(i)}}ref(){this.refCount===0&amp;&amp;(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:&quot;Channel closed before call started&quot;,metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=&quot;grpc.internal.no_subchannel&quot;;var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=&gt;({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof C_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name &quot;${e}&quot;`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name &quot;${e}&quot;`);this.options[&quot;grpc.enable_channelz&quot;]===0&amp;&amp;(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Channel created&quot;),this.options[&quot;grpc.default_authority&quot;]?this.defaultAuthority=this.options[&quot;grpc.default_authority&quot;]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options[&quot;grpc.use_local_subchannel_pool&quot;])!==null&amp;&amp;s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options[&quot;grpc.retry_buffer_size&quot;])!==null&amp;&amp;a!==void 0?a:H_e,(i=this.options[&quot;grpc.per_rpc_retry_buffer_size&quot;])!==null&amp;&amp;i!==void 0?i:q_e),this.keepaliveTime=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options[&quot;grpc.client_idle_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=&gt;{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Created subchannel or used existing subchannel&quot;,M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=&gt;{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=&gt;{throw new Error(&quot;Resolving load balancer should never call requestReresolution&quot;)},addChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=&gt;{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Address resolution succeeded&quot;),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=&gt;{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_WARNING&quot;,&quot;Address resolution failed with code &quot;+y.code+&#x27; and details &quot;&#x27;+y.details+&#x27;&quot;&#x27;),this.configSelectionQueue.length&gt;0&amp;&amp;this.trace(&quot;Name resolution failed with calls queued for config selection&quot;),this.configSelector===null&amp;&amp;(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace(&quot;Channel constructed with options &quot;+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)(&quot;channel_stacktrace&quot;)&amp;&amp;(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;channel_stacktrace&quot;,&quot;(&quot;+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,&quot;channel&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=&gt;{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&amp;&amp;t.call(e)||(this.trace(&quot;callRefTimer.ref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&amp;&amp;e.hasRef)||this.callRefTimer.hasRef())&amp;&amp;(this.trace(&quot;callRefTimer.unref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=&gt;o===e);t&gt;=0&amp;&amp;this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;connectivity_state&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+sr.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+sr.ConnectivityState[e]),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&amp;&amp;(o.timer&amp;&amp;clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.currentResolutionError=null)}throttleKeepalive(e){if(e&gt;this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:&quot;SUCCESS&quot;,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:&quot;ERROR&quot;,error:this.currentResolutionError}:{type:&quot;NONE&quot;}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&amp;&amp;(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&amp;&amp;(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=&gt;{if(this.callCount&gt;0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a&gt;=this.idleTimeoutMs?(this.trace(&quot;Idle timer triggered after &quot;+this.idleTimeoutMs+&quot;ms of inactivity&quot;),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;!this.idleTimer&amp;&amp;this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&amp;&amp;this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&amp;&amp;(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createLoadBalancingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createRetryingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace(&quot;createResolvingCall [&quot;+i+&#x27;] method=&quot;&#x27;+e+&#x27;&quot;, deadline=&#x27;+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=&gt;{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.pickQueue=[],this.callRefTimer&amp;&amp;clearInterval(this.callRefTimer),this.idleTimer&amp;&amp;clearTimeout(this.idleTimer),this.channelzEnabled&amp;&amp;(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&amp;&amp;(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i&lt;=n){process.nextTick(o,new Error(&quot;Deadline passed without connectivity state change&quot;));return}s=setTimeout(()=&gt;{this.removeConnectivityStateWatcher(a),o(new Error(&quot;Deadline passed without connectivity state change&quot;))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=&gt;{&quot;use strict&quot;;Object.defineProperty(nE,&quot;__esModule&quot;,{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof j_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=&gt;{&quot;use strict&quot;;Object.defineProperty(Cr,&quot;__esModule&quot;,{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V(&quot;events&quot;),XO=V(&quot;stream&quot;),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:&quot;message&quot;in r?r.message:&quot;Unknown Error&quot;,metadata:(t=e??r.metadata)!==null&amp;&amp;t!==void 0?t:null};return&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;&amp;&amp;Number.isInteger(r.code)&amp;&amp;(o.code=r.code,&quot;details&quot;in r&amp;&amp;typeof r.details==&quot;string&quot;&amp;&amp;(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,a=&gt;{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,s=&gt;{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=&gt;{&quot;use strict&quot;;Object.defineProperty(ya,&quot;__esModule&quot;,{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&amp;&amp;!Buffer.isBuffer(e))throw new TypeError(&quot;rootCerts must be null or a Buffer&quot;);if(!Array.isArray(t))throw new TypeError(&quot;keyCertPairs must be an array&quot;);if(typeof o!=&quot;boolean&quot;)throw new TypeError(&quot;checkClientCertificate must be a boolean&quot;);let a=[],i=[];for(let n=0;n&lt;t.length;n++){let l=t[n];if(l===null||typeof l!=&quot;object&quot;)throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&amp;&amp;s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&amp;&amp;Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&amp;&amp;Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t&lt;this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&amp;&amp;Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t&lt;this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&amp;&amp;this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t&lt;this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=&gt;{&quot;use strict&quot;;Object.defineProperty(ar,&quot;__esModule&quot;,{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V(&quot;http2&quot;),Vj=Mh(),Fj=V(&quot;zlib&quot;),X_e=lO(),jj=Pe(),Yj=&quot;server_call&quot;;function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&amp;&amp;(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,!this.cancelled&amp;&amp;(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,!this.cancelled&amp;&amp;(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=&gt;{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveHalfClose:r=&gt;{r()},onCancel:()=&gt;{}},sE={start:r=&gt;{r()},sendMetadata:(r,e)=&gt;{e(r)},sendMessage:(r,e)=&gt;{e(r)},sendStatus:(r,e)=&gt;{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&amp;&amp;o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&amp;&amp;s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&amp;&amp;a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&amp;&amp;i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&amp;&amp;(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&amp;&amp;(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=&gt;{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&amp;&amp;o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&amp;&amp;s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&amp;&amp;a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&amp;&amp;i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj=&quot;grpc-accept-encoding&quot;,cA=&quot;grpc-encoding&quot;,Gj=&quot;grpc-message&quot;,Hj=&quot;grpc-status&quot;,nA=&quot;grpc-timeout&quot;,J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:&quot;identity,deflate,gzip&quot;,[cA]:&quot;identity&quot;},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding=&quot;identity&quot;,this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once(&quot;error&quot;,u=&gt;{}),this.stream.once(&quot;close&quot;,()=&gt;{var u;Oo(&quot;Request to method &quot;+((u=this.handler)===null||u===void 0?void 0:u.path)+&quot; stream closed with rstCode &quot;+this.stream.rstCode),this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:&quot;Stream closed before sending status&quot;,metadata:null})),this.notifyOnCancel()}),this.stream.on(&quot;data&quot;,u=&gt;{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on(&quot;end&quot;,()=&gt;{this.handleEndEvent()}),&quot;grpc.max_send_message_length&quot;in a&amp;&amp;(this.maxSendMessageSize=a[&quot;grpc.max_send_message_length&quot;]),&quot;grpc.max_receive_message_length&quot;in a&amp;&amp;(this.maxReceiveMessageSize=a[&quot;grpc.max_receive_message_length&quot;]),this.host=(i=t[&quot;:authority&quot;])!==null&amp;&amp;i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&amp;&amp;Oo(&quot;Request to &quot;+this.handler.path+&quot; received headers &quot;+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length&gt;0&amp;&amp;this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length&gt;0&amp;&amp;(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value &quot;${e}&quot;`,metadata:null};process.nextTick(()=&gt;{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=&gt;{let a={code:bt.Status.DEADLINE_EXCEEDED,details:&quot;Deadline exceeded&quot;,metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&amp;&amp;(this.stream.destroyed||this.stream.closed)&amp;&amp;(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=&gt;{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&amp;&amp;clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t===&quot;identity&quot;)return o;if(t===&quot;deflate&quot;||t===&quot;gzip&quot;){let s;return t===&quot;deflate&quot;?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=&gt;{let n=0,l=[];s.on(&quot;data&quot;,c=&gt;{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&amp;&amp;n&gt;this.maxReceiveMessageSize&amp;&amp;(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on(&quot;end&quot;,()=&gt;{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding &quot;${t}&quot;`})}async decompressAndMaybePush(e){if(e.type!==&quot;COMPRESSED&quot;)throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:&quot;identity&quot;,s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type=&quot;READABLE&quot;,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&amp;&amp;this.isReadPending&amp;&amp;this.readQueue.length&gt;0&amp;&amp;this.readQueue[0].type!==&quot;COMPRESSED&quot;){this.isReadPending=!1;let e=this.readQueue.shift();e.type===&quot;READABLE&quot;?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo(&quot;Request to &quot;+this.handler.path+&quot; received data frame of size &quot;+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:&quot;COMPRESSED&quot;,compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:&quot;HALF_CLOSE&quot;,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo(&quot;Request to &quot;+this.handler.path+&quot; start called&quot;),!this.checkCancelled()&amp;&amp;(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&amp;&amp;o.length-5&gt;this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo(&quot;Request to &quot;+this.handler.path+&quot; sent data frame of size &quot;+o.length),this.stream.write(o,s=&gt;{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo(&quot;Request to method &quot;+((t=this.handler)===null||t===void 0?void 0:t.path)+&quot; ended with status code: &quot;+bt.Status[e.code]+&quot; details: &quot;+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(&quot;wantTrailers&quot;,()=&gt;{var s;this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo(&quot;Request to &quot;+this.handler.path+&quot; startRead called&quot;),!this.checkCancelled()&amp;&amp;(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&amp;&amp;t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:&quot;unknown&quot;}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type===&quot;clientStream&quot;||s.type===&quot;bidi&quot;,responseStream:s.type===&quot;serverStream&quot;||s.type===&quot;bidi&quot;,requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=&gt;c(i,l),n)}});var Zj=T(fi=&gt;{&quot;use strict&quot;;var rEe=fi&amp;&amp;fi.__runInitializers||function(r,e,t){for(var o=arguments.length&gt;2,s=0;s&lt;e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&amp;&amp;fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&amp;&amp;typeof I!=&quot;function&quot;)throw new TypeError(&quot;Function expected&quot;);return I}for(var n=o.kind,l=n===&quot;getter&quot;?&quot;get&quot;:n===&quot;setter&quot;?&quot;set&quot;:&quot;value&quot;,c=!e&amp;&amp;r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m&gt;=0;m--){var O={};for(var y in o)O[y]=y===&quot;access&quot;?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError(&quot;Cannot add initializers after decoration has completed&quot;);a.push(i(I||null))};var A=(0,t[m])(n===&quot;accessor&quot;?{get:u.get,set:u.set}:u[l],O);if(n===&quot;accessor&quot;){if(A===void 0)continue;if(A===null||typeof A!=&quot;object&quot;)throw new TypeError(&quot;Object expected&quot;);(f=i(A.get))&amp;&amp;(u.get=f),(f=i(A.set))&amp;&amp;(u.set=f),(f=i(A.init))&amp;&amp;s.unshift(f)}else(f=i(A))&amp;&amp;(n===&quot;field&quot;?s.unshift(f):u[l]=f)}c&amp;&amp;Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,&quot;__esModule&quot;,{value:!0});fi.Server=void 0;var Lt=V(&quot;http2&quot;),iEe=V(&quot;util&quot;),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1&lt;&lt;31),pA=~(1&lt;&lt;31),oEe=2e4,Xj=~(1&lt;&lt;31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe=&quot;server&quot;,Jj=Buffer.from(&quot;max_age&quot;);function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,&quot;server_call&quot;,r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case&quot;unary&quot;:return(o,s)=&gt;{s(t,null)};case&quot;clientStream&quot;:return(o,s)=&gt;{s(t,null)};case&quot;serverStream&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};case&quot;bidi&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=&gt;{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString=&quot;null&quot;,this.channelzEnabled=!0,this.options=s??{},this.options[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)(&quot;server&quot;,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Server created&quot;),this.maxConnectionAgeMs=(a=this.options[&quot;grpc.max_connection_age_ms&quot;])!==null&amp;&amp;a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options[&quot;grpc.max_connection_age_grace_ms&quot;])!==null&amp;&amp;i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options[&quot;grpc.keepalive_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options[&quot;grpc.max_connection_idle_ms&quot;])!==null&amp;&amp;c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},&quot;grpc-node.max_session_memory&quot;in this.options?this.commonServerOptions.maxSessionMemory=this.options[&quot;grpc-node.max_session_memory&quot;]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,&quot;grpc.max_concurrent_streams&quot;in this.options&amp;&amp;(this.commonServerOptions.settings={maxConcurrentStreams:this.options[&quot;grpc.max_concurrent_streams&quot;]}),this.interceptors=(u=this.options.interceptors)!==null&amp;&amp;u!==void 0?u:[],this.trace(&quot;Server constructed&quot;)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&amp;&amp;a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&amp;&amp;&quot;raw&quot;in A?A.raw:null,remoteCertificate:I&amp;&amp;&quot;raw&quot;in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&amp;&amp;i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&amp;&amp;n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}addProtoService(){throw new Error(&quot;Not implemented. Use addService() instead&quot;)}addService(s,a){if(s===null||typeof s!=&quot;object&quot;||a===null||typeof a!=&quot;object&quot;)throw new Error(&quot;addService() requires two objects as arguments&quot;);let i=Object.keys(s);if(i.length===0)throw new Error(&quot;Cannot add an empty service to a server&quot;);i.forEach(n=&gt;{let l=s[n],c;l.requestStream?l.responseStream?c=&quot;bidi&quot;:c=&quot;clientStream&quot;:l.responseStream?c=&quot;serverStream&quot;:c=&quot;unary&quot;;let u=a[n],f;if(u===void 0&amp;&amp;typeof l.originalName==&quot;string&quot;&amp;&amp;(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!=&quot;object&quot;)throw new Error(&quot;removeService() requires object as argument&quot;);Object.keys(s).forEach(i=&gt;{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error(&quot;Not implemented. Use bindAsync() instead&quot;)}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=&gt;({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options[&quot;grpc-node.tls_enable_trace&quot;]===1}),c=n!==null;this.trace(&quot;Initial credentials valid: &quot;+c),a=Lt.createSecureServer(l),a.prependListener(&quot;connection&quot;,f=&gt;{c||(this.trace(&quot;Dropped connection from &quot;+JSON.stringify(f.address())+&quot; due to unloaded credentials&quot;),f.destroy())}),a.on(&quot;secureConnection&quot;,f=&gt;{f.on(&quot;error&quot;,_=&gt;{this.trace(&quot;An incoming TLS connection closed with error: &quot;+_.message)})});let u=f=&gt;{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,&quot;Failed to set secure context with error &quot;+m.message),f=null}}c=f!==null,this.trace(&quot;Post-update credentials valid: &quot;+c)};s._addWatcher(u),a.on(&quot;close&quot;,()=&gt;{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace(&quot;Attempting to bind &quot;+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=&gt;{let c=u=&gt;{this.trace(&quot;Failed to bind &quot;+(0,ui.subchannelAddressToString)(s)+&quot; with error &quot;+u.message),n({port:&quot;port&quot;in s?s.port:1,error:u.message})};i.once(&quot;error&quot;,c),i.listen(s,()=&gt;{let u=i.address(),f;typeof u==&quot;string&quot;?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace(&quot;Successfully bound &quot;+(0,ui.subchannelAddressToString)(f)),n({port:&quot;port&quot;in f?f.port:1}),i.removeListener(&quot;error&quot;,c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&amp;&amp;s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=&gt;(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=&gt;this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=&gt;u.error===void 0).length,port:i.port,errors:c.filter(u=&gt;u.error).map(u=&gt;u.error)}}}else{let i=await Promise.all(s.map(n=&gt;this.bindOneAddress(n,a)));return{count:i.filter(n=&gt;n.error===void 0).length,port:i[0].port,errors:i.filter(n=&gt;n.error).map(n=&gt;n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count&gt;0)return i.count&lt;s.length&amp;&amp;Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(&quot;,&quot;)}]`)}}resolvePort(s){return new Promise((a,i)=&gt;{let n={onSuccessfulResolution:(c,u,f)=&gt;{n.onSuccessfulResolution=()=&gt;{};let _=[].concat(...c.map(m=&gt;m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=&gt;{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port &quot;${s}&quot;`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port &quot;${s}&quot;`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error(&quot;bindAsync called after shutdown&quot;);if(typeof s!=&quot;string&quot;)throw new TypeError(&quot;port must be a string&quot;);if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);if(typeof i!=&quot;function&quot;)throw new TypeError(&quot;callback must be a function&quot;);this.trace(&quot;bindAsync port=&quot;+s);let n=this.normalizePort(s),l=(_,m)=&gt;{process.nextTick(()=&gt;i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=&gt;i(null,_),_=&gt;i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=&gt;{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=&gt;{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=&gt;{c.completionPromise=null,c.portNumber=_,i(null,_)},_=&gt;{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)(&quot;injector&quot;,()=&gt;({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);this.channelzEnabled&amp;&amp;this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=&gt;{n.emit(&quot;connection&quot;,c)},drain:c=&gt;{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=&gt;{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=&gt;{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace(&quot;Closing server with address &quot;+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=&gt;{i&amp;&amp;i.ownsChannelzRef&amp;&amp;(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace(&quot;Closing session initiated by &quot;+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=&gt;{n&amp;&amp;(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=&gt;{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace(&quot;unbind port=&quot;+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error(&quot;Cannot unbind port 0&quot;);let n=this.boundPorts.get((0,Pr.uriToString)(a));n&amp;&amp;(this.trace(&quot;unbinding &quot;+n.mapKey+&quot; originally bound as &quot;+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace(&quot;drain port=&quot;+s+&quot; graceTimeMs=&quot;+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error(&quot;Cannot drain port 0&quot;);let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=&gt;{f.delete(O)})}(n=(i=setTimeout(()=&gt;{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=&gt;{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=&gt;!s.listening))throw new Error(&quot;server must be bound in order to start&quot;);if(this.started===!0)throw new Error(&quot;server is already started&quot;);this.started=!0}tryShutdown(s){var a;let i=c=&gt;{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&amp;&amp;i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace(&quot;Waiting for server &quot;+f+&quot; to close&quot;),this.closeServer(c,()=&gt;{this.trace(&quot;Server &quot;+f+&quot; finished closing&quot;),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace(&quot;Waiting for session &quot;+m+&quot; to close&quot;),this.closeSession(_,()=&gt;{this.trace(&quot;Session &quot;+m+&quot; finished closing&quot;),l()})}}n===0&amp;&amp;i()}addHttp2Port(){throw new Error(&quot;Not yet implemented&quot;)}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!=&quot;string&quot;||!i.startsWith(&quot;application/grpc&quot;)?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj(&quot;Received call to method &quot;+s+&quot; at address &quot;+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj(&quot;No handler registered for method &quot;+s+&quot;. Sending UNIMPLEMENTED status.&quot;),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({&quot;grpc-status&quot;:(n=s.code)!==null&amp;&amp;n!==void 0?n:qe.Status.INTERNAL,&quot;grpc-message&quot;:s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=&gt;{n&amp;&amp;(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=&gt;{n&amp;&amp;(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=&gt;{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=&gt;{n&amp;&amp;(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i===&quot;unary&quot;)fEe(s,a);else if(i===&quot;clientStream&quot;)pEe(s,a);else if(i===&quot;serverStream&quot;)dEe(s,a);else if(i===&quot;bidi&quot;)hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n=&quot;null&quot;;i&amp;&amp;(typeof i==&quot;string&quot;?n=i:n=i.address+&quot;:&quot;+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on(&quot;stream&quot;,l.bind(this,a)),s.on(&quot;session&quot;,c)}_sessionHandler(s){return a=&gt;{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=&gt;{var F,N;f=!0,this.trace(&quot;Connection dropped by max connection age: &quot;+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(c=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=&gt;{u&amp;&amp;(clearTimeout(u),u=null)},O=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,y,A=()=&gt;{var I;O()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),u=setTimeout(()=&gt;{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=&gt;{var I;if(!O())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let M=&quot;&quot;;try{a.ping((N,z,B)=&gt;{m(),N?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+N.message),f=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),A())})||(M=&quot;Ping returned false&quot;)}catch(F){M=(F instanceof Error?F.message:&quot;&quot;)||&quot;Unknown error&quot;}if(M){this.keepaliveTrace(&quot;Ping send failed: &quot;+M),this.trace(&quot;Connection dropped due to ping send error: &quot;+M),f=!0,a.close();return}u=setTimeout(()=&gt;{m(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.trace(&quot;Connection dropped by keepalive timeout&quot;),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on(&quot;close&quot;,()=&gt;{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&amp;&amp;clearTimeout(l),c&amp;&amp;clearTimeout(c),m(),_!==null&amp;&amp;(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=&gt;{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&amp;&amp;n!==void 0?n:&quot;unknown&quot;,this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection established by client &quot;+_),this.trace(&quot;Connection established by client &quot;+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=&gt;{var te;A=!0,this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by max connection age from &quot;+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(O=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=&gt;{y&amp;&amp;(clearTimeout(y),y=null)},F=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,N,z=()=&gt;{var B;F()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),y=setTimeout(()=&gt;{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=&gt;{var B;if(!F())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let G=&quot;&quot;;try{a.ping(($,le,v)=&gt;{M(),$?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+$.message),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to error of a ping frame &quot;+$.message+&quot; return in &quot;+le),A=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),z())})||(G=&quot;Ping returned false&quot;)}catch(te){G=(te instanceof Error?te.message:&quot;&quot;)||&quot;Unknown error&quot;}if(G){this.keepaliveTrace(&quot;Ping send failed: &quot;+G),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to ping send error: &quot;+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=&gt;{M(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by keepalive timeout from &quot;+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on(&quot;close&quot;,()=&gt;{var B;A||this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by client &quot;+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&amp;&amp;clearTimeout(m),O&amp;&amp;clearTimeout(O),M(),I!==null&amp;&amp;(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout&gt;=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace(&quot;Enable idle timeout for &quot;+l.remoteAddress+&quot;:&quot;+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&amp;&amp;n.activeStreams===0&amp;&amp;(Date.now()-n.lastIdle&gt;=s.sessionIdleTimeout?(s.trace(&quot;Session idle timeout triggered for &quot;+(i==null?void 0:i.remoteAddress)+&quot;:&quot;+(i==null?void 0:i.remotePort)+&quot; last idle at &quot;+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&amp;&amp;(i.activeStreams+=1,s.once(&quot;close&quot;,i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&amp;&amp;(n.activeStreams-=1,n.activeStreams===0&amp;&amp;(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace(&quot;Session onStreamClose&quot;+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+&quot;:&quot;+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+&quot; at &quot;+n.lastIdle)))}},(()=&gt;{let o=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.metadata?Object.create(null):void 0;t=[lEe(&quot;Calling start() is no longer necessary. It can be safely omitted.&quot;)],nEe(r,null,t,{kind:&quot;method&quot;,name:&quot;start&quot;,static:!1,private:!1,access:{has:s=&gt;&quot;start&quot;in s,get:s=&gt;s.start},metadata:o},null,e),o&amp;&amp;Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}});var e4=T(lE=&gt;{&quot;use strict&quot;;Object.defineProperty(lE,&quot;__esModule&quot;,{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&amp;&amp;(e.code=this.code),this.details!==null&amp;&amp;(e.details=this.details),this.metadata!==null&amp;&amp;(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=&gt;{&quot;use strict&quot;;Object.defineProperty(Ca,&quot;__esModule&quot;,{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds==&quot;number&quot;&amp;&amp;typeof r.nanos==&quot;number&quot;}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,&quot;0&quot;),10):0}:null}});var cE=T(on=&gt;{&quot;use strict&quot;;Object.defineProperty(on,&quot;__esModule&quot;,{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V(&quot;net&quot;),yEe=&quot;pick_first&quot;;function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au=&quot;pick_first&quot;,OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if(&quot;shuffleAddressList&quot;in e&amp;&amp;typeof e.shuffleAddressList!=&quot;boolean&quot;)throw new Error(&quot;pick_first config field shuffleAddressList must be a boolean if provided&quot;);return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t&gt;1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&amp;&amp;(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&amp;&amp;(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n&lt;Math.max(a.length,i.length);n++)n&lt;a.length&amp;&amp;e.push(a[n]),n&lt;i.length&amp;&amp;e.push(i[n]);return e}var o4=&quot;grpc-node.internal.pick-first.report_health_status&quot;,lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=&gt;{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=&gt;this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=&gt;{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=&gt;e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=&gt;e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&amp;&amp;!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&amp;&amp;(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&amp;&amp;a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&amp;&amp;(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&amp;&amp;this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(n.hasReportedTransientFailure=!0,s&amp;&amp;(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&amp;&amp;this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t&gt;=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&amp;&amp;(su(&quot;Start connecting to subchannel with address &quot;+this.children[e].subchannel.getAddress()),process.nextTick(()=&gt;{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=&gt;{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su(&quot;Pick subchannel with address &quot;+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su(&quot;connectToAddressList([&quot;+e.map(s=&gt;(0,t4.subchannelAddressToString)(s))+&quot;])&quot;);let o=e.map(s=&gt;({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&amp;&amp;(e=i4(e));let s=[].concat(...e.map(i=&gt;i.addresses));su(&quot;updateAddressList([&quot;+s.map(i=&gt;(0,t4.subchannelAddressToString)(i))+&quot;])&quot;),s.length===0&amp;&amp;(this.lastError=&quot;No addresses resolved&quot;);let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&amp;&amp;this.latestAddressList&amp;&amp;this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=&gt;{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&amp;&amp;this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=&gt;{&quot;use strict&quot;;Object.defineProperty(fE,&quot;__esModule&quot;,{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V(&quot;fs&quot;),PEe=Pe(),IEe=ue(),bEe=V(&quot;util&quot;),LEe=&quot;certificate_provider&quot;;function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error(&quot;certificateFile and privateKeyFile must be set or unset together&quot;);if(e.certificateFile===void 0&amp;&amp;e.caCertificateFile===void 0)throw new Error(&quot;At least one of certificateFile and caCertificateFile must be set&quot;);uE(&quot;File watcher constructed with config &quot;+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=&gt;{if(this.refreshTimer){uE(&quot;File watcher read certificates certificate &quot;+e.status+&quot;, privateKey &quot;+t.status+&quot;, CA certificate &quot;+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===&quot;fulfilled&quot;&amp;&amp;t.status===&quot;fulfilled&quot;?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status===&quot;fulfilled&quot;?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE(&quot;File watcher initiated certificate update&quot;))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e&gt;this.config.refreshIntervalMs&amp;&amp;this.updateCertificates(),e&gt;this.config.refreshIntervalMs*2&amp;&amp;(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=&gt;this.updateCertificates(),this.config.refreshIntervalMs),uE(&quot;File watcher started watching&quot;)}}maybeStopWatchingFiles(){this.caListeners.size===0&amp;&amp;this.identityListeners.size===0&amp;&amp;(this.fileResultPromise=null,this.refreshTimer&amp;&amp;(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=&gt;{&quot;use strict&quot;;Object.defineProperty(k,&quot;__esModule&quot;,{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,&quot;trace&quot;,{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,&quot;log&quot;,{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,&quot;registerResolver&quot;,{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,&quot;createResolver&quot;,{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,&quot;uriToString&quot;,{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,&quot;splitHostPort&quot;,{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,&quot;durationToMs&quot;,{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,&quot;parseDuration&quot;,{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,&quot;BackoffTimeout&quot;,{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,&quot;createChildChannelControlHelper&quot;,{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,&quot;registerLoadBalancerType&quot;,{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,&quot;selectLbConfigFromList&quot;,{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,&quot;parseLoadBalancingConfig&quot;,{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,&quot;isLoadBalancerNameRegistered&quot;,{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,&quot;LeafLoadBalancer&quot;,{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,&quot;subchannelAddressToString&quot;,{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,&quot;endpointToString&quot;,{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,&quot;endpointHasAddress&quot;,{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,&quot;EndpointMap&quot;,{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,&quot;ChildLoadBalancerHandler&quot;,{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,&quot;UnavailablePicker&quot;,{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,&quot;QueuePicker&quot;,{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,&quot;PickResultType&quot;,{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,&quot;BaseFilter&quot;,{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,&quot;FilterStackFactory&quot;,{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,&quot;registerAdminService&quot;,{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,&quot;BaseSubchannelWrapper&quot;,{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,&quot;createServerCredentialsWithInterceptors&quot;,{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,&quot;createCertificateProviderServerCredentials&quot;,{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,&quot;FileWatcherCertificateProvider&quot;,{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,&quot;createCertificateProviderChannelCredentials&quot;,{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,&quot;SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX&quot;,{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=&gt;{&quot;use strict&quot;;Object.defineProperty(AA,&quot;__esModule&quot;,{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===&quot;&quot;?s=&quot;/&quot;+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return&quot;localhost&quot;}};function qEe(){(0,HEe.registerResolver)(&quot;unix&quot;,OA)}});var m4=T(PA=&gt;{&quot;use strict&quot;;Object.defineProperty(PA,&quot;__esModule&quot;,{value:!0});PA.setup=KEe;var d4=V(&quot;net&quot;),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe=&quot;ip_resolver&quot;;function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA=&quot;ipv4&quot;,CA=&quot;ipv6&quot;,zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4(&quot;Resolver constructed for target &quot;+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(&quot;,&quot;);for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&amp;&amp;!(0,d4.isIPv4)(l.host)||e.scheme===CA&amp;&amp;!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&amp;&amp;s!==void 0?s:zEe})}this.endpoints=a.map(n=&gt;({addresses:[n]})),E4(&quot;Parsed &quot;+e.scheme+&quot; address list &quot;+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=&gt;{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(&quot;,&quot;)[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=&gt;{&quot;use strict&quot;;Object.defineProperty(uu,&quot;__esModule&quot;,{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe=&quot;round_robin&quot;;function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E=&quot;round_robin&quot;,bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=&gt;{this.currentState===yt.ConnectivityState.READY&amp;&amp;t!==yt.ConnectivityState.READY&amp;&amp;this.channelControlHelper.requestReresolution(),s&amp;&amp;(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=&gt;t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)&gt;0){let e=this.children.filter(o=&gt;o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=&gt;(0,T4.endpointEqual)(s.getEndpoint(),o)),t&lt;0&amp;&amp;(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=&gt;({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)&gt;0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)&gt;0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&amp;&amp;e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4(&quot;Connect to endpoint list &quot;+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=&gt;new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=&gt;{&quot;use strict&quot;;var xA;Object.defineProperty(No,&quot;__esModule&quot;,{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome=&quot;outlier_detection&quot;;function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA=&quot;outlier_detection&quot;,sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&amp;&amp;xA!==void 0?xA:&quot;true&quot;)===&quot;true&quot;,ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&amp;&amp;r[e]!==void 0&amp;&amp;typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&amp;&amp;r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds&gt;=0&amp;&amp;r[e].seconds&lt;=315576e6&amp;&amp;r[e].nanos&gt;=0&amp;&amp;r[e].nanos&lt;=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,&quot;number&quot;,t),e in r&amp;&amp;r[e]!==void 0&amp;&amp;!(r[e]&gt;=0&amp;&amp;r[e]&lt;=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()===&quot;pick_first&quot;)throw new Error(&quot;outlier_detection LB policy cannot have a pick_first child policy&quot;);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&amp;&amp;e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&amp;&amp;t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,&quot;interval&quot;),wA(e,&quot;base_ejection_time&quot;),wA(e,&quot;max_ejection_time&quot;),mE(e,&quot;max_ejection_percent&quot;),&quot;success_rate_ejection&quot;in e&amp;&amp;e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config success_rate_ejection must be an object&quot;);Ia(e.success_rate_ejection,&quot;stdev_factor&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),mE(e.success_rate_ejection,&quot;enforcement_percentage&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;)}if(&quot;failure_percentage_ejection&quot;in e&amp;&amp;e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config failure_percentage_ejection must be an object&quot;);mE(e.failure_percentage_ejection,&quot;threshold&quot;,&quot;failure_percentage_ejection&quot;),mE(e.failure_percentage_ejection,&quot;enforcement_percentage&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;)}if(!(&quot;child_policy&quot;in e)||!Array.isArray(e.child_policy))throw new Error(&quot;outlier detection config child_policy must be an array&quot;);let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error(&quot;outlier detection config child_policy: no valid recognized policy found&quot;);return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&amp;&amp;t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e&gt;=0&amp;&amp;this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&amp;&amp;(a=i=&gt;{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=&gt;{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&amp;&amp;i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=&gt;{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=&gt;{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&amp;&amp;(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&amp;&amp;(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it(&quot;Running success rate check&quot;);let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it(&quot;Stats for &quot;+(0,MA.endpointToString)(f)+&quot;: successes=&quot;+m+&quot; failures=&quot;+O+&quot; targetRequestVolume=&quot;+o),m+O&gt;=o&amp;&amp;(s+=1,a.push(m/(m+O)))}if(it(&quot;Found &quot;+s+&quot; success rate candidates; currentEjectionPercent=&quot;+this.getCurrentEjectionPercent()+&quot; successRates=[&quot;+a+&quot;]&quot;),s&lt;t.minimum_hosts)return;let i=a.reduce((f,_)=&gt;f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it(&quot;stdev=&quot;+c+&quot; ejectionThreshold=&quot;+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O&lt;o)continue;let y=m/(m+O);if(it(&quot;Checking candidate &quot;+f+&quot; successRate=&quot;+y),y&lt;u){let A=Math.random()*100;it(&quot;Candidate &quot;+f+&quot; randomNumber=&quot;+A+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),A&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it(&quot;Running failure percentage check. threshold=&quot;+t.threshold+&quot; request volume threshold=&quot;+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i&gt;=t.request_volume&amp;&amp;(o+=1)}if(!(o&lt;t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it(&quot;Candidate successes=&quot;+i+&quot; failures=&quot;+n),i+n&lt;t.request_volume)continue;if(n*100/(n+i)&gt;t.threshold){let c=Math.random()*100;it(&quot;Candidate &quot;+s+&quot; randomNumber=&quot;+c+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),c&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=&gt;this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it(&quot;Ejection timer running&quot;),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier&gt;0&amp;&amp;(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i&lt;new Date&amp;&amp;(it(&quot;Unejecting &quot;+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it(&quot;Received update with config: &quot;+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it(&quot;Adding map entry for &quot;+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it(&quot;Previous timer existed. Replacing timer&quot;),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it(&quot;Starting new timer&quot;),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it(&quot;Counting disabled. Cancelling timer.&quot;),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&amp;&amp;(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=&gt;{&quot;use strict&quot;;Object.defineProperty(w,&quot;__esModule&quot;,{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,&quot;CallCredentials&quot;,{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,&quot;Channel&quot;,{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,&quot;compressionAlgorithms&quot;,{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,&quot;connectivityState&quot;,{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,&quot;ChannelCredentials&quot;,{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,&quot;Client&quot;,{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,&quot;logVerbosity&quot;,{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,&quot;status&quot;,{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,&quot;propagate&quot;,{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,&quot;loadPackageDefinition&quot;,{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,&quot;makeClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,&quot;makeGenericClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,&quot;Metadata&quot;,{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,&quot;Server&quot;,{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,&quot;ServerCredentials&quot;,{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,&quot;StatusBuilder&quot;,{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),combineCallCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=&gt;r.close();w.closeClient=mme;var Tme=(r,e,t)=&gt;r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.loadObject=Sme;var gme=(r,e,t)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.load=gme;var vme=r=&gt;{N4.setLogger(r)};w.setLogger=vme;var yme=r=&gt;{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=&gt;R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,&quot;ListenerBuilder&quot;,{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,&quot;RequesterBuilder&quot;,{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,&quot;InterceptingCall&quot;,{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,&quot;InterceptorConfigurationError&quot;,{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,&quot;getChannelzServiceDefinition&quot;,{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,&quot;getChannelzHandlers&quot;,{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,&quot;addAdminServicesToServer&quot;,{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,&quot;ServerListenerBuilder&quot;,{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,&quot;ResponderBuilder&quot;,{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,&quot;ServerInterceptingCall&quot;,{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=&gt;{&quot;use strict&quot;;Object.defineProperty(yE,&quot;__esModule&quot;,{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=&gt;o,requestDeserialize:o=&gt;o,responseSerialize:o=&gt;o,responseDeserialize:o=&gt;o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=&gt;{&quot;use strict&quot;;Object.defineProperty(lr,&quot;__esModule&quot;,{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r===&quot;gzip&quot;?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{&quot;grpc.default_compression_algorithm&quot;:kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}}return new Promise(s=&gt;{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error(&quot;metadata was null&quot;),status:&quot;failure&quot;});this._client.export(o,this._metadata,{deadline:a},(i,n)=&gt;{s(i?{status:&quot;failure&quot;,error:i}:{data:n,status:&quot;success&quot;})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=&gt;{&quot;use strict&quot;;Object.defineProperty(AE,&quot;__esModule&quot;,{value:!0});AE.VERSION=void 0;AE.VERSION=&quot;0.56.0&quot;});var w4=T(pi=&gt;{&quot;use strict&quot;;Object.defineProperty(pi,&quot;__esModule&quot;,{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V(&quot;url&quot;),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol===&quot;unix:&quot;?r:(o.pathname&amp;&amp;o.pathname!==&quot;/&quot;&amp;&amp;b4.diag.warn(&quot;URL path should not be set when using grpc, the path part of the URL will be ignored.&quot;),o.protocol!==&quot;&quot;&amp;&amp;!(!((e=o.protocol)===null||e===void 0)&amp;&amp;e.match(/^(http)s?:$/))&amp;&amp;b4.diag.warn(&quot;URL protocol should be http(s)://. Using http://.&quot;),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length&lt;1&amp;&amp;r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=&gt;{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&amp;&amp;u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&amp;&amp;_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&amp;&amp;a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&amp;&amp;n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=&gt;{let r=(0,hu.createEmptyMetadata)();return r.set(&quot;User-Agent&quot;,`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:&quot;http://localhost:4317&quot;,credentials:r=&gt;r.startsWith(&quot;http://&quot;)?()=&gt;(0,hu.createInsecureCredentials)():()=&gt;(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=&gt;{P();qA=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var NE,U4=p(()=&gt;{NE=&quot;baggage&quot;});function PE(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function IE(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Eu(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Eu(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var jA=p(()=&gt;{P()});var bE,V4=p(()=&gt;{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=PE(a);i.length&gt;0&amp;&amp;o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=Eu(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=&gt;{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var q4=p(()=&gt;{P()});function xE(){return r=&gt;{S.error(Xme(r))}}function Xme(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=&gt;{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=&gt;{KA();j4=xE()});var La,XA=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(La||(La={}))});function Zme(r){return Qme.indexOf(r)&gt;-1}function tTe(r){return eTe.indexOf(r)&gt;-1}function nTe(r){return rTe.indexOf(r)&gt;-1}function iTe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=aTe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=&gt;{P();XA();Jme=&quot;,&quot;,Qme=[&quot;OTEL_SDK_DISABLED&quot;];eTe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rTe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=&gt;{QA()});var UE,K4=p(()=&gt;{UE=typeof globalThis==&quot;object&quot;?globalThis:global});function $4(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var ZA=p(()=&gt;{});function BE(r){return Buffer.from(kE(r)).toString(&quot;base64&quot;)}var X4=p(()=&gt;{ZA()});function W4(r){return function(){for(let t=0;t&lt;r/4;t++)VE.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(VE[t]&gt;0);t++)t===r-1&amp;&amp;(VE[r-1]=1);return VE.toString(&quot;hex&quot;,0,r)}}var xa,VE,J4=p(()=&gt;{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from&quot;perf_hooks&quot;;var di,Q4=p(()=&gt;{di=cTe});var FE,eR=p(()=&gt;{FE=&quot;1.29.0&quot;});var GE,Z4=p(()=&gt;{eR();Ve();GE={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=&gt;{});var t6=p(()=&gt;{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=&gt;{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!=&quot;number&quot;){let e=di;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r==&quot;number&quot;?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r==&quot;number&quot;)return r&lt;jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function c6(r){return YE(r)||typeof r==&quot;number&quot;||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=qE&amp;&amp;(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=&gt;{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(zE||(zE={}))});var KE,p6=p(()=&gt;{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&amp;&amp;!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=&gt;{iR=&quot;[_0-9a-z-*/]&quot;,pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=&gt;{_6();E6=32,mTe=512,m6=&quot;,&quot;,T6=&quot;=&quot;,wa=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length&gt;mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&amp;&amp;h6(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;E6&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=&gt;{P();_u();oR();vu=&quot;traceparent&quot;,yu=&quot;tracestate&quot;,TTe=&quot;00&quot;,STe=&quot;(?!ff)[\\da-f]{2}&quot;,gTe=&quot;(?![0]{32})[\\da-f]{32}&quot;,vTe=&quot;(?![0]{16})[\\da-f]{16}&quot;,yTe=&quot;[\\da-f]{2}&quot;,OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&amp;&amp;o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new wa(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=&gt;{P();aR=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(XE||(XE={}))});var Co,lR=p(()=&gt;{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var hi,cR=p(()=&gt;{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var WE,A6=p(()=&gt;{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=&gt;{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;N6.call(t)===PTe}function LTe(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&amp;&amp;Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&amp;&amp;(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=&gt;{ATe=&quot;[object Object]&quot;,RTe=&quot;[object Null]&quot;,NTe=&quot;[object Undefined]&quot;,CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t&gt;DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(QE(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&amp;&amp;Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r==&quot;function&quot;}function Ou(r){return!QE(r)&amp;&amp;!ZE(r)&amp;&amp;!w6(r)&amp;&amp;typeof r==&quot;object&quot;}function QE(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=&gt;{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Au,k6=p(()=&gt;{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=&gt;{});function F6(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var G6=p(()=&gt;{});var em,H6=p(()=&gt;{em=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=&gt;{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=&gt;{he.with(RE(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Y6=p(()=&gt;{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=&gt;Co,AlwaysOnSampler:()=&gt;hi,AnchoredClock:()=&gt;LE,BindOnceFuture:()=&gt;tm,CompositePropagator:()=&gt;KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;mu,DEFAULT_ENVIRONMENT:()=&gt;Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;JA,ExportResultCode:()=&gt;zE,ParentBasedSampler:()=&gt;WE,RPCType:()=&gt;XE,RandomIdGenerator:()=&gt;xa,SDK_INFO:()=&gt;GE,TRACE_PARENT_HEADER:()=&gt;vu,TRACE_STATE_HEADER:()=&gt;yu,TimeoutError:()=&gt;Au,TraceIdRatioBasedSampler:()=&gt;JE,TraceState:()=&gt;wa,TracesSamplerValues:()=&gt;La,VERSION:()=&gt;FE,W3CBaggagePropagator:()=&gt;bE,W3CTraceContextPropagator:()=&gt;$E,_globalThis:()=&gt;UE,addHrTimes:()=&gt;nR,baggageUtils:()=&gt;kTe,callWithTimeout:()=&gt;U6,deleteRPCMetadata:()=&gt;v6,getEnv:()=&gt;wE,getEnvWithoutDefaults:()=&gt;DE,getRPCMetadata:()=&gt;y6,getTimeOrigin:()=&gt;jE,globalErrorHandler:()=&gt;ME,hexToBase64:()=&gt;BE,hexToBinary:()=&gt;kE,hrTime:()=&gt;rR,hrTimeDuration:()=&gt;i6,hrTimeToMicroseconds:()=&gt;l6,hrTimeToMilliseconds:()=&gt;a6,hrTimeToNanoseconds:()=&gt;s6,hrTimeToTimeStamp:()=&gt;o6,internal:()=&gt;BTe,isAttributeKey:()=&gt;YA,isAttributeValue:()=&gt;zA,isTimeInput:()=&gt;c6,isTimeInputHrTime:()=&gt;YE,isTracingSuppressed:()=&gt;ba,isUrlIgnored:()=&gt;B6,isWrapped:()=&gt;F6,loggingErrorHandler:()=&gt;xE,merge:()=&gt;x6,millisToHrTime:()=&gt;Ma,otperformance:()=&gt;di,parseEnvironment:()=&gt;gu,parseTraceParent:()=&gt;sR,sanitizeAttributes:()=&gt;G4,setGlobalErrorHandler:()=&gt;Y4,setRPCMetadata:()=&gt;g6,suppressTracing:()=&gt;RE,timeInputToHrTime:()=&gt;n6,unrefTimer:()=&gt;HE,unsuppressTracing:()=&gt;D4,urlMatches:()=&gt;pR});var kTe,BTe,K6=p(()=&gt;{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=&gt;{&quot;use strict&quot;;Object.defineProperty(rm,&quot;__esModule&quot;,{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V(&quot;fs&quot;),GTe=V(&quot;path&quot;),W6=(P(),ee(ot));function dR(r,e){if(r!=null&amp;&amp;r!==&quot;&quot;)return r;if(e!=null&amp;&amp;e!==&quot;&quot;)return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=&gt;e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)===&quot;true&quot;}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE&quot;,&quot;Failed to read client certificate chain file&quot;)}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,&quot;OTEL_EXPORTER_OTLP_CLIENT_KEY&quot;,&quot;Failed to read client certificate private key file&quot;)}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CERTIFICATE&quot;,&quot;Failed to read root certificate file&quot;)}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&amp;&amp;t!=null;return o!=null&amp;&amp;!s?(W6.diag.warn(&quot;Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate&quot;),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=&gt;e.startsWith(&quot;http://&quot;)?()=&gt;(0,Ru.createInsecureCredentials)():e.startsWith(&quot;https://&quot;)?()=&gt;J6(r):()=&gt;$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=&gt;{&quot;use strict&quot;;Object.defineProperty(nm,&quot;__esModule&quot;,{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&amp;&amp;WTe.diag.warn(&quot;Headers cannot be set when using grpc&quot;);let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=&gt;{var o;return(o=r.metadata)!==null&amp;&amp;o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=&gt;t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=&gt;{&quot;use strict&quot;;Object.defineProperty(im,&quot;__esModule&quot;,{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=&gt;{&quot;use strict&quot;;Object.defineProperty(Da,&quot;__esModule&quot;,{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,&quot;convertLegacyOtlpGrpcOptions&quot;,{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,&quot;createOtlpGrpcExportDelegate&quot;,{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=&gt;{&quot;use strict&quot;;Object.defineProperty(om,&quot;__esModule&quot;,{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,&quot;LOGS&quot;),oSe.ProtobufLogsSerializer,&quot;LogsExportService&quot;,&quot;/opentelemetry.proto.collector.logs.v1.LogsService/Export&quot;))}};om.OTLPLogExporter=ER});var iY=T(Io=&gt;{&quot;use strict&quot;;var aSe=Io&amp;&amp;Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),lSe=Io&amp;&amp;Io.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;aSe(e,r,t)};Object.defineProperty(Io,&quot;__esModule&quot;,{value:!0});lSe(nY(),Io)});var oY,sY=p(()=&gt;{oY=&quot;0.56.0&quot;});var Ua,aY=p(()=&gt;{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${oY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Ah))}}});var lY=p(()=&gt;{aY()});var cY=p(()=&gt;{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=&gt;Ua});var fY=p(()=&gt;{cY()});var pY,dY=p(()=&gt;{pY=&quot;0.56.0&quot;});var ka,hY=p(()=&gt;{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${pY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Rh))}}});var _Y=p(()=&gt;{hY()});var EY=p(()=&gt;{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=&gt;ka});var TY=p(()=&gt;{EY()});var SY,gY=p(()=&gt;{SY=&quot;0.56.0&quot;});var mR,vY=p(()=&gt;{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${SY}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Nh))}}});var yY=p(()=&gt;{vY()});var OY=p(()=&gt;{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=&gt;mR});var RY=p(()=&gt;{OY()});var CY=T(sm=&gt;{&quot;use strict&quot;;Object.defineProperty(sm,&quot;__esModule&quot;,{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,&quot;TRACES&quot;),cSe.ProtobufTraceSerializer,&quot;TraceExportService&quot;,&quot;/opentelemetry.proto.collector.trace.v1.TraceService/Export&quot;))}};sm.OTLPTraceExporter=TR});var PY=T(bo=&gt;{&quot;use strict&quot;;var fSe=bo&amp;&amp;bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),pSe=bo&amp;&amp;bo.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;fSe(e,r,t)};Object.defineProperty(bo,&quot;__esModule&quot;,{value:!0});pSe(CY(),bo)});var am,IY=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(am||(am={}))});function _Se(r){return hSe.indexOf(r)&gt;-1}function mSe(r){return ESe.indexOf(r)&gt;-1}function SSe(r){return TSe.indexOf(r)&gt;-1}function ySe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=RSe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=&gt;{P();IY();dSe=&quot;,&quot;,hSe=[&quot;OTEL_SDK_DISABLED&quot;];ESe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];TSe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=&gt;{LY()});var wY=p(()=&gt;{xY()});var DY=p(()=&gt;{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=&gt;{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(sn||(sn={}))});var lm=p(()=&gt;{UY();kY();DY()});import*as DSe from&quot;http&quot;;import*as USe from&quot;https&quot;;import*as BY from&quot;url&quot;;function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:&quot;POST&quot;,headers:Object.assign({&quot;Content-Type&quot;:&quot;application/json&quot;},e)},t);return function(a,i){if(a.length===0)return S.debug(&quot;Zipkin send with empty spans&quot;),i({code:sn.SUCCESS});let{request:n}=o.protocol===&quot;http:&quot;?DSe:USe,l=n(o,u=&gt;{let f=&quot;&quot;;u.on(&quot;data&quot;,_=&gt;{f+=_}),u.on(&quot;end&quot;,()=&gt;{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_&lt;400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on(&quot;error&quot;,u=&gt;i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,&quot;utf8&quot;),l.end()}}var VY=p(()=&gt;{P();lm()});var FY=p(()=&gt;{VY()});var yR=p(()=&gt;{FY()});var xo,GY=p(()=&gt;{(function(r){r.CLIENT=&quot;CLIENT&quot;,r.SERVER=&quot;SERVER&quot;,r.CONSUMER=&quot;CONSUMER&quot;,r.PRODUCER=&quot;PRODUCER&quot;})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&amp;&amp;(l[i]=String(jt[t.code])),t.code===jt.ERROR&amp;&amp;t.message&amp;&amp;(l[n]=t.message),o&amp;&amp;(l[&quot;otel.dropped_attributes_count&quot;]=String(o)),s&amp;&amp;(l[&quot;otel.dropped_events_count&quot;]=String(s)),a&amp;&amp;(l[&quot;otel.dropped_links_count&quot;]=String(a)),Object.keys(e.attributes).forEach(c=&gt;l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=&gt;({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=&gt;{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY=&quot;otel.status_code&quot;,qY=&quot;error&quot;});function zY(r){return function(){return r()}}var KY=p(()=&gt;{});var cm,$Y=p(()=&gt;{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME=&quot;OpenTelemetry Service&quot;,this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders==&quot;function&quot;?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug(&quot;Zipkin exporter export&quot;),this._isShutdown){setTimeout(()=&gt;t({code:sn.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)}));return}let s=new Promise(i=&gt;{this._sendSpans(e,o,n=&gt;{i(),t(n)})});this._sendingPromises.push(s);let a=()=&gt;{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug(&quot;Zipkin exporter shutdown&quot;),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=&gt;{Promise.all(this._sendingPromises).then(()=&gt;{e()},t)})}_beforeSend(){this._getHeaders&amp;&amp;(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=&gt;jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=&gt;{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=&gt;cm,prepareSend:()=&gt;Lo});var WY=p(()=&gt;{yR();$Y()});var ez=T(an=&gt;{&quot;use strict&quot;;Object.defineProperty(an,&quot;__esModule&quot;,{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe=&quot;env&quot;,YSe=&quot;host&quot;,zSe=&quot;os&quot;,KSe=&quot;process&quot;,$Se=&quot;serviceinstance&quot;;function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(&quot;,&quot;))!==null&amp;&amp;e!==void 0?e:[&quot;all&quot;];return o.includes(&quot;all&quot;)?[...t.values()].flat():o.includes(&quot;none&quot;)?[]:o.flatMap(s=&gt;{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector &quot;${s}&quot; specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=&gt;e.trim()).filter(e=&gt;e!==&quot;null&quot;&amp;&amp;e!==&quot;&quot;)}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&amp;&amp;e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case&quot;grpc&quot;:return new HSe.OTLPTraceExporter;case&quot;http/json&quot;:return new GSe.OTLPTraceExporter;case&quot;http/protobuf&quot;:return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V(&quot;@opentelemetry/exporter-jaeger&quot;);return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter&#x27;s lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([[&quot;otlp&quot;,()=&gt;WSe()],[&quot;zipkin&quot;,()=&gt;new qSe.ZipkinExporter],[&quot;console&quot;,()=&gt;new um.ConsoleSpanExporter],[&quot;jaeger&quot;,()=&gt;JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(&quot;,&quot;))));if(s[0]===&quot;none&quot;)return Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot;. SDK will not be initialized.&#x27;),[];s.length===0?(Mo.diag.warn(&quot;OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.&quot;),s=[&quot;otlp&quot;]):s.length&gt;1&amp;&amp;s.includes(&quot;none&quot;)&amp;&amp;(Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot; along with other exporters. Using default otlp exporter.&#x27;),s=[&quot;otlp&quot;]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&amp;&amp;Mo.diag.warn(&quot;Unable to set up trace exporter(s) due to invalid exporter and/or protocol values.&quot;),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=&gt;{&quot;use strict&quot;;Object.defineProperty(pm,&quot;__esModule&quot;,{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&amp;&amp;(this._disabled=!0),u.OTEL_LOG_LEVEL&amp;&amp;ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&amp;&amp;t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&amp;&amp;o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&amp;&amp;s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&amp;&amp;(f.sampler=e.sampler),e.spanLimits&amp;&amp;(f.spanLimits=e.spanLimits),e.idGenerator&amp;&amp;(f.idGenerator=e.idGenerator),e.spanProcessor&amp;&amp;ln.diag.warn(&quot;The &#x27;spanProcessor&#x27; option is deprecated. Please use &#x27;spanProcessors&#x27; instead.&quot;);let _=(a=e.spanProcessor)!==null&amp;&amp;a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&amp;&amp;i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn(&quot;The &#x27;logRecordProcessor&#x27; option is deprecated. Please use &#x27;logRecordProcessors&#x27; instead.&quot;)):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&amp;&amp;(f.reader=e.metricReader),e.views&amp;&amp;(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&amp;&amp;l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length&gt;0&amp;&amp;this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&amp;&amp;t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&amp;&amp;l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&amp;&amp;i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&amp;&amp;e.push(this._tracerProvider.shutdown()),this._loggerProvider&amp;&amp;e.push(this._loggerProvider.shutdown()),this._meterProvider&amp;&amp;e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=&gt;{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&amp;&amp;e!==void 0?e:&quot;&quot;,o=(0,AR.filterBlanksAndNulls)(t.split(&quot;,&quot;));if(o.length===0&amp;&amp;(ln.diag.info(&quot;OTEL_LOGS_EXPORTER is empty. Using default otlp exporter.&quot;),o.push(&quot;otlp&quot;)),o.includes(&quot;none&quot;)){ln.diag.info(&#x27;OTEL_LOGS_EXPORTER contains &quot;none&quot;. Logger provider will not be initialized.&#x27;);return}let s=[];o.forEach(a=&gt;{var i,n;if(a===&quot;otlp&quot;){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&amp;&amp;i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case&quot;grpc&quot;:s.push(new rge.OTLPLogExporter);break;case&quot;http/json&quot;:s.push(new tge.OTLPLogExporter);break;case&quot;http/protobuf&quot;:s.push(new OR.OTLPLogExporter);break;case void 0:case&quot;&quot;:s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: &quot;${l}&quot;. Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a===&quot;console&quot;?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: &quot;${a}&quot;. Supported values are: otlp, console, none.`)}),s.length&gt;0&amp;&amp;(this._loggerProviderConfig={logRecordProcessors:s.map(a=&gt;a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=&gt;{&quot;use strict&quot;;Object.defineProperty(Xe,&quot;__esModule&quot;,{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,&quot;NodeSDK&quot;,{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from&quot;process&quot;;P();var vi=typeof globalThis==&quot;object&quot;?globalThis:global;function LN(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var xN=&quot;1.30.1&quot;;Ve();var yi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt&lt;&quot;u&quot;?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=&gt;sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=&gt;{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=&gt;{throw TypeError(r)},Jm=(r,e,t)=&gt;e.has(r)||uM(&quot;Cannot &quot;+t),el=(r,e,t)=&gt;(Jm(r,e,&quot;read from private field&quot;),t?t.call(r):e.get(r)),Wu=(r,e,t)=&gt;e.has(r)?uM(&quot;Cannot add the same private member more than once&quot;):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=&gt;(Jm(r,e,&quot;write to private field&quot;),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=&gt;(Jm(r,e,&quot;access private method&quot;),t),fZ=&quot;__nfOTLPTrace&quot;,tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:&quot;netlify-span-exporter&quot;}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug(&quot;Shutting down&quot;),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&amp;&amp;!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&amp;&amp;o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)==&quot;function&quot;?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName=&quot;@netlify/otel/instrumentation-fetch&quot;,this.instrumentationVersion=&quot;1.0.0&quot;,this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,&quot;http.request.method&quot;:e.method,&quot;url.full&quot;:o.href,&quot;url.host&quot;:o.host,&quot;url.scheme&quot;:o.protocol.slice(0,-1),&quot;server.address&quot;:o.hostname,&quot;server.port&quot;:o.port,...this.prepareHeaders(&quot;request&quot;,e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,&quot;http.response.status_code&quot;:e.status,...this.prepareHeaders(&quot;response&quot;,e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=[&quot;*&quot;,&quot;/.*/&quot;],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=&gt;t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l))?i[u]=&quot;REDACTED&quot;:i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=&gt;{var a;let o=typeof e==&quot;string&quot;?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&amp;&amp;a.some(i=&gt;typeof i==&quot;string&quot;?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan(&quot;fetch&quot;,async i=&gt;{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&amp;&amp;(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&amp;&amp;S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({&quot;service.name&quot;:SERVICE_NAME??&quot;lambda-function&quot;,&quot;service.version&quot;:SERVICE_VERSION,&quot;process.runtime.name&quot;:&quot;nodejs&quot;,&quot;process.runtime.version&quot;:lge.slice(1),&quot;deployment.environment&quot;:(iz=bu.URL)!=null&amp;&amp;iz.includes(&quot;netlifystg.com&quot;)?&quot;staging&quot;:&quot;production&quot;,&quot;http.url&quot;:bu.URL,&quot;netlify.site.id&quot;:bu.SITE_ID,&quot;netlify.site.name&quot;:bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */ </div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ netlify</div> <div class="folder" style="margin-left: 80px;">๐Ÿ“ functions</div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ sitemap.js</div> <div class="content">// netlify/functions/sitemap.js var fs = require(&quot;fs&quot;).promises; var path = require(&quot;path&quot;); var SITEMAP_CONFIG = { MAX_URLS_PER_SITEMAP: 5e4, CACHE_DURATION: 24 * 60 * 60 * 1e3, // 24 hours DEFAULT_CHANGEFREQ: &quot;weekly&quot;, DEFAULT_PRIORITY: 0.5, HIGH_PRIORITY: 0.9, MEDIUM_PRIORITY: 0.7, LOW_PRIORITY: 0.3 }; var STATIC_PAGES = [ { path: &quot;/&quot;, changefreq: &quot;daily&quot;, priority: 1 }, { path: &quot;/tools&quot;, changefreq: &quot;weekly&quot;, priority: 0.9 }, { path: &quot;/blog&quot;, changefreq: &quot;daily&quot;, priority: 0.8 }, { path: &quot;/about&quot;, changefreq: &quot;monthly&quot;, priority: 0.6 }, { path: &quot;/contact&quot;, changefreq: &quot;monthly&quot;, priority: 0.6 }, { path: &quot;/privacy-policy&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/terms-of-use&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/dmca&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/cookies-policy&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 } ]; var sitemapCache = null; function getSiteOrigin() { return process.env.URL || process.env.SITE_URL || &quot;https://modernphototools.com&quot;; } function escapeXml(str) { return str.replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;).replace(/&gt;/g, &quot;&amp;gt;&quot;).replace(/&quot;/g, &quot;&amp;quot;&quot;).replace(/&#x27;/g, &quot;&amp;#39;&quot;); } async function loadBlogArticles() { try { const contentDir = path.join(process.cwd(), &quot;content&quot;, &quot;blog&quot;); const files = await fs.readdir(contentDir); const markdownFiles = files.filter((file) =&gt; file.endsWith(&quot;.md&quot;)); const articles = []; for (const file of markdownFiles) { const filePath = path.join(contentDir, file); const content = await fs.readFile(filePath, &quot;utf-8&quot;); const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); if (frontmatterMatch) { const frontmatter = frontmatterMatch[1]; const slug = file.replace(&quot;.md&quot;, &quot;&quot;); const titleMatch = frontmatter.match(/title:\s*[&quot;&#x27;]?([^&quot;&#x27;\n]+)[&quot;&#x27;]?/); const dateMatch = frontmatter.match(/date:\s*[&quot;&#x27;]?([^&quot;&#x27;\n]+)[&quot;&#x27;]?/); if (titleMatch) { articles.push({ slug, title: titleMatch[1], date: dateMatch ? dateMatch[1] : (/* @__PURE__ */ new Date()).toISOString() }); } } } return articles; } catch (error) { console.error(&quot;Error loading blog articles:&quot;, error); return []; } } async function getImageFiles() { try { const imagesDir = path.join(process.cwd(), &quot;public&quot;, &quot;images&quot;); const images = []; async function scanDirectory(dir, relativePath = &quot;&quot;) { try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { await scanDirectory(itemPath, path.join(relativePath, item)); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { images.push({ path: `/images/${path.join(relativePath, item).replace(/\\/g, &quot;/&quot;)}`, filename: item }); } } } catch (error) { console.warn(`Could not scan directory ${dir}:`, error.message); } } await scanDirectory(imagesDir); return images; } catch (error) { console.error(&quot;Error loading images:&quot;, error); return []; } } async function getAllSitemapUrls() { const baseUrl = getSiteOrigin(); const urls = []; const now = (/* @__PURE__ */ new Date()).toISOString().split(&quot;T&quot;)[0]; STATIC_PAGES.forEach((page) =&gt; { urls.push({ loc: `${baseUrl}${page.path}`, lastmod: now, changefreq: page.changefreq, priority: page.priority }); }); TOOLS.forEach((tool) =&gt; { urls.push({ loc: `${baseUrl}${tool.path}`, lastmod: now, changefreq: &quot;weekly&quot;, priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); try { const articles = await loadBlogArticles(); articles.forEach((article) =&gt; { urls.push({ loc: `${baseUrl}/blog/${article.slug}`, lastmod: article.date.split(&quot;T&quot;)[0], changefreq: &quot;monthly&quot;, priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); } catch (error) { console.error(&quot;Error adding blog articles to sitemap:&quot;, error); } try { const images = await getImageFiles(); images.forEach((image) =&gt; { urls.push({ loc: `${baseUrl}${image.path}`, lastmod: now, changefreq: &quot;yearly&quot;, priority: SITEMAP_CONFIG.LOW_PRIORITY }); }); } catch (error) { console.error(&quot;Error adding images to sitemap:&quot;, error); } return urls; } function formatSitemapXml(urls) { const xmlHeader = &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x27;; const urlsetOpen = &#x27;&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;&#x27;; const urlsetClose = &quot;&lt;/urlset&gt;&quot;; const urlEntries = urls.map((url) =&gt; { let urlXml = ` &lt;url&gt; &lt;loc&gt;${escapeXml(url.loc)}&lt;/loc&gt;`; if (url.lastmod) { urlXml += ` &lt;lastmod&gt;${url.lastmod}&lt;/lastmod&gt;`; } if (url.changefreq) { urlXml += ` &lt;changefreq&gt;${url.changefreq}&lt;/changefreq&gt;`; } if (url.priority !== void 0) { urlXml += ` &lt;priority&gt;${url.priority.toFixed(1)}&lt;/priority&gt;`; } urlXml += &quot;\n &lt;/url&gt;&quot;; return urlXml; }).join(&quot;\n&quot;); return `${xmlHeader} ${urlsetOpen} ${urlEntries} ${urlsetClose}`; } function isCacheValid(timestamp) { return timestamp &amp;&amp; Date.now() - timestamp &lt; SITEMAP_CONFIG.CACHE_DURATION; } async function generateSitemap() { try { if (sitemapCache &amp;&amp; isCacheValid(sitemapCache.timestamp)) { console.log(&quot;Returning cached sitemap&quot;); return sitemapCache.xml; } console.log(&quot;Generating new sitemap...&quot;); const allUrls = await getAllSitemapUrls(); console.log(`Found ${allUrls.length} URLs for sitemap`); const xml = formatSitemapXml(allUrls); sitemapCache = { xml, timestamp: Date.now(), urlCount: allUrls.length }; console.log(&quot;Sitemap generated and cached successfully&quot;); return xml; } catch (error) { console.error(&quot;Error generating sitemap:&quot;, error); throw new Error(&quot;Failed to generate sitemap&quot;); } } exports.handler = async function(event, context) { if (event.httpMethod === &quot;OPTIONS&quot;) { return { statusCode: 200, headers: { &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;GET, OPTIONS&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot; }, body: &quot;&quot; }; } if (event.httpMethod !== &quot;GET&quot;) { return { statusCode: 405, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot; }, body: &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;error&gt;Method Not Allowed&lt;/error&gt;&#x27; }; } try { console.log(&quot;Sitemap request received&quot;); const sitemapXml = await generateSitemap(); return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot;, &quot;Cache-Control&quot;: &quot;public, max-age=3600, s-maxage=3600&quot;, // Cache for 1 hour &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot; }, body: sitemapXml }; } catch (error) { console.error(&quot;Error serving sitemap:&quot;, error); return { statusCode: 500, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot; }, body: &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;error&gt;Internal Server Error&lt;/error&gt;&#x27; }; } }; //# sourceMappingURL=sitemap.js.map </div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ sitemap.js.map</div> <div class="content">{ &quot;version&quot;: 3, &quot;sources&quot;: [&quot;../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap.js&quot;], &quot;sourceRoot&quot;: &quot;C:/Users/6732~1/AppData/Local/Temp/tmp-13180-B6Y5Lgc620L3&quot;, &quot;sourcesContent&quot;: [&quot;// Netlify function for serving sitemap.xml\nconst fs = require(&#x27;fs&#x27;).promises;\nconst path = require(&#x27;path&#x27;);\n\n// Import the sitemap utilities (we&#x27;ll need to adapt these for Node.js)\n// Since we can&#x27;t directly import TypeScript modules in Netlify functions,\n// we&#x27;ll implement the core functionality here\n\n// Configuration\nconst SITEMAP_CONFIG = {\n MAX_URLS_PER_SITEMAP: 50000,\n CACHE_DURATION: 24 * 60 * 60 * 1000, // 24 hours\n DEFAULT_CHANGEFREQ: &#x27;weekly&#x27;,\n DEFAULT_PRIORITY: 0.5,\n HIGH_PRIORITY: 0.9,\n MEDIUM_PRIORITY: 0.7,\n LOW_PRIORITY: 0.3,\n};\n\n// Static pages configuration\nconst STATIC_PAGES = [\n { path: &#x27;/&#x27;, changefreq: &#x27;daily&#x27;, priority: 1.0 },\n { path: &#x27;/tools&#x27;, changefreq: &#x27;weekly&#x27;, priority: 0.9 },\n { path: &#x27;/blog&#x27;, changefreq: &#x27;daily&#x27;, priority: 0.8 },\n { path: &#x27;/about&#x27;, changefreq: &#x27;monthly&#x27;, priority: 0.6 },\n { path: &#x27;/contact&#x27;, changefreq: &#x27;monthly&#x27;, priority: 0.6 },\n { path: &#x27;/privacy-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/terms-of-use&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/dmca&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/cookies-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n];\n\n/**\n * Load tools from the actual tools data file\n */\nasync function loadTools() {\n try {\n // Read the tools.ts file and extract the tools array\n const toolsFilePath = path.join(process.cwd(), &#x27;src&#x27;, &#x27;data&#x27;, &#x27;tools.ts&#x27;);\n const toolsContent = await fs.readFile(toolsFilePath, &#x27;utf-8&#x27;);\n \n // Extract tools data using regex (since we can&#x27;t directly import TypeScript)\n const toolsMatch = toolsContent.match(/export const tools: Tool\\[\\] = \\[([\\s\\S]*?)\\];/);\n if (!toolsMatch) {\n throw new Error(&#x27;Could not parse tools from tools.ts&#x27;);\n }\n \n // Parse each tool object\n const toolsArrayContent = toolsMatch[1];\n const toolObjects = [];\n \n // Split by tool objects (looking for id, name, path patterns)\n const toolMatches = toolsArrayContent.match(/\\{[^}]*id:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*name:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*path:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*\\}/g);\n \n if (toolMatches) {\n for (const toolMatch of toolMatches) {\n const idMatch = toolMatch.match(/id:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n const nameMatch = toolMatch.match(/name:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n const pathMatch = toolMatch.match(/path:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n \n if (idMatch &amp;&amp; nameMatch &amp;&amp; pathMatch) {\n toolObjects.push({\n id: idMatch[1],\n name: nameMatch[1],\n path: pathMatch[1]\n });\n }\n }\n }\n \n return toolObjects;\n } catch (error) {\n console.error(&#x27;Error loading tools:&#x27;, error);\n // Fallback to empty array if loading fails\n return [];\n }\n}\n\n// Cache storage (in production, this could be in a database or external cache)\nlet sitemapCache = null;\n\n/**\n * Get site origin\n */\nfunction getSiteOrigin() {\n return process.env.URL || process.env.SITE_URL || &#x27;https://modernphototools.com&#x27;;\n}\n\n/**\n * Escape XML characters\n */\nfunction escapeXml(str) {\n return str\n .replace(/&amp;/g, &#x27;&amp;amp;&#x27;)\n .replace(/&lt;/g, &#x27;&amp;lt;&#x27;)\n .replace(/&gt;/g, &#x27;&amp;gt;&#x27;)\n .replace(/\&quot;/g, &#x27;&amp;quot;&#x27;)\n .replace(/&#x27;/g, &#x27;&amp;#39;&#x27;);\n}\n\n/**\n * Load blog articles from markdown files\n */\nasync function loadBlogArticles() {\n try {\n const contentDir = path.join(process.cwd(), &#x27;content&#x27;, &#x27;blog&#x27;);\n const files = await fs.readdir(contentDir);\n const markdownFiles = files.filter(file =&gt; file.endsWith(&#x27;.md&#x27;));\n \n const articles = [];\n for (const file of markdownFiles) {\n const filePath = path.join(contentDir, file);\n const content = await fs.readFile(filePath, &#x27;utf-8&#x27;);\n \n // Extract frontmatter\n const frontmatterMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (frontmatterMatch) {\n const frontmatter = frontmatterMatch[1];\n const slug = file.replace(&#x27;.md&#x27;, &#x27;&#x27;);\n \n // Parse basic frontmatter (simplified)\n const titleMatch = frontmatter.match(/title:\\s*[\&quot;&#x27;]?([^\&quot;&#x27;\\n]+)[\&quot;&#x27;]?/);\n const dateMatch = frontmatter.match(/date:\\s*[\&quot;&#x27;]?([^\&quot;&#x27;\\n]+)[\&quot;&#x27;]?/);\n \n if (titleMatch) {\n articles.push({\n slug,\n title: titleMatch[1],\n date: dateMatch ? dateMatch[1] : new Date().toISOString(),\n });\n }\n }\n }\n \n return articles;\n } catch (error) {\n console.error(&#x27;Error loading blog articles:&#x27;, error);\n return [];\n }\n}\n\n/**\n * Get all image files from public directory\n */\nasync function getImageFiles() {\n try {\n const imagesDir = path.join(process.cwd(), &#x27;public&#x27;, &#x27;images&#x27;);\n const images = [];\n \n async function scanDirectory(dir, relativePath = &#x27;&#x27;) {\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n await scanDirectory(itemPath, path.join(relativePath, item));\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n images.push({\n path: `/images/${path.join(relativePath, item).replace(/\\\\/g, &#x27;/&#x27;)}`,\n filename: item,\n });\n }\n }\n } catch (error) {\n console.warn(`Could not scan directory ${dir}:`, error.message);\n }\n }\n \n await scanDirectory(imagesDir);\n return images;\n } catch (error) {\n console.error(&#x27;Error loading images:&#x27;, error);\n return [];\n }\n}\n\n/**\n * Generate all sitemap URLs\n */\nasync function getAllSitemapUrls() {\n const baseUrl = getSiteOrigin();\n const urls = [];\n const now = new Date().toISOString().split(&#x27;T&#x27;)[0];\n \n // Add static pages\n STATIC_PAGES.forEach(page =&gt; {\n urls.push({\n loc: `${baseUrl}${page.path}`,\n lastmod: now,\n changefreq: page.changefreq,\n priority: page.priority,\n });\n });\n \n // Add tool pages\n TOOLS.forEach(tool =&gt; {\n urls.push({\n loc: `${baseUrl}${tool.path}`,\n lastmod: now,\n changefreq: &#x27;weekly&#x27;,\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n \n // Add blog articles\n try {\n const articles = await loadBlogArticles();\n articles.forEach(article =&gt; {\n urls.push({\n loc: `${baseUrl}/blog/${article.slug}`,\n lastmod: article.date.split(&#x27;T&#x27;)[0],\n changefreq: &#x27;monthly&#x27;,\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n } catch (error) {\n console.error(&#x27;Error adding blog articles to sitemap:&#x27;, error);\n }\n \n // Add image files\n try {\n const images = await getImageFiles();\n images.forEach(image =&gt; {\n urls.push({\n loc: `${baseUrl}${image.path}`,\n lastmod: now,\n changefreq: &#x27;yearly&#x27;,\n priority: SITEMAP_CONFIG.LOW_PRIORITY,\n });\n });\n } catch (error) {\n console.error(&#x27;Error adding images to sitemap:&#x27;, error);\n }\n \n return urls;\n}\n\n/**\n * Format sitemap XML\n */\nfunction formatSitemapXml(urls) {\n const xmlHeader = &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&#x27;;\n const urlsetOpen = &#x27;&lt;urlset xmlns=\&quot;http://www.sitemaps.org/schemas/sitemap/0.9\&quot;&gt;&#x27;;\n const urlsetClose = &#x27;&lt;/urlset&gt;&#x27;;\n \n const urlEntries = urls.map(url =&gt; {\n let urlXml = ` &lt;url&gt;\\n &lt;loc&gt;${escapeXml(url.loc)}&lt;/loc&gt;`;\n \n if (url.lastmod) {\n urlXml += `\\n &lt;lastmod&gt;${url.lastmod}&lt;/lastmod&gt;`;\n }\n \n if (url.changefreq) {\n urlXml += `\\n &lt;changefreq&gt;${url.changefreq}&lt;/changefreq&gt;`;\n }\n \n if (url.priority !== undefined) {\n urlXml += `\\n &lt;priority&gt;${url.priority.toFixed(1)}&lt;/priority&gt;`;\n }\n \n urlXml += &#x27;\\n &lt;/url&gt;&#x27;;\n return urlXml;\n }).join(&#x27;\\n&#x27;);\n \n return `${xmlHeader}\\n${urlsetOpen}\\n${urlEntries}\\n${urlsetClose}`;\n}\n\n/**\n * Check if cache is valid\n */\nfunction isCacheValid(timestamp) {\n return timestamp &amp;&amp; (Date.now() - timestamp) &lt; SITEMAP_CONFIG.CACHE_DURATION;\n}\n\n/**\n * Generate sitemap\n */\nasync function generateSitemap() {\n try {\n // Check cache first\n if (sitemapCache &amp;&amp; isCacheValid(sitemapCache.timestamp)) {\n console.log(&#x27;Returning cached sitemap&#x27;);\n return sitemapCache.xml;\n }\n \n console.log(&#x27;Generating new sitemap...&#x27;);\n \n // Get all URLs\n const allUrls = await getAllSitemapUrls();\n console.log(`Found ${allUrls.length} URLs for sitemap`);\n \n // Generate XML\n const xml = formatSitemapXml(allUrls);\n \n // Cache the result\n sitemapCache = {\n xml,\n timestamp: Date.now(),\n urlCount: allUrls.length,\n };\n \n console.log(&#x27;Sitemap generated and cached successfully&#x27;);\n return xml;\n \n } catch (error) {\n console.error(&#x27;Error generating sitemap:&#x27;, error);\n throw new Error(&#x27;Failed to generate sitemap&#x27;);\n }\n}\n\n/**\n * Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === &#x27;OPTIONS&#x27;) {\n return {\n statusCode: 200,\n headers: {\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;GET, OPTIONS&#x27;,\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;,\n },\n body: &#x27;&#x27;,\n };\n }\n \n // Only allow GET requests\n if (event.httpMethod !== &#x27;GET&#x27;) {\n return {\n statusCode: 405,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n },\n body: &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&lt;error&gt;Method Not Allowed&lt;/error&gt;&#x27;,\n };\n }\n \n try {\n console.log(&#x27;Sitemap request received&#x27;);\n \n // Generate sitemap\n const sitemapXml = await generateSitemap();\n \n // Return sitemap with appropriate headers\n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n &#x27;Cache-Control&#x27;: &#x27;public, max-age=3600, s-maxage=3600&#x27;, // Cache for 1 hour\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\n },\n body: sitemapXml,\n };\n \n } catch (error) {\n console.error(&#x27;Error serving sitemap:&#x27;, error);\n \n return {\n statusCode: 500,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n },\n body: &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&lt;error&gt;Internal Server Error&lt;/error&gt;&#x27;,\n };\n }\n};&quot;], &quot;mappings&quot;: &quot;;AACA,IAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,IAAM,OAAO,QAAQ,MAAM;AAO3B,IAAM,iBAAiB;AAAA,EACrB,sBAAsB;AAAA,EACtB,gBAAgB,KAAK,KAAK,KAAK;AAAA;AAAA,EAC/B,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAGA,IAAM,eAAe;AAAA,EACnB,EAAE,MAAM,KAAK,YAAY,SAAS,UAAU,EAAI;AAAA,EAChD,EAAE,MAAM,UAAU,YAAY,UAAU,UAAU,IAAI;AAAA,EACtD,EAAE,MAAM,SAAS,YAAY,SAAS,UAAU,IAAI;AAAA,EACpD,EAAE,MAAM,UAAU,YAAY,WAAW,UAAU,IAAI;AAAA,EACvD,EAAE,MAAM,YAAY,YAAY,WAAW,UAAU,IAAI;AAAA,EACzD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,EAC/D,EAAE,MAAM,iBAAiB,YAAY,UAAU,UAAU,IAAI;AAAA,EAC7D,EAAE,MAAM,SAAS,YAAY,UAAU,UAAU,IAAI;AAAA,EACrD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AACjE;AAiDA,IAAI,eAAe;AAKnB,SAAS,gBAAgB;AACvB,SAAO,QAAQ,IAAI,OAAO,QAAQ,IAAI,YAAY;AACpD;AAKA,SAAS,UAAU,KAAK;AACtB,SAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAC1B;AAKA,eAAe,mBAAmB;AAChC,MAAI;AACF,UAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,UAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,UAAM,gBAAgB,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC;AAE/D,UAAM,WAAW,CAAC;AAClB,eAAW,QAAQ,eAAe;AAChC,YAAM,WAAW,KAAK,KAAK,YAAY,IAAI;AAC3C,YAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AAGnD,YAAM,mBAAmB,QAAQ,MAAM,uBAAuB;AAC9D,UAAI,kBAAkB;AACpB,cAAM,cAAc,iBAAiB,CAAC;AACtC,cAAM,OAAO,KAAK,QAAQ,OAAO,EAAE;AAGnC,cAAM,aAAa,YAAY,MAAM,+BAA+B;AACpE,cAAM,YAAY,YAAY,MAAM,8BAA8B;AAElE,YAAI,YAAY;AACd,mBAAS,KAAK;AAAA,YACZ;AAAA,YACA,OAAO,WAAW,CAAC;AAAA,YACnB,MAAM,YAAY,UAAU,CAAC,KAAI,oBAAI,KAAK,GAAE,YAAY;AAAA,UAC1D,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO,CAAC;AAAA,EACV;AACF;AAKA,eAAe,gBAAgB;AAC7B,MAAI;AACF,UAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAC7D,UAAM,SAAS,CAAC;AAEhB,mBAAe,cAAc,KAAK,eAAe,IAAI;AACnD,UAAI;AACF,cAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,mBAAW,QAAQ,OAAO;AACxB,gBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,gBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,cAAI,KAAK,YAAY,GAAG;AACtB,kBAAM,cAAc,UAAU,KAAK,KAAK,cAAc,IAAI,CAAC;AAAA,UAC7D,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD,mBAAO,KAAK;AAAA,cACV,MAAM,WAAW,KAAK,KAAK,cAAc,IAAI,EAAE,QAAQ,OAAO,GAAG,CAAC;AAAA,cAClE,UAAU;AAAA,YACZ,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,gBAAQ,KAAK,4BAA4B,GAAG,KAAK,MAAM,OAAO;AAAA,MAChE;AAAA,IACF;AAEA,UAAM,cAAc,SAAS;AAC7B,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,yBAAyB,KAAK;AAC5C,WAAO,CAAC;AAAA,EACV;AACF;AAKA,eAAe,oBAAoB;AACjC,QAAM,UAAU,cAAc;AAC9B,QAAM,OAAO,CAAC;AACd,QAAM,OAAM,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAGjD,eAAa,QAAQ,UAAQ;AAC3B,SAAK,KAAK;AAAA,MACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,MAC3B,SAAS;AAAA,MACT,YAAY,KAAK;AAAA,MACjB,UAAU,KAAK;AAAA,IACjB,CAAC;AAAA,EACH,CAAC;AAGD,QAAM,QAAQ,UAAQ;AACpB,SAAK,KAAK;AAAA,MACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,MAC3B,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU,eAAe;AAAA,IAC3B,CAAC;AAAA,EACH,CAAC;AAGD,MAAI;AACF,UAAM,WAAW,MAAM,iBAAiB;AACxC,aAAS,QAAQ,aAAW;AAC1B,WAAK,KAAK;AAAA,QACR,KAAK,GAAG,OAAO,SAAS,QAAQ,IAAI;AAAA,QACpC,SAAS,QAAQ,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,QAClC,YAAY;AAAA,QACZ,UAAU,eAAe;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,0CAA0C,KAAK;AAAA,EAC/D;AAGA,MAAI;AACF,UAAM,SAAS,MAAM,cAAc;AACnC,WAAO,QAAQ,WAAS;AACtB,WAAK,KAAK;AAAA,QACR,KAAK,GAAG,OAAO,GAAG,MAAM,IAAI;AAAA,QAC5B,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,UAAU,eAAe;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,mCAAmC,KAAK;AAAA,EACxD;AAEA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAM;AAC9B,QAAM,YAAY;AAClB,QAAM,aAAa;AACnB,QAAM,cAAc;AAEpB,QAAM,aAAa,KAAK,IAAI,SAAO;AACjC,QAAI,SAAS;AAAA,WAAqB,UAAU,IAAI,GAAG,CAAC;AAEpD,QAAI,IAAI,SAAS;AACf,gBAAU;AAAA,eAAkB,IAAI,OAAO;AAAA,IACzC;AAEA,QAAI,IAAI,YAAY;AAClB,gBAAU;AAAA,kBAAqB,IAAI,UAAU;AAAA,IAC/C;AAEA,QAAI,IAAI,aAAa,QAAW;AAC9B,gBAAU;AAAA,gBAAmB,IAAI,SAAS,QAAQ,CAAC,CAAC;AAAA,IACtD;AAEA,cAAU;AACV,WAAO;AAAA,EACT,CAAC,EAAE,KAAK,IAAI;AAEZ,SAAO,GAAG,SAAS;AAAA,EAAK,UAAU;AAAA,EAAK,UAAU;AAAA,EAAK,WAAW;AACnE;AAKA,SAAS,aAAa,WAAW;AAC/B,SAAO,aAAc,KAAK,IAAI,IAAI,YAAa,eAAe;AAChE;AAKA,eAAe,kBAAkB;AAC/B,MAAI;AAEF,QAAI,gBAAgB,aAAa,aAAa,SAAS,GAAG;AACxD,cAAQ,IAAI,0BAA0B;AACtC,aAAO,aAAa;AAAA,IACtB;AAEA,YAAQ,IAAI,2BAA2B;AAGvC,UAAM,UAAU,MAAM,kBAAkB;AACxC,YAAQ,IAAI,SAAS,QAAQ,MAAM,mBAAmB;AAGtD,UAAM,MAAM,iBAAiB,OAAO;AAGpC,mBAAe;AAAA,MACb;AAAA,MACA,WAAW,KAAK,IAAI;AAAA,MACpB,UAAU,QAAQ;AAAA,IACpB;AAEA,YAAQ,IAAI,2CAA2C;AACvD,WAAO;AAAA,EAET,SAAS,OAAO;AACd,YAAQ,MAAM,6BAA6B,KAAK;AAChD,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AACF;AAKA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAGA,MAAI,MAAM,eAAe,OAAO;AAC9B,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,MAAI;AACF,YAAQ,IAAI,0BAA0B;AAGtC,UAAM,aAAa,MAAM,gBAAgB;AAGzC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,QAChB,iBAAiB;AAAA;AAAA,QACjB,+BAA+B;AAAA,MACjC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,0BAA0B,KAAK;AAE7C,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AACF;&quot;, &quot;names&quot;: [] } </div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ package.json</div> <div class="content">{&quot;type&quot;:&quot;commonjs&quot;}</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ sitemap.js</div> <div class="content">module.exports = require(&#x27;./netlify/functions/sitemap.js&#x27;)</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ sitemap-admin</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ___netlify-telemetry.mjs</div> <div class="content"> var SERVICE_NAME = undefined; var SERVICE_VERSION = undefined; import{createRequire}from&quot;module&quot;;const require=createRequire(import.meta.url); var sz=Object.create;var xu=Object.defineProperty;var az=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var cz=Object.getPrototypeOf,uz=Object.prototype.hasOwnProperty;var V=(r=&gt;typeof require&lt;&quot;u&quot;?require:typeof Proxy&lt;&quot;u&quot;?new Proxy(r,{get:(e,t)=&gt;(typeof require&lt;&quot;u&quot;?require:e)[t]}):r)(function(r){if(typeof require&lt;&quot;u&quot;)return require.apply(this,arguments);throw Error(&#x27;Dynamic require of &quot;&#x27;+r+&#x27;&quot; is not supported&#x27;)});var p=(r,e)=&gt;()=&gt;(r&amp;&amp;(e=r(r=0)),e);var T=(r,e)=&gt;()=&gt;(e||r((e={exports:{}}).exports,e),e.exports),Ae=(r,e)=&gt;{for(var t in e)xu(r,t,{get:e[t],enumerable:!0})},NR=(r,e,t,o)=&gt;{if(e&amp;&amp;typeof e==&quot;object&quot;||typeof e==&quot;function&quot;)for(let s of lz(e))!uz.call(r,s)&amp;&amp;s!==t&amp;&amp;xu(r,s,{get:()=&gt;e[s],enumerable:!(o=az(e,s))||o.enumerable});return r};var Nn=(r,e,t)=&gt;(t=r!=null?sz(cz(r)):{},NR(e||!r||!r.__esModule?xu(t,&quot;default&quot;,{value:r,enumerable:!0}):t,r)),ee=r=&gt;NR(xu({},&quot;__esModule&quot;,{value:!0}),r);var CR,PR=p(()=&gt;{CR=typeof globalThis==&quot;object&quot;?globalThis:global});var IR=p(()=&gt;{PR()});var bR=p(()=&gt;{IR()});var cn,hm=p(()=&gt;{cn=&quot;1.9.0&quot;});function fz(r){var e=new Set([r]),t=new Set,o=r.match(LR);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(l){return l===r};function a(n){return t.add(n),!1}function i(n){return e.add(n),!0}return function(l){if(e.has(l))return!0;if(t.has(l))return!1;var c=l.match(LR);if(!c)return a(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||s.major!==u.major?a(l):s.major===0?s.minor===u.minor&amp;&amp;s.patch&lt;=u.patch?i(l):a(l):s.minor&lt;=u.minor?i(l):a(l)}}var LR,xR,MR=p(()=&gt;{hm();LR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;xR=fz(cn)});function Ir(r,e,t,o){var s;o===void 0&amp;&amp;(o=!1);var a=Fa[Va]=(s=Fa[Va])!==null&amp;&amp;s!==void 0?s:{version:cn};if(!o&amp;&amp;a[r]){var i=new Error(&quot;@opentelemetry/api: Attempted duplicate registration of API: &quot;+r);return t.error(i.stack||i.message),!1}if(a.version!==cn){var i=new Error(&quot;@opentelemetry/api: Registration of version v&quot;+a.version+&quot; for &quot;+r+&quot; does not match previously registered API v&quot;+cn);return t.error(i.stack||i.message),!1}return a[r]=e,t.debug(&quot;@opentelemetry/api: Registered a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;),!0}function xt(r){var e,t,o=(e=Fa[Va])===null||e===void 0?void 0:e.version;if(!(!o||!xR(o)))return(t=Fa[Va])===null||t===void 0?void 0:t[r]}function br(r,e){e.debug(&quot;@opentelemetry/api: Unregistering a global for &quot;+r+&quot; v&quot;+cn+&quot;.&quot;);var t=Fa[Va];t&amp;&amp;delete t[r]}var pz,Va,Fa,Ei=p(()=&gt;{bR();hm();MR();pz=cn.split(&quot;.&quot;)[0],Va=Symbol.for(&quot;opentelemetry.js.api.&quot;+pz),Fa=CR});function Ga(r,e,t){var o=xt(&quot;diag&quot;);if(o)return t.unshift(e),o[r].apply(o,hz([],dz(t),!1))}var dz,hz,wR,DR=p(()=&gt;{Ei();dz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},hz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},wR=(function(){function r(e){this._namespace=e.namespace||&quot;DiagComponentLogger&quot;}return r.prototype.debug=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;debug&quot;,this._namespace,e)},r.prototype.error=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;error&quot;,this._namespace,e)},r.prototype.info=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;info&quot;,this._namespace,e)},r.prototype.warn=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;warn&quot;,this._namespace,e)},r.prototype.verbose=function(){for(var e=[],t=0;t&lt;arguments.length;t++)e[t]=arguments[t];return Ga(&quot;verbose&quot;,this._namespace,e)},r})()});var H,Mu=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.ERROR=30]=&quot;ERROR&quot;,r[r.WARN=50]=&quot;WARN&quot;,r[r.INFO=60]=&quot;INFO&quot;,r[r.DEBUG=70]=&quot;DEBUG&quot;,r[r.VERBOSE=80]=&quot;VERBOSE&quot;,r[r.ALL=9999]=&quot;ALL&quot;})(H||(H={}))});function UR(r,e){r&lt;H.NONE?r=H.NONE:r&gt;H.ALL&amp;&amp;(r=H.ALL),e=e||{};function t(o,s){var a=e[o];return typeof a==&quot;function&quot;&amp;&amp;r&gt;=s?a.bind(e):function(){}}return{error:t(&quot;error&quot;,H.ERROR),warn:t(&quot;warn&quot;,H.WARN),info:t(&quot;info&quot;,H.INFO),debug:t(&quot;debug&quot;,H.DEBUG),verbose:t(&quot;verbose&quot;,H.VERBOSE)}}var kR=p(()=&gt;{Mu()});var _z,Ez,mz,ft,mi=p(()=&gt;{DR();kR();Mu();Ei();_z=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Ez=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},mz=&quot;diag&quot;,ft=(function(){function r(){function e(s){return function(){for(var a=[],i=0;i&lt;arguments.length;i++)a[i]=arguments[i];var n=xt(&quot;diag&quot;);if(n)return n[s].apply(n,Ez([],_z(a),!1))}}var t=this,o=function(s,a){var i,n,l;if(a===void 0&amp;&amp;(a={logLevel:H.INFO}),s===t){var c=new Error(&quot;Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation&quot;);return t.error((i=c.stack)!==null&amp;&amp;i!==void 0?i:c.message),!1}typeof a==&quot;number&quot;&amp;&amp;(a={logLevel:a});var u=xt(&quot;diag&quot;),f=UR((n=a.logLevel)!==null&amp;&amp;n!==void 0?n:H.INFO,s);if(u&amp;&amp;!a.suppressOverrideMessage){var _=(l=new Error().stack)!==null&amp;&amp;l!==void 0?l:&quot;&lt;failed to generate stacktrace&gt;&quot;;u.warn(&quot;Current logger will be overwritten from &quot;+_),f.warn(&quot;Current logger will overwrite one already registered from &quot;+_)}return Ir(&quot;diag&quot;,f,t,!0)};t.setLogger=o,t.disable=function(){br(mz,t)},t.createComponentLogger=function(s){return new wR(s)},t.verbose=e(&quot;verbose&quot;),t.debug=e(&quot;debug&quot;),t.info=e(&quot;info&quot;),t.warn=e(&quot;warn&quot;),t.error=e(&quot;error&quot;)}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r})()});var Tz,Sz,BR,VR=p(()=&gt;{Tz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Sz=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},BR=(function(){function r(e){this._entries=e?new Map(e):new Map}return r.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Tz(e,2),o=t[0],s=t[1];return[o,s]})},r.prototype.setEntry=function(e,t){var o=new r(this._entries);return o._entries.set(e,t),o},r.prototype.removeEntry=function(e){var t=new r(this._entries);return t._entries.delete(e),t},r.prototype.removeEntries=function(){for(var e,t,o=[],s=0;s&lt;arguments.length;s++)o[s]=arguments[s];var a=new r(this._entries);try{for(var i=Sz(o),n=i.next();!n.done;n=i.next()){var l=n.value;a._entries.delete(l)}}catch(c){e={error:c}}finally{try{n&amp;&amp;!n.done&amp;&amp;(t=i.return)&amp;&amp;t.call(i)}finally{if(e)throw e.error}}return a},r.prototype.clear=function(){return new r},r})()});var FR,GR=p(()=&gt;{FR=Symbol(&quot;BaggageEntryMetadata&quot;)});function HR(r){return r===void 0&amp;&amp;(r={}),new BR(new Map(Object.entries(r)))}function Lr(r){return typeof r!=&quot;string&quot;&amp;&amp;(gz.error(&quot;Cannot create baggage metadata from unknown type: &quot;+typeof r),r=&quot;&quot;),{__TYPE__:FR,toString:function(){return r}}}var gz,_m=p(()=&gt;{mi();VR();GR();gz=ft.instance()});function De(r){return Symbol.for(r)}var vz,wu,Ha=p(()=&gt;{vz=(function(){function r(e){var t=this;t._currentContext=e?new Map(e):new Map,t.getValue=function(o){return t._currentContext.get(o)},t.setValue=function(o,s){var a=new r(t._currentContext);return a._currentContext.set(o,s),a},t.deleteValue=function(o){var s=new r(t._currentContext);return s._currentContext.delete(o),s}}return r})(),wu=new vz});var Em,Du,qR=p(()=&gt;{Em=[{n:&quot;error&quot;,c:&quot;error&quot;},{n:&quot;warn&quot;,c:&quot;warn&quot;},{n:&quot;info&quot;,c:&quot;info&quot;},{n:&quot;debug&quot;,c:&quot;debug&quot;},{n:&quot;verbose&quot;,c:&quot;trace&quot;}],Du=(function(){function r(){function e(o){return function(){for(var s=[],a=0;a&lt;arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!=&quot;function&quot;&amp;&amp;(i=console.log),typeof i==&quot;function&quot;)return i.apply(console,s)}}}for(var t=0;t&lt;Em.length;t++)this[Em[t].n]=e(Em[t].c)}return r})()});function ku(){return Tm}var Ti,yz,Uu,Oz,Az,Rz,Nz,mm,Cz,Pz,Iz,Tm,bz,Lz,xz,Mz,wz,Dz,Uz,Sm=p(()=&gt;{Ti=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),yz=(function(){function r(){}return r.prototype.createGauge=function(e,t){return Lz},r.prototype.createHistogram=function(e,t){return xz},r.prototype.createCounter=function(e,t){return bz},r.prototype.createUpDownCounter=function(e,t){return Mz},r.prototype.createObservableGauge=function(e,t){return Dz},r.prototype.createObservableCounter=function(e,t){return wz},r.prototype.createObservableUpDownCounter=function(e,t){return Uz},r.prototype.addBatchObservableCallback=function(e,t){},r.prototype.removeBatchObservableCallback=function(e){},r})(),Uu=(function(){function r(){}return r})(),Oz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Az=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.add=function(t,o){},e})(Uu),Rz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),Nz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e.prototype.record=function(t,o){},e})(Uu),mm=(function(){function r(){}return r.prototype.addCallback=function(e){},r.prototype.removeCallback=function(e){},r})(),Cz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Pz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Iz=(function(r){Ti(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(mm),Tm=new yz,bz=new Oz,Lz=new Rz,xz=new Nz,Mz=new Az,wz=new Cz,Dz=new Pz,Uz=new Iz});var Ot,jR=p(()=&gt;{(function(r){r[r.INT=0]=&quot;INT&quot;,r[r.DOUBLE=1]=&quot;DOUBLE&quot;})(Ot||(Ot={}))});var Bu,Vu,gm=p(()=&gt;{Bu={get:function(r,e){if(r!=null)return r[e]},keys:function(r){return r==null?[]:Object.keys(r)}},Vu={set:function(r,e,t){r!=null&amp;&amp;(r[e]=t)}}});var kz,Bz,YR,zR=p(()=&gt;{Ha();kz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Bz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},YR=(function(){function r(){}return r.prototype.active=function(){return wu},r.prototype.with=function(e,t,o){for(var s=[],a=3;a&lt;arguments.length;a++)s[a-3]=arguments[a];return t.call.apply(t,Bz([o],kz(s),!1))},r.prototype.bind=function(e,t){return t},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r})()});var Vz,Fz,vm,Gz,Cn,qa=p(()=&gt;{zR();Ei();mi();Vz=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},Fz=function(r,e,t){if(t||arguments.length===2)for(var o=0,s=e.length,a;o&lt;s;o++)(a||!(o in e))&amp;&amp;(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return r.concat(a||Array.prototype.slice.call(e))},vm=&quot;context&quot;,Gz=new YR,Cn=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(e){return Ir(vm,e,ft.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(e,t,o){for(var s,a=[],i=3;i&lt;arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,Fz([e,t,o],Vz(a),!1))},r.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},r.prototype._getContextManager=function(){return xt(vm)||Gz},r.prototype.disable=function(){this._getContextManager().disable(),br(vm,ft.instance())},r})()});var se,ym=p(()=&gt;{(function(r){r[r.NONE=0]=&quot;NONE&quot;,r[r.SAMPLED=1]=&quot;SAMPLED&quot;})(se||(se={}))});var ja,Ya,Uo,Fu=p(()=&gt;{ym();ja=&quot;0000000000000000&quot;,Ya=&quot;00000000000000000000000000000000&quot;,Uo={traceId:Ya,spanId:ja,traceFlags:se.NONE}});var Pn,Gu=p(()=&gt;{Fu();Pn=(function(){function r(e){e===void 0&amp;&amp;(e=Uo),this._spanContext=e}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(e,t){return this},r.prototype.setAttributes=function(e){return this},r.prototype.addEvent=function(e,t){return this},r.prototype.addLink=function(e){return this},r.prototype.addLinks=function(e){return this},r.prototype.setStatus=function(e){return this},r.prototype.updateName=function(e){return this},r.prototype.end=function(e){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(e,t){},r})()});function Hu(r){return r.getValue(Om)||void 0}function KR(){return Hu(Cn.getInstance().active())}function za(r,e){return r.setValue(Om,e)}function $R(r){return r.deleteValue(Om)}function XR(r,e){return za(r,new Pn(e))}function qu(r){var e;return(e=Hu(r))===null||e===void 0?void 0:e.spanContext()}var Om,Am=p(()=&gt;{Ha();Gu();qa();Om=De(&quot;OpenTelemetry Context Key SPAN&quot;)});function Mt(r){return Hz.test(r)&amp;&amp;r!==Ya}function Si(r){return qz.test(r)&amp;&amp;r!==ja}function xe(r){return Mt(r.traceId)&amp;&amp;Si(r.spanId)}function WR(r){return new Pn(r)}var Hz,qz,ju=p(()=&gt;{Fu();Gu();Hz=/^([0-9a-f]{32})$/i,qz=/^[0-9a-f]{16}$/i});function jz(r){return typeof r==&quot;object&quot;&amp;&amp;typeof r.spanId==&quot;string&quot;&amp;&amp;typeof r.traceId==&quot;string&quot;&amp;&amp;typeof r.traceFlags==&quot;number&quot;}var Rm,Yu,Nm=p(()=&gt;{qa();Am();Gu();ju();Rm=Cn.getInstance(),Yu=(function(){function r(){}return r.prototype.startSpan=function(e,t,o){o===void 0&amp;&amp;(o=Rm.active());var s=!!(t!=null&amp;&amp;t.root);if(s)return new Pn;var a=o&amp;&amp;qu(o);return jz(a)&amp;&amp;xe(a)?new Pn(a):new Pn},r.prototype.startActiveSpan=function(e,t,o,s){var a,i,n;if(!(arguments.length&lt;2)){arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);var l=i??Rm.active(),c=this.startSpan(e,a,l),u=za(l,c);return Rm.with(u,n,void 0,c)}},r})()});var Yz,zu,Cm=p(()=&gt;{Nm();Yz=new Yu,zu=(function(){function r(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}return r.prototype.startSpan=function(e,t,o){return this._getTracer().startSpan(e,t,o)},r.prototype.startActiveSpan=function(e,t,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yz},r})()});var JR,QR=p(()=&gt;{Nm();JR=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){return new Yu},r})()});var zz,Ka,Pm=p(()=&gt;{Cm();QR();zz=new JR,Ka=(function(){function r(){}return r.prototype.getTracer=function(e,t,o){var s;return(s=this.getDelegateTracer(e,t,o))!==null&amp;&amp;s!==void 0?s:new zu(this,e,t,o)},r.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:zz},r.prototype.setDelegate=function(e){this._delegate=e},r.prototype.getDelegateTracer=function(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,t,o)},r})()});var ke,ZR=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(ke||(ke={}))});var qt,eN=p(()=&gt;{(function(r){r[r.INTERNAL=0]=&quot;INTERNAL&quot;,r[r.SERVER=1]=&quot;SERVER&quot;,r[r.CLIENT=2]=&quot;CLIENT&quot;,r[r.PRODUCER=3]=&quot;PRODUCER&quot;,r[r.CONSUMER=4]=&quot;CONSUMER&quot;})(qt||(qt={}))});var jt,tN=p(()=&gt;{(function(r){r[r.UNSET=0]=&quot;UNSET&quot;,r[r.OK=1]=&quot;OK&quot;,r[r.ERROR=2]=&quot;ERROR&quot;})(jt||(jt={}))});function rN(r){return Xz.test(r)}function nN(r){return Wz.test(r)&amp;&amp;!Jz.test(r)}var Im,Kz,$z,Xz,Wz,Jz,iN=p(()=&gt;{Im=&quot;[_0-9a-z-*/]&quot;,Kz=&quot;[a-z]&quot;+Im+&quot;{0,255}&quot;,$z=&quot;[a-z0-9]&quot;+Im+&quot;{0,240}@[a-z]&quot;+Im+&quot;{0,13}&quot;,Xz=new RegExp(&quot;^(?:&quot;+Kz+&quot;|&quot;+$z+&quot;)$&quot;),Wz=/^[ -~]{0,255}[!-~]$/,Jz=/,|=/});var oN,Qz,sN,aN,lN,cN=p(()=&gt;{iN();oN=32,Qz=512,sN=&quot;,&quot;,aN=&quot;=&quot;,lN=(function(){function r(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}return r.prototype.set=function(e,t){var o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o},r.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},r.prototype.get=function(e){return this._internalState.get(e)},r.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,o){return t.push(o+aN+e.get(o)),t},[]).join(sN)},r.prototype._parse=function(e){e.length&gt;Qz||(this._internalState=e.split(sN).reverse().reduce(function(t,o){var s=o.trim(),a=s.indexOf(aN);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);rN(i)&amp;&amp;nN(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;oN&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,oN))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var e=new r;return e._internalState=new Map(this._internalState),e},r})()});function uN(r){return new lN(r)}var fN=p(()=&gt;{cN()});var he,pN=p(()=&gt;{qa();he=Cn.getInstance()});var S,dN=p(()=&gt;{mi();S=ft.instance()});var Zz,hN,_N=p(()=&gt;{Sm();Zz=(function(){function r(){}return r.prototype.getMeter=function(e,t,o){return Tm},r})(),hN=new Zz});var bm,EN,mN=p(()=&gt;{_N();Ei();mi();bm=&quot;metrics&quot;,EN=(function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(e){return Ir(bm,e,ft.instance())},r.prototype.getMeterProvider=function(){return xt(bm)||hN},r.prototype.getMeter=function(e,t,o){return this.getMeterProvider().getMeter(e,t,o)},r.prototype.disable=function(){br(bm,ft.instance())},r})()});var gi,TN=p(()=&gt;{mN();gi=EN.getInstance()});var SN,gN=p(()=&gt;{SN=(function(){function r(){}return r.prototype.inject=function(e,t){},r.prototype.extract=function(e,t){return e},r.prototype.fields=function(){return[]},r})()});function xm(r){return r.getValue(Lm)||void 0}function vN(){return xm(Cn.getInstance().active())}function yN(r,e){return r.setValue(Lm,e)}function ON(r){return r.deleteValue(Lm)}var Lm,AN=p(()=&gt;{qa();Ha();Lm=De(&quot;OpenTelemetry Baggage Key&quot;)});var Mm,eK,RN,NN=p(()=&gt;{Ei();gN();gm();AN();_m();mi();Mm=&quot;propagation&quot;,eK=new SN,RN=(function(){function r(){this.createBaggage=HR,this.getBaggage=xm,this.getActiveBaggage=vN,this.setBaggage=yN,this.deleteBaggage=ON}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(e){return Ir(Mm,e,ft.instance())},r.prototype.inject=function(e,t,o){return o===void 0&amp;&amp;(o=Vu),this._getGlobalPropagator().inject(e,t,o)},r.prototype.extract=function(e,t,o){return o===void 0&amp;&amp;(o=Bu),this._getGlobalPropagator().extract(e,t,o)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){br(Mm,ft.instance())},r.prototype._getGlobalPropagator=function(){return xt(Mm)||eK},r})()});var Ue,CN=p(()=&gt;{NN();Ue=RN.getInstance()});var wm,PN,IN=p(()=&gt;{Ei();Pm();ju();Am();mi();wm=&quot;trace&quot;,PN=(function(){function r(){this._proxyTracerProvider=new Ka,this.wrapSpanContext=WR,this.isSpanContextValid=xe,this.deleteSpan=$R,this.getSpan=Hu,this.getActiveSpan=KR,this.getSpanContext=qu,this.setSpan=za,this.setSpanContext=XR}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(e){var t=Ir(wm,this._proxyTracerProvider,ft.instance());return t&amp;&amp;this._proxyTracerProvider.setDelegate(e),t},r.prototype.getTracerProvider=function(){return xt(wm)||this._proxyTracerProvider},r.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},r.prototype.disable=function(){br(wm,ft.instance()),this._proxyTracerProvider=new Ka},r})()});var ie,bN=p(()=&gt;{IN();ie=PN.getInstance()});var ot={};Ae(ot,{DiagConsoleLogger:()=&gt;Du,DiagLogLevel:()=&gt;H,INVALID_SPANID:()=&gt;ja,INVALID_SPAN_CONTEXT:()=&gt;Uo,INVALID_TRACEID:()=&gt;Ya,ProxyTracer:()=&gt;zu,ProxyTracerProvider:()=&gt;Ka,ROOT_CONTEXT:()=&gt;wu,SamplingDecision:()=&gt;ke,SpanKind:()=&gt;qt,SpanStatusCode:()=&gt;jt,TraceFlags:()=&gt;se,ValueType:()=&gt;Ot,baggageEntryMetadataFromString:()=&gt;Lr,context:()=&gt;he,createContextKey:()=&gt;De,createNoopMeter:()=&gt;ku,createTraceState:()=&gt;uN,default:()=&gt;tK,defaultTextMapGetter:()=&gt;Bu,defaultTextMapSetter:()=&gt;Vu,diag:()=&gt;S,isSpanContextValid:()=&gt;xe,isValidSpanId:()=&gt;Si,isValidTraceId:()=&gt;Mt,metrics:()=&gt;gi,propagation:()=&gt;Ue,trace:()=&gt;ie});var tK,P=p(()=&gt;{_m();Ha();qR();Mu();Sm();jR();gm();Cm();Pm();ZR();eN();tN();ym();fN();ju();Fu();pN();dN();TN();CN();bN();tK={context:he,diag:S,metrics:gi,propagation:Ue,trace:ie}});function Be(r){for(var e={},t=r.length,o=0;o&lt;t;o++){var s=r[o];s&amp;&amp;(e[String(s).toUpperCase().replace(/[-.]/g,&quot;_&quot;)]=s)}return e}var Dm=p(()=&gt;{});var MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP,rK,nK,iK,oK,sK,aK,lK,cK,uK,fK,pK,dK,hK,_K,EK,mK,TK,SK,gK,vK,yK,Xa,Wa,Um,OK,AK,RK,NK,CK,PK,IK,bK,LK,xK,MK,wK,DK,UK,kK,BK,VK,FK,GK,HK,qK,jK,YK,zK,KK,$K,XK,WK,JK,QK,ZK,e$,t$,r$,n$,i$,o$,s$,a$,l$,c$,u$,f$,p$,d$,h$,_$,E$,m$,T$,S$,g$,v$,y$,O$,A$,R$,N$,C$,P$,I$,b$,L$,x$,M$,w$,D$,U$,k$,B$,V$,F$,G$,H$,q$,j$,Y$,z$,K$,$$,X$,W$,J$,Q$,Z$,eX,tX,rX,nX,iX,oX,sX,aX,lX,cX,uX,fX,pX,dX,hX,_X,EX,mX,TX,SX,ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI,gX,vX,yX,OX,AX,RX,NX,CX,PX,IX,bX,LX,xX,MX,wX,DX,UX,kX,BX,VX,FX,GX,HX,qX,jX,YX,zX,KX,$X,XX,WX,JX,QX,ZX,eW,tW,rW,nW,iW,oW,sW,aW,lW,cW,uW,fW,pW,dW,zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb,hW,_W,EW,mW,TW,SW,gW,vW,yW,OW,AW,RW,nb,ib,ob,sb,ab,NW,CW,PW,IW,bW,LW,lb,cb,ub,xW,MW,wW,DW,fb,pb,db,hb,UW,kW,BW,VW,FW,_b,Eb,mb,Tb,Sb,gb,vb,GW,HW,qW,jW,YW,zW,KW,$W,yb,Ob,Ab,Rb,Nb,XW,WW,JW,QW,ZW,e8,Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb,t8,r8,n8,i8,o8,s8,a8,l8,c8,u8,f8,p8,d8,h8,_8,E8,m8,T8,S8,g8,v8,y8,$b,Xb,Wb,Jb,Qb,O8,A8,R8,N8,C8,P8,Zb,eL,I8,b8,L8,tL,rL,x8,M8,w8,nL,iL,oL,sL,aL,lL,cL,uL,fL,pL,dL,hL,_L,EL,mL,TL,SL,D8,U8,k8,B8,V8,F8,G8,H8,q8,j8,Y8,z8,K8,$8,X8,W8,J8,Q8,gL,vL,Z8,e5,t5,yL=p(()=&gt;{Dm();MN=&quot;aws.lambda.invoked_arn&quot;,wN=&quot;db.system&quot;,DN=&quot;db.connection_string&quot;,UN=&quot;db.user&quot;,kN=&quot;db.jdbc.driver_classname&quot;,BN=&quot;db.name&quot;,VN=&quot;db.statement&quot;,FN=&quot;db.operation&quot;,GN=&quot;db.mssql.instance_name&quot;,HN=&quot;db.cassandra.keyspace&quot;,qN=&quot;db.cassandra.page_size&quot;,jN=&quot;db.cassandra.consistency_level&quot;,YN=&quot;db.cassandra.table&quot;,zN=&quot;db.cassandra.idempotence&quot;,KN=&quot;db.cassandra.speculative_execution_count&quot;,$N=&quot;db.cassandra.coordinator.id&quot;,XN=&quot;db.cassandra.coordinator.dc&quot;,WN=&quot;db.hbase.namespace&quot;,JN=&quot;db.redis.database_index&quot;,QN=&quot;db.mongodb.collection&quot;,ZN=&quot;db.sql.table&quot;,eC=&quot;exception.type&quot;,tC=&quot;exception.message&quot;,rC=&quot;exception.stacktrace&quot;,nC=&quot;exception.escaped&quot;,iC=&quot;faas.trigger&quot;,oC=&quot;faas.execution&quot;,sC=&quot;faas.document.collection&quot;,aC=&quot;faas.document.operation&quot;,lC=&quot;faas.document.time&quot;,cC=&quot;faas.document.name&quot;,uC=&quot;faas.time&quot;,fC=&quot;faas.cron&quot;,pC=&quot;faas.coldstart&quot;,dC=&quot;faas.invoked_name&quot;,hC=&quot;faas.invoked_provider&quot;,_C=&quot;faas.invoked_region&quot;,EC=&quot;net.transport&quot;,mC=&quot;net.peer.ip&quot;,TC=&quot;net.peer.port&quot;,SC=&quot;net.peer.name&quot;,gC=&quot;net.host.ip&quot;,vC=&quot;net.host.port&quot;,yC=&quot;net.host.name&quot;,OC=&quot;net.host.connection.type&quot;,AC=&quot;net.host.connection.subtype&quot;,RC=&quot;net.host.carrier.name&quot;,NC=&quot;net.host.carrier.mcc&quot;,CC=&quot;net.host.carrier.mnc&quot;,PC=&quot;net.host.carrier.icc&quot;,IC=&quot;peer.service&quot;,bC=&quot;enduser.id&quot;,LC=&quot;enduser.role&quot;,xC=&quot;enduser.scope&quot;,MC=&quot;thread.id&quot;,wC=&quot;thread.name&quot;,DC=&quot;code.function&quot;,UC=&quot;code.namespace&quot;,kC=&quot;code.filepath&quot;,BC=&quot;code.lineno&quot;,VC=&quot;http.method&quot;,FC=&quot;http.url&quot;,GC=&quot;http.target&quot;,HC=&quot;http.host&quot;,qC=&quot;http.scheme&quot;,jC=&quot;http.status_code&quot;,YC=&quot;http.flavor&quot;,zC=&quot;http.user_agent&quot;,KC=&quot;http.request_content_length&quot;,$C=&quot;http.request_content_length_uncompressed&quot;,XC=&quot;http.response_content_length&quot;,WC=&quot;http.response_content_length_uncompressed&quot;,JC=&quot;http.server_name&quot;,QC=&quot;http.route&quot;,ZC=&quot;http.client_ip&quot;,eP=&quot;aws.dynamodb.table_names&quot;,tP=&quot;aws.dynamodb.consumed_capacity&quot;,rP=&quot;aws.dynamodb.item_collection_metrics&quot;,nP=&quot;aws.dynamodb.provisioned_read_capacity&quot;,iP=&quot;aws.dynamodb.provisioned_write_capacity&quot;,oP=&quot;aws.dynamodb.consistent_read&quot;,sP=&quot;aws.dynamodb.projection&quot;,aP=&quot;aws.dynamodb.limit&quot;,lP=&quot;aws.dynamodb.attributes_to_get&quot;,cP=&quot;aws.dynamodb.index_name&quot;,uP=&quot;aws.dynamodb.select&quot;,fP=&quot;aws.dynamodb.global_secondary_indexes&quot;,pP=&quot;aws.dynamodb.local_secondary_indexes&quot;,dP=&quot;aws.dynamodb.exclusive_start_table&quot;,hP=&quot;aws.dynamodb.table_count&quot;,_P=&quot;aws.dynamodb.scan_forward&quot;,EP=&quot;aws.dynamodb.segment&quot;,mP=&quot;aws.dynamodb.total_segments&quot;,TP=&quot;aws.dynamodb.count&quot;,SP=&quot;aws.dynamodb.scanned_count&quot;,gP=&quot;aws.dynamodb.attribute_definitions&quot;,vP=&quot;aws.dynamodb.global_secondary_index_updates&quot;,yP=&quot;messaging.system&quot;,OP=&quot;messaging.destination&quot;,AP=&quot;messaging.destination_kind&quot;,RP=&quot;messaging.temp_destination&quot;,NP=&quot;messaging.protocol&quot;,CP=&quot;messaging.protocol_version&quot;,PP=&quot;messaging.url&quot;,IP=&quot;messaging.message_id&quot;,bP=&quot;messaging.conversation_id&quot;,LP=&quot;messaging.message_payload_size_bytes&quot;,xP=&quot;messaging.message_payload_compressed_size_bytes&quot;,MP=&quot;messaging.operation&quot;,wP=&quot;messaging.consumer_id&quot;,DP=&quot;messaging.rabbitmq.routing_key&quot;,UP=&quot;messaging.kafka.message_key&quot;,kP=&quot;messaging.kafka.consumer_group&quot;,BP=&quot;messaging.kafka.client_id&quot;,VP=&quot;messaging.kafka.partition&quot;,FP=&quot;messaging.kafka.tombstone&quot;,GP=&quot;rpc.system&quot;,HP=&quot;rpc.service&quot;,qP=&quot;rpc.method&quot;,jP=&quot;rpc.grpc.status_code&quot;,YP=&quot;rpc.jsonrpc.version&quot;,zP=&quot;rpc.jsonrpc.request_id&quot;,KP=&quot;rpc.jsonrpc.error_code&quot;,$P=&quot;rpc.jsonrpc.error_message&quot;,XP=&quot;message.type&quot;,WP=&quot;message.id&quot;,JP=&quot;message.compressed_size&quot;,QP=&quot;message.uncompressed_size&quot;,rK=MN,nK=wN,iK=DN,oK=UN,sK=kN,aK=BN,lK=VN,cK=FN,uK=GN,fK=HN,pK=qN,dK=jN,hK=YN,_K=zN,EK=KN,mK=$N,TK=XN,SK=WN,gK=JN,vK=QN,yK=ZN,Xa=eC,Wa=tC,Um=rC,OK=nC,AK=iC,RK=oC,NK=sC,CK=aC,PK=lC,IK=cC,bK=uC,LK=fC,xK=pC,MK=dC,wK=hC,DK=_C,UK=EC,kK=mC,BK=TC,VK=SC,FK=gC,GK=vC,HK=yC,qK=OC,jK=AC,YK=RC,zK=NC,KK=CC,$K=PC,XK=IC,WK=bC,JK=LC,QK=xC,ZK=MC,e$=wC,t$=DC,r$=UC,n$=kC,i$=BC,o$=VC,s$=FC,a$=GC,l$=HC,c$=qC,u$=jC,f$=YC,p$=zC,d$=KC,h$=$C,_$=XC,E$=WC,m$=JC,T$=QC,S$=ZC,g$=eP,v$=tP,y$=rP,O$=nP,A$=iP,R$=oP,N$=sP,C$=aP,P$=lP,I$=cP,b$=uP,L$=fP,x$=pP,M$=dP,w$=hP,D$=_P,U$=EP,k$=mP,B$=TP,V$=SP,F$=gP,G$=vP,H$=yP,q$=OP,j$=AP,Y$=RP,z$=NP,K$=CP,$$=PP,X$=IP,W$=bP,J$=LP,Q$=xP,Z$=MP,eX=wP,tX=DP,rX=UP,nX=kP,iX=BP,oX=VP,sX=FP,aX=GP,lX=HP,cX=qP,uX=jP,fX=YP,pX=zP,dX=KP,hX=$P,_X=XP,EX=WP,mX=JP,TX=QP,SX=Be([MN,wN,DN,UN,kN,BN,VN,FN,GN,HN,qN,jN,YN,zN,KN,$N,XN,WN,JN,QN,ZN,eC,tC,rC,nC,iC,oC,sC,aC,lC,cC,uC,fC,pC,dC,hC,_C,EC,mC,TC,SC,gC,vC,yC,OC,AC,RC,NC,CC,PC,IC,bC,LC,xC,MC,wC,DC,UC,kC,BC,VC,FC,GC,HC,qC,jC,YC,zC,KC,$C,XC,WC,JC,QC,ZC,eP,tP,rP,nP,iP,oP,sP,aP,lP,cP,uP,fP,pP,dP,hP,_P,EP,mP,TP,SP,gP,vP,yP,OP,AP,RP,NP,CP,PP,IP,bP,LP,xP,MP,wP,DP,UP,kP,BP,VP,FP,GP,HP,qP,jP,YP,zP,KP,$P,XP,WP,JP,QP]),ZP=&quot;other_sql&quot;,eI=&quot;mssql&quot;,tI=&quot;mysql&quot;,rI=&quot;oracle&quot;,nI=&quot;db2&quot;,iI=&quot;postgresql&quot;,oI=&quot;redshift&quot;,sI=&quot;hive&quot;,aI=&quot;cloudscape&quot;,lI=&quot;hsqldb&quot;,cI=&quot;progress&quot;,uI=&quot;maxdb&quot;,fI=&quot;hanadb&quot;,pI=&quot;ingres&quot;,dI=&quot;firstsql&quot;,hI=&quot;edb&quot;,_I=&quot;cache&quot;,EI=&quot;adabas&quot;,mI=&quot;firebird&quot;,TI=&quot;derby&quot;,SI=&quot;filemaker&quot;,gI=&quot;informix&quot;,vI=&quot;instantdb&quot;,yI=&quot;interbase&quot;,OI=&quot;mariadb&quot;,AI=&quot;netezza&quot;,RI=&quot;pervasive&quot;,NI=&quot;pointbase&quot;,CI=&quot;sqlite&quot;,PI=&quot;sybase&quot;,II=&quot;teradata&quot;,bI=&quot;vertica&quot;,LI=&quot;h2&quot;,xI=&quot;coldfusion&quot;,MI=&quot;cassandra&quot;,wI=&quot;hbase&quot;,DI=&quot;mongodb&quot;,UI=&quot;redis&quot;,kI=&quot;couchbase&quot;,BI=&quot;couchdb&quot;,VI=&quot;cosmosdb&quot;,FI=&quot;dynamodb&quot;,GI=&quot;neo4j&quot;,HI=&quot;geode&quot;,qI=&quot;elasticsearch&quot;,jI=&quot;memcached&quot;,YI=&quot;cockroachdb&quot;,gX=ZP,vX=eI,yX=tI,OX=rI,AX=nI,RX=iI,NX=oI,CX=sI,PX=aI,IX=lI,bX=cI,LX=uI,xX=fI,MX=pI,wX=dI,DX=hI,UX=_I,kX=EI,BX=mI,VX=TI,FX=SI,GX=gI,HX=vI,qX=yI,jX=OI,YX=AI,zX=RI,KX=NI,$X=CI,XX=PI,WX=II,JX=bI,QX=LI,ZX=xI,eW=MI,tW=wI,rW=DI,nW=UI,iW=kI,oW=BI,sW=VI,aW=FI,lW=GI,cW=HI,uW=qI,fW=jI,pW=YI,dW=Be([ZP,eI,tI,rI,nI,iI,oI,sI,aI,lI,cI,uI,fI,pI,dI,hI,_I,EI,mI,TI,SI,gI,vI,yI,OI,AI,RI,NI,CI,PI,II,bI,LI,xI,MI,wI,DI,UI,kI,BI,VI,FI,GI,HI,qI,jI,YI]),zI=&quot;all&quot;,KI=&quot;each_quorum&quot;,$I=&quot;quorum&quot;,XI=&quot;local_quorum&quot;,WI=&quot;one&quot;,JI=&quot;two&quot;,QI=&quot;three&quot;,ZI=&quot;local_one&quot;,eb=&quot;any&quot;,tb=&quot;serial&quot;,rb=&quot;local_serial&quot;,hW=zI,_W=KI,EW=$I,mW=XI,TW=WI,SW=JI,gW=QI,vW=ZI,yW=eb,OW=tb,AW=rb,RW=Be([zI,KI,$I,XI,WI,JI,QI,ZI,eb,tb,rb]),nb=&quot;datasource&quot;,ib=&quot;http&quot;,ob=&quot;pubsub&quot;,sb=&quot;timer&quot;,ab=&quot;other&quot;,NW=nb,CW=ib,PW=ob,IW=sb,bW=ab,LW=Be([nb,ib,ob,sb,ab]),lb=&quot;insert&quot;,cb=&quot;edit&quot;,ub=&quot;delete&quot;,xW=lb,MW=cb,wW=ub,DW=Be([lb,cb,ub]),fb=&quot;alibaba_cloud&quot;,pb=&quot;aws&quot;,db=&quot;azure&quot;,hb=&quot;gcp&quot;,UW=fb,kW=pb,BW=db,VW=hb,FW=Be([fb,pb,db,hb]),_b=&quot;ip_tcp&quot;,Eb=&quot;ip_udp&quot;,mb=&quot;ip&quot;,Tb=&quot;unix&quot;,Sb=&quot;pipe&quot;,gb=&quot;inproc&quot;,vb=&quot;other&quot;,GW=_b,HW=Eb,qW=mb,jW=Tb,YW=Sb,zW=gb,KW=vb,$W=Be([_b,Eb,mb,Tb,Sb,gb,vb]),yb=&quot;wifi&quot;,Ob=&quot;wired&quot;,Ab=&quot;cell&quot;,Rb=&quot;unavailable&quot;,Nb=&quot;unknown&quot;,XW=yb,WW=Ob,JW=Ab,QW=Rb,ZW=Nb,e8=Be([yb,Ob,Ab,Rb,Nb]),Cb=&quot;gprs&quot;,Pb=&quot;edge&quot;,Ib=&quot;umts&quot;,bb=&quot;cdma&quot;,Lb=&quot;evdo_0&quot;,xb=&quot;evdo_a&quot;,Mb=&quot;cdma2000_1xrtt&quot;,wb=&quot;hsdpa&quot;,Db=&quot;hsupa&quot;,Ub=&quot;hspa&quot;,kb=&quot;iden&quot;,Bb=&quot;evdo_b&quot;,Vb=&quot;lte&quot;,Fb=&quot;ehrpd&quot;,Gb=&quot;hspap&quot;,Hb=&quot;gsm&quot;,qb=&quot;td_scdma&quot;,jb=&quot;iwlan&quot;,Yb=&quot;nr&quot;,zb=&quot;nrnsa&quot;,Kb=&quot;lte_ca&quot;,t8=Cb,r8=Pb,n8=Ib,i8=bb,o8=Lb,s8=xb,a8=Mb,l8=wb,c8=Db,u8=Ub,f8=kb,p8=Bb,d8=Vb,h8=Fb,_8=Gb,E8=Hb,m8=qb,T8=jb,S8=Yb,g8=zb,v8=Kb,y8=Be([Cb,Pb,Ib,bb,Lb,xb,Mb,wb,Db,Ub,kb,Bb,Vb,Fb,Gb,Hb,qb,jb,Yb,zb,Kb]),$b=&quot;1.0&quot;,Xb=&quot;1.1&quot;,Wb=&quot;2.0&quot;,Jb=&quot;SPDY&quot;,Qb=&quot;QUIC&quot;,O8=$b,A8=Xb,R8=Wb,N8=Jb,C8=Qb,P8={HTTP_1_0:$b,HTTP_1_1:Xb,HTTP_2_0:Wb,SPDY:Jb,QUIC:Qb},Zb=&quot;queue&quot;,eL=&quot;topic&quot;,I8=Zb,b8=eL,L8=Be([Zb,eL]),tL=&quot;receive&quot;,rL=&quot;process&quot;,x8=tL,M8=rL,w8=Be([tL,rL]),nL=0,iL=1,oL=2,sL=3,aL=4,lL=5,cL=6,uL=7,fL=8,pL=9,dL=10,hL=11,_L=12,EL=13,mL=14,TL=15,SL=16,D8=nL,U8=iL,k8=oL,B8=sL,V8=aL,F8=lL,G8=cL,H8=uL,q8=fL,j8=pL,Y8=dL,z8=hL,K8=_L,$8=EL,X8=mL,W8=TL,J8=SL,Q8={OK:nL,CANCELLED:iL,UNKNOWN:oL,INVALID_ARGUMENT:sL,DEADLINE_EXCEEDED:aL,NOT_FOUND:lL,ALREADY_EXISTS:cL,PERMISSION_DENIED:uL,RESOURCE_EXHAUSTED:fL,FAILED_PRECONDITION:pL,ABORTED:dL,OUT_OF_RANGE:hL,UNIMPLEMENTED:_L,INTERNAL:EL,UNAVAILABLE:mL,DATA_LOSS:TL,UNAUTHENTICATED:SL},gL=&quot;SENT&quot;,vL=&quot;RECEIVED&quot;,Z8=gL,e5=vL,t5=Be([gL,vL])});var OL=p(()=&gt;{yL()});var AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0,r5,n5,i5,o5,s5,a5,l5,c5,u5,f5,p5,d5,h5,_5,E5,m5,T5,S5,g5,v5,y5,O5,A5,R5,N5,C5,P5,I5,b5,L5,km,Bm,x5,Vm,M5,w5,D5,U5,k5,B5,V5,F5,G5,H5,q5,j5,Y5,z5,K5,$5,X5,W5,J5,Q5,Z5,e7,Fm,t7,r7,Gm,Hm,qm,jm,Ym,n7,zm,Km,st,ko,Ja,at,i7,$m,o7,Se,ge,ve,s7,a7,l7,c7,u7,J0,Q0,Z0,ex,f7,p7,d7,h7,_7,tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx,E7,m7,T7,S7,g7,v7,y7,O7,A7,R7,N7,C7,P7,I7,b7,L7,x7,M7,Tx,Sx,w7,D7,U7,gx,vx,yx,Ox,Ax,Rx,Nx,k7,B7,V7,F7,G7,H7,q7,j7,Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx,Y7,z7,K7,$7,X7,W7,J7,Q7,Z7,e9,t9,r9,Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx,n9,i9,o9,s9,a9,wt,l9,c9,u9,f9,p9,$x=p(()=&gt;{Dm();AL=&quot;cloud.provider&quot;,RL=&quot;cloud.account.id&quot;,NL=&quot;cloud.region&quot;,CL=&quot;cloud.availability_zone&quot;,PL=&quot;cloud.platform&quot;,IL=&quot;aws.ecs.container.arn&quot;,bL=&quot;aws.ecs.cluster.arn&quot;,LL=&quot;aws.ecs.launchtype&quot;,xL=&quot;aws.ecs.task.arn&quot;,ML=&quot;aws.ecs.task.family&quot;,wL=&quot;aws.ecs.task.revision&quot;,DL=&quot;aws.eks.cluster.arn&quot;,UL=&quot;aws.log.group.names&quot;,kL=&quot;aws.log.group.arns&quot;,BL=&quot;aws.log.stream.names&quot;,VL=&quot;aws.log.stream.arns&quot;,FL=&quot;container.name&quot;,GL=&quot;container.id&quot;,HL=&quot;container.runtime&quot;,qL=&quot;container.image.name&quot;,jL=&quot;container.image.tag&quot;,YL=&quot;deployment.environment&quot;,zL=&quot;device.id&quot;,KL=&quot;device.model.identifier&quot;,$L=&quot;device.model.name&quot;,XL=&quot;faas.name&quot;,WL=&quot;faas.id&quot;,JL=&quot;faas.version&quot;,QL=&quot;faas.instance&quot;,ZL=&quot;faas.max_memory&quot;,e0=&quot;host.id&quot;,t0=&quot;host.name&quot;,r0=&quot;host.type&quot;,n0=&quot;host.arch&quot;,i0=&quot;host.image.name&quot;,o0=&quot;host.image.id&quot;,s0=&quot;host.image.version&quot;,a0=&quot;k8s.cluster.name&quot;,l0=&quot;k8s.node.name&quot;,c0=&quot;k8s.node.uid&quot;,u0=&quot;k8s.namespace.name&quot;,f0=&quot;k8s.pod.uid&quot;,p0=&quot;k8s.pod.name&quot;,d0=&quot;k8s.container.name&quot;,h0=&quot;k8s.replicaset.uid&quot;,_0=&quot;k8s.replicaset.name&quot;,E0=&quot;k8s.deployment.uid&quot;,m0=&quot;k8s.deployment.name&quot;,T0=&quot;k8s.statefulset.uid&quot;,S0=&quot;k8s.statefulset.name&quot;,g0=&quot;k8s.daemonset.uid&quot;,v0=&quot;k8s.daemonset.name&quot;,y0=&quot;k8s.job.uid&quot;,O0=&quot;k8s.job.name&quot;,A0=&quot;k8s.cronjob.uid&quot;,R0=&quot;k8s.cronjob.name&quot;,N0=&quot;os.type&quot;,C0=&quot;os.description&quot;,P0=&quot;os.name&quot;,I0=&quot;os.version&quot;,b0=&quot;process.pid&quot;,L0=&quot;process.executable.name&quot;,x0=&quot;process.executable.path&quot;,M0=&quot;process.command&quot;,w0=&quot;process.command_line&quot;,D0=&quot;process.command_args&quot;,U0=&quot;process.owner&quot;,k0=&quot;process.runtime.name&quot;,B0=&quot;process.runtime.version&quot;,V0=&quot;process.runtime.description&quot;,F0=&quot;service.name&quot;,G0=&quot;service.namespace&quot;,H0=&quot;service.instance.id&quot;,q0=&quot;service.version&quot;,j0=&quot;telemetry.sdk.name&quot;,Y0=&quot;telemetry.sdk.language&quot;,z0=&quot;telemetry.sdk.version&quot;,K0=&quot;telemetry.auto.version&quot;,$0=&quot;webengine.name&quot;,X0=&quot;webengine.version&quot;,W0=&quot;webengine.description&quot;,r5=AL,n5=RL,i5=NL,o5=CL,s5=PL,a5=IL,l5=bL,c5=LL,u5=xL,f5=ML,p5=wL,d5=DL,h5=UL,_5=kL,E5=BL,m5=VL,T5=FL,S5=GL,g5=HL,v5=qL,y5=jL,O5=YL,A5=zL,R5=KL,N5=$L,C5=XL,P5=WL,I5=JL,b5=QL,L5=ZL,km=e0,Bm=t0,x5=r0,Vm=n0,M5=i0,w5=o0,D5=s0,U5=a0,k5=l0,B5=c0,V5=u0,F5=f0,G5=p0,H5=d0,q5=h0,j5=_0,Y5=E0,z5=m0,K5=T0,$5=S0,X5=g0,W5=v0,J5=y0,Q5=O0,Z5=A0,e7=R0,Fm=N0,t7=C0,r7=P0,Gm=I0,Hm=b0,qm=L0,jm=x0,Ym=M0,n7=w0,zm=D0,Km=U0,st=k0,ko=B0,Ja=V0,at=F0,i7=G0,$m=H0,o7=q0,Se=j0,ge=Y0,ve=z0,s7=K0,a7=$0,l7=X0,c7=W0,u7=Be([AL,RL,NL,CL,PL,IL,bL,LL,xL,ML,wL,DL,UL,kL,BL,VL,FL,GL,HL,qL,jL,YL,zL,KL,$L,XL,WL,JL,QL,ZL,e0,t0,r0,n0,i0,o0,s0,a0,l0,c0,u0,f0,p0,d0,h0,_0,E0,m0,T0,S0,g0,v0,y0,O0,A0,R0,N0,C0,P0,I0,b0,L0,x0,M0,w0,D0,U0,k0,B0,V0,F0,G0,H0,q0,j0,Y0,z0,K0,$0,X0,W0]),J0=&quot;alibaba_cloud&quot;,Q0=&quot;aws&quot;,Z0=&quot;azure&quot;,ex=&quot;gcp&quot;,f7=J0,p7=Q0,d7=Z0,h7=ex,_7=Be([J0,Q0,Z0,ex]),tx=&quot;alibaba_cloud_ecs&quot;,rx=&quot;alibaba_cloud_fc&quot;,nx=&quot;aws_ec2&quot;,ix=&quot;aws_ecs&quot;,ox=&quot;aws_eks&quot;,sx=&quot;aws_lambda&quot;,ax=&quot;aws_elastic_beanstalk&quot;,lx=&quot;azure_vm&quot;,cx=&quot;azure_container_instances&quot;,ux=&quot;azure_aks&quot;,fx=&quot;azure_functions&quot;,px=&quot;azure_app_service&quot;,dx=&quot;gcp_compute_engine&quot;,hx=&quot;gcp_cloud_run&quot;,_x=&quot;gcp_kubernetes_engine&quot;,Ex=&quot;gcp_cloud_functions&quot;,mx=&quot;gcp_app_engine&quot;,E7=tx,m7=rx,T7=nx,S7=ix,g7=ox,v7=sx,y7=ax,O7=lx,A7=cx,R7=ux,N7=fx,C7=px,P7=dx,I7=hx,b7=_x,L7=Ex,x7=mx,M7=Be([tx,rx,nx,ix,ox,sx,ax,lx,cx,ux,fx,px,dx,hx,_x,Ex,mx]),Tx=&quot;ec2&quot;,Sx=&quot;fargate&quot;,w7=Tx,D7=Sx,U7=Be([Tx,Sx]),gx=&quot;amd64&quot;,vx=&quot;arm32&quot;,yx=&quot;arm64&quot;,Ox=&quot;ia64&quot;,Ax=&quot;ppc32&quot;,Rx=&quot;ppc64&quot;,Nx=&quot;x86&quot;,k7=gx,B7=vx,V7=yx,F7=Ox,G7=Ax,H7=Rx,q7=Nx,j7=Be([gx,vx,yx,Ox,Ax,Rx,Nx]),Cx=&quot;windows&quot;,Px=&quot;linux&quot;,Ix=&quot;darwin&quot;,bx=&quot;freebsd&quot;,Lx=&quot;netbsd&quot;,xx=&quot;openbsd&quot;,Mx=&quot;dragonflybsd&quot;,wx=&quot;hpux&quot;,Dx=&quot;aix&quot;,Ux=&quot;solaris&quot;,kx=&quot;z_os&quot;,Y7=Cx,z7=Px,K7=Ix,$7=bx,X7=Lx,W7=xx,J7=Mx,Q7=wx,Z7=Dx,e9=Ux,t9=kx,r9=Be([Cx,Px,Ix,bx,Lx,xx,Mx,wx,Dx,Ux,kx]),Bx=&quot;cpp&quot;,Vx=&quot;dotnet&quot;,Fx=&quot;erlang&quot;,Gx=&quot;go&quot;,Hx=&quot;java&quot;,qx=&quot;nodejs&quot;,jx=&quot;php&quot;,Yx=&quot;python&quot;,zx=&quot;ruby&quot;,Kx=&quot;webjs&quot;,n9=Bx,i9=Vx,o9=Fx,s9=Gx,a9=Hx,wt=qx,l9=jx,c9=Yx,u9=zx,f9=Kx,p9=Be([Bx,Vx,Fx,Gx,Hx,qx,jx,Yx,zx,Kx])});var Xx=p(()=&gt;{$x()});var d9,h9,_9,E9,m9,T9,S9,g9,v9,y9,O9,A9,R9,N9,C9,P9,I9,b9,L9,x9,M9,w9,D9,U9,k9,B9,V9,F9,G9,H9,q9,j9,Y9,z9,K9,$9,X9,W9,J9,Q9,Z9,eJ,tJ,rJ,nJ,iJ,oJ,sJ,aJ,lJ,cJ,uJ,fJ,pJ,dJ,hJ,_J,EJ,mJ,TJ,SJ,gJ,vJ,yJ,OJ,AJ,RJ,NJ,CJ,PJ,IJ,bJ,LJ,xJ,MJ,wJ,DJ,UJ,kJ,BJ,VJ,FJ,GJ,HJ,qJ,jJ,YJ,zJ,KJ,$J,XJ,WJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,oQ,sQ,aQ,lQ,cQ,uQ,fQ,pQ,dQ,hQ,Wx=p(()=&gt;{d9=&quot;aspnetcore.rate_limiting.result&quot;,h9=&quot;acquired&quot;,_9=&quot;endpoint_limiter&quot;,E9=&quot;global_limiter&quot;,m9=&quot;request_canceled&quot;,T9=&quot;telemetry.sdk.language&quot;,S9=&quot;cpp&quot;,g9=&quot;dotnet&quot;,v9=&quot;erlang&quot;,y9=&quot;go&quot;,O9=&quot;java&quot;,A9=&quot;nodejs&quot;,R9=&quot;php&quot;,N9=&quot;python&quot;,C9=&quot;ruby&quot;,P9=&quot;rust&quot;,I9=&quot;swift&quot;,b9=&quot;webjs&quot;,L9=&quot;telemetry.sdk.name&quot;,x9=&quot;telemetry.sdk.version&quot;,M9=&quot;aspnetcore.diagnostics.handler.type&quot;,w9=&quot;aspnetcore.diagnostics.exception.result&quot;,D9=&quot;aborted&quot;,U9=&quot;handled&quot;,k9=&quot;skipped&quot;,B9=&quot;unhandled&quot;,V9=&quot;aspnetcore.rate_limiting.policy&quot;,F9=&quot;aspnetcore.request.is_unhandled&quot;,G9=&quot;aspnetcore.routing.is_fallback&quot;,H9=&quot;aspnetcore.routing.match_status&quot;,q9=&quot;failure&quot;,j9=&quot;success&quot;,Y9=&quot;client.address&quot;,z9=&quot;client.port&quot;,K9=&quot;error.type&quot;,$9=&quot;_OTHER&quot;,X9=&quot;exception.escaped&quot;,W9=&quot;exception.message&quot;,J9=&quot;exception.stacktrace&quot;,Q9=&quot;exception.type&quot;,Z9=function(r){return&quot;http.request.header.&quot;+r},eJ=&quot;http.request.method&quot;,tJ=&quot;_OTHER&quot;,rJ=&quot;CONNECT&quot;,nJ=&quot;DELETE&quot;,iJ=&quot;GET&quot;,oJ=&quot;HEAD&quot;,sJ=&quot;OPTIONS&quot;,aJ=&quot;PATCH&quot;,lJ=&quot;POST&quot;,cJ=&quot;PUT&quot;,uJ=&quot;TRACE&quot;,fJ=&quot;http.request.method_original&quot;,pJ=&quot;http.request.resend_count&quot;,dJ=function(r){return&quot;http.response.header.&quot;+r},hJ=&quot;http.response.status_code&quot;,_J=&quot;http.route&quot;,EJ=&quot;jvm.gc.action&quot;,mJ=&quot;jvm.gc.name&quot;,TJ=&quot;jvm.memory.pool.name&quot;,SJ=&quot;jvm.memory.type&quot;,gJ=&quot;heap&quot;,vJ=&quot;non_heap&quot;,yJ=&quot;jvm.thread.daemon&quot;,OJ=&quot;jvm.thread.state&quot;,AJ=&quot;blocked&quot;,RJ=&quot;new&quot;,NJ=&quot;runnable&quot;,CJ=&quot;terminated&quot;,PJ=&quot;timed_waiting&quot;,IJ=&quot;waiting&quot;,bJ=&quot;network.local.address&quot;,LJ=&quot;network.local.port&quot;,xJ=&quot;network.peer.address&quot;,MJ=&quot;network.peer.port&quot;,wJ=&quot;network.protocol.name&quot;,DJ=&quot;network.protocol.version&quot;,UJ=&quot;network.transport&quot;,kJ=&quot;pipe&quot;,BJ=&quot;quic&quot;,VJ=&quot;tcp&quot;,FJ=&quot;udp&quot;,GJ=&quot;unix&quot;,HJ=&quot;network.type&quot;,qJ=&quot;ipv4&quot;,jJ=&quot;ipv6&quot;,YJ=&quot;otel.scope.name&quot;,zJ=&quot;otel.scope.version&quot;,KJ=&quot;otel.status_code&quot;,$J=&quot;ERROR&quot;,XJ=&quot;OK&quot;,WJ=&quot;otel.status_description&quot;,JJ=&quot;server.address&quot;,QJ=&quot;server.port&quot;,ZJ=&quot;service.name&quot;,eQ=&quot;service.version&quot;,tQ=&quot;signalr.connection.status&quot;,rQ=&quot;app_shutdown&quot;,nQ=&quot;normal_closure&quot;,iQ=&quot;timeout&quot;,oQ=&quot;signalr.transport&quot;,sQ=&quot;long_polling&quot;,aQ=&quot;server_sent_events&quot;,lQ=&quot;web_sockets&quot;,cQ=&quot;url.fragment&quot;,uQ=&quot;url.full&quot;,fQ=&quot;url.path&quot;,pQ=&quot;url.query&quot;,dQ=&quot;url.scheme&quot;,hQ=&quot;user_agent.original&quot;});var _Q,EQ,mQ,TQ,SQ,gQ,vQ,yQ,OQ,AQ,RQ,NQ,CQ,PQ,IQ,bQ,LQ,xQ,MQ,wQ,DQ,UQ,kQ,BQ,VQ,FQ,GQ,HQ,qQ,jQ,YQ,Jx=p(()=&gt;{_Q=&quot;aspnetcore.diagnostics.exceptions&quot;,EQ=&quot;aspnetcore.rate_limiting.active_request_leases&quot;,mQ=&quot;aspnetcore.rate_limiting.queued_requests&quot;,TQ=&quot;aspnetcore.rate_limiting.request.time_in_queue&quot;,SQ=&quot;aspnetcore.rate_limiting.request_lease.duration&quot;,gQ=&quot;aspnetcore.rate_limiting.requests&quot;,vQ=&quot;aspnetcore.routing.match_attempts&quot;,yQ=&quot;http.client.request.duration&quot;,OQ=&quot;http.server.request.duration&quot;,AQ=&quot;jvm.class.count&quot;,RQ=&quot;jvm.class.loaded&quot;,NQ=&quot;jvm.class.unloaded&quot;,CQ=&quot;jvm.cpu.count&quot;,PQ=&quot;jvm.cpu.recent_utilization&quot;,IQ=&quot;jvm.cpu.time&quot;,bQ=&quot;jvm.gc.duration&quot;,LQ=&quot;jvm.memory.committed&quot;,xQ=&quot;jvm.memory.limit&quot;,MQ=&quot;jvm.memory.used&quot;,wQ=&quot;jvm.memory.used_after_last_gc&quot;,DQ=&quot;jvm.thread.count&quot;,UQ=&quot;kestrel.active_connections&quot;,kQ=&quot;kestrel.active_tls_handshakes&quot;,BQ=&quot;kestrel.connection.duration&quot;,VQ=&quot;kestrel.queued_connections&quot;,FQ=&quot;kestrel.queued_requests&quot;,GQ=&quot;kestrel.rejected_connections&quot;,HQ=&quot;kestrel.tls_handshake.duration&quot;,qQ=&quot;kestrel.upgraded_connections&quot;,jQ=&quot;signalr.server.active_connections&quot;,YQ=&quot;signalr.server.connection.duration&quot;});var Qx={};Ae(Qx,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=&gt;D9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=&gt;U9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=&gt;k9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=&gt;B9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=&gt;h9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=&gt;_9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=&gt;E9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=&gt;m9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=&gt;q9,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=&gt;j9,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=&gt;w9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=&gt;M9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=&gt;V9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=&gt;d9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=&gt;F9,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=&gt;G9,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=&gt;H9,ATTR_CLIENT_ADDRESS:()=&gt;Y9,ATTR_CLIENT_PORT:()=&gt;z9,ATTR_ERROR_TYPE:()=&gt;K9,ATTR_EXCEPTION_ESCAPED:()=&gt;X9,ATTR_EXCEPTION_MESSAGE:()=&gt;W9,ATTR_EXCEPTION_STACKTRACE:()=&gt;J9,ATTR_EXCEPTION_TYPE:()=&gt;Q9,ATTR_HTTP_REQUEST_HEADER:()=&gt;Z9,ATTR_HTTP_REQUEST_METHOD:()=&gt;eJ,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=&gt;fJ,ATTR_HTTP_REQUEST_RESEND_COUNT:()=&gt;pJ,ATTR_HTTP_RESPONSE_HEADER:()=&gt;dJ,ATTR_HTTP_RESPONSE_STATUS_CODE:()=&gt;hJ,ATTR_HTTP_ROUTE:()=&gt;_J,ATTR_JVM_GC_ACTION:()=&gt;EJ,ATTR_JVM_GC_NAME:()=&gt;mJ,ATTR_JVM_MEMORY_POOL_NAME:()=&gt;TJ,ATTR_JVM_MEMORY_TYPE:()=&gt;SJ,ATTR_JVM_THREAD_DAEMON:()=&gt;yJ,ATTR_JVM_THREAD_STATE:()=&gt;OJ,ATTR_NETWORK_LOCAL_ADDRESS:()=&gt;bJ,ATTR_NETWORK_LOCAL_PORT:()=&gt;LJ,ATTR_NETWORK_PEER_ADDRESS:()=&gt;xJ,ATTR_NETWORK_PEER_PORT:()=&gt;MJ,ATTR_NETWORK_PROTOCOL_NAME:()=&gt;wJ,ATTR_NETWORK_PROTOCOL_VERSION:()=&gt;DJ,ATTR_NETWORK_TRANSPORT:()=&gt;UJ,ATTR_NETWORK_TYPE:()=&gt;HJ,ATTR_OTEL_SCOPE_NAME:()=&gt;YJ,ATTR_OTEL_SCOPE_VERSION:()=&gt;zJ,ATTR_OTEL_STATUS_CODE:()=&gt;KJ,ATTR_OTEL_STATUS_DESCRIPTION:()=&gt;WJ,ATTR_SERVER_ADDRESS:()=&gt;JJ,ATTR_SERVER_PORT:()=&gt;QJ,ATTR_SERVICE_NAME:()=&gt;ZJ,ATTR_SERVICE_VERSION:()=&gt;eQ,ATTR_SIGNALR_CONNECTION_STATUS:()=&gt;tQ,ATTR_SIGNALR_TRANSPORT:()=&gt;oQ,ATTR_TELEMETRY_SDK_LANGUAGE:()=&gt;T9,ATTR_TELEMETRY_SDK_NAME:()=&gt;L9,ATTR_TELEMETRY_SDK_VERSION:()=&gt;x9,ATTR_URL_FRAGMENT:()=&gt;cQ,ATTR_URL_FULL:()=&gt;uQ,ATTR_URL_PATH:()=&gt;fQ,ATTR_URL_QUERY:()=&gt;pQ,ATTR_URL_SCHEME:()=&gt;dQ,ATTR_USER_AGENT_ORIGINAL:()=&gt;hQ,AWSECSLAUNCHTYPEVALUES_EC2:()=&gt;w7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=&gt;D7,AwsEcsLaunchtypeValues:()=&gt;U7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=&gt;E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=&gt;m7,CLOUDPLATFORMVALUES_AWS_EC2:()=&gt;T7,CLOUDPLATFORMVALUES_AWS_ECS:()=&gt;S7,CLOUDPLATFORMVALUES_AWS_EKS:()=&gt;g7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=&gt;y7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=&gt;v7,CLOUDPLATFORMVALUES_AZURE_AKS:()=&gt;R7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=&gt;C7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=&gt;A7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=&gt;N7,CLOUDPLATFORMVALUES_AZURE_VM:()=&gt;O7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=&gt;x7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=&gt;L7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=&gt;I7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=&gt;P7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=&gt;b7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;f7,CLOUDPROVIDERVALUES_AWS:()=&gt;p7,CLOUDPROVIDERVALUES_AZURE:()=&gt;d7,CLOUDPROVIDERVALUES_GCP:()=&gt;h7,CloudPlatformValues:()=&gt;M7,CloudProviderValues:()=&gt;_7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=&gt;hW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=&gt;yW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=&gt;_W,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=&gt;vW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=&gt;mW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=&gt;AW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=&gt;TW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=&gt;EW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=&gt;OW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=&gt;gW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=&gt;SW,DBSYSTEMVALUES_ADABAS:()=&gt;kX,DBSYSTEMVALUES_CACHE:()=&gt;UX,DBSYSTEMVALUES_CASSANDRA:()=&gt;eW,DBSYSTEMVALUES_CLOUDSCAPE:()=&gt;PX,DBSYSTEMVALUES_COCKROACHDB:()=&gt;pW,DBSYSTEMVALUES_COLDFUSION:()=&gt;ZX,DBSYSTEMVALUES_COSMOSDB:()=&gt;sW,DBSYSTEMVALUES_COUCHBASE:()=&gt;iW,DBSYSTEMVALUES_COUCHDB:()=&gt;oW,DBSYSTEMVALUES_DB2:()=&gt;AX,DBSYSTEMVALUES_DERBY:()=&gt;VX,DBSYSTEMVALUES_DYNAMODB:()=&gt;aW,DBSYSTEMVALUES_EDB:()=&gt;DX,DBSYSTEMVALUES_ELASTICSEARCH:()=&gt;uW,DBSYSTEMVALUES_FILEMAKER:()=&gt;FX,DBSYSTEMVALUES_FIREBIRD:()=&gt;BX,DBSYSTEMVALUES_FIRSTSQL:()=&gt;wX,DBSYSTEMVALUES_GEODE:()=&gt;cW,DBSYSTEMVALUES_H2:()=&gt;QX,DBSYSTEMVALUES_HANADB:()=&gt;xX,DBSYSTEMVALUES_HBASE:()=&gt;tW,DBSYSTEMVALUES_HIVE:()=&gt;CX,DBSYSTEMVALUES_HSQLDB:()=&gt;IX,DBSYSTEMVALUES_INFORMIX:()=&gt;GX,DBSYSTEMVALUES_INGRES:()=&gt;MX,DBSYSTEMVALUES_INSTANTDB:()=&gt;HX,DBSYSTEMVALUES_INTERBASE:()=&gt;qX,DBSYSTEMVALUES_MARIADB:()=&gt;jX,DBSYSTEMVALUES_MAXDB:()=&gt;LX,DBSYSTEMVALUES_MEMCACHED:()=&gt;fW,DBSYSTEMVALUES_MONGODB:()=&gt;rW,DBSYSTEMVALUES_MSSQL:()=&gt;vX,DBSYSTEMVALUES_MYSQL:()=&gt;yX,DBSYSTEMVALUES_NEO4J:()=&gt;lW,DBSYSTEMVALUES_NETEZZA:()=&gt;YX,DBSYSTEMVALUES_ORACLE:()=&gt;OX,DBSYSTEMVALUES_OTHER_SQL:()=&gt;gX,DBSYSTEMVALUES_PERVASIVE:()=&gt;zX,DBSYSTEMVALUES_POINTBASE:()=&gt;KX,DBSYSTEMVALUES_POSTGRESQL:()=&gt;RX,DBSYSTEMVALUES_PROGRESS:()=&gt;bX,DBSYSTEMVALUES_REDIS:()=&gt;nW,DBSYSTEMVALUES_REDSHIFT:()=&gt;NX,DBSYSTEMVALUES_SQLITE:()=&gt;$X,DBSYSTEMVALUES_SYBASE:()=&gt;XX,DBSYSTEMVALUES_TERADATA:()=&gt;WX,DBSYSTEMVALUES_VERTICA:()=&gt;JX,DbCassandraConsistencyLevelValues:()=&gt;RW,DbSystemValues:()=&gt;dW,ERROR_TYPE_VALUE_OTHER:()=&gt;$9,FAASDOCUMENTOPERATIONVALUES_DELETE:()=&gt;wW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=&gt;MW,FAASDOCUMENTOPERATIONVALUES_INSERT:()=&gt;xW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=&gt;UW,FAASINVOKEDPROVIDERVALUES_AWS:()=&gt;kW,FAASINVOKEDPROVIDERVALUES_AZURE:()=&gt;BW,FAASINVOKEDPROVIDERVALUES_GCP:()=&gt;VW,FAASTRIGGERVALUES_DATASOURCE:()=&gt;NW,FAASTRIGGERVALUES_HTTP:()=&gt;CW,FAASTRIGGERVALUES_OTHER:()=&gt;bW,FAASTRIGGERVALUES_PUBSUB:()=&gt;PW,FAASTRIGGERVALUES_TIMER:()=&gt;IW,FaasDocumentOperationValues:()=&gt;DW,FaasInvokedProviderValues:()=&gt;FW,FaasTriggerValues:()=&gt;LW,HOSTARCHVALUES_AMD64:()=&gt;k7,HOSTARCHVALUES_ARM32:()=&gt;B7,HOSTARCHVALUES_ARM64:()=&gt;V7,HOSTARCHVALUES_IA64:()=&gt;F7,HOSTARCHVALUES_PPC32:()=&gt;G7,HOSTARCHVALUES_PPC64:()=&gt;H7,HOSTARCHVALUES_X86:()=&gt;q7,HTTPFLAVORVALUES_HTTP_1_0:()=&gt;O8,HTTPFLAVORVALUES_HTTP_1_1:()=&gt;A8,HTTPFLAVORVALUES_HTTP_2_0:()=&gt;R8,HTTPFLAVORVALUES_QUIC:()=&gt;C8,HTTPFLAVORVALUES_SPDY:()=&gt;N8,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=&gt;rJ,HTTP_REQUEST_METHOD_VALUE_DELETE:()=&gt;nJ,HTTP_REQUEST_METHOD_VALUE_GET:()=&gt;iJ,HTTP_REQUEST_METHOD_VALUE_HEAD:()=&gt;oJ,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=&gt;sJ,HTTP_REQUEST_METHOD_VALUE_OTHER:()=&gt;tJ,HTTP_REQUEST_METHOD_VALUE_PATCH:()=&gt;aJ,HTTP_REQUEST_METHOD_VALUE_POST:()=&gt;lJ,HTTP_REQUEST_METHOD_VALUE_PUT:()=&gt;cJ,HTTP_REQUEST_METHOD_VALUE_TRACE:()=&gt;uJ,HostArchValues:()=&gt;j7,HttpFlavorValues:()=&gt;P8,JVM_MEMORY_TYPE_VALUE_HEAP:()=&gt;gJ,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=&gt;vJ,JVM_THREAD_STATE_VALUE_BLOCKED:()=&gt;AJ,JVM_THREAD_STATE_VALUE_NEW:()=&gt;RJ,JVM_THREAD_STATE_VALUE_RUNNABLE:()=&gt;NJ,JVM_THREAD_STATE_VALUE_TERMINATED:()=&gt;CJ,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=&gt;PJ,JVM_THREAD_STATE_VALUE_WAITING:()=&gt;IJ,MESSAGETYPEVALUES_RECEIVED:()=&gt;e5,MESSAGETYPEVALUES_SENT:()=&gt;Z8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=&gt;I8,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=&gt;b8,MESSAGINGOPERATIONVALUES_PROCESS:()=&gt;M8,MESSAGINGOPERATIONVALUES_RECEIVE:()=&gt;x8,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=&gt;_Q,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=&gt;EQ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=&gt;mQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=&gt;gQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=&gt;SQ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=&gt;TQ,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=&gt;vQ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=&gt;yQ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=&gt;OQ,METRIC_JVM_CLASS_COUNT:()=&gt;AQ,METRIC_JVM_CLASS_LOADED:()=&gt;RQ,METRIC_JVM_CLASS_UNLOADED:()=&gt;NQ,METRIC_JVM_CPU_COUNT:()=&gt;CQ,METRIC_JVM_CPU_RECENT_UTILIZATION:()=&gt;PQ,METRIC_JVM_CPU_TIME:()=&gt;IQ,METRIC_JVM_GC_DURATION:()=&gt;bQ,METRIC_JVM_MEMORY_COMMITTED:()=&gt;LQ,METRIC_JVM_MEMORY_LIMIT:()=&gt;xQ,METRIC_JVM_MEMORY_USED:()=&gt;MQ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=&gt;wQ,METRIC_JVM_THREAD_COUNT:()=&gt;DQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=&gt;UQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=&gt;kQ,METRIC_KESTREL_CONNECTION_DURATION:()=&gt;BQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=&gt;VQ,METRIC_KESTREL_QUEUED_REQUESTS:()=&gt;FQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=&gt;GQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=&gt;HQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=&gt;qQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=&gt;jQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=&gt;YQ,MessageTypeValues:()=&gt;t5,MessagingDestinationKindValues:()=&gt;L8,MessagingOperationValues:()=&gt;w8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=&gt;i8,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=&gt;a8,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=&gt;r8,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=&gt;h8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=&gt;o8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=&gt;s8,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=&gt;p8,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=&gt;t8,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=&gt;E8,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=&gt;l8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=&gt;u8,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=&gt;_8,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=&gt;c8,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=&gt;f8,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=&gt;T8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=&gt;d8,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=&gt;v8,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=&gt;S8,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=&gt;g8,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=&gt;m8,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=&gt;n8,NETHOSTCONNECTIONTYPEVALUES_CELL:()=&gt;JW,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=&gt;QW,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=&gt;ZW,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=&gt;XW,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=&gt;WW,NETTRANSPORTVALUES_INPROC:()=&gt;zW,NETTRANSPORTVALUES_IP:()=&gt;qW,NETTRANSPORTVALUES_IP_TCP:()=&gt;GW,NETTRANSPORTVALUES_IP_UDP:()=&gt;HW,NETTRANSPORTVALUES_OTHER:()=&gt;KW,NETTRANSPORTVALUES_PIPE:()=&gt;YW,NETTRANSPORTVALUES_UNIX:()=&gt;jW,NETWORK_TRANSPORT_VALUE_PIPE:()=&gt;kJ,NETWORK_TRANSPORT_VALUE_QUIC:()=&gt;BJ,NETWORK_TRANSPORT_VALUE_TCP:()=&gt;VJ,NETWORK_TRANSPORT_VALUE_UDP:()=&gt;FJ,NETWORK_TRANSPORT_VALUE_UNIX:()=&gt;GJ,NETWORK_TYPE_VALUE_IPV4:()=&gt;qJ,NETWORK_TYPE_VALUE_IPV6:()=&gt;jJ,NetHostConnectionSubtypeValues:()=&gt;y8,NetHostConnectionTypeValues:()=&gt;e8,NetTransportValues:()=&gt;$W,OSTYPEVALUES_AIX:()=&gt;Z7,OSTYPEVALUES_DARWIN:()=&gt;K7,OSTYPEVALUES_DRAGONFLYBSD:()=&gt;J7,OSTYPEVALUES_FREEBSD:()=&gt;$7,OSTYPEVALUES_HPUX:()=&gt;Q7,OSTYPEVALUES_LINUX:()=&gt;z7,OSTYPEVALUES_NETBSD:()=&gt;X7,OSTYPEVALUES_OPENBSD:()=&gt;W7,OSTYPEVALUES_SOLARIS:()=&gt;e9,OSTYPEVALUES_WINDOWS:()=&gt;Y7,OSTYPEVALUES_Z_OS:()=&gt;t9,OTEL_STATUS_CODE_VALUE_ERROR:()=&gt;$J,OTEL_STATUS_CODE_VALUE_OK:()=&gt;XJ,OsTypeValues:()=&gt;r9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=&gt;Y8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=&gt;G8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=&gt;U8,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=&gt;W8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=&gt;V8,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=&gt;j8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=&gt;$8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=&gt;B8,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=&gt;F8,RPCGRPCSTATUSCODEVALUES_OK:()=&gt;D8,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=&gt;z8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=&gt;H8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=&gt;q8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=&gt;J8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=&gt;X8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=&gt;K8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=&gt;k8,RpcGrpcStatusCodeValues:()=&gt;Q8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=&gt;P$,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=&gt;F$,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=&gt;R$,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=&gt;v$,SEMATTRS_AWS_DYNAMODB_COUNT:()=&gt;B$,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=&gt;M$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=&gt;L$,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=&gt;G$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=&gt;I$,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=&gt;y$,SEMATTRS_AWS_DYNAMODB_LIMIT:()=&gt;C$,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=&gt;x$,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=&gt;N$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=&gt;O$,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=&gt;A$,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=&gt;V$,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=&gt;D$,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=&gt;U$,SEMATTRS_AWS_DYNAMODB_SELECT:()=&gt;b$,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=&gt;w$,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=&gt;g$,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=&gt;k$,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=&gt;rK,SEMATTRS_CODE_FILEPATH:()=&gt;n$,SEMATTRS_CODE_FUNCTION:()=&gt;t$,SEMATTRS_CODE_LINENO:()=&gt;i$,SEMATTRS_CODE_NAMESPACE:()=&gt;r$,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=&gt;dK,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=&gt;TK,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=&gt;mK,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=&gt;_K,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=&gt;fK,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=&gt;pK,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=&gt;EK,SEMATTRS_DB_CASSANDRA_TABLE:()=&gt;hK,SEMATTRS_DB_CONNECTION_STRING:()=&gt;iK,SEMATTRS_DB_HBASE_NAMESPACE:()=&gt;SK,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=&gt;sK,SEMATTRS_DB_MONGODB_COLLECTION:()=&gt;vK,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=&gt;uK,SEMATTRS_DB_NAME:()=&gt;aK,SEMATTRS_DB_OPERATION:()=&gt;cK,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=&gt;gK,SEMATTRS_DB_SQL_TABLE:()=&gt;yK,SEMATTRS_DB_STATEMENT:()=&gt;lK,SEMATTRS_DB_SYSTEM:()=&gt;nK,SEMATTRS_DB_USER:()=&gt;oK,SEMATTRS_ENDUSER_ID:()=&gt;WK,SEMATTRS_ENDUSER_ROLE:()=&gt;JK,SEMATTRS_ENDUSER_SCOPE:()=&gt;QK,SEMATTRS_EXCEPTION_ESCAPED:()=&gt;OK,SEMATTRS_EXCEPTION_MESSAGE:()=&gt;Wa,SEMATTRS_EXCEPTION_STACKTRACE:()=&gt;Um,SEMATTRS_EXCEPTION_TYPE:()=&gt;Xa,SEMATTRS_FAAS_COLDSTART:()=&gt;xK,SEMATTRS_FAAS_CRON:()=&gt;LK,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=&gt;NK,SEMATTRS_FAAS_DOCUMENT_NAME:()=&gt;IK,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=&gt;CK,SEMATTRS_FAAS_DOCUMENT_TIME:()=&gt;PK,SEMATTRS_FAAS_EXECUTION:()=&gt;RK,SEMATTRS_FAAS_INVOKED_NAME:()=&gt;MK,SEMATTRS_FAAS_INVOKED_PROVIDER:()=&gt;wK,SEMATTRS_FAAS_INVOKED_REGION:()=&gt;DK,SEMATTRS_FAAS_TIME:()=&gt;bK,SEMATTRS_FAAS_TRIGGER:()=&gt;AK,SEMATTRS_HTTP_CLIENT_IP:()=&gt;S$,SEMATTRS_HTTP_FLAVOR:()=&gt;f$,SEMATTRS_HTTP_HOST:()=&gt;l$,SEMATTRS_HTTP_METHOD:()=&gt;o$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=&gt;d$,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;h$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=&gt;_$,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=&gt;E$,SEMATTRS_HTTP_ROUTE:()=&gt;T$,SEMATTRS_HTTP_SCHEME:()=&gt;c$,SEMATTRS_HTTP_SERVER_NAME:()=&gt;m$,SEMATTRS_HTTP_STATUS_CODE:()=&gt;u$,SEMATTRS_HTTP_TARGET:()=&gt;a$,SEMATTRS_HTTP_URL:()=&gt;s$,SEMATTRS_HTTP_USER_AGENT:()=&gt;p$,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=&gt;mX,SEMATTRS_MESSAGE_ID:()=&gt;EX,SEMATTRS_MESSAGE_TYPE:()=&gt;_X,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=&gt;TX,SEMATTRS_MESSAGING_CONSUMER_ID:()=&gt;eX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=&gt;W$,SEMATTRS_MESSAGING_DESTINATION:()=&gt;q$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=&gt;j$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=&gt;iX,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=&gt;nX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=&gt;rX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=&gt;oX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=&gt;sX,SEMATTRS_MESSAGING_MESSAGE_ID:()=&gt;X$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=&gt;Q$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=&gt;J$,SEMATTRS_MESSAGING_OPERATION:()=&gt;Z$,SEMATTRS_MESSAGING_PROTOCOL:()=&gt;z$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=&gt;K$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=&gt;tX,SEMATTRS_MESSAGING_SYSTEM:()=&gt;H$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=&gt;Y$,SEMATTRS_MESSAGING_URL:()=&gt;$$,SEMATTRS_NET_HOST_CARRIER_ICC:()=&gt;$K,SEMATTRS_NET_HOST_CARRIER_MCC:()=&gt;zK,SEMATTRS_NET_HOST_CARRIER_MNC:()=&gt;KK,SEMATTRS_NET_HOST_CARRIER_NAME:()=&gt;YK,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=&gt;jK,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=&gt;qK,SEMATTRS_NET_HOST_IP:()=&gt;FK,SEMATTRS_NET_HOST_NAME:()=&gt;HK,SEMATTRS_NET_HOST_PORT:()=&gt;GK,SEMATTRS_NET_PEER_IP:()=&gt;kK,SEMATTRS_NET_PEER_NAME:()=&gt;VK,SEMATTRS_NET_PEER_PORT:()=&gt;BK,SEMATTRS_NET_TRANSPORT:()=&gt;UK,SEMATTRS_PEER_SERVICE:()=&gt;XK,SEMATTRS_RPC_GRPC_STATUS_CODE:()=&gt;uX,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=&gt;dX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=&gt;hX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=&gt;pX,SEMATTRS_RPC_JSONRPC_VERSION:()=&gt;fX,SEMATTRS_RPC_METHOD:()=&gt;cX,SEMATTRS_RPC_SERVICE:()=&gt;lX,SEMATTRS_RPC_SYSTEM:()=&gt;aX,SEMATTRS_THREAD_ID:()=&gt;ZK,SEMATTRS_THREAD_NAME:()=&gt;e$,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=&gt;l5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=&gt;a5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=&gt;c5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=&gt;u5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=&gt;f5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=&gt;p5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=&gt;d5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=&gt;_5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=&gt;h5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=&gt;m5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=&gt;E5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=&gt;n5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=&gt;o5,SEMRESATTRS_CLOUD_PLATFORM:()=&gt;s5,SEMRESATTRS_CLOUD_PROVIDER:()=&gt;r5,SEMRESATTRS_CLOUD_REGION:()=&gt;i5,SEMRESATTRS_CONTAINER_ID:()=&gt;S5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=&gt;v5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=&gt;y5,SEMRESATTRS_CONTAINER_NAME:()=&gt;T5,SEMRESATTRS_CONTAINER_RUNTIME:()=&gt;g5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=&gt;O5,SEMRESATTRS_DEVICE_ID:()=&gt;A5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=&gt;R5,SEMRESATTRS_DEVICE_MODEL_NAME:()=&gt;N5,SEMRESATTRS_FAAS_ID:()=&gt;P5,SEMRESATTRS_FAAS_INSTANCE:()=&gt;b5,SEMRESATTRS_FAAS_MAX_MEMORY:()=&gt;L5,SEMRESATTRS_FAAS_NAME:()=&gt;C5,SEMRESATTRS_FAAS_VERSION:()=&gt;I5,SEMRESATTRS_HOST_ARCH:()=&gt;Vm,SEMRESATTRS_HOST_ID:()=&gt;km,SEMRESATTRS_HOST_IMAGE_ID:()=&gt;w5,SEMRESATTRS_HOST_IMAGE_NAME:()=&gt;M5,SEMRESATTRS_HOST_IMAGE_VERSION:()=&gt;D5,SEMRESATTRS_HOST_NAME:()=&gt;Bm,SEMRESATTRS_HOST_TYPE:()=&gt;x5,SEMRESATTRS_K8S_CLUSTER_NAME:()=&gt;U5,SEMRESATTRS_K8S_CONTAINER_NAME:()=&gt;H5,SEMRESATTRS_K8S_CRONJOB_NAME:()=&gt;e7,SEMRESATTRS_K8S_CRONJOB_UID:()=&gt;Z5,SEMRESATTRS_K8S_DAEMONSET_NAME:()=&gt;W5,SEMRESATTRS_K8S_DAEMONSET_UID:()=&gt;X5,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=&gt;z5,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=&gt;Y5,SEMRESATTRS_K8S_JOB_NAME:()=&gt;Q5,SEMRESATTRS_K8S_JOB_UID:()=&gt;J5,SEMRESATTRS_K8S_NAMESPACE_NAME:()=&gt;V5,SEMRESATTRS_K8S_NODE_NAME:()=&gt;k5,SEMRESATTRS_K8S_NODE_UID:()=&gt;B5,SEMRESATTRS_K8S_POD_NAME:()=&gt;G5,SEMRESATTRS_K8S_POD_UID:()=&gt;F5,SEMRESATTRS_K8S_REPLICASET_NAME:()=&gt;j5,SEMRESATTRS_K8S_REPLICASET_UID:()=&gt;q5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=&gt;$5,SEMRESATTRS_K8S_STATEFULSET_UID:()=&gt;K5,SEMRESATTRS_OS_DESCRIPTION:()=&gt;t7,SEMRESATTRS_OS_NAME:()=&gt;r7,SEMRESATTRS_OS_TYPE:()=&gt;Fm,SEMRESATTRS_OS_VERSION:()=&gt;Gm,SEMRESATTRS_PROCESS_COMMAND:()=&gt;Ym,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=&gt;zm,SEMRESATTRS_PROCESS_COMMAND_LINE:()=&gt;n7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=&gt;qm,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=&gt;jm,SEMRESATTRS_PROCESS_OWNER:()=&gt;Km,SEMRESATTRS_PROCESS_PID:()=&gt;Hm,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=&gt;Ja,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=&gt;st,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=&gt;ko,SEMRESATTRS_SERVICE_INSTANCE_ID:()=&gt;$m,SEMRESATTRS_SERVICE_NAME:()=&gt;at,SEMRESATTRS_SERVICE_NAMESPACE:()=&gt;i7,SEMRESATTRS_SERVICE_VERSION:()=&gt;o7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=&gt;s7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=&gt;ge,SEMRESATTRS_TELEMETRY_SDK_NAME:()=&gt;Se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=&gt;ve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=&gt;c7,SEMRESATTRS_WEBENGINE_NAME:()=&gt;a7,SEMRESATTRS_WEBENGINE_VERSION:()=&gt;l7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=&gt;rQ,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=&gt;nQ,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=&gt;iQ,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=&gt;sQ,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=&gt;aQ,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=&gt;lQ,SemanticAttributes:()=&gt;SX,SemanticResourceAttributes:()=&gt;u7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=&gt;n9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=&gt;i9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=&gt;o9,TELEMETRYSDKLANGUAGEVALUES_GO:()=&gt;s9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=&gt;a9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=&gt;wt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=&gt;l9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=&gt;c9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=&gt;u9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=&gt;f9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=&gt;S9,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=&gt;g9,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=&gt;v9,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=&gt;y9,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=&gt;O9,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=&gt;A9,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=&gt;R9,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=&gt;N9,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=&gt;C9,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=&gt;P9,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=&gt;I9,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=&gt;b9,TelemetrySdkLanguageValues:()=&gt;p9});var Ve=p(()=&gt;{OL();Xx();Wx();Jx()});function Qu(r){return r.setValue(Zm,!0)}function TM(r){return r.deleteValue(Zm)}function At(r){return r.getValue(Zm)===!0}var Zm,nl=p(()=&gt;{P();Zm=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Zu,SM=p(()=&gt;{Zu=&quot;baggage&quot;});function tf(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function rf(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function il(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function vM(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;il(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var eT=p(()=&gt;{P()});var nf,yM=p(()=&gt;{P();nl();SM();eT();nf=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||At(e))return;let a=rf(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=tf(a);i.length&gt;0&amp;&amp;o.set(t,Zu,i)}extract(e,t,o){let s=o.get(t,Zu),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=il(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Zu]}}});var of,OM=p(()=&gt;{of=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function AM(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!tT(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!rT(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function tT(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function rT(r){return r==null?!0:Array.isArray(r)?_Z(r):RM(r)}function _Z(r){let e;for(let t of r)if(t!=null){if(!e){if(RM(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function RM(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var NM=p(()=&gt;{P()});function sf(){return r=&gt;{S.error(EZ(r))}}function EZ(r){return typeof r==&quot;string&quot;?r:JSON.stringify(mZ(r))}function mZ(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var nT=p(()=&gt;{P()});function PM(r){CM=r}function af(r){try{CM(r)}catch{}}var CM,iT=p(()=&gt;{nT();CM=sf()});var Vo,oT=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Vo||(Vo={}))});function gZ(r){return SZ.indexOf(r)&gt;-1}function yZ(r){return vZ.indexOf(r)&gt;-1}function AZ(r){return OZ.indexOf(r)&gt;-1}function RZ(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function NZ(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function CZ(r,e,t,o=TZ){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function IZ(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=PZ[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function ll(r){let e={};for(let t in al){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:IZ(o,e,r);break;default:if(gZ(o))RZ(o,e,r);else if(yZ(o))NZ(o,e,r);else if(AZ(o))CZ(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var TZ,SZ,vZ,OZ,ol,sl,sT,aT,al,PZ,lT=p(()=&gt;{P();oT();TZ=&quot;,&quot;,SZ=[&quot;OTEL_SDK_DISABLED&quot;];vZ=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];OZ=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];ol=1/0,sl=128,sT=128,aT=128,al={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ol,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:sl,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:sT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aT,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Vo.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};PZ={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Fo(){let r=ll(process.env);return Object.assign({},al,r)}function lf(){return ll(process.env)}var IM=p(()=&gt;{lT()});var cf,bM=p(()=&gt;{cf=typeof globalThis==&quot;object&quot;?globalThis:global});function LM(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function uf(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LM(r.charCodeAt(o)),a=LM(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var cT=p(()=&gt;{});function ff(r){return Buffer.from(uf(r)).toString(&quot;base64&quot;)}var xM=p(()=&gt;{cT()});function MM(r){return function(){for(let t=0;t&lt;r/4;t++)pf.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(pf[t]&gt;0);t++)t===r-1&amp;&amp;(pf[r-1]=1);return pf.toString(&quot;hex&quot;,0,r)}}var Go,pf,wM=p(()=&gt;{Go=class{constructor(){this.generateTraceId=MM(16),this.generateSpanId=MM(8)}},pf=Buffer.allocUnsafe(16)});import{performance as bZ}from&quot;perf_hooks&quot;;var In,DM=p(()=&gt;{In=bZ});var df,uT=p(()=&gt;{df=&quot;1.29.0&quot;});var bn,UM=p(()=&gt;{uT();Ve();bn={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:df}});function hf(r){r.unref()}var kM=p(()=&gt;{});var BM=p(()=&gt;{IM();bM();xM();wM();DM();UM();kM()});var fT=p(()=&gt;{BM()});function Ho(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*xZ);return[t,o]}function Ef(){let r=In.timeOrigin;if(typeof r!=&quot;number&quot;){let e=In;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function pT(r){let e=Ho(Ef()),t=Ho(typeof r==&quot;number&quot;?r:In.now());return dT(e,t)}function FM(r){if(mf(r))return r;if(typeof r==&quot;number&quot;)return r&lt;Ef()?pT(r):Ho(r);if(r instanceof Date)return Ho(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function GM(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=_f),[t,o]}function HM(r){let e=VM,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function qM(r){return r[0]*_f+r[1]}function jM(r){return r[0]*1e3+r[1]/1e6}function YM(r){return r[0]*1e6+r[1]/1e3}function mf(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function zM(r){return mf(r)||typeof r==&quot;number&quot;||r instanceof Date}function dT(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=_f&amp;&amp;(t[1]-=_f,t[0]+=1),t}var VM,LZ,xZ,_f,KM=p(()=&gt;{fT();VM=9,LZ=6,xZ=Math.pow(10,LZ),_f=Math.pow(10,VM)});var Tf,$M=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Tf||(Tf={}))});var Sf,XM=p(()=&gt;{P();Sf=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function WM(r){return DZ.test(r)}function JM(r){return UZ.test(r)&amp;&amp;!kZ.test(r)}var hT,MZ,wZ,DZ,UZ,kZ,QM=p(()=&gt;{hT=&quot;[_0-9a-z-*/]&quot;,MZ=`[a-z]${hT}{0,255}`,wZ=`[a-z0-9]${hT}{0,240}@[a-z]${hT}{0,13}`,DZ=new RegExp(`^(?:${MZ}|${wZ})$`),UZ=/^[ -~]{0,255}[!-~]$/,kZ=/,|=/});var ZM,BZ,ew,tw,qo,_T=p(()=&gt;{QM();ZM=32,BZ=512,ew=&quot;,&quot;,tw=&quot;=&quot;,qo=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+tw+this.get(t)),e),[]).join(ew)}_parse(e){e.length&gt;BZ||(this._internalState=e.split(ew).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(tw);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);WM(i)&amp;&amp;JM(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;ZM&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ZM))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function ET(r){let e=jZ.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var cl,ul,VZ,FZ,GZ,HZ,qZ,jZ,gf,rw=p(()=&gt;{P();nl();_T();cl=&quot;traceparent&quot;,ul=&quot;tracestate&quot;,VZ=&quot;00&quot;,FZ=&quot;(?!ff)[\\da-f]{2}&quot;,GZ=&quot;(?![0]{32})[\\da-f]{32}&quot;,HZ=&quot;(?![0]{16})[\\da-f]{16}&quot;,qZ=&quot;[\\da-f]{2}&quot;,jZ=new RegExp(`^\\s?(${FZ})-(${GZ})-(${HZ})-(${qZ})(-.*)?\\s?$`);gf=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||At(e)||!xe(s))return;let a=`${VZ}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,cl,a),s.traceState&amp;&amp;o.set(t,ul,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,cl);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=ET(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ul);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new qo(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[cl,ul]}}});function nw(r,e){return r.setValue(mT,e)}function iw(r){return r.deleteValue(mT)}function ow(r){return r.getValue(mT)}var mT,vf,sw=p(()=&gt;{P();mT=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(vf||(vf={}))});var Ai,TT=p(()=&gt;{P();Ai=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Ln,ST=p(()=&gt;{P();Ln=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var yf,aw=p(()=&gt;{P();iT();TT();ST();yf=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(af(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Ln),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Ln,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ai,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Ln,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ai}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Of,lw=p(()=&gt;{P();Of=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function JZ(r,e){return function(t){return r(e(t))}}function gT(r){if(!QZ(r)||ZZ(r)!==YZ)return!1;let e=WZ(r);if(e===null)return!0;let t=fw.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;cw.call(t)===XZ}function QZ(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function ZZ(r){return r==null?r===void 0?KZ:zZ:Ri&amp;&amp;Ri in Object(r)?eee(r):tee(r)}function eee(r){let e=fw.call(r,Ri),t=r[Ri],o=!1;try{r[Ri]=void 0,o=!0}catch{}let s=pw.call(r);return o&amp;&amp;(e?r[Ri]=t:delete r[Ri]),s}function tee(r){return pw.call(r)}var YZ,zZ,KZ,$Z,cw,XZ,WZ,uw,fw,Ri,pw,dw=p(()=&gt;{YZ=&quot;[object Object]&quot;,zZ=&quot;[object Null]&quot;,KZ=&quot;[object Undefined]&quot;,$Z=Function.prototype,cw=$Z.toString,XZ=cw.call(Object),WZ=JZ(Object.getPrototypeOf,Object),uw=Object.prototype,fw=uw.hasOwnProperty,Ri=Symbol?Symbol.toStringTag:void 0,pw=uw.toString});function _w(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=Ew(e,r.shift(),0,t);return e}function vT(r){return Rf(r)?r.slice():r}function Ew(r,e,t=0,o){let s;if(!(t&gt;ree)){if(t++,Af(r)||Af(e)||mw(e))s=vT(e);else if(Rf(r)){if(s=r.slice(),Rf(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(vT(e[a]));else if(fl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=vT(e[l])}}}else if(fl(r))if(fl(e)){if(!nee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Af(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(hw(r,l,o)||hw(e,l,o))delete s[l];else{if(fl(u)&amp;&amp;fl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=Ew(s[l],c,t,o)}}}}else s=e;return s}}function hw(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Rf(r){return Array.isArray(r)}function mw(r){return typeof r==&quot;function&quot;}function fl(r){return!Af(r)&amp;&amp;!Rf(r)&amp;&amp;!mw(r)&amp;&amp;typeof r==&quot;object&quot;}function Af(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function nee(r,e){return!(!gT(r)||!gT(e))}var ree,Tw=p(()=&gt;{dw();ree=20});function Sw(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new pl(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var pl,gw=p(()=&gt;{pl=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function yT(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function vw(r,e){if(!e)return!1;for(let t of e)if(yT(r,t))return!0;return!1}var yw=p(()=&gt;{});function Ow(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Aw=p(()=&gt;{});var Nf,Rw=p(()=&gt;{Nf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Cf,Nw=p(()=&gt;{Rw();Cf=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Nf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function Cw(r,e){return new Promise(t=&gt;{he.with(Qu(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Pw=p(()=&gt;{P();nl()});var Pf={};Ae(Pf,{AlwaysOffSampler:()=&gt;Ai,AlwaysOnSampler:()=&gt;Ln,AnchoredClock:()=&gt;of,BindOnceFuture:()=&gt;Cf,CompositePropagator:()=&gt;Sf,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;sl,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;ol,DEFAULT_ENVIRONMENT:()=&gt;al,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;sT,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;aT,ExportResultCode:()=&gt;Tf,ParentBasedSampler:()=&gt;yf,RPCType:()=&gt;vf,RandomIdGenerator:()=&gt;Go,SDK_INFO:()=&gt;bn,TRACE_PARENT_HEADER:()=&gt;cl,TRACE_STATE_HEADER:()=&gt;ul,TimeoutError:()=&gt;pl,TraceIdRatioBasedSampler:()=&gt;Of,TraceState:()=&gt;qo,TracesSamplerValues:()=&gt;Vo,VERSION:()=&gt;df,W3CBaggagePropagator:()=&gt;nf,W3CTraceContextPropagator:()=&gt;gf,_globalThis:()=&gt;cf,addHrTimes:()=&gt;dT,baggageUtils:()=&gt;iee,callWithTimeout:()=&gt;Sw,deleteRPCMetadata:()=&gt;iw,getEnv:()=&gt;Fo,getEnvWithoutDefaults:()=&gt;lf,getRPCMetadata:()=&gt;ow,getTimeOrigin:()=&gt;Ef,globalErrorHandler:()=&gt;af,hexToBase64:()=&gt;ff,hexToBinary:()=&gt;uf,hrTime:()=&gt;pT,hrTimeDuration:()=&gt;GM,hrTimeToMicroseconds:()=&gt;YM,hrTimeToMilliseconds:()=&gt;jM,hrTimeToNanoseconds:()=&gt;qM,hrTimeToTimeStamp:()=&gt;HM,internal:()=&gt;oee,isAttributeKey:()=&gt;tT,isAttributeValue:()=&gt;rT,isTimeInput:()=&gt;zM,isTimeInputHrTime:()=&gt;mf,isTracingSuppressed:()=&gt;At,isUrlIgnored:()=&gt;vw,isWrapped:()=&gt;Ow,loggingErrorHandler:()=&gt;sf,merge:()=&gt;_w,millisToHrTime:()=&gt;Ho,otperformance:()=&gt;In,parseEnvironment:()=&gt;ll,parseTraceParent:()=&gt;ET,sanitizeAttributes:()=&gt;AM,setGlobalErrorHandler:()=&gt;PM,setRPCMetadata:()=&gt;nw,suppressTracing:()=&gt;Qu,timeInputToHrTime:()=&gt;FM,unrefTimer:()=&gt;hf,unsuppressTracing:()=&gt;TM,urlMatches:()=&gt;yT});var iee,oee,xr=p(()=&gt;{yM();OM();NM();iT();nT();KM();cT();$M();eT();fT();XM();rw();sw();TT();ST();aw();lw();nl();_T();lT();Tw();oT();gw();yw();Aw();Nw();uT();Pw();iee={getKeyPairs:rf,serializeKeyPairs:tf,parseKeyPairsIntoRecord:vM,parsePairKeyValue:il},oee={_export:Cw}});var If,Iw=p(()=&gt;{(function(r){r[r.UNSPECIFIED=0]=&quot;UNSPECIFIED&quot;,r[r.TRACE=1]=&quot;TRACE&quot;,r[r.TRACE2=2]=&quot;TRACE2&quot;,r[r.TRACE3=3]=&quot;TRACE3&quot;,r[r.TRACE4=4]=&quot;TRACE4&quot;,r[r.DEBUG=5]=&quot;DEBUG&quot;,r[r.DEBUG2=6]=&quot;DEBUG2&quot;,r[r.DEBUG3=7]=&quot;DEBUG3&quot;,r[r.DEBUG4=8]=&quot;DEBUG4&quot;,r[r.INFO=9]=&quot;INFO&quot;,r[r.INFO2=10]=&quot;INFO2&quot;,r[r.INFO3=11]=&quot;INFO3&quot;,r[r.INFO4=12]=&quot;INFO4&quot;,r[r.WARN=13]=&quot;WARN&quot;,r[r.WARN2=14]=&quot;WARN2&quot;,r[r.WARN3=15]=&quot;WARN3&quot;,r[r.WARN4=16]=&quot;WARN4&quot;,r[r.ERROR=17]=&quot;ERROR&quot;,r[r.ERROR2=18]=&quot;ERROR2&quot;,r[r.ERROR3=19]=&quot;ERROR3&quot;,r[r.ERROR4=20]=&quot;ERROR4&quot;,r[r.FATAL=21]=&quot;FATAL&quot;,r[r.FATAL2=22]=&quot;FATAL2&quot;,r[r.FATAL3=23]=&quot;FATAL3&quot;,r[r.FATAL4=24]=&quot;FATAL4&quot;})(If||(If={}))});var Ni,jo,bf=p(()=&gt;{Ni=class{emit(e){}},jo=new Ni});var dl,Yo,Lf=p(()=&gt;{bf();dl=class{getLogger(e,t,o){return new Ni}},Yo=new dl});var zo,OT=p(()=&gt;{bf();zo=class{constructor(e,t,o,s){this._provider=e,this.name=t,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):jo}}});var Ci,AT=p(()=&gt;{Lf();OT();Ci=class{getLogger(e,t,o){var s;return(s=this.getDelegateLogger(e,t,o))!==null&amp;&amp;s!==void 0?s:new zo(this,e,t,o)}getDelegate(){var e;return(e=this._delegate)!==null&amp;&amp;e!==void 0?e:Yo}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,t,o)}}});var xf,bw=p(()=&gt;{xf=typeof globalThis==&quot;object&quot;?globalThis:global});var Lw=p(()=&gt;{bw()});var xw=p(()=&gt;{Lw()});function Mw(r,e,t){return o=&gt;o===r?e:t}var hl,Ko,RT,ww=p(()=&gt;{xw();hl=Symbol.for(&quot;io.opentelemetry.js.api.logs&quot;),Ko=xf;RT=1});var Mf,Dw=p(()=&gt;{ww();Lf();AT();Mf=class r{constructor(){this._proxyLoggerProvider=new Ci}static getInstance(){return this._instance||(this._instance=new r),this._instance}setGlobalLoggerProvider(e){return Ko[hl]?this.getLoggerProvider():(Ko[hl]=Mw(RT,e,Yo),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ko[hl])===null||e===void 0?void 0:e.call(Ko,RT))!==null&amp;&amp;t!==void 0?t:this._proxyLoggerProvider}getLogger(e,t,o){return this.getLoggerProvider().getLogger(e,t,o)}disable(){delete Ko[hl],this._proxyLoggerProvider=new Ci}}});var Uw={};Ae(Uw,{NOOP_LOGGER:()=&gt;jo,NOOP_LOGGER_PROVIDER:()=&gt;Yo,NoopLogger:()=&gt;Ni,NoopLoggerProvider:()=&gt;dl,ProxyLogger:()=&gt;zo,ProxyLoggerProvider:()=&gt;Ci,SeverityNumber:()=&gt;If,logs:()=&gt;_l});var _l,El=p(()=&gt;{Iw();bf();Lf();OT();AT();Dw();_l=Mf.getInstance()});function kw(r){return r.setValue(see,!0)}var see,Bw=p(()=&gt;{P();see=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function wf(r){return r==null?!0:Array.isArray(r)?aee(r):Vw(r)}function aee(r){let e;for(let t of r)if(t!=null){if(!e){if(Vw(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Vw(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var Fw=p(()=&gt;{});function Gw(){return r=&gt;{S.error(lee(r))}}function lee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(cee(r))}function cee(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var Hw=p(()=&gt;{P()});function Mr(r){try{uee(r)}catch{}}var uee,qw=p(()=&gt;{Hw();uee=Gw()});var Df,jw=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Df||(Df={}))});function dee(r){return pee.indexOf(r)&gt;-1}function _ee(r){return hee.indexOf(r)&gt;-1}function mee(r){return Eee.indexOf(r)&gt;-1}function Tee(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function See(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function gee(r,e,t,o=fee){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function yee(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=vee[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function kf(r){let e={};for(let t in Uf){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:yee(o,e,r);break;default:if(dee(o))Tee(o,e,r);else if(_ee(o))See(o,e,r);else if(mee(o))gee(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var fee,pee,hee,Eee,$o,Xo,Yw,zw,Uf,vee,NT=p(()=&gt;{P();jw();fee=&quot;,&quot;,pee=[&quot;OTEL_SDK_DISABLED&quot;];hee=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];Eee=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];$o=1/0,Xo=128,Yw=128,zw=128,Uf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:$o,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Xo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Yw,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:zw,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Df.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};vee={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function xn(){let r=kf(process.env);return Object.assign({},Uf,r)}function ml(){return kf(process.env)}var Kw=p(()=&gt;{NT()});import{performance as Oee}from&quot;perf_hooks&quot;;var Pi,$w=p(()=&gt;{Pi=Oee});var Xw,Ww=p(()=&gt;{Xw=&quot;1.29.0&quot;});var Ii,Jw=p(()=&gt;{Ww();Ve();Ii={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:Xw}});function Tl(r){r.unref()}var Qw=p(()=&gt;{});var Zw=p(()=&gt;{Kw();$w();Jw();Qw()});var CT=p(()=&gt;{Zw()});function Sl(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*Iee);return[t,o]}function PT(){let r=Pi.timeOrigin;if(typeof r!=&quot;number&quot;){let e=Pi;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function t1(r){let e=Sl(PT()),t=Sl(typeof r==&quot;number&quot;?r:Pi.now());return n1(e,t)}function Bf(r){if(r1(r))return r;if(typeof r==&quot;number&quot;)return r&lt;PT()?t1(r):Sl(r);if(r instanceof Date)return Sl(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function IT(r){return r[0]*1e6+r[1]/1e3}function r1(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function n1(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=e1&amp;&amp;(t[1]-=e1,t[0]+=1),t}var Cee,Pee,Iee,e1,i1=p(()=&gt;{CT();Cee=9,Pee=6,Iee=Math.pow(10,Pee),e1=Math.pow(10,Cee)});var Yt,o1=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Yt||(Yt={}))});function Uee(r,e){return function(t){return r(e(t))}}function bT(r){if(!kee(r)||Bee(r)!==bee)return!1;let e=Dee(r);if(e===null)return!0;let t=l1.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;s1.call(t)===wee}function kee(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Bee(r){return r==null?r===void 0?xee:Lee:bi&amp;&amp;bi in Object(r)?Vee(r):Fee(r)}function Vee(r){let e=l1.call(r,bi),t=r[bi],o=!1;try{r[bi]=void 0,o=!0}catch{}let s=c1.call(r);return o&amp;&amp;(e?r[bi]=t:delete r[bi]),s}function Fee(r){return c1.call(r)}var bee,Lee,xee,Mee,s1,wee,Dee,a1,l1,bi,c1,u1=p(()=&gt;{bee=&quot;[object Object]&quot;,Lee=&quot;[object Null]&quot;,xee=&quot;[object Undefined]&quot;,Mee=Function.prototype,s1=Mee.toString,wee=s1.call(Object),Dee=Uee(Object.getPrototypeOf,Object),a1=Object.prototype,l1=a1.hasOwnProperty,bi=Symbol?Symbol.toStringTag:void 0,c1=a1.toString});function xT(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=p1(e,r.shift(),0,t);return e}function LT(r){return Ff(r)?r.slice():r}function p1(r,e,t=0,o){let s;if(!(t&gt;Gee)){if(t++,Vf(r)||Vf(e)||d1(e))s=LT(e);else if(Ff(r)){if(s=r.slice(),Ff(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(LT(e[a]));else if(gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=LT(e[l])}}}else if(gl(r))if(gl(e)){if(!Hee(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(Vf(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(f1(r,l,o)||f1(e,l,o))delete s[l];else{if(gl(u)&amp;&amp;gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=p1(s[l],c,t,o)}}}}else s=e;return s}}function f1(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function Ff(r){return Array.isArray(r)}function d1(r){return typeof r==&quot;function&quot;}function gl(r){return!Vf(r)&amp;&amp;!Ff(r)&amp;&amp;!d1(r)&amp;&amp;typeof r==&quot;object&quot;}function Vf(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Hee(r,e){return!(!bT(r)||!bT(e))}var Gee,h1=p(()=&gt;{u1();Gee=20});function vl(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Gf(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Gf,_1=p(()=&gt;{Gf=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var Hf,E1=p(()=&gt;{Hf=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var un,m1=p(()=&gt;{E1();un=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Hf}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function T1(r,e){return new Promise(t=&gt;{he.with(kw(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var S1=p(()=&gt;{P();Bw()});var qf,cr=p(()=&gt;{Fw();qw();i1();o1();CT();NT();h1();_1();m1();S1();qf={_export:T1}});function jf(){return`unknown_service:${process.argv0}`}var g1=p(()=&gt;{});var v1=p(()=&gt;{g1()});var y1=p(()=&gt;{v1()});var Mn,O1=p(()=&gt;{P();Ve();cr();y1();Mn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:jf(),[ge]:Ii[ge],[Se]:Ii[Se],[ve]:Ii[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Mn.EMPTY=new Mn({})});var A1=p(()=&gt;{O1()});var Wo,MT=p(()=&gt;{P();P();cr();Wo=class{constructor(e,t,o){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:s,observedTimestamp:a,severityNumber:i,severityText:n,body:l,attributes:c={},context:u}=o,f=Date.now();if(this.hrTime=Bf(s??f),this.hrTimeObserved=Bf(a??f),u){let _=ie.getSpanContext(u);_&amp;&amp;xe(_)&amp;&amp;(this.spanContext=_)}this.severityNumber=i,this.severityText=n,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):!wf(t)&amp;&amp;!(typeof t==&quot;object&quot;&amp;&amp;!Array.isArray(t)&amp;&amp;Object.keys(t).length&gt;0)?(S.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length&gt;=this._logRecordLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&amp;&amp;S.warn(&quot;Dropping extra attributes.&quot;),this):(wf(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&amp;&amp;S.warn(&quot;Can not execute the operation on emitted log record&quot;),this._isReadonly}}});var Yf,R1=p(()=&gt;{P();MT();Yf=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||he.active(),o=new Wo(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(o,t),o._makeReadonly()}}});function N1(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:xn().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0,mergeResourceWithDefaults:!0}}function C1(r){var e,t,o,s,a,i;let n=ml();return{attributeCountLimit:(o=(t=(e=r.attributeCountLimit)!==null&amp;&amp;e!==void 0?e:n.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;t!==void 0?t:n.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;o!==void 0?o:Xo,attributeValueLengthLimit:(i=(a=(s=r.attributeValueLengthLimit)!==null&amp;&amp;s!==void 0?s:n.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;a!==void 0?a:n.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;i!==void 0?i:$o}}var P1=p(()=&gt;{cr()});var zf,I1=p(()=&gt;{cr();zf=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=&gt;vl(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(o=&gt;o.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=&gt;e.shutdown()))}}});var Jo,wT=p(()=&gt;{Jo=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}});var Kf,b1=p(()=&gt;{wT();Kf=class{constructor(e,t,o){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=o,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Jo}}});function jee(r,e){let t=e??Mn.empty();return r?Mn.default().merge(t):t}var qee,$f,L1=p(()=&gt;{P();El();A1();cr();R1();P1();I1();b1();qee=&quot;unknown&quot;;$f=class{constructor(e={}){let t=xT({},N1(),e),o=jee(t.mergeResourceWithDefaults,e.resource);this._sharedState=new Kf(o,t.forceFlushTimeoutMillis,C1(t.logRecordLimits)),this._shutdownOnce=new un(this._shutdown,this)}getLogger(e,t,o){if(this._shutdownOnce.isCalled)return S.warn(&quot;A shutdown LoggerProvider cannot provide a Logger&quot;),jo;e||S.warn(&quot;Logger requested without instrumentation scope name.&quot;);let s=e||qee,a=`${s}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Yf({name:s,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&amp;&amp;this._sharedState.activeProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current log record processor&quot;,t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new zf(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn(&quot;invalid attempt to force flush after LoggerProvider shutdown&quot;),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn(&quot;shutdown may only be called once per LoggerProvider&quot;),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}});var Xf,x1=p(()=&gt;{cr();cr();Xf=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,o,s;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:IT(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(o=e.spanContext)===null||o===void 0?void 0:o.spanId,traceFlags:(s=e.spanContext)===null||s===void 0?void 0:s.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});t==null||t({code:Yt.SUCCESS})}}});var Wf,M1=p(()=&gt;{cr();Wf=class{constructor(e){this._exporter=e,this._shutdownOnce=new un(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var t,o;if(this._shutdownOnce.isCalled)return;let s=()=&gt;qf._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Yt.SUCCESS&amp;&amp;Mr((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleLogRecordProcessor: log record export failed (status ${a})`))}).catch(Mr);if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(this._unresolvedExports.delete(a),s()),Mr);a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var Jf,w1=p(()=&gt;{cr();Jf=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedLogRecords.push(...e),t({code:Yt.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}});var Qf,D1=p(()=&gt;{P();cr();Qf=class{constructor(e,t){var o,s,a,i;this._exporter=e,this._finishedLogRecords=[];let n=xn();this._maxExportBatchSize=(o=t==null?void 0:t.maxExportBatchSize)!==null&amp;&amp;o!==void 0?o:n.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(s=t==null?void 0:t.maxQueueSize)!==null&amp;&amp;s!==void 0?s:n.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(a=t==null?void 0:t.scheduledDelayMillis)!==null&amp;&amp;a!==void 0?a:n.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(i=t==null?void 0:t.exportTimeoutMillis)!==null&amp;&amp;i!==void 0?i:n.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new un(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length&gt;=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a&lt;s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=&gt;{vl(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=&gt;e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;{this._flushOneBatch().then(()=&gt;{this._finishedLogRecords.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(e=&gt;{Mr(e)})},this._scheduledDelayMillis),Tl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}_export(e){let t=()=&gt;qf._export(this._exporter,e).then(s=&gt;{var a;s.code!==Yt.SUCCESS&amp;&amp;Mr((a=s.error)!==null&amp;&amp;a!==void 0?a:new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(Mr),o=e.map(s=&gt;s.resource).filter(s=&gt;s.asyncAttributesPending);return o.length===0?t():Promise.all(o.map(s=&gt;{var a;return(a=s.waitForAsyncAttributes)===null||a===void 0?void 0:a.call(s)})).then(t,Mr)}}});var Qo,U1=p(()=&gt;{D1();Qo=class extends Qf{onShutdown(){}}});var k1=p(()=&gt;{U1()});var B1=p(()=&gt;{k1()});var DT={};Ae(DT,{BatchLogRecordProcessor:()=&gt;Qo,ConsoleLogRecordExporter:()=&gt;Xf,InMemoryLogRecordExporter:()=&gt;Jf,LogRecord:()=&gt;Wo,LoggerProvider:()=&gt;$f,NoopLogRecordProcessor:()=&gt;Jo,SimpleLogRecordProcessor:()=&gt;Wf});var UT=p(()=&gt;{L1();MT();wT();x1();M1();w1();B1()});var ur,Zf=p(()=&gt;{(function(r){r[r.DELTA=0]=&quot;DELTA&quot;,r[r.CUMULATIVE=1]=&quot;CUMULATIVE&quot;})(ur||(ur={}))});var lt,Zo=p(()=&gt;{(function(r){r[r.HISTOGRAM=0]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=1]=&quot;EXPONENTIAL_HISTOGRAM&quot;,r[r.GAUGE=2]=&quot;GAUGE&quot;,r[r.SUM=3]=&quot;SUM&quot;})(lt||(lt={}))});function V1(r){return r!=null}function ep(r){let e=Object.keys(r);return e.length===0?&quot;&quot;:(e=e.sort(),JSON.stringify(e.map(t=&gt;[t,r[t]])))}function F1(r){var e,t;return`${r.name}:${(e=r.version)!==null&amp;&amp;e!==void 0?e:&quot;&quot;}:${(t=r.schemaUrl)!==null&amp;&amp;t!==void 0?t:&quot;&quot;}`}function wn(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Li(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}async function G1(r){return Promise.all(r.map(async e=&gt;{try{return{status:&quot;fulfilled&quot;,value:await e}}catch(t){return{status:&quot;rejected&quot;,reason:t}}}))}function H1(r){return r.status===&quot;rejected&quot;}function kT(r,e){let t=[];return r.forEach(o=&gt;{t.push(...e(o))}),t}function q1(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function j1(r,e){let t=0,o=r.length-1,s=r.length;for(;o&gt;=t;){let a=t+Math.trunc((o-t)/2);r[a]&lt;e?t=a+1:(s=a,o=a-1)}return s}function Y1(r,e){return r.toLowerCase()===e.toLowerCase()}var Li,fr=p(()=&gt;{Li=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});var zt,es=p(()=&gt;{(function(r){r[r.DROP=0]=&quot;DROP&quot;,r[r.SUM=1]=&quot;SUM&quot;,r[r.LAST_VALUE=2]=&quot;LAST_VALUE&quot;,r[r.HISTOGRAM=3]=&quot;HISTOGRAM&quot;,r[r.EXPONENTIAL_HISTOGRAM=4]=&quot;EXPONENTIAL_HISTOGRAM&quot;})(zt||(zt={}))});var yl,z1=p(()=&gt;{es();yl=class{constructor(){this.kind=zt.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,o,s){}}});function wr(r,e,t){var o,s,a,i;return zee(r)||S.warn(`Invalid metric name: &quot;${r}&quot;. The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(o=t==null?void 0:t.description)!==null&amp;&amp;o!==void 0?o:&quot;&quot;,unit:(s=t==null?void 0:t.unit)!==null&amp;&amp;s!==void 0?s:&quot;&quot;,valueType:(a=t==null?void 0:t.valueType)!==null&amp;&amp;a!==void 0?a:Ot.DOUBLE,advice:(i=t==null?void 0:t.advice)!==null&amp;&amp;i!==void 0?i:{}}}function K1(r,e){var t,o;return{name:(t=r.name)!==null&amp;&amp;t!==void 0?t:e.name,description:(o=r.description)!==null&amp;&amp;o!==void 0?o:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function $1(r,e){return Y1(r.name,e.name)&amp;&amp;r.unit===e.unit&amp;&amp;r.type===e.type&amp;&amp;r.valueType===e.valueType}function zee(r){return r.match(Yee)!=null}var _e,Yee,fn=p(()=&gt;{P();fr();(function(r){r.COUNTER=&quot;COUNTER&quot;,r.GAUGE=&quot;GAUGE&quot;,r.HISTOGRAM=&quot;HISTOGRAM&quot;,r.UP_DOWN_COUNTER=&quot;UP_DOWN_COUNTER&quot;,r.OBSERVABLE_COUNTER=&quot;OBSERVABLE_COUNTER&quot;,r.OBSERVABLE_GAUGE=&quot;OBSERVABLE_GAUGE&quot;,r.OBSERVABLE_UP_DOWN_COUNTER=&quot;OBSERVABLE_UP_DOWN_COUNTER&quot;})(_e||(_e={}));Yee=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function Kee(r){let e=r.map(()=&gt;0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts,rs,X1=p(()=&gt;{es();Zo();fn();fr();ts=class{constructor(e,t,o=!0,s=Kee(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=o,this._current=s}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&amp;&amp;(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=j1(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rs=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=zt.HISTOGRAM}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let u=0;u&lt;a.length;u++)n[u]=a[u]+i[u];let l=1/0,c=-1/0;return this._recordMinMax&amp;&amp;(o.hasMinMax&amp;&amp;s.hasMinMax?(l=Math.min(o.min,s.min),c=Math.max(o.max,s.max)):o.hasMinMax?(l=o.min,c=o.max):s.hasMinMax&amp;&amp;(l=s.min,c=s.max)),new ts(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&amp;&amp;(o.hasMinMax||s.hasMinMax),min:l,max:c})}diff(e,t){let o=e.toPointValue(),s=t.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l&lt;a.length;l++)n[l]=i[l]-a[l];return new ts(t.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}});var Ol,BT,W1=p(()=&gt;{Ol=class r{constructor(e=new BT,t=0,o=0,s=0){this.backing=e,this.indexBase=t,this.indexStart=o,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&amp;&amp;this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=&gt;this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e&lt;t&amp;&amp;(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e&lt;this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e&gt;=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,o=1&lt;&lt;e,s=0,a=0;for(let i=this.indexStart;i&lt;=this.indexEnd;){let n=i%o;n&lt;0&amp;&amp;(n+=o);for(let l=n;l&lt;o&amp;&amp;s&lt;t;l++)this._relocateBucket(a,s),s++,i++;a++}this.indexStart&gt;&gt;=e,this.indexEnd&gt;&gt;=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&amp;&amp;(e&gt;0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&amp;&amp;this.incrementBucket(e,this.backing.emptyBucket(t))}},BT=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-t,...this._counts.slice(t)),s.splice(0,t,...this._counts.slice(0,t)),this._counts=s}reverse(e,t){let o=Math.floor((e+t)/2)-e;for(let s=0;s&lt;o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[t-s-1],this._counts[t-s-1]=a}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]&gt;=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});function tp(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&amp;2146435072)&gt;&gt;20)-1023}function rp(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),o=e.getUint32(4);return(t&amp;1048575)*Math.pow(2,32)+o}var Al,VT=p(()=&gt;{Al=Math.pow(2,-1022)});function Rl(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}function Q1(r){return r--,r|=r&gt;&gt;1,r|=r&gt;&gt;2,r|=r&gt;&gt;4,r|=r&gt;&gt;8,r|=r&gt;&gt;16,r++,r}var np=p(()=&gt;{});var Dr,ip=p(()=&gt;{Dr=class extends Error{}});var op,eD=p(()=&gt;{VT();np();ip();op=class{constructor(e){this._shift=-e}mapToIndex(e){if(e&lt;Al)return this._minNormalLowerBoundaryIndex();let t=tp(e),o=this._rightShift(rp(e)-1,52);return t+o&gt;&gt;this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e&lt;t)throw new Dr(`underflow: ${e} is &lt; minimum lower boundary: ${t}`);let o=this._maxNormalLowerBoundaryIndex();if(e&gt;o)throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${o}`);return Rl(1,e&lt;&lt;this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022&gt;&gt;this._shift;return this._shift&lt;2&amp;&amp;e--,e}_maxNormalLowerBoundaryIndex(){return 1023&gt;&gt;this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}});var sp,tD=p(()=&gt;{VT();np();ip();sp=class{constructor(e){this._scale=e,this._scaleFactor=Rl(Math.LOG2E,e),this._inverseFactor=Rl(Math.LN2,-e)}mapToIndex(e){if(e&lt;=Al)return this._minNormalLowerBoundaryIndex()-1;if(rp(e)===0)return(tp(e)&lt;&lt;this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return t&gt;=o?o:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e&gt;=t){if(e===t)return 2*Math.exp((e-(1&lt;&lt;this._scale))/this._scaleFactor);throw new Dr(`overflow: ${e} is &gt; maximum lower boundary: ${t}`)}let o=this._minNormalLowerBoundaryIndex();if(e&lt;=o){if(e===o)return Al;if(e===o-1)return Math.exp((e+(1&lt;&lt;this._scale))/this._scaleFactor)/2;throw new Dr(`overflow: ${e} is &lt; minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022&lt;&lt;this._scale}_maxNormalLowerBoundaryIndex(){return(1024&lt;&lt;this._scale)-1}}});function HT(r){if(r&gt;nD||r&lt;rD)throw new Dr(`expected scale &gt;= ${rD} &amp;&amp; &lt;= ${nD}, got: ${r}`);return Xee[r+10]}var rD,nD,Xee,iD=p(()=&gt;{eD();tD();ip();rD=-10,nD=20,Xee=Array.from({length:31},(r,e)=&gt;e&gt;10?new sp(e-10):new op(e-10))});var ns,Wee,Jee,qT,ap,Nl,oD=p(()=&gt;{es();Zo();P();fn();W1();iD();np();ns=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},Wee=20,Jee=160,qT=2,ap=class r{constructor(e=e,t=Jee,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new Ol,u=new Ol,f=HT(Wee)){this.startTime=e,this._maxSize=t,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=l,this._positive=c,this._negative=u,this._mapping=f,this._maxSize&lt;qT&amp;&amp;(S.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${qT}`),this._maxSize=qT)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e&gt;this._max&amp;&amp;(this._max=e),e&lt;this._min&amp;&amp;(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e&gt;0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&amp;&amp;(e.min&lt;this.min&amp;&amp;(this._min=e.min),e.max&gt;this.max&amp;&amp;(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,o){let s=this._mapping.mapToIndex(t),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s&lt;e.indexStart&amp;&amp;e.indexEnd-s&gt;=this._maxSize?(a=!0,n=s,i=e.indexEnd):s&gt;e.indexEnd&amp;&amp;s-e.indexStart&gt;=this._maxSize&amp;&amp;(a=!0,n=e.indexStart,i=s),a){let l=this._changeScale(i,n);this._downscale(l),s=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,t,o){if(o===0)return;if(e.length===0&amp;&amp;(e.indexStart=e.indexEnd=e.indexBase=t),t&lt;e.indexStart){let a=e.indexEnd-t;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexStart=t}else if(t&gt;e.indexEnd){let a=t-e.indexStart;a&gt;=e.backing.length&amp;&amp;this._grow(e,a+1),e.indexEnd=t}let s=t-e.indexBase;s&lt;0&amp;&amp;(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,t){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=Q1(t);i&gt;this._maxSize&amp;&amp;(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,t){let o=0;for(;e-t&gt;=this._maxSize;)e&gt;&gt;=1,t&gt;&gt;=1,o++;return o}_downscale(e){if(e===0)return;if(e&lt;0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=HT(t)}_minScale(e){let t=Math.min(this.scale,e.scale),o=ns.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),s=ns.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(o.high,o.low),t-this._changeScale(s.high,s.low))}_highLowAtScale(e,t,o){if(e.length===0)return new ns(0,-1);let s=t-o;return new ns(e.indexStart&gt;&gt;s,e.indexEnd&gt;&gt;s)}_mergeBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++)this._incrementIndexBy(e,a+n&gt;&gt;i,o.at(n))}_diffBuckets(e,t,o,s){let a=o.offset,i=t.scale-s;for(let n=0;n&lt;o.length;n++){let c=(a+n&gt;&gt;i)-e.indexBase;c&lt;0&amp;&amp;(c+=e.backing.length),e.decrementBucket(c,o.at(n))}e.trim()}},Nl=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=zt.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ap(e,this._maxSize,this._recordMinMax)}merge(e,t){let o=t.clone();return o.merge(e),o}diff(e,t){let o=t.clone();return o.diff(e),o}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=&gt;{let n=i.toPointValue(),l=e.type===_e.GAUGE||e.type===_e.UP_DOWN_COUNTER||e.type===_e.OBSERVABLE_GAUGE||e.type===_e.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:l?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}});function sD(r){return r.setValue(Qee,!0)}var Qee,aD=p(()=&gt;{P();Qee=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});function lD(){return r=&gt;{S.error(Zee(r))}}function Zee(r){return typeof r==&quot;string&quot;?r:JSON.stringify(ete(r))}function ete(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var cD=p(()=&gt;{P()});function lp(r){try{tte(r)}catch{}}var tte,uD=p(()=&gt;{cD();tte=lD()});var fD,pD=p(()=&gt;{fD=&quot;1.29.0&quot;});var xi,dD=p(()=&gt;{pD();Ve();xi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:fD}});function Cl(r){r.unref()}var hD=p(()=&gt;{});var _D=p(()=&gt;{dD();hD()});var ED=p(()=&gt;{_D()});function Mi(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*ute);return[t,o]}function is(r){return r[0]*1e6+r[1]/1e3}var lte,cte,ute,FIe,mD=p(()=&gt;{lte=9,cte=6,ute=Math.pow(10,cte),FIe=Math.pow(10,lte)});var pr,TD=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(pr||(pr={}))});function SD(r,e){return new Promise(t=&gt;{he.with(sD(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var gD=p(()=&gt;{P();aD()});var vD,Dn=p(()=&gt;{uD();mD();TD();ED();gD();vD={_export:SD}});var os,Pl,yD=p(()=&gt;{es();Dn();Zo();os=class{constructor(e,t=0,o=[0,0]){this.startTime=e,this._current=t,this.sampleTime=o}record(e){this._current=e,this.sampleTime=Mi(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Pl=class{constructor(){this.kind=zt.LAST_VALUE}createAccumulation(e){return new os(e)}merge(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,t){let o=is(t.sampleTime)&gt;=is(e.sampleTime)?t:e;return new os(t.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.GAUGE,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}}});var Un,ss,OD=p(()=&gt;{es();Zo();Un=class{constructor(e,t,o=0,s=!1){this.startTime=e,this.monotonic=t,this._current=o,this.reset=s}record(e){this.monotonic&amp;&amp;e&lt;0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ss=class{constructor(e){this.monotonic=e,this.kind=zt.SUM}createAccumulation(e){return new Un(e,this.monotonic)}merge(e,t){let o=e.toPointValue(),s=t.toPointValue();return t.reset?new Un(t.startTime,this.monotonic,s,t.reset):new Un(e.startTime,this.monotonic,o+s)}diff(e,t){let o=e.toPointValue(),s=t.toPointValue();return this.monotonic&amp;&amp;o&gt;s?new Un(t.startTime,this.monotonic,s,!0):new Un(t.startTime,this.monotonic,s-o)}toMetricData(e,t,o,s){return{descriptor:e,aggregationTemporality:t,dataPointType:lt.SUM,dataPoints:o.map(([a,i])=&gt;({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}}});var AD=p(()=&gt;{z1();X1();oD();yD();OD()});var mt,as,wi,ls,cs,Il,bl,Ll,RD,ND,CD,PD,fte,pte,cp=p(()=&gt;{P();AD();fn();mt=class{static Drop(){return RD}static Sum(){return ND}static LastValue(){return CD}static Histogram(){return PD}static ExponentialHistogram(){return fte}static Default(){return pte}},as=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};as.DEFAULT_INSTANCE=new yl;wi=class r extends mt{createAggregator(e){switch(e.type){case _e.COUNTER:case _e.OBSERVABLE_COUNTER:case _e.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};wi.MONOTONIC_INSTANCE=new ss(!0);wi.NON_MONOTONIC_INSTANCE=new ss(!1);ls=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};ls.DEFAULT_INSTANCE=new Pl;cs=class r extends mt{createAggregator(e){return r.DEFAULT_INSTANCE}};cs.DEFAULT_INSTANCE=new rs([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);Il=class extends mt{constructor(e,t=!0){if(super(),this._recordMinMax=t,e==null)throw new Error(&quot;ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array&quot;);e=e.concat(),e=e.sort((a,i)=&gt;a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&amp;&amp;(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new rs(this._boundaries,this._recordMinMax)}},bl=class extends mt{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Nl(this._maxSize,this._recordMinMax)}},Ll=class extends mt{_resolve(e){switch(e.type){case _e.COUNTER:case _e.UP_DOWN_COUNTER:case _e.OBSERVABLE_COUNTER:case _e.OBSERVABLE_UP_DOWN_COUNTER:return ND;case _e.GAUGE:case _e.OBSERVABLE_GAUGE:return CD;case _e.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Il(e.advice.explicitBucketBoundaries):PD}return S.warn(`Unable to recognize instrument type: ${e.type}`),RD}createAggregator(e){return this._resolve(e).createAggregator(e)}},RD=new as,ND=new wi,CD=new ls,PD=new cs,fte=new bl,pte=new Ll});var ID,up,jT=p(()=&gt;{cp();Zf();ID=r=&gt;mt.Default(),up=r=&gt;ur.CUMULATIVE});var us,YT=p(()=&gt;{P();fr();jT();us=class{constructor(e){var t,o,s;this._shutdown=!1,this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)!==null&amp;&amp;t!==void 0?t:ID,this._aggregationTemporalitySelector=(o=e==null?void 0:e.aggregationTemporalitySelector)!==null&amp;&amp;o!==void 0?o:up,this._metricProducers=(s=e==null?void 0:e.metricProducers)!==null&amp;&amp;s!==void 0?s:[],this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error(&quot;MetricReader can not be bound to a MeterProvider again.&quot;);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error(&quot;MetricReader is not bound to a MetricProducer&quot;);if(this._shutdown)throw new Error(&quot;MetricReader is shutdown&quot;);let[t,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...this._metricProducers.map(n=&gt;n.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),s=t.errors.concat(kT(o,n=&gt;n.errors)),a=t.resourceMetrics.resource,i=t.resourceMetrics.scopeMetrics.concat(kT(o,n=&gt;n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){S.error(&quot;Cannot call shutdown twice.&quot;);return}(e==null?void 0:e.timeoutMillis)==null?await this.onShutdown():await wn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){S.warn(&quot;Cannot forceFlush on already shutdown MetricReader.&quot;);return}if((e==null?void 0:e.timeoutMillis)==null){await this.onForceFlush();return}await wn(this.onForceFlush(),e.timeoutMillis)}}});var fp,bD=p(()=&gt;{P();Dn();YT();fr();fp=class extends us{constructor(e){var t,o,s,a;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(o=e.exporter.selectAggregationTemporality)===null||o===void 0?void 0:o.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;=0)throw Error(&quot;exportIntervalMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportTimeoutMillis&lt;=0)throw Error(&quot;exportTimeoutMillis must be greater than 0&quot;);if(e.exportTimeoutMillis!==void 0&amp;&amp;e.exportIntervalMillis!==void 0&amp;&amp;e.exportIntervalMillis&lt;e.exportTimeoutMillis)throw Error(&quot;exportIntervalMillis must be greater than or equal to exportTimeoutMillis&quot;);this._exportInterval=(s=e.exportIntervalMillis)!==null&amp;&amp;s!==void 0?s:6e4,this._exportTimeout=(a=e.exportTimeoutMillis)!==null&amp;&amp;a!==void 0?a:3e4,this._exporter=e.exporter}async _runOnce(){try{await wn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof Li){S.error(&quot;Export took longer than %s milliseconds and timed out.&quot;,this._exportTimeout);return}lp(e)}}async _doRun(){var e,t;let{resourceMetrics:o,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length&gt;0&amp;&amp;S.error(&quot;PeriodicExportingMetricReader: metrics collection errors&quot;,...s),o.resource.asyncAttributesPending)try{await((t=(e=o.resource).waitForAsyncAttributes)===null||t===void 0?void 0:t.call(e))}catch(i){S.debug(&quot;Error while resolving async portion of resource: &quot;,i),lp(i)}let a=await vD._export(this._exporter,o);if(a.code!==pr.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)}onInitialized(){this._interval=setInterval(()=&gt;{this._runOnce()},this._exportInterval),Cl(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&amp;&amp;clearInterval(this._interval),await this._exporter.shutdown()}}});var pp,LD=p(()=&gt;{Dn();pp=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=&gt;t({code:pr.FAILED}),0);return}this._metrics.push(e),setTimeout(()=&gt;t({code:pr.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var dp,xD=p(()=&gt;{Dn();jT();dp=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e==null?void 0:e.temporalitySelector)!==null&amp;&amp;t!==void 0?t:up}export(e,t){if(this._shutdown){setImmediate(t,{code:pr.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});t({code:pr.SUCCESS})}}});function hp(){return`unknown_service:${process.argv0}`}var MD=p(()=&gt;{});var wD=p(()=&gt;{MD()});var DD=p(()=&gt;{wD()});var kn,UD=p(()=&gt;{P();Ve();Dn();DD();kn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:hp(),[ge]:xi[ge],[Se]:xi[Se],[ve]:xi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};kn.EMPTY=new kn({})});var kD=p(()=&gt;{UD()});var _p,BD=p(()=&gt;{_p=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(s=&gt;this._matchInstrument(s.instrumentSelector,e)&amp;&amp;this._matchMeter(s.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&amp;&amp;e.getNameFilter().match(t.name)&amp;&amp;e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&amp;&amp;(t.version===void 0||e.getVersionFilter().match(t.version))&amp;&amp;(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}});function xl(r){return r instanceof ps}var fs,Ep,mp,Tp,Sp,ps,gp,vp,yp,Op=p(()=&gt;{P();Dn();fs=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},o=he.active()){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,o,Mi(Date.now()))}},Ep=class extends fs{add(e,t,o){this._record(e,t,o)}},mp=class extends fs{add(e,t,o){if(e&lt;0){S.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},Tp=class extends fs{record(e,t,o){this._record(e,t,o)}},Sp=class extends fs{record(e,t,o){if(e&lt;0){S.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,o)}},ps=class{constructor(e,t,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},gp=class extends ps{},vp=class extends ps{},yp=class extends ps{}});var Ap,VD=p(()=&gt;{fn();Op();Ap=class{constructor(e){this._meterSharedState=e}createGauge(e,t){let o=wr(e,_e.GAUGE,t),s=this._meterSharedState.registerMetricStorage(o);return new Tp(s,o)}createHistogram(e,t){let o=wr(e,_e.HISTOGRAM,t),s=this._meterSharedState.registerMetricStorage(o);return new Sp(s,o)}createCounter(e,t){let o=wr(e,_e.COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new mp(s,o)}createUpDownCounter(e,t){let o=wr(e,_e.UP_DOWN_COUNTER,t),s=this._meterSharedState.registerMetricStorage(o);return new Ep(s,o)}createObservableGauge(e,t){let o=wr(e,_e.OBSERVABLE_GAUGE,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new vp(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let o=wr(e,_e.OBSERVABLE_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new gp(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let o=wr(e,_e.OBSERVABLE_UP_DOWN_COUNTER,t),s=this._meterSharedState.registerAsyncMetricStorage(o);return new yp(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}});var ds,zT=p(()=&gt;{fn();ds=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=wr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var KT,Dt,Ml=p(()=&gt;{fr();KT=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=t();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,t,o){o??(o=this._hash(e)),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Dt=class extends KT{constructor(){super(ep)}}});var hs,$T=p(()=&gt;{fr();Ml();hs=class{constructor(e,t){this._aggregator=e,this._activeCollectionStorage=new Dt,this._cumulativeMemoStorage=new Dt,this._overflowAttributes={&quot;otel.metric.overflow&quot;:!0},this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=ep(this._overflowAttributes)}record(e,t,o,s){let a=this._activeCollectionStorage.get(t);if(!a){if(this._activeCollectionStorage.size&gt;=this._cardinalityLimit){let i=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=&gt;this._aggregator.createAccumulation(s));i==null||i.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(t,a)}a==null||a.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([o,s,a])=&gt;{let i=this._aggregator.createAccumulation(t);i==null||i.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}else if(this._cumulativeMemoStorage.size&gt;=this._cardinalityLimit&amp;&amp;(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let l=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(l,i)}if(this._activeCollectionStorage.has(o,a)){let l=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(l,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Dt,e}}});function dte(r){return Array.from(r.entries())}var _s,XT=p(()=&gt;{Zf();Ml();_s=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(o=&gt;{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,t,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),u=c.collectionTime;n=c.aggregationTemporality,n===ur.CUMULATIVE?i=r.merge(c.accumulations,a,this._aggregator):i=r.calibrateStartTime(c.accumulations,a,u)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let l=dte(i);if(l.length!==0)return this._aggregator.toMetricData(t,n,l,s)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let o of t){let s=this._unreportedAccumulations.get(o);s===void 0&amp;&amp;(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let t=new Dt,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return t;for(let s of o)t=r.merge(t,s,this._aggregator);return t}static merge(e,t,o){let s=e,a=t.entries(),i=a.next();for(;i.done!==!0;){let[n,l,c]=i.value;if(e.has(n,c)){let u=e.get(n,c),f=o.merge(u,l);s.set(n,f,c)}else s.set(n,l,c);i=a.next()}return s}static calibrateStartTime(e,t,o){for(let[s,a]of e.keys()){let i=t.get(s,a);i==null||i.setStartTime(o)}return t}}});var Rp,FD=p(()=&gt;{zT();$T();XT();Ml();Rp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t){let o=new Dt;Array.from(e.entries()).forEach(([s,a])=&gt;{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,t)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});function WT(r,e){let t=&quot;&quot;;return r.unit!==e.unit&amp;&amp;(t+=` - Unit &#x27;${r.unit}&#x27; does not match &#x27;${e.unit}&#x27; `),r.type!==e.type&amp;&amp;(t+=` - Type &#x27;${r.type}&#x27; does not match &#x27;${e.type}&#x27; `),r.valueType!==e.valueType&amp;&amp;(t+=` - Value Type &#x27;${r.valueType}&#x27; does not match &#x27;${e.valueType}&#x27; `),r.description!==e.description&amp;&amp;(t+=` - Description &#x27;${r.description}&#x27; does not match &#x27;${e.description}&#x27; `),t}function hte(r,e){return` - use valueType &#x27;${r.valueType}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function _te(r,e){return` - use unit &#x27;${r.unit}&#x27; on instrument creation or use an instrument name other than &#x27;${e.name}&#x27;`}function Ete(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27;`}function mte(r,e){let t={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(t);return` - create a new view with a name other than &#x27;${r.name}&#x27; and InstrumentSelector &#x27;${o}&#x27; - OR - create a new view with the name ${r.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o} - OR - create a new view with the name ${e.name} and description &#x27;${r.description}&#x27; and InstrumentSelector ${o}`}function JT(r,e){return r.valueType!==e.valueType?hte(r,e):r.unit!==e.unit?_te(r,e):r.type!==e.type?Ete(r,e):r.description!==e.description?mte(r,e):&quot;&quot;}var GD=p(()=&gt;{});var Np,HD=p(()=&gt;{fn();P();GD();Np=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let s of this._sharedRegistry.values())t=t.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())t=t.concat(s);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let o=this._perCollectorRegistry.get(e);o==null&amp;&amp;(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(t,o)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(t.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(t,s)}_registerStorage(e,t){let o=e.getInstrumentDescriptor(),s=t.get(o.name);if(s===void 0){t.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,t){let o=null;for(let s of t){let a=s.getInstrumentDescriptor();$1(a,e)?(a.description!==e.description&amp;&amp;(e.description.length&gt;a.description.length&amp;&amp;s.updateDescription(e.description),S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered, but has a different description and is incompatible with another registered view. `,`Details: `,WT(a,e),`The longer description will be used. To resolve the conflict:`,JT(a,e))),o=s):S.warn(&quot;A view or instrument with the name &quot;,e.name,` has already been registered and is incompatible with another registered view. `,`Details: `,WT(a,e),`To resolve the conflict: `,JT(a,e))}return o}}});var Cp,qD=p(()=&gt;{Cp=class{constructor(e){this._backingStorages=e}record(e,t,o,s){this._backingStorages.forEach(a=&gt;{a.record(e,t,o,s)})}}});var Pp,Ip,jD=p(()=&gt;{P();Ml();Op();Pp=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new Dt}observe(e,t={}){if(typeof e!=&quot;number&quot;){S.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ot.INT&amp;&amp;!Number.isInteger(e)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Ip=class{constructor(){this._buffer=new Map}observe(e,t,o={}){if(!xl(e))return;let s=this._buffer.get(e);if(s==null&amp;&amp;(s=new Dt,this._buffer.set(e,s)),typeof t!=&quot;number&quot;){S.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ot.INT&amp;&amp;!Number.isInteger(t)&amp;&amp;(S.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||s.set(o,t)}}});var bp,YD=p(()=&gt;{P();Op();jD();fr();bp=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)&gt;=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let o=this._findCallback(e,t);o&lt;0||this._callbacks.splice(o,1)}addBatchCallback(e,t){let o=new Set(t.filter(xl));if(o.size===0){S.error(&quot;BatchObservableCallback is not associated with valid instruments&quot;,t);return}this._findBatchCallback(e,o)&gt;=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,t){let o=new Set(t.filter(xl)),s=this._findBatchCallback(e,o);s&lt;0||this._batchCallbacks.splice(s,1)}async observe(e,t){let o=this._observeCallbacks(e,t),s=this._observeBatchCallbacks(e,t);return(await G1([...o,...s])).filter(H1).map(n=&gt;n.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:o,instrument:s})=&gt;{let a=new Pp(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s._metricStorages.forEach(n=&gt;{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:o,instruments:s})=&gt;{let a=new Ip,i=Promise.resolve(o(a));t!=null&amp;&amp;(i=wn(i,t)),await i,s.forEach(n=&gt;{let l=a._buffer.get(n);l!=null&amp;&amp;n._metricStorages.forEach(c=&gt;{c.record(l,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(o=&gt;o.callback===e&amp;&amp;o.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(o=&gt;o.callback===e&amp;&amp;q1(o.instruments,t))}}});var Lp,zD=p(()=&gt;{zT();$T();XT();Lp=class extends ds{constructor(e,t,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new hs(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new _s(t,s)}record(e,t,o,s){t=this._attributesProcessor.process(t,o),this._deltaMetricStorage.record(e,t,o,s)}collect(e,t){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,t)}}});var Bn,QT,xp,Tte,ZT=p(()=&gt;{Bn=class{static Noop(){return Tte}},QT=class extends Bn{process(e,t){return e}},xp=class extends Bn{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let o={};return Object.keys(e).filter(s=&gt;this._allowedAttributeNames.includes(s)).forEach(s=&gt;o[s]=e[s]),o}},Tte=new QT});var Mp,KD=p(()=&gt;{fn();VD();fr();FD();HD();qD();YD();zD();ZT();Mp=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new Np,this.observableRegistry=new bp,this.meter=new Ap(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,Lp);return t.length===1?t[0]:new Cp(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Rp)}async collect(e,t,o){let s=await this.observableRegistry.observe(t,o==null?void 0:o.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=&gt;n.collect(e,t)).filter(V1);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,t){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=&gt;{let i=K1(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let l=a.aggregation.createAggregator(i),c=new t(i,l,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,l])=&gt;{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(c!=null)return c;let u=l.createAggregator(e),f=n.selectCardinalityLimit(e.type),_=new t(e,u,Bn.Noop(),[n],f);return this.metricStorageRegistry.registerForCollector(n,_),_});s=s.concat(i)}return s}}});var wp,$D=p(()=&gt;{fr();BD();KD();wp=class{constructor(e){this.resource=e,this.viewRegistry=new _p,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=F1(e),o=this.meterSharedStates.get(t);return o==null&amp;&amp;(o=new Mp(this,e),this.meterSharedStates.set(t,o)),o}selectAggregations(e){let t=[];for(let o of this.metricCollectors)t.push([o,o.selectAggregation(e)]);return t}}});var Dp,XD=p(()=&gt;{Dn();Dp=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=Mi(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=&gt;{let n=await i.collect(this,t,e);(n==null?void 0:n.scopeMetrics)!=null&amp;&amp;o.push(n.scopeMetrics),(n==null?void 0:n.errors)!=null&amp;&amp;s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,o,s;return(s=(o=(t=this._metricReader).selectCardinalityLimit)===null||o===void 0?void 0:o.call(t,e))!==null&amp;&amp;s!==void 0?s:2e3}}});function Ste(r,e){let t=e??kn.empty();return r?kn.default().merge(t):t}var Up,WD=p(()=&gt;{P();kD();$D();XD();Up=class{constructor(e){var t;if(this._shutdown=!1,this._sharedState=new wp(Ste((t=e==null?void 0:e.mergeResourceWithDefaults)!==null&amp;&amp;t!==void 0?t:!0,e==null?void 0:e.resource)),(e==null?void 0:e.views)!=null&amp;&amp;e.views.length&gt;0)for(let o of e.views)this._sharedState.viewRegistry.addView(o);if((e==null?void 0:e.readers)!=null&amp;&amp;e.readers.length&gt;0)for(let o of e.readers)this.addMetricReader(o)}getMeter(e,t=&quot;&quot;,o={}){return this._shutdown?(S.warn(&quot;A shutdown MeterProvider cannot provide a Meter&quot;),ku()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:o.schemaUrl}).meter}addMetricReader(e){let t=new Dp(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){S.warn(&quot;shutdown may only be called once per MeterProvider&quot;);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.shutdown(e)))}async forceFlush(e){if(this._shutdown){S.warn(&quot;invalid attempt to force flush after MeterProvider shutdown&quot;);return}await Promise.all(this._sharedState.metricCollectors.map(t=&gt;t.forceFlush(e)))}}});var gte,Es,Vn,kp=p(()=&gt;{gte=/[\^$\\.+?()[\]{}|]/g,Es=class r{constructor(e){e===&quot;*&quot;?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(gte,&quot;\\$&amp;&quot;).replace(&quot;*&quot;,&quot;.*&quot;)}$`}static hasWildcard(e){return e.includes(&quot;*&quot;)}},Vn=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Bp,JD=p(()=&gt;{kp();Bp=class{constructor(e){var t;this._nameFilter=new Es((t=e==null?void 0:e.name)!==null&amp;&amp;t!==void 0?t:&quot;*&quot;),this._type=e==null?void 0:e.type,this._unitFilter=new Vn(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Vp,QD=p(()=&gt;{kp();Vp=class{constructor(e){this._nameFilter=new Vn(e==null?void 0:e.name),this._versionFilter=new Vn(e==null?void 0:e.version),this._schemaUrlFilter=new Vn(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function vte(r){return r.instrumentName==null&amp;&amp;r.instrumentType==null&amp;&amp;r.instrumentUnit==null&amp;&amp;r.meterName==null&amp;&amp;r.meterVersion==null&amp;&amp;r.meterSchemaUrl==null}var Fp,ZD=p(()=&gt;{kp();ZT();JD();QD();cp();Fp=class{constructor(e){var t;if(vte(e))throw new Error(&quot;Cannot create view with no selector arguments supplied&quot;);if(e.name!=null&amp;&amp;((e==null?void 0:e.instrumentName)==null||Es.hasWildcard(e.instrumentName)))throw new Error(&quot;Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.&quot;);e.attributeKeys!=null?this.attributesProcessor=new xp(e.attributeKeys):this.attributesProcessor=Bn.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&amp;&amp;t!==void 0?t:mt.Default(),this.instrumentSelector=new Bp({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Vp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var eS={};Ae(eS,{Aggregation:()=&gt;mt,AggregationTemporality:()=&gt;ur,ConsoleMetricExporter:()=&gt;dp,DataPointType:()=&gt;lt,DefaultAggregation:()=&gt;Ll,DropAggregation:()=&gt;as,ExplicitBucketHistogramAggregation:()=&gt;Il,ExponentialHistogramAggregation:()=&gt;bl,HistogramAggregation:()=&gt;cs,InMemoryMetricExporter:()=&gt;pp,InstrumentType:()=&gt;_e,LastValueAggregation:()=&gt;ls,MeterProvider:()=&gt;Up,MetricReader:()=&gt;us,PeriodicExportingMetricReader:()=&gt;fp,SumAggregation:()=&gt;wi,TimeoutError:()=&gt;Li,View:()=&gt;Fp});var Gp=p(()=&gt;{Zf();Zo();YT();bD();LD();xD();fn();WD();cp();ZD();fr()});var rS=T(Hp=&gt;{&quot;use strict&quot;;Object.defineProperty(Hp,&quot;__esModule&quot;,{value:!0});Hp.AbstractAsyncHooksContextManager=void 0;var yte=V(&quot;events&quot;),Ote=[&quot;addListener&quot;,&quot;on&quot;,&quot;once&quot;,&quot;prependListener&quot;,&quot;prependOnceListener&quot;],tS=class{constructor(){this._kOtListeners=Symbol(&quot;OtListeners&quot;),this._wrapped=!1}bind(e,t){return t instanceof yte.EventEmitter?this._bindEventEmitter(e,t):typeof t==&quot;function&quot;?this._bindFunction(e,t):t}_bindFunction(e,t){let o=this,s=function(...a){return o.with(e,()=&gt;t.apply(this,a))};return Object.defineProperty(s,&quot;length&quot;,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),s}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),Ote.forEach(s=&gt;{t[s]!==void 0&amp;&amp;(t[s]=this._patchAddListener(t,t[s],e))}),typeof t.removeListener==&quot;function&quot;&amp;&amp;(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off==&quot;function&quot;&amp;&amp;(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners==&quot;function&quot;&amp;&amp;(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let o=this;return function(s,a){var i;let n=(i=o._getPatchMap(e))===null||i===void 0?void 0:i[s];if(n===void 0)return t.call(this,s,a);let l=n.get(a);return t.call(this,s,l||a)}}_patchRemoveAllListeners(e,t){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&amp;&amp;(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&amp;&amp;delete a[s]),t.apply(this,arguments)}}_patchAddListener(e,t,o){let s=this;return function(a,i){if(s._wrapped)return t.call(this,a,i);let n=s._getPatchMap(e);n===void 0&amp;&amp;(n=s._createPatchMap(e));let l=n[a];l===void 0&amp;&amp;(l=new WeakMap,n[a]=l);let c=s.bind(o,i);l.set(i,c),s._wrapped=!0;try{return t.call(this,a,c)}finally{s._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Hp.AbstractAsyncHooksContextManager=tS});var eU=T(qp=&gt;{&quot;use strict&quot;;Object.defineProperty(qp,&quot;__esModule&quot;,{value:!0});qp.AsyncHooksContextManager=void 0;var Ate=(P(),ee(ot)),Rte=V(&quot;async_hooks&quot;),Nte=rS(),nS=class extends Nte.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=Rte.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&amp;&amp;e!==void 0?e:Ate.ROOT_CONTEXT}with(e,t,o,...s){this._enterContext(e);try{return t.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t===&quot;TIMERWRAP&quot;)return;let o=this._stack[this._stack.length-1];o!==void 0&amp;&amp;this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);t!==void 0&amp;&amp;this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};qp.AsyncHooksContextManager=nS});var tU=T(jp=&gt;{&quot;use strict&quot;;Object.defineProperty(jp,&quot;__esModule&quot;,{value:!0});jp.AsyncLocalStorageContextManager=void 0;var Cte=(P(),ee(ot)),Pte=V(&quot;async_hooks&quot;),Ite=rS(),iS=class extends Ite.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new Pte.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&amp;&amp;e!==void 0?e:Cte.ROOT_CONTEXT}with(e,t,o,...s){let a=o==null?t:t.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};jp.AsyncLocalStorageContextManager=iS});var rU=T(ms=&gt;{&quot;use strict&quot;;Object.defineProperty(ms,&quot;__esModule&quot;,{value:!0});ms.AsyncLocalStorageContextManager=ms.AsyncHooksContextManager=void 0;var bte=eU();Object.defineProperty(ms,&quot;AsyncHooksContextManager&quot;,{enumerable:!0,get:function(){return bte.AsyncHooksContextManager}});var Lte=tU();Object.defineProperty(ms,&quot;AsyncLocalStorageContextManager&quot;,{enumerable:!0,get:function(){return Lte.AsyncLocalStorageContextManager}})});var Ts,oS=p(()=&gt;{P();Ts=De(&quot;OpenTelemetry Context Key B3 Debug Flag&quot;)});var Ss,gs,vs,ys,Yp,Os,sS=p(()=&gt;{Ss=&quot;b3&quot;,gs=&quot;x-b3-traceid&quot;,vs=&quot;x-b3-spanid&quot;,ys=&quot;x-b3-sampled&quot;,Yp=&quot;x-b3-parentspanid&quot;,Os=&quot;x-b3-flags&quot;});function wte(r){return r===se.SAMPLED||r===se.NONE}function Dte(r){return Array.isArray(r)?r[0]:r}function Kp(r,e,t){let o=e.get(r,t);return Dte(o)}function Ute(r,e){let t=Kp(r,e,gs);return typeof t==&quot;string&quot;?t.padStart(32,&quot;0&quot;):&quot;&quot;}function kte(r,e){let t=Kp(r,e,vs);return typeof t==&quot;string&quot;?t:&quot;&quot;}function nU(r,e){return Kp(r,e,Os)===&quot;1&quot;?&quot;1&quot;:void 0}function Bte(r,e){let t=Kp(r,e,ys);if(nU(r,e)===&quot;1&quot;||xte.has(t))return se.SAMPLED;if(t===void 0||Mte.has(t))return se.NONE}var xte,Mte,zp,iU=p(()=&gt;{P();xr();oS();sS();xte=new Set([!0,&quot;true&quot;,&quot;True&quot;,&quot;1&quot;,1]),Mte=new Set([!1,&quot;false&quot;,&quot;False&quot;,&quot;0&quot;,0]);zp=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts);o.set(t,gs,s.traceId),o.set(t,vs,s.spanId),a===&quot;1&quot;?o.set(t,Os,a):s.traceFlags!==void 0&amp;&amp;o.set(t,ys,(se.SAMPLED&amp;s.traceFlags)===se.SAMPLED?&quot;1&quot;:&quot;0&quot;)}extract(e,t,o){let s=Ute(t,o),a=kte(t,o),i=Bte(t,o),n=nU(t,o);return Mt(s)&amp;&amp;Si(a)&amp;&amp;wte(i)?(e=e.setValue(Ts,n),ie.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[gs,vs,Os,ys,Yp]}}});function qte(r){return r.length===32?r:`${Fte}${r}`}function jte(r){return r&amp;&amp;Gte.has(r)?se.SAMPLED:se.NONE}var Vte,Fte,Gte,Hte,$p,oU=p(()=&gt;{P();xr();oS();Vte=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Fte=&quot;0&quot;.repeat(16),Gte=new Set([&quot;d&quot;,&quot;1&quot;]),Hte=&quot;d&quot;;$p=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||!xe(s)||At(e))return;let a=e.getValue(Ts)||s.traceFlags&amp;1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(t,&quot;b3&quot;,i)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;),a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=a.match(Vte);if(!i)return e;let[,n,l,c]=i,u=qte(n);if(!Mt(u)||!Si(l))return e;let f=jte(c);return c===Hte&amp;&amp;(e=e.setValue(Ts,c)),ie.setSpanContext(e,{traceId:u,spanId:l,isRemote:!0,traceFlags:f})}fields(){return[&quot;b3&quot;]}}});var As,aS=p(()=&gt;{(function(r){r[r.SINGLE_HEADER=0]=&quot;SINGLE_HEADER&quot;,r[r.MULTI_HEADER=1]=&quot;MULTI_HEADER&quot;})(As||(As={}))});var Xp,sU=p(()=&gt;{xr();iU();oU();aS();Xp=class{constructor(e={}){this._b3MultiPropagator=new zp,this._b3SinglePropagator=new $p,e.injectEncoding===As.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,t,o){At(e)||this._inject(e,t,o)}extract(e,t,o){let s=o.get(t,&quot;b3&quot;);return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,t,o):this._b3MultiPropagator.extract(e,t,o)}fields(){return this._fields}}});var aU={};Ae(aU,{B3InjectEncoding:()=&gt;As,B3Propagator:()=&gt;Xp,B3_CONTEXT_HEADER:()=&gt;Ss,X_B3_FLAGS:()=&gt;Os,X_B3_PARENT_SPAN_ID:()=&gt;Yp,X_B3_SAMPLED:()=&gt;ys,X_B3_SPAN_ID:()=&gt;vs,X_B3_TRACE_ID:()=&gt;gs});var lU=p(()=&gt;{sU();sS();aS()});function wl(r){return r.setValue(cU,!0)}function Di(r){return r.getValue(cU)===!0}var cU,Dl=p(()=&gt;{P();cU=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var Wp,uU=p(()=&gt;{Wp=&quot;baggage&quot;});function pU(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function dU(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function hU(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}var _U=p(()=&gt;{P()});var Ul,EU=p(()=&gt;{P();Dl();uU();_U();Ul=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||Di(e))return;let a=dU(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=pU(a);i.length&gt;0&amp;&amp;o.set(t,Wp,i)}extract(e,t,o){let s=o.get(t,Wp),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=hU(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[Wp]}}});function Ui(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!mU(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!Jp(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function mU(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function Jp(r){return r==null?!0:Array.isArray(r)?Kte(r):TU(r)}function Kte(r){let e;for(let t of r)if(t!=null){if(!e){if(TU(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function TU(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var SU=p(()=&gt;{P()});function gU(){return r=&gt;{S.error($te(r))}}function $te(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Xte(r))}function Xte(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var vU=p(()=&gt;{P()});function Kt(r){try{Wte(r)}catch{}}var Wte,yU=p(()=&gt;{vU();Wte=gU()});var Ut,cS=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(Ut||(Ut={}))});function Zte(r){return Qte.indexOf(r)&gt;-1}function tre(r){return ere.indexOf(r)&gt;-1}function nre(r){return rre.indexOf(r)&gt;-1}function ire(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function ore(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sre(r,e,t,o=Jte){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lre(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=are[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function Zp(r){let e={};for(let t in Qp){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lre(o,e,r);break;default:if(Zte(o))ire(o,e,r);else if(tre(o))ore(o,e,r);else if(nre(o))sre(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jte,Qte,ere,rre,Rs,Ns,OU,AU,Qp,are,uS=p(()=&gt;{P();cS();Jte=&quot;,&quot;,Qte=[&quot;OTEL_SDK_DISABLED&quot;];ere=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rre=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];Rs=1/0,Ns=128,OU=128,AU=128,Qp={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rs,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ns,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:OU,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:AU,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:Ut.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};are={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function $t(){let r=Zp(process.env);return Object.assign({},Qp,r)}function kl(){return Zp(process.env)}var RU=p(()=&gt;{uS()});import{performance as cre}from&quot;perf_hooks&quot;;var dr,NU=p(()=&gt;{dr=cre});var CU,PU=p(()=&gt;{CU=&quot;1.29.0&quot;});var ki,IU=p(()=&gt;{PU();Ve();ki={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:CU}});function Bl(r){r.unref()}var bU=p(()=&gt;{});var LU=p(()=&gt;{RU();NU();IU();bU()});var fS=p(()=&gt;{LU()});function Fn(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*_re);return[t,o]}function ed(){let r=dr.timeOrigin;if(typeof r!=&quot;number&quot;){let e=dr;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function dS(r){let e=Fn(ed()),t=Fn(typeof r==&quot;number&quot;?r:dr.now());return id(e,t)}function hS(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=pS),[t,o]}function td(r){return r[0]*1e6+r[1]/1e3}function rd(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function nd(r){return rd(r)||typeof r==&quot;number&quot;||r instanceof Date}function id(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=pS&amp;&amp;(t[1]-=pS,t[0]+=1),t}var dre,hre,_re,pS,xU=p(()=&gt;{fS();dre=9,hre=6,_re=Math.pow(10,hre),pS=Math.pow(10,dre)});var Xt,MU=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Xt||(Xt={}))});var Vl,wU=p(()=&gt;{P();Vl=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function DU(r){return Tre.test(r)}function UU(r){return Sre.test(r)&amp;&amp;!gre.test(r)}var _S,Ere,mre,Tre,Sre,gre,kU=p(()=&gt;{_S=&quot;[_0-9a-z-*/]&quot;,Ere=`[a-z]${_S}{0,255}`,mre=`[a-z0-9]${_S}{0,240}@[a-z]${_S}{0,13}`,Tre=new RegExp(`^(?:${Ere}|${mre})$`),Sre=/^[ -~]{0,255}[!-~]$/,gre=/,|=/});var BU,vre,VU,FU,od,GU=p(()=&gt;{kU();BU=32,vre=512,VU=&quot;,&quot;,FU=&quot;=&quot;,od=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+FU+this.get(t)),e),[]).join(VU)}_parse(e){e.length&gt;vre||(this._internalState=e.split(VU).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(FU);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);DU(i)&amp;&amp;UU(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;BU&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function HU(r){let e=Cre.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sd,ad,yre,Ore,Are,Rre,Nre,Cre,Fl,qU=p(()=&gt;{P();Dl();GU();sd=&quot;traceparent&quot;,ad=&quot;tracestate&quot;,yre=&quot;00&quot;,Ore=&quot;(?!ff)[\\da-f]{2}&quot;,Are=&quot;(?![0]{32})[\\da-f]{32}&quot;,Rre=&quot;(?![0]{16})[\\da-f]{16}&quot;,Nre=&quot;[\\da-f]{2}&quot;,Cre=new RegExp(`^\\s?(${Ore})-(${Are})-(${Rre})-(${Nre})(-.*)?\\s?$`);Fl=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||Di(e)||!xe(s))return;let a=`${yre}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,sd,a),s.traceState&amp;&amp;o.set(t,ad,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,sd);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=HU(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,ad);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new od(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[sd,ad]}}});function wre(r,e){return function(t){return r(e(t))}}function ES(r){if(!Dre(r)||Ure(r)!==Pre)return!1;let e=Mre(r);if(e===null)return!0;let t=zU.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;jU.call(t)===xre}function Dre(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function Ure(r){return r==null?r===void 0?bre:Ire:Bi&amp;&amp;Bi in Object(r)?kre(r):Bre(r)}function kre(r){let e=zU.call(r,Bi),t=r[Bi],o=!1;try{r[Bi]=void 0,o=!0}catch{}let s=KU.call(r);return o&amp;&amp;(e?r[Bi]=t:delete r[Bi]),s}function Bre(r){return KU.call(r)}var Pre,Ire,bre,Lre,jU,xre,Mre,YU,zU,Bi,KU,$U=p(()=&gt;{Pre=&quot;[object Object]&quot;,Ire=&quot;[object Null]&quot;,bre=&quot;[object Undefined]&quot;,Lre=Function.prototype,jU=Lre.toString,xre=jU.call(Object),Mre=wre(Object.getPrototypeOf,Object),YU=Object.prototype,zU=YU.hasOwnProperty,Bi=Symbol?Symbol.toStringTag:void 0,KU=YU.toString});function TS(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=WU(e,r.shift(),0,t);return e}function mS(r){return cd(r)?r.slice():r}function WU(r,e,t=0,o){let s;if(!(t&gt;Vre)){if(t++,ld(r)||ld(e)||JU(e))s=mS(e);else if(cd(r)){if(s=r.slice(),cd(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(mS(e[a]));else if(Gl(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=mS(e[l])}}}else if(Gl(r))if(Gl(e)){if(!Fre(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(ld(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(XU(r,l,o)||XU(e,l,o))delete s[l];else{if(Gl(u)&amp;&amp;Gl(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=WU(s[l],c,t,o)}}}}else s=e;return s}}function XU(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function cd(r){return Array.isArray(r)}function JU(r){return typeof r==&quot;function&quot;}function Gl(r){return!ld(r)&amp;&amp;!cd(r)&amp;&amp;!JU(r)&amp;&amp;typeof r==&quot;object&quot;}function ld(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function Fre(r,e){return!(!ES(r)||!ES(e))}var Vre,QU=p(()=&gt;{$U();Vre=20});var ud,ZU=p(()=&gt;{ud=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Vi,ek=p(()=&gt;{ZU();Vi=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new ud}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function tk(r,e){return new Promise(t=&gt;{he.with(wl(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var rk=p(()=&gt;{P();Dl()});var nk,kt=p(()=&gt;{EU();SU();yU();xU();MU();fS();wU();qU();Dl();uS();QU();cS();ek();rk();nk={_export:tk}});var ik,ok=p(()=&gt;{ik=&quot;exception&quot;});var Cs,SS=p(()=&gt;{P();kt();Ve();ok();Cs=class{constructor(e,t,o,s,a,i,n=[],l,c,u){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:jt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=o,this._spanContext=s,this.parentSpanId=i,this.kind=a,this.links=n;let f=Date.now();this._performanceStartTime=dr.now(),this._performanceOffset=f-(this._performanceStartTime+ed()),this._startTimeProvided=l!=null,this.startTime=this._getTime(l??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,u!=null&amp;&amp;this.setAttributes(u),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t)}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(S.warn(`Invalid attribute key: ${e}`),this):Jp(t)?Object.keys(this.attributes).length&gt;=this._spanLimits.attributeCountLimit&amp;&amp;!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(S.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,o]of Object.entries(e))this.setAttribute(t,o);return this}addEvent(e,t,o){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return S.warn(&quot;No events allowed.&quot;),this._droppedEventsCount++,this;this.events.length&gt;=this._spanLimits.eventCountLimit&amp;&amp;(this._droppedEventsCount===0&amp;&amp;S.debug(&quot;Dropping extra events.&quot;),this.events.shift(),this._droppedEventsCount++),nd(t)&amp;&amp;(nd(o)||(o=t),t=void 0);let s=Ui(t);return this.events.push({name:e,attributes:s,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&amp;&amp;typeof e.message!=&quot;string&quot;&amp;&amp;(S.warn(`Dropping invalid status.message of type &#x27;${typeof e.message}&#x27;, expected &#x27;string&#x27;`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){S.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hS(this.startTime,this.endTime),this._duration[0]&lt;0&amp;&amp;(S.warn(&quot;Inconsistent start and end time, startTime &gt; endTime. Setting span duration to 0ms.&quot;,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount&gt;0&amp;&amp;S.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==&quot;number&quot;&amp;&amp;e&lt;=dr.now())return dS(e+this._performanceOffset);if(typeof e==&quot;number&quot;)return Fn(e);if(e instanceof Date)return Fn(e.getTime());if(rd(e))return e;if(this._startTimeProvided)return Fn(Date.now());let t=dr.now()-this._performanceStartTime;return id(this.startTime,Fn(t))}isRecording(){return this._ended===!1}recordException(e,t){let o={};typeof e==&quot;string&quot;?o[Wa]=e:e&amp;&amp;(e.code?o[Xa]=e.code.toString():e.name&amp;&amp;(o[Xa]=e.name),e.message&amp;&amp;(o[Wa]=e.message),e.stack&amp;&amp;(o[Um]=e.stack)),o[Xa]||o[Wa]?this.addEvent(ik,o,t):S.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&amp;&amp;S.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length&lt;=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t&lt;=0?(S.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==&quot;string&quot;?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(o=&gt;typeof o==&quot;string&quot;?this._truncateToLimitUtil(o,t):o):e}}});var hr,Hl=p(()=&gt;{(function(r){r[r.NOT_RECORD=0]=&quot;NOT_RECORD&quot;,r[r.RECORD=1]=&quot;RECORD&quot;,r[r.RECORD_AND_SAMPLED=2]=&quot;RECORD_AND_SAMPLED&quot;})(hr||(hr={}))});var Ur,fd=p(()=&gt;{Hl();Ur=class{shouldSample(){return{decision:hr.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var Wt,pd=p(()=&gt;{Hl();Wt=class{shouldSample(){return{decision:hr.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var Gn,gS=p(()=&gt;{P();kt();fd();pd();Gn=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(Kt(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new Wt),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new Wt,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Ur,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new Wt,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Ur}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var Fi,vS=p(()=&gt;{P();Hl();Fi=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?hr.RECORD_AND_SAMPLED:hr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function dd(){let r=$t();return{sampler:yS(Gre),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:r.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:r.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:r.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:r.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:r.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:r.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function yS(r=$t()){switch(r.OTEL_TRACES_SAMPLER){case Ut.AlwaysOn:return new Wt;case Ut.AlwaysOff:return new Ur;case Ut.ParentBasedAlwaysOn:return new Gn({root:new Wt});case Ut.ParentBasedAlwaysOff:return new Gn({root:new Ur});case Ut.TraceIdRatio:return new Fi(sk(r));case Ut.ParentBasedTraceIdRatio:return new Gn({root:new Fi(sk(r))});default:return S.error(`OTEL_TRACES_SAMPLER value &quot;${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hre}&quot;.`),new Wt}}function sk(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG===&quot;&quot;)return S.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ps}.`),Ps;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ps}.`),Ps):e&lt;0||e&gt;1?(S.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ps}.`),Ps):e}var Gre,Hre,Ps,OS=p(()=&gt;{P();kt();fd();pd();gS();vS();Gre=$t(),Hre=Ut.AlwaysOn,Ps=1});function ak(r){let e={sampler:yS()},t=dd(),o=Object.assign({},t,e,r);return o.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),o.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),o}function lk(r){var e,t,o,s,a,i,n,l,c,u,f,_;let m=Object.assign({},r.spanLimits),O=kl();return m.attributeCountLimit=(i=(a=(s=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&amp;&amp;t!==void 0?t:(o=r.generalLimits)===null||o===void 0?void 0:o.attributeCountLimit)!==null&amp;&amp;s!==void 0?s:O.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;a!==void 0?a:O.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&amp;&amp;i!==void 0?i:Ns,m.attributeValueLengthLimit=(_=(f=(u=(l=(n=r.spanLimits)===null||n===void 0?void 0:n.attributeValueLengthLimit)!==null&amp;&amp;l!==void 0?l:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&amp;&amp;u!==void 0?u:O.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;f!==void 0?f:O.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&amp;&amp;_!==void 0?_:Rs,Object.assign({},r,{spanLimits:m})}var AS=p(()=&gt;{OS();kt()});var hd,ck=p(()=&gt;{P();kt();hd=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let o=$t();this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==&quot;number&quot;?t.maxExportBatchSize:o.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==&quot;number&quot;?t.maxQueueSize:o.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==&quot;number&quot;?t.scheduledDelayMillis:o.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==&quot;number&quot;?t.exportTimeoutMillis:o.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Vi(this._shutdown,this),this._maxExportBatchSize&gt;this._maxQueueSize&amp;&amp;(S.warn(&quot;BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize&quot;),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)!==0&amp;&amp;this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=&gt;this.onShutdown()).then(()=&gt;this._flushAll()).then(()=&gt;this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length&gt;=this._maxQueueSize){this._droppedSpansCount===0&amp;&amp;S.debug(&quot;maxQueueSize reached, dropping spans&quot;),this._droppedSpansCount++;return}this._droppedSpansCount&gt;0&amp;&amp;(S.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=&gt;{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a&lt;i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=&gt;{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=&gt;{let o=setTimeout(()=&gt;{t(new Error(&quot;Timeout&quot;))},this._exportTimeoutMillis);he.with(wl(he.active()),()=&gt;{let s;this._finishedSpans.length&lt;=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=&gt;this._exporter.export(s,n=&gt;{var l;clearTimeout(o),n.code===Xt.SUCCESS?e():t((l=n.error)!==null&amp;&amp;l!==void 0?l:new Error(&quot;BatchSpanProcessor: span export failed&quot;))}),i=null;for(let n=0,l=s.length;n&lt;l;n++){let c=s[n];c.resource.asyncAttributesPending&amp;&amp;c.resource.waitForAsyncAttributes&amp;&amp;(i??(i=[]),i.push(c.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=&gt;{Kt(n),t(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=&gt;{this._isExporting=!0,this._flushOneBatch().finally(()=&gt;{this._isExporting=!1,this._finishedSpans.length&gt;0&amp;&amp;(this._clearTimer(),this._maybeStartTimer())}).catch(t=&gt;{this._isExporting=!1,Kt(t)})};if(this._finishedSpans.length&gt;=this._maxExportBatchSize)return e();this._timer===void 0&amp;&amp;(this._timer=setTimeout(()=&gt;e(),this._scheduledDelayMillis),Bl(this._timer))}_clearTimer(){this._timer!==void 0&amp;&amp;(clearTimeout(this._timer),this._timer=void 0)}}});var Hn,uk=p(()=&gt;{ck();Hn=class extends hd{onShutdown(){}}});function fk(r){return function(){for(let t=0;t&lt;r/4;t++)_d.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(_d[t]&gt;0);t++)t===r-1&amp;&amp;(_d[r-1]=1);return _d.toString(&quot;hex&quot;,0,r)}}var qn,_d,pk=p(()=&gt;{qn=class{constructor(){this.generateTraceId=fk(16),this.generateSpanId=fk(8)}},_d=Buffer.allocUnsafe(16)});var dk=p(()=&gt;{uk();pk()});var Ed=p(()=&gt;{dk()});var Is,hk=p(()=&gt;{P();kt();SS();AS();Ed();Is=class{constructor(e,t,o){this._tracerProvider=o;let s=ak(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new qn,this.resource=o.resource,this.instrumentationLibrary=e}startSpan(e,t={},o=he.active()){var s,a,i;t.root&amp;&amp;(o=ie.deleteSpan(o));let n=ie.getSpan(o);if(Di(o))return S.debug(&quot;Instrumentation suppressed, returning Noop Span&quot;),ie.wrapSpanContext(Uo);let l=n==null?void 0:n.spanContext(),c=this._idGenerator.generateSpanId(),u,f,_;!l||!ie.isSpanContextValid(l)?u=this._idGenerator.generateTraceId():(u=l.traceId,f=l.traceState,_=l.spanId);let m=(s=t.kind)!==null&amp;&amp;s!==void 0?s:qt.INTERNAL,O=((a=t.links)!==null&amp;&amp;a!==void 0?a:[]).map(z=&gt;({context:z.context,attributes:Ui(z.attributes)})),y=Ui(t.attributes),A=this._sampler.shouldSample(o,u,e,m,y,O);f=(i=A.traceState)!==null&amp;&amp;i!==void 0?i:f;let I=A.decision===ke.RECORD_AND_SAMPLED?se.SAMPLED:se.NONE,M={traceId:u,spanId:c,traceFlags:I,traceState:f};if(A.decision===ke.NOT_RECORD)return S.debug(&quot;Recording is off, propagating context in a non-recording span&quot;),ie.wrapSpanContext(M);let F=Ui(Object.assign(y,A.attributes));return new Cs(this,o,e,M,m,_,O,t.startTime,void 0,F)}startActiveSpan(e,t,o,s){let a,i,n;if(arguments.length&lt;2)return;arguments.length===2?n=t:arguments.length===3?(a=t,n=o):(a=t,i=o,n=s);let l=i??he.active(),c=this.startSpan(e,a,l),u=ie.setSpan(l,c);return he.with(u,n,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}}});function md(){return`unknown_service:${process.argv0}`}var _k=p(()=&gt;{});var Ek=p(()=&gt;{_k()});var mk=p(()=&gt;{Ek()});var jn,Tk=p(()=&gt;{P();Ve();kt();mk();jn=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:md(),[ge]:ki[ge],[Se]:ki[Se],[ve]:ki[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};jn.EMPTY=new jn({})});var Sk=p(()=&gt;{Tk()});var ql,gk=p(()=&gt;{kt();ql=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=&gt;{Promise.all(e).then(()=&gt;{t()}).catch(o=&gt;{Kt(o||new Error(&quot;MultiSpanProcessor: forceFlush failed&quot;)),t()})})}onStart(e,t){for(let o of this._spanProcessors)o.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,o)=&gt;{Promise.all(e).then(()=&gt;{t()},o)})}}});var bs,RS=p(()=&gt;{bs=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}});var pn,Ls,vk=p(()=&gt;{P();kt();Sk();Gi();OS();gk();RS();Ed();AS();(function(r){r[r.resolved=0]=&quot;resolved&quot;,r[r.timeout=1]=&quot;timeout&quot;,r[r.error=2]=&quot;error&quot;,r[r.unresolved=3]=&quot;unresolved&quot;})(pn||(pn={}));Ls=class{constructor(e={}){var t,o;this._registeredSpanProcessors=[],this._tracers=new Map;let s=TS({},dd(),lk(e));if(this.resource=(t=s.resource)!==null&amp;&amp;t!==void 0?t:jn.empty(),s.mergeResourceWithDefaults&amp;&amp;(this.resource=jn.default().merge(this.resource)),this._config=Object.assign({},s,{resource:this.resource}),!((o=e.spanProcessors)===null||o===void 0)&amp;&amp;o.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new ql(this._registeredSpanProcessors);else{let a=this._buildExporterFromEnv();if(a!==void 0){let i=new Hn(a);this.activeSpanProcessor=i}else this.activeSpanProcessor=new bs}}getTracer(e,t,o){let s=`${e}@${t||&quot;&quot;}:${(o==null?void 0:o.schemaUrl)||&quot;&quot;}`;return this._tracers.has(s)||this._tracers.set(s,new Is({name:e,version:t,schemaUrl:o==null?void 0:o.schemaUrl},this._config,this)),this._tracers.get(s)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&amp;&amp;this.activeSpanProcessor.shutdown().catch(t=&gt;S.error(&quot;Error while trying to shutdown current span processor&quot;,t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new ql(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){ie.setGlobalTracerProvider(this),e.propagator===void 0&amp;&amp;(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&amp;&amp;he.setGlobalContextManager(e.contextManager),e.propagator&amp;&amp;Ue.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(o=&gt;new Promise(s=&gt;{let a,i=setTimeout(()=&gt;{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=pn.timeout},e);o.forceFlush().then(()=&gt;{clearTimeout(i),a!==pn.timeout&amp;&amp;(a=pn.resolved,s(a))}).catch(n=&gt;{clearTimeout(i),a=pn.error,s(n)})}));return new Promise((o,s)=&gt;{Promise.all(t).then(a=&gt;{let i=a.filter(n=&gt;n!==pn.resolved);i.length&gt;0?s(i):o()}).catch(a=&gt;s([a]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set($t().OTEL_PROPAGATORS)),o=e.map(s=&gt;{let a=this._getPropagator(s);return a||S.warn(`Propagator &quot;${s}&quot; requested through environment variable is unavailable.`),a}).reduce((s,a)=&gt;(a&amp;&amp;s.push(a),s),[]);if(o.length!==0)return e.length===1?o[0]:new Vl({propagators:o})}_buildExporterFromEnv(){let e=$t().OTEL_TRACES_EXPORTER;if(e===&quot;none&quot;||e===&quot;&quot;)return;let t=this._getSpanExporter(e);return t||S.error(`Exporter &quot;${e}&quot; requested through environment variable is unavailable.`),t}};Ls._registeredPropagators=new Map([[&quot;tracecontext&quot;,()=&gt;new Fl],[&quot;baggage&quot;,()=&gt;new Ul]]);Ls._registeredExporters=new Map});var Td,yk=p(()=&gt;{kt();Td=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:td(e.startTime),duration:td(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(t)return t({code:Xt.SUCCESS})}}});var Sd,Ok=p(()=&gt;{kt();Sd=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Xt.FAILED,error:new Error(&quot;Exporter has been stopped&quot;)});this._finishedSpans.push(...e),setTimeout(()=&gt;t({code:Xt.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}});var gd,Ak=p(()=&gt;{P();kt();gd=class{constructor(e){this._exporter=e,this._shutdownOnce=new Vi(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&amp;&amp;await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,o;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&amp;se.SAMPLED)===0)return;let s=()=&gt;nk._export(this._exporter,[e]).then(a=&gt;{var i;a.code!==Xt.SUCCESS&amp;&amp;Kt((i=a.error)!==null&amp;&amp;i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${a})`))}).catch(a=&gt;{Kt(a)});if(e.resource.asyncAttributesPending){let a=(o=(t=e.resource).waitForAsyncAttributes)===null||o===void 0?void 0:o.call(t).then(()=&gt;(a!=null&amp;&amp;this._unresolvedExports.delete(a),s()),i=&gt;Kt(i));a!=null&amp;&amp;this._unresolvedExports.add(a)}else s()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}});var xs={};Ae(xs,{AlwaysOffSampler:()=&gt;Ur,AlwaysOnSampler:()=&gt;Wt,BasicTracerProvider:()=&gt;Ls,BatchSpanProcessor:()=&gt;Hn,ConsoleSpanExporter:()=&gt;Td,ForceFlushState:()=&gt;pn,InMemorySpanExporter:()=&gt;Sd,NoopSpanProcessor:()=&gt;bs,ParentBasedSampler:()=&gt;Gn,RandomIdGenerator:()=&gt;qn,SamplingDecision:()=&gt;hr,SimpleSpanProcessor:()=&gt;gd,Span:()=&gt;Cs,TraceIdRatioBasedSampler:()=&gt;Fi,Tracer:()=&gt;Is});var Gi=p(()=&gt;{hk();vk();Ed();yk();Ok();Ak();RS();fd();pd();gS();vS();Hl();SS()});var jl=T((a1e,Rk)=&gt;{&quot;use strict&quot;;var qre=&quot;2.0.0&quot;,jre=Number.MAX_SAFE_INTEGER||9007199254740991,Yre=16,zre=250,Kre=[&quot;major&quot;,&quot;premajor&quot;,&quot;minor&quot;,&quot;preminor&quot;,&quot;patch&quot;,&quot;prepatch&quot;,&quot;prerelease&quot;];Rk.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Yre,MAX_SAFE_BUILD_LENGTH:zre,MAX_SAFE_INTEGER:jre,RELEASE_TYPES:Kre,SEMVER_SPEC_VERSION:qre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yl=T((l1e,Nk)=&gt;{&quot;use strict&quot;;var $re=typeof process==&quot;object&quot;&amp;&amp;process.env&amp;&amp;process.env.NODE_DEBUG&amp;&amp;/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=&gt;console.error(&quot;SEMVER&quot;,...r):()=&gt;{};Nk.exports=$re});var Ms=T((kr,Ck)=&gt;{&quot;use strict&quot;;var{MAX_SAFE_COMPONENT_LENGTH:NS,MAX_SAFE_BUILD_LENGTH:Xre,MAX_LENGTH:Wre}=jl(),Jre=Yl();kr=Ck.exports={};var Qre=kr.re=[],Zre=kr.safeRe=[],D=kr.src=[],ene=kr.safeSrc=[],U=kr.t={},tne=0,CS=&quot;[a-zA-Z0-9-]&quot;,rne=[[&quot;\\s&quot;,1],[&quot;\\d&quot;,Wre],[CS,Xre]],nne=r=&gt;{for(let[e,t]of rne)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},re=(r,e,t)=&gt;{let o=nne(e),s=tne++;Jre(r,s,e),U[r]=s,D[s]=e,ene[s]=o,Qre[s]=new RegExp(e,t?&quot;g&quot;:void 0),Zre[s]=new RegExp(o,t?&quot;g&quot;:void 0)};re(&quot;NUMERICIDENTIFIER&quot;,&quot;0|[1-9]\\d*&quot;);re(&quot;NUMERICIDENTIFIERLOOSE&quot;,&quot;\\d+&quot;);re(&quot;NONNUMERICIDENTIFIER&quot;,`\\d*[a-zA-Z-]${CS}*`);re(&quot;MAINVERSION&quot;,`(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})\\.(${D[U.NUMERICIDENTIFIER]})`);re(&quot;MAINVERSIONLOOSE&quot;,`(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})\\.(${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASEIDENTIFIER&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIER]})`);re(&quot;PRERELEASEIDENTIFIERLOOSE&quot;,`(?:${D[U.NONNUMERICIDENTIFIER]}|${D[U.NUMERICIDENTIFIERLOOSE]})`);re(&quot;PRERELEASE&quot;,`(?:-(${D[U.PRERELEASEIDENTIFIER]}(?:\\.${D[U.PRERELEASEIDENTIFIER]})*))`);re(&quot;PRERELEASELOOSE&quot;,`(?:-?(${D[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[U.PRERELEASEIDENTIFIERLOOSE]})*))`);re(&quot;BUILDIDENTIFIER&quot;,`${CS}+`);re(&quot;BUILD&quot;,`(?:\\+(${D[U.BUILDIDENTIFIER]}(?:\\.${D[U.BUILDIDENTIFIER]})*))`);re(&quot;FULLPLAIN&quot;,`v?${D[U.MAINVERSION]}${D[U.PRERELEASE]}?${D[U.BUILD]}?`);re(&quot;FULL&quot;,`^${D[U.FULLPLAIN]}$`);re(&quot;LOOSEPLAIN&quot;,`[v=\\s]*${D[U.MAINVERSIONLOOSE]}${D[U.PRERELEASELOOSE]}?${D[U.BUILD]}?`);re(&quot;LOOSE&quot;,`^${D[U.LOOSEPLAIN]}$`);re(&quot;GTLT&quot;,&quot;((?:&lt;|&gt;)?=?)&quot;);re(&quot;XRANGEIDENTIFIERLOOSE&quot;,`${D[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re(&quot;XRANGEIDENTIFIER&quot;,`${D[U.NUMERICIDENTIFIER]}|x|X|\\*`);re(&quot;XRANGEPLAIN&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:\\.(${D[U.XRANGEIDENTIFIER]})(?:${D[U.PRERELEASE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGEPLAINLOOSE&quot;,`[v=\\s]*(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[U.XRANGEIDENTIFIERLOOSE]})(?:${D[U.PRERELEASELOOSE]})?${D[U.BUILD]}?)?)?`);re(&quot;XRANGE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAIN]}$`);re(&quot;XRANGELOOSE&quot;,`^${D[U.GTLT]}\\s*${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COERCEPLAIN&quot;,`(^|[^\\d])(\\d{1,${NS}})(?:\\.(\\d{1,${NS}}))?(?:\\.(\\d{1,${NS}}))?`);re(&quot;COERCE&quot;,`${D[U.COERCEPLAIN]}(?:$|[^\\d])`);re(&quot;COERCEFULL&quot;,D[U.COERCEPLAIN]+`(?:${D[U.PRERELEASE]})?(?:${D[U.BUILD]})?(?:$|[^\\d])`);re(&quot;COERCERTL&quot;,D[U.COERCE],!0);re(&quot;COERCERTLFULL&quot;,D[U.COERCEFULL],!0);re(&quot;LONETILDE&quot;,&quot;(?:~&gt;?)&quot;);re(&quot;TILDETRIM&quot;,`(\\s*)${D[U.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace=&quot;$1~&quot;;re(&quot;TILDE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAIN]}$`);re(&quot;TILDELOOSE&quot;,`^${D[U.LONETILDE]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;LONECARET&quot;,&quot;(?:\\^)&quot;);re(&quot;CARETTRIM&quot;,`(\\s*)${D[U.LONECARET]}\\s+`,!0);kr.caretTrimReplace=&quot;$1^&quot;;re(&quot;CARET&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAIN]}$`);re(&quot;CARETLOOSE&quot;,`^${D[U.LONECARET]}${D[U.XRANGEPLAINLOOSE]}$`);re(&quot;COMPARATORLOOSE&quot;,`^${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]})$|^$`);re(&quot;COMPARATOR&quot;,`^${D[U.GTLT]}\\s*(${D[U.FULLPLAIN]})$|^$`);re(&quot;COMPARATORTRIM&quot;,`(\\s*)${D[U.GTLT]}\\s*(${D[U.LOOSEPLAIN]}|${D[U.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace=&quot;$1$2$3&quot;;re(&quot;HYPHENRANGE&quot;,`^\\s*(${D[U.XRANGEPLAIN]})\\s+-\\s+(${D[U.XRANGEPLAIN]})\\s*$`);re(&quot;HYPHENRANGELOOSE&quot;,`^\\s*(${D[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[U.XRANGEPLAINLOOSE]})\\s*$`);re(&quot;STAR&quot;,&quot;(&lt;|&gt;)?=?\\s*\\*&quot;);re(&quot;GTE0&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0\\s*$&quot;);re(&quot;GTE0PRE&quot;,&quot;^\\s*&gt;=\\s*0\\.0\\.0-0\\s*$&quot;)});var vd=T((c1e,Pk)=&gt;{&quot;use strict&quot;;var ine=Object.freeze({loose:!0}),one=Object.freeze({}),sne=r=&gt;r?typeof r!=&quot;object&quot;?ine:r:one;Pk.exports=sne});var PS=T((u1e,Lk)=&gt;{&quot;use strict&quot;;var Ik=/^[0-9]+$/,bk=(r,e)=&gt;{let t=Ik.test(r),o=Ik.test(e);return t&amp;&amp;o&amp;&amp;(r=+r,e=+e),r===e?0:t&amp;&amp;!o?-1:o&amp;&amp;!t?1:r&lt;e?-1:1},ane=(r,e)=&gt;bk(e,r);Lk.exports={compareIdentifiers:bk,rcompareIdentifiers:ane}});var pt=T((f1e,Mk)=&gt;{&quot;use strict&quot;;var yd=Yl(),{MAX_LENGTH:xk,MAX_SAFE_INTEGER:Od}=jl(),{safeRe:Ad,t:Rd}=Ms(),lne=vd(),{compareIdentifiers:ws}=PS(),IS=class r{constructor(e,t){if(t=lne(t),e instanceof r){if(e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!=&quot;string&quot;)throw new TypeError(`Invalid version. Must be a string. Got type &quot;${typeof e}&quot;.`);if(e.length&gt;xk)throw new TypeError(`version is longer than ${xk} characters`);yd(&quot;SemVer&quot;,e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let o=e.trim().match(t.loose?Ad[Rd.LOOSE]:Ad[Rd.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major&gt;Od||this.major&lt;0)throw new TypeError(&quot;Invalid major version&quot;);if(this.minor&gt;Od||this.minor&lt;0)throw new TypeError(&quot;Invalid minor version&quot;);if(this.patch&gt;Od||this.patch&lt;0)throw new TypeError(&quot;Invalid patch version&quot;);o[4]?this.prerelease=o[4].split(&quot;.&quot;).map(s=&gt;{if(/^[0-9]+$/.test(s)){let a=+s;if(a&gt;=0&amp;&amp;a&lt;Od)return a}return s}):this.prerelease=[],this.build=o[5]?o[5].split(&quot;.&quot;):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&amp;&amp;(this.version+=`-${this.prerelease.join(&quot;.&quot;)}`),this.version}toString(){return this.version}compare(e){if(yd(&quot;SemVer.compare&quot;,this.version,this.options,e),!(e instanceof r)){if(typeof e==&quot;string&quot;&amp;&amp;e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),ws(this.major,e.major)||ws(this.minor,e.minor)||ws(this.patch,e.patch)}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&amp;&amp;!e.prerelease.length)return-1;if(!this.prerelease.length&amp;&amp;e.prerelease.length)return 1;if(!this.prerelease.length&amp;&amp;!e.prerelease.length)return 0;let t=0;do{let o=this.prerelease[t],s=e.prerelease[t];if(yd(&quot;prerelease compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let o=this.build[t],s=e.build[t];if(yd(&quot;build compare&quot;,t,o,s),o===void 0&amp;&amp;s===void 0)return 0;if(s===void 0)return 1;if(o===void 0)return-1;if(o===s)continue;return ws(o,s)}while(++t)}inc(e,t,o){if(e.startsWith(&quot;pre&quot;)){if(!t&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier is empty&quot;);if(t){let s=`-${t}`.match(this.options.loose?Ad[Rd.PRERELEASELOOSE]:Ad[Rd.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case&quot;premajor&quot;:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(&quot;pre&quot;,t,o);break;case&quot;preminor&quot;:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(&quot;pre&quot;,t,o);break;case&quot;prepatch&quot;:this.prerelease.length=0,this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;prerelease&quot;:this.prerelease.length===0&amp;&amp;this.inc(&quot;patch&quot;,t,o),this.inc(&quot;pre&quot;,t,o);break;case&quot;release&quot;:if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case&quot;major&quot;:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&amp;&amp;this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case&quot;minor&quot;:(this.patch!==0||this.prerelease.length===0)&amp;&amp;this.minor++,this.patch=0,this.prerelease=[];break;case&quot;patch&quot;:this.prerelease.length===0&amp;&amp;this.patch++,this.prerelease=[];break;case&quot;pre&quot;:{let s=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;for(;--a&gt;=0;)typeof this.prerelease[a]==&quot;number&quot;&amp;&amp;(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(&quot;.&quot;)&amp;&amp;o===!1)throw new Error(&quot;invalid increment argument: identifier already exists&quot;);this.prerelease.push(s)}}if(t){let a=[t,s];o===!1&amp;&amp;(a=[t]),ws(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&amp;&amp;(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&amp;&amp;(this.raw+=`+${this.build.join(&quot;.&quot;)}`),this}};Mk.exports=IS});var Hi=T((p1e,Dk)=&gt;{&quot;use strict&quot;;var wk=pt(),cne=(r,e,t=!1)=&gt;{if(r instanceof wk)return r;try{return new wk(r,e)}catch(o){if(!t)return null;throw o}};Dk.exports=cne});var kk=T((d1e,Uk)=&gt;{&quot;use strict&quot;;var une=Hi(),fne=(r,e)=&gt;{let t=une(r,e);return t?t.version:null};Uk.exports=fne});var Vk=T((h1e,Bk)=&gt;{&quot;use strict&quot;;var pne=Hi(),dne=(r,e)=&gt;{let t=pne(r.trim().replace(/^[=v]+/,&quot;&quot;),e);return t?t.version:null};Bk.exports=dne});var Hk=T((_1e,Gk)=&gt;{&quot;use strict&quot;;var Fk=pt(),hne=(r,e,t,o,s)=&gt;{typeof t==&quot;string&quot;&amp;&amp;(s=o,o=t,t=void 0);try{return new Fk(r instanceof Fk?r.version:r,t).inc(e,o,s).version}catch{return null}};Gk.exports=hne});var Yk=T((E1e,jk)=&gt;{&quot;use strict&quot;;var qk=Hi(),_ne=(r,e)=&gt;{let t=qk(r,null,!0),o=qk(e,null,!0),s=t.compare(o);if(s===0)return null;let a=s&gt;0,i=a?t:o,n=a?o:t,l=!!i.prerelease.length;if(!!n.prerelease.length&amp;&amp;!l){if(!n.patch&amp;&amp;!n.minor)return&quot;major&quot;;if(n.compareMain(i)===0)return n.minor&amp;&amp;!n.patch?&quot;minor&quot;:&quot;patch&quot;}let u=l?&quot;pre&quot;:&quot;&quot;;return t.major!==o.major?u+&quot;major&quot;:t.minor!==o.minor?u+&quot;minor&quot;:t.patch!==o.patch?u+&quot;patch&quot;:&quot;prerelease&quot;};jk.exports=_ne});var Kk=T((m1e,zk)=&gt;{&quot;use strict&quot;;var Ene=pt(),mne=(r,e)=&gt;new Ene(r,e).major;zk.exports=mne});var Xk=T((T1e,$k)=&gt;{&quot;use strict&quot;;var Tne=pt(),Sne=(r,e)=&gt;new Tne(r,e).minor;$k.exports=Sne});var Jk=T((S1e,Wk)=&gt;{&quot;use strict&quot;;var gne=pt(),vne=(r,e)=&gt;new gne(r,e).patch;Wk.exports=vne});var Zk=T((g1e,Qk)=&gt;{&quot;use strict&quot;;var yne=Hi(),One=(r,e)=&gt;{let t=yne(r,e);return t&amp;&amp;t.prerelease.length?t.prerelease:null};Qk.exports=One});var Jt=T((v1e,tB)=&gt;{&quot;use strict&quot;;var eB=pt(),Ane=(r,e,t)=&gt;new eB(r,t).compare(new eB(e,t));tB.exports=Ane});var nB=T((y1e,rB)=&gt;{&quot;use strict&quot;;var Rne=Jt(),Nne=(r,e,t)=&gt;Rne(e,r,t);rB.exports=Nne});var oB=T((O1e,iB)=&gt;{&quot;use strict&quot;;var Cne=Jt(),Pne=(r,e)=&gt;Cne(r,e,!0);iB.exports=Pne});var Nd=T((A1e,aB)=&gt;{&quot;use strict&quot;;var sB=pt(),Ine=(r,e,t)=&gt;{let o=new sB(r,t),s=new sB(e,t);return o.compare(s)||o.compareBuild(s)};aB.exports=Ine});var cB=T((R1e,lB)=&gt;{&quot;use strict&quot;;var bne=Nd(),Lne=(r,e)=&gt;r.sort((t,o)=&gt;bne(t,o,e));lB.exports=Lne});var fB=T((N1e,uB)=&gt;{&quot;use strict&quot;;var xne=Nd(),Mne=(r,e)=&gt;r.sort((t,o)=&gt;xne(o,t,e));uB.exports=Mne});var zl=T((C1e,pB)=&gt;{&quot;use strict&quot;;var wne=Jt(),Dne=(r,e,t)=&gt;wne(r,e,t)&gt;0;pB.exports=Dne});var Cd=T((P1e,dB)=&gt;{&quot;use strict&quot;;var Une=Jt(),kne=(r,e,t)=&gt;Une(r,e,t)&lt;0;dB.exports=kne});var bS=T((I1e,hB)=&gt;{&quot;use strict&quot;;var Bne=Jt(),Vne=(r,e,t)=&gt;Bne(r,e,t)===0;hB.exports=Vne});var LS=T((b1e,_B)=&gt;{&quot;use strict&quot;;var Fne=Jt(),Gne=(r,e,t)=&gt;Fne(r,e,t)!==0;_B.exports=Gne});var Pd=T((L1e,EB)=&gt;{&quot;use strict&quot;;var Hne=Jt(),qne=(r,e,t)=&gt;Hne(r,e,t)&gt;=0;EB.exports=qne});var Id=T((x1e,mB)=&gt;{&quot;use strict&quot;;var jne=Jt(),Yne=(r,e,t)=&gt;jne(r,e,t)&lt;=0;mB.exports=Yne});var xS=T((M1e,TB)=&gt;{&quot;use strict&quot;;var zne=bS(),Kne=LS(),$ne=zl(),Xne=Pd(),Wne=Cd(),Jne=Id(),Qne=(r,e,t,o)=&gt;{switch(e){case&quot;===&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r===t;case&quot;!==&quot;:return typeof r==&quot;object&quot;&amp;&amp;(r=r.version),typeof t==&quot;object&quot;&amp;&amp;(t=t.version),r!==t;case&quot;&quot;:case&quot;=&quot;:case&quot;==&quot;:return zne(r,t,o);case&quot;!=&quot;:return Kne(r,t,o);case&quot;&gt;&quot;:return $ne(r,t,o);case&quot;&gt;=&quot;:return Xne(r,t,o);case&quot;&lt;&quot;:return Wne(r,t,o);case&quot;&lt;=&quot;:return Jne(r,t,o);default:throw new TypeError(`Invalid operator: ${e}`)}};TB.exports=Qne});var gB=T((w1e,SB)=&gt;{&quot;use strict&quot;;var Zne=pt(),eie=Hi(),{safeRe:bd,t:Ld}=Ms(),tie=(r,e)=&gt;{if(r instanceof Zne)return r;if(typeof r==&quot;number&quot;&amp;&amp;(r=String(r)),typeof r!=&quot;string&quot;)return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?bd[Ld.COERCEFULL]:bd[Ld.COERCE]);else{let l=e.includePrerelease?bd[Ld.COERCERTLFULL]:bd[Ld.COERCERTL],c;for(;(c=l.exec(r))&amp;&amp;(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&amp;&amp;(t=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(t===null)return null;let o=t[2],s=t[3]||&quot;0&quot;,a=t[4]||&quot;0&quot;,i=e.includePrerelease&amp;&amp;t[5]?`-${t[5]}`:&quot;&quot;,n=e.includePrerelease&amp;&amp;t[6]?`+${t[6]}`:&quot;&quot;;return eie(`${o}.${s}.${a}${i}${n}`,e)};SB.exports=tie});var yB=T((D1e,vB)=&gt;{&quot;use strict&quot;;var MS=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&amp;&amp;t!==void 0){if(this.map.size&gt;=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};vB.exports=MS});var Qt=T((U1e,NB)=&gt;{&quot;use strict&quot;;var rie=/\s+/g,wS=class r{constructor(e,t){if(t=iie(t),e instanceof r)return e.loose===!!t.loose&amp;&amp;e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof DS)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(rie,&quot; &quot;),this.set=this.raw.split(&quot;||&quot;).map(o=&gt;this.parseRange(o.trim())).filter(o=&gt;o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length&gt;1){let o=this.set[0];if(this.set=this.set.filter(s=&gt;!AB(s[0])),this.set.length===0)this.set=[o];else if(this.set.length&gt;1){for(let s of this.set)if(s.length===1&amp;&amp;fie(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=&quot;&quot;;for(let e=0;e&lt;this.set.length;e++){e&gt;0&amp;&amp;(this.formatted+=&quot;||&quot;);let t=this.set[e];for(let o=0;o&lt;t.length;o++)o&gt;0&amp;&amp;(this.formatted+=&quot; &quot;),this.formatted+=t[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&amp;&amp;cie)|(this.options.loose&amp;&amp;uie))+&quot;:&quot;+e,s=OB.get(o);if(s)return s;let a=this.options.loose,i=a?Rt[Tt.HYPHENRANGELOOSE]:Rt[Tt.HYPHENRANGE];e=e.replace(i,vie(this.options.includePrerelease)),be(&quot;hyphen replace&quot;,e),e=e.replace(Rt[Tt.COMPARATORTRIM],sie),be(&quot;comparator trim&quot;,e),e=e.replace(Rt[Tt.TILDETRIM],aie),be(&quot;tilde trim&quot;,e),e=e.replace(Rt[Tt.CARETTRIM],lie),be(&quot;caret trim&quot;,e);let n=e.split(&quot; &quot;).map(f=&gt;pie(f,this.options)).join(&quot; &quot;).split(/\s+/).map(f=&gt;gie(f,this.options));a&amp;&amp;(n=n.filter(f=&gt;(be(&quot;loose invalid filter&quot;,f,this.options),!!f.match(Rt[Tt.COMPARATORLOOSE])))),be(&quot;range list&quot;,n);let l=new Map,c=n.map(f=&gt;new DS(f,this.options));for(let f of c){if(AB(f))return[f];l.set(f.value,f)}l.size&gt;1&amp;&amp;l.has(&quot;&quot;)&amp;&amp;l.delete(&quot;&quot;);let u=[...l.values()];return OB.set(o,u),u}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Range is required&quot;);return this.set.some(o=&gt;RB(o,t)&amp;&amp;e.set.some(s=&gt;RB(s,t)&amp;&amp;o.every(a=&gt;s.every(i=&gt;a.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==&quot;string&quot;)try{e=new oie(e,this.options)}catch{return!1}for(let t=0;t&lt;this.set.length;t++)if(yie(this.set[t],e,this.options))return!0;return!1}};NB.exports=wS;var nie=yB(),OB=new nie,iie=vd(),DS=Kl(),be=Yl(),oie=pt(),{safeRe:Rt,t:Tt,comparatorTrimReplace:sie,tildeTrimReplace:aie,caretTrimReplace:lie}=Ms(),{FLAG_INCLUDE_PRERELEASE:cie,FLAG_LOOSE:uie}=jl(),AB=r=&gt;r.value===&quot;&lt;0.0.0-0&quot;,fie=r=&gt;r.value===&quot;&quot;,RB=(r,e)=&gt;{let t=!0,o=r.slice(),s=o.pop();for(;t&amp;&amp;o.length;)t=o.every(a=&gt;s.intersects(a,e)),s=o.pop();return t},pie=(r,e)=&gt;(be(&quot;comp&quot;,r,e),r=_ie(r,e),be(&quot;caret&quot;,r),r=die(r,e),be(&quot;tildes&quot;,r),r=mie(r,e),be(&quot;xrange&quot;,r),r=Sie(r,e),be(&quot;stars&quot;,r),r),St=r=&gt;!r||r.toLowerCase()===&quot;x&quot;||r===&quot;*&quot;,die=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;hie(t,e)).join(&quot; &quot;),hie=(r,e)=&gt;{let t=e.loose?Rt[Tt.TILDELOOSE]:Rt[Tt.TILDE];return r.replace(t,(o,s,a,i,n)=&gt;{be(&quot;tilde&quot;,r,o,s,a,i,n);let l;return St(s)?l=&quot;&quot;:St(a)?l=`&gt;=${s}.0.0 &lt;${+s+1}.0.0-0`:St(i)?l=`&gt;=${s}.${a}.0 &lt;${s}.${+a+1}.0-0`:n?(be(&quot;replaceTilde pr&quot;,n),l=`&gt;=${s}.${a}.${i}-${n} &lt;${s}.${+a+1}.0-0`):l=`&gt;=${s}.${a}.${i} &lt;${s}.${+a+1}.0-0`,be(&quot;tilde return&quot;,l),l})},_ie=(r,e)=&gt;r.trim().split(/\s+/).map(t=&gt;Eie(t,e)).join(&quot; &quot;),Eie=(r,e)=&gt;{be(&quot;caret&quot;,r,e);let t=e.loose?Rt[Tt.CARETLOOSE]:Rt[Tt.CARET],o=e.includePrerelease?&quot;-0&quot;:&quot;&quot;;return r.replace(t,(s,a,i,n,l)=&gt;{be(&quot;caret&quot;,r,s,a,i,n,l);let c;return St(a)?c=&quot;&quot;:St(i)?c=`&gt;=${a}.0.0${o} &lt;${+a+1}.0.0-0`:St(n)?a===&quot;0&quot;?c=`&gt;=${a}.${i}.0${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.0${o} &lt;${+a+1}.0.0-0`:l?(be(&quot;replaceCaret pr&quot;,l),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n}-${l} &lt;${+a+1}.0.0-0`):(be(&quot;no pr&quot;),a===&quot;0&quot;?i===&quot;0&quot;?c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${i}.${+n+1}-0`:c=`&gt;=${a}.${i}.${n}${o} &lt;${a}.${+i+1}.0-0`:c=`&gt;=${a}.${i}.${n} &lt;${+a+1}.0.0-0`),be(&quot;caret return&quot;,c),c})},mie=(r,e)=&gt;(be(&quot;replaceXRanges&quot;,r,e),r.split(/\s+/).map(t=&gt;Tie(t,e)).join(&quot; &quot;)),Tie=(r,e)=&gt;{r=r.trim();let t=e.loose?Rt[Tt.XRANGELOOSE]:Rt[Tt.XRANGE];return r.replace(t,(o,s,a,i,n,l)=&gt;{be(&quot;xRange&quot;,r,o,s,a,i,n,l);let c=St(a),u=c||St(i),f=u||St(n),_=f;return s===&quot;=&quot;&amp;&amp;_&amp;&amp;(s=&quot;&quot;),l=e.includePrerelease?&quot;-0&quot;:&quot;&quot;,c?s===&quot;&gt;&quot;||s===&quot;&lt;&quot;?o=&quot;&lt;0.0.0-0&quot;:o=&quot;*&quot;:s&amp;&amp;_?(u&amp;&amp;(i=0),n=0,s===&quot;&gt;&quot;?(s=&quot;&gt;=&quot;,u?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s===&quot;&lt;=&quot;&amp;&amp;(s=&quot;&lt;&quot;,u?a=+a+1:i=+i+1),s===&quot;&lt;&quot;&amp;&amp;(l=&quot;-0&quot;),o=`${s+a}.${i}.${n}${l}`):u?o=`&gt;=${a}.0.0${l} &lt;${+a+1}.0.0-0`:f&amp;&amp;(o=`&gt;=${a}.${i}.0${l} &lt;${a}.${+i+1}.0-0`),be(&quot;xRange return&quot;,o),o})},Sie=(r,e)=&gt;(be(&quot;replaceStars&quot;,r,e),r.trim().replace(Rt[Tt.STAR],&quot;&quot;)),gie=(r,e)=&gt;(be(&quot;replaceGTE0&quot;,r,e),r.trim().replace(Rt[e.includePrerelease?Tt.GTE0PRE:Tt.GTE0],&quot;&quot;)),vie=r=&gt;(e,t,o,s,a,i,n,l,c,u,f,_)=&gt;(St(o)?t=&quot;&quot;:St(s)?t=`&gt;=${o}.0.0${r?&quot;-0&quot;:&quot;&quot;}`:St(a)?t=`&gt;=${o}.${s}.0${r?&quot;-0&quot;:&quot;&quot;}`:i?t=`&gt;=${t}`:t=`&gt;=${t}${r?&quot;-0&quot;:&quot;&quot;}`,St(c)?l=&quot;&quot;:St(u)?l=`&lt;${+c+1}.0.0-0`:St(f)?l=`&lt;${c}.${+u+1}.0-0`:_?l=`&lt;=${c}.${u}.${f}-${_}`:r?l=`&lt;${c}.${u}.${+f+1}-0`:l=`&lt;=${l}`,`${t} ${l}`.trim()),yie=(r,e,t)=&gt;{for(let o=0;o&lt;r.length;o++)if(!r[o].test(e))return!1;if(e.prerelease.length&amp;&amp;!t.includePrerelease){for(let o=0;o&lt;r.length;o++)if(be(r[o].semver),r[o].semver!==DS.ANY&amp;&amp;r[o].semver.prerelease.length&gt;0){let s=r[o].semver;if(s.major===e.major&amp;&amp;s.minor===e.minor&amp;&amp;s.patch===e.patch)return!0}return!1}return!0}});var Kl=T((k1e,xB)=&gt;{&quot;use strict&quot;;var $l=Symbol(&quot;SemVer ANY&quot;),BS=class r{static get ANY(){return $l}constructor(e,t){if(t=CB(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(&quot; &quot;),kS(&quot;comparator&quot;,e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===$l?this.value=&quot;&quot;:this.value=this.operator+this.semver.version,kS(&quot;comp&quot;,this)}parse(e){let t=this.options.loose?PB[IB.COMPARATORLOOSE]:PB[IB.COMPARATOR],o=e.match(t);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:&quot;&quot;,this.operator===&quot;=&quot;&amp;&amp;(this.operator=&quot;&quot;),o[2]?this.semver=new bB(o[2],this.options.loose):this.semver=$l}toString(){return this.value}test(e){if(kS(&quot;Comparator.test&quot;,e,this.options.loose),this.semver===$l||e===$l)return!0;if(typeof e==&quot;string&quot;)try{e=new bB(e,this.options)}catch{return!1}return US(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError(&quot;a Comparator is required&quot;);return this.operator===&quot;&quot;?this.value===&quot;&quot;?!0:new LB(e.value,t).test(this.value):e.operator===&quot;&quot;?e.value===&quot;&quot;?!0:new LB(this.value,t).test(e.semver):(t=CB(t),t.includePrerelease&amp;&amp;(this.value===&quot;&lt;0.0.0-0&quot;||e.value===&quot;&lt;0.0.0-0&quot;)||!t.includePrerelease&amp;&amp;(this.value.startsWith(&quot;&lt;0.0.0&quot;)||e.value.startsWith(&quot;&lt;0.0.0&quot;))?!1:!!(this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)||this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||this.semver.version===e.semver.version&amp;&amp;this.operator.includes(&quot;=&quot;)&amp;&amp;e.operator.includes(&quot;=&quot;)||US(this.semver,&quot;&lt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&gt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&lt;&quot;)||US(this.semver,&quot;&gt;&quot;,e.semver,t)&amp;&amp;this.operator.startsWith(&quot;&lt;&quot;)&amp;&amp;e.operator.startsWith(&quot;&gt;&quot;)))}};xB.exports=BS;var CB=vd(),{safeRe:PB,t:IB}=Ms(),US=xS(),kS=Yl(),bB=pt(),LB=Qt()});var Xl=T((B1e,MB)=&gt;{&quot;use strict&quot;;var Oie=Qt(),Aie=(r,e,t)=&gt;{try{e=new Oie(e,t)}catch{return!1}return e.test(r)};MB.exports=Aie});var DB=T((V1e,wB)=&gt;{&quot;use strict&quot;;var Rie=Qt(),Nie=(r,e)=&gt;new Rie(r,e).set.map(t=&gt;t.map(o=&gt;o.value).join(&quot; &quot;).trim().split(&quot; &quot;));wB.exports=Nie});var kB=T((F1e,UB)=&gt;{&quot;use strict&quot;;var Cie=pt(),Pie=Qt(),Iie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Pie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===-1)&amp;&amp;(o=i,s=new Cie(o,t))}),o};UB.exports=Iie});var VB=T((G1e,BB)=&gt;{&quot;use strict&quot;;var bie=pt(),Lie=Qt(),xie=(r,e,t)=&gt;{let o=null,s=null,a=null;try{a=new Lie(e,t)}catch{return null}return r.forEach(i=&gt;{a.test(i)&amp;&amp;(!o||s.compare(i)===1)&amp;&amp;(o=i,s=new bie(o,t))}),o};BB.exports=xie});var HB=T((H1e,GB)=&gt;{&quot;use strict&quot;;var VS=pt(),Mie=Qt(),FB=zl(),wie=(r,e)=&gt;{r=new Mie(r,e);let t=new VS(&quot;0.0.0&quot;);if(r.test(t)||(t=new VS(&quot;0.0.0-0&quot;),r.test(t)))return t;t=null;for(let o=0;o&lt;r.set.length;++o){let s=r.set[o],a=null;s.forEach(i=&gt;{let n=new VS(i.semver.version);switch(i.operator){case&quot;&gt;&quot;:n.prerelease.length===0?n.patch++:n.prerelease.push(0),n.raw=n.format();case&quot;&quot;:case&quot;&gt;=&quot;:(!a||FB(n,a))&amp;&amp;(a=n);break;case&quot;&lt;&quot;:case&quot;&lt;=&quot;:break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),a&amp;&amp;(!t||FB(t,a))&amp;&amp;(t=a)}return t&amp;&amp;r.test(t)?t:null};GB.exports=wie});var jB=T((q1e,qB)=&gt;{&quot;use strict&quot;;var Die=Qt(),Uie=(r,e)=&gt;{try{return new Die(r,e).range||&quot;*&quot;}catch{return null}};qB.exports=Uie});var xd=T((j1e,$B)=&gt;{&quot;use strict&quot;;var kie=pt(),KB=Kl(),{ANY:Bie}=KB,Vie=Qt(),Fie=Xl(),YB=zl(),zB=Cd(),Gie=Id(),Hie=Pd(),qie=(r,e,t,o)=&gt;{r=new kie(r,o),e=new Vie(e,o);let s,a,i,n,l;switch(t){case&quot;&gt;&quot;:s=YB,a=Gie,i=zB,n=&quot;&gt;&quot;,l=&quot;&gt;=&quot;;break;case&quot;&lt;&quot;:s=zB,a=Hie,i=YB,n=&quot;&lt;&quot;,l=&quot;&lt;=&quot;;break;default:throw new TypeError(&#x27;Must provide a hilo val of &quot;&lt;&quot; or &quot;&gt;&quot;&#x27;)}if(Fie(r,e,o))return!1;for(let c=0;c&lt;e.set.length;++c){let u=e.set[c],f=null,_=null;if(u.forEach(m=&gt;{m.semver===Bie&amp;&amp;(m=new KB(&quot;&gt;=0.0.0&quot;)),f=f||m,_=_||m,s(m.semver,f.semver,o)?f=m:i(m.semver,_.semver,o)&amp;&amp;(_=m)}),f.operator===n||f.operator===l||(!_.operator||_.operator===n)&amp;&amp;a(r,_.semver))return!1;if(_.operator===l&amp;&amp;i(r,_.semver))return!1}return!0};$B.exports=qie});var WB=T((Y1e,XB)=&gt;{&quot;use strict&quot;;var jie=xd(),Yie=(r,e,t)=&gt;jie(r,e,&quot;&gt;&quot;,t);XB.exports=Yie});var QB=T((z1e,JB)=&gt;{&quot;use strict&quot;;var zie=xd(),Kie=(r,e,t)=&gt;zie(r,e,&quot;&lt;&quot;,t);JB.exports=Kie});var tV=T((K1e,eV)=&gt;{&quot;use strict&quot;;var ZB=Qt(),$ie=(r,e,t)=&gt;(r=new ZB(r,t),e=new ZB(e,t),r.intersects(e,t));eV.exports=$ie});var nV=T(($1e,rV)=&gt;{&quot;use strict&quot;;var Xie=Xl(),Wie=Jt();rV.exports=(r,e,t)=&gt;{let o=[],s=null,a=null,i=r.sort((u,f)=&gt;Wie(u,f,t));for(let u of i)Xie(u,e,t)?(a=u,s||(s=u)):(a&amp;&amp;o.push([s,a]),a=null,s=null);s&amp;&amp;o.push([s,null]);let n=[];for(let[u,f]of o)u===f?n.push(u):!f&amp;&amp;u===i[0]?n.push(&quot;*&quot;):f?u===i[0]?n.push(`&lt;=${f}`):n.push(`${u} - ${f}`):n.push(`&gt;=${u}`);let l=n.join(&quot; || &quot;),c=typeof e.raw==&quot;string&quot;?e.raw:String(e);return l.length&lt;c.length?l:e}});var cV=T((X1e,lV)=&gt;{&quot;use strict&quot;;var iV=Qt(),GS=Kl(),{ANY:FS}=GS,Wl=Xl(),HS=Jt(),Jie=(r,e,t={})=&gt;{if(r===e)return!0;r=new iV(r,t),e=new iV(e,t);let o=!1;e:for(let s of r.set){for(let a of e.set){let i=Zie(s,a,t);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},Qie=[new GS(&quot;&gt;=0.0.0-0&quot;)],oV=[new GS(&quot;&gt;=0.0.0&quot;)],Zie=(r,e,t)=&gt;{if(r===e)return!0;if(r.length===1&amp;&amp;r[0].semver===FS){if(e.length===1&amp;&amp;e[0].semver===FS)return!0;t.includePrerelease?r=Qie:r=oV}if(e.length===1&amp;&amp;e[0].semver===FS){if(t.includePrerelease)return!0;e=oV}let o=new Set,s,a;for(let m of r)m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;?s=sV(s,m,t):m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;?a=aV(a,m,t):o.add(m.semver);if(o.size&gt;1)return null;let i;if(s&amp;&amp;a){if(i=HS(s.semver,a.semver,t),i&gt;0)return null;if(i===0&amp;&amp;(s.operator!==&quot;&gt;=&quot;||a.operator!==&quot;&lt;=&quot;))return null}for(let m of o){if(s&amp;&amp;!Wl(m,String(s),t)||a&amp;&amp;!Wl(m,String(a),t))return null;for(let O of e)if(!Wl(m,String(O),t))return!1;return!0}let n,l,c,u,f=a&amp;&amp;!t.includePrerelease&amp;&amp;a.semver.prerelease.length?a.semver:!1,_=s&amp;&amp;!t.includePrerelease&amp;&amp;s.semver.prerelease.length?s.semver:!1;f&amp;&amp;f.prerelease.length===1&amp;&amp;a.operator===&quot;&lt;&quot;&amp;&amp;f.prerelease[0]===0&amp;&amp;(f=!1);for(let m of e){if(u=u||m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;,c=c||m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;,s){if(_&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===_.major&amp;&amp;m.semver.minor===_.minor&amp;&amp;m.semver.patch===_.patch&amp;&amp;(_=!1),m.operator===&quot;&gt;&quot;||m.operator===&quot;&gt;=&quot;){if(n=sV(s,m,t),n===m&amp;&amp;n!==s)return!1}else if(s.operator===&quot;&gt;=&quot;&amp;&amp;!Wl(s.semver,String(m),t))return!1}if(a){if(f&amp;&amp;m.semver.prerelease&amp;&amp;m.semver.prerelease.length&amp;&amp;m.semver.major===f.major&amp;&amp;m.semver.minor===f.minor&amp;&amp;m.semver.patch===f.patch&amp;&amp;(f=!1),m.operator===&quot;&lt;&quot;||m.operator===&quot;&lt;=&quot;){if(l=aV(a,m,t),l===m&amp;&amp;l!==a)return!1}else if(a.operator===&quot;&lt;=&quot;&amp;&amp;!Wl(a.semver,String(m),t))return!1}if(!m.operator&amp;&amp;(a||s)&amp;&amp;i!==0)return!1}return!(s&amp;&amp;c&amp;&amp;!a&amp;&amp;i!==0||a&amp;&amp;u&amp;&amp;!s&amp;&amp;i!==0||_||f)},sV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&gt;0?r:o&lt;0||e.operator===&quot;&gt;&quot;&amp;&amp;r.operator===&quot;&gt;=&quot;?e:r},aV=(r,e,t)=&gt;{if(!r)return e;let o=HS(r.semver,e.semver,t);return o&lt;0?r:o&gt;0||e.operator===&quot;&lt;&quot;&amp;&amp;r.operator===&quot;&lt;=&quot;?e:r};lV.exports=Jie});var jS=T((W1e,pV)=&gt;{&quot;use strict&quot;;var qS=Ms(),uV=jl(),eoe=pt(),fV=PS(),toe=Hi(),roe=kk(),noe=Vk(),ioe=Hk(),ooe=Yk(),soe=Kk(),aoe=Xk(),loe=Jk(),coe=Zk(),uoe=Jt(),foe=nB(),poe=oB(),doe=Nd(),hoe=cB(),_oe=fB(),Eoe=zl(),moe=Cd(),Toe=bS(),Soe=LS(),goe=Pd(),voe=Id(),yoe=xS(),Ooe=gB(),Aoe=Kl(),Roe=Qt(),Noe=Xl(),Coe=DB(),Poe=kB(),Ioe=VB(),boe=HB(),Loe=jB(),xoe=xd(),Moe=WB(),woe=QB(),Doe=tV(),Uoe=nV(),koe=cV();pV.exports={parse:toe,valid:roe,clean:noe,inc:ioe,diff:ooe,major:soe,minor:aoe,patch:loe,prerelease:coe,compare:uoe,rcompare:foe,compareLoose:poe,compareBuild:doe,sort:hoe,rsort:_oe,gt:Eoe,lt:moe,eq:Toe,neq:Soe,gte:goe,lte:voe,cmp:yoe,coerce:Ooe,Comparator:Aoe,Range:Roe,satisfies:Noe,toComparators:Coe,maxSatisfying:Poe,minSatisfying:Ioe,minVersion:boe,validRange:Loe,outside:xoe,gtr:Moe,ltr:woe,intersects:Doe,simplifyRange:Uoe,subset:koe,SemVer:eoe,re:qS.re,src:qS.src,tokens:qS.t,SEMVER_SPEC_VERSION:uV.SEMVER_SPEC_VERSION,RELEASE_TYPES:uV.RELEASE_TYPES,compareIdentifiers:fV.compareIdentifiers,rcompareIdentifiers:fV.rcompareIdentifiers}});function Voe(r){var e=decodeURIComponent(r).split(&quot;:&quot;);if(e.length!==4)return null;var t=hV(e,4),o=t[0],s=t[1],a=t[3],i=o.padStart(32,&quot;0&quot;),n=s.padStart(16,&quot;0&quot;),l=Boe.test(a)?parseInt(a,16)&amp;1:1;return{traceId:i,spanId:n,isRemote:!0,traceFlags:l}}var dV,hV,YS,Md,_V,Boe,EV=p(()=&gt;{P();xr();dV=function(r){var e=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.iterator,t=e&amp;&amp;r[e],o=0;if(t)return t.call(r);if(r&amp;&amp;typeof r.length==&quot;number&quot;)return{next:function(){return r&amp;&amp;o&gt;=r.length&amp;&amp;(r=void 0),{value:r&amp;&amp;r[o++],done:!r}}};throw new TypeError(e?&quot;Object is not iterable.&quot;:&quot;Symbol.iterator is not defined.&quot;)},hV=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a},YS=&quot;uber-trace-id&quot;,Md=&quot;uberctx&quot;,_V=(function(){function r(e){typeof e==&quot;string&quot;?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=Md):(this._jaegerTraceHeader=(e==null?void 0:e.customTraceHeader)||YS,this._jaegerBaggageHeaderPrefix=(e==null?void 0:e.customBaggageHeaderPrefix)||Md)}return r.prototype.inject=function(e,t,o){var s,a,i=ie.getSpanContext(e),n=Ue.getBaggage(e);if(i&amp;&amp;At(e)===!1){var l=&quot;0&quot;+(i.traceFlags||se.NONE).toString(16);o.set(t,this._jaegerTraceHeader,i.traceId+&quot;:&quot;+i.spanId+&quot;:0:&quot;+l)}if(n)try{for(var c=dV(n.getAllEntries()),u=c.next();!u.done;u=c.next()){var f=hV(u.value,2),_=f[0],m=f[1];o.set(t,this._jaegerBaggageHeaderPrefix+&quot;-&quot;+_,encodeURIComponent(m.value))}}catch(O){s={error:O}}finally{try{u&amp;&amp;!u.done&amp;&amp;(a=c.return)&amp;&amp;a.call(c)}finally{if(s)throw s.error}}},r.prototype.extract=function(e,t,o){var s,a,i=this,n,l=o.get(t,this._jaegerTraceHeader),c=Array.isArray(l)?l[0]:l,u=o.keys(t).filter(function(I){return I.startsWith(i._jaegerBaggageHeaderPrefix+&quot;-&quot;)}).map(function(I){var M=o.get(t,I);return{key:I.substring(i._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(M)?M[0]:M}}),f=e;if(typeof c==&quot;string&quot;){var _=Voe(c);_&amp;&amp;(f=ie.setSpanContext(f,_))}if(u.length===0)return f;var m=(n=Ue.getBaggage(e))!==null&amp;&amp;n!==void 0?n:Ue.createBaggage();try{for(var O=dV(u),y=O.next();!y.done;y=O.next()){var A=y.value;A.value!==void 0&amp;&amp;(m=m.setEntry(A.key,{value:decodeURIComponent(A.value)}))}}catch(I){s={error:I}}finally{try{y&amp;&amp;!y.done&amp;&amp;(a=O.return)&amp;&amp;a.call(O)}finally{if(s)throw s.error}}return f=Ue.setBaggage(f,m),f},r.prototype.fields=function(){return[this._jaegerTraceHeader]},r})(),Boe=/^[0-9a-f]{1,2}$/i});var mV={};Ae(mV,{JaegerPropagator:()=&gt;_V,UBER_BAGGAGE_HEADER_PREFIX:()=&gt;Md,UBER_TRACE_ID_HEADER:()=&gt;YS});var TV=p(()=&gt;{EV()});var vV=T(Ud=&gt;{&quot;use strict&quot;;Object.defineProperty(Ud,&quot;__esModule&quot;,{value:!0});Ud.NodeTracerProvider=void 0;var SV=rU(),wd=(lU(),ee(aU)),gV=(Gi(),ee(xs)),Foe=jS(),Goe=(TV(),ee(mV)),Dd=class extends gV.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let t=Foe.gte(process.version,&quot;14.8.0&quot;)?SV.AsyncLocalStorageContextManager:SV.AsyncHooksContextManager;e.contextManager=new t,e.contextManager.enable()}super.register(e)}};Ud.NodeTracerProvider=Dd;Dd._registeredPropagators=new Map([...gV.BasicTracerProvider._registeredPropagators,[&quot;b3&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.SINGLE_HEADER})],[&quot;b3multi&quot;,()=&gt;new wd.B3Propagator({injectEncoding:wd.B3InjectEncoding.MULTI_HEADER})],[&quot;jaeger&quot;,()=&gt;new Goe.JaegerPropagator]])});var zS=T(fe=&gt;{&quot;use strict&quot;;Object.defineProperty(fe,&quot;__esModule&quot;,{value:!0});fe.Tracer=fe.TraceIdRatioBasedSampler=fe.Span=fe.SimpleSpanProcessor=fe.SamplingDecision=fe.RandomIdGenerator=fe.ParentBasedSampler=fe.NoopSpanProcessor=fe.InMemorySpanExporter=fe.ForceFlushState=fe.ConsoleSpanExporter=fe.BatchSpanProcessor=fe.BasicTracerProvider=fe.AlwaysOnSampler=fe.AlwaysOffSampler=fe.NodeTracerProvider=void 0;var Hoe=vV();Object.defineProperty(fe,&quot;NodeTracerProvider&quot;,{enumerable:!0,get:function(){return Hoe.NodeTracerProvider}});var gt=(Gi(),ee(xs));Object.defineProperty(fe,&quot;AlwaysOffSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOffSampler}});Object.defineProperty(fe,&quot;AlwaysOnSampler&quot;,{enumerable:!0,get:function(){return gt.AlwaysOnSampler}});Object.defineProperty(fe,&quot;BasicTracerProvider&quot;,{enumerable:!0,get:function(){return gt.BasicTracerProvider}});Object.defineProperty(fe,&quot;BatchSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.BatchSpanProcessor}});Object.defineProperty(fe,&quot;ConsoleSpanExporter&quot;,{enumerable:!0,get:function(){return gt.ConsoleSpanExporter}});Object.defineProperty(fe,&quot;ForceFlushState&quot;,{enumerable:!0,get:function(){return gt.ForceFlushState}});Object.defineProperty(fe,&quot;InMemorySpanExporter&quot;,{enumerable:!0,get:function(){return gt.InMemorySpanExporter}});Object.defineProperty(fe,&quot;NoopSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.NoopSpanProcessor}});Object.defineProperty(fe,&quot;ParentBasedSampler&quot;,{enumerable:!0,get:function(){return gt.ParentBasedSampler}});Object.defineProperty(fe,&quot;RandomIdGenerator&quot;,{enumerable:!0,get:function(){return gt.RandomIdGenerator}});Object.defineProperty(fe,&quot;SamplingDecision&quot;,{enumerable:!0,get:function(){return gt.SamplingDecision}});Object.defineProperty(fe,&quot;SimpleSpanProcessor&quot;,{enumerable:!0,get:function(){return gt.SimpleSpanProcessor}});Object.defineProperty(fe,&quot;Span&quot;,{enumerable:!0,get:function(){return gt.Span}});Object.defineProperty(fe,&quot;TraceIdRatioBasedSampler&quot;,{enumerable:!0,get:function(){return gt.TraceIdRatioBasedSampler}});Object.defineProperty(fe,&quot;Tracer&quot;,{enumerable:!0,get:function(){return gt.Tracer}})});function Ds(){return`unknown_service:${process.argv0}`}var yV=p(()=&gt;{});var OV=p(()=&gt;{yV()});var KS=p(()=&gt;{OV()});var Ce,dn=p(()=&gt;{P();Ve();xr();KS();Ce=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:Ds(),[ge]:bn[ge],[Se]:bn[Se],[ve]:bn[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Ce.EMPTY=new Ce({})});var AV,RV,$S=p(()=&gt;{AV=r=&gt;{switch(r){case&quot;arm&quot;:return&quot;arm32&quot;;case&quot;ppc&quot;:return&quot;ppc32&quot;;case&quot;x64&quot;:return&quot;amd64&quot;;default:return r}},RV=r=&gt;{switch(r){case&quot;sunos&quot;:return&quot;solaris&quot;;case&quot;win32&quot;:return&quot;windows&quot;;default:return r}}});import*as NV from&quot;child_process&quot;;import*as CV from&quot;util&quot;;var Us,kd=p(()=&gt;{Us=CV.promisify(NV.exec)});var PV={};Ae(PV,{getMachineId:()=&gt;qoe});async function qoe(){try{let e=(await Us(&#x27;ioreg -rd1 -c &quot;IOPlatformExpertDevice&quot;&#x27;)).stdout.split(` `).find(o=&gt;o.includes(&quot;IOPlatformUUID&quot;));if(!e)return&quot;&quot;;let t=e.split(&#x27;&quot; = &quot;&#x27;);if(t.length===2)return t[1].slice(0,-1)}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var IV=p(()=&gt;{kd();P()});var bV={};Ae(bV,{getMachineId:()=&gt;Yoe});import{promises as joe}from&quot;fs&quot;;async function Yoe(){let r=[&quot;/etc/machine-id&quot;,&quot;/var/lib/dbus/machine-id&quot;];for(let e of r)try{return(await joe.readFile(e,{encoding:&quot;utf8&quot;})).trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var LV=p(()=&gt;{P()});var xV={};Ae(xV,{getMachineId:()=&gt;Koe});import{promises as zoe}from&quot;fs&quot;;async function Koe(){try{return(await zoe.readFile(&quot;/etc/hostid&quot;,{encoding:&quot;utf8&quot;})).trim()}catch(r){S.debug(`error reading machine id: ${r}`)}try{return(await Us(&quot;kenv -q smbios.system.uuid&quot;)).stdout.trim()}catch(r){S.debug(`error reading machine id: ${r}`)}return&quot;&quot;}var MV=p(()=&gt;{kd();P()});var wV={};Ae(wV,{getMachineId:()=&gt;$oe});import*as Bd from&quot;process&quot;;async function $oe(){let r=&quot;QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid&quot;,e=&quot;%windir%\\System32\\REG.exe&quot;;Bd.arch===&quot;ia32&quot;&amp;&amp;&quot;PROCESSOR_ARCHITEW6432&quot;in Bd.env&amp;&amp;(e=&quot;%windir%\\sysnative\\cmd.exe /c &quot;+e);try{let o=(await Us(`${e} ${r}`)).stdout.split(&quot;REG_SZ&quot;);if(o.length===2)return o[1].trim()}catch(t){S.debug(`error reading machine id: ${t}`)}return&quot;&quot;}var DV=p(()=&gt;{kd();P()});var UV={};Ae(UV,{getMachineId:()=&gt;Xoe});async function Xoe(){return S.debug(&quot;could not read machine-id: unsupported platform&quot;),&quot;&quot;}var kV=p(()=&gt;{P()});import*as BV from&quot;process&quot;;var qi,VV=p(()=&gt;{switch(BV.platform){case&quot;darwin&quot;:({getMachineId:qi}=(IV(),ee(PV)));break;case&quot;linux&quot;:({getMachineId:qi}=(LV(),ee(bV)));break;case&quot;freebsd&quot;:({getMachineId:qi}=(MV(),ee(xV)));break;case&quot;win32&quot;:({getMachineId:qi}=(DV(),ee(wV)));break;default:({getMachineId:qi}=(kV(),ee(UV)))}});import{arch as Woe,hostname as Joe}from&quot;os&quot;;var XS,ji,WS=p(()=&gt;{Ve();dn();$S();VV();XS=class{detect(e){let t={[Bm]:Joe(),[Vm]:AV(Woe())};return new Ce(t,this._getAsyncAttributes())}_getAsyncAttributes(){return qi().then(e=&gt;{let t={};return e&amp;&amp;(t[km]=e),t})}},ji=new XS});var JS,Jl,FV=p(()=&gt;{WS();JS=class{detect(e){return Promise.resolve(ji.detect(e))}},Jl=new JS});import{platform as Qoe,release as Zoe}from&quot;os&quot;;var QS,Yi,ZS=p(()=&gt;{Ve();dn();$S();QS=class{detect(e){let t={[Fm]:RV(Qoe()),[Gm]:Zoe()};return new Ce(t)}},Yi=new QS});var eg,Ql,GV=p(()=&gt;{ZS();eg=class{detect(e){return Promise.resolve(Yi.detect(e))}},Ql=new eg});import*as HV from&quot;os&quot;;var tg,zi,rg=p(()=&gt;{P();Ve();dn();tg=class{detect(e){let t={[Hm]:process.pid,[qm]:process.title,[jm]:process.execPath,[zm]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[ko]:process.versions.node,[st]:&quot;nodejs&quot;,[Ja]:&quot;Node.js&quot;};process.argv.length&gt;1&amp;&amp;(t[Ym]=process.argv[1]);try{let o=HV.userInfo();t[Km]=o.username}catch(o){S.debug(`error obtaining process owner: ${o}`)}return new Ce(t)}},zi=new tg});var ng,Zl,qV=p(()=&gt;{rg();ng=class{detect(e){return Promise.resolve(zi.detect(e))}},Zl=new ng});import{randomUUID as ese}from&quot;crypto&quot;;var ig,ec,jV=p(()=&gt;{Ve();dn();ig=class{detect(e){let t={[$m]:ese()};return new Ce(t)}},ec=new ig});var YV=p(()=&gt;{FV();WS();GV();ZS();qV();rg();jV()});var zV=p(()=&gt;{YV()});var og,tc,sg=p(()=&gt;{Ve();P();dn();og=class{detect(e){var t,o,s;if(!(typeof navigator&lt;&quot;u&quot;&amp;&amp;((o=(t=global.process)===null||t===void 0?void 0:t.versions)===null||o===void 0?void 0:o.node)===void 0&amp;&amp;((s=global.Bun)===null||s===void 0?void 0:s.version)===void 0))return Ce.empty();let i={[st]:&quot;browser&quot;,[Ja]:&quot;Web Browser&quot;,[ko]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,t){return e[ko]===&quot;&quot;?(S.debug(&quot;BrowserDetector failed: Unable to find required browser resources. &quot;),Ce.empty()):new Ce(Object.assign({},e))}},tc=new og});var ag,lg,KV=p(()=&gt;{sg();ag=class{detect(e){return Promise.resolve(tc.detect(e))}},lg=new ag});var cg,rc,ug=p(()=&gt;{P();xr();Ve();dn();cg=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=&quot;,&quot;,this._LABEL_KEY_VALUE_SPLITTER=&quot;=&quot;,this._ERROR_MESSAGE_INVALID_CHARS=&quot;should be a ASCII string with a length greater than 0 and not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;,this._ERROR_MESSAGE_INVALID_VALUE=&quot;should be a ASCII string with a length not exceed &quot;+this._MAX_LENGTH+&quot; characters.&quot;}detect(e){let t={},o=Fo(),s=o.OTEL_RESOURCE_ATTRIBUTES,a=o.OTEL_SERVICE_NAME;if(s)try{let i=this._parseResourceAttributes(s);Object.assign(t,i)}catch(i){S.debug(`EnvDetector failed: ${i.message}`)}return a&amp;&amp;(t[at]=a),new Ce(t)}_parseResourceAttributes(e){if(!e)return{};let t={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^&quot;|&quot;$/).join(&quot;&quot;),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[i]=decodeURIComponent(n)}return t}_isValid(e){return e.length&lt;=this._MAX_LENGTH&amp;&amp;this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t&lt;e.length;t++){let o=e.charCodeAt(t);if(o&lt;33||o===44||o===59||o===92||o&gt;126)return!1}return!0}_isValidAndNotEmpty(e){return e.length&gt;0&amp;&amp;this._isValid(e)}},rc=new cg});var fg,pg,$V=p(()=&gt;{ug();fg=class{detect(e){return Promise.resolve(rc.detect(e))}},pg=new fg});var XV=p(()=&gt;{zV();KV();$V();sg();ug()});var WV,JV=p(()=&gt;{WV=r=&gt;r!==null&amp;&amp;typeof r==&quot;object&quot;&amp;&amp;typeof r.then==&quot;function&quot;});var QV,ZV,e2,t2=p(()=&gt;{dn();P();JV();QV=async(r={})=&gt;{let e=await Promise.all((r.detectors||[]).map(async t=&gt;{try{let o=await t.detect(r);return S.debug(`${t.constructor.name} found resource.`,o),o}catch(o){return S.debug(`${t.constructor.name} failed: ${o.message}`),Ce.empty()}}));return e2(e),e.reduce((t,o)=&gt;t.merge(o),Ce.empty())},ZV=(r={})=&gt;{var e;let t=((e=r.detectors)!==null&amp;&amp;e!==void 0?e:[]).map(s=&gt;{try{let a=s.detect(r),i;if(WV(a)){let n=async()=&gt;{var l;let c=await a;return await((l=c.waitForAsyncAttributes)===null||l===void 0?void 0:l.call(c)),c.attributes};i=new Ce({},n())}else i=a;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=&gt;S.debug(`${s.constructor.name} found resource.`,i)):S.debug(`${s.constructor.name} found resource.`,i),i}catch(a){return S.error(`${s.constructor.name} failed: ${a.message}`),Ce.empty()}}),o=t.reduce((s,a)=&gt;s.merge(a),Ce.empty());return o.waitForAsyncAttributes&amp;&amp;o.waitForAsyncAttributes().then(()=&gt;{e2(t)}),o},e2=r=&gt;{r.forEach(e=&gt;{if(Object.keys(e.attributes).length&gt;0){let t=JSON.stringify(e.attributes,null,4);S.verbose(t)}})}});var Vd={};Ae(Vd,{Resource:()=&gt;Ce,browserDetector:()=&gt;lg,browserDetectorSync:()=&gt;tc,defaultServiceName:()=&gt;Ds,detectResources:()=&gt;QV,detectResourcesSync:()=&gt;ZV,envDetector:()=&gt;pg,envDetectorSync:()=&gt;rc,hostDetector:()=&gt;Jl,hostDetectorSync:()=&gt;ji,osDetector:()=&gt;Ql,osDetectorSync:()=&gt;Yi,processDetector:()=&gt;Zl,processDetectorSync:()=&gt;zi,serviceInstanceIdDetectorSync:()=&gt;ec});var Fd=p(()=&gt;{dn();KS();XV();t2()});function r2(r,e,t,o){for(let s=0,a=r.length;s&lt;a;s++){let i=r[s];e&amp;&amp;i.setTracerProvider(e),t&amp;&amp;i.setMeterProvider(t),o&amp;&amp;i.setLoggerProvider&amp;&amp;i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}function n2(r){r.forEach(e=&gt;e.disable())}var i2=p(()=&gt;{});function o2(r){var e,t;let o=r.tracerProvider||ie.getTracerProvider(),s=r.meterProvider||gi.getMeterProvider(),a=r.loggerProvider||_l.getLoggerProvider(),i=(t=(e=r.instrumentations)===null||e===void 0?void 0:e.flat())!==null&amp;&amp;t!==void 0?t:[];return r2(i,o,s,a),()=&gt;{n2(i)}}var s2=p(()=&gt;{P();El();i2()});var hg=T((FUe,c2)=&gt;{&quot;use strict&quot;;function dg(r){return typeof r==&quot;function&quot;}var vt=console.error.bind(console);function nc(r,e,t){var o=!!r[e]&amp;&amp;r.propertyIsEnumerable(e);Object.defineProperty(r,e,{configurable:!0,enumerable:o,writable:!0,value:t})}function ic(r){r&amp;&amp;r.logger&amp;&amp;(dg(r.logger)?vt=r.logger:vt(&quot;new logger isn&#x27;t a function, not replacing&quot;))}function a2(r,e,t){if(!r||!r[e]){vt(&quot;no original function &quot;+e+&quot; to wrap&quot;);return}if(!t){vt(&quot;no wrapper function&quot;),vt(new Error().stack);return}if(!dg(r[e])||!dg(t)){vt(&quot;original object and wrapper must be functions&quot;);return}var o=r[e],s=t(o,e);return nc(s,&quot;__original&quot;,o),nc(s,&quot;__unwrap&quot;,function(){r[e]===s&amp;&amp;nc(r,e,o)}),nc(s,&quot;__wrapped&quot;,!0),nc(r,e,s),s}function tse(r,e,t){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to wrap on modules&quot;);return}r.forEach(function(o){e.forEach(function(s){a2(o,s,t)})})}function l2(r,e){if(!r||!r[e]){vt(&quot;no function to unwrap.&quot;),vt(new Error().stack);return}if(!r[e].__unwrap)vt(&quot;no original to unwrap to -- has &quot;+e+&quot; already been unwrapped?&quot;);else return r[e].__unwrap()}function rse(r,e){if(r)Array.isArray(r)||(r=[r]);else{vt(&quot;must provide one or more modules to patch&quot;),vt(new Error().stack);return}if(!(e&amp;&amp;Array.isArray(e))){vt(&quot;must provide one or more functions to unwrap on modules&quot;);return}r.forEach(function(t){e.forEach(function(o){l2(t,o)})})}ic.wrap=a2;ic.massWrap=tse;ic.unwrap=l2;ic.massUnwrap=rse;c2.exports=ic});var Yn,Gd,u2=p(()=&gt;{P();El();Yn=Nn(hg()),Gd=class{constructor(e,t,o){this.instrumentationName=e,this.instrumentationVersion=t,this._config={},this._wrap=Yn.wrap,this._unwrap=Yn.unwrap,this._massWrap=Yn.massWrap,this._massUnwrap=Yn.massUnwrap,this.setConfig(o),this._diag=S.createComponentLogger({namespace:e}),this._tracer=ie.getTracer(e,t),this._meter=gi.getMeter(e,t),this._logger=_l.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())!==null&amp;&amp;e!==void 0?e:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,o,s){if(e)try{e(o,s)}catch(a){this._diag.error(&quot;Error running span customization hook due to exception in handler&quot;,{triggerName:t},a)}}}});var p2=T((jUe,f2)=&gt;{var ks=1e3,Bs=ks*60,Vs=Bs*60,Ki=Vs*24,nse=Ki*7,ise=Ki*365.25;f2.exports=function(r,e){e=e||{};var t=typeof r;if(t===&quot;string&quot;&amp;&amp;r.length&gt;0)return ose(r);if(t===&quot;number&quot;&amp;&amp;isFinite(r))return e.long?ase(r):sse(r);throw new Error(&quot;val is not a non-empty string or a valid number. val=&quot;+JSON.stringify(r))};function ose(r){if(r=String(r),!(r.length&gt;100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),o=(e[2]||&quot;ms&quot;).toLowerCase();switch(o){case&quot;years&quot;:case&quot;year&quot;:case&quot;yrs&quot;:case&quot;yr&quot;:case&quot;y&quot;:return t*ise;case&quot;weeks&quot;:case&quot;week&quot;:case&quot;w&quot;:return t*nse;case&quot;days&quot;:case&quot;day&quot;:case&quot;d&quot;:return t*Ki;case&quot;hours&quot;:case&quot;hour&quot;:case&quot;hrs&quot;:case&quot;hr&quot;:case&quot;h&quot;:return t*Vs;case&quot;minutes&quot;:case&quot;minute&quot;:case&quot;mins&quot;:case&quot;min&quot;:case&quot;m&quot;:return t*Bs;case&quot;seconds&quot;:case&quot;second&quot;:case&quot;secs&quot;:case&quot;sec&quot;:case&quot;s&quot;:return t*ks;case&quot;milliseconds&quot;:case&quot;millisecond&quot;:case&quot;msecs&quot;:case&quot;msec&quot;:case&quot;ms&quot;:return t;default:return}}}}function sse(r){var e=Math.abs(r);return e&gt;=Ki?Math.round(r/Ki)+&quot;d&quot;:e&gt;=Vs?Math.round(r/Vs)+&quot;h&quot;:e&gt;=Bs?Math.round(r/Bs)+&quot;m&quot;:e&gt;=ks?Math.round(r/ks)+&quot;s&quot;:r+&quot;ms&quot;}function ase(r){var e=Math.abs(r);return e&gt;=Ki?Hd(r,e,Ki,&quot;day&quot;):e&gt;=Vs?Hd(r,e,Vs,&quot;hour&quot;):e&gt;=Bs?Hd(r,e,Bs,&quot;minute&quot;):e&gt;=ks?Hd(r,e,ks,&quot;second&quot;):r+&quot; ms&quot;}function Hd(r,e,t,o){var s=e&gt;=t*1.5;return Math.round(r/t)+&quot; &quot;+o+(s?&quot;s&quot;:&quot;&quot;)}});var _g=T((YUe,d2)=&gt;{function lse(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=s,t.enabled=n,t.humanize=p2(),t.destroy=c,Object.keys(r).forEach(u=&gt;{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let _=0;_&lt;u.length;_++)f=(f&lt;&lt;5)-f+u.charCodeAt(_),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,_=null,m,O;function y(...A){if(!y.enabled)return;let I=y,M=Number(new Date),F=M-(f||M);I.diff=F,I.prev=f,I.curr=M,f=M,A[0]=t.coerce(A[0]),typeof A[0]!=&quot;string&quot;&amp;&amp;A.unshift(&quot;%O&quot;);let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,G)=&gt;{if(B===&quot;%%&quot;)return&quot;%&quot;;N++;let te=t.formatters[G];if(typeof te==&quot;function&quot;){let $=A[N];B=te.call(I,$),A.splice(N,1),N--}return B}),t.formatArgs.call(I,A),(I.log||t.log).apply(I,A)}return y.namespace=u,y.useColors=t.useColors(),y.color=t.selectColor(u),y.extend=o,y.destroy=t.destroy,Object.defineProperty(y,&quot;enabled&quot;,{enumerable:!0,configurable:!1,get:()=&gt;_!==null?_:(m!==t.namespaces&amp;&amp;(m=t.namespaces,O=t.enabled(u)),O),set:A=&gt;{_=A}}),typeof t.init==&quot;function&quot;&amp;&amp;t.init(y),y}function o(u,f){let _=t(this.namespace+(typeof f&gt;&quot;u&quot;?&quot;:&quot;:f)+u);return _.log=this.log,_}function s(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u==&quot;string&quot;?u:&quot;&quot;).trim().replace(/\s+/g,&quot;,&quot;).split(&quot;,&quot;).filter(Boolean);for(let _ of f)_[0]===&quot;-&quot;?t.skips.push(_.slice(1)):t.names.push(_)}function a(u,f){let _=0,m=0,O=-1,y=0;for(;_&lt;u.length;)if(m&lt;f.length&amp;&amp;(f[m]===u[_]||f[m]===&quot;*&quot;))f[m]===&quot;*&quot;?(O=m,y=_,m++):(_++,m++);else if(O!==-1)m=O+1,y++,_=y;else return!1;for(;m&lt;f.length&amp;&amp;f[m]===&quot;*&quot;;)m++;return m===f.length}function i(){let u=[...t.names,...t.skips.map(f=&gt;&quot;-&quot;+f)].join(&quot;,&quot;);return t.enable(&quot;&quot;),u}function n(u){for(let f of t.skips)if(a(u,f))return!1;for(let f of t.names)if(a(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;)}return t.enable(t.load()),t}d2.exports=lse});var h2=T((Nt,qd)=&gt;{Nt.formatArgs=use;Nt.save=fse;Nt.load=pse;Nt.useColors=cse;Nt.storage=dse();Nt.destroy=(()=&gt;{let r=!1;return()=&gt;{r||(r=!0,console.warn(&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;))}})();Nt.colors=[&quot;#0000CC&quot;,&quot;#0000FF&quot;,&quot;#0033CC&quot;,&quot;#0033FF&quot;,&quot;#0066CC&quot;,&quot;#0066FF&quot;,&quot;#0099CC&quot;,&quot;#0099FF&quot;,&quot;#00CC00&quot;,&quot;#00CC33&quot;,&quot;#00CC66&quot;,&quot;#00CC99&quot;,&quot;#00CCCC&quot;,&quot;#00CCFF&quot;,&quot;#3300CC&quot;,&quot;#3300FF&quot;,&quot;#3333CC&quot;,&quot;#3333FF&quot;,&quot;#3366CC&quot;,&quot;#3366FF&quot;,&quot;#3399CC&quot;,&quot;#3399FF&quot;,&quot;#33CC00&quot;,&quot;#33CC33&quot;,&quot;#33CC66&quot;,&quot;#33CC99&quot;,&quot;#33CCCC&quot;,&quot;#33CCFF&quot;,&quot;#6600CC&quot;,&quot;#6600FF&quot;,&quot;#6633CC&quot;,&quot;#6633FF&quot;,&quot;#66CC00&quot;,&quot;#66CC33&quot;,&quot;#9900CC&quot;,&quot;#9900FF&quot;,&quot;#9933CC&quot;,&quot;#9933FF&quot;,&quot;#99CC00&quot;,&quot;#99CC33&quot;,&quot;#CC0000&quot;,&quot;#CC0033&quot;,&quot;#CC0066&quot;,&quot;#CC0099&quot;,&quot;#CC00CC&quot;,&quot;#CC00FF&quot;,&quot;#CC3300&quot;,&quot;#CC3333&quot;,&quot;#CC3366&quot;,&quot;#CC3399&quot;,&quot;#CC33CC&quot;,&quot;#CC33FF&quot;,&quot;#CC6600&quot;,&quot;#CC6633&quot;,&quot;#CC9900&quot;,&quot;#CC9933&quot;,&quot;#CCCC00&quot;,&quot;#CCCC33&quot;,&quot;#FF0000&quot;,&quot;#FF0033&quot;,&quot;#FF0066&quot;,&quot;#FF0099&quot;,&quot;#FF00CC&quot;,&quot;#FF00FF&quot;,&quot;#FF3300&quot;,&quot;#FF3333&quot;,&quot;#FF3366&quot;,&quot;#FF3399&quot;,&quot;#FF33CC&quot;,&quot;#FF33FF&quot;,&quot;#FF6600&quot;,&quot;#FF6633&quot;,&quot;#FF9900&quot;,&quot;#FF9933&quot;,&quot;#FFCC00&quot;,&quot;#FFCC33&quot;];function cse(){if(typeof window&lt;&quot;u&quot;&amp;&amp;window.process&amp;&amp;(window.process.type===&quot;renderer&quot;||window.process.__nwjs))return!0;if(typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document&lt;&quot;u&quot;&amp;&amp;document.documentElement&amp;&amp;document.documentElement.style&amp;&amp;document.documentElement.style.WebkitAppearance||typeof window&lt;&quot;u&quot;&amp;&amp;window.console&amp;&amp;(window.console.firebug||window.console.exception&amp;&amp;window.console.table)||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&amp;&amp;parseInt(r[1],10)&gt;=31||typeof navigator&lt;&quot;u&quot;&amp;&amp;navigator.userAgent&amp;&amp;navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function use(r){if(r[0]=(this.useColors?&quot;%c&quot;:&quot;&quot;)+this.namespace+(this.useColors?&quot; %c&quot;:&quot; &quot;)+r[0]+(this.useColors?&quot;%c &quot;:&quot; &quot;)+&quot;+&quot;+qd.exports.humanize(this.diff),!this.useColors)return;let e=&quot;color: &quot;+this.color;r.splice(1,0,e,&quot;color: inherit&quot;);let t=0,o=0;r[0].replace(/%[a-zA-Z%]/g,s=&gt;{s!==&quot;%%&quot;&amp;&amp;(t++,s===&quot;%c&quot;&amp;&amp;(o=t))}),r.splice(o,0,e)}Nt.log=console.debug||console.log||(()=&gt;{});function fse(r){try{r?Nt.storage.setItem(&quot;debug&quot;,r):Nt.storage.removeItem(&quot;debug&quot;)}catch{}}function pse(){let r;try{r=Nt.storage.getItem(&quot;debug&quot;)||Nt.storage.getItem(&quot;DEBUG&quot;)}catch{}return!r&amp;&amp;typeof process&lt;&quot;u&quot;&amp;&amp;&quot;env&quot;in process&amp;&amp;(r=process.env.DEBUG),r}function dse(){try{return localStorage}catch{}}qd.exports=_g()(Nt);var{formatters:hse}=qd.exports;hse.j=function(r){try{return JSON.stringify(r)}catch(e){return&quot;[UnexpectedJSONParseError]: &quot;+e.message}}});var E2=T((zUe,_2)=&gt;{&quot;use strict&quot;;_2.exports=(r,e=process.argv)=&gt;{let t=r.startsWith(&quot;-&quot;)?&quot;&quot;:r.length===1?&quot;-&quot;:&quot;--&quot;,o=e.indexOf(t+r),s=e.indexOf(&quot;--&quot;);return o!==-1&amp;&amp;(s===-1||o&lt;s)}});var S2=T((KUe,T2)=&gt;{&quot;use strict&quot;;var _se=V(&quot;os&quot;),m2=V(&quot;tty&quot;),Zt=E2(),{env:Ze}=process,zn;Zt(&quot;no-color&quot;)||Zt(&quot;no-colors&quot;)||Zt(&quot;color=false&quot;)||Zt(&quot;color=never&quot;)?zn=0:(Zt(&quot;color&quot;)||Zt(&quot;colors&quot;)||Zt(&quot;color=true&quot;)||Zt(&quot;color=always&quot;))&amp;&amp;(zn=1);&quot;FORCE_COLOR&quot;in Ze&amp;&amp;(Ze.FORCE_COLOR===&quot;true&quot;?zn=1:Ze.FORCE_COLOR===&quot;false&quot;?zn=0:zn=Ze.FORCE_COLOR.length===0?1:Math.min(parseInt(Ze.FORCE_COLOR,10),3));function Eg(r){return r===0?!1:{level:r,hasBasic:!0,has256:r&gt;=2,has16m:r&gt;=3}}function mg(r,e){if(zn===0)return 0;if(Zt(&quot;color=16m&quot;)||Zt(&quot;color=full&quot;)||Zt(&quot;color=truecolor&quot;))return 3;if(Zt(&quot;color=256&quot;))return 2;if(r&amp;&amp;!e&amp;&amp;zn===void 0)return 0;let t=zn||0;if(Ze.TERM===&quot;dumb&quot;)return t;if(process.platform===&quot;win32&quot;){let o=_se.release().split(&quot;.&quot;);return Number(o[0])&gt;=10&amp;&amp;Number(o[2])&gt;=10586?Number(o[2])&gt;=14931?3:2:1}if(&quot;CI&quot;in Ze)return[&quot;TRAVIS&quot;,&quot;CIRCLECI&quot;,&quot;APPVEYOR&quot;,&quot;GITLAB_CI&quot;,&quot;GITHUB_ACTIONS&quot;,&quot;BUILDKITE&quot;].some(o=&gt;o in Ze)||Ze.CI_NAME===&quot;codeship&quot;?1:t;if(&quot;TEAMCITY_VERSION&quot;in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM===&quot;truecolor&quot;)return 3;if(&quot;TERM_PROGRAM&quot;in Ze){let o=parseInt((Ze.TERM_PROGRAM_VERSION||&quot;&quot;).split(&quot;.&quot;)[0],10);switch(Ze.TERM_PROGRAM){case&quot;iTerm.app&quot;:return o&gt;=3?3:2;case&quot;Apple_Terminal&quot;:return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||&quot;COLORTERM&quot;in Ze?1:t}function Ese(r){let e=mg(r,r&amp;&amp;r.isTTY);return Eg(e)}T2.exports={supportsColor:Ese,stdout:Eg(mg(!0,m2.isatty(1))),stderr:Eg(mg(!0,m2.isatty(2)))}});var v2=T((et,Yd)=&gt;{var mse=V(&quot;tty&quot;),jd=V(&quot;util&quot;);et.init=Ase;et.log=vse;et.formatArgs=Sse;et.save=yse;et.load=Ose;et.useColors=Tse;et.destroy=jd.deprecate(()=&gt;{},&quot;Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.&quot;);et.colors=[6,2,3,4,5,1];try{let r=S2();r&amp;&amp;(r.stderr||r).level&gt;=2&amp;&amp;(et.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}et.inspectOpts=Object.keys(process.env).filter(r=&gt;/^debug_/i.test(r)).reduce((r,e)=&gt;{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=&gt;a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o===&quot;null&quot;?o=null:o=Number(o),r[t]=o,r},{});function Tse(){return&quot;colors&quot;in et.inspectOpts?!!et.inspectOpts.colors:mse.isatty(process.stderr.fd)}function Sse(r){let{namespace:e,useColors:t}=this;if(t){let o=this.color,s=&quot;\x1B[3&quot;+(o&lt;8?o:&quot;8;5;&quot;+o),a=` ${s};1m${e} \x1B[0m`;r[0]=a+r[0].split(` `).join(` `+a),r.push(s+&quot;m+&quot;+Yd.exports.humanize(this.diff)+&quot;\x1B[0m&quot;)}else r[0]=gse()+e+&quot; &quot;+r[0]}function gse(){return et.inspectOpts.hideDate?&quot;&quot;:new Date().toISOString()+&quot; &quot;}function vse(...r){return process.stderr.write(jd.formatWithOptions(et.inspectOpts,...r)+` `)}function yse(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ose(){return process.env.DEBUG}function Ase(r){r.inspectOpts={};let e=Object.keys(et.inspectOpts);for(let t=0;t&lt;e.length;t++)r.inspectOpts[e[t]]=et.inspectOpts[e[t]]}Yd.exports=_g()(et);var{formatters:g2}=Yd.exports;g2.o=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts).split(` `).map(e=&gt;e.trim()).join(&quot; &quot;)};g2.O=function(r){return this.inspectOpts.colors=this.useColors,jd.inspect(r,this.inspectOpts)}});var y2=T(($Ue,Tg)=&gt;{typeof process&gt;&quot;u&quot;||process.type===&quot;renderer&quot;||process.browser===!0||process.__nwjs?Tg.exports=h2():Tg.exports=v2()});var gg=T((XUe,O2)=&gt;{&quot;use strict&quot;;var Sg=V(&quot;path&quot;).sep;O2.exports=function(r){var e=r.split(Sg),t=e.lastIndexOf(&quot;node_modules&quot;);if(t!==-1&amp;&amp;e[t+1]){for(var o=e[t+1][0]===&quot;@&quot;,s=o?e[t+1]+&quot;/&quot;+e[t+2]:e[t+1],a=o?3:2,i=&quot;&quot;,n=t+a-1,l=0;l&lt;=n;l++)l===n?i+=e[l]:i+=e[l]+Sg;for(var c=&quot;&quot;,u=e.length-1,f=t+a;f&lt;=u;f++)f===u?c+=e[f]:c+=e[f]+Sg;return{name:s,basedir:i,path:c}}}});var vg=T((WUe,A2)=&gt;{&quot;use strict&quot;;var Rse=V(&quot;os&quot;);A2.exports=Rse.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform===&quot;win32&quot;?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform===&quot;darwin&quot;?e||(t?&quot;/Users/&quot;+t:null):process.platform===&quot;linux&quot;?e||(process.getuid()===0?&quot;/root&quot;:t?&quot;/home/&quot;+t:null):e||null}});var yg=T((JUe,R2)=&gt;{R2.exports=function(){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(t,o){return o};var e=new Error().stack;return Error.prepareStackTrace=r,e[2].getFileName()}});var N2=T((QUe,oc)=&gt;{&quot;use strict&quot;;var Nse=process.platform===&quot;win32&quot;,Cse=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Og={};function Pse(r){return Cse.exec(r).slice(1)}Og.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=Pse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Ise=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ag={};function bse(r){return Ise.exec(r).slice(1)}Ag.parse=function(r){if(typeof r!=&quot;string&quot;)throw new TypeError(&quot;Parameter &#x27;pathString&#x27; must be a string, not &quot;+typeof r);var e=bse(r);if(!e||e.length!==5)throw new TypeError(&quot;Invalid path &#x27;&quot;+r+&quot;&#x27;&quot;);return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Nse?oc.exports=Og.parse:oc.exports=Ag.parse;oc.exports.posix=Ag.parse;oc.exports.win32=Og.parse});var Rg=T((ZUe,b2)=&gt;{var I2=V(&quot;path&quot;),C2=I2.parse||N2(),P2=function(e,t){var o=&quot;/&quot;;/^([A-Za-z]:)/.test(e)?o=&quot;&quot;:/^\\\\/.test(e)&amp;&amp;(o=&quot;\\\\&quot;);for(var s=[e],a=C2(e);a.dir!==s[s.length-1];)s.push(a.dir),a=C2(a.dir);return s.reduce(function(i,n){return i.concat(t.map(function(l){return I2.resolve(o,n,l)}))},[])};b2.exports=function(e,t,o){var s=t&amp;&amp;t.moduleDirectory?[].concat(t.moduleDirectory):[&quot;node_modules&quot;];if(t&amp;&amp;typeof t.paths==&quot;function&quot;)return t.paths(o,e,function(){return P2(e,s)},t);var a=P2(e,s);return t&amp;&amp;t.paths?a.concat(t.paths):a}});var Ng=T((eke,L2)=&gt;{L2.exports=function(r,e){return e||{}}});var w2=T((tke,M2)=&gt;{&quot;use strict&quot;;var Lse=&quot;Function.prototype.bind called on incompatible &quot;,xse=Object.prototype.toString,Mse=Math.max,wse=&quot;[object Function]&quot;,x2=function(e,t){for(var o=[],s=0;s&lt;e.length;s+=1)o[s]=e[s];for(var a=0;a&lt;t.length;a+=1)o[a+e.length]=t[a];return o},Dse=function(e,t){for(var o=[],s=t||0,a=0;s&lt;e.length;s+=1,a+=1)o[a]=e[s];return o},Use=function(r,e){for(var t=&quot;&quot;,o=0;o&lt;r.length;o+=1)t+=r[o],o+1&lt;r.length&amp;&amp;(t+=e);return t};M2.exports=function(e){var t=this;if(typeof t!=&quot;function&quot;||xse.apply(t)!==wse)throw new TypeError(Lse+t);for(var o=Dse(arguments,1),s,a=function(){if(this instanceof s){var u=t.apply(this,x2(o,arguments));return Object(u)===u?u:this}return t.apply(e,x2(o,arguments))},i=Mse(0,t.length-o.length),n=[],l=0;l&lt;i;l++)n[l]=&quot;$&quot;+l;if(s=Function(&quot;binder&quot;,&quot;return function (&quot;+Use(n,&quot;,&quot;)+&quot;){ return binder.apply(this,arguments); }&quot;)(a),t.prototype){var c=function(){};c.prototype=t.prototype,s.prototype=new c,c.prototype=null}return s}});var U2=T((rke,D2)=&gt;{&quot;use strict&quot;;var kse=w2();D2.exports=Function.prototype.bind||kse});var B2=T((nke,k2)=&gt;{&quot;use strict&quot;;var Bse=Function.prototype.call,Vse=Object.prototype.hasOwnProperty,Fse=U2();k2.exports=Fse.call(Bse,Vse)});var V2=T((ike,Gse)=&gt;{Gse.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:[&quot;&gt;= 22.13 &amp;&amp; &lt; 23&quot;,&quot;&gt;= 23.4&quot;],_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var sc=T((oke,H2)=&gt;{&quot;use strict&quot;;var Hse=B2();function qse(r,e){for(var t=r.split(&quot;.&quot;),o=e.split(&quot; &quot;),s=o.length&gt;1?o[0]:&quot;=&quot;,a=(o.length&gt;1?o[1]:o[0]).split(&quot;.&quot;),i=0;i&lt;3;++i){var n=parseInt(t[i]||0,10),l=parseInt(a[i]||0,10);if(n!==l)return s===&quot;&lt;&quot;?n&lt;l:s===&quot;&gt;=&quot;?n&gt;=l:!1}return s===&quot;&gt;=&quot;}function F2(r,e){var t=e.split(/ ?&amp;&amp; ?/);if(t.length===0)return!1;for(var o=0;o&lt;t.length;++o)if(!qse(r,t[o]))return!1;return!0}function jse(r,e){if(typeof e==&quot;boolean&quot;)return e;var t=typeof r&gt;&quot;u&quot;?process.versions&amp;&amp;process.versions.node:r;if(typeof t!=&quot;string&quot;)throw new TypeError(typeof r&gt;&quot;u&quot;?&quot;Unable to determine current node version&quot;:&quot;If provided, a valid node version is required&quot;);if(e&amp;&amp;typeof e==&quot;object&quot;){for(var o=0;o&lt;e.length;++o)if(F2(t,e[o]))return!0;return!1}return F2(t,e)}var G2=V2();H2.exports=function(e,t){return Hse(G2,e)&amp;&amp;jse(t,G2[e])}});var Y2=T((ske,j2)=&gt;{var $i=V(&quot;fs&quot;),Yse=vg(),ze=V(&quot;path&quot;),zse=yg(),Kse=Rg(),$se=Ng(),Xse=sc(),Wse=process.platform!==&quot;win32&quot;&amp;&amp;$i.realpath&amp;&amp;typeof $i.realpath.native==&quot;function&quot;?$i.realpath.native:$i.realpath,q2=Yse(),Jse=function(){return[ze.join(q2,&quot;.node_modules&quot;),ze.join(q2,&quot;.node_libraries&quot;)]},Qse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isFile()||s.isFIFO())})},Zse=function(e,t){$i.stat(e,function(o,s){return o?o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;?t(null,!1):t(o):t(null,s.isDirectory())})},eae=function(e,t){Wse(e,function(o,s){o&amp;&amp;o.code!==&quot;ENOENT&quot;?t(o):t(null,o?e:s)})},ac=function(e,t,o,s){o&amp;&amp;o.preserveSymlinks===!1?e(t,s):s(null,t)},tae=function(e,t,o){e(t,function(s,a){if(s)o(s);else try{var i=JSON.parse(a);o(null,i)}catch{o(null)}})},rae=function(e,t,o){for(var s=Kse(t,o,e),a=0;a&lt;s.length;a++)s[a]=ze.join(s[a],e);return s};j2.exports=function(e,t,o){var s=o,a=t;if(typeof t==&quot;function&quot;&amp;&amp;(s=a,a={}),typeof e!=&quot;string&quot;){var i=new TypeError(&quot;Path must be a string.&quot;);return process.nextTick(function(){s(i)})}a=$se(e,a);var n=a.isFile||Qse,l=a.isDirectory||Zse,c=a.readFile||$i.readFile,u=a.realpath||eae,f=a.readPackage||tae;if(a.readFile&amp;&amp;a.readPackage){var _=new TypeError(&quot;`readFile` and `readPackage` are mutually exclusive.&quot;);return process.nextTick(function(){s(_)})}var m=a.packageIterator,O=a.extensions||[&quot;.js&quot;],y=a.includeCoreModules!==!1,A=a.basedir||ze.dirname(zse()),I=a.filename||A;a.paths=a.paths||Jse();var M=ze.resolve(A);ac(u,M,a,function(v,W){v?s(v):N(W)});var F;function N(v){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))F=ze.resolve(v,e),(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(F+=&quot;/&quot;),/\/$/.test(e)&amp;&amp;F===v?te(F,a.package,z):B(F,a.package,z);else{if(y&amp;&amp;Xse(e))return s(null,e);le(e,v,function(W,R,E){if(W)s(W);else{if(R)return ac(u,R,a,function(Q,Y){Q?s(Q):s(null,Y,E)});var C=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);C.code=&quot;MODULE_NOT_FOUND&quot;,s(C)}})}}function z(v,W,R){v?s(v):W?s(null,W,R):te(F,function(E,C,Q){if(E)s(E);else if(C)ac(u,C,a,function(J,ce){J?s(J):s(null,ce,Q)});else{var Y=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+I+&quot;&#x27;&quot;);Y.code=&quot;MODULE_NOT_FOUND&quot;,s(Y)}})}function B(v,W,R){var E=W,C=R;typeof E==&quot;function&quot;&amp;&amp;(C=E,E=void 0);var Q=[&quot;&quot;].concat(O);Y(Q,v,E);function Y(J,ce,Ne){if(J.length===0)return C(null,void 0,Ne);var Me=ce+J[0],Te=Ne;Te?Z(null,Te):G(ze.dirname(Me),Z);function Z(me,we,We){if(Te=we,me)return C(me);if(We&amp;&amp;Te&amp;&amp;a.pathFilter){var wo=ze.relative(We,Me),Do=wo.slice(0,wo.length-J[0].length),_i=a.pathFilter(Te,ce,Do);if(_i)return Y([&quot;&quot;].concat(O.slice()),ze.resolve(We,_i),Te)}n(Me,je)}function je(me,we){if(me)return C(me);if(we)return C(null,Me,Te);Y(J.slice(1),ce,Te)}}}function G(v,W){if(v===&quot;&quot;||v===&quot;/&quot;||process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(v)||/[/\\]node_modules[/\\]*$/.test(v))return W(null);ac(u,v,a,function(R,E){if(R)return G(ze.dirname(v),W);var C=ze.join(E,&quot;package.json&quot;);n(C,function(Q,Y){if(!Y)return G(ze.dirname(v),W);f(c,C,function(J,ce){J&amp;&amp;W(J);var Ne=ce;Ne&amp;&amp;a.packageFilter&amp;&amp;(Ne=a.packageFilter(Ne,C)),W(null,Ne,v)})})})}function te(v,W,R){var E=R,C=W;typeof C==&quot;function&quot;&amp;&amp;(E=C,C=a.package),ac(u,v,a,function(Q,Y){if(Q)return E(Q);var J=ze.join(Y,&quot;package.json&quot;);n(J,function(ce,Ne){if(ce)return E(ce);if(!Ne)return B(ze.join(v,&quot;index&quot;),C,E);f(c,J,function(Me,Te){if(Me)return E(Me);var Z=Te;if(Z&amp;&amp;a.packageFilter&amp;&amp;(Z=a.packageFilter(Z,J)),Z&amp;&amp;Z.main){if(typeof Z.main!=&quot;string&quot;){var je=new TypeError(&quot;package \u201C&quot;+Z.name+&quot;\u201D `main` must be a string&quot;);return je.code=&quot;INVALID_PACKAGE_MAIN&quot;,E(je)}(Z.main===&quot;.&quot;||Z.main===&quot;./&quot;)&amp;&amp;(Z.main=&quot;index&quot;),B(ze.resolve(v,Z.main),Z,function(me,we,We){if(me)return E(me);if(we)return E(null,we,We);if(!We)return B(ze.join(v,&quot;index&quot;),We,E);var wo=ze.resolve(v,We.main);te(wo,We,function(Do,_i,Ye){if(Do)return E(Do);if(_i)return E(null,_i,Ye);B(ze.join(v,&quot;index&quot;),Ye,E)})});return}B(ze.join(v,&quot;/index&quot;),Z,E)})})})}function $(v,W){if(W.length===0)return v(null,void 0);var R=W[0];l(ze.dirname(R),E);function E(Y,J){if(Y)return v(Y);if(!J)return $(v,W.slice(1));B(R,a.package,C)}function C(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);te(R,a.package,Q)}function Q(Y,J,ce){if(Y)return v(Y);if(J)return v(null,J,ce);$(v,W.slice(1))}}function le(v,W,R){var E=function(){return rae(v,W,a)};$(R,m?m(v,W,E,a):E())}}});var z2=T((ake,nae)=&gt;{nae.exports={assert:!0,&quot;node:assert&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;assert/strict&quot;:&quot;&gt;= 15&quot;,&quot;node:assert/strict&quot;:&quot;&gt;= 16&quot;,async_hooks:&quot;&gt;= 8&quot;,&quot;node:async_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],buffer_ieee754:&quot;&gt;= 0.5 &amp;&amp; &lt; 0.9.7&quot;,buffer:!0,&quot;node:buffer&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],child_process:!0,&quot;node:child_process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],cluster:&quot;&gt;= 0.5&quot;,&quot;node:cluster&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],console:!0,&quot;node:console&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],constants:!0,&quot;node:constants&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],crypto:!0,&quot;node:crypto&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_debug_agent:&quot;&gt;= 1 &amp;&amp; &lt; 8&quot;,_debugger:&quot;&lt; 8&quot;,dgram:!0,&quot;node:dgram&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],diagnostics_channel:[&quot;&gt;= 14.17 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 15.1&quot;],&quot;node:diagnostics_channel&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],dns:!0,&quot;node:dns&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;dns/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:dns/promises&quot;:&quot;&gt;= 16&quot;,domain:&quot;&gt;= 0.7.12&quot;,&quot;node:domain&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],events:!0,&quot;node:events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],freelist:&quot;&lt; 6&quot;,fs:!0,&quot;node:fs&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;fs/promises&quot;:[&quot;&gt;= 10 &amp;&amp; &lt; 10.1&quot;,&quot;&gt;= 14&quot;],&quot;node:fs/promises&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_agent:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_agent&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_client:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_client&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_common:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_incoming:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_incoming&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_outgoing:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_outgoing&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_http_server:&quot;&gt;= 0.11.1&quot;,&quot;node:_http_server&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http:!0,&quot;node:http&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],http2:&quot;&gt;= 8.8&quot;,&quot;node:http2&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],https:!0,&quot;node:https&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],inspector:&quot;&gt;= 8&quot;,&quot;node:inspector&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;inspector/promises&quot;:[&quot;&gt;= 19&quot;],&quot;node:inspector/promises&quot;:[&quot;&gt;= 19&quot;],_linklist:&quot;&lt; 8&quot;,module:!0,&quot;node:module&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],net:!0,&quot;node:net&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node-inspect/lib/_inspect&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_client&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,&quot;node-inspect/lib/internal/inspect_repl&quot;:&quot;&gt;= 7.6 &amp;&amp; &lt; 12&quot;,os:!0,&quot;node:os&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],path:!0,&quot;node:path&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;path/posix&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/posix&quot;:&quot;&gt;= 16&quot;,&quot;path/win32&quot;:&quot;&gt;= 15.3&quot;,&quot;node:path/win32&quot;:&quot;&gt;= 16&quot;,perf_hooks:&quot;&gt;= 8.5&quot;,&quot;node:perf_hooks&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],process:&quot;&gt;= 1&quot;,&quot;node:process&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],punycode:&quot;&gt;= 0.5&quot;,&quot;node:punycode&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],querystring:!0,&quot;node:querystring&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],readline:!0,&quot;node:readline&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;readline/promises&quot;:&quot;&gt;= 17&quot;,&quot;node:readline/promises&quot;:&quot;&gt;= 17&quot;,repl:!0,&quot;node:repl&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;node:sea&quot;:[&quot;&gt;= 20.12 &amp;&amp; &lt; 21&quot;,&quot;&gt;= 21.7&quot;],smalloc:&quot;&gt;= 0.11.5 &amp;&amp; &lt; 3&quot;,&quot;node:sqlite&quot;:&quot;&gt;= 23.4&quot;,_stream_duplex:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_duplex&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_transform:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_transform&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_wrap:&quot;&gt;= 1.4.1&quot;,&quot;node:_stream_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_passthrough:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_passthrough&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_readable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_readable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_stream_writable:&quot;&gt;= 0.9.4&quot;,&quot;node:_stream_writable&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],stream:!0,&quot;node:stream&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;node:stream/consumers&quot;:&quot;&gt;= 16.7&quot;,&quot;stream/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:stream/promises&quot;:&quot;&gt;= 16&quot;,&quot;stream/web&quot;:&quot;&gt;= 16.5&quot;,&quot;node:stream/web&quot;:&quot;&gt;= 16.5&quot;,string_decoder:!0,&quot;node:string_decoder&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],sys:[&quot;&gt;= 0.4 &amp;&amp; &lt; 0.7&quot;,&quot;&gt;= 0.8&quot;],&quot;node:sys&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;test/reporters&quot;:&quot;&gt;= 19.9 &amp;&amp; &lt; 20.2&quot;,&quot;node:test/reporters&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 19.9&quot;,&quot;&gt;= 20&quot;],&quot;test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test/mock_loader&quot;:&quot;&gt;= 22.3 &amp;&amp; &lt; 22.7&quot;,&quot;node:test&quot;:[&quot;&gt;= 16.17 &amp;&amp; &lt; 17&quot;,&quot;&gt;= 18&quot;],timers:!0,&quot;node:timers&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;timers/promises&quot;:&quot;&gt;= 15&quot;,&quot;node:timers/promises&quot;:&quot;&gt;= 16&quot;,_tls_common:&quot;&gt;= 0.11.13&quot;,&quot;node:_tls_common&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],_tls_legacy:&quot;&gt;= 0.11.3 &amp;&amp; &lt; 10&quot;,_tls_wrap:&quot;&gt;= 0.11.3&quot;,&quot;node:_tls_wrap&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tls:!0,&quot;node:tls&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],trace_events:&quot;&gt;= 10&quot;,&quot;node:trace_events&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],tty:!0,&quot;node:tty&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],url:!0,&quot;node:url&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],util:!0,&quot;node:util&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],&quot;util/types&quot;:&quot;&gt;= 15.3&quot;,&quot;node:util/types&quot;:&quot;&gt;= 16&quot;,&quot;v8/tools/arguments&quot;:&quot;&gt;= 10 &amp;&amp; &lt; 12&quot;,&quot;v8/tools/codemap&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/consarray&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/csvparser&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/logreader&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/profile_view&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],&quot;v8/tools/splaytree&quot;:[&quot;&gt;= 4.4 &amp;&amp; &lt; 5&quot;,&quot;&gt;= 5.2 &amp;&amp; &lt; 12&quot;],v8:&quot;&gt;= 1&quot;,&quot;node:v8&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],vm:!0,&quot;node:vm&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],wasi:[&quot;&gt;= 13.4 &amp;&amp; &lt; 13.5&quot;,&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],&quot;node:wasi&quot;:[&quot;&gt;= 18.17 &amp;&amp; &lt; 19&quot;,&quot;&gt;= 20&quot;],worker_threads:&quot;&gt;= 11.7&quot;,&quot;node:worker_threads&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;],zlib:&quot;&gt;= 0.5&quot;,&quot;node:zlib&quot;:[&quot;&gt;= 14.18 &amp;&amp; &lt; 15&quot;,&quot;&gt;= 16&quot;]}});var W2=T((lke,X2)=&gt;{&quot;use strict&quot;;var iae=sc(),K2=z2(),$2={};for(zd in K2)Object.prototype.hasOwnProperty.call(K2,zd)&amp;&amp;($2[zd]=iae(zd));var zd;X2.exports=$2});var Q2=T((cke,J2)=&gt;{var oae=sc();J2.exports=function(e){return oae(e)}});var tF=T((uke,eF)=&gt;{var sae=sc(),Xi=V(&quot;fs&quot;),dt=V(&quot;path&quot;),aae=vg(),lae=yg(),cae=Rg(),uae=Ng(),fae=process.platform!==&quot;win32&quot;&amp;&amp;Xi.realpathSync&amp;&amp;typeof Xi.realpathSync.native==&quot;function&quot;?Xi.realpathSync.native:Xi.realpathSync,Z2=aae(),pae=function(){return[dt.join(Z2,&quot;.node_modules&quot;),dt.join(Z2,&quot;.node_libraries&quot;)]},dae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;(t.isFile()||t.isFIFO())},hae=function(e){try{var t=Xi.statSync(e,{throwIfNoEntry:!1})}catch(o){if(o&amp;&amp;(o.code===&quot;ENOENT&quot;||o.code===&quot;ENOTDIR&quot;))return!1;throw o}return!!t&amp;&amp;t.isDirectory()},_ae=function(e){try{return fae(e)}catch(t){if(t.code!==&quot;ENOENT&quot;)throw t}return e},lc=function(e,t,o){return o&amp;&amp;o.preserveSymlinks===!1?e(t):t},Eae=function(e,t){var o=e(t);try{var s=JSON.parse(o);return s}catch{}},mae=function(e,t,o){for(var s=cae(t,o,e),a=0;a&lt;s.length;a++)s[a]=dt.join(s[a],e);return s};eF.exports=function(e,t){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Path must be a string.&quot;);var o=uae(e,t),s=o.isFile||dae,a=o.readFileSync||Xi.readFileSync,i=o.isDirectory||hae,n=o.realpathSync||_ae,l=o.readPackageSync||Eae;if(o.readFileSync&amp;&amp;o.readPackageSync)throw new TypeError(&quot;`readFileSync` and `readPackageSync` are mutually exclusive.&quot;);var c=o.packageIterator,u=o.extensions||[&quot;.js&quot;],f=o.includeCoreModules!==!1,_=o.basedir||dt.dirname(lae()),m=o.filename||_;o.paths=o.paths||pae();var O=lc(n,dt.resolve(_),o);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var y=dt.resolve(O,e);(e===&quot;.&quot;||e===&quot;..&quot;||e.slice(-1)===&quot;/&quot;)&amp;&amp;(y+=&quot;/&quot;);var A=F(y)||z(y);if(A)return lc(n,A,o)}else{if(f&amp;&amp;sae(e))return e;var I=B(e,O);if(I)return lc(n,I,o)}var M=new Error(&quot;Cannot find module &#x27;&quot;+e+&quot;&#x27; from &#x27;&quot;+m+&quot;&#x27;&quot;);throw M.code=&quot;MODULE_NOT_FOUND&quot;,M;function F(G){var te=N(dt.dirname(G));if(te&amp;&amp;te.dir&amp;&amp;te.pkg&amp;&amp;o.pathFilter){var $=dt.relative(te.dir,G),le=o.pathFilter(te.pkg,G,$);le&amp;&amp;(G=dt.resolve(te.dir,le))}if(s(G))return G;for(var v=0;v&lt;u.length;v++){var W=G+u[v];if(s(W))return W}}function N(G){if(!(G===&quot;&quot;||G===&quot;/&quot;)&amp;&amp;!(process.platform===&quot;win32&quot;&amp;&amp;/^\w:[/\\]*$/.test(G))&amp;&amp;!/[/\\]node_modules[/\\]*$/.test(G)){var te=dt.join(lc(n,G,o),&quot;package.json&quot;);if(!s(te))return N(dt.dirname(G));var $=l(a,te);return $&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),{pkg:$,dir:G}}}function z(G){var te=dt.join(lc(n,G,o),&quot;/package.json&quot;);if(s(te)){try{var $=l(a,te)}catch{}if($&amp;&amp;o.packageFilter&amp;&amp;($=o.packageFilter($,G)),$&amp;&amp;$.main){if(typeof $.main!=&quot;string&quot;){var le=new TypeError(&quot;package \u201C&quot;+$.name+&quot;\u201D `main` must be a string&quot;);throw le.code=&quot;INVALID_PACKAGE_MAIN&quot;,le}($.main===&quot;.&quot;||$.main===&quot;./&quot;)&amp;&amp;($.main=&quot;index&quot;);try{var v=F(dt.resolve(G,$.main));if(v)return v;var W=z(dt.resolve(G,$.main));if(W)return W}catch{}}}return F(dt.join(G,&quot;/index&quot;))}function B(G,te){for(var $=function(){return mae(G,te,o)},le=c?c(G,te,$,o):$(),v=0;v&lt;le.length;v++){var W=le[v];if(i(dt.dirname(W))){var R=F(W);if(R)return R;var E=z(W);if(E)return E}}}}});var Cg=T((fke,rF)=&gt;{var Kd=Y2();Kd.core=W2();Kd.isCore=Q2();Kd.sync=tF();rF.exports=Kd});var nF=T((pke,Tae)=&gt;{Tae.exports={name:&quot;require-in-the-middle&quot;,version:&quot;7.5.2&quot;,description:&quot;Module to hook into the Node.js require function&quot;,main:&quot;index.js&quot;,types:&quot;types/index.d.ts&quot;,dependencies:{debug:&quot;^4.3.5&quot;,&quot;module-details-from-path&quot;:&quot;^1.0.3&quot;,resolve:&quot;^1.22.8&quot;},devDependencies:{&quot;@babel/core&quot;:&quot;^7.9.0&quot;,&quot;@babel/preset-env&quot;:&quot;^7.9.5&quot;,&quot;@babel/preset-typescript&quot;:&quot;^7.9.0&quot;,&quot;@babel/register&quot;:&quot;^7.9.0&quot;,&quot;ipp-printer&quot;:&quot;^1.0.0&quot;,patterns:&quot;^1.0.3&quot;,roundround:&quot;^0.2.0&quot;,semver:&quot;^6.3.0&quot;,standard:&quot;^14.3.1&quot;,tape:&quot;^4.11.0&quot;},scripts:{test:&quot;npm run test:lint &amp;&amp; npm run test:tape &amp;&amp; npm run test:babel&quot;,&quot;test:lint&quot;:&quot;standard&quot;,&quot;test:tape&quot;:&quot;tape test/*.js&quot;,&quot;test:babel&quot;:&quot;node test/babel/babel-register.js&quot;},repository:{type:&quot;git&quot;,url:&quot;git+https://github.com/nodejs/require-in-the-middle.git&quot;},keywords:[&quot;require&quot;,&quot;hook&quot;,&quot;shim&quot;,&quot;shimmer&quot;,&quot;shimming&quot;,&quot;patch&quot;,&quot;monkey&quot;,&quot;monkeypatch&quot;,&quot;module&quot;,&quot;load&quot;],files:[&quot;types&quot;],author:&quot;Thomas Watson Steen &lt;w@tson.dk&gt; (https://twitter.com/wa7son)&quot;,license:&quot;MIT&quot;,bugs:{url:&quot;https://github.com/nodejs/require-in-the-middle/issues&quot;},homepage:&quot;https://github.com/nodejs/require-in-the-middle#readme&quot;,engines:{node:&quot;&gt;=8.6.0&quot;}}});var Lg=T((dke,bg)=&gt;{&quot;use strict&quot;;var Gs=V(&quot;path&quot;),_r=V(&quot;module&quot;),Fe=y2()(&quot;require-in-the-middle&quot;),Sae=gg();bg.exports=cc;bg.exports.Hook=cc;var Pg,Fs;if(_r.isBuiltin)Fs=_r.isBuiltin;else if(_r.builtinModules)Fs=r=&gt;r.startsWith(&quot;node:&quot;)?!0:(Pg===void 0&amp;&amp;(Pg=new Set(_r.builtinModules)),Pg.has(r));else{let r=Cg(),[e,t]=process.versions.node.split(&quot;.&quot;).map(Number);e===8&amp;&amp;t&lt;8?Fs=o=&gt;o===&quot;http2&quot;?!0:!!r.core[o]:Fs=o=&gt;!!r.core[o]}var $d;function gae(r,e){if(!$d)if(V.resolve&amp;&amp;V.resolve.paths)$d=function(t,o){return V.resolve(t,{paths:[o]})};else{let t=Cg();$d=function(o,s){return t.sync(o,{basedir:s})}}return $d(r,e)}var vae=/([/\\]index)?(\.js)?$/,Ig=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol(&quot;RitmExports&quot;)}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let o=V.cache[e];return!!(o&amp;&amp;this._kRitmExports in o)}}get(e,t){let o=this._localCache.get(e);if(o!==void 0)return o;if(!t){let s=V.cache[e];return s&amp;&amp;s[this._kRitmExports]}}set(e,t,o){o?this._localCache.set(e,t):e in V.cache?V.cache[e][this._kRitmExports]=t:(Fe(&#x27;non-core module is unexpectedly not in require.cache: &quot;%s&quot;&#x27;,e),this._localCache.set(e,t))}};function cc(r,e,t){if(!(this instanceof cc))return new cc(r,e,t);if(typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null),typeof _r._resolveFilename!=&quot;function&quot;){console.error(&quot;Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!&quot;,typeof _r._resolveFilename),console.error(&quot;Please report this error as an issue related to Node.js %s at %s&quot;,process.version,nF().bugs.url);return}this._cache=new Ig,this._unhooked=!1,this._origRequire=_r.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(r);Fe(&quot;registering require hook&quot;),this._require=_r.prototype.require=function(l){return o._unhooked===!0?(Fe(&quot;ignoring require call - module is soft-unhooked&quot;),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule==&quot;function&quot;&amp;&amp;(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(l){return o._unhooked===!0?(Fe(&quot;ignoring process.getBuiltinModule call - module is soft-unhooked&quot;),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(l,c){let u=l[0],f=Fs(u),_;if(f){if(_=u,u.startsWith(&quot;node:&quot;)){let M=u.slice(5);Fs(M)&amp;&amp;(_=M)}}else{if(c)return Fe(&quot;call to process.getBuiltinModule with unknown built-in id&quot;),o._origGetBuiltinModule.apply(this,l);try{_=_r._resolveFilename(u,this)}catch(M){return Fe(&#x27;Module._resolveFilename(&quot;%s&quot;) threw %j, calling original Module.require&#x27;,u,M.message),o._origRequire.apply(this,l)}}let m,O;if(Fe(&quot;processing %s module require(&#x27;%s&#x27;): %s&quot;,f===!0?&quot;core&quot;:&quot;non-core&quot;,u,_),o._cache.has(_,f)===!0)return Fe(&quot;returning already patched cached module: %s&quot;,_),o._cache.get(_,f);let y=s.has(_);y===!1&amp;&amp;s.add(_);let A=c?o._origGetBuiltinModule.apply(this,l):o._origRequire.apply(this,l);if(y===!0)return Fe(&quot;module is in the process of being patched already - ignoring: %s&quot;,_),A;if(s.delete(_),f===!0){if(i===!0&amp;&amp;r.includes(_)===!1)return Fe(&quot;ignoring core module not on whitelist: %s&quot;,_),A;m=_}else if(i===!0&amp;&amp;r.includes(_)){let M=Gs.parse(_);m=M.name,O=M.dir}else{let M=Sae(_);if(M===void 0)return Fe(&quot;could not parse filename: %s&quot;,_),A;m=M.name,O=M.basedir;let F=yae(M);Fe(&quot;resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)&quot;,m,u,F,O);let N=!1;if(i){if(!u.startsWith(&quot;.&quot;)&amp;&amp;r.includes(u)&amp;&amp;(m=u,N=!0),!r.includes(m)&amp;&amp;!r.includes(F))return A;r.includes(F)&amp;&amp;F!==m&amp;&amp;(m=F,N=!0)}if(!N){let z;try{z=gae(m,O)}catch{return Fe(&quot;could not resolve module: %s&quot;,m),o._cache.set(_,A,f),A}if(z!==_)if(a===!0)m=m+Gs.sep+Gs.relative(O,_),Fe(&quot;preparing to process require of internal file: %s&quot;,m);else return Fe(&quot;ignoring require of non-main module file: %s&quot;,z),o._cache.set(_,A,f),A}}o._cache.set(_,A,f),Fe(&quot;calling require hook: %s&quot;,m);let I=t(A,m,O);return o._cache.set(_,I,f),Fe(&quot;returning module: %s&quot;,m),I}}cc.prototype.unhook=function(){this._unhooked=!0,this._require===_r.prototype.require?(_r.prototype.require=this._origRequire,Fe(&quot;require unhook successful&quot;)):Fe(&quot;require unhook unsuccessful&quot;),process.getBuiltinModule!==void 0&amp;&amp;(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Fe(&quot;process.getBuiltinModule unhook successful&quot;)):Fe(&quot;process.getBuiltinModule unhook unsuccessful&quot;))};function yae(r){let e=Gs.sep!==&quot;/&quot;?r.path.split(Gs.sep).join(&quot;/&quot;):r.path;return Gs.posix.join(r.name,e).replace(vae,&quot;&quot;)}});var Xd,Wd,iF=p(()=&gt;{Xd=class{constructor(){this.hooks=[],this.children=new Map}},Wd=class{constructor(){this._trie=new Xd,this._counter=0}insert(e){let t=this._trie;for(let o of e.moduleName.split(&quot;/&quot;)){let s=t.children.get(o);s||(s=new Xd,t.children.set(o,s)),t=s}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split(&quot;/&quot;)){let l=s.children.get(n);if(!l){i=!1;break}o||a.push(...l.hooks),s=l}return o&amp;&amp;i&amp;&amp;a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(t&amp;&amp;a.sort((n,l)=&gt;n.insertedId-l.insertedId),a.map(({hook:n})=&gt;n))}}});import*as xg from&quot;path&quot;;function Aae(r){return xg.sep!==&quot;/&quot;?r.split(xg.sep).join(&quot;/&quot;):r}var sF,Oae,Jd,aF=p(()=&gt;{sF=Nn(Lg());iF();Oae=[&quot;afterEach&quot;,&quot;after&quot;,&quot;beforeEach&quot;,&quot;before&quot;,&quot;describe&quot;,&quot;it&quot;].every(r=&gt;typeof global[r]==&quot;function&quot;),Jd=class r{constructor(){this._moduleNameTrie=new Wd,this._initialize()}_initialize(){new sF.Hook(null,{internals:!0},(e,t,o)=&gt;{let s=Aae(t),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,t,o);return e})}register(e,t){let o={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(o),o}static getInstance(){var e;return Oae?new r:this._instance=(e=this._instance)!==null&amp;&amp;e!==void 0?e:new r}}});var dF=T(Wi=&gt;{var lF=[],Mg=new WeakMap,cF=new WeakMap,uF=new Map,fF=[],Rae={set(r,e,t){return Mg.get(r)[e](t)},get(r,e){if(e===Symbol.toStringTag)return&quot;Module&quot;;let t=cF.get(r)[e];if(typeof t==&quot;function&quot;)return t()},defineProperty(r,e,t){if(!(&quot;value&quot;in t))throw new Error(&quot;Getters/setters are not supported for exports property descriptors.&quot;);return Mg.get(r)[e](t.value)}};function Nae(r,e,t,o,s){uF.set(r,s),Mg.set(e,t),cF.set(e,o);let a=new Proxy(e,Rae);lF.forEach(i=&gt;i(r,a)),fF.push([r,a])}var pF=!1;function Cae(){return pF}function Pae(r){pF=r}Wi.register=Nae;Wi.importHooks=lF;Wi.specifiers=uF;Wi.toHook=fF;Wi.getExperimentalPatchInternals=Cae;Wi.setExperimentalPatchInternals=Pae});var SF=T((Ske,Hs)=&gt;{var hF=V(&quot;path&quot;),Iae=gg(),{fileURLToPath:_F}=V(&quot;url&quot;),{MessageChannel:bae}=V(&quot;worker_threads&quot;),{importHooks:wg,specifiers:Lae,toHook:xae,getExperimentalPatchInternals:Mae}=dF();function mF(r){wg.push(r),xae.forEach(([e,t])=&gt;r(e,t))}function TF(r){let e=wg.indexOf(r);e&gt;-1&amp;&amp;wg.splice(e,1)}function EF(r,e,t,o){let s=r(e,t,o);s&amp;&amp;s!==e&amp;&amp;(e.default=s)}var Dg;function wae(){let{port1:r,port2:e}=new bae,t=0,o;Dg=n=&gt;{t++,r.postMessage(n)},r.on(&quot;message&quot;,()=&gt;{t--,o&amp;&amp;t&lt;=0&amp;&amp;o()}).unref();function s(){let n=setInterval(()=&gt;{},1e3),l=new Promise(c=&gt;{o=c}).then(()=&gt;{clearInterval(n)});return t===0&amp;&amp;o(),l}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function uc(r,e,t){if(!(this instanceof uc))return new uc(r,e,t);typeof r==&quot;function&quot;?(t=r,r=null,e=null):typeof e==&quot;function&quot;&amp;&amp;(t=e,e=null);let o=e?e.internals===!0:!1;Dg&amp;&amp;Array.isArray(r)&amp;&amp;Dg(r),this._iitmHook=(s,a)=&gt;{let i=s,n=s.startsWith(&quot;node:&quot;),l;if(n)s=s.replace(/^node:/,&quot;&quot;);else{if(s.startsWith(&quot;file://&quot;))try{s=_F(s)}catch{}let c=Iae(s);c&amp;&amp;(s=c.name,l=c.basedir)}if(r){for(let c of r)if(c===s){if(l){if(o)s=s+hF.sep+hF.relative(l,_F(i));else if(!Mae()&amp;&amp;!l.endsWith(Lae.get(i)))continue}EF(t,a,s,l)}}else EF(t,a,s,l)},mF(this._iitmHook)}uc.prototype.unhook=function(){TF(this._iitmHook)};Hs.exports=uc;Hs.exports.Hook=uc;Hs.exports.addHook=mF;Hs.exports.removeHook=TF;Hs.exports.createAddHookMessageChannel=wae});function gF(r,e,t){let o,s;try{s=r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}async function vF(r,e,t){let o,s;try{s=await r()}catch(a){o=a}finally{if(e(o,s),o&amp;&amp;!t)throw o;return s}}function Qd(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var Ug=p(()=&gt;{});import*as hn from&quot;path&quot;;import{types as yF}from&quot;util&quot;;import{readFileSync as Dae}from&quot;fs&quot;;function OF(r,e,t){return typeof e&gt;&quot;u&quot;?r.includes(&quot;*&quot;):r.some(o=&gt;(0,AF.satisfies)(e,o,{includePrerelease:t}))}var AF,fc,RF,NF,qs,CF=p(()=&gt;{AF=Nn(jS()),fc=Nn(hg());u2();aF();RF=Nn(SF());P();NF=Nn(Lg());Ug();qs=class extends Gd{constructor(e,t,o){super(e,t,o),this._hooks=[],this._requireInTheMiddleSingleton=Jd.getInstance(),this._enabled=!1,this._wrap=(a,i,n)=&gt;{if(Qd(a[i])&amp;&amp;this._unwrap(a,i),yF.isProxy(a)){let l=(0,fc.wrap)(Object.assign({},a),i,n);return Object.defineProperty(a,i,{value:l}),l}else return(0,fc.wrap)(a,i,n)},this._unwrap=(a,i)=&gt;yF.isProxy(a)?Object.defineProperty(a,i,{value:a[i]}):(0,fc.unwrap)(a,i),this._massWrap=(a,i,n)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(l=&gt;{i.forEach(c=&gt;{this._wrap(l,c,n)})})},this._massUnwrap=(a,i)=&gt;{if(a)Array.isArray(a)||(a=[a]);else{S.error(&quot;must provide one or more modules to patch&quot;);return}if(!(i&amp;&amp;Array.isArray(i))){S.error(&quot;must provide one or more functions to wrap on modules&quot;);return}a.forEach(n=&gt;{i.forEach(l=&gt;{this._unwrap(n,l)})})};let s=this.init();s&amp;&amp;!Array.isArray(s)&amp;&amp;(s=[s]),this._modules=s||[],this._config.enabled&amp;&amp;this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=&gt;{let{name:t}=e;try{let o=V.resolve(t);V.cache[o]&amp;&amp;this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{let t=Dae(hn.join(e,&quot;package.json&quot;),{encoding:&quot;utf8&quot;}),o=JSON.parse(t).version;return typeof o==&quot;string&quot;?o:void 0}catch{S.warn(&quot;Failed extracting version&quot;,e)}}_onRequire(e,t,o,s){var a;if(!s)return typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for nodejs core module on require hook&quot;,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(s);if(e.moduleVersion=i,e.name===o)return OF(e.supportedVersions,i,e.includePrerelease)&amp;&amp;typeof e.patch==&quot;function&quot;&amp;&amp;(e.moduleExports=t,this._enabled)?(this._diag.debug(&quot;Applying instrumentation patch for module on require hook&quot;,{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(t,e.moduleVersion)):t;let n=(a=e.files)!==null&amp;&amp;a!==void 0?a:[],l=hn.normalize(o);return n.filter(u=&gt;u.name===l).filter(u=&gt;OF(u.supportedVersions,i,e.includePrerelease)).reduce((u,f)=&gt;(f.moduleExports=u,this._enabled?(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on require hook&quot;,{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:s}),f.patch(u,e.moduleVersion)):u),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length&gt;0){for(let e of this._modules){typeof e.patch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Applying instrumentation patch for nodejs module file on instrumentation enabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(i,n,l)=&gt;{if(!l&amp;&amp;hn.isAbsolute(n)){let c=hn.parse(n);n=c.name,l=c.dir}return this._onRequire(e,i,n,l)},o=(i,n,l)=&gt;this._onRequire(e,i,n,l),s=hn.isAbsolute(e.name)?new NF.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new RF.Hook([e.name],{internals:!1},t);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==&quot;function&quot;&amp;&amp;e.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&amp;&amp;(this._diag.debug(&quot;Removing instrumentation patch for nodejs module file on instrumentation disabled&quot;,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}});import{normalize as Zd}from&quot;path&quot;;var PF=p(()=&gt;{});var IF=p(()=&gt;{CF();PF()});var kg=p(()=&gt;{IF()});var eh,bF=p(()=&gt;{eh=class{constructor(e,t,o,s,a){this.name=e,this.supportedVersions=t,this.patch=o,this.unpatch=s,this.files=a||[]}}});var th,LF=p(()=&gt;{kg();th=class{constructor(e,t,o,s){this.supportedVersions=t,this.patch=o,this.unpatch=s,this.name=Zd(e)}}});var xF={};Ae(xF,{InstrumentationBase:()=&gt;qs,InstrumentationNodeModuleDefinition:()=&gt;eh,InstrumentationNodeModuleFile:()=&gt;th,isWrapped:()=&gt;Qd,registerInstrumentations:()=&gt;o2,safeExecuteInTheMiddle:()=&gt;gF,safeExecuteInTheMiddleAsync:()=&gt;vF});var MF=p(()=&gt;{s2();kg();bF();LF();Ug()});var Br,wF=p(()=&gt;{Br=(function(){function r(e){this._delegate=e}return r.prototype.export=function(e,t){this._delegate.export(e,t)},r.prototype.forceFlush=function(){return this._delegate.forceFlush()},r.prototype.shutdown=function(){return this._delegate.shutdown()},r})()});var Uae,Ji,rh=p(()=&gt;{Uae=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&amp;&amp;(o[a]=s[a])},r(e,t)};return function(e,t){if(typeof t!=&quot;function&quot;&amp;&amp;t!==null)throw new TypeError(&quot;Class extends value &quot;+String(t)+&quot; is not a constructor or null&quot;);r(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}})(),Ji=(function(r){Uae(e,r);function e(t,o,s){var a=r.call(this,t)||this;return a.name=&quot;OTLPExporterError&quot;,a.data=s,a.code=o,a}return e})(Error)});function kae(r){if(!Number.isNaN(r)&amp;&amp;Number.isFinite(r)&amp;&amp;r&gt;0)return r;throw new Error(&quot;Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: &#x27;&quot;+r+&quot;&#x27;)&quot;)}function nh(r){if(r!=null)return function(){return r}}function ih(r,e,t){var o,s,a,i,n,l;return{timeoutMillis:kae((s=(o=r.timeoutMillis)!==null&amp;&amp;o!==void 0?o:e.timeoutMillis)!==null&amp;&amp;s!==void 0?s:t.timeoutMillis),concurrencyLimit:(i=(a=r.concurrencyLimit)!==null&amp;&amp;a!==void 0?a:e.concurrencyLimit)!==null&amp;&amp;i!==void 0?i:t.concurrencyLimit,compression:(l=(n=r.compression)!==null&amp;&amp;n!==void 0?n:e.compression)!==null&amp;&amp;l!==void 0?l:t.compression}}function oh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:&quot;none&quot;}}var pc=p(()=&gt;{});var sh,DF=p(()=&gt;{(function(r){r.NONE=&quot;none&quot;,r.GZIP=&quot;gzip&quot;})(sh||(sh={}))});function ah(r){return new Fae(r.concurrencyLimit)}var Bae,Vae,Fae,Bg=p(()=&gt;{Bae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Vae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Fae=(function(){function r(e){this._sendingPromises=[],this._concurrencyLimit=e}return r.prototype.pushPromise=function(e){var t=this;if(this.hasReachedLimit())throw new Error(&quot;Concurrency Limit reached&quot;);this._sendingPromises.push(e);var o=function(){var s=t._sendingPromises.indexOf(e);t._sendingPromises.splice(s,1)};e.then(o,o)},r.prototype.hasReachedLimit=function(){return this._sendingPromises.length&gt;=this._concurrencyLimit},r.prototype.awaitAll=function(){return Bae(this,void 0,void 0,function(){return Vae(this,function(e){switch(e.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return e.sent(),[2]}})})},r})()});function kF(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function BF(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Vg(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function VF(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Vg(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var FF=p(()=&gt;{P()});var Er,GF=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Er||(Er={}))});var dc,Fg=p(()=&gt;{GF();FF();dc={getKeyPairs:BF,serializeKeyPairs:kF,parseKeyPairsIntoRecord:VF,parsePairKeyValue:Vg}});function Hae(r){return Object.prototype.hasOwnProperty.call(r,&quot;partialSuccess&quot;)}function HF(){return{handleResponse:function(r){r==null||!Hae(r)||r.partialSuccess==null||Object.keys(r.partialSuccess).length===0||S.warn(&quot;Received Partial Success response:&quot;,JSON.stringify(r.partialSuccess))}}}var qF=p(()=&gt;{P()});function lh(r,e){return new Yae(r.transport,r.serializer,HF(),r.promiseHandler,e.timeout)}var qae,jae,Yae,Gg=p(()=&gt;{Fg();rh();qF();P();qae=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},jae=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yae=(function(){function r(e,t,o,s,a){this._transport=e,this._serializer=t,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=S.createComponentLogger({namespace:&quot;OTLPExportDelegate&quot;})}return r.prototype.export=function(e,t){var o=this;if(this._diagLogger.debug(&quot;items to be sent&quot;,e),this._promiseQueue.hasReachedLimit()){t({code:Er.FAILED,error:new Error(&quot;Concurrent export limit reached&quot;)});return}var s=this._serializer.serializeRequest(e);if(s==null){t({code:Er.FAILED,error:new Error(&quot;Nothing to send&quot;)});return}this._promiseQueue.pushPromise(this._transport.send(s,this._timeout).then(function(a){if(a.status===&quot;success&quot;){if(a.data!=null)try{o._responseHandler.handleResponse(o._serializer.deserializeResponse(a.data))}catch(i){o._diagLogger.warn(&quot;Export succeeded but could not deserialize response - is the response specification compliant?&quot;,i,a.data)}t({code:Er.SUCCESS});return}else if(a.status===&quot;failure&quot;&amp;&amp;a.error){t({code:Er.FAILED,error:a.error});return}else a.status===&quot;retryable&quot;?t({code:Er.FAILED,error:new Ji(&quot;Export failed with retryable status&quot;)}):t({code:Er.FAILED,error:new Ji(&quot;Export failed with unknown error&quot;)})},function(a){return t({code:Er.FAILED,error:a})}))},r.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},r.prototype.shutdown=function(){return qae(this,void 0,void 0,function(){return jae(this,function(e){switch(e.label){case 0:return this._diagLogger.debug(&quot;shutdown started&quot;),[4,this.forceFlush()];case 1:return e.sent(),this._transport.shutdown(),[2]}})})},r})()});function jF(r,e,t){return lh({transport:t,serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var YF=p(()=&gt;{Bg();Gg()});var hc={};Ae(hc,{CompressionAlgorithm:()=&gt;sh,OTLPExporterBase:()=&gt;Br,OTLPExporterError:()=&gt;Ji,createOtlpNetworkExportDelegate:()=&gt;jF,getSharedConfigurationDefaults:()=&gt;oh,mergeOtlpSharedConfigurationWithDefaults:()=&gt;ih});var _n=p(()=&gt;{wF();rh();pc();DF();YF()});function zF(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function _c(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=zF(r.charCodeAt(o)),a=zF(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var KF=p(()=&gt;{});function Hg(r){return r[0]*$ae+r[1]}var zae,Kae,SBe,$ae,$F=p(()=&gt;{zae=9,Kae=6,SBe=Math.pow(10,Kae),$ae=Math.pow(10,zae)});var XF=p(()=&gt;{$F();KF()});function ch(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function qg(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function uh(r){let e=ch(r);return qg(e)}function jg(r){return ch(r).toString()}function WF(r){return r}function JF(r){if(r!==void 0)return _c(r)}function Kn(r){var e,t;if(r===void 0)return Wae;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?uh:Xae,encodeSpanContext:s?WF:_c,encodeOptionalSpanContext:s?WF:JF}}var Xae,Wae,Ec=p(()=&gt;{XF();Xae=typeof BigInt&lt;&quot;u&quot;?jg:Hg;Wae={encodeHrTime:uh,encodeSpanContext:_c,encodeOptionalSpanContext:JF}});var fh,QF=p(()=&gt;{(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]=&quot;SPAN_KIND_UNSPECIFIED&quot;,r[r.SPAN_KIND_INTERNAL=1]=&quot;SPAN_KIND_INTERNAL&quot;,r[r.SPAN_KIND_SERVER=2]=&quot;SPAN_KIND_SERVER&quot;,r[r.SPAN_KIND_CLIENT=3]=&quot;SPAN_KIND_CLIENT&quot;,r[r.SPAN_KIND_PRODUCER=4]=&quot;SPAN_KIND_PRODUCER&quot;,r[r.SPAN_KIND_CONSUMER=5]=&quot;SPAN_KIND_CONSUMER&quot;})(fh||(fh={}))});function js(r){return{name:r.name,version:r.version}}function Vr(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}function ph(r,e){return{key:r,value:dh(e)}}function dh(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(dh)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;ph(t,o))}}:{}}var Ys=p(()=&gt;{});function ZF(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Vr(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;Qae(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;Jae(a,e)),droppedLinksCount:r.droppedLinksCount}}function Jae(r,e){var t;return{attributes:r.attributes?Vr(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function Qae(r,e){return{attributes:r.attributes?Vr(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}var eG=p(()=&gt;{Ys()});function zs(r){return{attributes:Vr(r.attributes),droppedAttributesCount:0}}var hh=p(()=&gt;{Ys()});function Ks(r,e){let t=Kn(e);return{resourceSpans:ele(r,t)}}function Zae(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function ele(r,e){let t=Zae(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;ZF(O,e));l.push({scope:js(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:zs(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var _h=p(()=&gt;{eG();Ec();Ys();hh()});function rG(r,e){let t=Kn(e);return{resource:zs(r.resource),schemaUrl:void 0,scopeMetrics:tle(r.scopeMetrics,t)}}function tle(r,e){return Array.from(r.map(t=&gt;({scope:js(t.scope),metrics:t.metrics.map(o=&gt;rle(o,e)),schemaUrl:t.scope.schemaUrl})))}function rle(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},o=sle(r.aggregationTemporality);switch(r.dataPointType){case lt.SUM:t.sum={aggregationTemporality:o,isMonotonic:r.isMonotonic,dataPoints:tG(r,e)};break;case lt.GAUGE:t.gauge={dataPoints:tG(r,e)};break;case lt.HISTOGRAM:t.histogram={aggregationTemporality:o,dataPoints:ile(r,e)};break;case lt.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:o,dataPoints:ole(r,e)};break}return t}function nle(r,e,t){let o={attributes:Vr(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Ot.INT:o.asInt=r.value;break;case Ot.DOUBLE:o.asDouble=r.value;break}return o}function tG(r,e){return r.dataPoints.map(t=&gt;nle(t,r.descriptor.valueType,e))}function ile(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function ole(r,e){return r.dataPoints.map(t=&gt;{let o=t.value;return{attributes:Vr(t.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function sle(r){switch(r){case ur.DELTA:return 1;case ur.CUMULATIVE:return 2}}var nG=p(()=&gt;{P();Gp();Ec();Ys();hh()});function $s(r,e){return{resourceMetrics:r.map(t=&gt;rG(t,e))}}var Eh=p(()=&gt;{nG()});function Xs(r,e){let t=Kn(e);return{resourceLogs:lle(r,t)}}function ale(r){let e=new Map;for(let t of r){let{resource:o,instrumentationScope:{name:s,version:a=&quot;&quot;,schemaUrl:i=&quot;&quot;}}=t,n=e.get(o);n||(n=new Map,e.set(o,n));let l=`${s}@${a}:${i}`,c=n.get(l);c||(c=[],n.set(l,c)),c.push(t)}return e}function lle(r,e){let t=ale(r);return Array.from(t,([o,s])=&gt;({resource:zs(o),scopeLogs:Array.from(s,([,a])=&gt;({scope:js(a[0].instrumentationScope),logRecords:a.map(i=&gt;cle(i,e)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function cle(r,e){var t,o,s;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:dh(r.body),attributes:ule(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((o=r.spanContext)===null||o===void 0?void 0:o.traceId),spanId:e.encodeOptionalSpanContext((s=r.spanContext)===null||s===void 0?void 0:s.spanId)}}function ule(r){return Object.keys(r).map(e=&gt;ph(e,r[e]))}var mh=p(()=&gt;{Ec();Ys();hh()});var Yg=T((sVe,iG)=&gt;{&quot;use strict&quot;;iG.exports=fle;function fle(r,e){for(var t=new Array(arguments.length-1),o=0,s=2,a=!0;s&lt;arguments.length;)t[o++]=arguments[s++];return new Promise(function(n,l){t[o]=function(u){if(a)if(a=!1,u)l(u);else{for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_++]=arguments[_];n.apply(null,f)}};try{r.apply(e||null,t)}catch(c){a&amp;&amp;(a=!1,l(c))}})}});var lG=T(aG=&gt;{&quot;use strict&quot;;var Th=aG;Th.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4&gt;1&amp;&amp;e.charAt(t)===&quot;=&quot;;)++o;return Math.ceil(e.length*3)/4-o};var Ws=new Array(64),sG=new Array(123);for(mr=0;mr&lt;64;)sG[Ws[mr]=mr&lt;26?mr+65:mr&lt;52?mr+71:mr&lt;62?mr-4:mr-59|43]=mr++;var mr;Th.encode=function(e,t,o){for(var s=null,a=[],i=0,n=0,l;t&lt;o;){var c=e[t++];switch(n){case 0:a[i++]=Ws[c&gt;&gt;2],l=(c&amp;3)&lt;&lt;4,n=1;break;case 1:a[i++]=Ws[l|c&gt;&gt;4],l=(c&amp;15)&lt;&lt;2,n=2;break;case 2:a[i++]=Ws[l|c&gt;&gt;6],a[i++]=Ws[c&amp;63],n=0;break}i&gt;8191&amp;&amp;((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&amp;&amp;(a[i++]=Ws[l],a[i++]=61,n===1&amp;&amp;(a[i++]=61)),s?(i&amp;&amp;s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join(&quot;&quot;)):String.fromCharCode.apply(String,a.slice(0,i))};var oG=&quot;invalid encoding&quot;;Th.decode=function(e,t,o){for(var s=o,a=0,i,n=0;n&lt;e.length;){var l=e.charCodeAt(n++);if(l===61&amp;&amp;a&gt;1)break;if((l=sG[l])===void 0)throw Error(oG);switch(a){case 0:i=l,a=1;break;case 1:t[o++]=i&lt;&lt;2|(l&amp;48)&gt;&gt;4,i=l,a=2;break;case 2:t[o++]=(i&amp;15)&lt;&lt;4|(l&amp;60)&gt;&gt;2,i=l,a=3;break;case 3:t[o++]=(i&amp;3)&lt;&lt;6|l,a=0;break}}if(a===1)throw Error(oG);return o-s};Th.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var uG=T((lVe,cG)=&gt;{&quot;use strict&quot;;cG.exports=Sh;function Sh(){this._listeners={}}Sh.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Sh.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s&lt;o.length;)o[s].fn===t?o.splice(s,1):++s;return this};Sh.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],s=1;s&lt;arguments.length;)o.push(arguments[s++]);for(s=0;s&lt;t.length;)t[s].fn.apply(t[s++].ctx,o)}return this}});var mG=T((cVe,EG)=&gt;{&quot;use strict&quot;;EG.exports=fG(fG);function fG(r){return typeof Float32Array&lt;&quot;u&quot;?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3]}function a(l,c,u){e[0]=l,c[u]=t[3],c[u+1]=t[2],c[u+2]=t[1],c[u+3]=t[0]}r.writeFloatLE=o?s:a,r.writeFloatBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],e[0]}function n(l,c){return t[3]=l[c],t[2]=l[c+1],t[1]=l[c+2],t[0]=l[c+3],e[0]}r.readFloatLE=o?i:n,r.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s&lt;0?1:0;if(n&amp;&amp;(s=-s),s===0)o(1/s&gt;0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s&gt;34028234663852886e22)o((n&lt;&lt;31|2139095040)&gt;&gt;&gt;0,a,i);else if(s&lt;11754943508222875e-54)o((n&lt;&lt;31|Math.round(s/1401298464324817e-60))&gt;&gt;&gt;0,a,i);else{var l=Math.floor(Math.log(s)/Math.LN2),c=Math.round(s*Math.pow(2,-l)*8388608)&amp;8388607;o((n&lt;&lt;31|l+127&lt;&lt;23|c)&gt;&gt;&gt;0,a,i)}}r.writeFloatLE=e.bind(null,pG),r.writeFloatBE=e.bind(null,dG);function t(o,s,a){var i=o(s,a),n=(i&gt;&gt;31)*2+1,l=i&gt;&gt;&gt;23&amp;255,c=i&amp;8388607;return l===255?c?NaN:n*(1/0):l===0?n*1401298464324817e-60*c:n*Math.pow(2,l-150)*(c+8388608)}r.readFloatLE=t.bind(null,hG),r.readFloatBE=t.bind(null,_G)})(),typeof Float64Array&lt;&quot;u&quot;?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function s(l,c,u){e[0]=l,c[u]=t[0],c[u+1]=t[1],c[u+2]=t[2],c[u+3]=t[3],c[u+4]=t[4],c[u+5]=t[5],c[u+6]=t[6],c[u+7]=t[7]}function a(l,c,u){e[0]=l,c[u]=t[7],c[u+1]=t[6],c[u+2]=t[5],c[u+3]=t[4],c[u+4]=t[3],c[u+5]=t[2],c[u+6]=t[1],c[u+7]=t[0]}r.writeDoubleLE=o?s:a,r.writeDoubleBE=o?a:s;function i(l,c){return t[0]=l[c],t[1]=l[c+1],t[2]=l[c+2],t[3]=l[c+3],t[4]=l[c+4],t[5]=l[c+5],t[6]=l[c+6],t[7]=l[c+7],e[0]}function n(l,c){return t[7]=l[c],t[6]=l[c+1],t[5]=l[c+2],t[4]=l[c+3],t[3]=l[c+4],t[2]=l[c+5],t[1]=l[c+6],t[0]=l[c+7],e[0]}r.readDoubleLE=o?i:n,r.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,l){var c=i&lt;0?1:0;if(c&amp;&amp;(i=-i),i===0)o(0,n,l+s),o(1/i&gt;0?0:2147483648,n,l+a);else if(isNaN(i))o(0,n,l+s),o(2146959360,n,l+a);else if(i&gt;17976931348623157e292)o(0,n,l+s),o((c&lt;&lt;31|2146435072)&gt;&gt;&gt;0,n,l+a);else{var u;if(i&lt;22250738585072014e-324)u=i/5e-324,o(u&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|u/4294967296)&gt;&gt;&gt;0,n,l+a);else{var f=Math.floor(Math.log(i)/Math.LN2);f===1024&amp;&amp;(f=1023),u=i*Math.pow(2,-f),o(u*4503599627370496&gt;&gt;&gt;0,n,l+s),o((c&lt;&lt;31|f+1023&lt;&lt;20|u*1048576&amp;1048575)&gt;&gt;&gt;0,n,l+a)}}}r.writeDoubleLE=e.bind(null,pG,0,4),r.writeDoubleBE=e.bind(null,dG,4,0);function t(o,s,a,i,n){var l=o(i,n+s),c=o(i,n+a),u=(c&gt;&gt;31)*2+1,f=c&gt;&gt;&gt;20&amp;2047,_=4294967296*(c&amp;1048575)+l;return f===2047?_?NaN:u*(1/0):f===0?u*5e-324*_:u*Math.pow(2,f-1075)*(_+4503599627370496)}r.readDoubleLE=t.bind(null,hG,0,4),r.readDoubleBE=t.bind(null,_G,4,0)})(),r}function pG(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}function dG(r,e,t){e[t]=r&gt;&gt;&gt;24,e[t+1]=r&gt;&gt;&gt;16&amp;255,e[t+2]=r&gt;&gt;&gt;8&amp;255,e[t+3]=r&amp;255}function hG(r,e){return(r[e]|r[e+1]&lt;&lt;8|r[e+2]&lt;&lt;16|r[e+3]&lt;&lt;24)&gt;&gt;&gt;0}function _G(r,e){return(r[e]&lt;&lt;24|r[e+1]&lt;&lt;16|r[e+2]&lt;&lt;8|r[e+3])&gt;&gt;&gt;0}});var zg=T((exports,module)=&gt;{&quot;use strict&quot;;module.exports=inquire;function inquire(moduleName){try{var mod=eval(&quot;quire&quot;.replace(/^/,&quot;re&quot;))(moduleName);if(mod&amp;&amp;(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var SG=T(TG=&gt;{&quot;use strict&quot;;var Kg=TG;Kg.length=function(e){for(var t=0,o=0,s=0;s&lt;e.length;++s)o=e.charCodeAt(s),o&lt;128?t+=1:o&lt;2048?t+=2:(o&amp;64512)===55296&amp;&amp;(e.charCodeAt(s+1)&amp;64512)===56320?(++s,t+=4):t+=3;return t};Kg.read=function(e,t,o){var s=o-t;if(s&lt;1)return&quot;&quot;;for(var a=null,i=[],n=0,l;t&lt;o;)l=e[t++],l&lt;128?i[n++]=l:l&gt;191&amp;&amp;l&lt;224?i[n++]=(l&amp;31)&lt;&lt;6|e[t++]&amp;63:l&gt;239&amp;&amp;l&lt;365?(l=((l&amp;7)&lt;&lt;18|(e[t++]&amp;63)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63)-65536,i[n++]=55296+(l&gt;&gt;10),i[n++]=56320+(l&amp;1023)):i[n++]=(l&amp;15)&lt;&lt;12|(e[t++]&amp;63)&lt;&lt;6|e[t++]&amp;63,n&gt;8191&amp;&amp;((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&amp;&amp;a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join(&quot;&quot;)):String.fromCharCode.apply(String,i.slice(0,n))};Kg.write=function(e,t,o){for(var s=o,a,i,n=0;n&lt;e.length;++n)a=e.charCodeAt(n),a&lt;128?t[o++]=a:a&lt;2048?(t[o++]=a&gt;&gt;6|192,t[o++]=a&amp;63|128):(a&amp;64512)===55296&amp;&amp;((i=e.charCodeAt(n+1))&amp;64512)===56320?(a=65536+((a&amp;1023)&lt;&lt;10)+(i&amp;1023),++n,t[o++]=a&gt;&gt;18|240,t[o++]=a&gt;&gt;12&amp;63|128,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128):(t[o++]=a&gt;&gt;12|224,t[o++]=a&gt;&gt;6&amp;63|128,t[o++]=a&amp;63|128);return o-s}});var vG=T((fVe,gG)=&gt;{&quot;use strict&quot;;gG.exports=ple;function ple(r,e,t){var o=t||8192,s=o&gt;&gt;&gt;1,a=null,i=o;return function(l){if(l&lt;1||l&gt;s)return r(l);i+l&gt;o&amp;&amp;(a=r(o),i=0);var c=e.call(a,i,i+=l);return i&amp;7&amp;&amp;(i=(i|7)+1),c}}});var OG=T((pVe,yG)=&gt;{&quot;use strict&quot;;yG.exports=tt;var mc=Fr();function tt(r,e){this.lo=r&gt;&gt;&gt;0,this.hi=e&gt;&gt;&gt;0}var Qi=tt.zero=new tt(0,0);Qi.toNumber=function(){return 0};Qi.zzEncode=Qi.zzDecode=function(){return this};Qi.length=function(){return 1};var dle=tt.zeroHash=&quot;\0\0\0\0\0\0\0\0&quot;;tt.fromNumber=function(e){if(e===0)return Qi;var t=e&lt;0;t&amp;&amp;(e=-e);var o=e&gt;&gt;&gt;0,s=(e-o)/4294967296&gt;&gt;&gt;0;return t&amp;&amp;(s=~s&gt;&gt;&gt;0,o=~o&gt;&gt;&gt;0,++o&gt;4294967295&amp;&amp;(o=0,++s&gt;4294967295&amp;&amp;(s=0))),new tt(o,s)};tt.from=function(e){if(typeof e==&quot;number&quot;)return tt.fromNumber(e);if(mc.isString(e))if(mc.Long)e=mc.Long.fromString(e);else return tt.fromNumber(parseInt(e,10));return e.low||e.high?new tt(e.low&gt;&gt;&gt;0,e.high&gt;&gt;&gt;0):Qi};tt.prototype.toNumber=function(e){if(!e&amp;&amp;this.hi&gt;&gt;&gt;31){var t=~this.lo+1&gt;&gt;&gt;0,o=~this.hi&gt;&gt;&gt;0;return t||(o=o+1&gt;&gt;&gt;0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};tt.prototype.toLong=function(e){return mc.Long?new mc.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $n=String.prototype.charCodeAt;tt.fromHash=function(e){return e===dle?Qi:new tt(($n.call(e,0)|$n.call(e,1)&lt;&lt;8|$n.call(e,2)&lt;&lt;16|$n.call(e,3)&lt;&lt;24)&gt;&gt;&gt;0,($n.call(e,4)|$n.call(e,5)&lt;&lt;8|$n.call(e,6)&lt;&lt;16|$n.call(e,7)&lt;&lt;24)&gt;&gt;&gt;0)};tt.prototype.toHash=function(){return String.fromCharCode(this.lo&amp;255,this.lo&gt;&gt;&gt;8&amp;255,this.lo&gt;&gt;&gt;16&amp;255,this.lo&gt;&gt;&gt;24,this.hi&amp;255,this.hi&gt;&gt;&gt;8&amp;255,this.hi&gt;&gt;&gt;16&amp;255,this.hi&gt;&gt;&gt;24)};tt.prototype.zzEncode=function(){var e=this.hi&gt;&gt;31;return this.hi=((this.hi&lt;&lt;1|this.lo&gt;&gt;&gt;31)^e)&gt;&gt;&gt;0,this.lo=(this.lo&lt;&lt;1^e)&gt;&gt;&gt;0,this};tt.prototype.zzDecode=function(){var e=-(this.lo&amp;1);return this.lo=((this.lo&gt;&gt;&gt;1|this.hi&lt;&lt;31)^e)&gt;&gt;&gt;0,this.hi=(this.hi&gt;&gt;&gt;1^e)&gt;&gt;&gt;0,this};tt.prototype.length=function(){var e=this.lo,t=(this.lo&gt;&gt;&gt;28|this.hi&lt;&lt;4)&gt;&gt;&gt;0,o=this.hi&gt;&gt;&gt;24;return o===0?t===0?e&lt;16384?e&lt;128?1:2:e&lt;2097152?3:4:t&lt;16384?t&lt;128?5:6:t&lt;2097152?7:8:o&lt;128?9:10}});var Fr=T($g=&gt;{&quot;use strict&quot;;var K=$g;K.asPromise=Yg();K.base64=lG();K.EventEmitter=uG();K.float=mG();K.inquire=zg();K.utf8=SG();K.pool=vG();K.LongBits=OG();K.isNode=!!(typeof global&lt;&quot;u&quot;&amp;&amp;global&amp;&amp;global.process&amp;&amp;global.process.versions&amp;&amp;global.process.versions.node);K.global=K.isNode&amp;&amp;global||typeof window&lt;&quot;u&quot;&amp;&amp;window||typeof self&lt;&quot;u&quot;&amp;&amp;self||$g;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e==&quot;number&quot;&amp;&amp;isFinite(e)&amp;&amp;Math.floor(e)===e};K.isString=function(e){return typeof e==&quot;string&quot;||e instanceof String};K.isObject=function(e){return e&amp;&amp;typeof e==&quot;object&quot;};K.isset=K.isSet=function(e,t){var o=e[t];return o!=null&amp;&amp;e.hasOwnProperty(t)?typeof o!=&quot;object&quot;||(Array.isArray(o)?o.length:Object.keys(o).length)&gt;0:!1};K.Buffer=(function(){try{var r=K.inquire(&quot;buffer&quot;).Buffer;return r.prototype.utf8Write?r:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e==&quot;number&quot;?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array&gt;&quot;u&quot;?e:new Uint8Array(e)};K.Array=typeof Uint8Array&lt;&quot;u&quot;?Uint8Array:Array;K.Long=K.global.dcodeIO&amp;&amp;K.global.dcodeIO.Long||K.global.Long||K.inquire(&quot;long&quot;);K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,t){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,t):o.toNumber(!!t)};function AG(r,e,t){for(var o=Object.keys(e),s=0;s&lt;o.length;++s)(r[o[s]]===void 0||!t)&amp;&amp;(r[o[s]]=e[o[s]]);return r}K.merge=AG;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function RG(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,&quot;message&quot;,{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,&quot;stack&quot;,{value:new Error().stack||&quot;&quot;}),o&amp;&amp;AG(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+&quot;: &quot;+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}K.newError=RG;K.ProtocolError=RG(&quot;ProtocolError&quot;);K.oneOfGetter=function(e){for(var t={},o=0;o&lt;e.length;++o)t[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a&gt;-1;--a)if(t[s[a]]===1&amp;&amp;this[s[a]]!==void 0&amp;&amp;this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(t){for(var o=0;o&lt;e.length;++o)e[o]!==t&amp;&amp;delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var r=K.Buffer;if(!r){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=r.from!==Uint8Array.from&amp;&amp;r.from||function(t,o){return new r(t,o)},K._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var vh=T((hVe,IG)=&gt;{&quot;use strict&quot;;IG.exports=Ee;var er=Fr(),Xg,gh=er.LongBits,NG=er.base64,CG=er.utf8;function Tc(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Jg(){}function hle(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function Ee(){this.len=0,this.head=new Tc(Jg,0,0),this.tail=this.head,this.states=null}var PG=function(){return er.Buffer?function(){return(Ee.create=function(){return new Xg})()}:function(){return new Ee}};Ee.create=PG();Ee.alloc=function(e){return new er.Array(e)};er.Array!==Array&amp;&amp;(Ee.alloc=er.pool(Ee.alloc,er.Array.prototype.subarray));Ee.prototype._push=function(e,t,o){return this.tail=this.tail.next=new Tc(e,t,o),this.len+=t,this};function Qg(r,e,t){e[t]=r&amp;255}function _le(r,e,t){for(;r&gt;127;)e[t++]=r&amp;127|128,r&gt;&gt;&gt;=7;e[t]=r}function Zg(r,e){this.len=r,this.next=void 0,this.val=e}Zg.prototype=Object.create(Tc.prototype);Zg.prototype.fn=_le;Ee.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zg((e=e&gt;&gt;&gt;0)&lt;128?1:e&lt;16384?2:e&lt;2097152?3:e&lt;268435456?4:5,e)).len,this};Ee.prototype.int32=function(e){return e&lt;0?this._push(ev,10,gh.fromNumber(e)):this.uint32(e)};Ee.prototype.sint32=function(e){return this.uint32((e&lt;&lt;1^e&gt;&gt;31)&gt;&gt;&gt;0)};function ev(r,e,t){for(;r.hi;)e[t++]=r.lo&amp;127|128,r.lo=(r.lo&gt;&gt;&gt;7|r.hi&lt;&lt;25)&gt;&gt;&gt;0,r.hi&gt;&gt;&gt;=7;for(;r.lo&gt;127;)e[t++]=r.lo&amp;127|128,r.lo=r.lo&gt;&gt;&gt;7;e[t++]=r.lo}Ee.prototype.uint64=function(e){var t=gh.from(e);return this._push(ev,t.length(),t)};Ee.prototype.int64=Ee.prototype.uint64;Ee.prototype.sint64=function(e){var t=gh.from(e).zzEncode();return this._push(ev,t.length(),t)};Ee.prototype.bool=function(e){return this._push(Qg,1,e?1:0)};function Wg(r,e,t){e[t]=r&amp;255,e[t+1]=r&gt;&gt;&gt;8&amp;255,e[t+2]=r&gt;&gt;&gt;16&amp;255,e[t+3]=r&gt;&gt;&gt;24}Ee.prototype.fixed32=function(e){return this._push(Wg,4,e&gt;&gt;&gt;0)};Ee.prototype.sfixed32=Ee.prototype.fixed32;Ee.prototype.fixed64=function(e){var t=gh.from(e);return this._push(Wg,4,t.lo)._push(Wg,4,t.hi)};Ee.prototype.sfixed64=Ee.prototype.fixed64;Ee.prototype.float=function(e){return this._push(er.float.writeFloatLE,4,e)};Ee.prototype.double=function(e){return this._push(er.float.writeDoubleLE,8,e)};var Ele=er.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var s=0;s&lt;e.length;++s)t[o+s]=e[s]};Ee.prototype.bytes=function(e){var t=e.length&gt;&gt;&gt;0;if(!t)return this._push(Qg,1,0);if(er.isString(e)){var o=Ee.alloc(t=NG.length(e));NG.decode(e,o,0),e=o}return this.uint32(t)._push(Ele,t,e)};Ee.prototype.string=function(e){var t=CG.length(e);return t?this.uint32(t)._push(CG.write,t,e):this._push(Qg,1,0)};Ee.prototype.fork=function(){return this.states=new hle(this),this.head=this.tail=new Tc(Jg,0,0),this.len=0,this};Ee.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Tc(Jg,0,0),this.len=0),this};Ee.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&amp;&amp;(this.tail.next=e.next,this.tail=t,this.len+=o),this};Ee.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};Ee._configure=function(r){Xg=r,Ee.create=PG(),Xg._configure()}});var xG=T((_Ve,LG)=&gt;{&quot;use strict&quot;;LG.exports=Gr;var bG=vh();(Gr.prototype=Object.create(bG.prototype)).constructor=Gr;var Xn=Fr();function Gr(){bG.call(this)}Gr._configure=function(){Gr.alloc=Xn._Buffer_allocUnsafe,Gr.writeBytesBuffer=Xn.Buffer&amp;&amp;Xn.Buffer.prototype instanceof Uint8Array&amp;&amp;Xn.Buffer.prototype.set.name===&quot;set&quot;?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var s=0;s&lt;e.length;)t[o++]=e[s++]}};Gr.prototype.bytes=function(e){Xn.isString(e)&amp;&amp;(e=Xn._Buffer_from(e,&quot;base64&quot;));var t=e.length&gt;&gt;&gt;0;return this.uint32(t),t&amp;&amp;this._push(Gr.writeBytesBuffer,t,e),this};function mle(r,e,t){r.length&lt;40?Xn.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Gr.prototype.string=function(e){var t=Xn.Buffer.byteLength(e);return this.uint32(t),t&amp;&amp;this._push(mle,t,e),this};Gr._configure()});var Oh=T((EVe,kG)=&gt;{&quot;use strict&quot;;kG.exports=Ge;var Tr=Fr(),rv,DG=Tr.LongBits,Tle=Tr.utf8;function Sr(r,e){return RangeError(&quot;index out of range: &quot;+r.pos+&quot; + &quot;+(e||1)+&quot; &gt; &quot;+r.len)}function Ge(r){this.buf=r,this.pos=0,this.len=r.length}var MG=typeof Uint8Array&lt;&quot;u&quot;?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)}:function(e){if(Array.isArray(e))return new Ge(e);throw Error(&quot;illegal buffer&quot;)},UG=function(){return Tr.Buffer?function(t){return(Ge.create=function(s){return Tr.Buffer.isBuffer(s)?new rv(s):MG(s)})(t)}:MG};Ge.create=UG();Ge.prototype._slice=Tr.Array.prototype.subarray||Tr.Array.prototype.slice;Ge.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&amp;127)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;14)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;127)&lt;&lt;21)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)||(e=(e|(this.buf[this.pos]&amp;15)&lt;&lt;28)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128))return e;if((this.pos+=5)&gt;this.len)throw this.pos=this.len,Sr(this,10);return e}})();Ge.prototype.int32=function(){return this.uint32()|0};Ge.prototype.sint32=function(){var e=this.uint32();return e&gt;&gt;&gt;1^-(e&amp;1)|0};function tv(){var r=new DG(0,0),e=0;if(this.len-this.pos&gt;4){for(;e&lt;4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;28)&gt;&gt;&gt;0,r.hi=(r.hi|(this.buf[this.pos]&amp;127)&gt;&gt;4)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r;e=0}else{for(;e&lt;3;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.lo=(r.lo|(this.buf[this.pos]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&amp;127)&lt;&lt;e*7)&gt;&gt;&gt;0,r}if(this.len-this.pos&gt;4){for(;e&lt;5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}else for(;e&lt;5;++e){if(this.pos&gt;=this.len)throw Sr(this);if(r.hi=(r.hi|(this.buf[this.pos]&amp;127)&lt;&lt;e*7+3)&gt;&gt;&gt;0,this.buf[this.pos++]&lt;128)return r}throw Error(&quot;invalid varint encoding&quot;)}Ge.prototype.bool=function(){return this.uint32()!==0};function yh(r,e){return(r[e-4]|r[e-3]&lt;&lt;8|r[e-2]&lt;&lt;16|r[e-1]&lt;&lt;24)&gt;&gt;&gt;0}Ge.prototype.fixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)};Ge.prototype.sfixed32=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);return yh(this.buf,this.pos+=4)|0};function wG(){if(this.pos+8&gt;this.len)throw Sr(this,8);return new DG(yh(this.buf,this.pos+=4),yh(this.buf,this.pos+=4))}Ge.prototype.float=function(){if(this.pos+4&gt;this.len)throw Sr(this,4);var e=Tr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Ge.prototype.double=function(){if(this.pos+8&gt;this.len)throw Sr(this,4);var e=Tr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Ge.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o&gt;this.len)throw Sr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,o);if(t===o){var s=Tr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,o)};Ge.prototype.string=function(){var e=this.bytes();return Tle.read(e,0,e.length)};Ge.prototype.skip=function(e){if(typeof e==&quot;number&quot;){if(this.pos+e&gt;this.len)throw Sr(this,e);this.pos+=e}else do if(this.pos&gt;=this.len)throw Sr(this);while(this.buf[this.pos++]&amp;128);return this};Ge.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&amp;7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error(&quot;invalid wire type &quot;+r+&quot; at offset &quot;+this.pos)}return this};Ge._configure=function(r){rv=r,Ge.create=UG(),rv._configure();var e=Tr.Long?&quot;toLong&quot;:&quot;toNumber&quot;;Tr.merge(Ge.prototype,{int64:function(){return tv.call(this)[e](!1)},uint64:function(){return tv.call(this)[e](!0)},sint64:function(){return tv.call(this).zzDecode()[e](!1)},fixed64:function(){return wG.call(this)[e](!0)},sfixed64:function(){return wG.call(this)[e](!1)}})}});var GG=T((mVe,FG)=&gt;{&quot;use strict&quot;;FG.exports=Zi;var VG=Oh();(Zi.prototype=Object.create(VG.prototype)).constructor=Zi;var BG=Fr();function Zi(r){VG.call(this,r)}Zi._configure=function(){BG.Buffer&amp;&amp;(Zi.prototype._slice=BG.Buffer.prototype.slice)};Zi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(&quot;utf-8&quot;,this.pos,this.pos=Math.min(this.pos+e,this.len))};Zi._configure()});var qG=T((TVe,HG)=&gt;{&quot;use strict&quot;;HG.exports=Sc;var nv=Fr();(Sc.prototype=Object.create(nv.EventEmitter.prototype)).constructor=Sc;function Sc(r,e,t){if(typeof r!=&quot;function&quot;)throw TypeError(&quot;rpcImpl must be a function&quot;);nv.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Sc.prototype.rpcCall=function r(e,t,o,s,a){if(!s)throw TypeError(&quot;request must be specified&quot;);var i=this;if(!a)return nv.asPromise(r,i,e,t,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error(&quot;already ended&quot;))},0);return}try{return i.rpcImpl(e,t[i.requestDelimited?&quot;encodeDelimited&quot;:&quot;encode&quot;](s).finish(),function(l,c){if(l)return i.emit(&quot;error&quot;,l,e),a(l);if(c===null){i.end(!0);return}if(!(c instanceof o))try{c=o[i.responseDelimited?&quot;decodeDelimited&quot;:&quot;decode&quot;](c)}catch(u){return i.emit(&quot;error&quot;,u,e),a(u)}return i.emit(&quot;data&quot;,c,e),a(null,c)})}catch(n){i.emit(&quot;error&quot;,n,e),setTimeout(function(){a(n)},0);return}};Sc.prototype.end=function(e){return this.rpcImpl&amp;&amp;(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(&quot;end&quot;).off()),this}});var iv=T(jG=&gt;{&quot;use strict&quot;;var Sle=jG;Sle.Service=qG()});var ov=T((gVe,YG)=&gt;{&quot;use strict&quot;;YG.exports={}});var sv=T(KG=&gt;{&quot;use strict&quot;;var Ct=KG;Ct.build=&quot;minimal&quot;;Ct.Writer=vh();Ct.BufferWriter=xG();Ct.Reader=Oh();Ct.BufferReader=GG();Ct.util=Fr();Ct.rpc=iv();Ct.roots=ov();Ct.configure=zG;function zG(){Ct.util._configure(),Ct.Writer._configure(Ct.BufferWriter),Ct.Reader._configure(Ct.BufferReader)}zG()});var XG=T((yVe,$G)=&gt;{&quot;use strict&quot;;$G.exports=sv()});var JG=T((OVe,WG)=&gt;{&quot;use strict&quot;;var X=XG(),g=X.Reader,oe=X.Writer,h=X.util,d=X.roots.default||(X.roots.default={});d.opentelemetry=(function(){var r={};return r.proto=(function(){var e={};return e.common=(function(){var t={};return t.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;intValue&quot;,&quot;doubleValue&quot;,&quot;arrayValue&quot;,&quot;kvlistValue&quot;,&quot;bytesValue&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.stringValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;stringValue&quot;)&amp;&amp;l.uint32(10).string(n.stringValue),n.boolValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;boolValue&quot;)&amp;&amp;l.uint32(16).bool(n.boolValue),n.intValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;intValue&quot;)&amp;&amp;l.uint32(24).int64(n.intValue),n.doubleValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;doubleValue&quot;)&amp;&amp;l.uint32(33).double(n.doubleValue),n.arrayValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;arrayValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,l.uint32(42).fork()).ldelim(),n.kvlistValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;kvlistValue&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,l.uint32(50).fork()).ldelim(),n.bytesValue!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;bytesValue&quot;)&amp;&amp;l.uint32(58).bytes(n.bytesValue),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.common.v1.AnyValue;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.stringValue=n.string();break}case 2:{u.boolValue=n.bool();break}case 3:{u.intValue=n.int64();break}case 4:{u.doubleValue=n.double();break}case 5:{u.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{u.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{u.bytesValue=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(l.value=1,!h.isString(n.stringValue)))return&quot;stringValue: string expected&quot;;if(n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.boolValue!=&quot;boolean&quot;)return&quot;boolValue: boolean expected&quot;}if(n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.intValue)&amp;&amp;!(n.intValue&amp;&amp;h.isInteger(n.intValue.low)&amp;&amp;h.isInteger(n.intValue.high)))return&quot;intValue: integer|Long expected&quot;}if(n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,typeof n.doubleValue!=&quot;number&quot;)return&quot;doubleValue: number expected&quot;}if(n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(c)return&quot;arrayValue.&quot;+c}}if(n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;l.value=1;{var c=d.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(c)return&quot;kvlistValue.&quot;+c}}if(n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!(n.bytesValue&amp;&amp;typeof n.bytesValue.length==&quot;number&quot;||h.isString(n.bytesValue)))return&quot;bytesValue: buffer expected&quot;}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.common.v1.AnyValue)return n;var l=new d.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&amp;&amp;(l.stringValue=String(n.stringValue)),n.boolValue!=null&amp;&amp;(l.boolValue=!!n.boolValue),n.intValue!=null&amp;&amp;(h.Long?(l.intValue=h.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue==&quot;string&quot;?l.intValue=parseInt(n.intValue,10):typeof n.intValue==&quot;number&quot;?l.intValue=n.intValue:typeof n.intValue==&quot;object&quot;&amp;&amp;(l.intValue=new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber())),n.doubleValue!=null&amp;&amp;(l.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected&quot;);l.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected&quot;);l.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&amp;&amp;(typeof n.bytesValue==&quot;string&quot;?h.base64.decode(n.bytesValue,l.bytesValue=h.newBuffer(h.base64.length(n.bytesValue)),0):n.bytesValue.length&gt;=0&amp;&amp;(l.bytesValue=n.bytesValue)),l},s.toObject=function(n,l){l||(l={});var c={};return n.stringValue!=null&amp;&amp;n.hasOwnProperty(&quot;stringValue&quot;)&amp;&amp;(c.stringValue=n.stringValue,l.oneofs&amp;&amp;(c.value=&quot;stringValue&quot;)),n.boolValue!=null&amp;&amp;n.hasOwnProperty(&quot;boolValue&quot;)&amp;&amp;(c.boolValue=n.boolValue,l.oneofs&amp;&amp;(c.value=&quot;boolValue&quot;)),n.intValue!=null&amp;&amp;n.hasOwnProperty(&quot;intValue&quot;)&amp;&amp;(typeof n.intValue==&quot;number&quot;?c.intValue=l.longs===String?String(n.intValue):n.intValue:c.intValue=l.longs===String?h.Long.prototype.toString.call(n.intValue):l.longs===Number?new h.LongBits(n.intValue.low&gt;&gt;&gt;0,n.intValue.high&gt;&gt;&gt;0).toNumber():n.intValue,l.oneofs&amp;&amp;(c.value=&quot;intValue&quot;)),n.doubleValue!=null&amp;&amp;n.hasOwnProperty(&quot;doubleValue&quot;)&amp;&amp;(c.doubleValue=l.json&amp;&amp;!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,l.oneofs&amp;&amp;(c.value=&quot;doubleValue&quot;)),n.arrayValue!=null&amp;&amp;n.hasOwnProperty(&quot;arrayValue&quot;)&amp;&amp;(c.arrayValue=d.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,l),l.oneofs&amp;&amp;(c.value=&quot;arrayValue&quot;)),n.kvlistValue!=null&amp;&amp;n.hasOwnProperty(&quot;kvlistValue&quot;)&amp;&amp;(c.kvlistValue=d.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,l),l.oneofs&amp;&amp;(c.value=&quot;kvlistValue&quot;)),n.bytesValue!=null&amp;&amp;n.hasOwnProperty(&quot;bytesValue&quot;)&amp;&amp;(c.bytesValue=l.bytes===String?h.base64.encode(n.bytesValue,0,n.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,l.oneofs&amp;&amp;(c.value=&quot;bytesValue&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.common.v1.AnyValue&quot;},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.AnyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.ArrayValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new d.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.ArrayValue.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.ArrayValue&quot;},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.values=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.values!=null&amp;&amp;i.values.length)for(var l=0;l&lt;i.values.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.values[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValueList;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.values&amp;&amp;c.values.length||(c.values=[]),c.values.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.values!=null&amp;&amp;i.hasOwnProperty(&quot;values&quot;)){if(!Array.isArray(i.values))return&quot;values: array expected&quot;;for(var n=0;n&lt;i.values.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(l)return&quot;values.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new d.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: array expected&quot;);n.values=[];for(var l=0;l&lt;i.values.length;++l){if(typeof i.values[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValueList.values: object expected&quot;);n.values[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.values=[]),i.values&amp;&amp;i.values.length){l.values=[];for(var c=0;c&lt;i.values.length;++c)l.values[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValueList&quot;},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.key!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;key&quot;)&amp;&amp;n.uint32(10).string(i.key),i.value!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;value&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.KeyValue;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.key=i.string();break}case 2:{c.value=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;!h.isString(i.key))return&quot;key: string expected&quot;;if(i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return&quot;value.&quot;+n}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.KeyValue)return i;var n=new d.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&amp;&amp;(n.key=String(i.key)),i.value!=null){if(typeof i.value!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.KeyValue.value: object expected&quot;);n.value=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.key=&quot;&quot;,l.value=null),i.key!=null&amp;&amp;i.hasOwnProperty(&quot;key&quot;)&amp;&amp;(l.key=i.key),i.value!=null&amp;&amp;i.hasOwnProperty(&quot;value&quot;)&amp;&amp;(l.value=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.KeyValue&quot;},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(10).string(i.name),i.version!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;version&quot;)&amp;&amp;n.uint32(18).string(i.version),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.common.v1.InstrumentationScope;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.name=i.string();break}case 2:{c.version=i.string();break}case 3:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;!h.isString(i.version))return&quot;version: string expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new d.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&amp;&amp;(n.name=String(i.name)),i.version!=null&amp;&amp;(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.name=&quot;&quot;,l.version=&quot;&quot;,l.droppedAttributesCount=0),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.version!=null&amp;&amp;i.hasOwnProperty(&quot;version&quot;)&amp;&amp;(l.version=i.version),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.common.v1.InstrumentationScope&quot;},s})(),o})(),t})(),e.resource=(function(){var t={};return t.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(10).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(16).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.resource.v1.Resource;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.droppedAttributesCount=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.resource.v1.Resource)return i;var n=new d.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.resource.v1.Resource.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults&amp;&amp;(l.droppedAttributesCount=0),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var c=0;c&lt;i.attributes.length;++c)l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[c],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.resource.v1.Resource&quot;},s})(),o})(),t})(),e.trace=(function(){var t={};return t.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceSpans!=null&amp;&amp;i.resourceSpans.length)for(var l=0;l&lt;i.resourceSpans.length;++l)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.TracesData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceSpans&amp;&amp;c.resourceSpans.length||(c.resourceSpans=[]),c.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceSpans!=null&amp;&amp;i.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(i.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var n=0;n&lt;i.resourceSpans.length;++n){var l=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(l)return&quot;resourceSpans.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.TracesData)return i;var n=new d.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected&quot;);n.resourceSpans=[];for(var l=0;l&lt;i.resourceSpans.length;++l){if(typeof i.resourceSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected&quot;);n.resourceSpans[l]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceSpans=[]),i.resourceSpans&amp;&amp;i.resourceSpans.length){l.resourceSpans=[];for(var c=0;c&lt;i.resourceSpans.length;++c)l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.TracesData&quot;},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&amp;&amp;i.scopeSpans.length)for(var l=0;l&lt;i.scopeSpans.length;++l)d.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ResourceSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeSpans&amp;&amp;c.scopeSpans.length||(c.scopeSpans=[]),c.scopeSpans.push(d.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeSpans!=null&amp;&amp;i.hasOwnProperty(&quot;scopeSpans&quot;)){if(!Array.isArray(i.scopeSpans))return&quot;scopeSpans: array expected&quot;;for(var l=0;l&lt;i.scopeSpans.length;++l){var n=d.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[l]);if(n)return&quot;scopeSpans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected&quot;);n.scopeSpans=[];for(var l=0;l&lt;i.scopeSpans.length;++l){if(typeof i.scopeSpans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected&quot;);n.scopeSpans[l]=d.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeSpans=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&amp;&amp;i.scopeSpans.length){l.scopeSpans=[];for(var c=0;c&lt;i.scopeSpans.length;++c)l.scopeSpans[c]=d.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ResourceSpans&quot;},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&amp;&amp;i.spans.length)for(var l=0;l&lt;i.spans.length;++l)d.opentelemetry.proto.trace.v1.Span.encode(i.spans[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.ScopeSpans;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.spans&amp;&amp;c.spans.length||(c.spans=[]),c.spans.push(d.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.spans!=null&amp;&amp;i.hasOwnProperty(&quot;spans&quot;)){if(!Array.isArray(i.spans))return&quot;spans: array expected&quot;;for(var l=0;l&lt;i.spans.length;++l){var n=d.opentelemetry.proto.trace.v1.Span.verify(i.spans[l]);if(n)return&quot;spans.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new d.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected&quot;);n.spans=[];for(var l=0;l&lt;i.spans.length;++l){if(typeof i.spans[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected&quot;);n.spans[l]=d.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.spans=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&amp;&amp;i.spans.length){l.spans=[];for(var c=0;c&lt;i.spans.length;++c)l.spans[c]=d.opentelemetry.proto.trace.v1.Span.toObject(i.spans[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.ScopeSpans&quot;},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=h.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=h.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(10).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(18).bytes(i.spanId),i.traceState!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceState&quot;)&amp;&amp;n.uint32(26).string(i.traceState),i.parentSpanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;parentSpanId&quot;)&amp;&amp;n.uint32(34).bytes(i.parentSpanId),i.name!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;name&quot;)&amp;&amp;n.uint32(42).string(i.name),i.kind!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;kind&quot;)&amp;&amp;n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;endTimeUnixNano&quot;)&amp;&amp;n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&amp;&amp;i.events.length)for(var l=0;l&lt;i.events.length;++l)d.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[l],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedEventsCount&quot;)&amp;&amp;n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&amp;&amp;i.links.length)for(var l=0;l&lt;i.links.length;++l)d.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[l],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedLinksCount&quot;)&amp;&amp;n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;status&quot;)&amp;&amp;d.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Span;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.traceId=i.bytes();break}case 2:{c.spanId=i.bytes();break}case 3:{c.traceState=i.string();break}case 4:{c.parentSpanId=i.bytes();break}case 5:{c.name=i.string();break}case 6:{c.kind=i.int32();break}case 7:{c.startTimeUnixNano=i.fixed64();break}case 8:{c.endTimeUnixNano=i.fixed64();break}case 9:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{c.droppedAttributesCount=i.uint32();break}case 11:{c.events&amp;&amp;c.events.length||(c.events=[]),c.events.push(d.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{c.droppedEventsCount=i.uint32();break}case 13:{c.links&amp;&amp;c.links.length||(c.links=[]),c.links.push(d.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{c.droppedLinksCount=i.uint32();break}case 15:{c.status=d.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId)))return&quot;traceId: buffer expected&quot;;if(i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId)))return&quot;spanId: buffer expected&quot;;if(i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(i.traceState))return&quot;traceState: string expected&quot;;if(i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;!(i.parentSpanId&amp;&amp;typeof i.parentSpanId.length==&quot;number&quot;||h.isString(i.parentSpanId)))return&quot;parentSpanId: buffer expected&quot;;if(i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(i.name))return&quot;name: string expected&quot;;if(i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;))switch(i.kind){default:return&quot;kind: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.endTimeUnixNano)&amp;&amp;!(i.endTimeUnixNano&amp;&amp;h.isInteger(i.endTimeUnixNano.low)&amp;&amp;h.isInteger(i.endTimeUnixNano.high)))return&quot;endTimeUnixNano: integer|Long expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount))return&quot;droppedAttributesCount: integer expected&quot;;if(i.events!=null&amp;&amp;i.hasOwnProperty(&quot;events&quot;)){if(!Array.isArray(i.events))return&quot;events: array expected&quot;;for(var n=0;n&lt;i.events.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(l)return&quot;events.&quot;+l}}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;!h.isInteger(i.droppedEventsCount))return&quot;droppedEventsCount: integer expected&quot;;if(i.links!=null&amp;&amp;i.hasOwnProperty(&quot;links&quot;)){if(!Array.isArray(i.links))return&quot;links: array expected&quot;;for(var n=0;n&lt;i.links.length;++n){var l=d.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(l)return&quot;links.&quot;+l}}if(i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;!h.isInteger(i.droppedLinksCount))return&quot;droppedLinksCount: integer expected&quot;;if(i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)){var l=d.opentelemetry.proto.trace.v1.Status.verify(i.status);if(l)return&quot;status.&quot;+l}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Span)return i;var n=new d.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),i.traceState!=null&amp;&amp;(n.traceState=String(i.traceState)),i.parentSpanId!=null&amp;&amp;(typeof i.parentSpanId==&quot;string&quot;?h.base64.decode(i.parentSpanId,n.parentSpanId=h.newBuffer(h.base64.length(i.parentSpanId)),0):i.parentSpanId.length&gt;=0&amp;&amp;(n.parentSpanId=i.parentSpanId)),i.name!=null&amp;&amp;(n.name=String(i.name)),i.kind){default:if(typeof i.kind==&quot;number&quot;){n.kind=i.kind;break}break;case&quot;SPAN_KIND_UNSPECIFIED&quot;:case 0:n.kind=0;break;case&quot;SPAN_KIND_INTERNAL&quot;:case 1:n.kind=1;break;case&quot;SPAN_KIND_SERVER&quot;:case 2:n.kind=2;break;case&quot;SPAN_KIND_CLIENT&quot;:case 3:n.kind=3;break;case&quot;SPAN_KIND_PRODUCER&quot;:case 4:n.kind=4;break;case&quot;SPAN_KIND_CONSUMER&quot;:case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.endTimeUnixNano!=null&amp;&amp;(h.Long?(n.endTimeUnixNano=h.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano==&quot;string&quot;?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano==&quot;number&quot;?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano==&quot;object&quot;&amp;&amp;(n.endTimeUnixNano=new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.events){if(!Array.isArray(i.events))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: array expected&quot;);n.events=[];for(var l=0;l&lt;i.events.length;++l){if(typeof i.events[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.events: object expected&quot;);n.events[l]=d.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[l])}}if(i.droppedEventsCount!=null&amp;&amp;(n.droppedEventsCount=i.droppedEventsCount&gt;&gt;&gt;0),i.links){if(!Array.isArray(i.links))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: array expected&quot;);n.links=[];for(var l=0;l&lt;i.links.length;++l){if(typeof i.links[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.links: object expected&quot;);n.links[l]=d.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[l])}}if(i.droppedLinksCount!=null&amp;&amp;(n.droppedLinksCount=i.droppedLinksCount&gt;&gt;&gt;0),i.status!=null){if(typeof i.status!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.status: object expected&quot;);n.status=d.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[],l.events=[],l.links=[]),n.defaults){if(n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),l.traceState=&quot;&quot;,n.bytes===String?l.parentSpanId=&quot;&quot;:(l.parentSpanId=[],n.bytes!==Array&amp;&amp;(l.parentSpanId=h.newBuffer(l.parentSpanId))),l.name=&quot;&quot;,l.kind=n.enums===String?&quot;SPAN_KIND_UNSPECIFIED&quot;:0,h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.endTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.endTimeUnixNano=n.longs===String?&quot;0&quot;:0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null}if(i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&amp;&amp;i.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(l.traceState=i.traceState),i.parentSpanId!=null&amp;&amp;i.hasOwnProperty(&quot;parentSpanId&quot;)&amp;&amp;(l.parentSpanId=n.bytes===String?h.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&amp;&amp;i.hasOwnProperty(&quot;name&quot;)&amp;&amp;(l.name=i.name),i.kind!=null&amp;&amp;i.hasOwnProperty(&quot;kind&quot;)&amp;&amp;(l.kind=n.enums===String?d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:d.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;endTimeUnixNano&quot;)&amp;&amp;(typeof i.endTimeUnixNano==&quot;number&quot;?l.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:l.endTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new h.LongBits(i.endTimeUnixNano.low&gt;&gt;&gt;0,i.endTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.endTimeUnixNano),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.events&amp;&amp;i.events.length){l.events=[];for(var u=0;u&lt;i.events.length;++u)l.events[u]=d.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[u],n)}if(i.droppedEventsCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedEventsCount&quot;)&amp;&amp;(l.droppedEventsCount=i.droppedEventsCount),i.links&amp;&amp;i.links.length){l.links=[];for(var u=0;u&lt;i.links.length;++u)l.links[u]=d.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[u],n)}return i.droppedLinksCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedLinksCount&quot;)&amp;&amp;(l.droppedLinksCount=i.droppedLinksCount),i.status!=null&amp;&amp;i.hasOwnProperty(&quot;status&quot;)&amp;&amp;(l.status=d.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Span&quot;},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;SPAN_KIND_UNSPECIFIED&quot;]=0,i[a[1]=&quot;SPAN_KIND_INTERNAL&quot;]=1,i[a[2]=&quot;SPAN_KIND_SERVER&quot;]=2,i[a[3]=&quot;SPAN_KIND_CLIENT&quot;]=3,i[a[4]=&quot;SPAN_KIND_PRODUCER&quot;]=4,i[a[5]=&quot;SPAN_KIND_CONSUMER&quot;]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(9).fixed64(n.timeUnixNano),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(18).string(n.name),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(32).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Event;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.timeUnixNano=n.fixed64();break}case 2:{u.name=n.string();break}case 3:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Event)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.name!=null&amp;&amp;(l.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Event.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.name=&quot;&quot;,c.droppedAttributesCount=0}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Event&quot;},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=h.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(10).bytes(n.traceId),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(18).bytes(n.spanId),n.traceState!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceState&quot;)&amp;&amp;l.uint32(26).string(n.traceState),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;droppedAttributesCount&quot;)&amp;&amp;l.uint32(40).uint32(n.droppedAttributesCount),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.trace.v1.Span.Link;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.traceId=n.bytes();break}case 2:{u.spanId=n.bytes();break}case 3:{u.traceState=n.string();break}case 4:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{u.droppedAttributesCount=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId)))return&quot;traceId: buffer expected&quot;;if(n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId)))return&quot;spanId: buffer expected&quot;;if(n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;!h.isString(n.traceState))return&quot;traceState: string expected&quot;;if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;n.attributes.length;++l){var c=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[l]);if(c)return&quot;attributes.&quot;+c}}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(n.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.trace.v1.Span.Link)return n;var l=new d.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceState!=null&amp;&amp;(l.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.trace.v1.Span.Link.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}return n.droppedAttributesCount!=null&amp;&amp;(l.droppedAttributesCount=n.droppedAttributesCount&gt;&gt;&gt;0),l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[]),l.defaults&amp;&amp;(l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId))),l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),c.traceState=&quot;&quot;,c.droppedAttributesCount=0),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&amp;&amp;n.hasOwnProperty(&quot;traceState&quot;)&amp;&amp;(c.traceState=n.traceState),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var u=0;u&lt;n.attributes.length;++u)c.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[u],l)}return n.droppedAttributesCount!=null&amp;&amp;n.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(c.droppedAttributesCount=n.droppedAttributesCount),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.trace.v1.Span.Link&quot;},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=oe.create()),i.message!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;message&quot;)&amp;&amp;n.uint32(18).string(i.message),i.code!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;code&quot;)&amp;&amp;n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.trace.v1.Status;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 2:{c.message=i.string();break}case 3:{c.code=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;!h.isString(i.message))return&quot;message: string expected&quot;;if(i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;))switch(i.code){default:return&quot;code: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.trace.v1.Status)return i;var n=new d.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&amp;&amp;(n.message=String(i.message)),i.code){default:if(typeof i.code==&quot;number&quot;){n.code=i.code;break}break;case&quot;STATUS_CODE_UNSET&quot;:case 0:n.code=0;break;case&quot;STATUS_CODE_OK&quot;:case 1:n.code=1;break;case&quot;STATUS_CODE_ERROR&quot;:case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};return n.defaults&amp;&amp;(l.message=&quot;&quot;,l.code=n.enums===String?&quot;STATUS_CODE_UNSET&quot;:0),i.message!=null&amp;&amp;i.hasOwnProperty(&quot;message&quot;)&amp;&amp;(l.message=i.message),i.code!=null&amp;&amp;i.hasOwnProperty(&quot;code&quot;)&amp;&amp;(l.code=n.enums===String?d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:d.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.trace.v1.Status&quot;},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]=&quot;STATUS_CODE_UNSET&quot;]=0,i[a[1]=&quot;STATUS_CODE_OK&quot;]=1,i[a[2]=&quot;STATUS_CODE_ERROR&quot;]=2,i})(),s})(),o})(),t})(),e.collector=(function(){var t={};return t.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceSpans=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceSpans!=null&amp;&amp;n.resourceSpans.length)for(var c=0;c&lt;n.resourceSpans.length;++c)d.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceSpans&amp;&amp;u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(d.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceSpans!=null&amp;&amp;n.hasOwnProperty(&quot;resourceSpans&quot;)){if(!Array.isArray(n.resourceSpans))return&quot;resourceSpans: array expected&quot;;for(var l=0;l&lt;n.resourceSpans.length;++l){var c=d.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[l]);if(c)return&quot;resourceSpans.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected&quot;);l.resourceSpans=[];for(var c=0;c&lt;n.resourceSpans.length;++c){if(typeof n.resourceSpans[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected&quot;);l.resourceSpans[c]=d.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceSpans=[]),n.resourceSpans&amp;&amp;n.resourceSpans.length){c.resourceSpans=[];for(var u=0;u&lt;n.resourceSpans.length;++u)c.resourceSpans[u]=d.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest&quot;},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse&quot;},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedSpans!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedSpans&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedSpans=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;!h.isInteger(n.rejectedSpans)&amp;&amp;!(n.rejectedSpans&amp;&amp;h.isInteger(n.rejectedSpans.low)&amp;&amp;h.isInteger(n.rejectedSpans.high))?&quot;rejectedSpans: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var l=new d.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&amp;&amp;(h.Long?(l.rejectedSpans=h.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans==&quot;string&quot;?l.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans==&quot;number&quot;?l.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans==&quot;object&quot;&amp;&amp;(l.rejectedSpans=new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedSpans=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedSpans=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedSpans!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedSpans&quot;)&amp;&amp;(typeof n.rejectedSpans==&quot;number&quot;?c.rejectedSpans=l.longs===String?String(n.rejectedSpans):n.rejectedSpans:c.rejectedSpans=l.longs===String?h.Long.prototype.toString.call(n.rejectedSpans):l.longs===Number?new h.LongBits(n.rejectedSpans.low&gt;&gt;&gt;0,n.rejectedSpans.high&gt;&gt;&gt;0).toNumber():n.rejectedSpans),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess&quot;},a})(),s})(),o})(),t.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceMetrics=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceMetrics!=null&amp;&amp;n.resourceMetrics.length)for(var c=0;c&lt;n.resourceMetrics.length;++c)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceMetrics&amp;&amp;u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceMetrics!=null&amp;&amp;n.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(n.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var l=0;l&lt;n.resourceMetrics.length;++l){var c=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[l]);if(c)return&quot;resourceMetrics.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected&quot;);l.resourceMetrics=[];for(var c=0;c&lt;n.resourceMetrics.length;++c){if(typeof n.resourceMetrics[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected&quot;);l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceMetrics=[]),n.resourceMetrics&amp;&amp;n.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u&lt;n.resourceMetrics.length;++u)c.resourceMetrics[u]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest&quot;},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse&quot;},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedDataPoints!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedDataPoints&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedDataPoints=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;!h.isInteger(n.rejectedDataPoints)&amp;&amp;!(n.rejectedDataPoints&amp;&amp;h.isInteger(n.rejectedDataPoints.low)&amp;&amp;h.isInteger(n.rejectedDataPoints.high))?&quot;rejectedDataPoints: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&amp;&amp;(h.Long?(l.rejectedDataPoints=h.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints==&quot;string&quot;?l.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints==&quot;number&quot;?l.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints==&quot;object&quot;&amp;&amp;(l.rejectedDataPoints=new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedDataPoints=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedDataPoints!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedDataPoints&quot;)&amp;&amp;(typeof n.rejectedDataPoints==&quot;number&quot;?c.rejectedDataPoints=l.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?h.Long.prototype.toString.call(n.rejectedDataPoints):l.longs===Number?new h.LongBits(n.rejectedDataPoints.low&gt;&gt;&gt;0,n.rejectedDataPoints.high&gt;&gt;&gt;0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess&quot;},a})(),s})(),o})(),t.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,l){X.rpc.Service.call(this,i,n,l)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,l,c){return new this(n,l,c)},Object.defineProperty(a.prototype.export=function i(n,l){return this.rpcCall(i,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,l)},&quot;name&quot;,{value:&quot;Export&quot;}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.resourceLogs=h.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,l){if(l||(l=oe.create()),n.resourceLogs!=null&amp;&amp;n.resourceLogs.length)for(var c=0;c&lt;n.resourceLogs.length;++c)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.resourceLogs&amp;&amp;u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.resourceLogs!=null&amp;&amp;n.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(n.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var l=0;l&lt;n.resourceLogs.length;++l){var c=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[l]);if(c)return&quot;resourceLogs.&quot;+c}}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected&quot;);l.resourceLogs=[];for(var c=0;c&lt;n.resourceLogs.length;++c){if(typeof n.resourceLogs[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected&quot;);l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[c])}}return l},a.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.resourceLogs=[]),n.resourceLogs&amp;&amp;n.resourceLogs.length){c.resourceLogs=[];for(var u=0;u&lt;n.resourceLogs.length;++u)c.resourceLogs[u]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[u],l)}return c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest&quot;},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.partialSuccess!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;partialSuccess&quot;)&amp;&amp;d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,l.uint32(10).fork()).ldelim(),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;if(n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)){var l=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(l)return&quot;partialSuccess.&quot;+l}return null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected&quot;);l.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.partialSuccess=null),n.partialSuccess!=null&amp;&amp;n.hasOwnProperty(&quot;partialSuccess&quot;)&amp;&amp;(c.partialSuccess=d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,l)),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse&quot;},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.rejectedLogRecords!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;rejectedLogRecords&quot;)&amp;&amp;l.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;errorMessage&quot;)&amp;&amp;l.uint32(18).string(n.errorMessage),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.rejectedLogRecords=n.int64();break}case 2:{u.errorMessage=n.string();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;!h.isInteger(n.rejectedLogRecords)&amp;&amp;!(n.rejectedLogRecords&amp;&amp;h.isInteger(n.rejectedLogRecords.low)&amp;&amp;h.isInteger(n.rejectedLogRecords.high))?&quot;rejectedLogRecords: integer|Long expected&quot;:n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;!h.isString(n.errorMessage)?&quot;errorMessage: string expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var l=new d.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&amp;&amp;(h.Long?(l.rejectedLogRecords=h.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords==&quot;string&quot;?l.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords==&quot;number&quot;?l.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords==&quot;object&quot;&amp;&amp;(l.rejectedLogRecords=new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber())),n.errorMessage!=null&amp;&amp;(l.errorMessage=String(n.errorMessage)),l},a.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.rejectedLogRecords=l.longs===String?&quot;0&quot;:0;c.errorMessage=&quot;&quot;}return n.rejectedLogRecords!=null&amp;&amp;n.hasOwnProperty(&quot;rejectedLogRecords&quot;)&amp;&amp;(typeof n.rejectedLogRecords==&quot;number&quot;?c.rejectedLogRecords=l.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?h.Long.prototype.toString.call(n.rejectedLogRecords):l.longs===Number?new h.LongBits(n.rejectedLogRecords.low&gt;&gt;&gt;0,n.rejectedLogRecords.high&gt;&gt;&gt;0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&amp;&amp;n.hasOwnProperty(&quot;errorMessage&quot;)&amp;&amp;(c.errorMessage=n.errorMessage),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess&quot;},a})(),s})(),o})(),t})(),e.metrics=(function(){var t={};return t.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceMetrics!=null&amp;&amp;i.resourceMetrics.length)for(var l=0;l&lt;i.resourceMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.MetricsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceMetrics&amp;&amp;c.resourceMetrics.length||(c.resourceMetrics=[]),c.resourceMetrics.push(d.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;resourceMetrics&quot;)){if(!Array.isArray(i.resourceMetrics))return&quot;resourceMetrics: array expected&quot;;for(var n=0;n&lt;i.resourceMetrics.length;++n){var l=d.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(l)return&quot;resourceMetrics.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new d.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected&quot;);n.resourceMetrics=[];for(var l=0;l&lt;i.resourceMetrics.length;++l){if(typeof i.resourceMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected&quot;);n.resourceMetrics[l]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceMetrics=[]),i.resourceMetrics&amp;&amp;i.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c&lt;i.resourceMetrics.length;++c)l.resourceMetrics[c]=d.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.MetricsData&quot;},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&amp;&amp;i.scopeMetrics.length)for(var l=0;l&lt;i.scopeMetrics.length;++l)d.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeMetrics&amp;&amp;c.scopeMetrics.length||(c.scopeMetrics=[]),c.scopeMetrics.push(d.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeMetrics!=null&amp;&amp;i.hasOwnProperty(&quot;scopeMetrics&quot;)){if(!Array.isArray(i.scopeMetrics))return&quot;scopeMetrics: array expected&quot;;for(var l=0;l&lt;i.scopeMetrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[l]);if(n)return&quot;scopeMetrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected&quot;);n.scopeMetrics=[];for(var l=0;l&lt;i.scopeMetrics.length;++l){if(typeof i.scopeMetrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected&quot;);n.scopeMetrics[l]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeMetrics=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&amp;&amp;i.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c&lt;i.scopeMetrics.length;++c)l.scopeMetrics[c]=d.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ResourceMetrics&quot;},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&amp;&amp;i.metrics.length)for(var l=0;l&lt;i.metrics.length;++l)d.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.metrics&amp;&amp;c.metrics.length||(c.metrics=[]),c.metrics.push(d.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.metrics!=null&amp;&amp;i.hasOwnProperty(&quot;metrics&quot;)){if(!Array.isArray(i.metrics))return&quot;metrics: array expected&quot;;for(var l=0;l&lt;i.metrics.length;++l){var n=d.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[l]);if(n)return&quot;metrics.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new d.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected&quot;);n.metrics=[];for(var l=0;l&lt;i.metrics.length;++l){if(typeof i.metrics[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected&quot;);n.metrics[l]=d.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.metrics=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&amp;&amp;i.metrics.length){l.metrics=[];for(var c=0;c&lt;i.metrics.length;++c)l.metrics[c]=d.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ScopeMetrics&quot;},s})(),o.Metric=(function(){function s(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null;var a;return Object.defineProperty(s.prototype,&quot;data&quot;,{get:h.oneOfGetter(a=[&quot;gauge&quot;,&quot;sum&quot;,&quot;histogram&quot;,&quot;exponentialHistogram&quot;,&quot;summary&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){return l||(l=oe.create()),n.name!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;name&quot;)&amp;&amp;l.uint32(10).string(n.name),n.description!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;description&quot;)&amp;&amp;l.uint32(18).string(n.description),n.unit!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;unit&quot;)&amp;&amp;l.uint32(26).string(n.unit),n.gauge!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;gauge&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,l.uint32(42).fork()).ldelim(),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,l.uint32(58).fork()).ldelim(),n.histogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;histogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,l.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;exponentialHistogram&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,l.uint32(82).fork()).ldelim(),n.summary!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;summary&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,l.uint32(90).fork()).ldelim(),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Metric;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.name=n.string();break}case 2:{u.description=n.string();break}case 3:{u.unit=n.string();break}case 5:{u.gauge=d.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{u.sum=d.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{u.histogram=d.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{u.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{u.summary=d.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;!h.isString(n.name))return&quot;name: string expected&quot;;if(n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;!h.isString(n.description))return&quot;description: string expected&quot;;if(n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;!h.isString(n.unit))return&quot;unit: string expected&quot;;if(n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)){l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(c)return&quot;gauge.&quot;+c}}if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(c)return&quot;sum.&quot;+c}}if(n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(c)return&quot;histogram.&quot;+c}}if(n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(c)return&quot;exponentialHistogram.&quot;+c}}if(n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)){if(l.data===1)return&quot;data: multiple values&quot;;l.data=1;{var c=d.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(c)return&quot;summary.&quot;+c}}return null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Metric)return n;var l=new d.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&amp;&amp;(l.name=String(n.name)),n.description!=null&amp;&amp;(l.description=String(n.description)),n.unit!=null&amp;&amp;(l.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.gauge: object expected&quot;);l.gauge=d.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.sum: object expected&quot;);l.sum=d.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.histogram: object expected&quot;);l.histogram=d.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected&quot;);l.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Metric.summary: object expected&quot;);l.summary=d.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}return l},s.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.name=&quot;&quot;,c.description=&quot;&quot;,c.unit=&quot;&quot;),n.name!=null&amp;&amp;n.hasOwnProperty(&quot;name&quot;)&amp;&amp;(c.name=n.name),n.description!=null&amp;&amp;n.hasOwnProperty(&quot;description&quot;)&amp;&amp;(c.description=n.description),n.unit!=null&amp;&amp;n.hasOwnProperty(&quot;unit&quot;)&amp;&amp;(c.unit=n.unit),n.gauge!=null&amp;&amp;n.hasOwnProperty(&quot;gauge&quot;)&amp;&amp;(c.gauge=d.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,l),l.oneofs&amp;&amp;(c.data=&quot;gauge&quot;)),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=d.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,l),l.oneofs&amp;&amp;(c.data=&quot;sum&quot;)),n.histogram!=null&amp;&amp;n.hasOwnProperty(&quot;histogram&quot;)&amp;&amp;(c.histogram=d.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,l),l.oneofs&amp;&amp;(c.data=&quot;histogram&quot;)),n.exponentialHistogram!=null&amp;&amp;n.hasOwnProperty(&quot;exponentialHistogram&quot;)&amp;&amp;(c.exponentialHistogram=d.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,l),l.oneofs&amp;&amp;(c.data=&quot;exponentialHistogram&quot;)),n.summary!=null&amp;&amp;n.hasOwnProperty(&quot;summary&quot;)&amp;&amp;(c.summary=d.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,l),l.oneofs&amp;&amp;(c.data=&quot;summary&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Metric&quot;},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Gauge;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new d.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Gauge&quot;},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;isMonotonic&quot;)&amp;&amp;n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Sum;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}case 3:{c.isMonotonic=i.bool();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;typeof i.isMonotonic!=&quot;boolean&quot;?&quot;isMonotonic: boolean expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Sum)return i;var n=new d.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&amp;&amp;(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0,l.isMonotonic=!1),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&amp;&amp;i.hasOwnProperty(&quot;isMonotonic&quot;)&amp;&amp;(l.isMonotonic=i.isMonotonic),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Sum&quot;},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Histogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new d.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Histogram&quot;},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;aggregationTemporality&quot;)&amp;&amp;n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{c.aggregationTemporality=i.int32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}if(i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;))switch(i.aggregationTemporality){default:return&quot;aggregationTemporality: enum value expected&quot;;case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new d.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[l])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality==&quot;number&quot;){n.aggregationTemporality=i.aggregationTemporality;break}break;case&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:case 0:n.aggregationTemporality=0;break;case&quot;AGGREGATION_TEMPORALITY_DELTA&quot;:case 1:n.aggregationTemporality=1;break;case&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;:case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),n.defaults&amp;&amp;(l.aggregationTemporality=n.enums===String?&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;:0),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[c],n)}return i.aggregationTemporality!=null&amp;&amp;i.hasOwnProperty(&quot;aggregationTemporality&quot;)&amp;&amp;(l.aggregationTemporality=n.enums===String?d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:d.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogram&quot;},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.dataPoints!=null&amp;&amp;i.dataPoints.length)for(var l=0;l&lt;i.dataPoints.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.Summary;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.dataPoints&amp;&amp;c.dataPoints.length||(c.dataPoints=[]),c.dataPoints.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.dataPoints!=null&amp;&amp;i.hasOwnProperty(&quot;dataPoints&quot;)){if(!Array.isArray(i.dataPoints))return&quot;dataPoints: array expected&quot;;for(var n=0;n&lt;i.dataPoints.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(l)return&quot;dataPoints.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.Summary)return i;var n=new d.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected&quot;);n.dataPoints=[];for(var l=0;l&lt;i.dataPoints.length;++l){if(typeof i.dataPoints[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected&quot;);n.dataPoints[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.dataPoints=[]),i.dataPoints&amp;&amp;i.dataPoints.length){l.dataPoints=[];for(var c=0;c&lt;i.dataPoints.length;++c)l.dataPoints[c]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.Summary&quot;},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;AGGREGATION_TEMPORALITY_UNSPECIFIED&quot;]=0,a[s[1]=&quot;AGGREGATION_TEMPORALITY_DELTA&quot;]=1,a[s[2]=&quot;AGGREGATION_TEMPORALITY_CUMULATIVE&quot;]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;DATA_POINT_FLAGS_DO_NOT_USE&quot;]=0,a[s[1]=&quot;DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK&quot;]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(33).double(n.asDouble),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(42).fork()).ldelim();if(n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(58).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(64).uint32(n.flags),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 5:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{u.flags=n.uint32();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.NumberDataPoint&quot;},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=h.emptyArray,s.prototype.explicitBounds=h.emptyArray,s.prototype.exemplars=h.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.bucketCounts!=null&amp;&amp;n.bucketCounts.length){l.uint32(50).fork();for(var c=0;c&lt;n.bucketCounts.length;++c)l.fixed64(n.bucketCounts[c]);l.ldelim()}if(n.explicitBounds!=null&amp;&amp;n.explicitBounds.length){l.uint32(58).fork();for(var c=0;c&lt;n.explicitBounds.length;++c)l.double(n.explicitBounds[c]);l.ldelim()}if(n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(66).fork()).ldelim();if(n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(74).fork()).ldelim();return n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(89).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(97).double(n.max),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 9:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{if(u.bucketCounts&amp;&amp;u.bucketCounts.length||(u.bucketCounts=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.bucketCounts.push(n.fixed64());else u.bucketCounts.push(n.fixed64());break}case 7:{if(u.explicitBounds&amp;&amp;u.explicitBounds.length||(u.explicitBounds=[]),(f&amp;7)===2)for(var _=n.uint32()+n.pos;n.pos&lt;_;)u.explicitBounds.push(n.double());else u.explicitBounds.push(n.double());break}case 8:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{u.flags=n.uint32();break}case 11:{u.min=n.double();break}case 12:{u.max=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.bucketCounts!=null&amp;&amp;n.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(n.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;n.bucketCounts.length;++c)if(!h.isInteger(n.bucketCounts[c])&amp;&amp;!(n.bucketCounts[c]&amp;&amp;h.isInteger(n.bucketCounts[c].low)&amp;&amp;h.isInteger(n.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}if(n.explicitBounds!=null&amp;&amp;n.hasOwnProperty(&quot;explicitBounds&quot;)){if(!Array.isArray(n.explicitBounds))return&quot;explicitBounds: array expected&quot;;for(var c=0;c&lt;n.explicitBounds.length;++c)if(typeof n.explicitBounds[c]!=&quot;number&quot;)return&quot;explicitBounds: number[] expected&quot;}if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags)?&quot;flags: integer expected&quot;:n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected&quot;);l.bucketCounts=[];for(var c=0;c&lt;n.bucketCounts.length;++c)h.Long?(l.bucketCounts[c]=h.Long.fromValue(n.bucketCounts[c])).unsigned=!1:typeof n.bucketCounts[c]==&quot;string&quot;?l.bucketCounts[c]=parseInt(n.bucketCounts[c],10):typeof n.bucketCounts[c]==&quot;number&quot;?l.bucketCounts[c]=n.bucketCounts[c]:typeof n.bucketCounts[c]==&quot;object&quot;&amp;&amp;(l.bucketCounts[c]=new h.LongBits(n.bucketCounts[c].low&gt;&gt;&gt;0,n.bucketCounts[c].high&gt;&gt;&gt;0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected&quot;);l.explicitBounds=[];for(var c=0;c&lt;n.explicitBounds.length;++c)l.explicitBounds[c]=Number(n.explicitBounds[c])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;c.flags=0}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.bucketCounts&amp;&amp;n.bucketCounts.length){c.bucketCounts=[];for(var f=0;f&lt;n.bucketCounts.length;++f)typeof n.bucketCounts[f]==&quot;number&quot;?c.bucketCounts[f]=l.longs===String?String(n.bucketCounts[f]):n.bucketCounts[f]:c.bucketCounts[f]=l.longs===String?h.Long.prototype.toString.call(n.bucketCounts[f]):l.longs===Number?new h.LongBits(n.bucketCounts[f].low&gt;&gt;&gt;0,n.bucketCounts[f].high&gt;&gt;&gt;0).toNumber():n.bucketCounts[f]}if(n.explicitBounds&amp;&amp;n.explicitBounds.length){c.explicitBounds=[];for(var f=0;f&lt;n.explicitBounds.length;++f)c.explicitBounds[f]=l.json&amp;&amp;!isFinite(n.explicitBounds[f])?String(n.explicitBounds[f]):n.explicitBounds[f]}if(n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}return n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.HistogramDataPoint&quot;},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=h.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,&quot;_sum&quot;,{get:h.oneOfGetter(a=[&quot;sum&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_min&quot;,{get:h.oneOfGetter(a=[&quot;min&quot;]),set:h.oneOfSetter(a)}),Object.defineProperty(s.prototype,&quot;_max&quot;,{get:h.oneOfGetter(a=[&quot;max&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.attributes!=null&amp;&amp;n.attributes.length)for(var c=0;c&lt;n.attributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[c],l.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;startTimeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(25).fixed64(n.timeUnixNano),n.count!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;count&quot;)&amp;&amp;l.uint32(33).fixed64(n.count),n.sum!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;sum&quot;)&amp;&amp;l.uint32(41).double(n.sum),n.scale!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;scale&quot;)&amp;&amp;l.uint32(48).sint32(n.scale),n.zeroCount!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroCount&quot;)&amp;&amp;l.uint32(57).fixed64(n.zeroCount),n.positive!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;positive&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,l.uint32(66).fork()).ldelim(),n.negative!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;negative&quot;)&amp;&amp;d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,l.uint32(74).fork()).ldelim(),n.flags!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;flags&quot;)&amp;&amp;l.uint32(80).uint32(n.flags),n.exemplars!=null&amp;&amp;n.exemplars.length)for(var c=0;c&lt;n.exemplars.length;++c)d.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[c],l.uint32(90).fork()).ldelim();return n.min!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;min&quot;)&amp;&amp;l.uint32(97).double(n.min),n.max!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;max&quot;)&amp;&amp;l.uint32(105).double(n.max),n.zeroThreshold!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;zeroThreshold&quot;)&amp;&amp;l.uint32(113).double(n.zeroThreshold),l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.attributes&amp;&amp;u.attributes.length||(u.attributes=[]),u.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.startTimeUnixNano=n.fixed64();break}case 3:{u.timeUnixNano=n.fixed64();break}case 4:{u.count=n.fixed64();break}case 5:{u.sum=n.double();break}case 6:{u.scale=n.sint32();break}case 7:{u.zeroCount=n.fixed64();break}case 8:{u.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{u.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{u.flags=n.uint32();break}case 11:{u.exemplars&amp;&amp;u.exemplars.length||(u.exemplars=[]),u.exemplars.push(d.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{u.min=n.double();break}case 13:{u.max=n.double();break}case 14:{u.zeroThreshold=n.double();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.attributes!=null&amp;&amp;n.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(n.attributes))return&quot;attributes: array expected&quot;;for(var c=0;c&lt;n.attributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return&quot;attributes.&quot;+u}}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(n.startTimeUnixNano)&amp;&amp;!(n.startTimeUnixNano&amp;&amp;h.isInteger(n.startTimeUnixNano.low)&amp;&amp;h.isInteger(n.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(n.count)&amp;&amp;!(n.count&amp;&amp;h.isInteger(n.count.low)&amp;&amp;h.isInteger(n.count.high)))return&quot;count: integer|Long expected&quot;;if(n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l._sum=1,typeof n.sum!=&quot;number&quot;))return&quot;sum: number expected&quot;;if(n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;!h.isInteger(n.scale))return&quot;scale: integer expected&quot;;if(n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;!h.isInteger(n.zeroCount)&amp;&amp;!(n.zeroCount&amp;&amp;h.isInteger(n.zeroCount.low)&amp;&amp;h.isInteger(n.zeroCount.high)))return&quot;zeroCount: integer|Long expected&quot;;if(n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(u)return&quot;positive.&quot;+u}if(n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)){var u=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(u)return&quot;negative.&quot;+u}if(n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(n.flags))return&quot;flags: integer expected&quot;;if(n.exemplars!=null&amp;&amp;n.hasOwnProperty(&quot;exemplars&quot;)){if(!Array.isArray(n.exemplars))return&quot;exemplars: array expected&quot;;for(var c=0;c&lt;n.exemplars.length;++c){var u=d.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[c]);if(u)return&quot;exemplars.&quot;+u}}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(l._min=1,typeof n.min!=&quot;number&quot;)?&quot;min: number expected&quot;:n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(l._max=1,typeof n.max!=&quot;number&quot;)?&quot;max: number expected&quot;:n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;typeof n.zeroThreshold!=&quot;number&quot;?&quot;zeroThreshold: number expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var l=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected&quot;);l.attributes=[];for(var c=0;c&lt;n.attributes.length;++c){if(typeof n.attributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected&quot;);l.attributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[c])}}if(n.startTimeUnixNano!=null&amp;&amp;(h.Long?(l.startTimeUnixNano=h.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano==&quot;string&quot;?l.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano==&quot;object&quot;&amp;&amp;(l.startTimeUnixNano=new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.count!=null&amp;&amp;(h.Long?(l.count=h.Long.fromValue(n.count)).unsigned=!1:typeof n.count==&quot;string&quot;?l.count=parseInt(n.count,10):typeof n.count==&quot;number&quot;?l.count=n.count:typeof n.count==&quot;object&quot;&amp;&amp;(l.count=new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber())),n.sum!=null&amp;&amp;(l.sum=Number(n.sum)),n.scale!=null&amp;&amp;(l.scale=n.scale|0),n.zeroCount!=null&amp;&amp;(h.Long?(l.zeroCount=h.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount==&quot;string&quot;?l.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount==&quot;number&quot;?l.zeroCount=n.zeroCount:typeof n.zeroCount==&quot;object&quot;&amp;&amp;(l.zeroCount=new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber())),n.positive!=null){if(typeof n.positive!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected&quot;);l.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected&quot;);l.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&amp;&amp;(l.flags=n.flags&gt;&gt;&gt;0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected&quot;);l.exemplars=[];for(var c=0;c&lt;n.exemplars.length;++c){if(typeof n.exemplars[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected&quot;);l.exemplars[c]=d.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[c])}}return n.min!=null&amp;&amp;(l.min=Number(n.min)),n.max!=null&amp;&amp;(l.max=Number(n.max)),n.zeroThreshold!=null&amp;&amp;(l.zeroThreshold=Number(n.zeroThreshold)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.attributes=[],c.exemplars=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.startTimeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;if(h.Long){var u=new h.Long(0,0,!1);c.count=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.count=l.longs===String?&quot;0&quot;:0;if(c.scale=0,h.Long){var u=new h.Long(0,0,!1);c.zeroCount=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.zeroCount=l.longs===String?&quot;0&quot;:0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(n.attributes&amp;&amp;n.attributes.length){c.attributes=[];for(var f=0;f&lt;n.attributes.length;++f)c.attributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[f],l)}if(n.startTimeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof n.startTimeUnixNano==&quot;number&quot;?c.startTimeUnixNano=l.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.startTimeUnixNano):l.longs===Number?new h.LongBits(n.startTimeUnixNano.low&gt;&gt;&gt;0,n.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.count!=null&amp;&amp;n.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof n.count==&quot;number&quot;?c.count=l.longs===String?String(n.count):n.count:c.count=l.longs===String?h.Long.prototype.toString.call(n.count):l.longs===Number?new h.LongBits(n.count.low&gt;&gt;&gt;0,n.count.high&gt;&gt;&gt;0).toNumber():n.count),n.sum!=null&amp;&amp;n.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(c.sum=l.json&amp;&amp;!isFinite(n.sum)?String(n.sum):n.sum,l.oneofs&amp;&amp;(c._sum=&quot;sum&quot;)),n.scale!=null&amp;&amp;n.hasOwnProperty(&quot;scale&quot;)&amp;&amp;(c.scale=n.scale),n.zeroCount!=null&amp;&amp;n.hasOwnProperty(&quot;zeroCount&quot;)&amp;&amp;(typeof n.zeroCount==&quot;number&quot;?c.zeroCount=l.longs===String?String(n.zeroCount):n.zeroCount:c.zeroCount=l.longs===String?h.Long.prototype.toString.call(n.zeroCount):l.longs===Number?new h.LongBits(n.zeroCount.low&gt;&gt;&gt;0,n.zeroCount.high&gt;&gt;&gt;0).toNumber():n.zeroCount),n.positive!=null&amp;&amp;n.hasOwnProperty(&quot;positive&quot;)&amp;&amp;(c.positive=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,l)),n.negative!=null&amp;&amp;n.hasOwnProperty(&quot;negative&quot;)&amp;&amp;(c.negative=d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,l)),n.flags!=null&amp;&amp;n.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(c.flags=n.flags),n.exemplars&amp;&amp;n.exemplars.length){c.exemplars=[];for(var f=0;f&lt;n.exemplars.length;++f)c.exemplars[f]=d.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[f],l)}return n.min!=null&amp;&amp;n.hasOwnProperty(&quot;min&quot;)&amp;&amp;(c.min=l.json&amp;&amp;!isFinite(n.min)?String(n.min):n.min,l.oneofs&amp;&amp;(c._min=&quot;min&quot;)),n.max!=null&amp;&amp;n.hasOwnProperty(&quot;max&quot;)&amp;&amp;(c.max=l.json&amp;&amp;!isFinite(n.max)?String(n.max):n.max,l.oneofs&amp;&amp;(c._max=&quot;max&quot;)),n.zeroThreshold!=null&amp;&amp;n.hasOwnProperty(&quot;zeroThreshold&quot;)&amp;&amp;(c.zeroThreshold=l.json&amp;&amp;!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint&quot;},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var l=Object.keys(n),c=0;c&lt;l.length;++c)n[l[c]]!=null&amp;&amp;(this[l[c]]=n[l[c]])}return i.prototype.offset=null,i.prototype.bucketCounts=h.emptyArray,i.create=function(l){return new i(l)},i.encode=function(l,c){if(c||(c=oe.create()),l.offset!=null&amp;&amp;Object.hasOwnProperty.call(l,&quot;offset&quot;)&amp;&amp;c.uint32(8).sint32(l.offset),l.bucketCounts!=null&amp;&amp;l.bucketCounts.length){c.uint32(18).fork();for(var u=0;u&lt;l.bucketCounts.length;++u)c.uint64(l.bucketCounts[u]);c.ldelim()}return c},i.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},i.decode=function(l,c){l instanceof g||(l=g.create(l));for(var u=c===void 0?l.len:l.pos+c,f=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos&lt;u;){var _=l.uint32();switch(_&gt;&gt;&gt;3){case 1:{f.offset=l.sint32();break}case 2:{if(f.bucketCounts&amp;&amp;f.bucketCounts.length||(f.bucketCounts=[]),(_&amp;7)===2)for(var m=l.uint32()+l.pos;l.pos&lt;m;)f.bucketCounts.push(l.uint64());else f.bucketCounts.push(l.uint64());break}default:l.skipType(_&amp;7);break}}return f},i.decodeDelimited=function(l){return l instanceof g||(l=new g(l)),this.decode(l,l.uint32())},i.verify=function(l){if(typeof l!=&quot;object&quot;||l===null)return&quot;object expected&quot;;if(l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;!h.isInteger(l.offset))return&quot;offset: integer expected&quot;;if(l.bucketCounts!=null&amp;&amp;l.hasOwnProperty(&quot;bucketCounts&quot;)){if(!Array.isArray(l.bucketCounts))return&quot;bucketCounts: array expected&quot;;for(var c=0;c&lt;l.bucketCounts.length;++c)if(!h.isInteger(l.bucketCounts[c])&amp;&amp;!(l.bucketCounts[c]&amp;&amp;h.isInteger(l.bucketCounts[c].low)&amp;&amp;h.isInteger(l.bucketCounts[c].high)))return&quot;bucketCounts: integer|Long[] expected&quot;}return null},i.fromObject=function(l){if(l instanceof d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new d.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&amp;&amp;(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected&quot;);c.bucketCounts=[];for(var u=0;u&lt;l.bucketCounts.length;++u)h.Long?(c.bucketCounts[u]=h.Long.fromValue(l.bucketCounts[u])).unsigned=!0:typeof l.bucketCounts[u]==&quot;string&quot;?c.bucketCounts[u]=parseInt(l.bucketCounts[u],10):typeof l.bucketCounts[u]==&quot;number&quot;?c.bucketCounts[u]=l.bucketCounts[u]:typeof l.bucketCounts[u]==&quot;object&quot;&amp;&amp;(c.bucketCounts[u]=new h.LongBits(l.bucketCounts[u].low&gt;&gt;&gt;0,l.bucketCounts[u].high&gt;&gt;&gt;0).toNumber(!0))}return c},i.toObject=function(l,c){c||(c={});var u={};if((c.arrays||c.defaults)&amp;&amp;(u.bucketCounts=[]),c.defaults&amp;&amp;(u.offset=0),l.offset!=null&amp;&amp;l.hasOwnProperty(&quot;offset&quot;)&amp;&amp;(u.offset=l.offset),l.bucketCounts&amp;&amp;l.bucketCounts.length){u.bucketCounts=[];for(var f=0;f&lt;l.bucketCounts.length;++f)typeof l.bucketCounts[f]==&quot;number&quot;?u.bucketCounts[f]=c.longs===String?String(l.bucketCounts[f]):l.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?h.Long.prototype.toString.call(l.bucketCounts[f]):c.longs===Number?new h.LongBits(l.bucketCounts[f].low&gt;&gt;&gt;0,l.bucketCounts[f].high&gt;&gt;&gt;0).toNumber(!0):l.bucketCounts[f]}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(l){return l===void 0&amp;&amp;(l=&quot;type.googleapis.com&quot;),l+&quot;/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets&quot;},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.attributes=h.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=h.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.startTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;startTimeUnixNano&quot;)&amp;&amp;n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;count&quot;)&amp;&amp;n.uint32(33).fixed64(i.count),i.sum!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;sum&quot;)&amp;&amp;n.uint32(41).double(i.sum),i.quantileValues!=null&amp;&amp;i.quantileValues.length)for(var l=0;l&lt;i.quantileValues.length;++l)d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[l],n.uint32(50).fork()).ldelim();if(i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(58).fork()).ldelim();return i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 7:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{c.startTimeUnixNano=i.fixed64();break}case 3:{c.timeUnixNano=i.fixed64();break}case 4:{c.count=i.fixed64();break}case 5:{c.sum=i.double();break}case 6:{c.quantileValues&amp;&amp;c.quantileValues.length||(c.quantileValues=[]),c.quantileValues.push(d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{c.flags=i.uint32();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var n=0;n&lt;i.attributes.length;++n){var l=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(l)return&quot;attributes.&quot;+l}}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.startTimeUnixNano)&amp;&amp;!(i.startTimeUnixNano&amp;&amp;h.isInteger(i.startTimeUnixNano.low)&amp;&amp;h.isInteger(i.startTimeUnixNano.high)))return&quot;startTimeUnixNano: integer|Long expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;!h.isInteger(i.count)&amp;&amp;!(i.count&amp;&amp;h.isInteger(i.count.low)&amp;&amp;h.isInteger(i.count.high)))return&quot;count: integer|Long expected&quot;;if(i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;typeof i.sum!=&quot;number&quot;)return&quot;sum: number expected&quot;;if(i.quantileValues!=null&amp;&amp;i.hasOwnProperty(&quot;quantileValues&quot;)){if(!Array.isArray(i.quantileValues))return&quot;quantileValues: array expected&quot;;for(var n=0;n&lt;i.quantileValues.length;++n){var l=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(l)return&quot;quantileValues.&quot;+l}}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}if(i.startTimeUnixNano!=null&amp;&amp;(h.Long?(n.startTimeUnixNano=h.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano==&quot;string&quot;?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano==&quot;number&quot;?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano==&quot;object&quot;&amp;&amp;(n.startTimeUnixNano=new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.count!=null&amp;&amp;(h.Long?(n.count=h.Long.fromValue(i.count)).unsigned=!1:typeof i.count==&quot;string&quot;?n.count=parseInt(i.count,10):typeof i.count==&quot;number&quot;?n.count=i.count:typeof i.count==&quot;object&quot;&amp;&amp;(n.count=new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber())),i.sum!=null&amp;&amp;(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected&quot;);n.quantileValues=[];for(var l=0;l&lt;i.quantileValues.length;++l){if(typeof i.quantileValues[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected&quot;);n.quantileValues[l]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[l])}}return i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.quantileValues=[],l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.startTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.startTimeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(h.Long){var c=new h.Long(0,0,!1);l.count=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.count=n.longs===String?&quot;0&quot;:0;l.sum=0,l.flags=0}if(i.startTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;startTimeUnixNano&quot;)&amp;&amp;(typeof i.startTimeUnixNano==&quot;number&quot;?l.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:l.startTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new h.LongBits(i.startTimeUnixNano.low&gt;&gt;&gt;0,i.startTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.count!=null&amp;&amp;i.hasOwnProperty(&quot;count&quot;)&amp;&amp;(typeof i.count==&quot;number&quot;?l.count=n.longs===String?String(i.count):i.count:l.count=n.longs===String?h.Long.prototype.toString.call(i.count):n.longs===Number?new h.LongBits(i.count.low&gt;&gt;&gt;0,i.count.high&gt;&gt;&gt;0).toNumber():i.count),i.sum!=null&amp;&amp;i.hasOwnProperty(&quot;sum&quot;)&amp;&amp;(l.sum=n.json&amp;&amp;!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&amp;&amp;i.quantileValues.length){l.quantileValues=[];for(var u=0;u&lt;i.quantileValues.length;++u)l.quantileValues[u]=d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[u],n)}if(i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint&quot;},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,l){return l||(l=oe.create()),n.quantile!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;quantile&quot;)&amp;&amp;l.uint32(9).double(n.quantile),n.value!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;value&quot;)&amp;&amp;l.uint32(17).double(n.value),l},a.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},a.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 1:{u.quantile=n.double();break}case 2:{u.value=n.double();break}default:n.skipType(f&amp;7);break}}return u},a.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!=&quot;object&quot;||n===null?&quot;object expected&quot;:n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;typeof n.quantile!=&quot;number&quot;?&quot;quantile: number expected&quot;:n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;typeof n.value!=&quot;number&quot;?&quot;value: number expected&quot;:null},a.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var l=new d.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&amp;&amp;(l.quantile=Number(n.quantile)),n.value!=null&amp;&amp;(l.value=Number(n.value)),l},a.toObject=function(n,l){l||(l={});var c={};return l.defaults&amp;&amp;(c.quantile=0,c.value=0),n.quantile!=null&amp;&amp;n.hasOwnProperty(&quot;quantile&quot;)&amp;&amp;(c.quantile=l.json&amp;&amp;!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&amp;&amp;n.hasOwnProperty(&quot;value&quot;)&amp;&amp;(c.value=l.json&amp;&amp;!isFinite(n.value)?String(n.value):n.value),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile&quot;},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),l=0;l&lt;n.length;++l)i[n[l]]!=null&amp;&amp;(this[n[l]]=i[n[l]])}s.prototype.filteredAttributes=h.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,&quot;value&quot;,{get:h.oneOfGetter(a=[&quot;asDouble&quot;,&quot;asInt&quot;]),set:h.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,l){if(l||(l=oe.create()),n.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;timeUnixNano&quot;)&amp;&amp;l.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asDouble&quot;)&amp;&amp;l.uint32(25).double(n.asDouble),n.spanId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;spanId&quot;)&amp;&amp;l.uint32(34).bytes(n.spanId),n.traceId!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;traceId&quot;)&amp;&amp;l.uint32(42).bytes(n.traceId),n.asInt!=null&amp;&amp;Object.hasOwnProperty.call(n,&quot;asInt&quot;)&amp;&amp;l.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&amp;&amp;n.filteredAttributes.length)for(var c=0;c&lt;n.filteredAttributes.length;++c)d.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},s.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},s.decode=function(n,l){n instanceof g||(n=g.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.opentelemetry.proto.metrics.v1.Exemplar;n.pos&lt;c;){var f=n.uint32();switch(f&gt;&gt;&gt;3){case 7:{u.filteredAttributes&amp;&amp;u.filteredAttributes.length||(u.filteredAttributes=[]),u.filteredAttributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{u.timeUnixNano=n.fixed64();break}case 3:{u.asDouble=n.double();break}case 6:{u.asInt=n.sfixed64();break}case 4:{u.spanId=n.bytes();break}case 5:{u.traceId=n.bytes();break}default:n.skipType(f&amp;7);break}}return u},s.decodeDelimited=function(n){return n instanceof g||(n=new g(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!=&quot;object&quot;||n===null)return&quot;object expected&quot;;var l={};if(n.filteredAttributes!=null&amp;&amp;n.hasOwnProperty(&quot;filteredAttributes&quot;)){if(!Array.isArray(n.filteredAttributes))return&quot;filteredAttributes: array expected&quot;;for(var c=0;c&lt;n.filteredAttributes.length;++c){var u=d.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[c]);if(u)return&quot;filteredAttributes.&quot;+u}}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(n.timeUnixNano)&amp;&amp;!(n.timeUnixNano&amp;&amp;h.isInteger(n.timeUnixNano.low)&amp;&amp;h.isInteger(n.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(l.value=1,typeof n.asDouble!=&quot;number&quot;))return&quot;asDouble: number expected&quot;;if(n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)){if(l.value===1)return&quot;value: multiple values&quot;;if(l.value=1,!h.isInteger(n.asInt)&amp;&amp;!(n.asInt&amp;&amp;h.isInteger(n.asInt.low)&amp;&amp;h.isInteger(n.asInt.high)))return&quot;asInt: integer|Long expected&quot;}return n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(n.spanId&amp;&amp;typeof n.spanId.length==&quot;number&quot;||h.isString(n.spanId))?&quot;spanId: buffer expected&quot;:n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(n.traceId&amp;&amp;typeof n.traceId.length==&quot;number&quot;||h.isString(n.traceId))?&quot;traceId: buffer expected&quot;:null},s.fromObject=function(n){if(n instanceof d.opentelemetry.proto.metrics.v1.Exemplar)return n;var l=new d.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected&quot;);l.filteredAttributes=[];for(var c=0;c&lt;n.filteredAttributes.length;++c){if(typeof n.filteredAttributes[c]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected&quot;);l.filteredAttributes[c]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[c])}}return n.timeUnixNano!=null&amp;&amp;(h.Long?(l.timeUnixNano=h.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano==&quot;string&quot;?l.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano==&quot;object&quot;&amp;&amp;(l.timeUnixNano=new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),n.asDouble!=null&amp;&amp;(l.asDouble=Number(n.asDouble)),n.asInt!=null&amp;&amp;(h.Long?(l.asInt=h.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt==&quot;string&quot;?l.asInt=parseInt(n.asInt,10):typeof n.asInt==&quot;number&quot;?l.asInt=n.asInt:typeof n.asInt==&quot;object&quot;&amp;&amp;(l.asInt=new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber())),n.spanId!=null&amp;&amp;(typeof n.spanId==&quot;string&quot;?h.base64.decode(n.spanId,l.spanId=h.newBuffer(h.base64.length(n.spanId)),0):n.spanId.length&gt;=0&amp;&amp;(l.spanId=n.spanId)),n.traceId!=null&amp;&amp;(typeof n.traceId==&quot;string&quot;?h.base64.decode(n.traceId,l.traceId=h.newBuffer(h.base64.length(n.traceId)),0):n.traceId.length&gt;=0&amp;&amp;(l.traceId=n.traceId)),l},s.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&amp;&amp;(c.filteredAttributes=[]),l.defaults){if(h.Long){var u=new h.Long(0,0,!1);c.timeUnixNano=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.timeUnixNano=l.longs===String?&quot;0&quot;:0;l.bytes===String?c.spanId=&quot;&quot;:(c.spanId=[],l.bytes!==Array&amp;&amp;(c.spanId=h.newBuffer(c.spanId))),l.bytes===String?c.traceId=&quot;&quot;:(c.traceId=[],l.bytes!==Array&amp;&amp;(c.traceId=h.newBuffer(c.traceId)))}if(n.timeUnixNano!=null&amp;&amp;n.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof n.timeUnixNano==&quot;number&quot;?c.timeUnixNano=l.longs===String?String(n.timeUnixNano):n.timeUnixNano:c.timeUnixNano=l.longs===String?h.Long.prototype.toString.call(n.timeUnixNano):l.longs===Number?new h.LongBits(n.timeUnixNano.low&gt;&gt;&gt;0,n.timeUnixNano.high&gt;&gt;&gt;0).toNumber():n.timeUnixNano),n.asDouble!=null&amp;&amp;n.hasOwnProperty(&quot;asDouble&quot;)&amp;&amp;(c.asDouble=l.json&amp;&amp;!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,l.oneofs&amp;&amp;(c.value=&quot;asDouble&quot;)),n.spanId!=null&amp;&amp;n.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(c.spanId=l.bytes===String?h.base64.encode(n.spanId,0,n.spanId.length):l.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&amp;&amp;n.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(c.traceId=l.bytes===String?h.base64.encode(n.traceId,0,n.traceId.length):l.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&amp;&amp;n.hasOwnProperty(&quot;asInt&quot;)&amp;&amp;(typeof n.asInt==&quot;number&quot;?c.asInt=l.longs===String?String(n.asInt):n.asInt:c.asInt=l.longs===String?h.Long.prototype.toString.call(n.asInt):l.longs===Number?new h.LongBits(n.asInt.low&gt;&gt;&gt;0,n.asInt.high&gt;&gt;&gt;0).toNumber():n.asInt,l.oneofs&amp;&amp;(c.value=&quot;asInt&quot;)),n.filteredAttributes&amp;&amp;n.filteredAttributes.length){c.filteredAttributes=[];for(var f=0;f&lt;n.filteredAttributes.length;++f)c.filteredAttributes[f]=d.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[f],l)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&amp;&amp;(n=&quot;type.googleapis.com&quot;),n+&quot;/opentelemetry.proto.metrics.v1.Exemplar&quot;},s})(),o})(),t})(),e.logs=(function(){var t={};return t.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=h.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resourceLogs!=null&amp;&amp;i.resourceLogs.length)for(var l=0;l&lt;i.resourceLogs.length;++l)d.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[l],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogsData;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resourceLogs&amp;&amp;c.resourceLogs.length||(c.resourceLogs=[]),c.resourceLogs.push(d.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resourceLogs!=null&amp;&amp;i.hasOwnProperty(&quot;resourceLogs&quot;)){if(!Array.isArray(i.resourceLogs))return&quot;resourceLogs: array expected&quot;;for(var n=0;n&lt;i.resourceLogs.length;++n){var l=d.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(l)return&quot;resourceLogs.&quot;+l}}return null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogsData)return i;var n=new d.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected&quot;);n.resourceLogs=[];for(var l=0;l&lt;i.resourceLogs.length;++l){if(typeof i.resourceLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected&quot;);n.resourceLogs[l]=d.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[l])}}return n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.resourceLogs=[]),i.resourceLogs&amp;&amp;i.resourceLogs.length){l.resourceLogs=[];for(var c=0;c&lt;i.resourceLogs.length;++c)l.resourceLogs[c]=d.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[c],n)}return l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogsData&quot;},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.resource!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;resource&quot;)&amp;&amp;d.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&amp;&amp;i.scopeLogs.length)for(var l=0;l&lt;i.scopeLogs.length;++l)d.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ResourceLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.resource=d.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{c.scopeLogs&amp;&amp;c.scopeLogs.length||(c.scopeLogs=[]),c.scopeLogs.push(d.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)){var n=d.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return&quot;resource.&quot;+n}if(i.scopeLogs!=null&amp;&amp;i.hasOwnProperty(&quot;scopeLogs&quot;)){if(!Array.isArray(i.scopeLogs))return&quot;scopeLogs: array expected&quot;;for(var l=0;l&lt;i.scopeLogs.length;++l){var n=d.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[l]);if(n)return&quot;scopeLogs.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected&quot;);n.resource=d.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected&quot;);n.scopeLogs=[];for(var l=0;l&lt;i.scopeLogs.length;++l){if(typeof i.scopeLogs[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected&quot;);n.scopeLogs[l]=d.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.scopeLogs=[]),n.defaults&amp;&amp;(l.resource=null,l.schemaUrl=&quot;&quot;),i.resource!=null&amp;&amp;i.hasOwnProperty(&quot;resource&quot;)&amp;&amp;(l.resource=d.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&amp;&amp;i.scopeLogs.length){l.scopeLogs=[];for(var c=0;c&lt;i.scopeLogs.length;++c)l.scopeLogs[c]=d.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ResourceLogs&quot;},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=h.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.scope!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;scope&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&amp;&amp;i.logRecords.length)for(var l=0;l&lt;i.logRecords.length;++l)d.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[l],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;schemaUrl&quot;)&amp;&amp;n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.ScopeLogs;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{c.logRecords&amp;&amp;c.logRecords.length||(c.logRecords=[]),c.logRecords.push(d.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{c.schemaUrl=i.string();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)){var n=d.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return&quot;scope.&quot;+n}if(i.logRecords!=null&amp;&amp;i.hasOwnProperty(&quot;logRecords&quot;)){if(!Array.isArray(i.logRecords))return&quot;logRecords: array expected&quot;;for(var l=0;l&lt;i.logRecords.length;++l){var n=d.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[l]);if(n)return&quot;logRecords.&quot;+n}}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;!h.isString(i.schemaUrl)?&quot;schemaUrl: string expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new d.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected&quot;);n.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected&quot;);n.logRecords=[];for(var l=0;l&lt;i.logRecords.length;++l){if(typeof i.logRecords[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected&quot;);n.logRecords[l]=d.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[l])}}return i.schemaUrl!=null&amp;&amp;(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.logRecords=[]),n.defaults&amp;&amp;(l.scope=null,l.schemaUrl=&quot;&quot;),i.scope!=null&amp;&amp;i.hasOwnProperty(&quot;scope&quot;)&amp;&amp;(l.scope=d.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&amp;&amp;i.logRecords.length){l.logRecords=[];for(var c=0;c&lt;i.logRecords.length;++c)l.logRecords[c]=d.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[c],n)}return i.schemaUrl!=null&amp;&amp;i.hasOwnProperty(&quot;schemaUrl&quot;)&amp;&amp;(l.schemaUrl=i.schemaUrl),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.ScopeLogs&quot;},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;]=0,a[s[1]=&quot;SEVERITY_NUMBER_TRACE&quot;]=1,a[s[2]=&quot;SEVERITY_NUMBER_TRACE2&quot;]=2,a[s[3]=&quot;SEVERITY_NUMBER_TRACE3&quot;]=3,a[s[4]=&quot;SEVERITY_NUMBER_TRACE4&quot;]=4,a[s[5]=&quot;SEVERITY_NUMBER_DEBUG&quot;]=5,a[s[6]=&quot;SEVERITY_NUMBER_DEBUG2&quot;]=6,a[s[7]=&quot;SEVERITY_NUMBER_DEBUG3&quot;]=7,a[s[8]=&quot;SEVERITY_NUMBER_DEBUG4&quot;]=8,a[s[9]=&quot;SEVERITY_NUMBER_INFO&quot;]=9,a[s[10]=&quot;SEVERITY_NUMBER_INFO2&quot;]=10,a[s[11]=&quot;SEVERITY_NUMBER_INFO3&quot;]=11,a[s[12]=&quot;SEVERITY_NUMBER_INFO4&quot;]=12,a[s[13]=&quot;SEVERITY_NUMBER_WARN&quot;]=13,a[s[14]=&quot;SEVERITY_NUMBER_WARN2&quot;]=14,a[s[15]=&quot;SEVERITY_NUMBER_WARN3&quot;]=15,a[s[16]=&quot;SEVERITY_NUMBER_WARN4&quot;]=16,a[s[17]=&quot;SEVERITY_NUMBER_ERROR&quot;]=17,a[s[18]=&quot;SEVERITY_NUMBER_ERROR2&quot;]=18,a[s[19]=&quot;SEVERITY_NUMBER_ERROR3&quot;]=19,a[s[20]=&quot;SEVERITY_NUMBER_ERROR4&quot;]=20,a[s[21]=&quot;SEVERITY_NUMBER_FATAL&quot;]=21,a[s[22]=&quot;SEVERITY_NUMBER_FATAL2&quot;]=22,a[s[23]=&quot;SEVERITY_NUMBER_FATAL3&quot;]=23,a[s[24]=&quot;SEVERITY_NUMBER_FATAL4&quot;]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]=&quot;LOG_RECORD_FLAGS_DO_NOT_USE&quot;]=0,a[s[255]=&quot;LOG_RECORD_FLAGS_TRACE_FLAGS_MASK&quot;]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]!=null&amp;&amp;(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=h.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=oe.create()),i.timeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;timeUnixNano&quot;)&amp;&amp;n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityNumber&quot;)&amp;&amp;n.uint32(16).int32(i.severityNumber),i.severityText!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;severityText&quot;)&amp;&amp;n.uint32(26).string(i.severityText),i.body!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;body&quot;)&amp;&amp;d.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&amp;&amp;i.attributes.length)for(var l=0;l&lt;i.attributes.length;++l)d.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[l],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;droppedAttributesCount&quot;)&amp;&amp;n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;flags&quot;)&amp;&amp;n.uint32(69).fixed32(i.flags),i.traceId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;traceId&quot;)&amp;&amp;n.uint32(74).bytes(i.traceId),i.spanId!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;spanId&quot;)&amp;&amp;n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&amp;&amp;Object.hasOwnProperty.call(i,&quot;observedTimeUnixNano&quot;)&amp;&amp;n.uint32(89).fixed64(i.observedTimeUnixNano),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n){i instanceof g||(i=g.create(i));for(var l=n===void 0?i.len:i.pos+n,c=new d.opentelemetry.proto.logs.v1.LogRecord;i.pos&lt;l;){var u=i.uint32();switch(u&gt;&gt;&gt;3){case 1:{c.timeUnixNano=i.fixed64();break}case 11:{c.observedTimeUnixNano=i.fixed64();break}case 2:{c.severityNumber=i.int32();break}case 3:{c.severityText=i.string();break}case 5:{c.body=d.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{c.attributes&amp;&amp;c.attributes.length||(c.attributes=[]),c.attributes.push(d.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{c.droppedAttributesCount=i.uint32();break}case 8:{c.flags=i.fixed32();break}case 9:{c.traceId=i.bytes();break}case 10:{c.spanId=i.bytes();break}default:i.skipType(u&amp;7);break}}return c},s.decodeDelimited=function(i){return i instanceof g||(i=new g(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!=&quot;object&quot;||i===null)return&quot;object expected&quot;;if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;!h.isInteger(i.timeUnixNano)&amp;&amp;!(i.timeUnixNano&amp;&amp;h.isInteger(i.timeUnixNano.low)&amp;&amp;h.isInteger(i.timeUnixNano.high)))return&quot;timeUnixNano: integer|Long expected&quot;;if(i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;!h.isInteger(i.observedTimeUnixNano)&amp;&amp;!(i.observedTimeUnixNano&amp;&amp;h.isInteger(i.observedTimeUnixNano.low)&amp;&amp;h.isInteger(i.observedTimeUnixNano.high)))return&quot;observedTimeUnixNano: integer|Long expected&quot;;if(i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;))switch(i.severityNumber){default:return&quot;severityNumber: enum value expected&quot;;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;!h.isString(i.severityText))return&quot;severityText: string expected&quot;;if(i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)){var n=d.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return&quot;body.&quot;+n}if(i.attributes!=null&amp;&amp;i.hasOwnProperty(&quot;attributes&quot;)){if(!Array.isArray(i.attributes))return&quot;attributes: array expected&quot;;for(var l=0;l&lt;i.attributes.length;++l){var n=d.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[l]);if(n)return&quot;attributes.&quot;+n}}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;!h.isInteger(i.droppedAttributesCount)?&quot;droppedAttributesCount: integer expected&quot;:i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;!h.isInteger(i.flags)?&quot;flags: integer expected&quot;:i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;!(i.traceId&amp;&amp;typeof i.traceId.length==&quot;number&quot;||h.isString(i.traceId))?&quot;traceId: buffer expected&quot;:i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;!(i.spanId&amp;&amp;typeof i.spanId.length==&quot;number&quot;||h.isString(i.spanId))?&quot;spanId: buffer expected&quot;:null},s.fromObject=function(i){if(i instanceof d.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new d.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&amp;&amp;(h.Long?(n.timeUnixNano=h.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano==&quot;string&quot;?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano==&quot;number&quot;?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano==&quot;object&quot;&amp;&amp;(n.timeUnixNano=new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.observedTimeUnixNano!=null&amp;&amp;(h.Long?(n.observedTimeUnixNano=h.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano==&quot;string&quot;?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano==&quot;number&quot;?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano==&quot;object&quot;&amp;&amp;(n.observedTimeUnixNano=new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber==&quot;number&quot;){n.severityNumber=i.severityNumber;break}break;case&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:case 0:n.severityNumber=0;break;case&quot;SEVERITY_NUMBER_TRACE&quot;:case 1:n.severityNumber=1;break;case&quot;SEVERITY_NUMBER_TRACE2&quot;:case 2:n.severityNumber=2;break;case&quot;SEVERITY_NUMBER_TRACE3&quot;:case 3:n.severityNumber=3;break;case&quot;SEVERITY_NUMBER_TRACE4&quot;:case 4:n.severityNumber=4;break;case&quot;SEVERITY_NUMBER_DEBUG&quot;:case 5:n.severityNumber=5;break;case&quot;SEVERITY_NUMBER_DEBUG2&quot;:case 6:n.severityNumber=6;break;case&quot;SEVERITY_NUMBER_DEBUG3&quot;:case 7:n.severityNumber=7;break;case&quot;SEVERITY_NUMBER_DEBUG4&quot;:case 8:n.severityNumber=8;break;case&quot;SEVERITY_NUMBER_INFO&quot;:case 9:n.severityNumber=9;break;case&quot;SEVERITY_NUMBER_INFO2&quot;:case 10:n.severityNumber=10;break;case&quot;SEVERITY_NUMBER_INFO3&quot;:case 11:n.severityNumber=11;break;case&quot;SEVERITY_NUMBER_INFO4&quot;:case 12:n.severityNumber=12;break;case&quot;SEVERITY_NUMBER_WARN&quot;:case 13:n.severityNumber=13;break;case&quot;SEVERITY_NUMBER_WARN2&quot;:case 14:n.severityNumber=14;break;case&quot;SEVERITY_NUMBER_WARN3&quot;:case 15:n.severityNumber=15;break;case&quot;SEVERITY_NUMBER_WARN4&quot;:case 16:n.severityNumber=16;break;case&quot;SEVERITY_NUMBER_ERROR&quot;:case 17:n.severityNumber=17;break;case&quot;SEVERITY_NUMBER_ERROR2&quot;:case 18:n.severityNumber=18;break;case&quot;SEVERITY_NUMBER_ERROR3&quot;:case 19:n.severityNumber=19;break;case&quot;SEVERITY_NUMBER_ERROR4&quot;:case 20:n.severityNumber=20;break;case&quot;SEVERITY_NUMBER_FATAL&quot;:case 21:n.severityNumber=21;break;case&quot;SEVERITY_NUMBER_FATAL2&quot;:case 22:n.severityNumber=22;break;case&quot;SEVERITY_NUMBER_FATAL3&quot;:case 23:n.severityNumber=23;break;case&quot;SEVERITY_NUMBER_FATAL4&quot;:case 24:n.severityNumber=24;break}if(i.severityText!=null&amp;&amp;(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.body: object expected&quot;);n.body=d.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: array expected&quot;);n.attributes=[];for(var l=0;l&lt;i.attributes.length;++l){if(typeof i.attributes[l]!=&quot;object&quot;)throw TypeError(&quot;.opentelemetry.proto.logs.v1.LogRecord.attributes: object expected&quot;);n.attributes[l]=d.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[l])}}return i.droppedAttributesCount!=null&amp;&amp;(n.droppedAttributesCount=i.droppedAttributesCount&gt;&gt;&gt;0),i.flags!=null&amp;&amp;(n.flags=i.flags&gt;&gt;&gt;0),i.traceId!=null&amp;&amp;(typeof i.traceId==&quot;string&quot;?h.base64.decode(i.traceId,n.traceId=h.newBuffer(h.base64.length(i.traceId)),0):i.traceId.length&gt;=0&amp;&amp;(n.traceId=i.traceId)),i.spanId!=null&amp;&amp;(typeof i.spanId==&quot;string&quot;?h.base64.decode(i.spanId,n.spanId=h.newBuffer(h.base64.length(i.spanId)),0):i.spanId.length&gt;=0&amp;&amp;(n.spanId=i.spanId)),n},s.toObject=function(i,n){n||(n={});var l={};if((n.arrays||n.defaults)&amp;&amp;(l.attributes=[]),n.defaults){if(h.Long){var c=new h.Long(0,0,!1);l.timeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timeUnixNano=n.longs===String?&quot;0&quot;:0;if(l.severityNumber=n.enums===String?&quot;SEVERITY_NUMBER_UNSPECIFIED&quot;:0,l.severityText=&quot;&quot;,l.body=null,l.droppedAttributesCount=0,l.flags=0,n.bytes===String?l.traceId=&quot;&quot;:(l.traceId=[],n.bytes!==Array&amp;&amp;(l.traceId=h.newBuffer(l.traceId))),n.bytes===String?l.spanId=&quot;&quot;:(l.spanId=[],n.bytes!==Array&amp;&amp;(l.spanId=h.newBuffer(l.spanId))),h.Long){var c=new h.Long(0,0,!1);l.observedTimeUnixNano=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=n.longs===String?&quot;0&quot;:0}if(i.timeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;timeUnixNano&quot;)&amp;&amp;(typeof i.timeUnixNano==&quot;number&quot;?l.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:l.timeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new h.LongBits(i.timeUnixNano.low&gt;&gt;&gt;0,i.timeUnixNano.high&gt;&gt;&gt;0).toNumber():i.timeUnixNano),i.severityNumber!=null&amp;&amp;i.hasOwnProperty(&quot;severityNumber&quot;)&amp;&amp;(l.severityNumber=n.enums===String?d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:d.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&amp;&amp;i.hasOwnProperty(&quot;severityText&quot;)&amp;&amp;(l.severityText=i.severityText),i.body!=null&amp;&amp;i.hasOwnProperty(&quot;body&quot;)&amp;&amp;(l.body=d.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&amp;&amp;i.attributes.length){l.attributes=[];for(var u=0;u&lt;i.attributes.length;++u)l.attributes[u]=d.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&amp;&amp;i.hasOwnProperty(&quot;droppedAttributesCount&quot;)&amp;&amp;(l.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&amp;&amp;i.hasOwnProperty(&quot;flags&quot;)&amp;&amp;(l.flags=i.flags),i.traceId!=null&amp;&amp;i.hasOwnProperty(&quot;traceId&quot;)&amp;&amp;(l.traceId=n.bytes===String?h.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&amp;&amp;i.hasOwnProperty(&quot;spanId&quot;)&amp;&amp;(l.spanId=n.bytes===String?h.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&amp;&amp;i.hasOwnProperty(&quot;observedTimeUnixNano&quot;)&amp;&amp;(typeof i.observedTimeUnixNano==&quot;number&quot;?l.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:l.observedTimeUnixNano=n.longs===String?h.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new h.LongBits(i.observedTimeUnixNano.low&gt;&gt;&gt;0,i.observedTimeUnixNano.high&gt;&gt;&gt;0).toNumber():i.observedTimeUnixNano),l},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&amp;&amp;(i=&quot;type.googleapis.com&quot;),i+&quot;/opentelemetry.proto.logs.v1.LogRecord&quot;},s})(),o})(),t})(),e})(),r})();WG.exports=d});var eo,gle,vle,yle,Ole,Ale,Rle,Ah,QG,Rh,ZG=p(()=&gt;{eo=Nn(JG());_h();Eh();mh();gle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,vle=eo.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,yle=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ole=eo.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ale=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Rle=eo.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ah={serializeRequest:r=&gt;{let e=Xs(r);return vle.encode(e).finish()},deserializeResponse:r=&gt;gle.decode(r)},QG={serializeRequest:r=&gt;{let e=$s([r]);return Ole.encode(e).finish()},deserializeResponse:r=&gt;yle.decode(r)},Rh={serializeRequest:r=&gt;{let e=Ks(r);return Rle.encode(e).finish()},deserializeResponse:r=&gt;Ale.decode(r)}});var Nh,e3,Ch,t3=p(()=&gt;{_h();Eh();mh();Nh={serializeRequest:r=&gt;{let e=Ks(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},e3={serializeRequest:r=&gt;{let e=$s([r],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}},Ch={serializeRequest:r=&gt;{let e=Xs(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}}});var av={};Ae(av,{ESpanKind:()=&gt;fh,JsonLogsSerializer:()=&gt;Ch,JsonMetricsSerializer:()=&gt;e3,JsonTraceSerializer:()=&gt;Nh,ProtobufLogsSerializer:()=&gt;Ah,ProtobufMetricsSerializer:()=&gt;QG,ProtobufTraceSerializer:()=&gt;Rh,createExportLogsServiceRequest:()=&gt;Xs,createExportMetricsServiceRequest:()=&gt;$s,createExportTraceServiceRequest:()=&gt;Ks,encodeAsLongBits:()=&gt;uh,encodeAsString:()=&gt;jg,getOtlpEncoder:()=&gt;Kn,hrTimeToNanos:()=&gt;ch,toLongBits:()=&gt;qg});var to=p(()=&gt;{Ec();QF();_h();Eh();mh();ZG();t3()});var r3,n3=p(()=&gt;{r3=&quot;0.56.0&quot;});function i3(r){var e=[429,502,503,504];return e.includes(r)}function o3(r){if(r!=null){var e=Number.parseInt(r,10);if(Number.isInteger(e))return e&gt;0?e*1e3:-1;var t=new Date(r).getTime()-Date.now();return t&gt;=0?t:0}}var s3=p(()=&gt;{});var c3={};Ae(c3,{compressAndSend:()=&gt;l3,createHttpAgent:()=&gt;Ile,sendWithHttp:()=&gt;Cle});import*as Ph from&quot;http&quot;;import*as Ih from&quot;https&quot;;import*as a3 from&quot;zlib&quot;;import{Readable as Nle}from&quot;stream&quot;;function Cle(r,e,t,o,s){var a=new URL(r.url),i=Number(process.versions.node.split(&quot;.&quot;)[0]),n={hostname:a.hostname,port:a.port,path:a.pathname,method:&quot;POST&quot;,headers:lv({},r.headers()),agent:e},l=a.protocol===&quot;http:&quot;?Ph.request:Ih.request,c=l(n,function(f){var _=[];f.on(&quot;data&quot;,function(m){return _.push(m)}),f.on(&quot;end&quot;,function(){if(f.statusCode&amp;&amp;f.statusCode&lt;299)o({status:&quot;success&quot;,data:Buffer.concat(_)});else if(f.statusCode&amp;&amp;i3(f.statusCode))o({status:&quot;retryable&quot;,retryInMillis:o3(f.headers[&quot;retry-after&quot;])});else{var m=new Ji(f.statusMessage,f.statusCode,Buffer.concat(_).toString());o({status:&quot;failure&quot;,error:m})}})});c.setTimeout(s,function(){c.destroy(),o({status:&quot;failure&quot;,error:new Error(&quot;Request Timeout&quot;)})}),c.on(&quot;error&quot;,function(f){o({status:&quot;failure&quot;,error:f})});var u=i&gt;=14?&quot;close&quot;:&quot;abort&quot;;c.on(u,function(){o({status:&quot;failure&quot;,error:new Error(&quot;Request timed out&quot;)})}),l3(c,r.compression,t,function(f){o({status:&quot;failure&quot;,error:f})})}function l3(r,e,t,o){var s=Ple(t);e===&quot;gzip&quot;&amp;&amp;(r.setHeader(&quot;Content-Encoding&quot;,&quot;gzip&quot;),s=s.on(&quot;error&quot;,o).pipe(a3.createGzip()).on(&quot;error&quot;,o)),s.pipe(r).on(&quot;error&quot;,o)}function Ple(r){var e=new Nle;return e.push(r),e.push(null),e}function Ile(r,e){var t=new URL(r),o=t.protocol===&quot;http:&quot;?Ph.Agent:Ih.Agent;return new o(e)}var lv,u3=p(()=&gt;{s3();rh();lv=function(){return lv=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},lv.apply(this,arguments)}});function f3(r){return new xle(r)}var ble,Lle,xle,p3=p(()=&gt;{ble=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},Lle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xle=(function(){function r(e){this._parameters=e,this._send=null,this._agent=null}return r.prototype.send=function(e,t){return ble(this,void 0,void 0,function(){var o,s,a,i=this;return Lle(this,function(n){return this._send==null&amp;&amp;(o=(u3(),ee(c3)),s=o.sendWithHttp,a=o.createHttpAgent,this._agent=a(this._parameters.url,this._parameters.agentOptions),this._send=s),[2,new Promise(function(l){var c;(c=i._send)===null||c===void 0||c.call(i,i._parameters,i._agent,e,function(u){l(u)},t)})]})})},r.prototype.shutdown=function(){},r})()});function Vle(){return Math.random()*(2*d3)-d3}function h3(r){return new Fle(r.transport)}var Mle,wle,Dle,Ule,kle,Ble,d3,Fle,_3=p(()=&gt;{Mle=function(r,e,t,o){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function n(u){try{c(o.next(u))}catch(f){i(f)}}function l(u){try{c(o.throw(u))}catch(f){i(f)}}function c(u){u.done?a(u.value):s(u.value).then(n,l)}c((o=o.apply(r,e||[])).next())})},wle=function(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Dle=5,Ule=1e3,kle=5e3,Ble=1.5,d3=.2;Fle=(function(){function r(e){this._transport=e}return r.prototype.retry=function(e,t,o){var s=this;return new Promise(function(a,i){setTimeout(function(){s._transport.send(e,t).then(a,i)},o)})},r.prototype.send=function(e,t){var o;return Mle(this,void 0,void 0,function(){var s,a,i,n,l,c,u;return wle(this,function(f){switch(f.label){case 0:return s=Date.now()+t,[4,this._transport.send(e,t)];case 1:a=f.sent(),i=Dle,n=Ule,f.label=2;case 2:return a.status===&quot;retryable&quot;&amp;&amp;i&gt;0?(i--,l=Math.max(Math.min(n,kle)+Vle(),0),n=n*Ble,c=(o=a.retryInMillis)!==null&amp;&amp;o!==void 0?o:l,u=s-Date.now(),c&gt;u?[2,a]:[4,this.retry(e,u,c)]):[3,4];case 3:return a=f.sent(),[3,2];case 4:return[2,a]}})})},r.prototype.shutdown=function(){return this._transport.shutdown()},r})()});function Hr(r,e){return lh({transport:h3({transport:f3(r)}),serializer:e,promiseHandler:ah(r)},{timeout:r.timeoutMillis})}var E3=p(()=&gt;{Gg();p3();Bg();_3()});function m3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!=null&amp;&amp;t!==&quot;&quot;){var o=Number(t);if(!Number.isNaN(o)&amp;&amp;Number.isFinite(o)&amp;&amp;o&gt;0)return o;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected number greater than 0 (actual: &quot;+t+&quot;)&quot;)}}function Gle(r){var e=m3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_TIMEOUT&quot;),t=m3(&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;);return e??t}function T3(r){var e,t=(e=process.env[r])===null||e===void 0?void 0:e.trim();if(t!==&quot;&quot;){if(t==null||t===&quot;none&quot;||t===&quot;gzip&quot;)return t;S.warn(&quot;Configuration: &quot;+r+&quot; is invalid, expected &#x27;none&#x27; or &#x27;gzip&#x27; (actual: &#x27;&quot;+t+&quot;&#x27;)&quot;)}}function Hle(r){var e=T3(&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_COMPRESSION&quot;),t=T3(&quot;OTEL_EXPORTER_OTLP_COMPRESSION&quot;);return e??t}function bh(r){return{timeoutMillis:Gle(r),compression:Hle(r)}}var cv=p(()=&gt;{P()});function S3(r){return function(){var e,t={};return Object.entries((e=r==null?void 0:r())!==null&amp;&amp;e!==void 0?e:{}).forEach(function(o){var s=qle(o,2),a=s[0],i=s[1];typeof i&lt;&quot;u&quot;?t[a]=String(i):S.warn(&#x27;Header &quot;&#x27;+a+&#x27;&quot; has invalid value (&#x27;+i+&quot;) and will be ignored&quot;)}),t}}var qle,g3=p(()=&gt;{P();qle=function(r,e){var t=typeof Symbol==&quot;function&quot;&amp;&amp;r[Symbol.iterator];if(!t)return r;var o=t.call(r),s,a=[],i;try{for(;(e===void 0||e-- &gt;0)&amp;&amp;!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&amp;&amp;!s.done&amp;&amp;(t=o.return)&amp;&amp;t.call(o)}finally{if(i)throw i.error}}return a}});function jle(r,e,t){var o=ro({},t()),s={};return function(){return e!=null&amp;&amp;Object.assign(s,e()),r!=null&amp;&amp;Object.assign(s,r()),Object.assign(s,o)}}function Yle(r){if(r!=null)try{return new URL(r),r}catch{throw new Error(&quot;Configuration: Could not parse user-provided export URL: &#x27;&quot;+r+&quot;&#x27;&quot;)}}function v3(r,e,t){var o,s,a,i;return ro(ro({},ih(r,e,t)),{headers:jle(S3(r.headers),e.headers,t.headers),url:(s=(o=Yle(r.url))!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url,agentOptions:(i=(a=r.agentOptions)!==null&amp;&amp;a!==void 0?a:e.agentOptions)!==null&amp;&amp;i!==void 0?i:t.agentOptions})}function y3(r,e){return ro(ro({},oh()),{headers:function(){return r},url:&quot;http://localhost:4318/&quot;+e,agentOptions:{keepAlive:!0}})}var ro,O3=p(()=&gt;{pc();g3();ro=function(){return ro=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},ro.apply(this,arguments)}});function zle(r){var e,t,o=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_HEADERS&quot;])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=dc.parseKeyPairsIntoRecord(o),i=dc.parseKeyPairsIntoRecord(s);if(!(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0))return Object.assign({},dc.parseKeyPairsIntoRecord(s),dc.parseKeyPairsIntoRecord(o))}function Kle(r){try{var e=new URL(r);return e.toString()}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}}function $le(r,e){try{new URL(r)}catch{S.warn(&quot;Configuration: Could not parse environment-provided export URL: &#x27;&quot;+r+&quot;&#x27;, falling back to undefined&quot;);return}r.endsWith(&quot;/&quot;)||(r=r+&quot;/&quot;),r+=e;try{new URL(r)}catch{S.warn(&quot;Configuration: Provided URL appended with &#x27;&quot;+e+&quot;&#x27; is not a valid URL, using &#x27;undefined&#x27; instead of &#x27;&quot;+r+&quot;&#x27;&quot;);return}return r}function Xle(r){var e,t=(e=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return $le(t,r)}function Wle(r){var e,t=(e=process.env[&quot;OTEL_EXPORTER_OTLP_&quot;+r+&quot;_ENDPOINT&quot;])===null||e===void 0?void 0:e.trim();if(!(t==null||t===&quot;&quot;))return Kle(t)}function A3(r,e){var t;return Lh(Lh({},bh(r)),{url:(t=Wle(r))!==null&amp;&amp;t!==void 0?t:Xle(e),headers:nh(zle(r))})}var Lh,R3=p(()=&gt;{Fg();P();cv();pc();Lh=function(){return Lh=Object.assign||function(r){for(var e,t=1,o=arguments.length;t&lt;o;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&amp;&amp;(r[s]=e[s])}return r},Lh.apply(this,arguments)}});function Jle(r){return(r==null?void 0:r.keepAlive)!=null&amp;&amp;(r.httpAgentOptions!=null?r.httpAgentOptions.keepAlive==null&amp;&amp;(r.httpAgentOptions.keepAlive=r.keepAlive):r.httpAgentOptions={keepAlive:r.keepAlive}),r.httpAgentOptions}function qr(r,e,t,o){return r.metadata&amp;&amp;S.warn(&quot;Metadata cannot be set when using http&quot;),v3({url:r.url,headers:nh(r.headers),concurrencyLimit:r.concurrencyLimit,timeoutMillis:r.timeoutMillis,compression:r.compression,agentOptions:Jle(r)},A3(e,t),y3(o,t))}var N3=p(()=&gt;{O3();R3();P();pc()});var C3={};Ae(C3,{convertLegacyHttpOptions:()=&gt;qr,createOtlpHttpExportDelegate:()=&gt;Hr,getSharedConfigurationFromEnvironment:()=&gt;bh});var Js=p(()=&gt;{E3();cv();N3()});var Qs,P3=p(()=&gt;{_n();to();n3();Js();Qs=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${r3}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Ch))}}});var I3=p(()=&gt;{P3()});var b3=p(()=&gt;{I3()});var L3={};Ae(L3,{OTLPLogExporter:()=&gt;Qs});var x3=p(()=&gt;{b3()});var ue=T(tr=&gt;{&quot;use strict&quot;;Object.defineProperty(tr,&quot;__esModule&quot;,{value:!0});tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=tr.Propagate=tr.LogVerbosity=tr.Status=void 0;var M3;(function(r){r[r.OK=0]=&quot;OK&quot;,r[r.CANCELLED=1]=&quot;CANCELLED&quot;,r[r.UNKNOWN=2]=&quot;UNKNOWN&quot;,r[r.INVALID_ARGUMENT=3]=&quot;INVALID_ARGUMENT&quot;,r[r.DEADLINE_EXCEEDED=4]=&quot;DEADLINE_EXCEEDED&quot;,r[r.NOT_FOUND=5]=&quot;NOT_FOUND&quot;,r[r.ALREADY_EXISTS=6]=&quot;ALREADY_EXISTS&quot;,r[r.PERMISSION_DENIED=7]=&quot;PERMISSION_DENIED&quot;,r[r.RESOURCE_EXHAUSTED=8]=&quot;RESOURCE_EXHAUSTED&quot;,r[r.FAILED_PRECONDITION=9]=&quot;FAILED_PRECONDITION&quot;,r[r.ABORTED=10]=&quot;ABORTED&quot;,r[r.OUT_OF_RANGE=11]=&quot;OUT_OF_RANGE&quot;,r[r.UNIMPLEMENTED=12]=&quot;UNIMPLEMENTED&quot;,r[r.INTERNAL=13]=&quot;INTERNAL&quot;,r[r.UNAVAILABLE=14]=&quot;UNAVAILABLE&quot;,r[r.DATA_LOSS=15]=&quot;DATA_LOSS&quot;,r[r.UNAUTHENTICATED=16]=&quot;UNAUTHENTICATED&quot;})(M3||(tr.Status=M3={}));var w3;(function(r){r[r.DEBUG=0]=&quot;DEBUG&quot;,r[r.INFO=1]=&quot;INFO&quot;,r[r.ERROR=2]=&quot;ERROR&quot;,r[r.NONE=3]=&quot;NONE&quot;})(w3||(tr.LogVerbosity=w3={}));var D3;(function(r){r[r.DEADLINE=1]=&quot;DEADLINE&quot;,r[r.CENSUS_STATS_CONTEXT=2]=&quot;CENSUS_STATS_CONTEXT&quot;,r[r.CENSUS_TRACING_CONTEXT=4]=&quot;CENSUS_TRACING_CONTEXT&quot;,r[r.CANCELLATION=8]=&quot;CANCELLATION&quot;,r[r.DEFAULTS=65535]=&quot;DEFAULTS&quot;})(D3||(tr.Propagate=D3={}));tr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;tr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var uv=T((P2e,Qle)=&gt;{Qle.exports={name:&quot;@grpc/grpc-js&quot;,version:&quot;1.13.4&quot;,description:&quot;gRPC Library for Node - pure JS implementation&quot;,homepage:&quot;https://grpc.io/&quot;,repository:&quot;https://github.com/grpc/grpc-node/tree/master/packages/grpc-js&quot;,main:&quot;build/src/index.js&quot;,engines:{node:&quot;&gt;=12.10.0&quot;},keywords:[],author:{name:&quot;Google Inc.&quot;},types:&quot;build/src/index.d.ts&quot;,license:&quot;Apache-2.0&quot;,devDependencies:{&quot;@grpc/proto-loader&quot;:&quot;file:../proto-loader&quot;,&quot;@types/gulp&quot;:&quot;^4.0.17&quot;,&quot;@types/gulp-mocha&quot;:&quot;0.0.37&quot;,&quot;@types/lodash&quot;:&quot;^4.14.202&quot;,&quot;@types/mocha&quot;:&quot;^10.0.6&quot;,&quot;@types/ncp&quot;:&quot;^2.0.8&quot;,&quot;@types/node&quot;:&quot;&gt;=20.11.20&quot;,&quot;@types/pify&quot;:&quot;^5.0.4&quot;,&quot;@types/semver&quot;:&quot;^7.5.8&quot;,&quot;@typescript-eslint/eslint-plugin&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/parser&quot;:&quot;^7.1.0&quot;,&quot;@typescript-eslint/typescript-estree&quot;:&quot;^7.1.0&quot;,&quot;clang-format&quot;:&quot;^1.8.0&quot;,eslint:&quot;^8.42.0&quot;,&quot;eslint-config-prettier&quot;:&quot;^8.8.0&quot;,&quot;eslint-plugin-node&quot;:&quot;^11.1.0&quot;,&quot;eslint-plugin-prettier&quot;:&quot;^4.2.1&quot;,execa:&quot;^2.0.3&quot;,gulp:&quot;^4.0.2&quot;,&quot;gulp-mocha&quot;:&quot;^6.0.0&quot;,lodash:&quot;^4.17.21&quot;,madge:&quot;^5.0.1&quot;,&quot;mocha-jenkins-reporter&quot;:&quot;^0.4.1&quot;,ncp:&quot;^2.0.0&quot;,pify:&quot;^4.0.1&quot;,prettier:&quot;^2.8.8&quot;,rimraf:&quot;^3.0.2&quot;,semver:&quot;^7.6.0&quot;,&quot;ts-node&quot;:&quot;^10.9.2&quot;,typescript:&quot;^5.3.3&quot;},contributors:[{name:&quot;Google Inc.&quot;}],scripts:{build:&quot;npm run compile&quot;,clean:&quot;rimraf ./build&quot;,compile:&quot;tsc -p .&quot;,format:&#x27;clang-format -i -style=&quot;{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}&quot; src/*.ts test/*.ts&#x27;,lint:&quot;eslint src/*.ts test/*.ts&quot;,prepare:&quot;npm run generate-types &amp;&amp; npm run compile&quot;,test:&quot;gulp test&quot;,check:&quot;npm run lint&quot;,fix:&quot;eslint --fix src/*.ts test/*.ts&quot;,pretest:&quot;npm run generate-types &amp;&amp; npm run generate-test-types &amp;&amp; npm run compile&quot;,posttest:&quot;npm run check &amp;&amp; madge -c ./build/src&quot;,&quot;generate-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto&quot;,&quot;generate-test-types&quot;:&quot;proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto&quot;},dependencies:{&quot;@grpc/proto-loader&quot;:&quot;^0.7.13&quot;,&quot;@js-sdsl/ordered-map&quot;:&quot;^4.4.2&quot;},files:[&quot;src/**/*.ts&quot;,&quot;build/src/**/*.{js,d.ts,js.map}&quot;,&quot;proto/*.proto&quot;,&quot;LICENSE&quot;,&quot;deps/envoy-api/envoy/api/v2/**/*.proto&quot;,&quot;deps/envoy-api/envoy/config/**/*.proto&quot;,&quot;deps/envoy-api/envoy/service/**/*.proto&quot;,&quot;deps/envoy-api/envoy/type/**/*.proto&quot;,&quot;deps/udpa/udpa/**/*.proto&quot;,&quot;deps/googleapis/google/api/*.proto&quot;,&quot;deps/googleapis/google/rpc/*.proto&quot;,&quot;deps/protoc-gen-validate/validate/**/*.proto&quot;]}});var Pe=T(Bt=&gt;{&quot;use strict&quot;;var fv,pv,dv,hv;Object.defineProperty(Bt,&quot;__esModule&quot;,{value:!0});Bt.log=Bt.setLoggerVerbosity=Bt.setLogger=Bt.getLogger=void 0;Bt.trace=cce;Bt.isTracerEnabled=k3;var Wn=ue(),Zle=V(&quot;process&quot;),ece=uv().version,tce={error:(r,...e)=&gt;{console.error(&quot;E &quot;+r,...e)},info:(r,...e)=&gt;{console.error(&quot;I &quot;+r,...e)},debug:(r,...e)=&gt;{console.error(&quot;D &quot;+r,...e)}},no=tce,Zs=Wn.LogVerbosity.ERROR,rce=(pv=(fv=process.env.GRPC_NODE_VERBOSITY)!==null&amp;&amp;fv!==void 0?fv:process.env.GRPC_VERBOSITY)!==null&amp;&amp;pv!==void 0?pv:&quot;&quot;;switch(rce.toUpperCase()){case&quot;DEBUG&quot;:Zs=Wn.LogVerbosity.DEBUG;break;case&quot;INFO&quot;:Zs=Wn.LogVerbosity.INFO;break;case&quot;ERROR&quot;:Zs=Wn.LogVerbosity.ERROR;break;case&quot;NONE&quot;:Zs=Wn.LogVerbosity.NONE;break;default:}var nce=()=&gt;no;Bt.getLogger=nce;var ice=r=&gt;{no=r};Bt.setLogger=ice;var oce=r=&gt;{Zs=r};Bt.setLoggerVerbosity=oce;var sce=(r,...e)=&gt;{let t;if(r&gt;=Zs){switch(r){case Wn.LogVerbosity.DEBUG:t=no.debug;break;case Wn.LogVerbosity.INFO:t=no.info;break;case Wn.LogVerbosity.ERROR:t=no.error;break}t||(t=no.error),t&amp;&amp;t.bind(no)(...e)}};Bt.log=sce;var ace=(hv=(dv=process.env.GRPC_NODE_TRACE)!==null&amp;&amp;dv!==void 0?dv:process.env.GRPC_TRACE)!==null&amp;&amp;hv!==void 0?hv:&quot;&quot;,_v=new Set,U3=new Set;for(let r of ace.split(&quot;,&quot;))r.startsWith(&quot;-&quot;)?U3.add(r.substring(1)):_v.add(r);var lce=_v.has(&quot;all&quot;);function cce(r,e,t){k3(e)&amp;&amp;(0,Bt.log)(r,new Date().toISOString()+&quot; | v&quot;+ece+&quot; &quot;+Zle.pid+&quot; | &quot;+e+&quot; | &quot;+t)}function k3(r){return!U3.has(r)&amp;&amp;(lce||_v.has(r))}});var Mh=T(xh=&gt;{&quot;use strict&quot;;Object.defineProperty(xh,&quot;__esModule&quot;,{value:!0});xh.getErrorMessage=uce;xh.getErrorCode=fce;function uce(r){return r instanceof Error?r.message:String(r)}function fce(r){return typeof r==&quot;object&quot;&amp;&amp;r!==null&amp;&amp;&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;?r.code:null}});var ht=T(Dh=&gt;{&quot;use strict&quot;;Object.defineProperty(Dh,&quot;__esModule&quot;,{value:!0});Dh.Metadata=void 0;var pce=Pe(),dce=ue(),hce=Mh(),_ce=/^[0-9a-z_.-]+$/,Ece=/^[ -~]*$/;function mce(r){return _ce.test(r)}function Tce(r){return Ece.test(r)}function V3(r){return r.endsWith(&quot;-bin&quot;)}function Sce(r){return!r.startsWith(&quot;grpc-&quot;)}function wh(r){return r.toLowerCase()}function B3(r,e){if(!mce(r))throw new Error(&#x27;Metadata key &quot;&#x27;+r+&#x27;&quot; contains illegal characters&#x27;);if(e!=null)if(V3(r)){if(!Buffer.isBuffer(e))throw new Error(&quot;keys that end with &#x27;-bin&#x27; must have Buffer values&quot;)}else{if(Buffer.isBuffer(e))throw new Error(&quot;keys that don&#x27;t end with &#x27;-bin&#x27; must have String values&quot;);if(!Tce(e))throw new Error(&#x27;Metadata string value &quot;&#x27;+e+&#x27;&quot; contains illegal characters&#x27;)}}var Ev=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=wh(e),B3(e,t),this.internalRepr.set(e,[t])}add(e,t){e=wh(e),B3(e,t);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[t]):o.push(t)}remove(e){e=wh(e),this.internalRepr.delete(e)}get(e){return e=wh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,o]of this.internalRepr)if(o.length&gt;0){let s=o[0];e[t]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=&gt;Buffer.isBuffer(i)?Buffer.from(i):i);t.set(o,a)}return e}merge(e){for(let[t,o]of e.internalRepr){let s=(this.internalRepr.get(t)||[]).concat(o);this.internalRepr.set(t,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,o]of this.internalRepr)e[t]=o.map(gce);return e}toJSON(){let e={};for(let[t,o]of this.internalRepr)e[t]=o;return e}static fromHttp2Headers(e){let t=new r;for(let o of Object.keys(e)){if(o.charAt(0)===&quot;:&quot;)continue;let s=e[o];try{V3(o)?Array.isArray(s)?s.forEach(a=&gt;{t.add(o,Buffer.from(a,&quot;base64&quot;))}):s!==void 0&amp;&amp;(Sce(o)?s.split(&quot;,&quot;).forEach(a=&gt;{t.add(o,Buffer.from(a.trim(),&quot;base64&quot;))}):t.add(o,Buffer.from(s,&quot;base64&quot;))):Array.isArray(s)?s.forEach(a=&gt;{t.add(o,a)}):s!==void 0&amp;&amp;t.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,hce.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,pce.log)(dce.LogVerbosity.ERROR,i)}}return t}};Dh.Metadata=Ev;var gce=r=&gt;Buffer.isBuffer(r)?r.toString(&quot;base64&quot;):r});var kh=T(Uh=&gt;{&quot;use strict&quot;;Object.defineProperty(Uh,&quot;__esModule&quot;,{value:!0});Uh.CallCredentials=void 0;var gv=ht();function vce(r){return&quot;getRequestHeaders&quot;in r&amp;&amp;typeof r.getRequestHeaders==&quot;function&quot;}var ea=class r{static createFromMetadataGenerator(e){return new Tv(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,o)=&gt;{let s;vce(e)?s=e.getRequestHeaders(t.service_url):s=new Promise((a,i)=&gt;{e.getRequestMetadata(t.service_url,(n,l)=&gt;{if(n){i(n);return}if(!l){i(new Error(&quot;Headers not set by metadata plugin&quot;));return}a(l)})}),s.then(a=&gt;{let i=new gv.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=&gt;{o(a)})})}static createEmpty(){return new Sv}};Uh.CallCredentials=ea;var mv=class r extends ea{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new gv.Metadata,o=await Promise.all(this.creds.map(s=&gt;s.generateMetadata(e)));for(let s of o)t.merge(s);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,o)=&gt;t._equals(e.creds[o])):!1}},Tv=class r extends ea{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,o)=&gt;{this.metadataGenerator(e,(s,a)=&gt;{a!==void 0?t(a):o(s)})})}compose(e){return new mv([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Sv=class r extends ea{generateMetadata(e){return Promise.resolve(new gv.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var yv=T(gc=&gt;{&quot;use strict&quot;;Object.defineProperty(gc,&quot;__esModule&quot;,{value:!0});gc.CIPHER_SUITES=void 0;gc.getDefaultRootsData=Oce;var yce=V(&quot;fs&quot;);gc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var F3=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,vv=null;function Oce(){return F3?(vv===null&amp;&amp;(vv=yce.readFileSync(F3)),vv):null}});var Pt=T(ta=&gt;{&quot;use strict&quot;;Object.defineProperty(ta,&quot;__esModule&quot;,{value:!0});ta.parseUri=Rce;ta.splitHostPort=Nce;ta.combineHostPort=Cce;ta.uriToString=Pce;var Ace=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Rce(r){let e=Ace.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var G3=/^\d+$/;function Nce(r){if(r.startsWith(&quot;[&quot;)){let e=r.indexOf(&quot;]&quot;);if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(&quot;:&quot;)===-1)return null;if(r.length&gt;e+1)if(r[e+1]===&quot;:&quot;){let o=r.substring(e+2);return G3.test(o)?{host:t,port:+o}:null}else return null;else return{host:t}}else{let e=r.split(&quot;:&quot;);return e.length===2?G3.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function Cce(r){return r.port===void 0?r.host:r.host.includes(&quot;:&quot;)?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function Pce(r){let e=&quot;&quot;;return r.scheme!==void 0&amp;&amp;(e+=r.scheme+&quot;:&quot;),r.authority!==void 0&amp;&amp;(e+=&quot;//&quot;+r.authority+&quot;/&quot;),e+=r.path,e}});var jr=T(io=&gt;{&quot;use strict&quot;;Object.defineProperty(io,&quot;__esModule&quot;,{value:!0});io.registerResolver=Ice;io.registerDefaultScheme=bce;io.createResolver=Lce;io.getDefaultAuthority=xce;io.mapUriDefaultScheme=Mce;var Av=Pt(),ra={},Ov=null;function Ice(r,e){ra[r]=e}function bce(r){Ov=r}function Lce(r,e,t){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return new ra[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Av.uriToString)(r)}`)}function xce(r){if(r.scheme!==void 0&amp;&amp;r.scheme in ra)return ra[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Av.uriToString)(r)}`)}function Mce(r){return r.scheme===void 0||!(r.scheme in ra)?Ov!==null?{scheme:Ov,authority:void 0,path:(0,Av.uriToString)(r)}:null:r}});var Oc=T(yc=&gt;{&quot;use strict&quot;;Object.defineProperty(yc,&quot;__esModule&quot;,{value:!0});yc.ChannelCredentials=void 0;yc.createCertificateProviderChannelCredentials=kce;var vc=V(&quot;tls&quot;),Fh=kh(),Nv=yv(),H3=Pt(),wce=jr(),Dce=Pe(),Uce=ue();function Rv(r,e){if(r&amp;&amp;!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var oo=class{compose(e){return new Iv(this,e)}static createSsl(e,t,o,s){var a;if(Rv(e,&quot;Root certificate&quot;),Rv(t,&quot;Private key&quot;),Rv(o,&quot;Certificate chain&quot;),t&amp;&amp;!o)throw new Error(&quot;Private key must be given with accompanying certificate chain&quot;);if(!t&amp;&amp;o)throw new Error(&quot;Certificate chain must be given with accompanying private key&quot;);let i=(0,vc.createSecureContext)({ca:(a=e??(0,Nv.getDefaultRootsData)())!==null&amp;&amp;a!==void 0?a:void 0,key:t??void 0,cert:o??void 0,ciphers:Nv.CIPHER_SUITES});return new Bh(i,s??{})}static createFromSecureContext(e,t){return new Bh(e,t??{})}static createInsecure(){return new Cv}};yc.ChannelCredentials=oo;var Cv=class r extends oo{constructor(){super()}compose(e){throw new Error(&quot;Cannot compose insecure credentials&quot;)}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=&gt;Promise.resolve(),getCallCredentials:()=&gt;o??Fh.CallCredentials.createEmpty(),destroy(){}}}};function q3(r,e,t,o){var s,a;let i={secureContext:r},n=t;if(&quot;grpc.http_connect_target&quot;in o){let f=(0,H3.parseUri)(o[&quot;grpc.http_connect_target&quot;]);f&amp;&amp;(n=f)}let l=(0,wce.getDefaultAuthority)(n),c=(0,H3.splitHostPort)(l),u=(s=c==null?void 0:c.host)!==null&amp;&amp;s!==void 0?s:l;if(i.host=u,e.checkServerIdentity&amp;&amp;(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&amp;&amp;(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=[&quot;h2&quot;],o[&quot;grpc.ssl_target_name_override&quot;]){let f=o[&quot;grpc.ssl_target_name_override&quot;],_=(a=i.checkServerIdentity)!==null&amp;&amp;a!==void 0?a:vc.checkServerIdentity;i.checkServerIdentity=(m,O)=&gt;_(f,O),i.servername=f}else i.servername=u;return o[&quot;grpc-node.tls_enable_trace&quot;]&amp;&amp;(i.enableTrace=!0),i}var Pv=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=&gt;{let a=(0,vc.connect)(t,()=&gt;{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&amp;&amp;i!==void 0)||i)&amp;&amp;!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on(&quot;error&quot;,i=&gt;{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Bh=class r extends oo{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&amp;&amp;this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,o){let s=q3(this.secureContext,this.verifyOptions,e,t);return new Pv(s,o??Fh.CallCredentials.createEmpty())}},Vh=class r extends oo{constructor(e,t,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=o,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,o;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((o=e.verifyOptions)===null||o===void 0?void 0:o.checkServerIdentity):!1}ref(){var e;this.refcount===0&amp;&amp;(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&amp;&amp;(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,o){return this.ref(),new r.SecureConnectorImpl(this,e,t,o??Fh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&amp;&amp;this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=&gt;{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&amp;&amp;!this.latestIdentityUpdate)return null;try{return(0,vc.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Nv.CIPHER_SUITES})}catch(o){return(0,Dce.log)(Uce.LogVerbosity.ERROR,&quot;Failed to createSecureContext with error &quot;+o.message),null}}};Vh.SecureConnectorImpl=class{constructor(r,e,t,o){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=o}connect(r){return new Promise((e,t)=&gt;{let o=this.parent.getLatestSecureContext();if(!o){t(new Error(&quot;Failed to load credentials&quot;));return}r.closed&amp;&amp;t(new Error(&quot;Socket closed while loading credentials&quot;));let s=q3(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:r},s),i=()=&gt;{t(new Error(&quot;Socket closed&quot;))},n=c=&gt;{t(c)},l=(0,vc.connect)(a,()=&gt;{var c;if(l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&amp;&amp;c!==void 0)||c)&amp;&amp;!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function kce(r,e,t){return new Vh(r,e,t??{})}var Iv=class r extends oo{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error(&quot;Cannot compose insecure credentials&quot;)}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&amp;&amp;this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,o){let s=this.callCredentials.compose(o??Fh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,s)}}});var so=T(Yr=&gt;{&quot;use strict&quot;;Object.defineProperty(Yr,&quot;__esModule&quot;,{value:!0});Yr.createChildChannelControlHelper=Fce;Yr.registerLoadBalancerType=Gce;Yr.registerDefaultLoadBalancerType=Hce;Yr.createLoadBalancer=qce;Yr.isLoadBalancerNameRegistered=jce;Yr.parseLoadBalancingConfig=j3;Yr.getDefaultConfig=Yce;Yr.selectLbConfigFromList=zce;var Bce=Pe(),Vce=ue();function Fce(r,e){var t,o,s,a,i,n,l,c,u,f;return{createSubchannel:(o=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&amp;&amp;o!==void 0?o:r.createSubchannel.bind(r),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&amp;&amp;a!==void 0?a:r.updateState.bind(r),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&amp;&amp;n!==void 0?n:r.requestReresolution.bind(r),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&amp;&amp;c!==void 0?c:r.addChannelzChild.bind(r),removeChannelzChild:(f=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&amp;&amp;f!==void 0?f:r.removeChannelzChild.bind(r)}}var Jn={},Ac=null;function Gce(r,e,t){Jn[r]={LoadBalancer:e,LoadBalancingConfig:t}}function Hce(r){Ac=r}function qce(r,e){let t=r.getLoadBalancerName();return t in Jn?new Jn[t].LoadBalancer(e):null}function jce(r){return r in Jn}function j3(r){let e=Object.keys(r);if(e.length!==1)throw new Error(&quot;Provided load balancing config has multiple conflicting entries&quot;);let t=e[0];if(t in Jn)try{return Jn[t].LoadBalancingConfig.createFromJson(r[t])}catch(o){throw new Error(`${t}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Yce(){if(!Ac)throw new Error(&quot;No default load balancer type registered&quot;);return new Jn[Ac].LoadBalancingConfig}function zce(r,e=!1){for(let t of r)try{return j3(t)}catch(o){(0,Bce.log)(Vce.LogVerbosity.DEBUG,&quot;Config parsing failed with error&quot;,o.message);continue}return e&amp;&amp;Ac?new Jn[Ac].LoadBalancingConfig:null}});var bv=T(Rc=&gt;{&quot;use strict&quot;;Object.defineProperty(Rc,&quot;__esModule&quot;,{value:!0});Rc.validateRetryThrottling=Y3;Rc.validateServiceConfig=z3;Rc.extractAndSelectServiceConfig=rue;var Kce=V(&quot;os&quot;),Gh=ue(),Hh=/^\d+(\.\d{1,9})?s$/,$ce=&quot;node&quot;;function Xce(r){if(&quot;service&quot;in r&amp;&amp;r.service!==&quot;&quot;){if(typeof r.service!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if(&quot;method&quot;in r&amp;&amp;r.method!==&quot;&quot;){if(typeof r.method!=&quot;string&quot;)throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if(&quot;method&quot;in r&amp;&amp;r.method!==void 0)throw new Error(&quot;Invalid method config name: method set with empty or unset service&quot;);return{}}}function Wce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config retry policy: maxAttempts must be an integer at least 2&quot;);if(!(&quot;initialBackoff&quot;in r)||typeof r.initialBackoff!=&quot;string&quot;||!Hh.test(r.initialBackoff))throw new Error(&quot;Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;maxBackoff&quot;in r)||typeof r.maxBackoff!=&quot;string&quot;||!Hh.test(r.maxBackoff))throw new Error(&quot;Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s&quot;);if(!(&quot;backoffMultiplier&quot;in r)||typeof r.backoffMultiplier!=&quot;number&quot;||r.backoffMultiplier&lt;=0)throw new Error(&quot;Invalid method config retry policy: backoffMultiplier must be a number greater than 0&quot;);if(!(&quot;retryableStatusCodes&quot;in r&amp;&amp;Array.isArray(r.retryableStatusCodes)))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes is required&quot;);if(r.retryableStatusCodes.length===0)throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes must be non-empty&quot;);for(let e of r.retryableStatusCodes)if(typeof e==&quot;number&quot;){if(!Object.values(Gh.Status).includes(e))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not in status code range&quot;)}else if(typeof e==&quot;string&quot;){if(!Object.values(Gh.Status).includes(e.toUpperCase()))throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config retry policy: retryableStatusCodes value must be a string or number&quot;);return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function Jce(r){if(!(&quot;maxAttempts&quot;in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts&lt;2)throw new Error(&quot;Invalid method config hedging policy: maxAttempts must be an integer at least 2&quot;);if(&quot;hedgingDelay&quot;in r&amp;&amp;(typeof r.hedgingDelay!=&quot;string&quot;||!Hh.test(r.hedgingDelay)))throw new Error(&quot;Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s&quot;);if(&quot;nonFatalStatusCodes&quot;in r&amp;&amp;Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t==&quot;number&quot;){if(!Object.values(Gh.Status).includes(t))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not in status code range&quot;)}else if(typeof t==&quot;string&quot;){if(!Object.values(Gh.Status).includes(t.toUpperCase()))throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value not a status code name&quot;)}else throw new Error(&quot;Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number&quot;);let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&amp;&amp;(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&amp;&amp;(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function Qce(r){var e;let t={name:[]};if(!(&quot;name&quot;in r)||!Array.isArray(r.name))throw new Error(&quot;Invalid method config: invalid name array&quot;);for(let o of r.name)t.name.push(Xce(o));if(&quot;waitForReady&quot;in r){if(typeof r.waitForReady!=&quot;boolean&quot;)throw new Error(&quot;Invalid method config: invalid waitForReady&quot;);t.waitForReady=r.waitForReady}if(&quot;timeout&quot;in r)if(typeof r.timeout==&quot;object&quot;){if(!(&quot;seconds&quot;in r.timeout)||typeof r.timeout.seconds!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.seconds&quot;);if(!(&quot;nanos&quot;in r.timeout)||typeof r.timeout.nanos!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid timeout.nanos&quot;);t.timeout=r.timeout}else if(typeof r.timeout==&quot;string&quot;&amp;&amp;Hh.test(r.timeout)){let o=r.timeout.substring(0,r.timeout.length-1).split(&quot;.&quot;);t.timeout={seconds:o[0]|0,nanos:((e=o[1])!==null&amp;&amp;e!==void 0?e:0)|0}}else throw new Error(&quot;Invalid method config: invalid timeout&quot;);if(&quot;maxRequestBytes&quot;in r){if(typeof r.maxRequestBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxRequestBytes=r.maxRequestBytes}if(&quot;maxResponseBytes&quot;in r){if(typeof r.maxResponseBytes!=&quot;number&quot;)throw new Error(&quot;Invalid method config: invalid maxRequestBytes&quot;);t.maxResponseBytes=r.maxResponseBytes}if(&quot;retryPolicy&quot;in r){if(&quot;hedgingPolicy&quot;in r)throw new Error(&quot;Invalid method config: retryPolicy and hedgingPolicy cannot both be specified&quot;);t.retryPolicy=Wce(r.retryPolicy)}else&quot;hedgingPolicy&quot;in r&amp;&amp;(t.hedgingPolicy=Jce(r.hedgingPolicy));return t}function Y3(r){if(!(&quot;maxTokens&quot;in r)||typeof r.maxTokens!=&quot;number&quot;||r.maxTokens&lt;=0||r.maxTokens&gt;1e3)throw new Error(&quot;Invalid retryThrottling: maxTokens must be a number in (0, 1000]&quot;);if(!(&quot;tokenRatio&quot;in r)||typeof r.tokenRatio!=&quot;number&quot;||r.tokenRatio&lt;=0)throw new Error(&quot;Invalid retryThrottling: tokenRatio must be a number greater than 0&quot;);return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function Zce(r){if(!(typeof r==&quot;object&quot;&amp;&amp;r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length&gt;1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error(&quot;Invalid loadBalancingConfig: load balancing policy name required&quot;);return{[e[0]]:r[e[0]]}}function z3(r){let e={loadBalancingConfig:[],methodConfig:[]};if(&quot;loadBalancingPolicy&quot;in r)if(typeof r.loadBalancingPolicy==&quot;string&quot;)e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error(&quot;Invalid service config: invalid loadBalancingPolicy&quot;);if(&quot;loadBalancingConfig&quot;in r)if(Array.isArray(r.loadBalancingConfig))for(let o of r.loadBalancingConfig)e.loadBalancingConfig.push(Zce(o));else throw new Error(&quot;Invalid service config: invalid loadBalancingConfig&quot;);if(&quot;methodConfig&quot;in r&amp;&amp;Array.isArray(r.methodConfig))for(let o of r.methodConfig)e.methodConfig.push(Qce(o));&quot;retryThrottling&quot;in r&amp;&amp;(e.retryThrottling=Y3(r.retryThrottling));let t=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of t)if(s.service===a.service&amp;&amp;s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);t.push(s)}return e}function eue(r){if(!(&quot;serviceConfig&quot;in r))throw new Error(&quot;Invalid service config choice: missing service config&quot;);let e={serviceConfig:z3(r.serviceConfig)};if(&quot;clientLanguage&quot;in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let o of r.clientLanguage)if(typeof o==&quot;string&quot;)e.clientLanguage.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientLanguage&quot;);if(&quot;clientHostname&quot;in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let o of r.clientHostname)if(typeof o==&quot;string&quot;)e.clientHostname.push(o);else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;)}else throw new Error(&quot;Invalid service config choice: invalid clientHostname&quot;);if(&quot;percentage&quot;in r)if(typeof r.percentage==&quot;number&quot;&amp;&amp;0&lt;=r.percentage&amp;&amp;r.percentage&lt;=100)e.percentage=r.percentage;else throw new Error(&quot;Invalid service config choice: invalid percentage&quot;);let t=[&quot;clientLanguage&quot;,&quot;percentage&quot;,&quot;clientHostname&quot;,&quot;serviceConfig&quot;];for(let o in r)if(!t.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function tue(r,e){if(!Array.isArray(r))throw new Error(&quot;Invalid service config list&quot;);for(let t of r){let o=eue(t);if(!(typeof o.percentage==&quot;number&quot;&amp;&amp;e&gt;o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===Kce.hostname()&amp;&amp;(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===$ce&amp;&amp;(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error(&quot;No matching service config found&quot;)}function rue(r,e){for(let t of r)if(t.length&gt;0&amp;&amp;t[0].startsWith(&quot;grpc_config=&quot;)){let o=t.join(&quot;&quot;).substring(12),s=JSON.parse(o);return tue(s,e)}return null}});var rr=T(qh=&gt;{&quot;use strict&quot;;Object.defineProperty(qh,&quot;__esModule&quot;,{value:!0});qh.ConnectivityState=void 0;var K3;(function(r){r[r.IDLE=0]=&quot;IDLE&quot;,r[r.CONNECTING=1]=&quot;CONNECTING&quot;,r[r.READY=2]=&quot;READY&quot;,r[r.TRANSIENT_FAILURE=3]=&quot;TRANSIENT_FAILURE&quot;,r[r.SHUTDOWN=4]=&quot;SHUTDOWN&quot;})(K3||(qh.ConnectivityState=K3={}))});var Zn=T(Qn=&gt;{&quot;use strict&quot;;Object.defineProperty(Qn,&quot;__esModule&quot;,{value:!0});Qn.QueuePicker=Qn.UnavailablePicker=Qn.PickResultType=void 0;var nue=ht(),iue=ue(),jh;(function(r){r[r.COMPLETE=0]=&quot;COMPLETE&quot;,r[r.QUEUE=1]=&quot;QUEUE&quot;,r[r.TRANSIENT_FAILURE=2]=&quot;TRANSIENT_FAILURE&quot;,r[r.DROP=3]=&quot;DROP&quot;})(jh||(Qn.PickResultType=jh={}));var Lv=class{constructor(e){this.status=Object.assign({code:iue.Status.UNAVAILABLE,details:&quot;No connection established&quot;,metadata:new nue.Metadata},e)}pick(e){return{pickResultType:jh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Qn.UnavailablePicker=Lv;var xv=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=&gt;{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:jh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Qn.QueuePicker=xv});var Nc=T(zh=&gt;{&quot;use strict&quot;;Object.defineProperty(zh,&quot;__esModule&quot;,{value:!0});zh.BackoffTimeout=void 0;var oue=ue(),sue=Pe(),aue=&quot;backoff&quot;,lue=1e3,cue=1.6,uue=12e4,fue=.2;function pue(r,e){return Math.random()*(e-r)+r}var Yh=class r{constructor(e,t){this.callback=e,this.initialDelay=lue,this.multiplier=cue,this.maxDelay=uue,this.jitter=fue,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&amp;&amp;(t.initialDelay&amp;&amp;(this.initialDelay=t.initialDelay),t.multiplier&amp;&amp;(this.multiplier=t.multiplier),t.jitter&amp;&amp;(this.jitter=t.jitter),t.maxDelay&amp;&amp;(this.maxDelay=t.maxDelay)),this.trace(&quot;constructed initialDelay=&quot;+this.initialDelay+&quot; multiplier=&quot;+this.multiplier+&quot; jitter=&quot;+this.jitter+&quot; maxDelay=&quot;+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=&gt;{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){sue.trace(oue.LogVerbosity.DEBUG,aue,&quot;{&quot;+this.id+&quot;} &quot;+e)}runTimer(e){var t,o;this.trace(&quot;runTimer(delay=&quot;+e+&quot;)&quot;),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=&gt;{this.trace(&quot;timer fired&quot;),this.running=!1,this.callback()},e),this.hasRef||(o=(t=this.timerId).unref)===null||o===void 0||o.call(t)}runOnce(){this.trace(&quot;runOnce()&quot;),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+pue(-t,t)}stop(){this.trace(&quot;stop()&quot;),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(&quot;reset() running=&quot;+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e&lt;t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};zh.BackoffTimeout=Yh;Yh.nextId=0});var $h=T(Kh=&gt;{&quot;use strict&quot;;Object.defineProperty(Kh,&quot;__esModule&quot;,{value:!0});Kh.ChildLoadBalancerHandler=void 0;var due=so(),hue=rr(),_ue=&quot;child_load_balancer_helper&quot;,Mv=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,o){return this.parent.channelControlHelper.createSubchannel(t,o)}updateState(t,o,s){var a;if(this.calledByPendingChild()){if(t===hue.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,o,s)}requestReresolution(){var t;let o=(t=this.parent.pendingChild)!==null&amp;&amp;t!==void 0?t:this.parent.currentChild;this.child===o&amp;&amp;this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,o){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),i=(0,due.createLoadBalancer)(t,a);a.setChild(i),this.currentChild===null?(this.currentChild=i,s=this.currentChild):(this.pendingChild&amp;&amp;this.pendingChild.destroy(),this.pendingChild=i,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;this.latestConfig=t,s.updateAddressList(e,t,o)}exitIdle(){this.currentChild&amp;&amp;(this.currentChild.exitIdle(),this.pendingChild&amp;&amp;this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&amp;&amp;(this.currentChild.resetBackoff(),this.pendingChild&amp;&amp;this.pendingChild.resetBackoff())}destroy(){this.currentChild&amp;&amp;(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&amp;&amp;(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return _ue}};Kh.ChildLoadBalancerHandler=Mv});var X3=T(Xh=&gt;{&quot;use strict&quot;;Object.defineProperty(Xh,&quot;__esModule&quot;,{value:!0});Xh.ResolvingLoadBalancer=void 0;var Eue=so(),mue=bv(),It=rr(),Tue=jr(),Cc=Zn(),Sue=Nc(),wv=ue(),gue=ht(),vue=Pe(),yue=ue(),Oue=Pt(),Aue=$h(),Rue=&quot;resolving_load_balancer&quot;;function $3(r){vue.trace(yue.LogVerbosity.DEBUG,Rue,r)}var Nue=[&quot;SERVICE_AND_METHOD&quot;,&quot;SERVICE&quot;,&quot;EMPTY&quot;];function Cue(r,e,t,o){for(let s of t.name)switch(o){case&quot;EMPTY&quot;:if(!s.service&amp;&amp;!s.method)return!0;break;case&quot;SERVICE&quot;:if(s.service===r&amp;&amp;!s.method)return!0;break;case&quot;SERVICE_AND_METHOD&quot;:if(s.service===r&amp;&amp;s.method===e)return!0}return!1}function Pue(r,e,t,o){for(let s of t)if(Cue(r,e,s,o))return s;return null}function Iue(r){return{invoke(e,t){var o,s;let a=e.split(&quot;/&quot;).filter(l=&gt;l.length&gt;0),i=(o=a[0])!==null&amp;&amp;o!==void 0?o:&quot;&quot;,n=(s=a[1])!==null&amp;&amp;s!==void 0?s:&quot;&quot;;if(r&amp;&amp;r.methodConfig)for(let l of Nue){let c=Pue(i,n,r.methodConfig,l);if(c)return{methodConfig:c,pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:wv.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Dv=class{constructor(e,t,o,s,a){this.target=e,this.channelControlHelper=t,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o[&quot;grpc.service_config&quot;]?this.defaultServiceConfig=(0,mue.validateServiceConfig)(JSON.parse(o[&quot;grpc.service_config&quot;])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(It.ConnectivityState.IDLE,new Cc.QueuePicker(this),null),this.childLoadBalancer=new Aue.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=&gt;{this.backoffTimeout.isRunning()?($3(&quot;requestReresolution delayed by backoff timer until &quot;+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,l,c)=&gt;{this.latestChildState=n,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(n,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,Tue.createResolver)(e,{onSuccessfulResolution:(n,l,c,u,f)=&gt;{var _;this.backoffTimeout.stop(),this.backoffTimeout.reset();let m=null;l===null?c===null?(this.previousServiceConfig=null,m=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(c):m=this.previousServiceConfig:(m=l,this.previousServiceConfig=l);let O=(_=m==null?void 0:m.loadBalancingConfig)!==null&amp;&amp;_!==void 0?_:[],y=(0,Eue.selectLbConfigFromList)(O,!0);if(y===null){this.handleResolutionFailure({code:wv.Status.UNAVAILABLE,details:&quot;All load balancer options in service config are not compatible&quot;,metadata:new gue.Metadata}),u==null||u.unref();return}this.childLoadBalancer.updateAddressList(n,y,Object.assign(Object.assign({},this.channelOptions),f));let A=m??this.defaultServiceConfig;this.onSuccessfulResolution(A,u??Iue(A))},onError:n=&gt;{this.handleResolutionFailure(n)}},o);let i={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new Sue.BackoffTimeout(()=&gt;{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===It.ConnectivityState.IDLE&amp;&amp;this.updateState(It.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,o){$3((0,Oue.uriToString)(this.target)+&quot; &quot;+It.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+It.ConnectivityState[e]),e===It.ConnectivityState.IDLE&amp;&amp;(t=new Cc.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}handleResolutionFailure(e){this.latestChildState===It.ConnectivityState.IDLE&amp;&amp;(this.updateState(It.ConnectivityState.TRANSIENT_FAILURE,new Cc.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===It.ConnectivityState.IDLE||this.currentState===It.ConnectivityState.TRANSIENT_FAILURE)&amp;&amp;(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error(&quot;updateAddressList not supported on ResolvingLoadBalancer&quot;)}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=It.ConnectivityState.IDLE,this.latestChildPicker=new Cc.QueuePicker(this),this.currentState=It.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return&quot;resolving_load_balancer&quot;}};Xh.ResolvingLoadBalancer=Dv});var W3=T(Pc=&gt;{&quot;use strict&quot;;Object.defineProperty(Pc,&quot;__esModule&quot;,{value:!0});Pc.recognizedOptions=void 0;Pc.channelOptionsEqual=bue;Pc.recognizedOptions={&quot;grpc.ssl_target_name_override&quot;:!0,&quot;grpc.primary_user_agent&quot;:!0,&quot;grpc.secondary_user_agent&quot;:!0,&quot;grpc.default_authority&quot;:!0,&quot;grpc.keepalive_time_ms&quot;:!0,&quot;grpc.keepalive_timeout_ms&quot;:!0,&quot;grpc.keepalive_permit_without_calls&quot;:!0,&quot;grpc.service_config&quot;:!0,&quot;grpc.max_concurrent_streams&quot;:!0,&quot;grpc.initial_reconnect_backoff_ms&quot;:!0,&quot;grpc.max_reconnect_backoff_ms&quot;:!0,&quot;grpc.use_local_subchannel_pool&quot;:!0,&quot;grpc.max_send_message_length&quot;:!0,&quot;grpc.max_receive_message_length&quot;:!0,&quot;grpc.enable_http_proxy&quot;:!0,&quot;grpc.enable_channelz&quot;:!0,&quot;grpc.dns_min_time_between_resolutions_ms&quot;:!0,&quot;grpc.enable_retries&quot;:!0,&quot;grpc.per_rpc_retry_buffer_size&quot;:!0,&quot;grpc.retry_buffer_size&quot;:!0,&quot;grpc.max_connection_age_ms&quot;:!0,&quot;grpc.max_connection_age_grace_ms&quot;:!0,&quot;grpc-node.max_session_memory&quot;:!0,&quot;grpc.service_config_disable_resolution&quot;:!0,&quot;grpc.client_idle_timeout_ms&quot;:!0,&quot;grpc-node.tls_enable_trace&quot;:!0,&quot;grpc.lb.ring_hash.ring_size_cap&quot;:!0,&quot;grpc-node.retry_max_attempts_limit&quot;:!0,&quot;grpc-node.flow_control_window&quot;:!0};function bue(r,e){let t=Object.keys(r).sort(),o=Object.keys(e).sort();if(t.length!==o.length)return!1;for(let s=0;s&lt;t.length;s+=1)if(t[s]!==o[s]||r[t[s]]!==e[o[s]])return!1;return!0}});var nr=T(gr=&gt;{&quot;use strict&quot;;Object.defineProperty(gr,&quot;__esModule&quot;,{value:!0});gr.EndpointMap=void 0;gr.isTcpSubchannelAddress=bc;gr.subchannelAddressEqual=Wh;gr.subchannelAddressToString=Q3;gr.stringToSubchannelAddress=xue;gr.endpointEqual=Mue;gr.endpointToString=wue;gr.endpointHasAddress=Z3;var J3=V(&quot;net&quot;);function bc(r){return&quot;port&quot;in r}function Wh(r,e){return!r&amp;&amp;!e?!0:!r||!e?!1:bc(r)?bc(e)&amp;&amp;r.host===e.host&amp;&amp;r.port===e.port:!bc(e)&amp;&amp;r.path===e.path}function Q3(r){return bc(r)?(0,J3.isIPv6)(r.host)?&quot;[&quot;+r.host+&quot;]:&quot;+r.port:r.host+&quot;:&quot;+r.port:r.path}var Lue=443;function xue(r,e){return(0,J3.isIP)(r)?{host:r,port:e??Lue}:{path:r}}function Mue(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t&lt;r.addresses.length;t++)if(!Wh(r.addresses[t],e.addresses[t]))return!1;return!0}function wue(r){return&quot;[&quot;+r.addresses.map(Q3).join(&quot;, &quot;)+&quot;]&quot;}function Z3(r,e){for(let t of r.addresses)if(Wh(t,e))return!0;return!1}function Ic(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let o=!1;for(let s of e.addresses)if(Wh(t,s)){o=!0;break}if(!o)return!1}return!0}var Uv=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Z3(t.key,e))return t.value}deleteMissing(e){let t=[];for(let o of this.map){let s=!1;for(let a of e)Ic(a,o.key)&amp;&amp;(s=!0);s||(t.push(o.value),this.map.delete(o))}return t}get(e){for(let t of this.map)if(Ic(e,t.key))return t.value}set(e,t){for(let o of this.map)if(Ic(e,o.key)){o.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ic(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ic(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};gr.EndpointMap=Uv});var tH={};Ae(tH,{OrderedMap:()=&gt;Hue});function na(r,e){if(typeof e!=&quot;function&quot;&amp;&amp;e!==null)throw new TypeError(&quot;Class extends value &quot;+String(e)+&quot; is not a constructor or null&quot;);kv(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Due(r,e){var t={label:0,sent:function(){if(a[0]&amp;1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==&quot;function&quot;&amp;&amp;(i[Symbol.iterator]=function(){return this}),i;function n(c){return function(u){return l([c,u])}}function l(c){if(o)throw new TypeError(&quot;Generator is already executing.&quot;);for(;i&amp;&amp;(i=0,c[0]&amp;&amp;(t=0)),t;)try{if(o=1,s&amp;&amp;(a=c[0]&amp;2?s.return:c[0]?s.throw||((a=s.return)&amp;&amp;a.call(s),0):s.next)&amp;&amp;!(a=a.call(s,c[1])).done)return a;switch(s=0,a&amp;&amp;(c=[c[0]&amp;2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length&gt;0&amp;&amp;a[a.length-1])&amp;&amp;(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&amp;&amp;(!a||c[1]&gt;a[0]&amp;&amp;c[1]&lt;a[3])){t.label=c[1];break}if(c[0]===6&amp;&amp;t.label&lt;a[1]){t.label=a[1],a=c;break}if(a&amp;&amp;t.label&lt;a[2]){t.label=a[2],t.ops.push(c);break}a[2]&amp;&amp;t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],s=0}finally{o=a=0}if(c[0]&amp;5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ao(){throw new RangeError(&quot;Iterator access denied!&quot;)}var kv,eH,Uue,kue,Bue,Vue,Fue,Gue,En,Hue,rH=p(()=&gt;{kv=function(r,e){return kv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&amp;&amp;function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&amp;&amp;(t[s]=o[s])},kv(r,e)};eH=(function(){function r(e,t,o){o===void 0&amp;&amp;(o=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=o}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&amp;&amp;e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var o=e.h;o.t===e;)e=o,o=e.h;e=o}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,o=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=o,o&amp;&amp;(o.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,o=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=o,o&amp;&amp;(o.h=this),t},r})(),Uue=(function(r){na(e,r);function e(){var t=r!==null&amp;&amp;r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&amp;&amp;(this.O+=this.t.O),this.i&amp;&amp;(this.O+=this.i.O)},e})(eH),kue=(function(){function r(e){e===void 0&amp;&amp;(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r})(),Bue=(function(){function r(){this._=0}return Object.defineProperty(r.prototype,&quot;length&quot;,{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r})(),Vue=(function(r){na(e,r);function e(){return r!==null&amp;&amp;r.apply(this,arguments)||this}return e})(Bue);Fue=(function(r){na(e,r);function e(t,o){t===void 0&amp;&amp;(t=function(a,i){return a&lt;i?-1:a&gt;i?1:0}),o===void 0&amp;&amp;(o=!1);var s=r.call(this)||this;return s.N=void 0,s.g=t,s.enableIndex=o,s.S=o?Uue:eH,s.A=new s.S,s}return e.prototype.m=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)t=t.i;else if(a&gt;0)s=t,t=t.t;else return t}return s},e.prototype.B=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;=0?t=t.i:(s=t,t=t.t)}return s},e.prototype.j=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);if(a&lt;0)s=t,t=t.i;else if(a&gt;0)t=t.t;else return t}return s},e.prototype.k=function(t,o){for(var s=this.A;t;){var a=this.g(t.u,o);a&lt;0?(s=t,t=t.i):t=t.t}return s},e.prototype.R=function(t){for(;;){var o=t.h;if(o===this.A)return;if(t.l===1){t.l=0;return}if(t===o.t){var s=o.i;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.T():o.T();else if(s.i&amp;&amp;s.i.l===1){s.l=o.l,o.l=0,s.i.l=0,o===this.N?this.N=o.T():o.T();return}else s.t&amp;&amp;s.t.l===1?(s.l=1,s.t.l=0,s.I()):(s.l=1,t=o)}else{var s=o.t;if(s.l===1)s.l=0,o.l=1,o===this.N?this.N=o.I():o.I();else if(s.t&amp;&amp;s.t.l===1){s.l=o.l,o.l=0,s.t.l=0,o===this.N?this.N=o.I():o.I();return}else s.i&amp;&amp;s.i.l===1?(s.l=1,s.i.l=0,s.T()):(s.l=1,t=o)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var o=t;o.t||o.i;){if(o.i)for(o=o.i;o.t;)o=o.t;else o=o.t;var s=t.u;t.u=o.u,o.u=s;var a=t.o;t.o=o.o,o.o=a,t=o}this.A.t===o?this.A.t=o.h:this.A.i===o&amp;&amp;(this.A.i=o.h),this.R(o);var i=o.h;if(o===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h},e.prototype.P=function(t){for(var o=typeof t==&quot;number&quot;?t:void 0,s=typeof t==&quot;function&quot;?t:void 0,a=typeof t&gt;&quot;u&quot;?[]:void 0,i=0,n=this.N,l=[];l.length||n;)if(n)l.push(n),n=n.t;else{if(n=l.pop(),i===o)return n;a&amp;&amp;a.push(n),s&amp;&amp;s(n,i,this),i+=1,n=n.i}return a},e.prototype.q=function(t){for(;;){var o=t.h;if(o.l===0)return;var s=o.h;if(o===s.t){var a=s.i;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.i){if(t.l=0,t.t&amp;&amp;(t.t.h=o),t.i&amp;&amp;(t.i.h=s),o.i=t.t,s.t=t.i,t.t=o,t.i=s,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.I():s.I(),s.l=1;return}}else{var a=s.t;if(a&amp;&amp;a.l===1){if(a.l=o.l=0,s===this.N)return;s.l=1,t=s;continue}else if(t===o.t){if(t.l=0,t.t&amp;&amp;(t.t.h=s),t.i&amp;&amp;(t.i.h=o),s.i=t.t,o.t=t.i,t.t=s,t.i=o,s===this.N)this.N=t,this.A.h=t;else{var i=s.h;i.t===s?i.t=t:i.i=t}t.h=s.h,o.h=t,s.h=t,s.l=1}else{o.l=0,s===this.N?this.N=s.T():s.T(),s.l=1;return}}this.enableIndex&amp;&amp;(o.M(),s.M(),t.M());return}},e.prototype.D=function(t,o,s){if(this.N===void 0)return this._+=1,this.N=new this.S(t,o,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var a,i=this.A.t,n=this.g(i.u,t);if(n===0)return i.o=o,this._;if(n&gt;0)i.t=new this.S(t,o),i.t.h=i,a=i.t,this.A.t=a;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=o,this._;if(c&lt;0)l.i=new this.S(t,o),l.i.h=l,a=l.i,this.A.i=a;else{if(s!==void 0){var u=s.C;if(u!==this.A){var f=this.g(u.u,t);if(f===0)return u.o=o,this._;if(f&gt;0){var _=u.v(),m=this.g(_.u,t);if(m===0)return _.o=o,this._;m&lt;0&amp;&amp;(a=new this.S(t,o),_.i===void 0?(_.i=a,a.h=_):(u.t=a,a.h=u))}}}if(a===void 0)for(a=this.N;;){var O=this.g(a.u,t);if(O&gt;0){if(a.t===void 0){a.t=new this.S(t,o),a.t.h=a,a=a.t;break}a=a.t}else if(O&lt;0){if(a.i===void 0){a.i=new this.S(t,o),a.i.h=a,a=a.i;break}a=a.i}else return a.o=o,this._}}}if(this.enableIndex)for(var y=a.h;y!==this.A;)y.O+=1,y=y.h;return this.q(a),this._+=1,this._},e.prototype.F=function(t,o){for(;t;){var s=this.g(t.u,o);if(s&lt;0)t=t.i;else if(s&gt;0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,o){var s=t.C;if(s===this.A&amp;&amp;ao(),this._===1)return s.u=o,!0;var a=s.p().u;if(s===this.A.t)return this.g(a,o)&gt;0?(s.u=o,!0):!1;var i=s.v().u;return s===this.A.i?this.g(i,o)&lt;0?(s.u=o,!0):!1:this.g(i,o)&gt;=0||this.g(a,o)&lt;=0?!1:(s.u=o,!0)},e.prototype.eraseElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return this.G(o),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var o=this.F(this.N,t);return o===this.A?!1:(this.G(o),!0)},e.prototype.eraseElementByIterator=function(t){var o=t.C;o===this.A&amp;&amp;ao();var s=o.i===void 0,a=t.iteratorType===0;return a?s&amp;&amp;t.next():(!s||o.t===void 0)&amp;&amp;t.next(),this.G(o),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(o){return o?Math.max(t(o.t),t(o.i))+1:0}return t(this.N)},e})(Vue),Gue=(function(r){na(e,r);function e(t,o,s){var a=r.call(this,s)||this;return a.C=t,a.A=o,a.iteratorType===0?(a.pre=function(){return this.C===this.A.t&amp;&amp;ao(),this.C=this.C.v(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.p(),this}):(a.pre=function(){return this.C===this.A.i&amp;&amp;ao(),this.C=this.C.p(),this},a.next=function(){return this.C===this.A&amp;&amp;ao(),this.C=this.C.v(),this}),a}return Object.defineProperty(e.prototype,&quot;index&quot;,{get:function(){var t=this.C,o=this.A.h;if(t===this.A)return o?o.O-1:0;var s=0;for(t.t&amp;&amp;(s+=t.t.O);t!==o;){var a=t.h;t===a.i&amp;&amp;(s+=1,a.t&amp;&amp;(s+=a.t.O)),t=a}return s},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(kue),En=(function(r){na(e,r);function e(t,o,s,a){var i=r.call(this,t,o,a)||this;return i.container=s,i}return Object.defineProperty(e.prototype,&quot;pointer&quot;,{get:function(){this.C===this.A&amp;&amp;ao();var t=this;return new Proxy([],{get:function(o,s){return s===&quot;0&quot;?t.C.u:s===&quot;1&quot;?t.C.o:(o[0]=t.C.u,o[1]=t.C.o,o[s])},set:function(o,s,a){if(s!==&quot;1&quot;)throw new TypeError(&quot;prop must be 1&quot;);return t.C.o=a,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Gue),Hue=(function(r){na(e,r);function e(t,o,s){t===void 0&amp;&amp;(t=[]);var a=r.call(this,o,s)||this,i=a;return t.forEach((function(n){i.setElement(n[0],n[1])})),a}return e.prototype.begin=function(){return new En(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new En(this.A,this.A,this)},e.prototype.rBegin=function(){return new En(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new En(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var o=this.m(this.N,t);return new En(o,this.A,this)},e.prototype.upperBound=function(t){var o=this.B(this.N,t);return new En(o,this.A,this)},e.prototype.reverseLowerBound=function(t){var o=this.j(this.N,t);return new En(o,this.A,this)},e.prototype.reverseUpperBound=function(t){var o=this.k(this.N,t);return new En(o,this.A,this)},e.prototype.forEach=function(t){this.P((function(o,s,a){t([o.u,o.o],s,a)}))},e.prototype.setElement=function(t,o,s){return this.D(t,o,s)},e.prototype.getElementByPos=function(t){if(t&lt;0||t&gt;this._-1)throw new RangeError;var o=this.P(t);return[o.u,o.o]},e.prototype.find=function(t){var o=this.F(this.N,t);return new En(o,this.A,this)},e.prototype.getElementByKey=function(t){var o=this.F(this.N,t);return o.o},e.prototype.union=function(t){var o=this;return t.forEach((function(s){o.setElement(s[0],s[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,o,s,a;return Due(this,(function(i){switch(i.label){case 0:t=this._,o=this.P(),s=0,i.label=1;case 1:return s&lt;t?(a=o[s],[4,[a.u,a.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++s,[3,1];case 4:return[2]}}))},e})(Fue)});var Qh=T(Jh=&gt;{&quot;use strict&quot;;Object.defineProperty(Jh,&quot;__esModule&quot;,{value:!0});Jh.registerAdminService=que;Jh.addAdminServicesToServer=jue;var nH=[];function que(r,e){nH.push({getServiceDefinition:r,getHandlers:e})}function jue(r){for(let{getServiceDefinition:e,getHandlers:t}of nH)r.addService(e(),t())}});var iH=T(vr=&gt;{&quot;use strict&quot;;Object.defineProperty(vr,&quot;__esModule&quot;,{value:!0});vr.ClientDuplexStreamImpl=vr.ClientWritableStreamImpl=vr.ClientReadableStreamImpl=vr.ClientUnaryCallImpl=void 0;vr.callErrorFromStatus=zue;var Yue=V(&quot;events&quot;),Hv=V(&quot;stream&quot;),Lc=ue();function zue(r,e){let t=`${r.code} ${Lc.Status[r.code]}: ${r.details}`,s=`${new Error(t).stack} for call at ${e}`;return Object.assign(new Error(t),r,{stack:s})}var Bv=class extends Yue.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}};vr.ClientUnaryCallImpl=Bv;var Vv=class extends Hv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};vr.ClientReadableStreamImpl=Vv;var Fv=class extends Hv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientWritableStreamImpl=Fv;var Gv=class extends Hv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Lc.Status.CANCELLED,&quot;Cancelled on client&quot;)}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:&quot;unknown&quot;}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,o){var s;let a={callback:o},i=Number(t);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};vr.ClientDuplexStreamImpl=Gv});var oH=T(xc=&gt;{&quot;use strict&quot;;Object.defineProperty(xc,&quot;__esModule&quot;,{value:!0});xc.InterceptingListenerImpl=void 0;xc.isInterceptingListener=Kue;function Kue(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var qv=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&amp;&amp;this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};xc.InterceptingListenerImpl=qv});var Wv=T(yr=&gt;{&quot;use strict&quot;;Object.defineProperty(yr,&quot;__esModule&quot;,{value:!0});yr.InterceptingCall=yr.RequesterBuilder=yr.ListenerBuilder=yr.InterceptorConfigurationError=void 0;yr.getInterceptingCall=Jue;var $ue=ht(),sH=oH(),aH=ue(),lH=Mh(),wc=class r extends Error{constructor(e){super(e),this.name=&quot;InterceptorConfigurationError&quot;,Error.captureStackTrace(this,r)}};yr.InterceptorConfigurationError=wc;var Yv=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yr.ListenerBuilder=Yv;var zv=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yr.RequesterBuilder=zv;var jv={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveStatus:(r,e)=&gt;{e(r)}},Mc={start:(r,e,t)=&gt;{t(r,e)},sendMessage:(r,e)=&gt;{e(r)},halfClose:r=&gt;{r()},cancel:r=&gt;{r()}},Kv=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(o=t.start)!==null&amp;&amp;o!==void 0?o:Mc.start,sendMessage:(s=t.sendMessage)!==null&amp;&amp;s!==void 0?s:Mc.sendMessage,halfClose:(a=t.halfClose)!==null&amp;&amp;a!==void 0?a:Mc.halfClose,cancel:(i=t.cancel)!==null&amp;&amp;i!==void 0?i:Mc.cancel}:this.requester=Mc}cancelWithStatus(e,t){this.requester.cancel(()=&gt;{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&amp;&amp;(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&amp;&amp;this.nextCall.halfClose()}start(e,t){var o,s,a,i,n,l;let c={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(u=&gt;{}),onReceiveMessage:(i=(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0?void 0:a.bind(t))!==null&amp;&amp;i!==void 0?i:(u=&gt;{}),onReceiveStatus:(l=(n=t==null?void 0:t.onReceiveStatus)===null||n===void 0?void 0:n.bind(t))!==null&amp;&amp;l!==void 0?l:(u=&gt;{})};this.processingMetadata=!0,this.requester.start(e,c,(u,f)=&gt;{var _,m,O;this.processingMetadata=!1;let y;if((0,sH.isInterceptingListener)(f))y=f;else{let A={onReceiveMetadata:(_=f.onReceiveMetadata)!==null&amp;&amp;_!==void 0?_:jv.onReceiveMetadata,onReceiveMessage:(m=f.onReceiveMessage)!==null&amp;&amp;m!==void 0?m:jv.onReceiveMessage,onReceiveStatus:(O=f.onReceiveStatus)!==null&amp;&amp;O!==void 0?O:jv.onReceiveStatus};y=new sH.InterceptingListenerImpl(A,c)}this.nextCall.start(u,y),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,o),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=&gt;{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};yr.InterceptingCall=Kv;function Xue(r,e,t){var o,s;let a=(o=t.deadline)!==null&amp;&amp;o!==void 0?o:1/0,i=t.host,n=(s=t.parent)!==null&amp;&amp;s!==void 0?s:null,l=t.propagate_flags,c=t.credentials,u=r.createCall(e,a,i,n,l);return c&amp;&amp;u.setCredentials(c),u}var Zh=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(s){this.call.cancelWithStatus(aH.Status.INTERNAL,`Request message serialization failure: ${(0,lH.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let o=null;this.call.start(e,{onReceiveMetadata:s=&gt;{var a;(a=t==null?void 0:t.onReceiveMetadata)===null||a===void 0||a.call(t,s)},onReceiveMessage:s=&gt;{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:aH.Status.INTERNAL,details:`Response message parsing error: ${(0,lH.getErrorMessage)(n)}`,metadata:new $ue.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=t==null?void 0:t.onReceiveMessage)===null||a===void 0||a.call(t,i)},onReceiveStatus:s=&gt;{var a,i;o?(a=t==null?void 0:t.onReceiveStatus)===null||a===void 0||a.call(t,o):(i=t==null?void 0:t.onReceiveStatus)===null||i===void 0||i.call(t,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},$v=class extends Zh{constructor(e,t){super(e,t)}start(e,t){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=t==null?void 0:t.onReceiveMetadata)===null||o===void 0?void 0:o.bind(t))!==null&amp;&amp;s!==void 0?s:(n=&gt;{}),onReceiveMessage:n=&gt;{var l;a=!0,(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,n)},onReceiveStatus:n=&gt;{var l,c;a||(l=t==null?void 0:t.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t==null?void 0:t.onReceiveStatus)===null||c===void 0||c.call(t,n)}};super.start(e,i),this.call.startRead()}},Xv=class extends Zh{};function Wue(r,e,t){let o=Xue(r,t.path,e);return t.responseStream?new Xv(o,t):new $v(o,t)}function Jue(r,e,t,o){if(r.clientInterceptors.length&gt;0&amp;&amp;r.clientInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(r.callInterceptors.length&gt;0&amp;&amp;r.callInterceptorProviders.length&gt;0)throw new wc(&quot;Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.&quot;);let s=[];r.callInterceptors.length&gt;0||r.callInterceptorProviders.length&gt;0?s=[].concat(r.callInterceptors,r.callInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n):s=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(n=&gt;n(e))).filter(n=&gt;n);let a=Object.assign({},t,{method_definition:e});return s.reduceRight((n,l)=&gt;c=&gt;l(c,n),n=&gt;Wue(o,n,e))(a)}});var Zv=T(t_=&gt;{&quot;use strict&quot;;Object.defineProperty(t_,&quot;__esModule&quot;,{value:!0});t_.Client=void 0;var zr=iH(),Que=ey(),Zue=rr(),ei=ue(),ia=ht(),e_=Wv(),Or=Symbol(),oa=Symbol(),sa=Symbol(),mn=Symbol();function Jv(r){return typeof r==&quot;function&quot;}function aa(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(` `).slice(1).join(` `))||&quot;no stack trace available&quot;}var Qv=class{constructor(e,t,o={}){var s,a;if(o=Object.assign({},o),this[oa]=(s=o.interceptors)!==null&amp;&amp;s!==void 0?s:[],delete o.interceptors,this[sa]=(a=o.interceptor_providers)!==null&amp;&amp;a!==void 0?a:[],delete o.interceptor_providers,this[oa].length&gt;0&amp;&amp;this[sa].length&gt;0)throw new Error(&quot;Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.&quot;);if(this[mn]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Or]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Or]=i(e,t,o)}else this[Or]=new Que.ChannelImplementation(e,t,o)}close(){this[Or].close()}getChannel(){return this[Or]}waitForReady(e,t){let o=s=&gt;{if(s){t(new Error(&quot;Failed to connect before the deadline&quot;));return}let a;try{a=this[Or].getConnectivityState(!0)}catch{t(new Error(&quot;The channel has been closed&quot;));return}if(a===Zue.ConnectivityState.READY)t();else try{this[Or].watchConnectivityState(a,e,o)}catch{t(new Error(&quot;The channel has been closed&quot;))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,t,o){if(Jv(e))return{metadata:new ia.Metadata,options:{},callback:e};if(Jv(t))return e instanceof ia.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ia.Metadata,options:e,callback:t};if(!(e instanceof ia.Metadata&amp;&amp;t instanceof Object&amp;&amp;Jv(o)))throw new Error(&quot;Incorrect arguments passed&quot;);return{metadata:e,options:t,callback:o}}makeUnaryRequest(e,t,o,s,a,i,n){var l,c;let u=this.checkOptionalUnaryResponseArguments(a,i,n),f={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:o},_={argument:s,metadata:u.metadata,call:new zr.ClientUnaryCallImpl,channel:this[Or],methodDefinition:f,callOptions:u.options,callback:u.callback};this[mn]&amp;&amp;(_=this[mn](_));let m=_.call,O={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(l=_.callOptions.interceptors)!==null&amp;&amp;l!==void 0?l:[],callInterceptorProviders:(c=_.callOptions.interceptor_providers)!==null&amp;&amp;c!==void 0?c:[]},y=(0,e_.getInterceptingCall)(O,_.methodDefinition,_.callOptions,_.channel);m.call=y;let A=null,I=!1,M=new Error;return y.start(_.metadata,{onReceiveMetadata:F=&gt;{m.emit(&quot;metadata&quot;,F)},onReceiveMessage(F){A!==null&amp;&amp;y.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),A=F},onReceiveStatus(F){if(!I){if(I=!0,F.code===ei.Status.OK)if(A===null){let N=aa(M);_.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:F.metadata},N))}else _.callback(null,A);else{let N=aa(M);_.callback((0,zr.callErrorFromStatus)(F,N))}M=null,m.emit(&quot;status&quot;,F)}}}),y.sendMessage(s),y.halfClose(),m}makeClientStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkOptionalUnaryResponseArguments(s,a,i),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:o},f={metadata:c.metadata,call:new zr.ClientWritableStreamImpl(t),channel:this[Or],methodDefinition:u,callOptions:c.options,callback:c.callback};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=null,A=!1,I=new Error;return O.start(f.metadata,{onReceiveMetadata:M=&gt;{_.emit(&quot;metadata&quot;,M)},onReceiveMessage(M){y!==null&amp;&amp;O.cancelWithStatus(ei.Status.UNIMPLEMENTED,&quot;Too many responses received&quot;),y=M,O.startRead()},onReceiveStatus(M){if(!A){if(A=!0,M.code===ei.Status.OK)if(y===null){let F=aa(I);f.callback((0,zr.callErrorFromStatus)({code:ei.Status.UNIMPLEMENTED,details:&quot;No message received&quot;,metadata:M.metadata},F))}else f.callback(null,y);else{let F=aa(I);f.callback((0,zr.callErrorFromStatus)(M,F))}I=null,_.emit(&quot;status&quot;,M)}}}),_}checkMetadataAndOptions(e,t){let o,s;return e instanceof ia.Metadata?(o=e,t?s=t:s={}):(e?s=e:s={},o=new ia.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,t,o,s,a,i){var n,l;let c=this.checkMetadataAndOptions(a,i),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:o},f={argument:s,metadata:c.metadata,call:new zr.ClientReadableStreamImpl(o),channel:this[Or],methodDefinition:u,callOptions:c.options};this[mn]&amp;&amp;(f=this[mn](f));let _=f.call,m={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(n=f.callOptions.interceptors)!==null&amp;&amp;n!==void 0?n:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&amp;&amp;l!==void 0?l:[]},O=(0,e_.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);_.call=O;let y=!1,A=new Error;return O.start(f.metadata,{onReceiveMetadata(I){_.emit(&quot;metadata&quot;,I)},onReceiveMessage(I){_.push(I)},onReceiveStatus(I){if(!y){if(y=!0,_.push(null),I.code!==ei.Status.OK){let M=aa(A);_.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(I,M))}A=null,_.emit(&quot;status&quot;,I)}}}),O.sendMessage(s),O.halfClose(),_}makeBidiStreamRequest(e,t,o,s,a){var i,n;let l=this.checkMetadataAndOptions(s,a),c={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:o},u={metadata:l.metadata,call:new zr.ClientDuplexStreamImpl(t,o),channel:this[Or],methodDefinition:c,callOptions:l.options};this[mn]&amp;&amp;(u=this[mn](u));let f=u.call,_={clientInterceptors:this[oa],clientInterceptorProviders:this[sa],callInterceptors:(i=u.callOptions.interceptors)!==null&amp;&amp;i!==void 0?i:[],callInterceptorProviders:(n=u.callOptions.interceptor_providers)!==null&amp;&amp;n!==void 0?n:[]},m=(0,e_.getInterceptingCall)(_,u.methodDefinition,u.callOptions,u.channel);f.call=m;let O=!1,y=new Error;return m.start(u.metadata,{onReceiveMetadata(A){f.emit(&quot;metadata&quot;,A)},onReceiveMessage(A){f.push(A)},onReceiveStatus(A){if(!O){if(O=!0,f.push(null),A.code!==ei.Status.OK){let I=aa(y);f.emit(&quot;error&quot;,(0,zr.callErrorFromStatus)(A,I))}y=null,f.emit(&quot;status&quot;,A)}}}),f}};t_.Client=Qv});var ry=T(r_=&gt;{&quot;use strict&quot;;Object.defineProperty(r_,&quot;__esModule&quot;,{value:!0});r_.makeClientConstructor=cH;r_.loadPackageDefinition=nfe;var Dc=Zv(),efe={unary:Dc.Client.prototype.makeUnaryRequest,server_stream:Dc.Client.prototype.makeServerStreamRequest,client_stream:Dc.Client.prototype.makeClientStreamRequest,bidi:Dc.Client.prototype.makeBidiStreamRequest};function ty(r){return[&quot;__proto__&quot;,&quot;prototype&quot;,&quot;constructor&quot;].includes(r)}function cH(r,e,t){t||(t={});class o extends Dc.Client{}return Object.keys(r).forEach(s=&gt;{if(ty(s))return;let a=r[s],i;if(typeof s==&quot;string&quot;&amp;&amp;s.charAt(0)===&quot;$&quot;)throw new Error(&quot;Method names cannot start with $&quot;);a.requestStream?a.responseStream?i=&quot;bidi&quot;:i=&quot;client_stream&quot;:a.responseStream?i=&quot;server_stream&quot;:i=&quot;unary&quot;;let n=a.requestSerialize,l=a.responseDeserialize,c=tfe(efe[i],a.path,n,l);o.prototype[s]=c,Object.assign(o.prototype[s],a),a.originalName&amp;&amp;!ty(a.originalName)&amp;&amp;(o.prototype[a.originalName]=o.prototype[s])}),o.service=r,o.serviceName=e,o}function tfe(r,e,t,o){return function(...s){return r.call(this,e,t,o,...s)}}function rfe(r){return&quot;format&quot;in r}function nfe(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let o=r[t],s=t.split(&quot;.&quot;);if(s.some(n=&gt;ty(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];rfe(o)?i[a]=o:i[a]=cH(o,a,{})}return e}});var wH=T((eFe,MH)=&gt;{var ife=1/0,ofe=&quot;[object Symbol]&quot;,sfe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,afe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i_=&quot;\\ud800-\\udfff&quot;,mH=&quot;\\u0300-\\u036f\\ufe20-\\ufe23&quot;,TH=&quot;\\u20d0-\\u20f0&quot;,SH=&quot;\\u2700-\\u27bf&quot;,gH=&quot;a-z\\xdf-\\xf6\\xf8-\\xff&quot;,lfe=&quot;\\xac\\xb1\\xd7\\xf7&quot;,cfe=&quot;\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf&quot;,ufe=&quot;\\u2000-\\u206f&quot;,ffe=&quot; \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000&quot;,vH=&quot;A-Z\\xc0-\\xd6\\xd8-\\xde&quot;,yH=&quot;\\ufe0e\\ufe0f&quot;,OH=lfe+cfe+ufe+ffe,iy=&quot;[&#x27;\u2019]&quot;,pfe=&quot;[&quot;+i_+&quot;]&quot;,uH=&quot;[&quot;+OH+&quot;]&quot;,n_=&quot;[&quot;+mH+TH+&quot;]&quot;,AH=&quot;\\d+&quot;,dfe=&quot;[&quot;+SH+&quot;]&quot;,RH=&quot;[&quot;+gH+&quot;]&quot;,NH=&quot;[^&quot;+i_+OH+AH+SH+gH+vH+&quot;]&quot;,ny=&quot;\\ud83c[\\udffb-\\udfff]&quot;,hfe=&quot;(?:&quot;+n_+&quot;|&quot;+ny+&quot;)&quot;,CH=&quot;[^&quot;+i_+&quot;]&quot;,oy=&quot;(?:\\ud83c[\\udde6-\\uddff]){2}&quot;,sy=&quot;[\\ud800-\\udbff][\\udc00-\\udfff]&quot;,la=&quot;[&quot;+vH+&quot;]&quot;,PH=&quot;\\u200d&quot;,fH=&quot;(?:&quot;+RH+&quot;|&quot;+NH+&quot;)&quot;,_fe=&quot;(?:&quot;+la+&quot;|&quot;+NH+&quot;)&quot;,pH=&quot;(?:&quot;+iy+&quot;(?:d|ll|m|re|s|t|ve))?&quot;,dH=&quot;(?:&quot;+iy+&quot;(?:D|LL|M|RE|S|T|VE))?&quot;,IH=hfe+&quot;?&quot;,bH=&quot;[&quot;+yH+&quot;]?&quot;,Efe=&quot;(?:&quot;+PH+&quot;(?:&quot;+[CH,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+bH+IH+&quot;)*&quot;,LH=bH+IH+Efe,mfe=&quot;(?:&quot;+[dfe,oy,sy].join(&quot;|&quot;)+&quot;)&quot;+LH,Tfe=&quot;(?:&quot;+[CH+n_+&quot;?&quot;,n_,oy,sy,pfe].join(&quot;|&quot;)+&quot;)&quot;,Sfe=RegExp(iy,&quot;g&quot;),gfe=RegExp(n_,&quot;g&quot;),vfe=RegExp(ny+&quot;(?=&quot;+ny+&quot;)|&quot;+Tfe+LH,&quot;g&quot;),yfe=RegExp([la+&quot;?&quot;+RH+&quot;+&quot;+pH+&quot;(?=&quot;+[uH,la,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,_fe+&quot;+&quot;+dH+&quot;(?=&quot;+[uH,la+fH,&quot;$&quot;].join(&quot;|&quot;)+&quot;)&quot;,la+&quot;?&quot;+fH+&quot;+&quot;+pH,la+&quot;+&quot;+dH,AH,mfe].join(&quot;|&quot;),&quot;g&quot;),Ofe=RegExp(&quot;[&quot;+PH+i_+mH+TH+yH+&quot;]&quot;),Afe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rfe={\u00C0:&quot;A&quot;,\u00C1:&quot;A&quot;,\u00C2:&quot;A&quot;,\u00C3:&quot;A&quot;,\u00C4:&quot;A&quot;,\u00C5:&quot;A&quot;,\u00E0:&quot;a&quot;,\u00E1:&quot;a&quot;,\u00E2:&quot;a&quot;,\u00E3:&quot;a&quot;,\u00E4:&quot;a&quot;,\u00E5:&quot;a&quot;,\u00C7:&quot;C&quot;,\u00E7:&quot;c&quot;,\u00D0:&quot;D&quot;,\u00F0:&quot;d&quot;,\u00C8:&quot;E&quot;,\u00C9:&quot;E&quot;,\u00CA:&quot;E&quot;,\u00CB:&quot;E&quot;,\u00E8:&quot;e&quot;,\u00E9:&quot;e&quot;,\u00EA:&quot;e&quot;,\u00EB:&quot;e&quot;,\u00CC:&quot;I&quot;,\u00CD:&quot;I&quot;,\u00CE:&quot;I&quot;,\u00CF:&quot;I&quot;,\u00EC:&quot;i&quot;,\u00ED:&quot;i&quot;,\u00EE:&quot;i&quot;,\u00EF:&quot;i&quot;,\u00D1:&quot;N&quot;,\u00F1:&quot;n&quot;,\u00D2:&quot;O&quot;,\u00D3:&quot;O&quot;,\u00D4:&quot;O&quot;,\u00D5:&quot;O&quot;,\u00D6:&quot;O&quot;,\u00D8:&quot;O&quot;,\u00F2:&quot;o&quot;,\u00F3:&quot;o&quot;,\u00F4:&quot;o&quot;,\u00F5:&quot;o&quot;,\u00F6:&quot;o&quot;,\u00F8:&quot;o&quot;,\u00D9:&quot;U&quot;,\u00DA:&quot;U&quot;,\u00DB:&quot;U&quot;,\u00DC:&quot;U&quot;,\u00F9:&quot;u&quot;,\u00FA:&quot;u&quot;,\u00FB:&quot;u&quot;,\u00FC:&quot;u&quot;,\u00DD:&quot;Y&quot;,\u00FD:&quot;y&quot;,\u00FF:&quot;y&quot;,\u00C6:&quot;Ae&quot;,\u00E6:&quot;ae&quot;,\u00DE:&quot;Th&quot;,\u00FE:&quot;th&quot;,\u00DF:&quot;ss&quot;,\u0100:&quot;A&quot;,\u0102:&quot;A&quot;,\u0104:&quot;A&quot;,\u0101:&quot;a&quot;,\u0103:&quot;a&quot;,\u0105:&quot;a&quot;,\u0106:&quot;C&quot;,\u0108:&quot;C&quot;,\u010A:&quot;C&quot;,\u010C:&quot;C&quot;,\u0107:&quot;c&quot;,\u0109:&quot;c&quot;,\u010B:&quot;c&quot;,\u010D:&quot;c&quot;,\u010E:&quot;D&quot;,\u0110:&quot;D&quot;,\u010F:&quot;d&quot;,\u0111:&quot;d&quot;,\u0112:&quot;E&quot;,\u0114:&quot;E&quot;,\u0116:&quot;E&quot;,\u0118:&quot;E&quot;,\u011A:&quot;E&quot;,\u0113:&quot;e&quot;,\u0115:&quot;e&quot;,\u0117:&quot;e&quot;,\u0119:&quot;e&quot;,\u011B:&quot;e&quot;,\u011C:&quot;G&quot;,\u011E:&quot;G&quot;,\u0120:&quot;G&quot;,\u0122:&quot;G&quot;,\u011D:&quot;g&quot;,\u011F:&quot;g&quot;,\u0121:&quot;g&quot;,\u0123:&quot;g&quot;,\u0124:&quot;H&quot;,\u0126:&quot;H&quot;,\u0125:&quot;h&quot;,\u0127:&quot;h&quot;,\u0128:&quot;I&quot;,\u012A:&quot;I&quot;,\u012C:&quot;I&quot;,\u012E:&quot;I&quot;,\u0130:&quot;I&quot;,\u0129:&quot;i&quot;,\u012B:&quot;i&quot;,\u012D:&quot;i&quot;,\u012F:&quot;i&quot;,\u0131:&quot;i&quot;,\u0134:&quot;J&quot;,\u0135:&quot;j&quot;,\u0136:&quot;K&quot;,\u0137:&quot;k&quot;,\u0138:&quot;k&quot;,\u0139:&quot;L&quot;,\u013B:&quot;L&quot;,\u013D:&quot;L&quot;,\u013F:&quot;L&quot;,\u0141:&quot;L&quot;,\u013A:&quot;l&quot;,\u013C:&quot;l&quot;,\u013E:&quot;l&quot;,\u0140:&quot;l&quot;,\u0142:&quot;l&quot;,\u0143:&quot;N&quot;,\u0145:&quot;N&quot;,\u0147:&quot;N&quot;,\u014A:&quot;N&quot;,\u0144:&quot;n&quot;,\u0146:&quot;n&quot;,\u0148:&quot;n&quot;,\u014B:&quot;n&quot;,\u014C:&quot;O&quot;,\u014E:&quot;O&quot;,\u0150:&quot;O&quot;,\u014D:&quot;o&quot;,\u014F:&quot;o&quot;,\u0151:&quot;o&quot;,\u0154:&quot;R&quot;,\u0156:&quot;R&quot;,\u0158:&quot;R&quot;,\u0155:&quot;r&quot;,\u0157:&quot;r&quot;,\u0159:&quot;r&quot;,\u015A:&quot;S&quot;,\u015C:&quot;S&quot;,\u015E:&quot;S&quot;,\u0160:&quot;S&quot;,\u015B:&quot;s&quot;,\u015D:&quot;s&quot;,\u015F:&quot;s&quot;,\u0161:&quot;s&quot;,\u0162:&quot;T&quot;,\u0164:&quot;T&quot;,\u0166:&quot;T&quot;,\u0163:&quot;t&quot;,\u0165:&quot;t&quot;,\u0167:&quot;t&quot;,\u0168:&quot;U&quot;,\u016A:&quot;U&quot;,\u016C:&quot;U&quot;,\u016E:&quot;U&quot;,\u0170:&quot;U&quot;,\u0172:&quot;U&quot;,\u0169:&quot;u&quot;,\u016B:&quot;u&quot;,\u016D:&quot;u&quot;,\u016F:&quot;u&quot;,\u0171:&quot;u&quot;,\u0173:&quot;u&quot;,\u0174:&quot;W&quot;,\u0175:&quot;w&quot;,\u0176:&quot;Y&quot;,\u0177:&quot;y&quot;,\u0178:&quot;Y&quot;,\u0179:&quot;Z&quot;,\u017B:&quot;Z&quot;,\u017D:&quot;Z&quot;,\u017A:&quot;z&quot;,\u017C:&quot;z&quot;,\u017E:&quot;z&quot;,\u0132:&quot;IJ&quot;,\u0133:&quot;ij&quot;,\u0152:&quot;Oe&quot;,\u0153:&quot;oe&quot;,\u0149:&quot;&#x27;n&quot;,\u017F:&quot;ss&quot;},Nfe=typeof global==&quot;object&quot;&amp;&amp;global&amp;&amp;global.Object===Object&amp;&amp;global,Cfe=typeof self==&quot;object&quot;&amp;&amp;self&amp;&amp;self.Object===Object&amp;&amp;self,Pfe=Nfe||Cfe||Function(&quot;return this&quot;)();function Ife(r,e,t,o){var s=-1,a=r?r.length:0;for(o&amp;&amp;a&amp;&amp;(t=r[++s]);++s&lt;a;)t=e(t,r[s],s,r);return t}function bfe(r){return r.split(&quot;&quot;)}function Lfe(r){return r.match(sfe)||[]}function xfe(r){return function(e){return r==null?void 0:r[e]}}var Mfe=xfe(Rfe);function xH(r){return Ofe.test(r)}function wfe(r){return Afe.test(r)}function Dfe(r){return xH(r)?Ufe(r):bfe(r)}function Ufe(r){return r.match(vfe)||[]}function kfe(r){return r.match(yfe)||[]}var Bfe=Object.prototype,Vfe=Bfe.toString,hH=Pfe.Symbol,_H=hH?hH.prototype:void 0,EH=_H?_H.toString:void 0;function Ffe(r,e,t){var o=-1,s=r.length;e&lt;0&amp;&amp;(e=-e&gt;s?0:s+e),t=t&gt;s?s:t,t&lt;0&amp;&amp;(t+=s),s=e&gt;t?0:t-e&gt;&gt;&gt;0,e&gt;&gt;&gt;=0;for(var a=Array(s);++o&lt;s;)a[o]=r[o+e];return a}function Gfe(r){if(typeof r==&quot;string&quot;)return r;if(zfe(r))return EH?EH.call(r):&quot;&quot;;var e=r+&quot;&quot;;return e==&quot;0&quot;&amp;&amp;1/r==-ife?&quot;-0&quot;:e}function Hfe(r,e,t){var o=r.length;return t=t===void 0?o:t,!e&amp;&amp;t&gt;=o?r:Ffe(r,e,t)}function qfe(r){return function(e){e=o_(e);var t=xH(e)?Dfe(e):void 0,o=t?t[0]:e.charAt(0),s=t?Hfe(t,1).join(&quot;&quot;):e.slice(1);return o[r]()+s}}function jfe(r){return function(e){return Ife(Jfe(Xfe(e).replace(Sfe,&quot;&quot;)),r,&quot;&quot;)}}function Yfe(r){return!!r&amp;&amp;typeof r==&quot;object&quot;}function zfe(r){return typeof r==&quot;symbol&quot;||Yfe(r)&amp;&amp;Vfe.call(r)==ofe}function o_(r){return r==null?&quot;&quot;:Gfe(r)}var Kfe=jfe(function(r,e,t){return e=e.toLowerCase(),r+(t?$fe(e):e)});function $fe(r){return Wfe(o_(r).toLowerCase())}function Xfe(r){return r=o_(r),r&amp;&amp;r.replace(afe,Mfe).replace(gfe,&quot;&quot;)}var Wfe=qfe(&quot;toUpperCase&quot;);function Jfe(r,e,t){return r=o_(r),e=t?void 0:e,e===void 0?wfe(r)?kfe(r):Lfe(r):r.match(e)||[]}MH.exports=Kfe});var UH=T((tFe,DH)=&gt;{&quot;use strict&quot;;DH.exports=ay;function ay(r,e){typeof r==&quot;string&quot;&amp;&amp;(e=r,r=void 0);var t=[];function o(a){if(typeof a!=&quot;string&quot;){var i=s();if(ay.verbose&amp;&amp;console.log(&quot;codegen: &quot;+i),i=&quot;return &quot;+i,a){for(var n=Object.keys(a),l=new Array(n.length+1),c=new Array(n.length),u=0;u&lt;n.length;)l[u]=n[u],c[u]=a[n[u++]];return l[u]=i,Function.apply(null,l).apply(null,c)}return Function(i)()}for(var f=new Array(arguments.length-1),_=0;_&lt;f.length;)f[_]=arguments[++_];if(_=0,a=a.replace(/%([%dfijs])/g,function(O,y){var A=f[_++];switch(y){case&quot;d&quot;:case&quot;f&quot;:return String(Number(A));case&quot;i&quot;:return String(Math.floor(A));case&quot;j&quot;:return JSON.stringify(A);case&quot;s&quot;:return String(A)}return&quot;%&quot;}),_!==f.length)throw Error(&quot;parameter count mismatch&quot;);return t.push(a),o}function s(a){return&quot;function &quot;+(a||e||&quot;&quot;)+&quot;(&quot;+(r&amp;&amp;r.join(&quot;,&quot;)||&quot;&quot;)+`){ `+t.join(` `)+` }`}return o.toString=s,o}ay.verbose=!1});var BH=T((rFe,kH)=&gt;{&quot;use strict&quot;;kH.exports=Uc;var Qfe=Yg(),Zfe=zg(),ly=Zfe(&quot;fs&quot;);function Uc(r,e,t){return typeof e==&quot;function&quot;?(t=e,e={}):e||(e={}),t?!e.xhr&amp;&amp;ly&amp;&amp;ly.readFile?ly.readFile(r,function(s,a){return s&amp;&amp;typeof XMLHttpRequest&lt;&quot;u&quot;?Uc.xhr(r,e,t):s?t(s):t(null,e.binary?a:a.toString(&quot;utf8&quot;))}):Uc.xhr(r,e,t):Qfe(Uc,this,r,e)}Uc.xhr=function(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&amp;&amp;s.status!==200)return o(Error(&quot;status &quot;+s.status));if(t.binary){var i=s.response;if(!i){i=[];for(var n=0;n&lt;s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&amp;255)}return o(null,typeof Uint8Array&lt;&quot;u&quot;?new Uint8Array(i):i)}return o(null,s.responseText)}},t.binary&amp;&amp;(&quot;overrideMimeType&quot;in s&amp;&amp;s.overrideMimeType(&quot;text/plain; charset=x-user-defined&quot;),s.responseType=&quot;arraybuffer&quot;),s.open(&quot;GET&quot;,e),s.send()}});var GH=T(FH=&gt;{&quot;use strict&quot;;var uy=FH,VH=uy.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},cy=uy.normalize=function(e){e=e.replace(/\\/g,&quot;/&quot;).replace(/\/{2,}/g,&quot;/&quot;);var t=e.split(&quot;/&quot;),o=VH(e),s=&quot;&quot;;o&amp;&amp;(s=t.shift()+&quot;/&quot;);for(var a=0;a&lt;t.length;)t[a]===&quot;..&quot;?a&gt;0&amp;&amp;t[a-1]!==&quot;..&quot;?t.splice(--a,2):o?t.splice(a,1):++a:t[a]===&quot;.&quot;?t.splice(a,1):++a;return s+t.join(&quot;/&quot;)};uy.resolve=function(e,t,o){return o||(t=cy(t)),VH(t)?t:(o||(e=cy(e)),(e=e.replace(/(?:\/|^)[^/]+$/,&quot;&quot;)).length?cy(e+&quot;/&quot;+t):t)}});var ua=T((iFe,jH)=&gt;{&quot;use strict&quot;;jH.exports=pe;var s_=ri();((pe.prototype=Object.create(s_.prototype)).constructor=pe).className=&quot;Namespace&quot;;var fy=ti(),a_=rt(),epe=uo(),lo,ca,co;pe.fromJSON=function(e,t){return new pe(e,t.options).addJSON(t.nested)};function HH(r,e){if(r&amp;&amp;r.length){for(var t={},o=0;o&lt;r.length;++o)t[r[o].name]=r[o].toJSON(e);return t}}pe.arrayToJSON=HH;pe.isReservedId=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(typeof e[o]!=&quot;string&quot;&amp;&amp;e[o][0]&lt;=t&amp;&amp;e[o][1]&gt;t)return!0}return!1};pe.isReservedName=function(e,t){if(e){for(var o=0;o&lt;e.length;++o)if(e[o]===t)return!0}return!1};function pe(r,e){s_.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function qH(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(pe.prototype,&quot;nestedArray&quot;,{get:function(){return this._nestedArray||(this._nestedArray=a_.toArray(this.nested))}});pe.prototype.toJSON=function(e){return a_.toObject([&quot;options&quot;,this.options,&quot;nested&quot;,HH(this.nestedArray,e)])};pe.prototype.addJSON=function(e){var t=this;if(e)for(var o=Object.keys(e),s=0,a;s&lt;o.length;++s)a=e[o[s]],t.add((a.fields!==void 0?lo.fromJSON:a.values!==void 0?co.fromJSON:a.methods!==void 0?ca.fromJSON:a.id!==void 0?fy.fromJSON:pe.fromJSON)(o[s],a));return this};pe.prototype.get=function(e){return this.nested&amp;&amp;this.nested[e]||null};pe.prototype.getEnum=function(e){if(this.nested&amp;&amp;this.nested[e]instanceof co)return this.nested[e].values;throw Error(&quot;no such enum: &quot;+e)};pe.prototype.add=function(e){if(!(e instanceof fy&amp;&amp;e.extend!==void 0||e instanceof lo||e instanceof epe||e instanceof co||e instanceof ca||e instanceof pe))throw TypeError(&quot;object must be a valid nested object&quot;);if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof pe&amp;&amp;e instanceof pe&amp;&amp;!(t instanceof lo||t instanceof ca)){for(var o=t.nestedArray,s=0;s&lt;o.length;++s)e.add(o[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this)}this.nested[e.name]=e,this instanceof lo||this instanceof ca||this instanceof co||this instanceof fy||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),qH(this)};pe.prototype.remove=function(e){if(!(e instanceof s_))throw TypeError(&quot;object must be a ReflectionObject&quot;);if(e.parent!==this)throw Error(e+&quot; is not a member of &quot;+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),qH(this)};pe.prototype.define=function(e,t){if(a_.isString(e))e=e.split(&quot;.&quot;);else if(!Array.isArray(e))throw TypeError(&quot;illegal path&quot;);if(e&amp;&amp;e.length&amp;&amp;e[0]===&quot;&quot;)throw Error(&quot;path must be relative&quot;);for(var o=this;e.length&gt;0;){var s=e.shift();if(o.nested&amp;&amp;o.nested[s]){if(o=o.nested[s],!(o instanceof pe))throw Error(&quot;path conflicts with non-namespace objects&quot;)}else o.add(o=new pe(s))}return t&amp;&amp;o.addJSON(t),o};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t&lt;e.length;)e[t]instanceof pe?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,s_.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};pe.prototype.lookup=function(e,t,o){if(typeof t==&quot;boolean&quot;?(o=t,t=void 0):t&amp;&amp;!Array.isArray(t)&amp;&amp;(t=[t]),a_.isString(e)&amp;&amp;e.length){if(e===&quot;.&quot;)return this.root;e=e.split(&quot;.&quot;)}else if(!e.length)return this;var s=e.join(&quot;.&quot;);if(e[0]===&quot;&quot;)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&amp;&amp;this.root._fullyQualifiedObjects[&quot;.&quot;+s];if(a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)||(a=this._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&amp;&amp;(!t||t.indexOf(a.constructor)&gt;-1))return a;i=i.parent}return null};pe.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof pe&amp;&amp;(e=e.slice(1),s=o._lookupImpl(e,e.join(&quot;.&quot;)));else for(var a=0;a&lt;this.nestedArray.length;++a)this._nestedArray[a]instanceof pe&amp;&amp;(o=this._nestedArray[a]._lookupImpl(e,t))&amp;&amp;(s=o);return this._lookupCache[t]=s,s};pe.prototype.lookupType=function(e){var t=this.lookup(e,[lo]);if(!t)throw Error(&quot;no such type: &quot;+e);return t};pe.prototype.lookupEnum=function(e){var t=this.lookup(e,[co]);if(!t)throw Error(&quot;no such Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[lo,co]);if(!t)throw Error(&quot;no such Type or Enum &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe.prototype.lookupService=function(e){var t=this.lookup(e,[ca]);if(!t)throw Error(&quot;no such Service &#x27;&quot;+e+&quot;&#x27; in &quot;+this);return t};pe._configure=function(r,e,t){lo=r,ca=e,co=t}});var l_=T((oFe,YH)=&gt;{&quot;use strict&quot;;YH.exports=Tn;var py=ti();((Tn.prototype=Object.create(py.prototype)).constructor=Tn).className=&quot;MapField&quot;;var tpe=fo(),kc=rt();function Tn(r,e,t,o,s,a){if(py.call(this,r,e,o,void 0,void 0,s,a),!kc.isString(t))throw TypeError(&quot;keyType must be a string&quot;);this.keyType=t,this.resolvedKeyType=null,this.map=!0}Tn.fromJSON=function(e,t){return new Tn(e,t.id,t.keyType,t.type,t.options,t.comment)};Tn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return kc.toObject([&quot;keyType&quot;,this.keyType,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};Tn.prototype.resolve=function(){if(this.resolved)return this;if(tpe.mapKey[this.keyType]===void 0)throw Error(&quot;invalid key type: &quot;+this.keyType);return py.prototype.resolve.call(this)};Tn.d=function(e,t,o){return typeof o==&quot;function&quot;?o=kc.decorateType(o).name:o&amp;&amp;typeof o==&quot;object&quot;&amp;&amp;(o=kc.decorateEnum(o).name),function(a,i){kc.decorateType(a.constructor).add(new Tn(i,e,t,o))}}});var c_=T((sFe,zH)=&gt;{&quot;use strict&quot;;zH.exports=po;var dy=ri();((po.prototype=Object.create(dy.prototype)).constructor=po).className=&quot;Method&quot;;var fa=rt();function po(r,e,t,o,s,a,i,n,l){if(fa.isObject(s)?(i=s,s=a=void 0):fa.isObject(a)&amp;&amp;(i=a,a=void 0),!(e===void 0||fa.isString(e)))throw TypeError(&quot;type must be a string&quot;);if(!fa.isString(t))throw TypeError(&quot;requestType must be a string&quot;);if(!fa.isString(o))throw TypeError(&quot;responseType must be a string&quot;);dy.call(this,r,i),this.type=e||&quot;rpc&quot;,this.requestType=t,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=l}po.fromJSON=function(e,t){return new po(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};po.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return fa.toObject([&quot;type&quot;,this.type!==&quot;rpc&quot;&amp;&amp;this.type||void 0,&quot;requestType&quot;,this.requestType,&quot;requestStream&quot;,this.requestStream,&quot;responseType&quot;,this.responseType,&quot;responseStream&quot;,this.responseStream,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0,&quot;parsedOptions&quot;,this.parsedOptions])};po.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),dy.prototype.resolve.call(this))}});var u_=T((aFe,$H)=&gt;{&quot;use strict&quot;;$H.exports=Vt;var Sn=ua();((Vt.prototype=Object.create(Sn.prototype)).constructor=Vt).className=&quot;Service&quot;;var hy=c_(),Bc=rt(),rpe=iv();function Vt(r,e){Sn.call(this,r,e),this.methods={},this._methodsArray=null}Vt.fromJSON=function(e,t){var o=new Vt(e,t.options);if(t.methods)for(var s=Object.keys(t.methods),a=0;a&lt;s.length;++a)o.add(hy.fromJSON(s[a],t.methods[s[a]]));return t.nested&amp;&amp;o.addJSON(t.nested),t.edition&amp;&amp;(o._edition=t.edition),o.comment=t.comment,o._defaultEdition=&quot;proto3&quot;,o};Vt.prototype.toJSON=function(e){var t=Sn.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Bc.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;methods&quot;,Sn.arrayToJSON(this.methodsArray,e)||{},&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Object.defineProperty(Vt.prototype,&quot;methodsArray&quot;,{get:function(){return this._methodsArray||(this._methodsArray=Bc.toArray(this.methods))}});function KH(r){return r._methodsArray=null,r}Vt.prototype.get=function(e){return this.methods[e]||Sn.prototype.get.call(this,e)};Vt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sn.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t&lt;e.length;++t)e[t].resolve();return this};Vt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=&gt;{t._resolveFeaturesRecursive(e)}),this):this};Vt.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);return e instanceof hy?(this.methods[e.name]=e,e.parent=this,KH(this)):Sn.prototype.add.call(this,e)};Vt.prototype.remove=function(e){if(e instanceof hy){if(this.methods[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.methods[e.name],e.parent=null,KH(this)}return Sn.prototype.remove.call(this,e)};Vt.prototype.create=function(e,t,o){for(var s=new rpe.Service(e,t,o),a=0,i;a&lt;this.methodsArray.length;++a){var n=Bc.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,&quot;&quot;);s[n]=Bc.codegen([&quot;r&quot;,&quot;c&quot;],Bc.isReserved(n)?n+&quot;_&quot;:n)(&quot;return this.rpcCall(m,q,s,r,c)&quot;)({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var f_=T((lFe,XH)=&gt;{&quot;use strict&quot;;XH.exports=Kr;var npe=Fr();function Kr(r){if(r)for(var e=Object.keys(r),t=0;t&lt;e.length;++t)this[e[t]]=r[e[t]]}Kr.create=function(e){return this.$type.create(e)};Kr.encode=function(e,t){return this.$type.encode(e,t)};Kr.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};Kr.decode=function(e){return this.$type.decode(e)};Kr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Kr.verify=function(e){return this.$type.verify(e)};Kr.fromObject=function(e){return this.$type.fromObject(e)};Kr.toObject=function(e,t){return this.$type.toObject(e,t)};Kr.prototype.toJSON=function(){return this.$type.toObject(this,npe.toJSONOptions)}});var _y=T((cFe,JH)=&gt;{&quot;use strict&quot;;JH.exports=spe;var ipe=Ar(),gn=fo(),WH=rt();function ope(r){return&quot;missing required &#x27;&quot;+r.name+&quot;&#x27;&quot;}function spe(r){for(var e=WH.codegen([&quot;r&quot;,&quot;l&quot;,&quot;e&quot;],r.name+&quot;$decode&quot;)(&quot;if(!(r instanceof Reader))&quot;)(&quot;r=Reader.create(r)&quot;)(&quot;var c=l===undefined?r.len:r.pos+l,m=new this.ctor&quot;+(r.fieldsArray.filter(function(n){return n.map}).length?&quot;,k,value&quot;:&quot;&quot;))(&quot;while(r.pos&lt;c){&quot;)(&quot;var t=r.uint32()&quot;)(&quot;if(t===e)&quot;)(&quot;break&quot;)(&quot;switch(t&gt;&gt;&gt;3){&quot;),t=0;t&lt;r.fieldsArray.length;++t){var o=r._fieldsArray[t].resolve(),s=o.resolvedType instanceof ipe?&quot;int32&quot;:o.type,a=&quot;m&quot;+WH.safeProp(o.name);e(&quot;case %i: {&quot;,o.id),o.map?(e(&quot;if(%s===util.emptyObject)&quot;,a)(&quot;%s={}&quot;,a)(&quot;var c2 = r.uint32()+r.pos&quot;),gn.defaults[o.keyType]!==void 0?e(&quot;k=%j&quot;,gn.defaults[o.keyType]):e(&quot;k=null&quot;),gn.defaults[s]!==void 0?e(&quot;value=%j&quot;,gn.defaults[s]):e(&quot;value=null&quot;),e(&quot;while(r.pos&lt;c2){&quot;)(&quot;var tag2=r.uint32()&quot;)(&quot;switch(tag2&gt;&gt;&gt;3){&quot;)(&quot;case 1: k=r.%s(); break&quot;,o.keyType)(&quot;case 2:&quot;),gn.basic[s]===void 0?e(&quot;value=types[%i].decode(r,r.uint32())&quot;,t):e(&quot;value=r.%s()&quot;,s),e(&quot;break&quot;)(&quot;default:&quot;)(&quot;r.skipType(tag2&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),gn.long[o.keyType]!==void 0?e(&#x27;%s[typeof k===&quot;object&quot;?util.longToHash(k):k]=value&#x27;,a):e(&quot;%s[k]=value&quot;,a)):o.repeated?(e(&quot;if(!(%s&amp;&amp;%s.length))&quot;,a,a)(&quot;%s=[]&quot;,a),gn.packed[s]!==void 0&amp;&amp;e(&quot;if((t&amp;7)===2){&quot;)(&quot;var c2=r.uint32()+r.pos&quot;)(&quot;while(r.pos&lt;c2)&quot;)(&quot;%s.push(r.%s())&quot;,a,s)(&quot;}else&quot;),gn.basic[s]===void 0?e(o.delimited?&quot;%s.push(types[%i].decode(r,undefined,((t&amp;~7)|4)))&quot;:&quot;%s.push(types[%i].decode(r,r.uint32()))&quot;,a,t):e(&quot;%s.push(r.%s())&quot;,a,s)):gn.basic[s]===void 0?e(o.delimited?&quot;%s=types[%i].decode(r,undefined,((t&amp;~7)|4))&quot;:&quot;%s=types[%i].decode(r,r.uint32())&quot;,a,t):e(&quot;%s=r.%s()&quot;,a,s),e(&quot;break&quot;)(&quot;}&quot;)}for(e(&quot;default:&quot;)(&quot;r.skipType(t&amp;7)&quot;)(&quot;break&quot;)(&quot;}&quot;)(&quot;}&quot;),t=0;t&lt;r._fieldsArray.length;++t){var i=r._fieldsArray[t];i.required&amp;&amp;e(&quot;if(!m.hasOwnProperty(%j))&quot;,i.name)(&quot;throw util.ProtocolError(%j,{instance:m})&quot;,ope(i))}return e(&quot;return m&quot;)}});var Ty=T((uFe,QH)=&gt;{&quot;use strict&quot;;QH.exports=cpe;var ape=Ar(),Ey=rt();function ir(r,e){return r.name+&quot;: &quot;+e+(r.repeated&amp;&amp;e!==&quot;array&quot;?&quot;[]&quot;:r.map&amp;&amp;e!==&quot;object&quot;?&quot;{k:&quot;+r.keyType+&quot;}&quot;:&quot;&quot;)+&quot; expected&quot;}function my(r,e,t,o){if(e.resolvedType)if(e.resolvedType instanceof ape){r(&quot;switch(%s){&quot;,o)(&quot;default:&quot;)(&quot;return%j&quot;,ir(e,&quot;enum value&quot;));for(var s=Object.keys(e.resolvedType.values),a=0;a&lt;s.length;++a)r(&quot;case %i:&quot;,e.resolvedType.values[s[a]]);r(&quot;break&quot;)(&quot;}&quot;)}else r(&quot;{&quot;)(&quot;var e=types[%i].verify(%s);&quot;,t,o)(&quot;if(e)&quot;)(&quot;return%j+e&quot;,e.name+&quot;.&quot;)(&quot;}&quot;);else switch(e.type){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.isInteger(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;integer&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.isInteger(%s)&amp;&amp;!(%s&amp;&amp;util.isInteger(%s.low)&amp;&amp;util.isInteger(%s.high)))&quot;,o,o,o,o)(&quot;return%j&quot;,ir(e,&quot;integer|Long&quot;));break;case&quot;float&quot;:case&quot;double&quot;:r(&#x27;if(typeof %s!==&quot;number&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;number&quot;));break;case&quot;bool&quot;:r(&#x27;if(typeof %s!==&quot;boolean&quot;)&#x27;,o)(&quot;return%j&quot;,ir(e,&quot;boolean&quot;));break;case&quot;string&quot;:r(&quot;if(!util.isString(%s))&quot;,o)(&quot;return%j&quot;,ir(e,&quot;string&quot;));break;case&quot;bytes&quot;:r(&#x27;if(!(%s&amp;&amp;typeof %s.length===&quot;number&quot;||util.isString(%s)))&#x27;,o,o,o)(&quot;return%j&quot;,ir(e,&quot;buffer&quot;));break}return r}function lpe(r,e,t){switch(e.keyType){case&quot;int32&quot;:case&quot;uint32&quot;:case&quot;sint32&quot;:case&quot;fixed32&quot;:case&quot;sfixed32&quot;:r(&quot;if(!util.key32Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer key&quot;));break;case&quot;int64&quot;:case&quot;uint64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(!util.key64Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;integer|Long key&quot;));break;case&quot;bool&quot;:r(&quot;if(!util.key2Re.test(%s))&quot;,t)(&quot;return%j&quot;,ir(e,&quot;boolean key&quot;));break}return r}function cpe(r){var e=Ey.codegen([&quot;m&quot;],r.name+&quot;$verify&quot;)(&#x27;if(typeof m!==&quot;object&quot;||m===null)&#x27;)(&quot;return%j&quot;,&quot;object expected&quot;),t=r.oneofsArray,o={};t.length&amp;&amp;e(&quot;var p={}&quot;);for(var s=0;s&lt;r.fieldsArray.length;++s){var a=r._fieldsArray[s].resolve(),i=&quot;m&quot;+Ey.safeProp(a.name);if(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,i,a.name),a.map)e(&quot;if(!util.isObject(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;object&quot;))(&quot;var k=Object.keys(%s)&quot;,i)(&quot;for(var i=0;i&lt;k.length;++i){&quot;),lpe(e,a,&quot;k[i]&quot;),my(e,a,s,i+&quot;[k[i]]&quot;)(&quot;}&quot;);else if(a.repeated)e(&quot;if(!Array.isArray(%s))&quot;,i)(&quot;return%j&quot;,ir(a,&quot;array&quot;))(&quot;for(var i=0;i&lt;%s.length;++i){&quot;,i),my(e,a,s,i+&quot;[i]&quot;)(&quot;}&quot;);else{if(a.partOf){var n=Ey.safeProp(a.partOf.name);o[a.partOf.name]===1&amp;&amp;e(&quot;if(p%s===1)&quot;,n)(&quot;return%j&quot;,a.partOf.name+&quot;: multiple values&quot;),o[a.partOf.name]=1,e(&quot;p%s=1&quot;,n)}my(e,a,s,i)}a.optional&amp;&amp;e(&quot;}&quot;)}return e(&quot;return null&quot;)}});var vy=T(eq=&gt;{&quot;use strict&quot;;var ZH=eq,Vc=Ar(),$r=rt();function Sy(r,e,t,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Vc){r(&quot;switch(d%s){&quot;,o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n&lt;i.length;++n)a[i[n]]===e.typeDefault&amp;&amp;!s&amp;&amp;(r(&quot;default:&quot;)(&#x27;if(typeof(d%s)===&quot;number&quot;){m%s=d%s;break}&#x27;,o,o,o),e.repeated||r(&quot;break&quot;),s=!0),r(&quot;case%j:&quot;,i[n])(&quot;case %i:&quot;,a[i[n]])(&quot;m%s=%j&quot;,o,a[i[n]])(&quot;break&quot;);r(&quot;}&quot;)}else r(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,o)(&quot;throw TypeError(%j)&quot;,e.fullName+&quot;: object expected&quot;)(&quot;m%s=types[%i].fromObject(d%s)&quot;,o,t,o);else{var l=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;m%s=Number(d%s)&quot;,o,o);break;case&quot;uint32&quot;:case&quot;fixed32&quot;:r(&quot;m%s=d%s&gt;&gt;&gt;0&quot;,o,o);break;case&quot;int32&quot;:case&quot;sint32&quot;:case&quot;sfixed32&quot;:r(&quot;m%s=d%s|0&quot;,o,o);break;case&quot;uint64&quot;:l=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&quot;if(util.Long)&quot;)(&quot;(m%s=util.Long.fromValue(d%s)).unsigned=%j&quot;,o,o,l)(&#x27;else if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;m%s=parseInt(d%s,10)&quot;,o,o)(&#x27;else if(typeof d%s===&quot;number&quot;)&#x27;,o)(&quot;m%s=d%s&quot;,o,o)(&#x27;else if(typeof d%s===&quot;object&quot;)&#x27;,o)(&quot;m%s=new util.LongBits(d%s.low&gt;&gt;&gt;0,d%s.high&gt;&gt;&gt;0).toNumber(%s)&quot;,o,o,o,l?&quot;true&quot;:&quot;&quot;);break;case&quot;bytes&quot;:r(&#x27;if(typeof d%s===&quot;string&quot;)&#x27;,o)(&quot;util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)&quot;,o,o,o)(&quot;else if(d%s.length &gt;= 0)&quot;,o)(&quot;m%s=d%s&quot;,o,o);break;case&quot;string&quot;:r(&quot;m%s=String(d%s)&quot;,o,o);break;case&quot;bool&quot;:r(&quot;m%s=Boolean(d%s)&quot;,o,o);break}}return r}ZH.fromObject=function(e){var t=e.fieldsArray,o=$r.codegen([&quot;d&quot;],e.name+&quot;$fromObject&quot;)(&quot;if(d instanceof this.ctor)&quot;)(&quot;return d&quot;);if(!t.length)return o(&quot;return new this.ctor&quot;);o(&quot;var m=new this.ctor&quot;);for(var s=0;s&lt;t.length;++s){var a=t[s].resolve(),i=$r.safeProp(a.name);a.map?(o(&quot;if(d%s){&quot;,i)(&#x27;if(typeof d%s!==&quot;object&quot;)&#x27;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: object expected&quot;)(&quot;m%s={}&quot;,i)(&quot;for(var ks=Object.keys(d%s),i=0;i&lt;ks.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[ks[i]]&quot;)(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(o(&quot;if(d%s){&quot;,i)(&quot;if(!Array.isArray(d%s))&quot;,i)(&quot;throw TypeError(%j)&quot;,a.fullName+&quot;: array expected&quot;)(&quot;m%s=[]&quot;,i)(&quot;for(var i=0;i&lt;d%s.length;++i){&quot;,i),Sy(o,a,s,i+&quot;[i]&quot;)(&quot;}&quot;)(&quot;}&quot;)):(a.resolvedType instanceof Vc||o(&quot;if(d%s!=null){&quot;,i),Sy(o,a,s,i),a.resolvedType instanceof Vc||o(&quot;}&quot;))}return o(&quot;return m&quot;)};function gy(r,e,t,o){if(e.resolvedType)e.resolvedType instanceof Vc?r(&quot;d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s&quot;,o,t,o,o,t,o,o):r(&quot;d%s=types[%i].toObject(m%s,o)&quot;,o,t,o);else{var s=!1;switch(e.type){case&quot;double&quot;:case&quot;float&quot;:r(&quot;d%s=o.json&amp;&amp;!isFinite(m%s)?String(m%s):m%s&quot;,o,o,o,o);break;case&quot;uint64&quot;:s=!0;case&quot;int64&quot;:case&quot;sint64&quot;:case&quot;fixed64&quot;:case&quot;sfixed64&quot;:r(&#x27;if(typeof m%s===&quot;number&quot;)&#x27;,o)(&quot;d%s=o.longs===String?String(m%s):m%s&quot;,o,o,o)(&quot;else&quot;)(&quot;d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low&gt;&gt;&gt;0,m%s.high&gt;&gt;&gt;0).toNumber(%s):m%s&quot;,o,o,o,o,s?&quot;true&quot;:&quot;&quot;,o);break;case&quot;bytes&quot;:r(&quot;d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s&quot;,o,o,o,o,o);break;default:r(&quot;d%s=m%s&quot;,o,o);break}}return r}ZH.toObject=function(e){var t=e.fieldsArray.slice().sort($r.compareFieldsById);if(!t.length)return $r.codegen()(&quot;return {}&quot;);for(var o=$r.codegen([&quot;m&quot;,&quot;o&quot;],e.name+&quot;$toObject&quot;)(&quot;if(!o)&quot;)(&quot;o={}&quot;)(&quot;var d={}&quot;),s=[],a=[],i=[],n=0;n&lt;t.length;++n)t[n].partOf||(t[n].resolve().repeated?s:t[n].map?a:i).push(t[n]);if(s.length){for(o(&quot;if(o.arrays||o.defaults){&quot;),n=0;n&lt;s.length;++n)o(&quot;d%s=[]&quot;,$r.safeProp(s[n].name));o(&quot;}&quot;)}if(a.length){for(o(&quot;if(o.objects||o.defaults){&quot;),n=0;n&lt;a.length;++n)o(&quot;d%s={}&quot;,$r.safeProp(a[n].name));o(&quot;}&quot;)}if(i.length){for(o(&quot;if(o.defaults){&quot;),n=0;n&lt;i.length;++n){var l=i[n],c=$r.safeProp(l.name);if(l.resolvedType instanceof Vc)o(&quot;d%s=o.enums===String?%j:%j&quot;,c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)o(&quot;if(util.Long){&quot;)(&quot;var n=new util.Long(%i,%i,%j)&quot;,l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)(&quot;d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n&quot;,c)(&quot;}else&quot;)(&quot;d%s=o.longs===String?%j:%i&quot;,c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var u=&quot;[&quot;+Array.prototype.slice.call(l.typeDefault).join(&quot;,&quot;)+&quot;]&quot;;o(&quot;if(o.bytes===String)d%s=%j&quot;,c,String.fromCharCode.apply(String,l.typeDefault))(&quot;else{&quot;)(&quot;d%s=%s&quot;,c,u)(&quot;if(o.bytes!==Array)d%s=util.newBuffer(d%s)&quot;,c,c)(&quot;}&quot;)}else o(&quot;d%s=%j&quot;,c,l.typeDefault)}o(&quot;}&quot;)}var f=!1;for(n=0;n&lt;t.length;++n){var l=t[n],_=e._fieldsArray.indexOf(l),c=$r.safeProp(l.name);l.map?(f||(f=!0,o(&quot;var ks2&quot;)),o(&quot;if(m%s&amp;&amp;(ks2=Object.keys(m%s)).length){&quot;,c,c)(&quot;d%s={}&quot;,c)(&quot;for(var j=0;j&lt;ks2.length;++j){&quot;),gy(o,l,_,c+&quot;[ks2[j]]&quot;)(&quot;}&quot;)):l.repeated?(o(&quot;if(m%s&amp;&amp;m%s.length){&quot;,c,c)(&quot;d%s=[]&quot;,c)(&quot;for(var j=0;j&lt;m%s.length;++j){&quot;,c),gy(o,l,_,c+&quot;[j]&quot;)(&quot;}&quot;)):(o(&quot;if(m%s!=null&amp;&amp;m.hasOwnProperty(%j)){&quot;,c,l.name),gy(o,l,_,c),l.partOf&amp;&amp;o(&quot;if(o.oneofs)&quot;)(&quot;d%s=%j&quot;,$r.safeProp(l.partOf.name),l.name)),o(&quot;}&quot;)}return o(&quot;return d&quot;)}});var yy=T(tq=&gt;{&quot;use strict&quot;;var upe=tq,fpe=f_();upe[&quot;.google.protobuf.Any&quot;]={fromObject:function(r){if(r&amp;&amp;r[&quot;@type&quot;]){var e=r[&quot;@type&quot;].substring(r[&quot;@type&quot;].lastIndexOf(&quot;/&quot;)+1),t=this.lookup(e);if(t){var o=r[&quot;@type&quot;].charAt(0)===&quot;.&quot;?r[&quot;@type&quot;].slice(1):r[&quot;@type&quot;];return o.indexOf(&quot;/&quot;)===-1&amp;&amp;(o=&quot;/&quot;+o),this.create({type_url:o,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t=&quot;type.googleapis.com/&quot;,o=&quot;&quot;,s=&quot;&quot;;if(e&amp;&amp;e.json&amp;&amp;r.type_url&amp;&amp;r.value){s=r.type_url.substring(r.type_url.lastIndexOf(&quot;/&quot;)+1),o=r.type_url.substring(0,r.type_url.lastIndexOf(&quot;/&quot;)+1);var a=this.lookup(s);a&amp;&amp;(r=a.decode(r.value))}if(!(r instanceof this.ctor)&amp;&amp;r instanceof fpe){var i=r.$type.toObject(r,e),n=r.$type.fullName[0]===&quot;.&quot;?r.$type.fullName.slice(1):r.$type.fullName;return o===&quot;&quot;&amp;&amp;(o=t),s=o+n,i[&quot;@type&quot;]=s,i}return this.toObject(r,e)}}});var h_=T((dFe,nq)=&gt;{&quot;use strict&quot;;nq.exports=Re;var or=ua();((Re.prototype=Object.create(or.prototype)).constructor=Re).className=&quot;Type&quot;;var ppe=Ar(),Ry=uo(),p_=ti(),dpe=l_(),hpe=u_(),Oy=f_(),Ay=Oh(),_pe=vh(),_t=rt(),Epe=Ny(),mpe=_y(),Tpe=Ty(),rq=vy(),Spe=yy();function Re(r,e){or.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e&lt;r.length;++e){var t=this.fields[r[e]],o=t.id;if(this._fieldsById[o])throw Error(&quot;duplicate id &quot;+o+&quot; in &quot;+this);this._fieldsById[o]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=_t.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=_t.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Oy||((r.prototype=new Oy).constructor=r,_t.merge(r.prototype,e)),r.$type=r.prototype.$type=this,_t.merge(r,Oy,!0),this._ctor=r;for(var t=0;t&lt;this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var o={};for(t=0;t&lt;this.oneofsArray.length;++t)o[this._oneofsArray[t].resolve().name]={get:_t.oneOfGetter(this._oneofsArray[t].oneof),set:_t.oneOfSetter(this._oneofsArray[t].oneof)};t&amp;&amp;Object.defineProperties(r.prototype,o)}}});Re.generateConstructor=function(e){for(var t=_t.codegen([&quot;p&quot;],e.name),o=0,s;o&lt;e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?t(&quot;this%s={}&quot;,_t.safeProp(s.name)):s.repeated&amp;&amp;t(&quot;this%s=[]&quot;,_t.safeProp(s.name));return t(&quot;if(p)for(var ks=Object.keys(p),i=0;i&lt;ks.length;++i)if(p[ks[i]]!=null)&quot;)(&quot;this[ks[i]]=p[ks[i]]&quot;)};function d_(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var o=new Re(e,t.options);o.extensions=t.extensions,o.reserved=t.reserved;for(var s=Object.keys(t.fields),a=0;a&lt;s.length;++a)o.add((typeof t.fields[s[a]].keyType&lt;&quot;u&quot;?dpe.fromJSON:p_.fromJSON)(s[a],t.fields[s[a]]));if(t.oneofs)for(s=Object.keys(t.oneofs),a=0;a&lt;s.length;++a)o.add(Ry.fromJSON(s[a],t.oneofs[s[a]]));if(t.nested)for(s=Object.keys(t.nested),a=0;a&lt;s.length;++a){var i=t.nested[s[a]];o.add((i.id!==void 0?p_.fromJSON:i.fields!==void 0?Re.fromJSON:i.values!==void 0?ppe.fromJSON:i.methods!==void 0?hpe.fromJSON:or.fromJSON)(s[a],i))}return t.extensions&amp;&amp;t.extensions.length&amp;&amp;(o.extensions=t.extensions),t.reserved&amp;&amp;t.reserved.length&amp;&amp;(o.reserved=t.reserved),t.group&amp;&amp;(o.group=!0),t.comment&amp;&amp;(o.comment=t.comment),t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Re.prototype.toJSON=function(e){var t=or.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return _t.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,t&amp;&amp;t.options||void 0,&quot;oneofs&quot;,or.arrayToJSON(this.oneofsArray,e),&quot;fields&quot;,or.arrayToJSON(this.fieldsArray.filter(function(s){return!s.declaringField}),e)||{},&quot;extensions&quot;,this.extensions&amp;&amp;this.extensions.length?this.extensions:void 0,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;group&quot;,this.group||void 0,&quot;nested&quot;,t&amp;&amp;t.nested||void 0,&quot;comment&quot;,o?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;or.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o&lt;e.length;)e[o++].resolve();for(var t=this.fieldsArray,o=0;o&lt;t.length;)t[o++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,or.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=&gt;{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&amp;&amp;this.oneofs[e]||this.nested&amp;&amp;this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error(&quot;duplicate name &#x27;&quot;+e.name+&quot;&#x27; in &quot;+this);if(e instanceof p_&amp;&amp;e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(&quot;duplicate id &quot;+e.id+&quot; in &quot;+this);if(this.isReservedId(e.id))throw Error(&quot;id &quot;+e.id+&quot; is reserved in &quot;+this);if(this.isReservedName(e.name))throw Error(&quot;name &#x27;&quot;+e.name+&quot;&#x27; is reserved in &quot;+this);return e.parent&amp;&amp;e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),d_(this)}return e instanceof Ry?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),d_(this)):or.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof p_&amp;&amp;e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),d_(this)}if(e instanceof Ry){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+&quot; is not a member of &quot;+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),d_(this)}return or.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return or.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return or.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],o=0;o&lt;this.fieldsArray.length;++o)t.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Epe(this)({Writer:_pe,types:t,util:_t}),this.decode=mpe(this)({Reader:Ay,types:t,util:_t}),this.verify=Tpe(this)({types:t,util:_t}),this.fromObject=rq.fromObject(this)({types:t,util:_t}),this.toObject=rq.toObject(this)({types:t,util:_t});var s=Spe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&amp;&amp;t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof Ay||(e=Ay.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(o){_t.decorateType(o,e)}}});var T_=T((hFe,sq)=&gt;{&quot;use strict&quot;;sq.exports=Ft;var m_=ua();((Ft.prototype=Object.create(m_.prototype)).constructor=Ft).className=&quot;Root&quot;;var __=ti(),Cy=Ar(),gpe=uo(),ni=rt(),Py,Iy,Fc;function Ft(r){m_.call(this,&quot;&quot;,r),this.deferred=[],this.files=[],this._edition=&quot;proto2&quot;,this._fullyQualifiedObjects={}}Ft.fromJSON=function(e,t){return t||(t=new Ft),e.options&amp;&amp;t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};Ft.prototype.resolvePath=ni.path.resolve;Ft.prototype.fetch=ni.fetch;function oq(){}Ft.prototype.load=function r(e,t,o){typeof t==&quot;function&quot;&amp;&amp;(o=t,t=void 0);var s=this;if(!o)return ni.asPromise(r,s,e,t);var a=o===oq;function i(m,O){if(o){if(a)throw m;O&amp;&amp;O.resolveAll();var y=o;o=null,y(m,O)}}function n(m){var O=m.lastIndexOf(&quot;google/protobuf/&quot;);if(O&gt;-1){var y=m.substring(O);if(y in Fc)return y}return null}function l(m,O){try{if(ni.isString(O)&amp;&amp;O.charAt(0)===&quot;{&quot;&amp;&amp;(O=JSON.parse(O)),!ni.isString(O))s.setOptions(O.options).addJSON(O.nested);else{Iy.filename=m;var y=Iy(O,s,t),A,I=0;if(y.imports)for(;I&lt;y.imports.length;++I)(A=n(y.imports[I])||s.resolvePath(m,y.imports[I]))&amp;&amp;c(A);if(y.weakImports)for(I=0;I&lt;y.weakImports.length;++I)(A=n(y.weakImports[I])||s.resolvePath(m,y.weakImports[I]))&amp;&amp;c(A,!0)}}catch(M){i(M)}!a&amp;&amp;!u&amp;&amp;i(null,s)}function c(m,O){if(m=n(m)||m,!(s.files.indexOf(m)&gt;-1)){if(s.files.push(m),m in Fc){a?l(m,Fc[m]):(++u,setTimeout(function(){--u,l(m,Fc[m])}));return}if(a){var y;try{y=ni.fs.readFileSync(m).toString(&quot;utf8&quot;)}catch(A){O||i(A);return}l(m,y)}else++u,s.fetch(m,function(A,I){if(--u,!!o){if(A){O?u||i(null,s):i(A);return}l(m,I)}})}}var u=0;ni.isString(e)&amp;&amp;(e=[e]);for(var f=0,_;f&lt;e.length;++f)(_=s.resolvePath(&quot;&quot;,e[f]))&amp;&amp;c(_);return a?(s.resolveAll(),s):(u||i(null,s),s)};Ft.prototype.loadSync=function(e,t){if(!ni.isNode)throw Error(&quot;not supported&quot;);return this.load(e,t,oq)};Ft.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(&quot;unresolvable extensions: &quot;+this.deferred.map(function(e){return&quot;&#x27;extend &quot;+e.extend+&quot;&#x27; in &quot;+e.parent.fullName}).join(&quot;, &quot;));return m_.prototype.resolveAll.call(this)};var E_=/^[A-Z]/;function iq(r,e){var t=e.parent.lookup(e.extend);if(t){var o=new __(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(o.name)||(o.declaringField=e,e.extensionField=o,t.add(o)),!0}return!1}Ft.prototype._handleAdd=function(e){if(e instanceof __)e.extend!==void 0&amp;&amp;!e.extensionField&amp;&amp;(iq(this,e)||this.deferred.push(e));else if(e instanceof Cy)E_.test(e.name)&amp;&amp;(e.parent[e.name]=e.values);else if(!(e instanceof gpe)){if(e instanceof Py)for(var t=0;t&lt;this.deferred.length;)iq(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var o=0;o&lt;e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);E_.test(e.name)&amp;&amp;(e.parent[e.name]=e)}(e instanceof Py||e instanceof Cy||e instanceof __)&amp;&amp;(this._fullyQualifiedObjects[e.fullName]=e)};Ft.prototype._handleRemove=function(e){if(e instanceof __){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t&gt;-1&amp;&amp;this.deferred.splice(t,1)}}else if(e instanceof Cy)E_.test(e.name)&amp;&amp;delete e.parent[e.name];else if(e instanceof m_){for(var o=0;o&lt;e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);E_.test(e.name)&amp;&amp;delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ft._configure=function(r,e,t){Py=r,Iy=e,Fc=t}});var rt=T((_Fe,lq)=&gt;{&quot;use strict&quot;;var He=lq.exports=Fr(),aq=ov(),by,Ly;He.codegen=UH();He.fetch=BH();He.path=GH();He.fs=He.inquire(&quot;fs&quot;);He.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),s=0;s&lt;t.length;)o[s]=e[t[s++]];return o}return[]};He.toObject=function(e){for(var t={},o=0;o&lt;e.length;){var s=e[o++],a=e[o++];a!==void 0&amp;&amp;(t[s]=a)}return t};var vpe=/\\/g,ype=/&quot;/g;He.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)};He.safeProp=function(e){return!/^[$\w_]+$/.test(e)||He.isReserved(e)?&#x27;[&quot;&#x27;+e.replace(vpe,&quot;\\\\&quot;).replace(ype,&#x27;\\&quot;&#x27;)+&#x27;&quot;]&#x27;:&quot;.&quot;+e};He.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Ope=/_([a-z])/g;He.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Ope,function(t,o){return o.toUpperCase()})};He.compareFieldsById=function(e,t){return e.id-t.id};He.decorateType=function(e,t){if(e.$type)return t&amp;&amp;e.$type.name!==t&amp;&amp;(He.decorateRoot.remove(e.$type),e.$type.name=t,He.decorateRoot.add(e.$type)),e.$type;by||(by=h_());var o=new by(t||e.name);return He.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,&quot;$type&quot;,{value:o,enumerable:!1}),Object.defineProperty(e.prototype,&quot;$type&quot;,{value:o,enumerable:!1}),o};var Ape=0;He.decorateEnum=function(e){if(e.$type)return e.$type;Ly||(Ly=Ar());var t=new Ly(&quot;Enum&quot;+Ape++,e);return He.decorateRoot.add(t),Object.defineProperty(e,&quot;$type&quot;,{value:t,enumerable:!1}),t};He.setProperty=function(e,t,o,s){function a(i,n,l){var c=n.shift();if(c===&quot;__proto__&quot;||c===&quot;prototype&quot;)return i;if(n.length&gt;0)i[c]=a(i[c]||{},n,l);else{var u=i[c];if(u&amp;&amp;s)return i;u&amp;&amp;(l=[].concat(u).concat(l)),i[c]=l}return i}if(typeof e!=&quot;object&quot;)throw TypeError(&quot;dst must be an object&quot;);if(!t)throw TypeError(&quot;path must be specified&quot;);return t=t.split(&quot;.&quot;),a(e,t,o)};Object.defineProperty(He,&quot;decorateRoot&quot;,{get:function(){return aq.decorated||(aq.decorated=new(T_()))}})});var fo=T(cq=&gt;{&quot;use strict&quot;;var Gc=cq,Rpe=rt(),Npe=[&quot;double&quot;,&quot;float&quot;,&quot;int32&quot;,&quot;uint32&quot;,&quot;sint32&quot;,&quot;fixed32&quot;,&quot;sfixed32&quot;,&quot;int64&quot;,&quot;uint64&quot;,&quot;sint64&quot;,&quot;fixed64&quot;,&quot;sfixed64&quot;,&quot;bool&quot;,&quot;string&quot;,&quot;bytes&quot;];function Hc(r,e){var t=0,o={};for(e|=0;t&lt;r.length;)o[Npe[t+e]]=r[t++];return o}Gc.basic=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Gc.defaults=Hc([0,0,0,0,0,0,0,0,0,0,0,0,!1,&quot;&quot;,Rpe.emptyArray,null]);Gc.long=Hc([0,0,0,1,1],7);Gc.mapKey=Hc([0,0,0,5,5,0,0,0,1,1,0,2],2);Gc.packed=Hc([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ti=T((mFe,fq)=&gt;{&quot;use strict&quot;;fq.exports=nt;var jc=ri();((nt.prototype=Object.create(jc.prototype)).constructor=nt).className=&quot;Field&quot;;var uq=Ar(),xy=fo(),Ke=rt(),qc,Cpe=/^required|optional|repeated$/;nt.fromJSON=function(e,t){var o=new nt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};function nt(r,e,t,o,s,a,i){if(Ke.isObject(o)?(i=s,a=o,o=s=void 0):Ke.isObject(s)&amp;&amp;(i=a,a=s,s=void 0),jc.call(this,r,a),!Ke.isInteger(e)||e&lt;0)throw TypeError(&quot;id must be a non-negative integer&quot;);if(!Ke.isString(t))throw TypeError(&quot;type must be a string&quot;);if(o!==void 0&amp;&amp;!Cpe.test(o=o.toString().toLowerCase()))throw TypeError(&quot;rule must be a string rule&quot;);if(s!==void 0&amp;&amp;!Ke.isString(s))throw TypeError(&quot;extend must be a string&quot;);o===&quot;proto3_optional&quot;&amp;&amp;(o=&quot;optional&quot;),this.rule=o&amp;&amp;o!==&quot;optional&quot;?o:void 0,this.type=t,this.id=e,this.extend=s||void 0,this.repeated=o===&quot;repeated&quot;,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ke.Long?xy.long[t]!==void 0:!1,this.bytes=t===&quot;bytes&quot;,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(nt.prototype,&quot;required&quot;,{get:function(){return this._features.field_presence===&quot;LEGACY_REQUIRED&quot;}});Object.defineProperty(nt.prototype,&quot;optional&quot;,{get:function(){return!this.required}});Object.defineProperty(nt.prototype,&quot;delimited&quot;,{get:function(){return this.resolvedType instanceof qc&amp;&amp;this._features.message_encoding===&quot;DELIMITED&quot;}});Object.defineProperty(nt.prototype,&quot;packed&quot;,{get:function(){return this._features.repeated_field_encoding===&quot;PACKED&quot;}});Object.defineProperty(nt.prototype,&quot;hasPresence&quot;,{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==&quot;IMPLICIT&quot;}});nt.prototype.setOption=function(e,t,o){return jc.prototype.setOption.call(this,e,t,o)};nt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Ke.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;rule&quot;,this.rule!==&quot;optional&quot;&amp;&amp;this.rule||void 0,&quot;type&quot;,this.type,&quot;id&quot;,this.id,&quot;extend&quot;,this.extend,&quot;options&quot;,this.options,&quot;comment&quot;,t?this.comment:void 0])};nt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=xy.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof qc?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&amp;&amp;this.options.proto3_optional&amp;&amp;(this.typeDefault=null),this.options&amp;&amp;this.options.default!=null&amp;&amp;(this.typeDefault=this.options.default,this.resolvedType instanceof uq&amp;&amp;typeof this.typeDefault==&quot;string&quot;&amp;&amp;(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&amp;&amp;(this.options.packed!==void 0&amp;&amp;this.resolvedType&amp;&amp;!(this.resolvedType instanceof uq)&amp;&amp;delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Ke.Long.fromNumber(this.typeDefault,this.type.charAt(0)===&quot;u&quot;),Object.freeze&amp;&amp;Object.freeze(this.typeDefault);else if(this.bytes&amp;&amp;typeof this.typeDefault==&quot;string&quot;){var e;Ke.base64.test(this.typeDefault)?Ke.base64.decode(this.typeDefault,e=Ke.newBuffer(Ke.base64.length(this.typeDefault)),0):Ke.utf8.write(this.typeDefault,e=Ke.newBuffer(Ke.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Ke.emptyObject:this.repeated?this.defaultValue=Ke.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof qc&amp;&amp;(this.parent.ctor.prototype[this.name]=this.defaultValue),jc.prototype.resolve.call(this)};nt.prototype._inferLegacyProtoFeatures=function(e){if(e!==&quot;proto2&quot;&amp;&amp;e!==&quot;proto3&quot;)return{};var t={};if(this.rule===&quot;required&quot;&amp;&amp;(t.field_presence=&quot;LEGACY_REQUIRED&quot;),this.parent&amp;&amp;xy.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(&quot;.&quot;).pop());o&amp;&amp;o instanceof qc&amp;&amp;o.group&amp;&amp;(t.message_encoding=&quot;DELIMITED&quot;)}return this.getOption(&quot;packed&quot;)===!0?t.repeated_field_encoding=&quot;PACKED&quot;:this.getOption(&quot;packed&quot;)===!1&amp;&amp;(t.repeated_field_encoding=&quot;EXPANDED&quot;),t};nt.prototype._resolveFeatures=function(e){return jc.prototype._resolveFeatures.call(this,this._edition||e)};nt.d=function(e,t,o,s){return typeof t==&quot;function&quot;?t=Ke.decorateType(t).name:t&amp;&amp;typeof t==&quot;object&quot;&amp;&amp;(t=Ke.decorateEnum(t).name),function(i,n){Ke.decorateType(i.constructor).add(new nt(n,e,t,o,{default:s}))}};nt._configure=function(e){qc=e}});var uo=T((TFe,hq)=&gt;{&quot;use strict&quot;;hq.exports=Gt;var g_=ri();((Gt.prototype=Object.create(g_.prototype)).constructor=Gt).className=&quot;OneOf&quot;;var pq=ti(),S_=rt();function Gt(r,e,t,o){if(Array.isArray(e)||(t=e,e=void 0),g_.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError(&quot;fieldNames must be an Array&quot;);this.oneof=e||[],this.fieldsArray=[],this.comment=o}Gt.fromJSON=function(e,t){return new Gt(e,t.oneof,t.options,t.comment)};Gt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return S_.toObject([&quot;options&quot;,this.options,&quot;oneof&quot;,this.oneof,&quot;comment&quot;,t?this.comment:void 0])};function dq(r){if(r.parent)for(var e=0;e&lt;r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}Gt.prototype.add=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);return e.parent&amp;&amp;e.parent!==this.parent&amp;&amp;e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,dq(this),this};Gt.prototype.remove=function(e){if(!(e instanceof pq))throw TypeError(&quot;field must be a Field&quot;);var t=this.fieldsArray.indexOf(e);if(t&lt;0)throw Error(e+&quot; is not a member of &quot;+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t&gt;-1&amp;&amp;this.oneof.splice(t,1),e.partOf=null,this};Gt.prototype.onAdd=function(e){g_.prototype.onAdd.call(this,e);for(var t=this,o=0;o&lt;this.oneof.length;++o){var s=e.get(this.oneof[o]);s&amp;&amp;!s.partOf&amp;&amp;(s.partOf=t,t.fieldsArray.push(s))}dq(this)};Gt.prototype.onRemove=function(e){for(var t=0,o;t&lt;this.fieldsArray.length;++t)(o=this.fieldsArray[t]).parent&amp;&amp;o.parent.remove(o);g_.prototype.onRemove.call(this,e)};Object.defineProperty(Gt.prototype,&quot;isProto3Optional&quot;,{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&amp;&amp;r.options.proto3_optional===!0}});Gt.d=function(){for(var e=new Array(arguments.length),t=0;t&lt;arguments.length;)e[t]=arguments[t++];return function(s,a){S_.decorateType(s.constructor).add(new Gt(a,e)),Object.defineProperty(s,a,{get:S_.oneOfGetter(e),set:S_.oneOfSetter(e)})}}});var ri=T((SFe,_q)=&gt;{&quot;use strict&quot;;_q.exports=ct;ct.className=&quot;ReflectionObject&quot;;var Ppe=uo(),Yc=rt(),v_,Ipe={enum_type:&quot;OPEN&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;},bpe={enum_type:&quot;CLOSED&quot;,field_presence:&quot;EXPLICIT&quot;,json_format:&quot;LEGACY_BEST_EFFORT&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;EXPANDED&quot;,utf8_validation:&quot;NONE&quot;},Lpe={enum_type:&quot;OPEN&quot;,field_presence:&quot;IMPLICIT&quot;,json_format:&quot;ALLOW&quot;,message_encoding:&quot;LENGTH_PREFIXED&quot;,repeated_field_encoding:&quot;PACKED&quot;,utf8_validation:&quot;VERIFY&quot;};function ct(r,e){if(!Yc.isString(r))throw TypeError(&quot;name must be a string&quot;);if(e&amp;&amp;!Yc.isObject(e))throw TypeError(&quot;options must be an object&quot;);this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition=&quot;proto2&quot;,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(ct.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(&quot;.&quot;)}}});ct.prototype.toJSON=function(){throw Error()};ct.prototype.onAdd=function(e){this.parent&amp;&amp;this.parent!==e&amp;&amp;this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof v_&amp;&amp;t._handleAdd(this)};ct.prototype.onRemove=function(e){var t=e.root;t instanceof v_&amp;&amp;t._handleRemove(this),this.parent=null,this.resolved=!1};ct.prototype.resolve=function(){return this.resolved?this:(this.root instanceof v_&amp;&amp;(this.resolved=!0),this)};ct.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ct.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error(&quot;Unknown edition for &quot;+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e===&quot;proto2&quot;)t=Object.assign({},bpe);else if(e===&quot;proto3&quot;)t=Object.assign({},Lpe);else if(e===&quot;2023&quot;)t=Object.assign({},Ipe);else throw new Error(&quot;Unknown edition: &quot;+e);this._features=Object.assign(t,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof Ppe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error(&quot;Unable to find a parent for &quot;+this.fullName);this.extensionField&amp;&amp;(this.extensionField._features=this._features),this._featuresResolved=!0}};ct.prototype._inferLegacyProtoFeatures=function(){return{}};ct.prototype.getOption=function(e){if(this.options)return this.options[e]};ct.prototype.setOption=function(e,t,o){return this.options||(this.options={}),/^features\./.test(e)?Yc.setProperty(this.options,e,t,o):(!o||this.options[e]===void 0)&amp;&amp;(this.getOption(e)!==t&amp;&amp;(this.resolved=!1),this.options[e]=t),this};ct.prototype.setParsedOption=function(e,t,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(a){var i=a[e];Yc.setProperty(i,o,t)}else a={},a[e]=Yc.setProperty({},o,t),s.push(a)}else{var n={};n[e]=t,s.push(n)}return this};ct.prototype.setOptions=function(e,t){if(e)for(var o=Object.keys(e),s=0;s&lt;o.length;++s)this.setOption(o[s],e[o[s]],t);return this};ct.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+&quot; &quot;+t:e};ct.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===&quot;proto3&quot;))return this._edition};ct._configure=function(r){v_=r}});var Ar=T((gFe,mq)=&gt;{&quot;use strict&quot;;mq.exports=Rr;var My=ri();((Rr.prototype=Object.create(My.prototype)).constructor=Rr).className=&quot;Enum&quot;;var Eq=ua(),y_=rt();function Rr(r,e,t,o,s,a){if(My.call(this,r,t),e&amp;&amp;typeof e!=&quot;object&quot;)throw TypeError(&quot;values must be an object&quot;);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n&lt;i.length;++n)typeof e[i[n]]==&quot;number&quot;&amp;&amp;(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Rr.prototype._resolveFeatures=function(e){return e=this._edition||e,My.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=&gt;{var o=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(o,this.valuesOptions&amp;&amp;this.valuesOptions[t]&amp;&amp;this.valuesOptions[t].features)}),this};Rr.fromJSON=function(e,t){var o=new Rr(e,t.values,t.options,t.comment,t.comments);return o.reserved=t.reserved,t.edition&amp;&amp;(o._edition=t.edition),o._defaultEdition=&quot;proto3&quot;,o};Rr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return y_.toObject([&quot;edition&quot;,this._editionToJSON(),&quot;options&quot;,this.options,&quot;valuesOptions&quot;,this.valuesOptions,&quot;values&quot;,this.values,&quot;reserved&quot;,this.reserved&amp;&amp;this.reserved.length?this.reserved:void 0,&quot;comment&quot;,t?this.comment:void 0,&quot;comments&quot;,t?this.comments:void 0])};Rr.prototype.add=function(e,t,o,s){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);if(!y_.isInteger(t))throw TypeError(&quot;id must be an integer&quot;);if(this.values[e]!==void 0)throw Error(&quot;duplicate name &#x27;&quot;+e+&quot;&#x27; in &quot;+this);if(this.isReservedId(t))throw Error(&quot;id &quot;+t+&quot; is reserved in &quot;+this);if(this.isReservedName(e))throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; is reserved in &quot;+this);if(this.valuesById[t]!==void 0){if(!(this.options&amp;&amp;this.options.allow_alias))throw Error(&quot;duplicate id &quot;+t+&quot; in &quot;+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return s&amp;&amp;(this.valuesOptions===void 0&amp;&amp;(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Rr.prototype.remove=function(e){if(!y_.isString(e))throw TypeError(&quot;name must be a string&quot;);var t=this.values[e];if(t==null)throw Error(&quot;name &#x27;&quot;+e+&quot;&#x27; does not exist in &quot;+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&amp;&amp;delete this.valuesOptions[e],this};Rr.prototype.isReservedId=function(e){return Eq.isReservedId(this.reserved,e)};Rr.prototype.isReservedName=function(e){return Eq.isReservedName(this.reserved,e)}});var Ny=T((vFe,Sq)=&gt;{&quot;use strict&quot;;Sq.exports=Mpe;var xpe=Ar(),wy=fo(),Dy=rt();function Tq(r,e,t,o){return e.delimited?r(&quot;types[%i].encode(%s,w.uint32(%i)).uint32(%i)&quot;,t,o,(e.id&lt;&lt;3|3)&gt;&gt;&gt;0,(e.id&lt;&lt;3|4)&gt;&gt;&gt;0):r(&quot;types[%i].encode(%s,w.uint32(%i).fork()).ldelim()&quot;,t,o,(e.id&lt;&lt;3|2)&gt;&gt;&gt;0)}function Mpe(r){for(var e=Dy.codegen([&quot;m&quot;,&quot;w&quot;],r.name+&quot;$encode&quot;)(&quot;if(!w)&quot;)(&quot;w=Writer.create()&quot;),t,o,s=r.fieldsArray.slice().sort(Dy.compareFieldsById),t=0;t&lt;s.length;++t){var a=s[t].resolve(),i=r._fieldsArray.indexOf(a),n=a.resolvedType instanceof xpe?&quot;int32&quot;:a.type,l=wy.basic[n];o=&quot;m&quot;+Dy.safeProp(a.name),a.map?(e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j)){&quot;,o,a.name)(&quot;for(var ks=Object.keys(%s),i=0;i&lt;ks.length;++i){&quot;,o)(&quot;w.uint32(%i).fork().uint32(%i).%s(ks[i])&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0,8|wy.mapKey[a.keyType],a.keyType),l===void 0?e(&quot;types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()&quot;,i,o):e(&quot;.uint32(%i).%s(%s[ks[i]]).ldelim()&quot;,16|l,n,o),e(&quot;}&quot;)(&quot;}&quot;)):a.repeated?(e(&quot;if(%s!=null&amp;&amp;%s.length){&quot;,o,o),a.packed&amp;&amp;wy.packed[n]!==void 0?e(&quot;w.uint32(%i).fork()&quot;,(a.id&lt;&lt;3|2)&gt;&gt;&gt;0)(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o)(&quot;w.%s(%s[i])&quot;,n,o)(&quot;w.ldelim()&quot;):(e(&quot;for(var i=0;i&lt;%s.length;++i)&quot;,o),l===void 0?Tq(e,a,i,o+&quot;[i]&quot;):e(&quot;w.uint32(%i).%s(%s[i])&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o)),e(&quot;}&quot;)):(a.optional&amp;&amp;e(&quot;if(%s!=null&amp;&amp;Object.hasOwnProperty.call(m,%j))&quot;,o,a.name),l===void 0?Tq(e,a,i,o):e(&quot;w.uint32(%i).%s(%s)&quot;,(a.id&lt;&lt;3|l)&gt;&gt;&gt;0,n,o))}return e(&quot;return w&quot;)}});var vq=T((yFe,gq)=&gt;{&quot;use strict&quot;;var de=gq.exports=sv();de.build=&quot;light&quot;;function wpe(r,e,t){return typeof e==&quot;function&quot;?(t=e,e=new de.Root):e||(e=new de.Root),e.load(r,t)}de.load=wpe;function Dpe(r,e){return e||(e=new de.Root),e.loadSync(r)}de.loadSync=Dpe;de.encoder=Ny();de.decoder=_y();de.verifier=Ty();de.converter=vy();de.ReflectionObject=ri();de.Namespace=ua();de.Root=T_();de.Enum=Ar();de.Type=h_();de.Field=ti();de.OneOf=uo();de.MapField=l_();de.Service=u_();de.Method=c_();de.Message=f_();de.wrappers=yy();de.types=fo();de.util=rt();de.ReflectionObject._configure(de.Root);de.Namespace._configure(de.Type,de.Service,de.Enum);de.Root._configure(de.Type);de.Field._configure(de.Type)});var ky=T((OFe,Aq)=&gt;{&quot;use strict&quot;;Aq.exports=Oq;var Uy=/[\s{}=;:[\],&#x27;&quot;()&lt;&gt;]/g,Upe=/(?:&quot;([^&quot;\\]*(?:\\.[^&quot;\\]*)*)&quot;)/g,kpe=/(?:&#x27;([^&#x27;\\]*(?:\\.[^&#x27;\\]*)*)&#x27;)/g,Bpe=/^ *[*/]+ */,Vpe=/^\s*\*?\/*/,Fpe=/\n/g,Gpe=/\s/,Hpe=/\\(.?)/g,qpe={0:&quot;\0&quot;,r:&quot;\r&quot;,n:` `,t:&quot; &quot;};function yq(r){return r.replace(Hpe,function(e,t){switch(t){case&quot;\\&quot;:case&quot;&quot;:return t;default:return qpe[t]||&quot;&quot;}})}Oq.unescape=yq;function Oq(r,e){r=r.toString();var t=0,o=r.length,s=1,a=0,i={},n=[],l=null;function c(N){return Error(&quot;illegal &quot;+N+&quot; (line &quot;+s+&quot;)&quot;)}function u(){var N=l===&quot;&#x27;&quot;?kpe:Upe;N.lastIndex=t-1;var z=N.exec(r);if(!z)throw c(&quot;string&quot;);return t=N.lastIndex,A(l),l=null,yq(z[1])}function f(N){return r.charAt(N)}function _(N,z,B){var G={type:r.charAt(N++),lineEmpty:!1,leading:B},te;e?te=2:te=3;var $=N-te,le;do if(--$&lt;0||(le=r.charAt($))===` `){G.lineEmpty=!0;break}while(le===&quot; &quot;||le===&quot; &quot;);for(var v=r.substring(N,z).split(Fpe),W=0;W&lt;v.length;++W)v[W]=v[W].replace(e?Vpe:Bpe,&quot;&quot;).trim();G.text=v.join(` `).trim(),i[s]=G,a=s}function m(N){var z=O(N),B=r.substring(N,z),G=/^\s*\/\//.test(B);return G}function O(N){for(var z=N;z&lt;o&amp;&amp;f(z)!==` `;)z++;return z}function y(){if(n.length&gt;0)return n.shift();if(l)return u();var N,z,B,G,te,$=t===0;do{if(t===o)return null;for(N=!1;Gpe.test(B=f(t));)if(B===` `&amp;&amp;($=!0,++s),++t===o)return null;if(f(t)===&quot;/&quot;){if(++t===o)throw c(&quot;comment&quot;);if(f(t)===&quot;/&quot;)if(e){if(G=t,te=!1,m(t-1)){te=!0;do if(t=O(t),t===o||(t++,!$))break;while(m(t))}else t=Math.min(o,O(t)+1);te&amp;&amp;(_(G,t,$),$=!0),s++,N=!0}else{for(te=f(G=t+1)===&quot;/&quot;;f(++t)!==` `;)if(t===o)return null;++t,te&amp;&amp;(_(G,t-1,$),$=!0),++s,N=!0}else if((B=f(t))===&quot;*&quot;){G=t+1,te=e||f(G)===&quot;*&quot;;do{if(B===` `&amp;&amp;++s,++t===o)throw c(&quot;comment&quot;);z=B,B=f(t)}while(z!==&quot;*&quot;||B!==&quot;/&quot;);++t,te&amp;&amp;(_(G,t-2,$),$=!0),N=!0}else return&quot;/&quot;}}while(N);var le=t;Uy.lastIndex=0;var v=Uy.test(f(le++));if(!v)for(;le&lt;o&amp;&amp;!Uy.test(f(le));)++le;var W=r.substring(t,t=le);return(W===&#x27;&quot;&#x27;||W===&quot;&#x27;&quot;)&amp;&amp;(l=W),W}function A(N){n.push(N)}function I(){if(!n.length){var N=y();if(N===null)return null;A(N)}return n[0]}function M(N,z){var B=I(),G=B===N;if(G)return y(),!0;if(!z)throw c(&quot;token &#x27;&quot;+B+&quot;&#x27;, &#x27;&quot;+N+&quot;&#x27; expected&quot;);return!1}function F(N){var z=null,B;return N===void 0?(B=i[s-1],delete i[s-1],B&amp;&amp;(e||B.type===&quot;*&quot;||B.lineEmpty)&amp;&amp;(z=B.leading?B.text:null)):(a&lt;N&amp;&amp;I(),B=i[N],delete i[N],B&amp;&amp;!B.lineEmpty&amp;&amp;(e||B.type===&quot;/&quot;)&amp;&amp;(z=B.leading?null:B.text)),z}return Object.defineProperty({next:y,peek:I,push:A,skip:M,cmnt:F},&quot;line&quot;,{get:function(){return s}})}});var bq=T((AFe,Iq)=&gt;{&quot;use strict&quot;;Iq.exports=vn;vn.filename=null;vn.defaults={keepCase:!1};var jpe=ky(),Rq=T_(),Nq=h_(),Cq=ti(),Ype=l_(),Pq=uo(),zpe=Ar(),Kpe=u_(),$pe=c_(),Xpe=ri(),Wpe=fo(),By=rt(),Jpe=/^[1-9][0-9]*$/,Qpe=/^-?[1-9][0-9]*$/,Zpe=/^0[x][0-9a-fA-F]+$/,ede=/^-?0[x][0-9a-fA-F]+$/,tde=/^0[0-7]+$/,rde=/^-?0[0-7]+$/,nde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Xr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Wr=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function vn(r,e,t){e instanceof Rq||(t=e,e=new Rq),t||(t=vn.defaults);var o=t.preferTrailingComment||!1,s=jpe(r,t.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,l=s.skip,c=s.cmnt,u=!0,f,_,m,O=&quot;proto2&quot;,y=e,A=[],I={},M=t.keepCase?function(L){return L}:By.camelCase;function F(){A.forEach(L=&gt;{L._edition=O,Object.keys(I).forEach(b=&gt;{L.getOption(b)===void 0&amp;&amp;L.setOption(b,I[b],!0)})})}function N(L,b,x){var j=vn.filename;return x||(vn.filename=null),Error(&quot;illegal &quot;+(b||&quot;token&quot;)+&quot; &#x27;&quot;+L+&quot;&#x27; (&quot;+(j?j+&quot;, &quot;:&quot;&quot;)+&quot;line &quot;+s.line+&quot;)&quot;)}function z(){var L=[],b;do{if((b=a())!==&#x27;&quot;&#x27;&amp;&amp;b!==&quot;&#x27;&quot;)throw N(b);L.push(a()),l(b),b=n()}while(b===&#x27;&quot;&#x27;||b===&quot;&#x27;&quot;);return L.join(&quot;&quot;)}function B(L){var b=a();switch(b){case&quot;&#x27;&quot;:case&#x27;&quot;&#x27;:return i(b),z();case&quot;true&quot;:case&quot;TRUE&quot;:return!0;case&quot;false&quot;:case&quot;FALSE&quot;:return!1}try{return te(b,!0)}catch{if(L&amp;&amp;Wr.test(b))return b;throw N(b,&quot;value&quot;)}}function G(L,b){var x,j;do if(b&amp;&amp;((x=n())===&#x27;&quot;&#x27;||x===&quot;&#x27;&quot;)){var q=z();if(L.push(q),O&gt;=2023)throw N(q,&quot;id&quot;)}else try{L.push([j=$(a()),l(&quot;to&quot;,!0)?$(a()):j])}catch(Le){if(b&amp;&amp;Wr.test(x)&amp;&amp;O&gt;=2023)L.push(x);else throw Le}while(l(&quot;,&quot;,!0));var ne={options:void 0};ne.setOption=function(Le,ut){this.options===void 0&amp;&amp;(this.options={}),this.options[Le]=ut},C(ne,function(ut){if(ut===&quot;option&quot;)Z(ne,ut),l(&quot;;&quot;);else throw N(ut)},function(){We(ne)})}function te(L,b){var x=1;switch(L.charAt(0)===&quot;-&quot;&amp;&amp;(x=-1,L=L.substring(1)),L){case&quot;inf&quot;:case&quot;INF&quot;:case&quot;Inf&quot;:return x*(1/0);case&quot;nan&quot;:case&quot;NAN&quot;:case&quot;Nan&quot;:case&quot;NaN&quot;:return NaN;case&quot;0&quot;:return 0}if(Jpe.test(L))return x*parseInt(L,10);if(Zpe.test(L))return x*parseInt(L,16);if(tde.test(L))return x*parseInt(L,8);if(nde.test(L))return x*parseFloat(L);throw N(L,&quot;number&quot;,b)}function $(L,b){switch(L){case&quot;max&quot;:case&quot;MAX&quot;:case&quot;Max&quot;:return 536870911;case&quot;0&quot;:return 0}if(!b&amp;&amp;L.charAt(0)===&quot;-&quot;)throw N(L,&quot;id&quot;);if(Qpe.test(L))return parseInt(L,10);if(ede.test(L))return parseInt(L,16);if(rde.test(L))return parseInt(L,8);throw N(L,&quot;id&quot;)}function le(){if(f!==void 0)throw N(&quot;package&quot;);if(f=a(),!Wr.test(f))throw N(f,&quot;name&quot;);y=y.define(f),l(&quot;;&quot;)}function v(){var L=n(),b;switch(L){case&quot;weak&quot;:b=m||(m=[]),a();break;case&quot;public&quot;:a();default:b=_||(_=[]);break}L=z(),l(&quot;;&quot;),b.push(L)}function W(){if(l(&quot;=&quot;),O=z(),O&lt;2023)throw N(O,&quot;syntax&quot;);l(&quot;;&quot;)}function R(){if(l(&quot;=&quot;),O=z(),![&quot;2023&quot;].includes(O))throw N(O,&quot;edition&quot;);l(&quot;;&quot;)}function E(L,b){switch(b){case&quot;option&quot;:return Z(L,b),l(&quot;;&quot;),!0;case&quot;message&quot;:return Q(L,b),!0;case&quot;enum&quot;:return Me(L,b),!0;case&quot;service&quot;:return wo(L,b),!0;case&quot;extend&quot;:return _i(L,b),!0}return!1}function C(L,b,x){var j=s.line;if(L&amp;&amp;(typeof L.comment!=&quot;string&quot;&amp;&amp;(L.comment=c()),L.filename=vn.filename),l(&quot;{&quot;,!0)){for(var q;(q=a())!==&quot;}&quot;;)b(q);l(&quot;;&quot;,!0)}else x&amp;&amp;x(),l(&quot;;&quot;),L&amp;&amp;(typeof L.comment!=&quot;string&quot;||o)&amp;&amp;(L.comment=c(j)||L.comment)}function Q(L,b){if(!Xr.test(b=a()))throw N(b,&quot;type name&quot;);var x=new Nq(b);C(x,function(q){if(!E(x,q))switch(q){case&quot;map&quot;:ce(x,q);break;case&quot;required&quot;:if(O!==&quot;proto2&quot;)throw N(q);case&quot;repeated&quot;:Y(x,q);break;case&quot;optional&quot;:if(O===&quot;proto3&quot;)Y(x,&quot;proto3_optional&quot;);else{if(O!==&quot;proto2&quot;)throw N(q);Y(x,&quot;optional&quot;)}break;case&quot;oneof&quot;:Ne(x,q);break;case&quot;extensions&quot;:G(x.extensions||(x.extensions=[]));break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(x,&quot;optional&quot;);break}}),L.add(x),L===y&amp;&amp;A.push(x)}function Y(L,b,x){var j=a();if(j===&quot;group&quot;){J(L,b);return}for(;j.endsWith(&quot;.&quot;)||n().startsWith(&quot;.&quot;);)j+=a();if(!Wr.test(j))throw N(j,&quot;type&quot;);var q=a();if(!Xr.test(q))throw N(q,&quot;name&quot;);q=M(q),l(&quot;=&quot;);var ne=new Cq(q,$(a()),j,b,x);if(C(ne,function(Et){if(Et===&quot;option&quot;)Z(ne,Et),l(&quot;;&quot;);else throw N(Et)},function(){We(ne)}),b===&quot;proto3_optional&quot;){var Le=new Pq(&quot;_&quot;+q);ne.setOption(&quot;proto3_optional&quot;,!0),Le.add(ne),L.add(Le)}else L.add(ne);L===y&amp;&amp;A.push(ne)}function J(L,b){if(O&gt;=2023)throw N(&quot;group&quot;);var x=a();if(!Xr.test(x))throw N(x,&quot;name&quot;);var j=By.lcFirst(x);x===j&amp;&amp;(x=By.ucFirst(x)),l(&quot;=&quot;);var q=$(a()),ne=new Nq(x);ne.group=!0;var Le=new Cq(j,q,x,b);Le.filename=vn.filename,C(ne,function(Et){switch(Et){case&quot;option&quot;:Z(ne,Et),l(&quot;;&quot;);break;case&quot;required&quot;:case&quot;repeated&quot;:Y(ne,Et);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(ne,&quot;proto3_optional&quot;):Y(ne,&quot;optional&quot;);break;case&quot;message&quot;:Q(ne,Et);break;case&quot;enum&quot;:Me(ne,Et);break;case&quot;reserved&quot;:G(ne.reserved||(ne.reserved=[]),!0);break;default:throw N(Et)}}),L.add(ne).add(Le)}function ce(L){l(&quot;&lt;&quot;);var b=a();if(Wpe.mapKey[b]===void 0)throw N(b,&quot;type&quot;);l(&quot;,&quot;);var x=a();if(!Wr.test(x))throw N(x,&quot;type&quot;);l(&quot;&gt;&quot;);var j=a();if(!Xr.test(j))throw N(j,&quot;name&quot;);l(&quot;=&quot;);var q=new Ype(M(j),$(a()),b,x);C(q,function(Le){if(Le===&quot;option&quot;)Z(q,Le),l(&quot;;&quot;);else throw N(Le)},function(){We(q)}),L.add(q)}function Ne(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new Pq(M(b));C(x,function(q){q===&quot;option&quot;?(Z(x,q),l(&quot;;&quot;)):(i(q),Y(x,&quot;optional&quot;))}),L.add(x)}function Me(L,b){if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var x=new zpe(b);C(x,function(q){switch(q){case&quot;option&quot;:Z(x,q),l(&quot;;&quot;);break;case&quot;reserved&quot;:G(x.reserved||(x.reserved=[]),!0),x.reserved===void 0&amp;&amp;(x.reserved=[]);break;default:Te(x,q)}}),L.add(x),L===y&amp;&amp;A.push(x)}function Te(L,b){if(!Xr.test(b))throw N(b,&quot;name&quot;);l(&quot;=&quot;);var x=$(a(),!0),j={options:void 0};j.getOption=function(q){return this.options[q]},j.setOption=function(q,ne){Xpe.prototype.setOption.call(j,q,ne)},j.setParsedOption=function(){},C(j,function(ne){if(ne===&quot;option&quot;)Z(j,ne),l(&quot;;&quot;);else throw N(ne)},function(){We(j)}),L.add(b,x,j.comment,j.parsedOptions||j.options)}function Z(L,b){var x,j,q=!0;for(b===&quot;option&quot;&amp;&amp;(b=a());b!==&quot;=&quot;;){if(b===&quot;(&quot;){var ne=a();l(&quot;)&quot;),b=&quot;(&quot;+ne+&quot;)&quot;}if(q){if(q=!1,b.includes(&quot;.&quot;)&amp;&amp;!b.includes(&quot;(&quot;)){var Le=b.split(&quot;.&quot;);x=Le[0]+&quot;.&quot;,b=Le[1];continue}x=b}else j=j?j+=b:b;b=a()}var ut=j?x.concat(j):x,Et=je(L,ut);j=j&amp;&amp;j[0]===&quot;.&quot;?j.slice(1):j,x=x&amp;&amp;x[x.length-1]===&quot;.&quot;?x.slice(0,-1):x,we(L,x,Et,j)}function je(L,b){if(l(&quot;{&quot;,!0)){for(var x={};!l(&quot;}&quot;,!0);){if(!Xr.test(Ye=a()))throw N(Ye,&quot;name&quot;);if(Ye===null)throw N(Ye,&quot;end of input&quot;);var j,q=Ye;if(l(&quot;:&quot;,!0),n()===&quot;{&quot;)j=je(L,b+&quot;.&quot;+Ye);else if(n()===&quot;[&quot;){j=[];var ne;if(l(&quot;[&quot;,!0)){do ne=B(!0),j.push(ne);while(l(&quot;,&quot;,!0));l(&quot;]&quot;),typeof ne&lt;&quot;u&quot;&amp;&amp;me(L,b+&quot;.&quot;+Ye,ne)}}else j=B(!0),me(L,b+&quot;.&quot;+Ye,j);var Le=x[q];Le&amp;&amp;(j=[].concat(Le).concat(j)),x[q]=j,l(&quot;,&quot;,!0),l(&quot;;&quot;,!0)}return x}var ut=B(!0);return me(L,b,ut),ut}function me(L,b,x){if(y===L&amp;&amp;/^features\./.test(b)){I[b]=x;return}L.setOption&amp;&amp;L.setOption(b,x)}function we(L,b,x,j){L.setParsedOption&amp;&amp;L.setParsedOption(b,x,j)}function We(L){if(l(&quot;[&quot;,!0)){do Z(L,&quot;option&quot;);while(l(&quot;,&quot;,!0));l(&quot;]&quot;)}return L}function wo(L,b){if(!Xr.test(b=a()))throw N(b,&quot;service name&quot;);var x=new Kpe(b);C(x,function(q){if(!E(x,q))if(q===&quot;rpc&quot;)Do(x,q);else throw N(q)}),L.add(x),L===y&amp;&amp;A.push(x)}function Do(L,b){var x=c(),j=b;if(!Xr.test(b=a()))throw N(b,&quot;name&quot;);var q=b,ne,Le,ut,Et;if(l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Le=!0),!Wr.test(b=a())||(ne=b,l(&quot;)&quot;),l(&quot;returns&quot;),l(&quot;(&quot;),l(&quot;stream&quot;,!0)&amp;&amp;(Et=!0),!Wr.test(b=a())))throw N(b);ut=b,l(&quot;)&quot;);var Lu=new $pe(q,j,ne,ut,Le,Et);Lu.comment=x,C(Lu,function(dm){if(dm===&quot;option&quot;)Z(Lu,dm),l(&quot;;&quot;);else throw N(dm)}),L.add(Lu)}function _i(L,b){if(!Wr.test(b=a()))throw N(b,&quot;reference&quot;);var x=b;C(null,function(q){switch(q){case&quot;required&quot;:case&quot;repeated&quot;:Y(L,q,x);break;case&quot;optional&quot;:O===&quot;proto3&quot;?Y(L,&quot;proto3_optional&quot;,x):Y(L,&quot;optional&quot;,x);break;default:if(O===&quot;proto2&quot;||!Wr.test(q))throw N(q);i(q),Y(L,&quot;optional&quot;,x);break}})}for(var Ye;(Ye=a())!==null;)switch(Ye){case&quot;package&quot;:if(!u)throw N(Ye);le();break;case&quot;import&quot;:if(!u)throw N(Ye);v();break;case&quot;syntax&quot;:if(!u)throw N(Ye);W();break;case&quot;edition&quot;:if(!u)throw N(Ye);R();break;case&quot;option&quot;:Z(y,Ye),l(&quot;;&quot;,!0);break;default:if(E(y,Ye)){u=!1;continue}throw N(Ye)}return F(),vn.filename=null,{package:f,imports:_,weakImports:m,root:e}}});var Mq=T((RFe,xq)=&gt;{&quot;use strict&quot;;xq.exports=Nr;var ide=/\/|\./;function Nr(r,e){ide.test(r)||(r=&quot;google/protobuf/&quot;+r+&quot;.proto&quot;,e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Nr[r]=e}Nr(&quot;any&quot;,{Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}}});var Lq;Nr(&quot;duration&quot;,{Duration:Lq={fields:{seconds:{type:&quot;int64&quot;,id:1},nanos:{type:&quot;int32&quot;,id:2}}}});Nr(&quot;timestamp&quot;,{Timestamp:Lq});Nr(&quot;empty&quot;,{Empty:{fields:{}}});Nr(&quot;struct&quot;,{Struct:{fields:{fields:{keyType:&quot;string&quot;,type:&quot;Value&quot;,id:1}}},Value:{oneofs:{kind:{oneof:[&quot;nullValue&quot;,&quot;numberValue&quot;,&quot;stringValue&quot;,&quot;boolValue&quot;,&quot;structValue&quot;,&quot;listValue&quot;]}},fields:{nullValue:{type:&quot;NullValue&quot;,id:1},numberValue:{type:&quot;double&quot;,id:2},stringValue:{type:&quot;string&quot;,id:3},boolValue:{type:&quot;bool&quot;,id:4},structValue:{type:&quot;Struct&quot;,id:5},listValue:{type:&quot;ListValue&quot;,id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:&quot;repeated&quot;,type:&quot;Value&quot;,id:1}}}});Nr(&quot;wrappers&quot;,{DoubleValue:{fields:{value:{type:&quot;double&quot;,id:1}}},FloatValue:{fields:{value:{type:&quot;float&quot;,id:1}}},Int64Value:{fields:{value:{type:&quot;int64&quot;,id:1}}},UInt64Value:{fields:{value:{type:&quot;uint64&quot;,id:1}}},Int32Value:{fields:{value:{type:&quot;int32&quot;,id:1}}},UInt32Value:{fields:{value:{type:&quot;uint32&quot;,id:1}}},BoolValue:{fields:{value:{type:&quot;bool&quot;,id:1}}},StringValue:{fields:{value:{type:&quot;string&quot;,id:1}}},BytesValue:{fields:{value:{type:&quot;bytes&quot;,id:1}}}});Nr(&quot;field_mask&quot;,{FieldMask:{fields:{paths:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:1}}}});Nr.get=function(e){return Nr[e]||null}});var Dq=T((NFe,wq)=&gt;{&quot;use strict&quot;;var ii=wq.exports=vq();ii.build=&quot;full&quot;;ii.tokenize=ky();ii.parse=bq();ii.common=Mq();ii.Root._configure(ii.Type,ii.parse,ii.common)});var O_=T((CFe,Uq)=&gt;{&quot;use strict&quot;;Uq.exports=Dq()});var Vy=T((PFe,ode)=&gt;{ode.exports={nested:{google:{nested:{protobuf:{options:{go_package:&quot;google.golang.org/protobuf/types/descriptorpb&quot;,java_package:&quot;com.google.protobuf&quot;,java_outer_classname:&quot;DescriptorProtos&quot;,csharp_namespace:&quot;Google.Protobuf.Reflection&quot;,objc_class_prefix:&quot;GPB&quot;,cc_enable_arenas:!0,optimize_for:&quot;SPEED&quot;},nested:{FileDescriptorSet:{edition:&quot;proto2&quot;,fields:{file:{rule:&quot;repeated&quot;,type:&quot;FileDescriptorProto&quot;,id:1}},extensions:[[536e6,536e6]]},Edition:{edition:&quot;proto2&quot;,values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},package:{type:&quot;string&quot;,id:2},dependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},publicDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:10},weakDependency:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:11},optionDependency:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:15},messageType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:4},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:5},service:{rule:&quot;repeated&quot;,type:&quot;ServiceDescriptorProto&quot;,id:6},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:7},options:{type:&quot;FileOptions&quot;,id:8},sourceCodeInfo:{type:&quot;SourceCodeInfo&quot;,id:9},syntax:{type:&quot;string&quot;,id:12},edition:{type:&quot;Edition&quot;,id:14}}},DescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},field:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:2},extension:{rule:&quot;repeated&quot;,type:&quot;FieldDescriptorProto&quot;,id:6},nestedType:{rule:&quot;repeated&quot;,type:&quot;DescriptorProto&quot;,id:3},enumType:{rule:&quot;repeated&quot;,type:&quot;EnumDescriptorProto&quot;,id:4},extensionRange:{rule:&quot;repeated&quot;,type:&quot;ExtensionRange&quot;,id:5},oneofDecl:{rule:&quot;repeated&quot;,type:&quot;OneofDescriptorProto&quot;,id:8},options:{type:&quot;MessageOptions&quot;,id:7},reservedRange:{rule:&quot;repeated&quot;,type:&quot;ReservedRange&quot;,id:9},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:10},visibility:{type:&quot;SymbolVisibility&quot;,id:11}},nested:{ExtensionRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2},options:{type:&quot;ExtensionRangeOptions&quot;,id:3}}},ReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},ExtensionRangeOptions:{edition:&quot;proto2&quot;,fields:{uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999},declaration:{rule:&quot;repeated&quot;,type:&quot;Declaration&quot;,id:2,options:{retention:&quot;RETENTION_SOURCE&quot;}},features:{type:&quot;FeatureSet&quot;,id:50},verification:{type:&quot;VerificationState&quot;,id:3,options:{default:&quot;UNVERIFIED&quot;,retention:&quot;RETENTION_SOURCE&quot;}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:&quot;int32&quot;,id:1},fullName:{type:&quot;string&quot;,id:2},type:{type:&quot;string&quot;,id:3},reserved:{type:&quot;bool&quot;,id:5},repeated:{type:&quot;bool&quot;,id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:3},label:{type:&quot;Label&quot;,id:4},type:{type:&quot;Type&quot;,id:5},typeName:{type:&quot;string&quot;,id:6},extendee:{type:&quot;string&quot;,id:2},defaultValue:{type:&quot;string&quot;,id:7},oneofIndex:{type:&quot;int32&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},options:{type:&quot;FieldOptions&quot;,id:8},proto3Optional:{type:&quot;bool&quot;,id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},options:{type:&quot;OneofOptions&quot;,id:2}}},EnumDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},value:{rule:&quot;repeated&quot;,type:&quot;EnumValueDescriptorProto&quot;,id:2},options:{type:&quot;EnumOptions&quot;,id:3},reservedRange:{rule:&quot;repeated&quot;,type:&quot;EnumReservedRange&quot;,id:4},reservedName:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:5},visibility:{type:&quot;SymbolVisibility&quot;,id:6}},nested:{EnumReservedRange:{fields:{start:{type:&quot;int32&quot;,id:1},end:{type:&quot;int32&quot;,id:2}}}}},EnumValueDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{type:&quot;EnumValueOptions&quot;,id:3}}},ServiceDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},method:{rule:&quot;repeated&quot;,type:&quot;MethodDescriptorProto&quot;,id:2},options:{type:&quot;ServiceOptions&quot;,id:3}}},MethodDescriptorProto:{edition:&quot;proto2&quot;,fields:{name:{type:&quot;string&quot;,id:1},inputType:{type:&quot;string&quot;,id:2},outputType:{type:&quot;string&quot;,id:3},options:{type:&quot;MethodOptions&quot;,id:4},clientStreaming:{type:&quot;bool&quot;,id:5},serverStreaming:{type:&quot;bool&quot;,id:6}}},FileOptions:{edition:&quot;proto2&quot;,fields:{javaPackage:{type:&quot;string&quot;,id:1},javaOuterClassname:{type:&quot;string&quot;,id:8},javaMultipleFiles:{type:&quot;bool&quot;,id:10},javaGenerateEqualsAndHash:{type:&quot;bool&quot;,id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:&quot;bool&quot;,id:27},optimizeFor:{type:&quot;OptimizeMode&quot;,id:9,options:{default:&quot;SPEED&quot;}},goPackage:{type:&quot;string&quot;,id:11},ccGenericServices:{type:&quot;bool&quot;,id:16},javaGenericServices:{type:&quot;bool&quot;,id:17},pyGenericServices:{type:&quot;bool&quot;,id:18},deprecated:{type:&quot;bool&quot;,id:23},ccEnableArenas:{type:&quot;bool&quot;,id:31,options:{default:!0}},objcClassPrefix:{type:&quot;string&quot;,id:36},csharpNamespace:{type:&quot;string&quot;,id:37},swiftPrefix:{type:&quot;string&quot;,id:39},phpClassPrefix:{type:&quot;string&quot;,id:40},phpNamespace:{type:&quot;string&quot;,id:41},phpMetadataNamespace:{type:&quot;string&quot;,id:44},rubyPackage:{type:&quot;string&quot;,id:45},features:{type:&quot;FeatureSet&quot;,id:50},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],&quot;php_generic_services&quot;,[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:&quot;proto2&quot;,fields:{messageSetWireFormat:{type:&quot;bool&quot;,id:1},noStandardDescriptorAccessor:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},mapEntry:{type:&quot;bool&quot;,id:7},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:11,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:12},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:&quot;proto2&quot;,fields:{ctype:{type:&quot;CType&quot;,id:1,options:{default:&quot;STRING&quot;}},packed:{type:&quot;bool&quot;,id:2},jstype:{type:&quot;JSType&quot;,id:6,options:{default:&quot;JS_NORMAL&quot;}},lazy:{type:&quot;bool&quot;,id:5},unverifiedLazy:{type:&quot;bool&quot;,id:15},deprecated:{type:&quot;bool&quot;,id:3},weak:{type:&quot;bool&quot;,id:10,options:{deprecated:!0}},debugRedact:{type:&quot;bool&quot;,id:16},retention:{type:&quot;OptionRetention&quot;,id:17},targets:{rule:&quot;repeated&quot;,type:&quot;OptionTargetType&quot;,id:19},editionDefaults:{rule:&quot;repeated&quot;,type:&quot;EditionDefault&quot;,id:20},features:{type:&quot;FeatureSet&quot;,id:21},featureSupport:{type:&quot;FeatureSupport&quot;,id:22},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},value:{type:&quot;string&quot;,id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:&quot;Edition&quot;,id:1},editionDeprecated:{type:&quot;Edition&quot;,id:2},deprecationWarning:{type:&quot;string&quot;,id:3},editionRemoved:{type:&quot;Edition&quot;,id:4}}}}},OneofOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:1},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:&quot;proto2&quot;,fields:{allowAlias:{type:&quot;bool&quot;,id:2},deprecated:{type:&quot;bool&quot;,id:3},deprecatedLegacyJsonFieldConflicts:{type:&quot;bool&quot;,id:6,options:{deprecated:!0}},features:{type:&quot;FeatureSet&quot;,id:7},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:1},features:{type:&quot;FeatureSet&quot;,id:2},debugRedact:{type:&quot;bool&quot;,id:3},featureSupport:{type:&quot;FieldOptions.FeatureSupport&quot;,id:4},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:&quot;proto2&quot;,fields:{features:{type:&quot;FeatureSet&quot;,id:34},deprecated:{type:&quot;bool&quot;,id:33},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:&quot;proto2&quot;,fields:{deprecated:{type:&quot;bool&quot;,id:33},idempotencyLevel:{type:&quot;IdempotencyLevel&quot;,id:34,options:{default:&quot;IDEMPOTENCY_UNKNOWN&quot;}},features:{type:&quot;FeatureSet&quot;,id:35},uninterpretedOption:{rule:&quot;repeated&quot;,type:&quot;UninterpretedOption&quot;,id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:&quot;proto2&quot;,fields:{name:{rule:&quot;repeated&quot;,type:&quot;NamePart&quot;,id:2},identifierValue:{type:&quot;string&quot;,id:3},positiveIntValue:{type:&quot;uint64&quot;,id:4},negativeIntValue:{type:&quot;int64&quot;,id:5},doubleValue:{type:&quot;double&quot;,id:6},stringValue:{type:&quot;bytes&quot;,id:7},aggregateValue:{type:&quot;string&quot;,id:8}},nested:{NamePart:{fields:{namePart:{rule:&quot;required&quot;,type:&quot;string&quot;,id:1},isExtension:{rule:&quot;required&quot;,type:&quot;bool&quot;,id:2}}}}},FeatureSet:{edition:&quot;proto2&quot;,fields:{fieldPresence:{type:&quot;FieldPresence&quot;,id:1,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.value&quot;:&quot;EXPLICIT&quot;}},enumType:{type:&quot;EnumType&quot;,id:2,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;OPEN&quot;}},repeatedFieldEncoding:{type:&quot;RepeatedFieldEncoding&quot;,id:3,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;PACKED&quot;}},utf8Validation:{type:&quot;Utf8Validation&quot;,id:4,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;VERIFY&quot;}},messageEncoding:{type:&quot;MessageEncoding&quot;,id:5,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_LEGACY&quot;,&quot;edition_defaults.value&quot;:&quot;LENGTH_PREFIXED&quot;}},jsonFormat:{type:&quot;JsonFormat&quot;,id:6,options:{retention:&quot;RETENTION_RUNTIME&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2023&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_PROTO3&quot;,&quot;edition_defaults.value&quot;:&quot;ALLOW&quot;}},enforceNamingStyle:{type:&quot;EnforceNamingStyle&quot;,id:7,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_METHOD&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;STYLE2024&quot;}},defaultSymbolVisibility:{type:&quot;VisibilityFeature.DefaultSymbolVisibility&quot;,id:8,options:{retention:&quot;RETENTION_SOURCE&quot;,targets:&quot;TARGET_TYPE_FILE&quot;,&quot;feature_support.edition_introduced&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.edition&quot;:&quot;EDITION_2024&quot;,&quot;edition_defaults.value&quot;:&quot;EXPORT_TOP_LEVEL&quot;}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:&quot;proto2&quot;,fields:{defaults:{rule:&quot;repeated&quot;,type:&quot;FeatureSetEditionDefault&quot;,id:1},minimumEdition:{type:&quot;Edition&quot;,id:4},maximumEdition:{type:&quot;Edition&quot;,id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:&quot;Edition&quot;,id:3},overridableFeatures:{type:&quot;FeatureSet&quot;,id:4},fixedFeatures:{type:&quot;FeatureSet&quot;,id:5}},reserved:[[1,1],[2,2],&quot;features&quot;]}}},SourceCodeInfo:{edition:&quot;proto2&quot;,fields:{location:{rule:&quot;repeated&quot;,type:&quot;Location&quot;,id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},span:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:2,options:{packed:!0}},leadingComments:{type:&quot;string&quot;,id:3},trailingComments:{type:&quot;string&quot;,id:4},leadingDetachedComments:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:6}}}}},GeneratedCodeInfo:{edition:&quot;proto2&quot;,fields:{annotation:{rule:&quot;repeated&quot;,type:&quot;Annotation&quot;,id:1}},nested:{Annotation:{fields:{path:{rule:&quot;repeated&quot;,type:&quot;int32&quot;,id:1,options:{packed:!0}},sourceFile:{type:&quot;string&quot;,id:2},begin:{type:&quot;int32&quot;,id:3},end:{type:&quot;int32&quot;,id:4},semantic:{type:&quot;Semantic&quot;,id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:&quot;proto2&quot;,values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var qq=T((ae,Hq)=&gt;{&quot;use strict&quot;;var Ht=O_();Hq.exports=ae=Ht.descriptor=Ht.Root.fromJSON(Vy()).lookup(&quot;.google.protobuf&quot;);var kq=Ht.Namespace,zc=Ht.Root,yn=Ht.Enum,Jr=Ht.Type,oi=Ht.Field,sde=Ht.MapField,A_=Ht.OneOf,Kc=Ht.Service,R_=Ht.Method;zc.fromDescriptor=function(e){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.FileDescriptorSet.decode(e));var t=new zc;if(e.file)for(var o,s,a=0,i;a&lt;e.file.length;++a){s=t,(o=e.file[a]).package&amp;&amp;o.package.length&amp;&amp;(s=t.define(o.package));var n=Ede(o);if(o.name&amp;&amp;o.name.length&amp;&amp;t.files.push(s.filename=o.name),o.messageType)for(i=0;i&lt;o.messageType.length;++i)s.add(Jr.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i&lt;o.enumType.length;++i)s.add(yn.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i&lt;o.extension.length;++i)s.add(oi.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i&lt;o.service.length;++i)s.add(Kc.fromDescriptor(o.service[i],n));var l=pa(o.options,ae.FileOptions);if(l){var c=Object.keys(l);for(i=0;i&lt;c.length;++i)s.setOption(c[i],l[c[i]])}}return t.resolveAll()};zc.prototype.toDescriptor=function(e){var t=ae.FileDescriptorSet.create();return Bq(this,t.file,e),t};function Bq(r,e,t){var o=ae.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,&quot;_&quot;)||&quot;root&quot;)+&quot;.proto&quot;});mde(t,o),r instanceof zc||(o.package=r.fullName.substring(1));for(var s=0,a;s&lt;r.nestedArray.length;++s)(a=r._nestedArray[s])instanceof Jr?o.messageType.push(a.toDescriptor(t)):a instanceof yn?o.enumType.push(a.toDescriptor()):a instanceof oi?o.extension.push(a.toDescriptor(t)):a instanceof Kc?o.service.push(a.toDescriptor()):a instanceof kq&amp;&amp;Bq(a,e,t);o.options=da(r.options,ae.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&amp;&amp;e.push(o)}var ade=0;Jr.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e));var s=new Jr(e.name.length?e.name:&quot;Type&quot;+ade++,pa(e.options,ae.MessageOptions)),a;if(o||(s._edition=t),e.oneofDecl)for(a=0;a&lt;e.oneofDecl.length;++a)s.add(A_.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a&lt;e.field.length;++a){var i=oi.fromDescriptor(e.field[a],t,!0);s.add(i),e.field[a].hasOwnProperty(&quot;oneofIndex&quot;)&amp;&amp;s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a&lt;e.extension.length;++a)s.add(oi.fromDescriptor(e.extension[a],t,!0));if(e.nestedType)for(a=0;a&lt;e.nestedType.length;++a)s.add(Jr.fromDescriptor(e.nestedType[a],t,!0)),e.nestedType[a].options&amp;&amp;e.nestedType[a].options.mapEntry&amp;&amp;s.setOption(&quot;map_entry&quot;,!0);if(e.enumType)for(a=0;a&lt;e.enumType.length;++a)s.add(yn.fromDescriptor(e.enumType[a],t,!0));if(e.extensionRange&amp;&amp;e.extensionRange.length)for(s.extensions=[],a=0;a&lt;e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&amp;&amp;e.reservedRange.length||e.reservedName&amp;&amp;e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a&lt;e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a&lt;e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Jr.prototype.toDescriptor=function(e){var t=ae.DescriptorProto.create({name:this.name}),o;for(o=0;o&lt;this.fieldsArray.length;++o){var s;if(t.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof sde){var a=Fy(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=Fy(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&amp;&amp;Gq(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;t.nestedType.push(ae.DescriptorProto.create({name:s.typeName,field:[ae.FieldDescriptorProto.create({name:&quot;key&quot;,number:1,label:1,type:a}),ae.FieldDescriptorProto.create({name:&quot;value&quot;,number:2,label:1,type:i,typeName:n})],options:ae.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o&lt;this.oneofsArray.length;++o)t.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o&lt;this.nestedArray.length;++o)this._nestedArray[o]instanceof oi?t.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Jr?t.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof yn&amp;&amp;t.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o&lt;this.extensions.length;++o)t.extensionRange.push(ae.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o&lt;this.reserved.length;++o)typeof this.reserved[o]==&quot;string&quot;?t.reservedName.push(this.reserved[o]):t.reservedRange.push(ae.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return t.options=da(this.options,ae.MessageOptions),t};var lde=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;oi.fromDescriptor=function(e,t,o){if(typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.DescriptorProto.decode(e)),typeof e.number!=&quot;number&quot;)throw Error(&quot;missing field id&quot;);var s;e.typeName&amp;&amp;e.typeName.length?s=e.typeName:s=dde(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a=&quot;required&quot;;break;case 3:a=&quot;repeated&quot;;break;default:throw Error(&quot;illegal label: &quot;+e.label)}var i=e.extendee;e.extendee!==void 0&amp;&amp;(i=i.length?i:void 0);var n=new oi(e.name.length?e.name:&quot;field&quot;+e.number,e.number,s,a,i);if(o||(n._edition=t),n.options=pa(e.options,ae.FieldOptions),e.proto3_optional&amp;&amp;(n.options.proto3_optional=!0),e.defaultValue&amp;&amp;e.defaultValue.length){var l=e.defaultValue;switch(l){case&quot;true&quot;:case&quot;TRUE&quot;:l=!0;break;case&quot;false&quot;:case&quot;FALSE&quot;:l=!1;break;default:var c=lde.exec(l);c&amp;&amp;(l=parseInt(l));break}n.setOption(&quot;default&quot;,l)}return hde(e.type)&amp;&amp;(t===&quot;proto3&quot;?e.options&amp;&amp;!e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!1):(!t||t===&quot;proto2&quot;)&amp;&amp;e.options&amp;&amp;e.options.packed&amp;&amp;n.setOption(&quot;packed&quot;,!0)),n};oi.prototype.toDescriptor=function(e){var t=ae.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ht.util.ucFirst(this.name),t.label=3;else{switch(t.type=Fy(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Gq(this.parent,this.resolvedType):this.type;break}this.rule===&quot;repeated&quot;?t.label=3:this.required&amp;&amp;e===&quot;proto2&quot;?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&amp;&amp;(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))&lt;0)throw Error(&quot;missing oneof&quot;);return this.options&amp;&amp;(t.options=da(this.options,ae.FieldOptions),this.options.default!=null&amp;&amp;(t.defaultValue=String(this.options.default)),this.options.proto3_optional&amp;&amp;(t.proto3_optional=!0)),e===&quot;proto3&quot;?this.packed||((t.options||(t.options=ae.FieldOptions.create())).packed=!1):(!e||e===&quot;proto2&quot;)&amp;&amp;this.packed&amp;&amp;((t.options||(t.options=ae.FieldOptions.create())).packed=!0),t};var cde=0;yn.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a&lt;e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&amp;&amp;i.length?i:&quot;NAME&quot;+n]=n}var l=new yn(e.name&amp;&amp;e.name.length?e.name:&quot;Enum&quot;+cde++,s,pa(e.options,ae.EnumOptions));return o||(l._edition=t),l};yn.prototype.toDescriptor=function(){for(var e=[],t=0,o=Object.keys(this.values);t&lt;o.length;++t)e.push(ae.EnumValueDescriptorProto.create({name:o[t],number:this.values[o[t]]}));return ae.EnumDescriptorProto.create({name:this.name,value:e,options:da(this.options,ae.EnumOptions)})};var ude=0;A_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.OneofDescriptorProto.decode(e)),new A_(e.name&amp;&amp;e.name.length?e.name:&quot;oneof&quot;+ude++)};A_.prototype.toDescriptor=function(){return ae.OneofDescriptorProto.create({name:this.name})};var fde=0;Kc.fromDescriptor=function(e,t,o){typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.ServiceDescriptorProto.decode(e));var s=new Kc(e.name&amp;&amp;e.name.length?e.name:&quot;Service&quot;+fde++,pa(e.options,ae.ServiceOptions));if(o||(s._edition=t),e.method)for(var a=0;a&lt;e.method.length;++a)s.add(R_.fromDescriptor(e.method[a]));return s};Kc.prototype.toDescriptor=function(){for(var e=[],t=0;t&lt;this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return ae.ServiceDescriptorProto.create({name:this.name,method:e,options:da(this.options,ae.ServiceOptions)})};var pde=0;R_.fromDescriptor=function(e){return typeof e.length==&quot;number&quot;&amp;&amp;(e=ae.MethodDescriptorProto.decode(e)),new R_(e.name&amp;&amp;e.name.length?e.name:&quot;Method&quot;+pde++,&quot;rpc&quot;,e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,pa(e.options,ae.MethodOptions))};R_.prototype.toDescriptor=function(){return ae.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:da(this.options,ae.MethodOptions)})};function dde(r){switch(r){case 1:return&quot;double&quot;;case 2:return&quot;float&quot;;case 3:return&quot;int64&quot;;case 4:return&quot;uint64&quot;;case 5:return&quot;int32&quot;;case 6:return&quot;fixed64&quot;;case 7:return&quot;fixed32&quot;;case 8:return&quot;bool&quot;;case 9:return&quot;string&quot;;case 12:return&quot;bytes&quot;;case 13:return&quot;uint32&quot;;case 15:return&quot;sfixed32&quot;;case 16:return&quot;sfixed64&quot;;case 17:return&quot;sint32&quot;;case 18:return&quot;sint64&quot;}throw Error(&quot;illegal type: &quot;+r)}function hde(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function Fy(r,e,t){switch(r){case&quot;double&quot;:return 1;case&quot;float&quot;:return 2;case&quot;int64&quot;:return 3;case&quot;uint64&quot;:return 4;case&quot;int32&quot;:return 5;case&quot;fixed64&quot;:return 6;case&quot;fixed32&quot;:return 7;case&quot;bool&quot;:return 8;case&quot;string&quot;:return 9;case&quot;bytes&quot;:return 12;case&quot;uint32&quot;:return 13;case&quot;sfixed32&quot;:return 15;case&quot;sfixed64&quot;:return 16;case&quot;sint32&quot;:return 17;case&quot;sint64&quot;:return 18}if(e instanceof yn)return 14;if(e instanceof Jr)return t?10:11;throw Error(&quot;illegal type: &quot;+r)}function Vq(r,e){for(var t={},o=0,s,a;o&lt;e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!==&quot;uninterpretedOption&quot;&amp;&amp;Object.prototype.hasOwnProperty.call(r,a)){var i=_de(a);s.resolvedType instanceof Jr?t[i]=Vq(r[a],s.resolvedType):s.resolvedType instanceof yn?t[i]=s.resolvedType.valuesById[r[a]]:t[i]=r[a]}return t}function pa(r,e){if(r)return Vq(e.toObject(r),e)}function Fq(r,e){for(var t={},o=Object.keys(r),s=0;s&lt;o.length;++s){var a=o[s],i=Ht.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Jr?t[i]=Fq(r[a],n.resolvedType):t[i]=r[a],n.repeated&amp;&amp;!Array.isArray(t[i])&amp;&amp;(t[i]=[t[i]])}}return t}function da(r,e){if(r)return e.fromObject(Fq(r,e))}function Gq(r,e){var t=r.fullName.split(&quot;.&quot;),o=e.fullName.split(&quot;.&quot;),s=0,a=0,i=o.length-1;if(!(r instanceof zc)&amp;&amp;e instanceof kq)for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];){var n=e.lookup(t[s++],!0);if(n!==null&amp;&amp;n!==e)break;++a}else for(;s&lt;t.length&amp;&amp;a&lt;i&amp;&amp;t[s]===o[a];++s,++a);return o.slice(a).join(&quot;.&quot;)}function _de(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return&quot;_&quot;+t.toLowerCase()})}function Ede(r){if(r.syntax===&quot;editions&quot;)switch(r.edition){case ae.Edition.EDITION_2023:return&quot;2023&quot;;default:throw new Error(&quot;Unsupported edition &quot;+r.edition)}return r.syntax===&quot;proto3&quot;?&quot;proto3&quot;:&quot;proto2&quot;}function mde(r,e){if(r)if(r===&quot;proto2&quot;||r===&quot;proto3&quot;)e.syntax=r;else switch(e.syntax=&quot;editions&quot;,r){case&quot;2023&quot;:e.edition=ae.Edition.EDITION_2023;break;default:throw new Error(&quot;Unsupported edition &quot;+r)}}});var jq=T((IFe,Tde)=&gt;{Tde.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:&quot;string&quot;,id:1},methods:{rule:&quot;repeated&quot;,type:&quot;Method&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},version:{type:&quot;string&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},mixins:{rule:&quot;repeated&quot;,type:&quot;Mixin&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Method:{fields:{name:{type:&quot;string&quot;,id:1},requestTypeUrl:{type:&quot;string&quot;,id:2},requestStreaming:{type:&quot;bool&quot;,id:3},responseTypeUrl:{type:&quot;string&quot;,id:4},responseStreaming:{type:&quot;bool&quot;,id:5},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:6},syntax:{type:&quot;Syntax&quot;,id:7}}},Mixin:{fields:{name:{type:&quot;string&quot;,id:1},root:{type:&quot;string&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Yq=T((bFe,Sde)=&gt;{Sde.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var zq=T((LFe,gde)=&gt;{gde.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:&quot;string&quot;,id:1},fields:{rule:&quot;repeated&quot;,type:&quot;Field&quot;,id:2},oneofs:{rule:&quot;repeated&quot;,type:&quot;string&quot;,id:3},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:4},sourceContext:{type:&quot;SourceContext&quot;,id:5},syntax:{type:&quot;Syntax&quot;,id:6}}},Field:{fields:{kind:{type:&quot;Kind&quot;,id:1},cardinality:{type:&quot;Cardinality&quot;,id:2},number:{type:&quot;int32&quot;,id:3},name:{type:&quot;string&quot;,id:4},typeUrl:{type:&quot;string&quot;,id:6},oneofIndex:{type:&quot;int32&quot;,id:7},packed:{type:&quot;bool&quot;,id:8},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:9},jsonName:{type:&quot;string&quot;,id:10},defaultValue:{type:&quot;string&quot;,id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:&quot;string&quot;,id:1},enumvalue:{rule:&quot;repeated&quot;,type:&quot;EnumValue&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3},sourceContext:{type:&quot;SourceContext&quot;,id:4},syntax:{type:&quot;Syntax&quot;,id:5}}},EnumValue:{fields:{name:{type:&quot;string&quot;,id:1},number:{type:&quot;int32&quot;,id:2},options:{rule:&quot;repeated&quot;,type:&quot;Option&quot;,id:3}}},Option:{fields:{name:{type:&quot;string&quot;,id:1},value:{type:&quot;Any&quot;,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:&quot;string&quot;,id:1},value:{type:&quot;bytes&quot;,id:2}}},SourceContext:{fields:{fileName:{type:&quot;string&quot;,id:1}}}}}}}}}});var Wq=T(si=&gt;{&quot;use strict&quot;;Object.defineProperty(si,&quot;__esModule&quot;,{value:!0});si.addCommonProtos=si.loadProtosWithOptionsSync=si.loadProtosWithOptions=void 0;var Kq=V(&quot;fs&quot;),$q=V(&quot;path&quot;),ha=O_();function Xq(r,e){let t=r.resolvePath;r.resolvePath=(o,s)=&gt;{if($q.isAbsolute(s))return s;for(let a of e){let i=$q.join(a,s);try{return Kq.accessSync(i,Kq.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),t(o,s)}}async function vde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error(&quot;The includeDirs option must be an array&quot;));Xq(t,e.includeDirs)}let o=await t.load(r,e);return o.resolveAll(),o}si.loadProtosWithOptions=vde;function yde(r,e){let t=new ha.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error(&quot;The includeDirs option must be an array&quot;);Xq(t,e.includeDirs)}let o=t.loadSync(r,e);return o.resolveAll(),o}si.loadProtosWithOptionsSync=yde;function Ode(){let r=jq(),e=Vy(),t=Yq(),o=zq();ha.common(&quot;api&quot;,r.nested.google.nested.protobuf.nested),ha.common(&quot;descriptor&quot;,e.nested.google.nested.protobuf.nested),ha.common(&quot;source_context&quot;,t.nested.google.nested.protobuf.nested),ha.common(&quot;type&quot;,o.nested.google.nested.protobuf.nested)}si.addCommonProtos=Ode});var Jq=T(($c,Gy)=&gt;{(function(r,e){function t(o){return o.default||o}typeof define==&quot;function&quot;&amp;&amp;define.amd?define([],function(){var o={};return e(o),t(o)}):typeof $c==&quot;object&quot;?(e($c),typeof Gy==&quot;object&quot;&amp;&amp;(Gy.exports=t($c))):(function(){var o={};e(o),r.Long=t(o)})()})(typeof globalThis&lt;&quot;u&quot;?globalThis:typeof self&lt;&quot;u&quot;?self:$c,function(r){&quot;use strict&quot;;Object.defineProperty(r,&quot;__esModule&quot;,{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(R,E,C){this.low=R|0,this.high=E|0,this.unsigned=!!C}t.prototype.__isLong__,Object.defineProperty(t.prototype,&quot;__isLong__&quot;,{value:!0});function o(R){return(R&amp;&amp;R.__isLong__)===!0}function s(R){var E=Math.clz32(R&amp;-R);return R?31-E:E}t.isLong=o;var a={},i={};function n(R,E){var C,Q,Y;return E?(R&gt;&gt;&gt;=0,(Y=0&lt;=R&amp;&amp;R&lt;256)&amp;&amp;(Q=i[R],Q)?Q:(C=c(R,0,!0),Y&amp;&amp;(i[R]=C),C)):(R|=0,(Y=-128&lt;=R&amp;&amp;R&lt;128)&amp;&amp;(Q=a[R],Q)?Q:(C=c(R,R&lt;0?-1:0,!1),Y&amp;&amp;(a[R]=C),C))}t.fromInt=n;function l(R,E){if(isNaN(R))return E?N:F;if(E){if(R&lt;0)return N;if(R&gt;=A)return $}else{if(R&lt;=-I)return le;if(R+1&gt;=I)return te}return R&lt;0?l(-R,E).neg():c(R%y|0,R/y|0,E)}t.fromNumber=l;function c(R,E,C){return new t(R,E,C)}t.fromBits=c;var u=Math.pow;function f(R,E,C){if(R.length===0)throw Error(&quot;empty string&quot;);if(typeof E==&quot;number&quot;?(C=E,E=!1):E=!!E,R===&quot;NaN&quot;||R===&quot;Infinity&quot;||R===&quot;+Infinity&quot;||R===&quot;-Infinity&quot;)return E?N:F;if(C=C||10,C&lt;2||36&lt;C)throw RangeError(&quot;radix&quot;);var Q;if((Q=R.indexOf(&quot;-&quot;))&gt;0)throw Error(&quot;interior hyphen&quot;);if(Q===0)return f(R.substring(1),E,C).neg();for(var Y=l(u(C,8)),J=F,ce=0;ce&lt;R.length;ce+=8){var Ne=Math.min(8,R.length-ce),Me=parseInt(R.substring(ce,ce+Ne),C);if(Ne&lt;8){var Te=l(u(C,Ne));J=J.mul(Te).add(l(Me))}else J=J.mul(Y),J=J.add(l(Me))}return J.unsigned=E,J}t.fromString=f;function _(R,E){return typeof R==&quot;number&quot;?l(R,E):typeof R==&quot;string&quot;?f(R,E):c(R.low,R.high,typeof E==&quot;boolean&quot;?E:R.unsigned)}t.fromValue=_;var m=65536,O=1&lt;&lt;24,y=m*m,A=y*y,I=A/2,M=n(O),F=n(0);t.ZERO=F;var N=n(0,!0);t.UZERO=N;var z=n(1);t.ONE=z;var B=n(1,!0);t.UONE=B;var G=n(-1);t.NEG_ONE=G;var te=c(-1,2147483647,!1);t.MAX_VALUE=te;var $=c(-1,-1,!0);t.MAX_UNSIGNED_VALUE=$;var le=c(0,-2147483648,!1);t.MIN_VALUE=le;var v=t.prototype;v.toInt=function(){return this.unsigned?this.low&gt;&gt;&gt;0:this.low},v.toNumber=function(){return this.unsigned?(this.high&gt;&gt;&gt;0)*y+(this.low&gt;&gt;&gt;0):this.high*y+(this.low&gt;&gt;&gt;0)},v.toString=function(E){if(E=E||10,E&lt;2||36&lt;E)throw RangeError(&quot;radix&quot;);if(this.isZero())return&quot;0&quot;;if(this.isNegative())if(this.eq(le)){var C=l(E),Q=this.div(C),Y=Q.mul(C).sub(this);return Q.toString(E)+Y.toInt().toString(E)}else return&quot;-&quot;+this.neg().toString(E);for(var J=l(u(E,6),this.unsigned),ce=this,Ne=&quot;&quot;;;){var Me=ce.div(J),Te=ce.sub(Me.mul(J)).toInt()&gt;&gt;&gt;0,Z=Te.toString(E);if(ce=Me,ce.isZero())return Z+Ne;for(;Z.length&lt;6;)Z=&quot;0&quot;+Z;Ne=&quot;&quot;+Z+Ne}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high&gt;&gt;&gt;0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low&gt;&gt;&gt;0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var E=this.high!=0?this.high:this.low,C=31;C&gt;0&amp;&amp;(E&amp;1&lt;&lt;C)==0;C--);return this.high!=0?C+33:C+1},v.isSafeInteger=function(){var E=this.high&gt;&gt;21;return E?this.unsigned?!1:E===-1&amp;&amp;!(this.low===0&amp;&amp;this.high===-2097152):!0},v.isZero=function(){return this.high===0&amp;&amp;this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&amp;&amp;this.high&lt;0},v.isPositive=function(){return this.unsigned||this.high&gt;=0},v.isOdd=function(){return(this.low&amp;1)===1},v.isEven=function(){return(this.low&amp;1)===0},v.equals=function(E){return o(E)||(E=_(E)),this.unsigned!==E.unsigned&amp;&amp;this.high&gt;&gt;&gt;31===1&amp;&amp;E.high&gt;&gt;&gt;31===1?!1:this.high===E.high&amp;&amp;this.low===E.low},v.eq=v.equals,v.notEquals=function(E){return!this.eq(E)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(E){return this.comp(E)&lt;0},v.lt=v.lessThan,v.lessThanOrEqual=function(E){return this.comp(E)&lt;=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(E){return this.comp(E)&gt;0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(E){return this.comp(E)&gt;=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(E){if(o(E)||(E=_(E)),this.eq(E))return 0;var C=this.isNegative(),Q=E.isNegative();return C&amp;&amp;!Q?-1:!C&amp;&amp;Q?1:this.unsigned?E.high&gt;&gt;&gt;0&gt;this.high&gt;&gt;&gt;0||E.high===this.high&amp;&amp;E.low&gt;&gt;&gt;0&gt;this.low&gt;&gt;&gt;0?-1:1:this.sub(E).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&amp;&amp;this.eq(le)?le:this.not().add(z)},v.neg=v.negate,v.add=function(E){o(E)||(E=_(E));var C=this.high&gt;&gt;&gt;16,Q=this.high&amp;65535,Y=this.low&gt;&gt;&gt;16,J=this.low&amp;65535,ce=E.high&gt;&gt;&gt;16,Ne=E.high&amp;65535,Me=E.low&gt;&gt;&gt;16,Te=E.low&amp;65535,Z=0,je=0,me=0,we=0;return we+=J+Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y+Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q+Ne,Z+=je&gt;&gt;&gt;16,je&amp;=65535,Z+=C+ce,Z&amp;=65535,c(me&lt;&lt;16|we,Z&lt;&lt;16|je,this.unsigned)},v.subtract=function(E){return o(E)||(E=_(E)),this.add(E.neg())},v.sub=v.subtract,v.multiply=function(E){if(this.isZero())return this;if(o(E)||(E=_(E)),e){var C=e.mul(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(E.isZero())return this.unsigned?N:F;if(this.eq(le))return E.isOdd()?le:F;if(E.eq(le))return this.isOdd()?le:F;if(this.isNegative())return E.isNegative()?this.neg().mul(E.neg()):this.neg().mul(E).neg();if(E.isNegative())return this.mul(E.neg()).neg();if(this.lt(M)&amp;&amp;E.lt(M))return l(this.toNumber()*E.toNumber(),this.unsigned);var Q=this.high&gt;&gt;&gt;16,Y=this.high&amp;65535,J=this.low&gt;&gt;&gt;16,ce=this.low&amp;65535,Ne=E.high&gt;&gt;&gt;16,Me=E.high&amp;65535,Te=E.low&gt;&gt;&gt;16,Z=E.low&amp;65535,je=0,me=0,we=0,We=0;return We+=ce*Z,we+=We&gt;&gt;&gt;16,We&amp;=65535,we+=J*Z,me+=we&gt;&gt;&gt;16,we&amp;=65535,we+=ce*Te,me+=we&gt;&gt;&gt;16,we&amp;=65535,me+=Y*Z,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=J*Te,je+=me&gt;&gt;&gt;16,me&amp;=65535,me+=ce*Me,je+=me&gt;&gt;&gt;16,me&amp;=65535,je+=Q*Z+Y*Te+J*Me+ce*Ne,je&amp;=65535,c(we&lt;&lt;16|We,je&lt;&lt;16|me,this.unsigned)},v.mul=v.multiply,v.divide=function(E){if(o(E)||(E=_(E)),E.isZero())throw Error(&quot;division by zero&quot;);if(e){if(!this.unsigned&amp;&amp;this.high===-2147483648&amp;&amp;E.low===-1&amp;&amp;E.high===-1)return this;var C=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?N:F;var Q,Y,J;if(this.unsigned){if(E.unsigned||(E=E.toUnsigned()),E.gt(this))return N;if(E.gt(this.shru(1)))return B;J=N}else{if(this.eq(le)){if(E.eq(z)||E.eq(G))return le;if(E.eq(le))return z;var ce=this.shr(1);return Q=ce.div(E).shl(1),Q.eq(F)?E.isNegative()?z:G:(Y=this.sub(E.mul(Q)),J=Q.add(Y.div(E)),J)}else if(E.eq(le))return this.unsigned?N:F;if(this.isNegative())return E.isNegative()?this.neg().div(E.neg()):this.neg().div(E).neg();if(E.isNegative())return this.div(E.neg()).neg();J=F}for(Y=this;Y.gte(E);){Q=Math.max(1,Math.floor(Y.toNumber()/E.toNumber()));for(var Ne=Math.ceil(Math.log(Q)/Math.LN2),Me=Ne&lt;=48?1:u(2,Ne-48),Te=l(Q),Z=Te.mul(E);Z.isNegative()||Z.gt(Y);)Q-=Me,Te=l(Q,this.unsigned),Z=Te.mul(E);Te.isZero()&amp;&amp;(Te=z),J=J.add(Te),Y=Y.sub(Z)}return J},v.div=v.divide,v.modulo=function(E){if(o(E)||(E=_(E)),e){var C=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,E.low,E.high);return c(C,e.get_high(),this.unsigned)}return this.sub(this.div(E).mul(E))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return c(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(E){return o(E)||(E=_(E)),c(this.low&amp;E.low,this.high&amp;E.high,this.unsigned)},v.or=function(E){return o(E)||(E=_(E)),c(this.low|E.low,this.high|E.high,this.unsigned)},v.xor=function(E){return o(E)||(E=_(E)),c(this.low^E.low,this.high^E.high,this.unsigned)},v.shiftLeft=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&lt;&lt;E,this.high&lt;&lt;E|this.low&gt;&gt;&gt;32-E,this.unsigned):c(0,this.low&lt;&lt;E-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;E,this.unsigned):c(this.high&gt;&gt;E-32,this.high&gt;=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(E){return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E&lt;32?c(this.low&gt;&gt;&gt;E|this.high&lt;&lt;32-E,this.high&gt;&gt;&gt;E,this.unsigned):E===32?c(this.high,0,this.unsigned):c(this.high&gt;&gt;&gt;E-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.unsigned)):(E-=32,C=32-E,c(this.high&lt;&lt;E|this.low&gt;&gt;&gt;C,this.low&lt;&lt;E|this.high&gt;&gt;&gt;C,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(E){var C;return o(E)&amp;&amp;(E=E.toInt()),(E&amp;=63)===0?this:E===32?c(this.high,this.low,this.unsigned):E&lt;32?(C=32-E,c(this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.unsigned)):(E-=32,C=32-E,c(this.low&lt;&lt;C|this.high&gt;&gt;&gt;E,this.high&lt;&lt;C|this.low&gt;&gt;&gt;E,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},v.toBytes=function(E){return E?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var E=this.high,C=this.low;return[C&amp;255,C&gt;&gt;&gt;8&amp;255,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;24,E&amp;255,E&gt;&gt;&gt;8&amp;255,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;24]},v.toBytesBE=function(){var E=this.high,C=this.low;return[E&gt;&gt;&gt;24,E&gt;&gt;&gt;16&amp;255,E&gt;&gt;&gt;8&amp;255,E&amp;255,C&gt;&gt;&gt;24,C&gt;&gt;&gt;16&amp;255,C&gt;&gt;&gt;8&amp;255,C&amp;255]},t.fromBytes=function(E,C,Q){return Q?t.fromBytesLE(E,C):t.fromBytesBE(E,C)},t.fromBytesLE=function(E,C){return new t(E[0]|E[1]&lt;&lt;8|E[2]&lt;&lt;16|E[3]&lt;&lt;24,E[4]|E[5]&lt;&lt;8|E[6]&lt;&lt;16|E[7]&lt;&lt;24,C)},t.fromBytesBE=function(E,C){return new t(E[4]&lt;&lt;24|E[5]&lt;&lt;16|E[6]&lt;&lt;8|E[7],E[0]&lt;&lt;24|E[1]&lt;&lt;16|E[2]&lt;&lt;8|E[3],C)},typeof BigInt==&quot;function&quot;&amp;&amp;(t.fromBigInt=function(E,C){var Q=Number(BigInt.asIntN(32,E)),Y=Number(BigInt.asIntN(32,E&gt;&gt;BigInt(32)));return c(Q,Y,C)},t.fromValue=function(E,C){return typeof E==&quot;bigint&quot;?t.fromBigInt(E,C):_(E,C)},v.toBigInt=function(){var E=BigInt(this.low&gt;&gt;&gt;0),C=BigInt(this.unsigned?this.high&gt;&gt;&gt;0:this.high);return C&lt;&lt;BigInt(32)|E});var W=r.default=t})});var ij=T(Je=&gt;{&quot;use strict&quot;;Object.defineProperty(Je,&quot;__esModule&quot;,{value:!0});Je.loadFileDescriptorSetFromObject=Je.loadFileDescriptorSetFromBuffer=Je.fromJSON=Je.loadSync=Je.load=Je.IdempotencyLevel=Je.isAnyExtension=Je.Long=void 0;var Ade=wH(),Qr=O_(),qy=qq(),jy=Wq(),Rde=Jq();Je.Long=Rde;function Nde(r){return&quot;@type&quot;in r&amp;&amp;typeof r[&quot;@type&quot;]==&quot;string&quot;}Je.isAnyExtension=Nde;var ej;(function(r){r.IDEMPOTENCY_UNKNOWN=&quot;IDEMPOTENCY_UNKNOWN&quot;,r.NO_SIDE_EFFECTS=&quot;NO_SIDE_EFFECTS&quot;,r.IDEMPOTENT=&quot;IDEMPOTENT&quot;})(ej=Je.IdempotencyLevel||(Je.IdempotencyLevel={}));var tj={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Cde(r,e){return r===&quot;&quot;?e:r+&quot;.&quot;+e}function Pde(r){return r instanceof Qr.Service||r instanceof Qr.Type||r instanceof Qr.Enum}function Ide(r){return r instanceof Qr.Namespace||r instanceof Qr.Root}function rj(r,e){let t=Cde(e,r.name);return Pde(r)?[[t,r]]:Ide(r)&amp;&amp;typeof r.nested&lt;&quot;u&quot;?Object.keys(r.nested).map(o=&gt;rj(r.nested[o],t)).reduce((o,s)=&gt;o.concat(s),[]):[]}function Qq(r,e){return function(o){return r.toObject(r.decode(o),e)}}function Zq(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let o=r.fromObject(t);return r.encode(o).finish()}}function bde(r){return(r||[]).reduce((e,t)=&gt;{for(let[o,s]of Object.entries(t))switch(o){case&quot;uninterpreted_option&quot;:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:ej.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Lde(r,e,t,o){let s=r.resolvedRequestType,a=r.resolvedResponseType;return{path:&quot;/&quot;+e+&quot;/&quot;+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Zq(s),requestDeserialize:Qq(s,t),responseSerialize:Zq(a),responseDeserialize:Qq(a,t),originalName:Ade(r.name),requestType:Hy(s,o),responseType:Hy(a,o),options:bde(r.parsedOptions)}}function xde(r,e,t,o){let s={};for(let a of r.methodsArray)s[a.name]=Lde(a,e,t,o);return s}function Hy(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 DescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function Mde(r,e){let t=r.toDescriptor(&quot;proto3&quot;);return{format:&quot;Protocol Buffer 3 EnumDescriptorProto&quot;,type:t.$type.toObject(t,tj),fileDescriptorProtos:e}}function wde(r,e,t,o){if(r instanceof Qr.Service)return xde(r,e,t,o);if(r instanceof Qr.Type)return Hy(r,o);if(r instanceof Qr.Enum)return Mde(r,o);throw new Error(&quot;Type mismatch in reflection object handling&quot;)}function N_(r,e){let t={};r.resolveAll();let s=r.toDescriptor(&quot;proto3&quot;).file.map(a=&gt;Buffer.from(qy.FileDescriptorProto.encode(a).finish()));for(let[a,i]of rj(r,&quot;&quot;))t[a]=wde(i,a,e,s);return t}function nj(r,e){e=e||{};let t=Qr.Root.fromDescriptor(r);return t.resolveAll(),N_(t,e)}function Dde(r,e){return(0,jy.loadProtosWithOptions)(r,e).then(t=&gt;N_(t,e))}Je.load=Dde;function Ude(r,e){let t=(0,jy.loadProtosWithOptionsSync)(r,e);return N_(t,e)}Je.loadSync=Ude;function kde(r,e){e=e||{};let t=Qr.Root.fromJSON(r);return t.resolveAll(),N_(t,e)}Je.fromJSON=kde;function Bde(r,e){let t=qy.FileDescriptorSet.decode(r);return nj(t,e)}Je.loadFileDescriptorSetFromBuffer=Bde;function Vde(r,e){let t=qy.FileDescriptorSet.fromObject(r);return nj(t,e)}Je.loadFileDescriptorSetFromObject=Vde;(0,jy.addCommonProtos)()});var _o=T(Ie=&gt;{&quot;use strict&quot;;Object.defineProperty(Ie,&quot;__esModule&quot;,{value:!0});Ie.registerChannelzSocket=Ie.registerChannelzServer=Ie.registerChannelzSubchannel=Ie.registerChannelzChannel=Ie.ChannelzCallTrackerStub=Ie.ChannelzCallTracker=Ie.ChannelzChildrenTrackerStub=Ie.ChannelzChildrenTracker=Ie.ChannelzTrace=Ie.ChannelzTraceStub=void 0;Ie.unregisterChannelzRef=jde;Ie.getChannelzHandlers=pj;Ie.getChannelzServiceDefinition=dj;Ie.setup=the;var P_=V(&quot;net&quot;),ho=(rH(),ee(tH)),Xc=rr(),Wc=ue(),Fde=nr(),Gde=Qh(),Hde=ry();function Yy(r){return{channel_id:r.id,name:r.name}}function Wy(r){return{subchannel_id:r.id,name:r.name}}function qde(r){return{server_id:r.id}}function L_(r){return{socket_id:r.id,name:r.name}}var oj=32,Jy=100,zy=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ie.ChannelzTraceStub=zy;var Ky=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,o){let s=new Date;this.events.push({description:t,severity:e,timestamp:s,childChannel:(o==null?void 0:o.kind)===&quot;channel&quot;?o:void 0,childSubchannel:(o==null?void 0:o.kind)===&quot;subchannel&quot;?o:void 0}),this.events.length&gt;=oj*2&amp;&amp;(this.events=this.events.slice(oj)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Zr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=&gt;({description:e.description,severity:e.severity,timestamp:Zr(e.timestamp),channel_ref:e.childChannel?Yy(e.childChannel):null,subchannel_ref:e.childSubchannel?Wy(e.childSubchannel):null}))}}};Ie.ChannelzTrace=Ky;var I_=class{constructor(){this.channelChildren=new ho.OrderedMap,this.subchannelChildren=new ho.OrderedMap,this.socketChildren=new ho.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],o=t.find(e.id);o.equals(t.end())?t.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],o=t.getElementByKey(e.id);o!==void 0&amp;&amp;(o.count-=1,o.count===0&amp;&amp;t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ie.ChannelzChildrenTracker=I_;var $y=class extends I_{refChild(){}unrefChild(){}};Ie.ChannelzChildrenTrackerStub=$y;var b_=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ie.ChannelzCallTracker=b_;var Xy=class extends b_{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ie.ChannelzCallTrackerStub=Xy;var On={channel:new ho.OrderedMap,subchannel:new ho.OrderedMap,server:new ho.OrderedMap,socket:new ho.OrderedMap},x_=r=&gt;{let e=1;function t(){return e++}let o=On[r];return(s,a,i)=&gt;{let n=t(),l={id:n,name:s,kind:r};return i&amp;&amp;o.setElement(n,{ref:l,getInfo:a}),l}};Ie.registerChannelzChannel=x_(&quot;channel&quot;);Ie.registerChannelzSubchannel=x_(&quot;subchannel&quot;);Ie.registerChannelzServer=x_(&quot;server&quot;);Ie.registerChannelzSocket=x_(&quot;socket&quot;);function jde(r){On[r.kind].eraseElementByKey(r.id)}function Yde(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function sj(r){if(r===&quot;&quot;)return[];let e=r.split(&quot;:&quot;).map(o=&gt;Yde(o));return[].concat(...e)}function zde(r){return(0,P_.isIPv6)(r)&amp;&amp;r.toLowerCase().startsWith(&quot;::ffff:&quot;)&amp;&amp;(0,P_.isIPv4)(r.substring(7))}function aj(r){return Buffer.from(Uint8Array.from(r.split(&quot;.&quot;).map(e=&gt;Number.parseInt(e))))}function Kde(r){if((0,P_.isIPv4)(r))return aj(r);if(zde(r))return aj(r.substring(7));if((0,P_.isIPv6)(r)){let e,t,o=r.indexOf(&quot;::&quot;);o===-1?(e=r,t=&quot;&quot;):(e=r.substring(0,o),t=r.substring(o+2));let s=Buffer.from(sj(e)),a=Buffer.from(sj(t)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function cj(r){switch(r){case Xc.ConnectivityState.CONNECTING:return{state:&quot;CONNECTING&quot;};case Xc.ConnectivityState.IDLE:return{state:&quot;IDLE&quot;};case Xc.ConnectivityState.READY:return{state:&quot;READY&quot;};case Xc.ConnectivityState.SHUTDOWN:return{state:&quot;SHUTDOWN&quot;};case Xc.ConnectivityState.TRANSIENT_FAILURE:return{state:&quot;TRANSIENT_FAILURE&quot;};default:return{state:&quot;UNKNOWN&quot;}}}function Zr(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function uj(r){let e=r.getInfo(),t=[],o=[];return e.children.channels.forEach(s=&gt;{t.push(Yy(s[1].ref))}),e.children.subchannels.forEach(s=&gt;{o.push(Wy(s[1].ref))}),{ref:Yy(r.ref),data:{target:e.target,state:cj(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:o}}function $de(r,e){let t=parseInt(r.request.channel_id,10),o=On.channel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No channel data found for id &quot;+t});return}e(null,{channel:uj(o)})}function Xde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=[],s=parseInt(r.request.start_channel_id,10),a=On.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&amp;&amp;o.length&lt;t;i=i.next())o.push(uj(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function fj(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(o=&gt;{t.push(L_(o[1].ref))}),{ref:qde(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Zr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Wde(r,e){let t=parseInt(r.request.server_id,10),s=On.server.getElementByKey(t);if(s===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}e(null,{server:fj(s)})}function Jde(r,e){let t=parseInt(r.request.max_results,10)||Jy,o=parseInt(r.request.start_server_id,10),s=On.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&amp;&amp;a.length&lt;t;i=i.next())a.push(fj(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function Qde(r,e){let t=parseInt(r.request.subchannel_id,10),o=On.subchannel.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No subchannel data found for id &quot;+t});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=&gt;{a.push(L_(n[1].ref))});let i={ref:Wy(o.ref),data:{target:s.target,state:cj(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Zr(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function lj(r){var e;return(0,Fde.isTcpSubchannelAddress)(r)?{address:&quot;tcpip_address&quot;,tcpip_address:{ip_address:(e=Kde(r.host))!==null&amp;&amp;e!==void 0?e:void 0,port:r.port}}:{address:&quot;uds_address&quot;,uds_address:{filename:r.path}}}function Zde(r,e){var t,o,s,a,i;let n=parseInt(r.request.socket_id,10),l=On.socket.getElementByKey(n);if(l===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No socket data found for id &quot;+n});return}let c=l.getInfo(),u=c.security?{model:&quot;tls&quot;,tls:{cipher_suite:c.security.cipherSuiteStandardName?&quot;standard_name&quot;:&quot;other_name&quot;,standard_name:(t=c.security.cipherSuiteStandardName)!==null&amp;&amp;t!==void 0?t:void 0,other_name:(o=c.security.cipherSuiteOtherName)!==null&amp;&amp;o!==void 0?o:void 0,local_certificate:(s=c.security.localCertificate)!==null&amp;&amp;s!==void 0?s:void 0,remote_certificate:(a=c.security.remoteCertificate)!==null&amp;&amp;a!==void 0?a:void 0}}:null,f={ref:L_(l.ref),local:c.localAddress?lj(c.localAddress):null,remote:c.remoteAddress?lj(c.remoteAddress):null,remote_name:(i=c.remoteName)!==null&amp;&amp;i!==void 0?i:void 0,security:u,data:{keep_alives_sent:c.keepAlivesSent,streams_started:c.streamsStarted,streams_succeeded:c.streamsSucceeded,streams_failed:c.streamsFailed,last_local_stream_created_timestamp:Zr(c.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Zr(c.lastRemoteStreamCreatedTimestamp),messages_received:c.messagesReceived,messages_sent:c.messagesSent,last_message_received_timestamp:Zr(c.lastMessageReceivedTimestamp),last_message_sent_timestamp:Zr(c.lastMessageSentTimestamp),local_flow_control_window:c.localFlowControlWindow?{value:c.localFlowControlWindow}:null,remote_flow_control_window:c.remoteFlowControlWindow?{value:c.remoteFlowControlWindow}:null}};e(null,{socket:f})}function ehe(r,e){let t=parseInt(r.request.server_id,10),o=On.server.getElementByKey(t);if(o===void 0){e({code:Wc.Status.NOT_FOUND,details:&quot;No server data found for id &quot;+t});return}let s=parseInt(r.request.start_socket_id,10),a=parseInt(r.request.max_results,10)||Jy,n=o.getInfo().sessionChildren.sockets,l=[],c;for(c=n.lowerBound(s);!c.equals(n.end())&amp;&amp;l.length&lt;a;c=c.next())l.push(L_(c.pointer[1].ref));e(null,{socket_ref:l,end:c.equals(n.end())})}function pj(){return{GetChannel:$de,GetTopChannels:Xde,GetServer:Wde,GetServers:Jde,GetSubchannel:Qde,GetSocket:Zde,GetServerSockets:ehe}}var C_=null;function dj(){if(C_)return C_;let r=ij().loadSync,e=r(&quot;channelz.proto&quot;,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return C_=(0,Hde.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,C_}function the(){(0,Gde.registerAdminService)(dj,pj)}});var hj=T(w_=&gt;{&quot;use strict&quot;;Object.defineProperty(w_,&quot;__esModule&quot;,{value:!0});w_.Subchannel=void 0;var ye=rr(),rhe=Nc(),Qy=Pe(),M_=ue(),nhe=Pt(),ihe=nr(),en=_o(),ohe=&quot;subchannel&quot;,she=~(1&lt;&lt;31),Zy=class{constructor(e,t,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=t,this.options=o,this.connector=a,this.connectivityState=ye.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let n={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoffTimeout=new rhe.BackoffTimeout(()=&gt;{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ihe.subchannelAddressToString)(t),this.keepaliveTime=(i=o[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;i!==void 0?i:-1,o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new en.ChannelzTraceStub,this.callTracker=new en.ChannelzCallTrackerStub,this.childrenTracker=new en.ChannelzChildrenTrackerStub,this.streamTracker=new en.ChannelzCallTrackerStub):(this.channelzTrace=new en.ChannelzTrace,this.callTracker=new en.ChannelzCallTracker,this.childrenTracker=new en.ChannelzChildrenTracker,this.streamTracker=new en.ChannelzCallTracker),this.channelzRef=(0,en.registerChannelzSubchannel)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Subchannel created&quot;),this.trace(&quot;Subchannel constructed with options &quot;+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){Qy.trace(M_.LogVerbosity.DEBUG,ohe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}refTrace(e){Qy.trace(M_.LogVerbosity.DEBUG,&quot;subchannel_refcount&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING):this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[&quot;grpc.keepalive_time_ms&quot;]){let t=Math.min(this.keepaliveTime,she);e=Object.assign(Object.assign({},e),{&quot;grpc.keepalive_time_ms&quot;:t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&amp;&amp;this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(o=&gt;{this.transitionToState([ye.ConnectivityState.READY],ye.ConnectivityState.IDLE),o&amp;&amp;this.keepaliveTime&gt;0&amp;&amp;(this.keepaliveTime*=2,Qy.log(M_.LogVerbosity.ERROR,`Connection to ${(0,nhe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING],ye.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]+&#x27; with error &quot;&#x27;+o+&#x27;&quot;&#x27;):this.trace(ye.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+ye.ConnectivityState[t]),this.channelzEnabled&amp;&amp;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+ye.ConnectivityState[t]);let i=this.connectivityState;switch(this.connectivityState=t,t){case ye.ConnectivityState.READY:this.stopBackoff();break;case ye.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case ye.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=&gt;{this.handleBackoffTimer()});break;case ye.ConnectivityState.IDLE:this.channelzEnabled&amp;&amp;this.transport&amp;&amp;this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let n of this.stateListeners)n(this,i,t,this.keepaliveTime,o);return!0}ref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(&quot;refcount &quot;+this.refcount+&quot; -&gt; &quot;+(this.refcount-1)),this.refcount-=1,this.refcount===0&amp;&amp;(this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Shutting down&quot;),(0,en.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.CONNECTING,ye.ConnectivityState.READY],ye.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,o,s){if(!this.transport)throw new Error(&quot;Cannot create call, subchannel not READY&quot;);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=&gt;{i.code===M_.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,o,s,a)}startConnecting(){process.nextTick(()=&gt;{this.transitionToState([ye.ConnectivityState.IDLE],ye.ConnectivityState.CONNECTING)||this.connectivityState===ye.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=&gt;{this.backoffTimeout.reset(),this.transitionToState([ye.ConnectivityState.TRANSIENT_FAILURE],ye.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e&gt;this.keepaliveTime&amp;&amp;(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}};w_.Subchannel=Zy});var _j=T(D_=&gt;{&quot;use strict&quot;;var eO;Object.defineProperty(D_,&quot;__esModule&quot;,{value:!0});D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;D_.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((eO=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&amp;&amp;eO!==void 0?eO:&quot;false&quot;)===&quot;true&quot;});var oO=T(Eo=&gt;{&quot;use strict&quot;;Object.defineProperty(Eo,&quot;__esModule&quot;,{value:!0});Eo.DEFAULT_PORT=void 0;Eo.setup=dhe;var Ej=jr(),tO=V(&quot;dns&quot;),ahe=bv(),rO=ue(),nO=ht(),lhe=Pe(),che=ue(),ai=Pt(),mj=V(&quot;net&quot;),uhe=Nc(),Tj=_j(),fhe=&quot;dns_resolver&quot;;function tn(r){lhe.trace(che.LogVerbosity.DEBUG,fhe,r)}Eo.DEFAULT_PORT=443;var phe=3e4,iO=class{constructor(e,t,o){var s,a,i;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new tO.promises.Resolver,tn(&quot;Resolver constructed for target &quot;+(0,ai.uriToString)(e)),e.authority&amp;&amp;this.alternativeResolver.setServers([e.authority]);let n=(0,ai.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,mj.isIPv4)(n.host)||(0,mj.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&amp;&amp;s!==void 0?s:Eo.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&amp;&amp;a!==void 0?a:Eo.DEFAULT_PORT),this.percentage=Math.random()*100,o[&quot;grpc.service_config_disable_resolution&quot;]===1&amp;&amp;(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:rO.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata};let l={initialDelay:o[&quot;grpc.initial_reconnect_backoff_ms&quot;],maxDelay:o[&quot;grpc.max_reconnect_backoff_ms&quot;]};this.backoff=new uhe.BackoffTimeout(()=&gt;{this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},l),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o[&quot;grpc.dns_min_time_between_resolutions_ms&quot;])!==null&amp;&amp;i!==void 0?i:phe,this.nextResolutionTimer=setTimeout(()=&gt;{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(tn(&quot;Returning IP address for target &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)tn(&quot;Failed to parse DNS address &quot;+(0,ai.uriToString)(this.target)),setImmediate(()=&gt;{this.listener.onError({code:rO.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,ai.uriToString)(this.target)}`,metadata:new nO.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;tn(&quot;Looking up DNS hostname &quot;+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=&gt;{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(s=&gt;({addresses:[s]}));let o=&quot;[&quot;+t.map(s=&gt;s.host+&quot;:&quot;+s.port).join(&quot;,&quot;)+&quot;]&quot;;if(tn(&quot;Resolved addresses for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+o),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=&gt;{this.pendingLookupPromise!==null&amp;&amp;(tn(&quot;Resolution error for target &quot;+(0,ai.uriToString)(this.target)+&quot;: &quot;+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&amp;&amp;this.pendingTxtPromise===null&amp;&amp;(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=&gt;{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,ahe.extractAndSelectServiceConfig)(t,this.percentage)}catch(o){this.latestServiceConfigError={code:rO.Status.UNAVAILABLE,details:`Parsing service config failed with error ${o.message}`,metadata:new nO.Metadata}}this.latestLookupResult!==null&amp;&amp;this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=&gt;{}))}}async lookup(e){if(Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){tn(&quot;Using alternative DNS resolver.&quot;);let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=&gt;s.status===&quot;rejected&quot;))throw new Error(o[0].reason);return o.reduce((s,a)=&gt;a.status===&quot;fulfilled&quot;?[...s,...a.value]:s,[]).map(s=&gt;({host:s,port:+this.port}))}return(await tO.promises.lookup(e,{all:!0})).map(o=&gt;({host:o.address,port:+this.port}))}async resolveTxt(e){return Tj.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(tn(&quot;Using alternative DNS resolver.&quot;),this.alternativeResolver.resolveTxt(e)):tO.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=&gt;{this.stopNextResolutionTimer(),this.continueResolving&amp;&amp;this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&amp;&amp;(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&amp;&amp;(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?tn(&#x27;resolution update delayed by &quot;min time between resolutions&quot; rate limit&#x27;):tn(&quot;resolution update delayed by backoff timer until &quot;+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function dhe(){(0,Ej.registerResolver)(&quot;dns&quot;,iO),(0,Ej.registerDefaultScheme)(&quot;dns&quot;)}});var sO=T(Zc=&gt;{&quot;use strict&quot;;Object.defineProperty(Zc,&quot;__esModule&quot;,{value:!0});Zc.parseCIDR=vj;Zc.mapProxyName=Ohe;Zc.getProxiedConnection=Ahe;var Jc=Pe(),_a=ue(),gj=V(&quot;net&quot;),hhe=V(&quot;http&quot;),_he=Pe(),Sj=nr(),Qc=Pt(),Ehe=V(&quot;url&quot;),mhe=oO(),The=&quot;proxy&quot;;function Ea(r){_he.trace(_a.LogVerbosity.DEBUG,The,r)}function She(){let r=&quot;&quot;,e=&quot;&quot;;if(process.env.grpc_proxy)e=&quot;grpc_proxy&quot;,r=process.env.grpc_proxy;else if(process.env.https_proxy)e=&quot;https_proxy&quot;,r=process.env.https_proxy;else if(process.env.http_proxy)e=&quot;http_proxy&quot;,r=process.env.http_proxy;else return{};let t;try{t=new Ehe.URL(r)}catch{return(0,Jc.log)(_a.LogVerbosity.ERROR,`cannot parse value of &quot;${e}&quot; env var`),{}}if(t.protocol!==&quot;http:&quot;)return(0,Jc.log)(_a.LogVerbosity.ERROR,`&quot;${t.protocol}&quot; scheme not supported in proxy URI`),{};let o=null;t.username&amp;&amp;(t.password?((0,Jc.log)(_a.LogVerbosity.INFO,&quot;userinfo found in proxy URI&quot;),o=decodeURIComponent(`${t.username}:${t.password}`)):o=t.username);let s=t.hostname,a=t.port;a===&quot;&quot;&amp;&amp;(a=&quot;80&quot;);let i={address:`${s}:${a}`};return o&amp;&amp;(i.creds=o),Ea(&quot;Proxy server &quot;+i.address+&quot; set by environment variable &quot;+e),i}function ghe(){let r=process.env.no_grpc_proxy,e=&quot;no_grpc_proxy&quot;;return r||(r=process.env.no_proxy,e=&quot;no_proxy&quot;),r?(Ea(&quot;No proxy server list set by environment variable &quot;+e),r.split(&quot;,&quot;)):[]}function vj(r){let e=r.split(&quot;/&quot;);if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,gj.isIPv4)(e[0])||Number.isNaN(t)||t&lt;0||t&gt;32?null:{ip:yj(e[0]),prefixLength:t}}function yj(r){return r.split(&quot;.&quot;).reduce((e,t)=&gt;(e&lt;&lt;8)+parseInt(t,10),0)}function vhe(r,e){let t=r.ip,o=-1&lt;&lt;32-r.prefixLength;return(yj(e)&amp;o)===(t&amp;o)}function yhe(r){for(let e of ghe()){let t=vj(e);if((0,gj.isIPv4)(r)&amp;&amp;t&amp;&amp;vhe(t,r))return!0;if(r.endsWith(e))return!0}return!1}function Ohe(r,e){var t;let o={target:r,extraOptions:{}};if(((t=e[&quot;grpc.enable_http_proxy&quot;])!==null&amp;&amp;t!==void 0?t:1)===0||r.scheme===&quot;unix&quot;)return o;let s=She();if(!s.address)return o;let a=(0,Qc.splitHostPort)(r.path);if(!a)return o;let i=a.host;if(yhe(i))return Ea(&quot;Not using proxy for target in no_proxy list: &quot;+(0,Qc.uriToString)(r)),o;let n={&quot;grpc.http_connect_target&quot;:(0,Qc.uriToString)(r)};return s.creds&amp;&amp;(n[&quot;grpc.http_connect_creds&quot;]=s.creds),{target:{scheme:&quot;dns&quot;,path:s.address},extraOptions:n}}function Ahe(r,e){var t;if(!(&quot;grpc.http_connect_target&quot;in e))return Promise.resolve(null);let o=e[&quot;grpc.http_connect_target&quot;],s=(0,Qc.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,Qc.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(t=a.port)!==null&amp;&amp;t!==void 0?t:mhe.DEFAULT_PORT}`,n={method:&quot;CONNECT&quot;,path:i},l={Host:i};(0,Sj.isTcpSubchannelAddress)(r)?(n.host=r.host,n.port=r.port):n.socketPath=r.path,&quot;grpc.http_connect_creds&quot;in e&amp;&amp;(l[&quot;Proxy-Authorization&quot;]=&quot;Basic &quot;+Buffer.from(e[&quot;grpc.http_connect_creds&quot;]).toString(&quot;base64&quot;)),n.headers=l;let c=(0,Sj.subchannelAddressToString)(r);return Ea(&quot;Using proxy &quot;+c+&quot; to connect to &quot;+n.path),new Promise((u,f)=&gt;{let _=hhe.request(n);_.once(&quot;connect&quot;,(m,O,y)=&gt;{_.removeAllListeners(),O.removeAllListeners(),m.statusCode===200?(Ea(&quot;Successfully connected to &quot;+n.path+&quot; through proxy &quot;+c),y.length&gt;0&amp;&amp;O.unshift(y),Ea(&quot;Successfully established a plaintext connection to &quot;+n.path+&quot; through proxy &quot;+c),u(O)):((0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to &quot;+n.path+&quot; through proxy &quot;+c+&quot; with status &quot;+m.statusCode),f())}),_.once(&quot;error&quot;,m=&gt;{_.removeAllListeners(),(0,Jc.log)(_a.LogVerbosity.ERROR,&quot;Failed to connect to proxy &quot;+c+&quot; with error &quot;+m.message),f()}),_.end()})}});var lO=T(U_=&gt;{&quot;use strict&quot;;Object.defineProperty(U_,&quot;__esModule&quot;,{value:!0});U_.StreamDecoder=void 0;var rn;(function(r){r[r.NO_DATA=0]=&quot;NO_DATA&quot;,r[r.READING_SIZE=1]=&quot;READING_SIZE&quot;,r[r.READING_MESSAGE=2]=&quot;READING_MESSAGE&quot;})(rn||(rn={}));var aO=class{constructor(e){this.maxReadMessageLength=e,this.readState=rn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,o,s=[];for(;t&lt;e.length;)switch(this.readState){case rn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=rn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case rn.READING_SIZE:if(o=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+o),this.readSizeRemaining-=o,t+=o,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&amp;&amp;this.readMessageSize&gt;this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining&gt;0)this.readState=rn.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=rn.NO_DATA,s.push(a)}}break;case rn.READING_MESSAGE:if(o=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+o)),this.readMessageRemaining-=o,t+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=rn.NO_DATA,s.push(i)}break;default:throw new Error(&quot;Unexpected read state&quot;)}return s}};U_.StreamDecoder=aO});var Oj=T(k_=&gt;{&quot;use strict&quot;;Object.defineProperty(k_,&quot;__esModule&quot;,{value:!0});k_.Http2SubchannelCall=void 0;var An=V(&quot;http2&quot;),Rhe=V(&quot;os&quot;),Oe=ue(),Rn=ht(),Nhe=lO(),Che=Pe(),Phe=ue(),Ihe=&quot;subchannel_call&quot;;function bhe(r){for(let[e,t]of Object.entries(Rhe.constants.errno))if(t===r)return e;return&quot;Unknown system error &quot;+r}function cO(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Oe.Status.INTERNAL;break;case 401:t=Oe.Status.UNAUTHENTICATED;break;case 403:t=Oe.Status.PERMISSION_DENIED;break;case 404:t=Oe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Oe.Status.UNAVAILABLE;break;default:t=Oe.Status.UNKNOWN}return{code:t,details:e,metadata:new Rn.Metadata}}var uO=class{constructor(e,t,o,s,a){var i;this.http2Stream=e,this.callEventTracker=t,this.listener=o,this.transport=s,this.callId=a,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let n=(i=s.getOptions()[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;i!==void 0?i:Oe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Nhe.StreamDecoder(n),e.on(&quot;response&quot;,(l,c)=&gt;{let u=&quot;&quot;;for(let f of Object.keys(l))u+=&quot; &quot;+f+&quot;: &quot;+l[f]+` `;if(this.trace(`Received server headers: `+u),this.httpStatusCode=l[&quot;:status&quot;],c&amp;An.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(l);else{let f;try{f=Rn.Metadata.fromHttp2Headers(l)}catch(_){this.endCall({code:Oe.Status.UNKNOWN,details:_.message,metadata:new Rn.Metadata});return}this.listener.onReceiveMetadata(f)}}),e.on(&quot;trailers&quot;,l=&gt;{this.handleTrailers(l)}),e.on(&quot;data&quot;,l=&gt;{if(this.statusOutput)return;this.trace(&quot;receive HTTP/2 data frame of length &quot;+l.length);let c;try{c=this.decoder.write(l)}catch(u){if(this.httpStatusCode!==void 0&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);this.cancelWithStatus(f.code,f.details)}else this.cancelWithStatus(Oe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of c)this.trace(&quot;parsed message of length &quot;+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on(&quot;end&quot;,()=&gt;{this.readsClosed=!0,this.maybeOutputStatus()}),e.on(&quot;close&quot;,()=&gt;{this.serverEndedCall=!0,process.nextTick(()=&gt;{var l;if(this.trace(&quot;HTTP/2 stream closed with code &quot;+e.rstCode),((l=this.finalStatus)===null||l===void 0?void 0:l.code)===Oe.Status.OK)return;let c,u=&quot;&quot;;switch(e.rstCode){case An.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&amp;&amp;this.httpStatusCode!==200){let f=cO(this.httpStatusCode);c=f.code,u=f.details}else c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case An.constants.NGHTTP2_REFUSED_STREAM:c=Oe.Status.UNAVAILABLE,u=&quot;Stream refused by server&quot;;break;case An.constants.NGHTTP2_CANCEL:this.connectionDropped?(c=Oe.Status.UNAVAILABLE,u=&quot;Connection dropped&quot;):(c=Oe.Status.CANCELLED,u=&quot;Call cancelled&quot;);break;case An.constants.NGHTTP2_ENHANCE_YOUR_CALM:c=Oe.Status.RESOURCE_EXHAUSTED,u=&quot;Bandwidth exhausted or memory limit exceeded&quot;;break;case An.constants.NGHTTP2_INADEQUATE_SECURITY:c=Oe.Status.PERMISSION_DENIED,u=&quot;Protocol not secure enough&quot;;break;case An.constants.NGHTTP2_INTERNAL_ERROR:c=Oe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code===&quot;ECONNRESET&quot;||this.internalError.code===&quot;ETIMEDOUT&quot;?(c=Oe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:c=Oe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:c,details:u,metadata:new Rn.Metadata,rstCode:e.rstCode})})}),e.on(&quot;error&quot;,l=&gt;{l.code!==&quot;ERR_HTTP2_STREAM_ERROR&quot;&amp;&amp;(this.trace(&quot;Node error event: message=&quot;+l.message+&quot; code=&quot;+l.code+&quot; errno=&quot;+bhe(l.errno)+&quot; syscall=&quot;+l.syscall),this.internalError=l),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=&gt;{this.endCall({code:Oe.Status.UNAVAILABLE,details:&quot;Connection dropped&quot;,metadata:new Rn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace(&quot;ended with status: code=&quot;+this.finalStatus.code+&#x27; details=&quot;&#x27;+this.finalStatus.details+&#x27;&quot;&#x27;),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=&gt;{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){Che.trace(Phe.LogVerbosity.DEBUG,Ihe,&quot;[&quot;+this.callId+&quot;] &quot;+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Oe.Status.OK)&amp;&amp;(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&amp;&amp;(this.finalStatus.code!==Oe.Status.OK||this.readsClosed&amp;&amp;this.unpushedReadMessages.length===0&amp;&amp;!this.isReadFilterPending&amp;&amp;!this.isPushPending)&amp;&amp;this.outputStatus()}push(e){this.trace(&quot;pushing to reader message of length &quot;+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=&gt;{this.isPushPending=!1,!this.statusOutput&amp;&amp;(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace(&quot;unpushedReadMessages.push message of length &quot;+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t=&quot;&quot;;for(let i of Object.keys(e))t+=&quot; &quot;+i+&quot;: &quot;+e[i]+` `;this.trace(`Received server trailers: `+t);let o;try{o=Rn.Metadata.fromHttp2Headers(e)}catch{o=new Rn.Metadata}let s=o.getMap(),a;if(typeof s[&quot;grpc-status&quot;]==&quot;string&quot;){let i=Number(s[&quot;grpc-status&quot;]);this.trace(&quot;received status code &quot;+i+&quot; from server&quot;),o.remove(&quot;grpc-status&quot;);let n=&quot;&quot;;if(typeof s[&quot;grpc-message&quot;]==&quot;string&quot;){try{n=decodeURI(s[&quot;grpc-message&quot;])}catch{n=s[&quot;grpc-message&quot;]}o.remove(&quot;grpc-message&quot;),this.trace(&#x27;received status details string &quot;&#x27;+n+&#x27;&quot; from server&#x27;)}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=cO(this.httpStatusCode),a.metadata=o):a={code:Oe.Status.UNKNOWN,details:&quot;No status information received&quot;,metadata:o};this.endCall(a)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Oe.Status.OK?t=An.constants.NGHTTP2_NO_ERROR:t=An.constants.NGHTTP2_CANCEL,this.trace(&quot;close http2 stream with code &quot;+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.endCall({code:e,details:t,metadata:new Rn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&amp;&amp;this.finalStatus.code!==Oe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length&gt;0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length);let o=s=&gt;{process.nextTick(()=&gt;{var a;let i=Oe.Status.UNAVAILABLE;(s==null?void 0:s.code)===&quot;ERR_STREAM_WRITE_AFTER_END&quot;&amp;&amp;(i=Oe.Status.INTERNAL),s&amp;&amp;this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace(&quot;sending data chunk of length &quot;+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,o)}catch(s){this.endCall({code:Oe.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new Rn.Metadata})}}halfClose(){this.trace(&quot;end() called&quot;),this.trace(&quot;calling end() on HTTP/2 stream&quot;),this.http2Stream.end()}};k_.Http2SubchannelCall=uO});var pO=T(fO=&gt;{&quot;use strict&quot;;Object.defineProperty(fO,&quot;__esModule&quot;,{value:!0});fO.getNextCallNumber=xhe;var Lhe=0;function xhe(){return Lhe++}});var Aj=T(F_=&gt;{&quot;use strict&quot;;Object.defineProperty(F_,&quot;__esModule&quot;,{value:!0});F_.Http2SubchannelConnector=void 0;var mO=V(&quot;http2&quot;),B_=_o(),eu=ue(),Mhe=sO(),ma=Pe(),whe=jr(),V_=nr(),dO=Pt(),Dhe=V(&quot;net&quot;),Uhe=Oj(),khe=pO(),hO=&quot;transport&quot;,Bhe=&quot;transport_flowctrl&quot;,Vhe=uv().version,{HTTP2_HEADER_AUTHORITY:Fhe,HTTP2_HEADER_CONTENT_TYPE:Ghe,HTTP2_HEADER_METHOD:Hhe,HTTP2_HEADER_PATH:qhe,HTTP2_HEADER_TE:jhe,HTTP2_HEADER_USER_AGENT:Yhe}=mO.constants,zhe=2e4,Khe=Buffer.from(&quot;too_many_pings&quot;,&quot;ascii&quot;),_O=class{constructor(e,t,o,s){this.session=e,this.options=o,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,V_.subchannelAddressToString)(t),o[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.streamTracker=new B_.ChannelzCallTrackerStub):this.streamTracker=new B_.ChannelzCallTracker,this.channelzRef=(0,B_.registerChannelzSocket)(this.subchannelAddressString,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o[&quot;grpc.primary_user_agent&quot;],`grpc-node-js/${Vhe}`,o[&quot;grpc.secondary_user_agent&quot;]].filter(a=&gt;a).join(&quot; &quot;),&quot;grpc.keepalive_time_ms&quot;in o?this.keepaliveTimeMs=o[&quot;grpc.keepalive_time_ms&quot;]:this.keepaliveTimeMs=-1,&quot;grpc.keepalive_timeout_ms&quot;in o?this.keepaliveTimeoutMs=o[&quot;grpc.keepalive_timeout_ms&quot;]:this.keepaliveTimeoutMs=zhe,&quot;grpc.keepalive_permit_without_calls&quot;in o?this.keepaliveWithoutCalls=o[&quot;grpc.keepalive_permit_without_calls&quot;]===1:this.keepaliveWithoutCalls=!1,e.once(&quot;close&quot;,()=&gt;{this.trace(&quot;session closed&quot;),this.handleDisconnect()}),e.once(&quot;goaway&quot;,(a,i,n)=&gt;{let l=!1;a===mO.constants.NGHTTP2_ENHANCE_YOUR_CALM&amp;&amp;n&amp;&amp;n.equals(Khe)&amp;&amp;(l=!0),this.trace(&quot;connection closed by GOAWAY with code &quot;+a+&quot; and data &quot;+(n==null?void 0:n.toString())),this.reportDisconnectToOwner(l)}),e.once(&quot;error&quot;,a=&gt;{this.trace(&quot;connection closed with error &quot;+a.message),this.handleDisconnect()}),e.socket.once(&quot;close&quot;,a=&gt;{this.trace(&quot;connection closed. hadError=&quot;+a),this.handleDisconnect()}),ma.isTracerEnabled(hO)&amp;&amp;(e.on(&quot;remoteSettings&quot;,a=&gt;{this.trace(&quot;new settings received&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))}),e.on(&quot;localSettings&quot;,a=&gt;{this.trace(&quot;local settings acknowledged by remote&quot;+(this.session!==e?&quot; on the old connection&quot;:&quot;&quot;)+&quot;: &quot;+JSON.stringify(a))})),this.keepaliveWithoutCalls&amp;&amp;this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,o;let s=this.session.socket,a=s.remoteAddress?(0,V_.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,V_.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let c=s,u=c.getCipher(),f=c.getCertificate(),_=c.getPeerCertificate();n={cipherSuiteStandardName:(e=u.standardName)!==null&amp;&amp;e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:f&amp;&amp;&quot;raw&quot;in f?f.raw:null,remoteCertificate:_&amp;&amp;&quot;raw&quot;in _?_.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&amp;&amp;t!==void 0?t:null,remoteFlowControlWindow:(o=this.session.state.remoteWindowSize)!==null&amp;&amp;o!==void 0?o:null}}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}keepaliveTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}flowControlTrace(e){ma.trace(eu.LogVerbosity.DEBUG,Bhe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}internalsTrace(e){ma.trace(eu.LogVerbosity.DEBUG,&quot;transport_internals&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+this.subchannelAddressString+&quot; &quot;+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=&gt;t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=&gt;{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&amp;&amp;this.keepaliveTimeMs&gt;0&amp;&amp;(this.keepaliveWithoutCalls||this.activeCalls.size&gt;0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(&quot;keepaliveTimeout is not null&quot;);return}this.channelzEnabled&amp;&amp;(this.keepalivesSent+=1),this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let o=&quot;&quot;;try{this.session.ping((a,i,n)=&gt;{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace(&quot;Ping failed with error &quot;+a.message),this.handleDisconnect()):(this.keepaliveTrace(&quot;Received ping response&quot;),this.maybeStartKeepalivePingTimer())})||(o=&quot;Ping returned false&quot;)}catch(s){o=(s instanceof Error?s.message:&quot;&quot;)||&quot;Unknown error&quot;}o&amp;&amp;(this.keepaliveTrace(&quot;Ping send failed: &quot;+o),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&amp;&amp;(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),this.keepaliveTimer=setTimeout(()=&gt;{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&amp;&amp;(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&amp;&amp;this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&amp;&amp;(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,o,s,a){let i=e.toHttp2Headers();i[Fhe]=t,i[Yhe]=this.userAgent,i[Ghe]=&quot;application/grpc&quot;,i[Hhe]=&quot;POST&quot;,i[qhe]=o,i[jhe]=&quot;trailers&quot;;let n;try{n=this.session.request(i)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace(&quot;local window size: &quot;+this.session.state.localWindowSize+&quot; remote window size: &quot;+this.session.state.remoteWindowSize),this.internalsTrace(&quot;session.closed=&quot;+this.session.closed+&quot; session.destroyed=&quot;+this.session.destroyed+&quot; session.socket.destroyed=&quot;+this.session.socket.destroyed);let l,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),l={addMessageSent:()=&gt;{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}}):l={addMessageSent:()=&gt;{var u;(u=a.addMessageSent)===null||u===void 0||u.call(a)},addMessageReceived:()=&gt;{var u;(u=a.addMessageReceived)===null||u===void 0||u.call(a)},onCallEnd:u=&gt;{var f;(f=a.onCallEnd)===null||f===void 0||f.call(a,u),this.removeActiveCall(c)},onStreamEnd:u=&gt;{var f;(f=a.onStreamEnd)===null||f===void 0||f.call(a,u)}},c=new Uhe.Http2SubchannelCall(n,l,s,this,(0,khe.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,B_.unregisterChannelzRef)(this.channelzRef)}},EO=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ma.trace(eu.LogVerbosity.DEBUG,hO,(0,dO.uriToString)(this.channelTarget)+&quot; &quot;+e)}createSession(e,t,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(&quot;Connection closed before starting HTTP/2 handshake&quot;):new Promise((s,a)=&gt;{let i=null,n=this.channelTarget;if(&quot;grpc.http_connect_target&quot;in o){let A=(0,dO.parseUri)(o[&quot;grpc.http_connect_target&quot;]);A&amp;&amp;(n=A,i=(0,dO.uriToString)(A))}let l=e.secure?&quot;https&quot;:&quot;http&quot;,c=(0,whe.getDefaultAuthority)(n),u=()=&gt;{var A;(A=this.session)===null||A===void 0||A.destroy(),this.session=null,setImmediate(()=&gt;{y||(y=!0,a(`${O.trim()} (${new Date().toISOString()})`))})},f=A=&gt;{var I;(I=this.session)===null||I===void 0||I.destroy(),O=A.message,this.trace(&quot;connection failed with error &quot;+O),y||(y=!0,a(`${O} (${new Date().toISOString()})`))},_={createConnection:(A,I)=&gt;e.socket};o[&quot;grpc-node.flow_control_window&quot;]!==void 0&amp;&amp;(_.settings={initialWindowSize:o[&quot;grpc-node.flow_control_window&quot;]});let m=mO.connect(`${l}://${c}`,_);this.session=m;let O=&quot;Failed to connect&quot;,y=!1;m.unref(),m.once(&quot;remoteSettings&quot;,()=&gt;{m.removeAllListeners(),e.socket.removeListener(&quot;close&quot;,u),e.socket.removeListener(&quot;error&quot;,f),s(new _O(m,t,o,i)),this.session=null}),m.once(&quot;close&quot;,u),m.once(&quot;error&quot;,f),e.socket.once(&quot;close&quot;,u),e.socket.once(&quot;error&quot;,f)})}tcpConnect(e,t){return(0,Mhe.getProxiedConnection)(e,t).then(o=&gt;o||new Promise((s,a)=&gt;{let i=()=&gt;{a(new Error(&quot;Socket closed&quot;))},n=c=&gt;{a(c)},l=Dhe.connect(e,()=&gt;{l.removeListener(&quot;close&quot;,i),l.removeListener(&quot;error&quot;,n),s(l)});l.once(&quot;close&quot;,i),l.once(&quot;error&quot;,n)}))}async connect(e,t,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,V_.subchannelAddressToString)(e);try{return this.trace(i+&quot; Waiting for secureConnector to be ready&quot;),await t.waitForReady(),this.trace(i+&quot; secureConnector is ready&quot;),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+&quot; Established TCP connection&quot;),a=await t.connect(s),this.trace(i+&quot; Established secure connection&quot;),this.createSession(a,e,o)}catch(n){throw s==null||s.destroy(),a==null||a.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};F_.Http2SubchannelConnector=EO});var Rj=T(ru=&gt;{&quot;use strict&quot;;Object.defineProperty(ru,&quot;__esModule&quot;,{value:!0});ru.SubchannelPool=void 0;ru.getSubchannelPool=t_e;var $he=W3(),Xhe=hj(),Whe=nr(),Jhe=Pt(),Qhe=Aj(),Zhe=1e4,tu=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let s=this.pool[t].filter(a=&gt;!a.subchannel.unrefIfOneRef());s.length&gt;0&amp;&amp;(e=!1),this.pool[t]=s}e&amp;&amp;this.cleanupTimer!==null&amp;&amp;(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&amp;&amp;(this.cleanupTimer=setInterval(()=&gt;{this.unrefUnusedSubchannels()},Zhe),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,o,s){this.ensureCleanupTask();let a=(0,Jhe.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let l of n)if((0,Whe.subchannelAddressEqual)(t,l.subchannelAddress)&amp;&amp;(0,$he.channelOptionsEqual)(o,l.channelArguments)&amp;&amp;s._equals(l.channelCredentials))return l.subchannel}let i=new Xhe.Subchannel(e,t,o,s,new Qhe.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:t,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};ru.SubchannelPool=tu;var e_e=new tu;function t_e(r){return r?e_e:new tu}});var SO=T(Ta=&gt;{&quot;use strict&quot;;Object.defineProperty(Ta,&quot;__esModule&quot;,{value:!0});Ta.FilterStackFactory=Ta.FilterStack=void 0;var G_=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let o=0;o&lt;this.filters.length;o++)t=this.filters[o].sendMessage(t);return t}receiveMessage(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let o=this.filters.length-1;o&gt;=0;o--)t=this.filters[o].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ta.FilterStack=G_;var TO=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new G_(this.factories.map(e=&gt;e.createFilter()))}};Ta.FilterStackFactory=TO});var gO=T(H_=&gt;{&quot;use strict&quot;;Object.defineProperty(H_,&quot;__esModule&quot;,{value:!0});H_.CompressionAlgorithms=void 0;var Nj;(function(r){r[r.identity=0]=&quot;identity&quot;,r[r.deflate=1]=&quot;deflate&quot;,r[r.gzip=2]=&quot;gzip&quot;})(Nj||(H_.CompressionAlgorithms=Nj={}))});var yO=T(q_=&gt;{&quot;use strict&quot;;Object.defineProperty(q_,&quot;__esModule&quot;,{value:!0});q_.BaseFilter=void 0;var vO=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};q_.BaseFilter=vO});var Ij=T(va=&gt;{&quot;use strict&quot;;Object.defineProperty(va,&quot;__esModule&quot;,{value:!0});va.CompressionFilterFactory=va.CompressionFilter=void 0;var j_=V(&quot;zlib&quot;),Pj=gO(),Sa=ue(),r_e=yO(),n_e=Pe(),i_e=r=&gt;typeof r==&quot;number&quot;&amp;&amp;typeof Pj.CompressionAlgorithms[r]==&quot;string&quot;,ga=class{async writeMessage(e,t){let o=e;t&amp;&amp;(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(t?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let t=e.readUInt8(0)===1,o=e.slice(5);return t&amp;&amp;(o=await this.decompressMessage(o)),o}},mo=class extends ga{async compressMessage(e){return e}async writeMessage(e,t){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error(&#x27;Received compressed message but &quot;grpc-encoding&quot; header was identity&#x27;))}},OO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.deflate(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createInflate();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},AO=class extends ga{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,o)=&gt;{j_.gzip(e,(s,a)=&gt;{s?o(s):t(a)})})}decompressMessage(e){return new Promise((t,o)=&gt;{let s=0,a=[],i=j_.createGunzip();i.on(&quot;data&quot;,n=&gt;{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&amp;&amp;s&gt;this.maxRecvMessageLength&amp;&amp;(i.destroy(),o({code:Sa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on(&quot;end&quot;,()=&gt;{t(Buffer.concat(a))}),i.write(e),i.end()})}},RO=class extends ga{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Cj(r,e){switch(r){case&quot;identity&quot;:return new mo;case&quot;deflate&quot;:return new OO(e);case&quot;gzip&quot;:return new AO(e);default:return new RO(r)}}var Y_=class extends r_e.BaseFilter{constructor(e,t){var o,s,a;super(),this.sharedFilterConfig=t,this.sendCompression=new mo,this.receiveCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;;let i=e[&quot;grpc.default_compression_algorithm&quot;];if(this.maxReceiveMessageLength=(o=e[&quot;grpc.max_receive_message_length&quot;])!==null&amp;&amp;o!==void 0?o:Sa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e[&quot;grpc.max_send_message_length&quot;])!==null&amp;&amp;s!==void 0?s:Sa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(i_e(i)){let n=Pj.CompressionAlgorithms[i],l=(a=t.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(&quot;,&quot;);(!l||l.includes(n))&amp;&amp;(this.currentCompressionAlgorithm=n,this.sendCompression=Cj(this.currentCompressionAlgorithm,-1))}else n_e.log(Sa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set(&quot;grpc-accept-encoding&quot;,&quot;identity,deflate,gzip&quot;),t.set(&quot;accept-encoding&quot;,&quot;identity&quot;),this.currentCompressionAlgorithm===&quot;identity&quot;?t.remove(&quot;grpc-encoding&quot;):t.set(&quot;grpc-encoding&quot;,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(&quot;grpc-encoding&quot;);if(t.length&gt;0){let s=t[0];typeof s==&quot;string&quot;&amp;&amp;(this.receiveCompression=Cj(s,this.maxReceiveMessageLength))}e.remove(&quot;grpc-encoding&quot;);let o=e.get(&quot;grpc-accept-encoding&quot;)[0];return o&amp;&amp;(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(&quot;,&quot;).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new mo,this.currentCompressionAlgorithm=&quot;identity&quot;)),e.remove(&quot;grpc-accept-encoding&quot;),e}async sendMessage(e){var t;let o=await e;if(this.maxSendMessageLength!==-1&amp;&amp;o.message.length&gt;this.maxSendMessageLength)throw{code:Sa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof mo?s=!1:s=(((t=o.flags)!==null&amp;&amp;t!==void 0?t:0)&amp;2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};va.CompressionFilter=Y_;var NO=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Y_(this.options,this.sharedFilterConfig)}};va.CompressionFilterFactory=NO});var nu=T(To=&gt;{&quot;use strict&quot;;Object.defineProperty(To,&quot;__esModule&quot;,{value:!0});To.minDeadline=o_e;To.getDeadlineTimeoutString=a_e;To.getRelativeTimeout=c_e;To.deadlineToString=u_e;To.formatDateDifference=f_e;function o_e(...r){let e=1/0;for(let t of r){let o=t instanceof Date?t.getTime():t;o&lt;e&amp;&amp;(e=o)}return e}var s_e=[[&quot;m&quot;,1],[&quot;S&quot;,1e3],[&quot;M&quot;,60*1e3],[&quot;H&quot;,3600*1e3]];function a_e(r){let e=new Date().getTime();r instanceof Date&amp;&amp;(r=r.getTime());let t=Math.max(r-e,0);for(let[o,s]of s_e){let a=t/s;if(a&lt;1e8)return String(Math.ceil(a))+o}throw new Error(&quot;Deadline is too far in the future&quot;)}var l_e=2147483647;function c_e(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),o=e-t;return o&lt;0?0:o&gt;l_e?1/0:o}function u_e(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?&quot;&quot;+r:e.toISOString()}}function f_e(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+&quot;s&quot;}});var z_=T(CO=&gt;{&quot;use strict&quot;;Object.defineProperty(CO,&quot;__esModule&quot;,{value:!0});CO.restrictControlPlaneStatusCode=d_e;var nn=ue(),p_e=[nn.Status.OK,nn.Status.INVALID_ARGUMENT,nn.Status.NOT_FOUND,nn.Status.ALREADY_EXISTS,nn.Status.FAILED_PRECONDITION,nn.Status.ABORTED,nn.Status.OUT_OF_RANGE,nn.Status.DATA_LOSS];function d_e(r,e){return p_e.includes(r)?{code:nn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${nn.Status[r]} ${e}`}:{code:r,details:e}}});var xj=T(X_=&gt;{&quot;use strict&quot;;Object.defineProperty(X_,&quot;__esModule&quot;,{value:!0});X_.LoadBalancingCall=void 0;var bj=rr(),K_=ue(),Lj=nu(),$_=ht(),iu=Zn(),h_e=Pt(),__e=Pe(),PO=z_(),E_e=V(&quot;http2&quot;),m_e=&quot;load_balancing_call&quot;,IO=class{constructor(e,t,o,s,a,i,n){var l,c;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split(&quot;/&quot;),f=&quot;&quot;;u.length&gt;=2&amp;&amp;(f=u[1]);let _=(c=(l=(0,h_e.splitHostPort)(this.host))===null||l===void 0?void 0:l.host)!==null&amp;&amp;c!==void 0?c:&quot;localhost&quot;;this.serviceUrl=`https://${_}/${f}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let o=[];return this.childStartTime?(this.childStartTime&gt;this.startTime&amp;&amp;(!((e=this.metadata)===null||e===void 0)&amp;&amp;e.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(`LB pick: ${(0,Lj.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady&amp;&amp;o.push(&quot;wait_for_ready&quot;),o.push(&quot;Waiting for LB pick&quot;),o)}trace(e){__e.trace(K_.LogVerbosity.DEBUG,m_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}outputStatus(e,t){var o,s;if(!this.ended){this.ended=!0,this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:t});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error(&quot;doPick called before start&quot;);this.trace(&quot;Pick called&quot;);let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?&quot;(&quot;+s.subchannel.getChannelzRef().id+&quot;) &quot;+s.subchannel.getAddress():&quot;&quot;+s.subchannel;switch(this.trace(&quot;Pick result: &quot;+iu.PickResultType[s.pickResultType]+&quot; subchannel: &quot;+a+&quot; status: &quot;+((e=s.status)===null||e===void 0?void 0:e.code)+&quot; &quot;+((t=s.status)===null||t===void 0?void 0:t.details)),s.pickResultType){case iu.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=&gt;{var u;if(this.ended){this.trace(&quot;Credentials metadata generation finished after call ended&quot;);return}if(o.merge(c),o.get(&quot;authorization&quot;).length&gt;1&amp;&amp;this.outputStatus({code:K_.Status.INTERNAL,details:&#x27;&quot;authorization&quot; metadata cannot have multiple values&#x27;,metadata:new $_.Metadata},&quot;PROCESSED&quot;),s.subchannel.getConnectivityState()!==bj.ConnectivityState.READY){this.trace(&quot;Picked subchannel &quot;+a+&quot; has state &quot;+bj.ConnectivityState[s.subchannel.getConnectivityState()]+&quot; after getting credentials metadata. Retrying pick&quot;),this.doPick();return}this.deadline!==1/0&amp;&amp;o.set(&quot;grpc-timeout&quot;,(0,Lj.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,this.host,this.methodName,{onReceiveMetadata:f=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(f)},onReceiveMessage:f=&gt;{this.trace(&quot;Received message&quot;),this.listener.onReceiveMessage(f)},onReceiveStatus:f=&gt;{this.trace(&quot;Received status&quot;),f.rstCode===E_e.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(f,&quot;REFUSED&quot;):this.outputStatus(f,&quot;PROCESSED&quot;)}}),this.childStartTime=new Date}catch(f){this.trace(&quot;Failed to start call on picked subchannel &quot;+a+&quot; with error &quot;+f.message),this.outputStatus({code:K_.Status.INTERNAL,details:&quot;Failed to start HTTP/2 stream with error &quot;+f.message,metadata:new $_.Metadata},&quot;NOT_STARTED&quot;);return}(u=s.onCallStarted)===null||u===void 0||u.call(s),this.onCallEnded=s.onCallEnded,this.trace(&quot;Created child call [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage&amp;&amp;this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&amp;&amp;this.child.halfClose()},c=&gt;{let{code:u,details:f}=(0,PO.restrictControlPlaneStatusCode)(typeof c.code==&quot;number&quot;?c.code:K_.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:f,metadata:new $_.Metadata},&quot;PROCESSED&quot;)});break;case iu.PickResultType.DROP:let{code:n,details:l}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:n,details:l,metadata:s.status.metadata},&quot;DROP&quot;)});break;case iu.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,PO.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=&gt;{this.outputStatus({code:c,details:u,metadata:s.status.metadata},&quot;PROCESSED&quot;)})}break;case iu.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new $_.Metadata},&quot;PROCESSED&quot;)}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getCallNumber(){return this.callNumber}};X_.LoadBalancingCall=IO});var wj=T(W_=&gt;{&quot;use strict&quot;;Object.defineProperty(W_,&quot;__esModule&quot;,{value:!0});W_.ResolvingCall=void 0;var T_e=kh(),So=ue(),go=nu(),Mj=ht(),S_e=Pe(),g_e=z_(),v_e=&quot;resolving_call&quot;,bO=class{constructor(e,t,o,s,a){this.channel=e,this.method=t,this.filterStackFactory=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=&gt;{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=T_e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&amp;&amp;(o.flags&amp;So.Propagate.CANCELLATION&amp;&amp;o.parentCall.on(&quot;cancelled&quot;,()=&gt;{this.cancelWithStatus(So.Status.CANCELLED,&quot;Cancelled by parent call&quot;)}),o.flags&amp;So.Propagate.DEADLINE&amp;&amp;(this.trace(&quot;Propagating deadline from parent: &quot;+o.parentCall.getDeadline()),this.deadline=(0,go.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace(&quot;Created&quot;),this.runDeadlineTimer()}trace(e){S_e.trace(So.LogVerbosity.DEBUG,v_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(&quot;Deadline: &quot;+(0,go.deadlineToString)(this.deadline));let e=(0,go.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(&quot;Deadline will be reached in &quot;+e+&quot;ms&quot;);let t=()=&gt;{if(!this.deadlineStartTime){this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,&quot;Deadline exceeded&quot;);return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,go.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime&gt;this.deadlineStartTime&amp;&amp;o.push(`name resolution: ${(0,go.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime&gt;this.configReceivedTime&amp;&amp;o.push(`metadata filters: ${(0,go.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push(&quot;waiting for metadata filters&quot;)):o.push(&quot;waiting for name resolution&quot;),this.child&amp;&amp;o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(So.Status.DEADLINE_EXCEEDED,o.join(&quot;,&quot;))};e&lt;=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(&quot;ended with status: code=&quot;+t.code+&#x27; details=&quot;&#x27;+t.details+&#x27;&quot;&#x27;),this.statusWatchers.forEach(o=&gt;o(t)),process.nextTick(()=&gt;{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error(&quot;sendMessageonChild called with child not populated&quot;);let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(s=&gt;{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&amp;&amp;o.halfClose()},s=&gt;{this.cancelWithStatus(s.code,s.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error(&quot;getConfig called before start&quot;);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===&quot;NONE&quot;){this.channel.queueCallForConfig(this);return}else if(e.type===&quot;ERROR&quot;){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==So.Status.OK){let{code:o,details:s}=(0,g_e.restrictControlPlaneStatusCode)(t.status,&quot;Failed to route call to method &quot;+this.method);this.outputStatus({code:o,details:s,metadata:new Mj.Metadata});return}if(t.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+t.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,go.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=&gt;{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(&quot;Created child [&quot;+this.child.getCallNumber()+&quot;]&quot;),this.childStartTime=new Date,this.child.start(o,{onReceiveMetadata:s=&gt;{this.trace(&quot;Received metadata&quot;),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=&gt;{this.trace(&quot;Received message&quot;),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=&gt;{this.trace(&quot;Finished filtering received message&quot;),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&amp;&amp;this.outputStatus(this.pendingChildStatus)},a=&gt;{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=&gt;{this.trace(&quot;Received status&quot;),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&amp;&amp;this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&amp;&amp;this.child.halfClose()},o=&gt;{this.outputStatus(o)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&amp;&amp;t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var o;this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mj.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&amp;&amp;t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace(&quot;start called&quot;),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(&quot;write() called with message of length &quot;+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(&quot;startRead called&quot;),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(&quot;halfClose called&quot;),this.child&amp;&amp;!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};W_.ResolvingCall=bO});var Dj=T(li=&gt;{&quot;use strict&quot;;Object.defineProperty(li,&quot;__esModule&quot;,{value:!0});li.RetryingCall=li.MessageBufferTracker=li.RetryThrottler=void 0;var J_=ue(),y_e=nu(),O_e=ht(),A_e=Pe(),R_e=&quot;retrying_call&quot;,xO=class{constructor(e,t,o){this.maxTokens=e,this.tokenRatio=t,o?this.tokens=o.tokens*(e/o.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens&gt;this.maxTokens/2}};li.RetryThrottler=xO;var MO=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var o;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;return this.limitPerCall-s&lt;e||this.totalLimit-this.totalAllocated&lt;e?!1:(this.allocatedPerCall.set(t,s+e),this.totalAllocated+=e,!0)}free(e,t){var o;if(this.totalAllocated&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(t))!==null&amp;&amp;o!==void 0?o:0;if(s&lt;e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} &gt; allocated for call ${s}`);this.allocatedPerCall.set(t,s-e)}freeAll(e){var t;let o=(t=this.allocatedPerCall.get(e))!==null&amp;&amp;t!==void 0?t:0;if(this.totalAllocated&lt;o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} &gt; total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};li.MessageBufferTracker=MO;var LO=&quot;grpc-previous-rpc-attempts&quot;,N_e=5,wO=class{constructor(e,t,o,s,a,i,n,l,c){var u;this.channel=e,this.callConfig=t,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=l,this.retryThrottler=c,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let f=(u=e.getOptions()[&quot;grpc-node.retry_max_attempts_limit&quot;])!==null&amp;&amp;u!==void 0?u:N_e;if(e.getOptions()[&quot;grpc.enable_retries&quot;]===0)this.state=&quot;NO_RETRY&quot;,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=&quot;RETRY&quot;;let _=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(_.initialBackoff.substring(0,_.initialBackoff.length-1)),this.maxAttempts=Math.min(_.maxAttempts,f)}else t.methodConfig.hedgingPolicy?(this.state=&quot;HEDGING&quot;,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,f)):(this.state=&quot;TRANSPARENT_ONLY&quot;,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length&gt;1&amp;&amp;e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime&gt;this.startTime&amp;&amp;e.push(`time to current attempt start: ${(0,y_e.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){A_e.trace(J_.LogVerbosity.DEBUG,R_e,&quot;[&quot;+this.callNumber+&quot;] &quot;+e)}reportStatus(e){this.trace(&quot;ended with status: code=&quot;+e.code+&#x27; details=&quot;&#x27;+e.details+&#x27;&quot; start time=&#x27;+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=&gt;{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(&quot;cancelWithStatus code: &quot;+e+&#x27; details: &quot;&#x27;+t+&#x27;&quot;&#x27;),this.reportStatus({code:e,details:t,metadata:new O_e.Metadata});for(let{call:o}of this.underlyingCalls)o.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():&quot;unknown&quot;}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&amp;&amp;t!==void 0?t:{entryType:&quot;FREED&quot;,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==&quot;COMMITTED&quot;)return;let e;this.underlyingCalls[this.committedCallIndex].state===&quot;COMPLETED&quot;?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t&lt;e;t++){let o=this.getBufferEntry(t);o.allocated&amp;&amp;this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,o;if(this.state!==&quot;COMMITTED&quot;){this.trace(&quot;Committing call [&quot;+this.underlyingCalls[e].call.getCallNumber()+&quot;] at index &quot;+e),this.state=&quot;COMMITTED&quot;,(o=(t=this.callConfig).onCommitted)===null||o===void 0||o.call(t),this.committedCallIndex=e;for(let s=0;s&lt;this.underlyingCalls.length;s++)s!==e&amp;&amp;this.underlyingCalls[s].state!==&quot;COMPLETED&quot;&amp;&amp;(this.underlyingCalls[s].state=&quot;COMPLETED&quot;,this.underlyingCalls[s].call.cancelWithStatus(J_.Status.CANCELLED,&quot;Discarded in favor of other hedged attempt&quot;));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===&quot;COMMITTED&quot;)return;let e=-1,t=-1;for(let[o,s]of this.underlyingCalls.entries())s.state===&quot;ACTIVE&quot;&amp;&amp;s.nextMessageToSend&gt;e&amp;&amp;(e=s.nextMessageToSend,t=o);t===-1?this.state=&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t)}isStatusCodeInList(e,t){return e.some(o=&gt;{var s;return o===t||o.toString().toLowerCase()===((s=J_.Status[t])===null||s===void 0?void 0:s.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let o=Math.random()*this.nextRetryBackoffSec*1e3,s=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,s),o}maybeRetryCall(e,t){if(this.state!==&quot;RETRY&quot;){t(!1);return}if(this.attempts&gt;=this.maxAttempts){t(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,t(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=&gt;{var s,a;if(this.state!==&quot;RETRY&quot;){t(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&amp;&amp;a!==void 0)||a?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(&quot;Retry attempt denied by throttling policy&quot;),t(!1))},o)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;(e+=1);return e}handleProcessedStatus(e,t,o){var s,a,i;switch(this.state){case&quot;COMMITTED&quot;:case&quot;NO_RETRY&quot;:case&quot;TRANSPARENT_ONLY&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;HEDGING&quot;:if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&amp;&amp;s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o&lt;0){this.state=&quot;TRANSPARENT_ONLY&quot;,this.commitCall(t),this.reportStatus(e);return}else n=o;setTimeout(()=&gt;{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&amp;&amp;(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case&quot;RETRY&quot;:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=&gt;{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(&quot;grpc-retry-pushback-ms&quot;);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var o;if(this.underlyingCalls[t].state===&quot;COMPLETED&quot;)return;if(this.trace(&quot;state=&quot;+this.state+&quot; handling status with progress &quot;+e.progress+&quot; from child [&quot;+this.underlyingCalls[t].call.getCallNumber()+&quot;] in state &quot;+this.underlyingCalls[t].state),this.underlyingCalls[t].state=&quot;COMPLETED&quot;,e.code===J_.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;NO_RETRY&quot;){this.commitCall(t),this.reportStatus(e);return}if(this.state===&quot;COMMITTED&quot;){this.reportStatus(e);return}let s=this.getPushback(e.metadata);switch(e.progress){case&quot;NOT_STARTED&quot;:this.startNewAttempt();break;case&quot;REFUSED&quot;:this.transparentRetryUsed?this.handleProcessedStatus(e,t,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case&quot;DROP&quot;:this.commitCall(t),this.reportStatus(e);break;case&quot;PROCESSED&quot;:this.handleProcessedStatus(e,t,s);break}}maybeStartHedgingAttempt(){this.state===&quot;HEDGING&quot;&amp;&amp;this.callConfig.methodConfig.hedgingPolicy&amp;&amp;(this.attempts&gt;=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,o;if(this.hedgingTimer&amp;&amp;clearTimeout(this.hedgingTimer),this.state!==&quot;HEDGING&quot;||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts&gt;=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&amp;&amp;e!==void 0?e:&quot;0s&quot;,i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=&gt;{this.maybeStartHedgingAttempt()},i*1e3),(o=(t=this.hedgingTimer).unref)===null||o===void 0||o.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(&quot;Created child call [&quot;+e.getCallNumber()+&quot;] for attempt &quot;+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:&quot;ACTIVE&quot;,call:e,nextMessageToSend:0,startTime:new Date});let o=this.attempts-1,s=this.initialMetadata.clone();o&gt;0&amp;&amp;s.set(LO,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=&gt;{this.trace(&quot;Received metadata from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),a=!0,o&gt;0&amp;&amp;i.set(LO,`${o}`),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMetadata(i)},onReceiveMessage:i=&gt;{this.trace(&quot;Received message from child [&quot;+e.getCallNumber()+&quot;]&quot;),this.commitCall(t),this.underlyingCalls[t].state===&quot;ACTIVE&quot;&amp;&amp;this.listener.onReceiveMessage(i)},onReceiveStatus:i=&gt;{this.trace(&quot;Received status from child [&quot;+e.getCallNumber()+&quot;]&quot;),!a&amp;&amp;o&gt;0&amp;&amp;i.metadata.set(LO,`${o}`),this.handleChildStatus(i,t)}}),this.sendNextChildMessage(t),this.readStarted&amp;&amp;e.startRead()}start(e,t){this.trace(&quot;start called&quot;),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(t=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(t),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!==&quot;COMPLETED&quot;&amp;&amp;this.getBufferEntry(t.nextMessageToSend)){let o=this.getBufferEntry(t.nextMessageToSend);switch(o.entryType){case&quot;MESSAGE&quot;:t.call.sendMessageWithContext({callback:s=&gt;{this.handleChildWriteCompleted(e)}},o.message.message);break;case&quot;HALF_CLOSE&quot;:t.nextMessageToSend+=1,t.call.halfClose();break;case&quot;FREED&quot;:break}}}sendMessageWithContext(e,t){var o;this.trace(&quot;write() called with message of length &quot;+t.length);let s={message:t,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:&quot;MESSAGE&quot;,message:s,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,l]of this.underlyingCalls.entries())l.state===&quot;ACTIVE&quot;&amp;&amp;l.nextMessageToSend===a&amp;&amp;l.call.sendMessageWithContext({callback:c=&gt;{this.handleChildWriteCompleted(n)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===&quot;ACTIVE&quot;&amp;&amp;n.nextMessageToSend===a&amp;&amp;n.call.sendMessageWithContext({callback:l=&gt;{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace(&quot;startRead called&quot;),this.readStarted=!0;for(let e of this.underlyingCalls)(e==null?void 0:e.state)===&quot;ACTIVE&quot;&amp;&amp;e.call.startRead()}halfClose(){this.trace(&quot;halfClose called&quot;);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:&quot;HALF_CLOSE&quot;,allocated:!1});for(let t of this.underlyingCalls)(t==null?void 0:t.state)===&quot;ACTIVE&quot;&amp;&amp;t.nextMessageToSend===e&amp;&amp;(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error(&quot;Method not implemented.&quot;)}getMethod(){return this.methodName}getHost(){return this.host}};li.RetryingCall=wO});var Z_=T(Q_=&gt;{&quot;use strict&quot;;Object.defineProperty(Q_,&quot;__esModule&quot;,{value:!0});Q_.BaseSubchannelWrapper=void 0;var DO=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=&gt;{this.healthy&amp;&amp;this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&amp;&amp;this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&amp;&amp;(this.healthy=e,this.child.isHealthy()&amp;&amp;this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}};Q_.BaseSubchannelWrapper=DO});var qO=T(vo=&gt;{&quot;use strict&quot;;Object.defineProperty(vo,&quot;__esModule&quot;,{value:!0});vo.InternalChannel=vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var C_e=Oc(),P_e=X3(),I_e=Rj(),BO=Zn(),b_e=ht(),ci=ue(),L_e=SO(),x_e=Ij(),Uj=jr(),eE=Pe(),M_e=sO(),tE=Pt(),sr=rr(),ou=_o(),w_e=xj(),D_e=nu(),U_e=wj(),UO=pO(),k_e=z_(),kO=Dj(),B_e=Z_(),V_e=2147483647,F_e=1e3,G_e=1800*1e3,rE=new Map,H_e=1&lt;&lt;24,q_e=1&lt;&lt;20,VO=class extends B_e.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=&gt;{t.throttleKeepalive(i)}}ref(){this.refCount===0&amp;&amp;(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},FO=class{pick(e){return{pickResultType:BO.PickResultType.DROP,status:{code:ci.Status.UNAVAILABLE,details:&quot;Channel closed before call started&quot;,metadata:new b_e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=&quot;grpc.internal.no_subchannel&quot;;var GO=class{constructor(e){this.target=e,this.trace=new ou.ChannelzTrace,this.callTracker=new ou.ChannelzCallTracker,this.childrenTracker=new ou.ChannelzChildrenTracker,this.state=sr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=&gt;({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},HO=class{constructor(e,t,o){var s,a,i,n,l,c;if(this.credentials=t,this.options=o,this.connectivityState=sr.ConnectivityState.IDLE,this.currentPicker=new BO.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof C_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.channelzInfoTracker=new GO(e);let u=(0,tE.parseUri)(e);if(u===null)throw new Error(`Could not parse target name &quot;${e}&quot;`);let f=(0,Uj.mapUriDefaultScheme)(u);if(f===null)throw new Error(`Could not find a default scheme for target name &quot;${e}&quot;`);this.options[&quot;grpc.enable_channelz&quot;]===0&amp;&amp;(this.channelzEnabled=!1),this.channelzRef=(0,ou.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Channel created&quot;),this.options[&quot;grpc.default_authority&quot;]?this.defaultAuthority=this.options[&quot;grpc.default_authority&quot;]:this.defaultAuthority=(0,Uj.getDefaultAuthority)(f);let _=(0,M_e.mapProxyName)(f,o);this.target=_.target,this.options=Object.assign({},this.options,_.extraOptions),this.subchannelPool=(0,I_e.getSubchannelPool)(((s=this.options[&quot;grpc.use_local_subchannel_pool&quot;])!==null&amp;&amp;s!==void 0?s:0)===0),this.retryBufferTracker=new kO.MessageBufferTracker((a=this.options[&quot;grpc.retry_buffer_size&quot;])!==null&amp;&amp;a!==void 0?a:H_e,(i=this.options[&quot;grpc.per_rpc_retry_buffer_size&quot;])!==null&amp;&amp;i!==void 0?i:q_e),this.keepaliveTime=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:-1,this.idleTimeoutMs=Math.max((l=this.options[&quot;grpc.client_idle_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:G_e,F_e);let m={createSubchannel:(y,A)=&gt;{let I={};for(let[N,z]of Object.entries(A))N.startsWith(vo.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(I[N]=z);let M=this.subchannelPool.getOrCreateSubchannel(this.target,y,I,this.credentials);return M.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Created subchannel or used existing subchannel&quot;,M.getChannelzRef()),new VO(M,this)},updateState:(y,A)=&gt;{this.currentPicker=A;let I=this.pickQueue.slice();this.pickQueue=[],I.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let M of I)M.doPick();this.updateState(y)},requestReresolution:()=&gt;{throw new Error(&quot;Resolving load balancer should never call requestReresolution&quot;)},addChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.refChild(y)},removeChannelzChild:y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.childrenTracker.unrefChild(y)}};this.resolvingLoadBalancer=new P_e.ResolvingLoadBalancer(this.target,m,this.options,(y,A)=&gt;{var I;y.retryThrottling?rE.set(this.getTarget(),new kO.RetryThrottler(y.retryThrottling.maxTokens,y.retryThrottling.tokenRatio,rE.get(this.getTarget()))):rE.delete(this.getTarget()),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Address resolution succeeded&quot;),(I=this.configSelector)===null||I===void 0||I.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=&gt;{let M=this.configSelectionQueue;this.configSelectionQueue=[],M.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let F of M)F.getConfig()})},y=&gt;{this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_WARNING&quot;,&quot;Address resolution failed with code &quot;+y.code+&#x27; and details &quot;&#x27;+y.details+&#x27;&quot;&#x27;),this.configSelectionQueue.length&gt;0&amp;&amp;this.trace(&quot;Name resolution failed with calls queued for config selection&quot;),this.configSelector===null&amp;&amp;(this.currentResolutionError=Object.assign(Object.assign({},(0,k_e.restrictControlPlaneStatusCode)(y.code,y.details)),{metadata:y.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length&gt;0&amp;&amp;this.callRefTimerUnref();for(let I of A)I.reportResolverError(y)}),this.filterStackFactory=new L_e.FilterStackFactory([new x_e.CompressionFilterFactory(this,this.options)]),this.trace(&quot;Channel constructed with options &quot;+JSON.stringify(o,void 0,2));let O=new Error;(0,eE.isTracerEnabled)(&quot;channel_stacktrace&quot;)&amp;&amp;(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;channel_stacktrace&quot;,&quot;(&quot;+this.channelzRef.id+`) Channel constructed `+((c=O.stack)===null||c===void 0?void 0:c.substring(O.stack.indexOf(` `)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,eE.trace)(t??ci.LogVerbosity.DEBUG,&quot;channel&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+e)}callRefTimerRef(){var e,t,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=&gt;{},V_e)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&amp;&amp;t.call(e)||(this.trace(&quot;callRefTimer.ref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,t,o;(!(!((e=this.callRefTimer)===null||e===void 0)&amp;&amp;e.hasRef)||this.callRefTimer.hasRef())&amp;&amp;(this.trace(&quot;callRefTimer.unref | configSelectionQueue.length=&quot;+this.configSelectionQueue.length+&quot; pickQueue.length=&quot;+this.pickQueue.length),(o=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||o===void 0||o.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(o=&gt;o===e);t&gt;=0&amp;&amp;this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,eE.trace)(ci.LogVerbosity.DEBUG,&quot;connectivity_state&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+(0,tE.uriToString)(this.target)+&quot; &quot;+sr.ConnectivityState[this.connectivityState]+&quot; -&gt; &quot;+sr.ConnectivityState[e]),this.channelzEnabled&amp;&amp;this.channelzInfoTracker.trace.addTrace(&quot;CT_INFO&quot;,&quot;Connectivity state change to &quot;+sr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let o of t)e!==o.currentState&amp;&amp;(o.timer&amp;&amp;clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==sr.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(this.currentResolutionError=null)}throttleKeepalive(e){if(e&gt;this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:&quot;SUCCESS&quot;,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:&quot;ERROR&quot;,error:this.currentResolutionError}:{type:&quot;NONE&quot;}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.IDLE),this.currentPicker=new BO.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&amp;&amp;(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&amp;&amp;(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,o;this.idleTimer=setTimeout(()=&gt;{if(this.callCount&gt;0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a&gt;=this.idleTimeoutMs?(this.trace(&quot;Idle timer triggered after &quot;+this.idleTimeoutMs+&quot;ms of inactivity&quot;),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(t=this.idleTimer).unref)===null||o===void 0||o.call(t)}maybeStartIdleTimer(){this.connectivityState!==sr.ConnectivityState.SHUTDOWN&amp;&amp;!this.idleTimer&amp;&amp;this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&amp;&amp;this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&amp;&amp;(e.code===ci.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createLoadBalancingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new w_e.LoadBalancingCall(this,e,t,o,s,a,i)}createRetryingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();return this.trace(&quot;createRetryingCall [&quot;+i+&#x27;] method=&quot;&#x27;+t+&#x27;&quot;&#x27;),new kO.RetryingCall(this,e,t,o,s,a,i,this.retryBufferTracker,rE.get(this.getTarget()))}createResolvingCall(e,t,o,s,a){let i=(0,UO.getNextCallNumber)();this.trace(&quot;createResolvingCall [&quot;+i+&#x27;] method=&quot;&#x27;+e+&#x27;&quot;, deadline=&#x27;+(0,D_e.deadlineToString)(t));let n={deadline:t,flags:a??ci.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},l=new U_e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),l.addStatusWatcher(c=&gt;{this.onCallEnd(c)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(sr.ConnectivityState.SHUTDOWN),this.currentPicker=new FO;for(let t of this.configSelectionQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(ci.Status.UNAVAILABLE,&quot;Channel closed before call started&quot;);this.pickQueue=[],this.callRefTimer&amp;&amp;clearInterval(this.callRefTimer),this.idleTimer&amp;&amp;clearTimeout(this.idleTimer),this.channelzEnabled&amp;&amp;(0,ou.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tE.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&amp;&amp;(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,o){if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);let s=null;if(t!==1/0){let i=t instanceof Date?t:new Date(t),n=new Date;if(t===-1/0||i&lt;=n){process.nextTick(o,new Error(&quot;Deadline passed without connectivity state change&quot;));return}s=setTimeout(()=&gt;{this.removeConnectivityStateWatcher(a),o(new Error(&quot;Deadline passed without connectivity state change&quot;))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);if(this.connectivityState===sr.ConnectivityState.SHUTDOWN)throw new Error(&quot;Channel has been shut down&quot;);return this.createResolvingCall(e,t,o,s,a)}getOptions(){return this.options}};vo.InternalChannel=HO});var ey=T(nE=&gt;{&quot;use strict&quot;;Object.defineProperty(nE,&quot;__esModule&quot;,{value:!0});nE.ChannelImplementation=void 0;var j_e=Oc(),Y_e=qO(),jO=class{constructor(e,t,o){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel target must be a string&quot;);if(!(t instanceof j_e.ChannelCredentials))throw new TypeError(&quot;Channel credentials must be a ChannelCredentials object&quot;);if(o&amp;&amp;typeof o!=&quot;object&quot;)throw new TypeError(&quot;Channel options must be an object&quot;);this.internalChannel=new Y_e.InternalChannel(e,t,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,o){this.internalChannel.watchConnectivityState(e,t,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,o,s,a){if(typeof e!=&quot;string&quot;)throw new TypeError(&quot;Channel#createCall: method must be a string&quot;);if(!(typeof t==&quot;number&quot;||t instanceof Date))throw new TypeError(&quot;Channel#createCall: deadline must be a number or Date&quot;);return this.internalChannel.createCall(e,t,o,s,a)}};nE.ChannelImplementation=jO});var Bj=T(Cr=&gt;{&quot;use strict&quot;;Object.defineProperty(Cr,&quot;__esModule&quot;,{value:!0});Cr.ServerDuplexStreamImpl=Cr.ServerWritableStreamImpl=Cr.ServerReadableStreamImpl=Cr.ServerUnaryCallImpl=void 0;Cr.serverErrorToStatus=JO;var z_e=V(&quot;events&quot;),XO=V(&quot;stream&quot;),WO=ue(),kj=ht();function JO(r,e){var t;let o={code:WO.Status.UNKNOWN,details:&quot;message&quot;in r?r.message:&quot;Unknown Error&quot;,metadata:(t=e??r.metadata)!==null&amp;&amp;t!==void 0?t:null};return&quot;code&quot;in r&amp;&amp;typeof r.code==&quot;number&quot;&amp;&amp;Number.isInteger(r.code)&amp;&amp;(o.code=r.code,&quot;details&quot;in r&amp;&amp;typeof r.details==&quot;string&quot;&amp;&amp;(o.details=r.details)),o}var YO=class extends z_e.EventEmitter{constructor(e,t,o,s){super(),this.path=e,this.call=t,this.metadata=o,this.request=s,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerUnaryCallImpl=YO;var zO=class extends XO.Readable{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};Cr.ServerReadableStreamImpl=zO;var KO=class extends XO.Writable{constructor(e,t,o,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.request=s,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,a=&gt;{this.pendingStatus=JO(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerWritableStreamImpl=KO;var $O=class extends XO.Duplex{constructor(e,t,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=o,this.pendingStatus={code:WO.Status.OK,details:&quot;OK&quot;},this.cancelled=!1,this.trailingMetadata=new kj.Metadata,this.on(&quot;error&quot;,s=&gt;{this.pendingStatus=JO(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,o){this.call.sendMessage(e,o)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&amp;&amp;t!==void 0?t:this.trailingMetadata}))}end(e){return e&amp;&amp;(this.trailingMetadata=e),super.end()}};Cr.ServerDuplexStreamImpl=$O});var iE=T(ya=&gt;{&quot;use strict&quot;;Object.defineProperty(ya,&quot;__esModule&quot;,{value:!0});ya.ServerCredentials=void 0;ya.createCertificateProviderServerCredentials=K_e;ya.createServerCredentialsWithInterceptors=$_e;var QO=yv(),yo=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new ZO}static createSsl(e,t,o=!1){var s;if(e!==null&amp;&amp;!Buffer.isBuffer(e))throw new TypeError(&quot;rootCerts must be null or a Buffer&quot;);if(!Array.isArray(t))throw new TypeError(&quot;keyCertPairs must be an array&quot;);if(typeof o!=&quot;boolean&quot;)throw new TypeError(&quot;checkClientCertificate must be a boolean&quot;);let a=[],i=[];for(let n=0;n&lt;t.length;n++){let l=t[n];if(l===null||typeof l!=&quot;object&quot;)throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(l.cert_chain),i.push(l.private_key)}return new eA({requestCert:o,ciphers:QO.CIPHER_SUITES},{ca:(s=e??(0,QO.getDefaultRootsData)())!==null&amp;&amp;s!==void 0?s:void 0,cert:a,key:i})}};ya.ServerCredentials=yo;var ZO=class r extends yo{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},eA=class r extends yo{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&amp;&amp;Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&amp;&amp;Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t&lt;this.options.cert.length;t++){let o=this.options.cert[t],s=e.options.cert[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&amp;&amp;Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t&lt;this.options.key.length;t++){let o=this.options.key[t],s=e.options.key[t];if(Buffer.isBuffer(o)&amp;&amp;Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tA=class r extends yo{constructor(e,t,o){super({requestCert:t!==null,rejectUnauthorized:o,ciphers:QO.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=o,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&amp;&amp;((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&amp;&amp;this.identityCertificateProvider===e.identityCertificateProvider&amp;&amp;this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&amp;&amp;this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function K_e(r,e,t){return new tA(r,e,t)}var rA=class r extends yo{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t&lt;this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function $_e(r,e){return new rA(r,e)}});var uA=T(ar=&gt;{&quot;use strict&quot;;Object.defineProperty(ar,&quot;__esModule&quot;,{value:!0});ar.BaseServerInterceptingCall=ar.ServerInterceptingCall=ar.ResponderBuilder=ar.ServerListenerBuilder=void 0;ar.isInterceptingServerListener=W_e;ar.getServerInterceptingCall=tEe;var iA=ht(),bt=ue(),Oa=V(&quot;http2&quot;),Vj=Mh(),Fj=V(&quot;zlib&quot;),X_e=lO(),jj=Pe(),Yj=&quot;server_call&quot;;function Oo(r){jj.trace(bt.LogVerbosity.DEBUG,Yj,r)}var oA=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};ar.ServerListenerBuilder=oA;function W_e(r){return r.onReceiveMetadata!==void 0&amp;&amp;r.onReceiveMetadata.length===1}var sA=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&amp;&amp;(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&amp;&amp;(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=&gt;{this.processingMetadata=!1,!this.cancelled&amp;&amp;(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=&gt;{this.processingMessage=!1,!this.cancelled&amp;&amp;(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=&gt;{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},aA=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};ar.ResponderBuilder=aA;var oE={onReceiveMetadata:(r,e)=&gt;{e(r)},onReceiveMessage:(r,e)=&gt;{e(r)},onReceiveHalfClose:r=&gt;{r()},onCancel:()=&gt;{}},sE={start:r=&gt;{r()},sendMetadata:(r,e)=&gt;{e(r)},sendMessage:(r,e)=&gt;{e(r)},sendStatus:(r,e)=&gt;{e(r)}},lA=class{constructor(e,t){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=t==null?void 0:t.start)!==null&amp;&amp;o!==void 0?o:sE.start,sendMetadata:(s=t==null?void 0:t.sendMetadata)!==null&amp;&amp;s!==void 0?s:sE.sendMetadata,sendMessage:(a=t==null?void 0:t.sendMessage)!==null&amp;&amp;a!==void 0?a:sE.sendMessage,sendStatus:(i=t==null?void 0:t.sendStatus)!==null&amp;&amp;i!==void 0?i:sE.sendStatus}}processPendingMessage(){this.pendingMessageCallback&amp;&amp;(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&amp;&amp;(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=&gt;{var o,s,a,i;let n={onReceiveMetadata:(o=t==null?void 0:t.onReceiveMetadata)!==null&amp;&amp;o!==void 0?o:oE.onReceiveMetadata,onReceiveMessage:(s=t==null?void 0:t.onReceiveMessage)!==null&amp;&amp;s!==void 0?s:oE.onReceiveMessage,onReceiveHalfClose:(a=t==null?void 0:t.onReceiveHalfClose)!==null&amp;&amp;a!==void 0?a:oE.onReceiveHalfClose,onCancel:(i=t==null?void 0:t.onCancel)!==null&amp;&amp;i!==void 0?i:oE.onCancel},l=new sA(n,e);this.nextCall.start(l)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=&gt;{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new iA.Metadata),this.responder.sendMessage(e,o=&gt;{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=t):this.nextCall.sendMessage(o,t)})}sendStatus(e){this.responder.sendStatus(e,t=&gt;{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};ar.ServerInterceptingCall=lA;var zj=&quot;grpc-accept-encoding&quot;,cA=&quot;grpc-encoding&quot;,Gj=&quot;grpc-message&quot;,Hj=&quot;grpc-status&quot;,nA=&quot;grpc-timeout&quot;,J_e=/(\d{1,8})\s*([HMSmun])/,Q_e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},Z_e={[zj]:&quot;identity,deflate,gzip&quot;,[cA]:&quot;identity&quot;},qj={[Oa.constants.HTTP2_HEADER_STATUS]:Oa.constants.HTTP_STATUS_OK,[Oa.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},eEe={waitForTrailers:!0},aE=class{constructor(e,t,o,s,a){var i;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=bt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=bt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding=&quot;identity&quot;,this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once(&quot;error&quot;,u=&gt;{}),this.stream.once(&quot;close&quot;,()=&gt;{var u;Oo(&quot;Request to method &quot;+((u=this.handler)===null||u===void 0?void 0:u.path)+&quot; stream closed with rstCode &quot;+this.stream.rstCode),this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:bt.Status.CANCELLED,details:&quot;Stream closed before sending status&quot;,metadata:null})),this.notifyOnCancel()}),this.stream.on(&quot;data&quot;,u=&gt;{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on(&quot;end&quot;,()=&gt;{this.handleEndEvent()}),&quot;grpc.max_send_message_length&quot;in a&amp;&amp;(this.maxSendMessageSize=a[&quot;grpc.max_send_message_length&quot;]),&quot;grpc.max_receive_message_length&quot;in a&amp;&amp;(this.maxReceiveMessageSize=a[&quot;grpc.max_receive_message_length&quot;]),this.host=(i=t[&quot;:authority&quot;])!==null&amp;&amp;i!==void 0?i:t.host,this.decoder=new X_e.StreamDecoder(this.maxReceiveMessageSize);let n=iA.Metadata.fromHttp2Headers(t);jj.isTracerEnabled(Yj)&amp;&amp;Oo(&quot;Request to &quot;+this.handler.path+&quot; received headers &quot;+JSON.stringify(n.toJSON()));let l=n.get(nA);l.length&gt;0&amp;&amp;this.handleTimeoutHeader(l[0]);let c=n.get(cA);c.length&gt;0&amp;&amp;(this.incomingEncoding=c[0]),n.remove(nA),n.remove(cA),n.remove(zj),n.remove(Oa.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Oa.constants.HTTP2_HEADER_TE),n.remove(Oa.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=n}handleTimeoutHeader(e){let t=e.toString().match(J_e);if(t===null){let a={code:bt.Status.INTERNAL,details:`Invalid ${nA} value &quot;${e}&quot;`,metadata:null};process.nextTick(()=&gt;{this.sendStatus(a)});return}let o=+t[1]*Q_e[t[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=&gt;{let a={code:bt.Status.DEADLINE_EXCEEDED,details:&quot;Deadline exceeded&quot;,metadata:null};this.sendStatus(a)},o)}checkCancelled(){return!this.cancelled&amp;&amp;(this.stream.destroyed||this.stream.closed)&amp;&amp;(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=&gt;{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&amp;&amp;clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new iA.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),o=t.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),t.copy(s,5),s}decompressMessage(e,t){let o=e.subarray(5);if(t===&quot;identity&quot;)return o;if(t===&quot;deflate&quot;||t===&quot;gzip&quot;){let s;return t===&quot;deflate&quot;?s=Fj.createInflate():s=Fj.createGunzip(),new Promise((a,i)=&gt;{let n=0,l=[];s.on(&quot;data&quot;,c=&gt;{l.push(c),n+=c.byteLength,this.maxReceiveMessageSize!==-1&amp;&amp;n&gt;this.maxReceiveMessageSize&amp;&amp;(s.destroy(),i({code:bt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on(&quot;end&quot;,()=&gt;{a(Buffer.concat(l))}),s.write(o),s.end()})}else return Promise.reject({code:bt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding &quot;${t}&quot;`})}async decompressAndMaybePush(e){if(e.type!==&quot;COMPRESSED&quot;)throw new Error(`Invalid queue entry type: ${e.type}`);let o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:&quot;identity&quot;,s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:bt.Status.INTERNAL,details:`Error deserializing request: ${a.message}`});return}e.type=&quot;READABLE&quot;,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&amp;&amp;this.isReadPending&amp;&amp;this.readQueue.length&gt;0&amp;&amp;this.readQueue[0].type!==&quot;COMPRESSED&quot;){this.isReadPending=!1;let e=this.readQueue.shift();e.type===&quot;READABLE&quot;?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Oo(&quot;Request to &quot;+this.handler.path+&quot; received data frame of size &quot;+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:&quot;COMPRESSED&quot;,compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:&quot;HALF_CLOSE&quot;,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Oo(&quot;Request to &quot;+this.handler.path+&quot; start called&quot;),!this.checkCancelled()&amp;&amp;(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,o=Object.assign(Object.assign(Object.assign({},qj),Z_e),t);this.stream.respond(o,eEe)}sendMessage(e,t){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error serializing response: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&amp;&amp;o.length-5&gt;this.maxSendMessageSize){this.sendStatus({code:bt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Oo(&quot;Request to &quot;+this.handler.path+&quot; sent data frame of size &quot;+o.length),this.stream.write(o,s=&gt;{var a;if(s){this.sendStatus({code:bt.Status.INTERNAL,details:`Error writing message: ${(0,Vj.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),t()})}sendStatus(e){var t,o;if(!this.checkCancelled())if(Oo(&quot;Request to method &quot;+((t=this.handler)===null||t===void 0?void 0:t.path)+&quot; ended with status code: &quot;+bt.Status[e.code]+&quot; details: &quot;+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(&quot;wantTrailers&quot;,()=&gt;{var s;this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let a=Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},(s=e.metadata)===null||s===void 0?void 0:s.toHttp2Headers());this.stream.sendTrailers(a),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&amp;&amp;!this.streamEnded&amp;&amp;(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Hj]:e.code,[Gj]:encodeURI(e.details)},qj),(o=e.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){Oo(&quot;Request to &quot;+this.handler.path+&quot; startRead called&quot;),!this.checkCancelled()&amp;&amp;(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t!=null&amp;&amp;t.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:&quot;unknown&quot;}getDeadline(){return this.deadline}getHost(){return this.host}};ar.BaseServerInterceptingCall=aE;function tEe(r,e,t,o,s,a){let i={path:s.path,requestStream:s.type===&quot;clientStream&quot;||s.type===&quot;bidi&quot;,responseStream:s.type===&quot;serverStream&quot;||s.type===&quot;bidi&quot;,requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new aE(e,t,o,s,a);return r.reduce((l,c)=&gt;c(i,l),n)}});var Zj=T(fi=&gt;{&quot;use strict&quot;;var rEe=fi&amp;&amp;fi.__runInitializers||function(r,e,t){for(var o=arguments.length&gt;2,s=0;s&lt;e.length;s++)t=o?e[s].call(r,t):e[s].call(r);return o?t:void 0},nEe=fi&amp;&amp;fi.__esDecorate||function(r,e,t,o,s,a){function i(I){if(I!==void 0&amp;&amp;typeof I!=&quot;function&quot;)throw new TypeError(&quot;Function expected&quot;);return I}for(var n=o.kind,l=n===&quot;getter&quot;?&quot;get&quot;:n===&quot;setter&quot;?&quot;set&quot;:&quot;value&quot;,c=!e&amp;&amp;r?o.static?r:r.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,o.name):{}),f,_=!1,m=t.length-1;m&gt;=0;m--){var O={};for(var y in o)O[y]=y===&quot;access&quot;?{}:o[y];for(var y in o.access)O.access[y]=o.access[y];O.addInitializer=function(I){if(_)throw new TypeError(&quot;Cannot add initializers after decoration has completed&quot;);a.push(i(I||null))};var A=(0,t[m])(n===&quot;accessor&quot;?{get:u.get,set:u.set}:u[l],O);if(n===&quot;accessor&quot;){if(A===void 0)continue;if(A===null||typeof A!=&quot;object&quot;)throw new TypeError(&quot;Object expected&quot;);(f=i(A.get))&amp;&amp;(u.get=f),(f=i(A.set))&amp;&amp;(u.set=f),(f=i(A.init))&amp;&amp;s.unshift(f)}else(f=i(A))&amp;&amp;(n===&quot;field&quot;?s.unshift(f):u[l]=f)}c&amp;&amp;Object.defineProperty(c,o.name,u),_=!0};Object.defineProperty(fi,&quot;__esModule&quot;,{value:!0});fi.Server=void 0;var Lt=V(&quot;http2&quot;),iEe=V(&quot;util&quot;),qe=ue(),Na=Bj(),fA=iE(),Kj=jr(),Ra=Pe(),ui=nr(),Pr=Pt(),Qe=_o(),$j=uA(),Aa=~(1&lt;&lt;31),pA=~(1&lt;&lt;31),oEe=2e4,Xj=~(1&lt;&lt;31),{HTTP2_HEADER_PATH:Wj}=Lt.constants,sEe=&quot;server&quot;,Jj=Buffer.from(&quot;max_age&quot;);function Qj(r){Ra.trace(qe.LogVerbosity.DEBUG,&quot;server_call&quot;,r)}function aEe(){}function lEe(r){return function(e,t){return iEe.deprecate(e,r)}}function dA(r){return{code:qe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function cEe(r,e){let t=dA(e);switch(r){case&quot;unary&quot;:return(o,s)=&gt;{s(t,null)};case&quot;clientStream&quot;:return(o,s)=&gt;{s(t,null)};case&quot;serverStream&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};case&quot;bidi&quot;:return o=&gt;{o.emit(&quot;error&quot;,t)};default:throw new Error(`Invalid handlerType ${r}`)}}var uEe=(()=&gt;{var r;let e=[],t;return r=class{constructor(s){var a,i,n,l,c,u;this.boundPorts=(rEe(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString=&quot;null&quot;,this.channelzEnabled=!0,this.options=s??{},this.options[&quot;grpc.enable_channelz&quot;]===0?(this.channelzEnabled=!1,this.channelzTrace=new Qe.ChannelzTraceStub,this.callTracker=new Qe.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Qe.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Qe.ChannelzChildrenTrackerStub):(this.channelzTrace=new Qe.ChannelzTrace,this.callTracker=new Qe.ChannelzCallTracker,this.listenerChildrenTracker=new Qe.ChannelzChildrenTracker,this.sessionChildrenTracker=new Qe.ChannelzChildrenTracker),this.channelzRef=(0,Qe.registerChannelzServer)(&quot;server&quot;,()=&gt;this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Server created&quot;),this.maxConnectionAgeMs=(a=this.options[&quot;grpc.max_connection_age_ms&quot;])!==null&amp;&amp;a!==void 0?a:Aa,this.maxConnectionAgeGraceMs=(i=this.options[&quot;grpc.max_connection_age_grace_ms&quot;])!==null&amp;&amp;i!==void 0?i:Aa,this.keepaliveTimeMs=(n=this.options[&quot;grpc.keepalive_time_ms&quot;])!==null&amp;&amp;n!==void 0?n:pA,this.keepaliveTimeoutMs=(l=this.options[&quot;grpc.keepalive_timeout_ms&quot;])!==null&amp;&amp;l!==void 0?l:oEe,this.sessionIdleTimeout=(c=this.options[&quot;grpc.max_connection_idle_ms&quot;])!==null&amp;&amp;c!==void 0?c:Xj,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},&quot;grpc-node.max_session_memory&quot;in this.options?this.commonServerOptions.maxSessionMemory=this.options[&quot;grpc-node.max_session_memory&quot;]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,&quot;grpc.max_concurrent_streams&quot;in this.options&amp;&amp;(this.commonServerOptions.settings={maxConcurrentStreams:this.options[&quot;grpc.max_concurrent_streams&quot;]}),this.interceptors=(u=this.options.interceptors)!==null&amp;&amp;u!==void 0?u:[],this.trace(&quot;Server constructed&quot;)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let l=this.sessions.get(s),c=s.socket,u=c.remoteAddress?(0,ui.stringToSubchannelAddress)(c.remoteAddress,c.remotePort):null,f=c.localAddress?(0,ui.stringToSubchannelAddress)(c.localAddress,c.localPort):null,_;if(s.encrypted){let O=c,y=O.getCipher(),A=O.getCertificate(),I=O.getPeerCertificate();_={cipherSuiteStandardName:(a=y.standardName)!==null&amp;&amp;a!==void 0?a:null,cipherSuiteOtherName:y.standardName?null:y.name,localCertificate:A&amp;&amp;&quot;raw&quot;in A?A.raw:null,remoteCertificate:I&amp;&amp;&quot;raw&quot;in I?I.raw:null}}else _=null;return{remoteAddress:u,localAddress:f,security:_,remoteName:null,streamsStarted:l.streamTracker.callsStarted,streamsSucceeded:l.streamTracker.callsSucceeded,streamsFailed:l.streamTracker.callsFailed,messagesSent:l.messagesSent,messagesReceived:l.messagesReceived,keepAlivesSent:l.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:l.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:l.lastMessageSentTimestamp,lastMessageReceivedTimestamp:l.lastMessageReceivedTimestamp,localFlowControlWindow:(i=s.state.localWindowSize)!==null&amp;&amp;i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&amp;&amp;n!==void 0?n:null}}trace(s){Ra.trace(qe.LogVerbosity.DEBUG,sEe,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}keepaliveTrace(s){Ra.trace(qe.LogVerbosity.DEBUG,&quot;keepalive&quot;,&quot;(&quot;+this.channelzRef.id+&quot;) &quot;+s)}addProtoService(){throw new Error(&quot;Not implemented. Use addService() instead&quot;)}addService(s,a){if(s===null||typeof s!=&quot;object&quot;||a===null||typeof a!=&quot;object&quot;)throw new Error(&quot;addService() requires two objects as arguments&quot;);let i=Object.keys(s);if(i.length===0)throw new Error(&quot;Cannot add an empty service to a server&quot;);i.forEach(n=&gt;{let l=s[n],c;l.requestStream?l.responseStream?c=&quot;bidi&quot;:c=&quot;clientStream&quot;:l.responseStream?c=&quot;serverStream&quot;:c=&quot;unary&quot;;let u=a[n],f;if(u===void 0&amp;&amp;typeof l.originalName==&quot;string&quot;&amp;&amp;(u=a[l.originalName]),u!==void 0?f=u.bind(a):f=cEe(c,n),this.register(l.path,f,l.responseSerialize,l.requestDeserialize,c)===!1)throw new Error(`Method handler for ${l.path} already provided.`)})}removeService(s){if(s===null||typeof s!=&quot;object&quot;)throw new Error(&quot;removeService() requires object as argument&quot;);Object.keys(s).forEach(i=&gt;{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error(&quot;Not implemented. Use bindAsync() instead&quot;)}experimentalRegisterListenerToChannelz(s){return(0,Qe.registerChannelzSocket)((0,ui.subchannelAddressToString)(s),()=&gt;({localAddress:s,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(s){(0,Qe.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),l=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options[&quot;grpc-node.tls_enable_trace&quot;]===1}),c=n!==null;this.trace(&quot;Initial credentials valid: &quot;+c),a=Lt.createSecureServer(l),a.prependListener(&quot;connection&quot;,f=&gt;{c||(this.trace(&quot;Dropped connection from &quot;+JSON.stringify(f.address())+&quot; due to unloaded credentials&quot;),f.destroy())}),a.on(&quot;secureConnection&quot;,f=&gt;{f.on(&quot;error&quot;,_=&gt;{this.trace(&quot;An incoming TLS connection closed with error: &quot;+_.message)})});let u=f=&gt;{if(f){let _=a;try{_.setSecureContext(f)}catch(m){Ra.log(qe.LogVerbosity.ERROR,&quot;Failed to set secure context with error &quot;+m.message),f=null}}c=f!==null,this.trace(&quot;Post-update credentials valid: &quot;+c)};s._addWatcher(u),a.on(&quot;close&quot;,()=&gt;{s._removeWatcher(u)})}else a=Lt.createServer(this.commonServerOptions);return a.setTimeout(0,aEe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace(&quot;Attempting to bind &quot;+(0,ui.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,l)=&gt;{let c=u=&gt;{this.trace(&quot;Failed to bind &quot;+(0,ui.subchannelAddressToString)(s)+&quot; with error &quot;+u.message),n({port:&quot;port&quot;in s?s.port:1,error:u.message})};i.once(&quot;error&quot;,c),i.listen(s,()=&gt;{let u=i.address(),f;typeof u==&quot;string&quot;?f={path:u}:f={host:u.address,port:u.port};let _=this.experimentalRegisterListenerToChannelz(f);this.listenerChildrenTracker.refChild(_),this.http2Servers.set(i,{channelzRef:_,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace(&quot;Successfully bound &quot;+(0,ui.subchannelAddressToString)(f)),n({port:&quot;port&quot;in f?f.port:1}),i.removeListener(&quot;error&quot;,c)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,ui.isTcpSubchannelAddress)(s[0])&amp;&amp;s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(u=&gt;(0,ui.isTcpSubchannelAddress)(u)?{host:u.host,port:i.port}:u),l=await Promise.all(n.map(u=&gt;this.bindOneAddress(u,a))),c=[i,...l];return{count:c.filter(u=&gt;u.error===void 0).length,port:i.port,errors:c.filter(u=&gt;u.error).map(u=&gt;u.error)}}}else{let i=await Promise.all(s.map(n=&gt;this.bindOneAddress(n,a)));return{count:i.filter(n=&gt;n.error===void 0).length,port:i[0].port,errors:i.filter(n=&gt;n.error).map(n=&gt;n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count&gt;0)return i.count&lt;s.length&amp;&amp;Ra.log(qe.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Ra.log(qe.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(&quot;,&quot;)}]`)}}resolvePort(s){return new Promise((a,i)=&gt;{let n={onSuccessfulResolution:(c,u,f)=&gt;{n.onSuccessfulResolution=()=&gt;{};let _=[].concat(...c.map(m=&gt;m.addresses));if(_.length===0){i(new Error(`No addresses resolved for port ${s}`));return}a(_)},onError:c=&gt;{i(new Error(c.details))}};(0,Kj.createResolver)(s,n,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error(&quot;bindAsync operation cancelled by unbind call&quot;);return n}normalizePort(s){let a=(0,Pr.parseUri)(s);if(a===null)throw new Error(`Could not parse port &quot;${s}&quot;`);let i=(0,Kj.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port &quot;${s}&quot;`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error(&quot;bindAsync called after shutdown&quot;);if(typeof s!=&quot;string&quot;)throw new TypeError(&quot;port must be a string&quot;);if(a===null||!(a instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);if(typeof i!=&quot;function&quot;)throw new TypeError(&quot;callback must be a function&quot;);this.trace(&quot;bindAsync port=&quot;+s);let n=this.normalizePort(s),l=(_,m)=&gt;{process.nextTick(()=&gt;i(_,m))},c=this.boundPorts.get((0,Pr.uriToString)(n));if(c){if(!a._equals(c.credentials)){l(new Error(`${s} already bound with incompatible credentials`),0);return}c.cancelled=!1,c.completionPromise?c.completionPromise.then(_=&gt;i(null,_),_=&gt;i(_,0)):l(null,c.portNumber);return}c={mapKey:(0,Pr.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let u=(0,Pr.splitHostPort)(n.path),f=this.bindPort(n,c);c.completionPromise=f,(u==null?void 0:u.port)===0?f.then(_=&gt;{let m={scheme:n.scheme,authority:n.authority,path:(0,Pr.combineHostPort)({host:u.host,port:_})};c.mapKey=(0,Pr.uriToString)(m),c.completionPromise=null,c.portNumber=_,this.boundPorts.set(c.mapKey,c),i(null,_)},_=&gt;{i(_,0)}):(this.boundPorts.set(c.mapKey,c),f.then(_=&gt;{c.completionPromise=null,c.portNumber=_,i(null,_)},_=&gt;{i(_,0)}))}registerInjectorToChannelz(){return(0,Qe.registerChannelzSocket)(&quot;injector&quot;,()=&gt;({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(s,a,i=!1){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);this.channelzEnabled&amp;&amp;this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),l=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:l,ownsChannelzRef:i}),{injectConnection:c=&gt;{n.emit(&quot;connection&quot;,c)},drain:c=&gt;{var u,f;for(let _ of l)this.closeSession(_);(f=(u=setTimeout(()=&gt;{for(let _ of l)_.destroy(Lt.constants.NGHTTP2_CANCEL)},c)).unref)===null||f===void 0||f.call(u)},destroy:()=&gt;{this.closeServer(n);for(let c of l)this.closeSession(c)}}}createConnectionInjector(s){if(s===null||!(s instanceof fA.ServerCredentials))throw new TypeError(&quot;creds must be a ServerCredentials object&quot;);let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace(&quot;Closing server with address &quot;+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=&gt;{i&amp;&amp;i.ownsChannelzRef&amp;&amp;(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Qe.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a==null||a()})}closeSession(s,a){var i;this.trace(&quot;Closing session initiated by &quot;+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),l=()=&gt;{n&amp;&amp;(this.sessionChildrenTracker.unrefChild(n.ref),(0,Qe.unregisterChannelzRef)(n.ref)),a==null||a()};s.closed?queueMicrotask(l):s.close(l)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=&gt;{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace(&quot;unbind port=&quot;+s);let a=this.normalizePort(s),i=(0,Pr.splitHostPort)(a.path);if((i==null?void 0:i.port)===0)throw new Error(&quot;Cannot unbind port 0&quot;);let n=this.boundPorts.get((0,Pr.uriToString)(a));n&amp;&amp;(this.trace(&quot;unbinding &quot;+n.mapKey+&quot; originally bound as &quot;+(0,Pr.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace(&quot;drain port=&quot;+s+&quot; graceTimeMs=&quot;+a);let l=this.normalizePort(s),c=(0,Pr.splitHostPort)(l.path);if((c==null?void 0:c.port)===0)throw new Error(&quot;Cannot drain port 0&quot;);let u=this.boundPorts.get((0,Pr.uriToString)(l));if(!u)return;let f=new Set;for(let _ of u.listeningServers){let m=this.http2Servers.get(_);if(m)for(let O of m.sessions)f.add(O),this.closeSession(O,()=&gt;{f.delete(O)})}(n=(i=setTimeout(()=&gt;{for(let _ of f)_.destroy(Lt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=&gt;{this.closeSession(a),a.destroy(Lt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Qe.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,l){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:l,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=&gt;!s.listening))throw new Error(&quot;server must be bound in order to start&quot;);if(this.started===!0)throw new Error(&quot;server is already started&quot;);this.started=!0}tryShutdown(s){var a;let i=c=&gt;{(0,Qe.unregisterChannelzRef)(this.channelzRef),s(c)},n=0;function l(){n--,n===0&amp;&amp;i()}this.shutdown=!0;for(let[c,u]of this.http2Servers.entries()){n++;let f=u.channelzRef.name;this.trace(&quot;Waiting for server &quot;+f+&quot; to close&quot;),this.closeServer(c,()=&gt;{this.trace(&quot;Server &quot;+f+&quot; finished closing&quot;),l()});for(let _ of u.sessions.keys()){n++;let m=(a=_.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace(&quot;Waiting for session &quot;+m+&quot; to close&quot;),this.closeSession(_,()=&gt;{this.trace(&quot;Session &quot;+m+&quot; finished closing&quot;),l()})}}n===0&amp;&amp;i()}addHttp2Port(){throw new Error(&quot;Not yet implemented&quot;)}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Lt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!=&quot;string&quot;||!i.startsWith(&quot;application/grpc&quot;)?(s.respond({[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){Qj(&quot;Received call to method &quot;+s+&quot; at address &quot;+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(Qj(&quot;No handler registered for method &quot;+s+&quot;. Sending UNIMPLEMENTED status.&quot;),null):a}_respondWithError(s,a,i=null){var n,l;let c=Object.assign({&quot;grpc-status&quot;:(n=s.code)!==null&amp;&amp;n!==void 0?n:qe.Status.INTERNAL,&quot;grpc-message&quot;:s.details,[Lt.constants.HTTP2_HEADER_STATUS]:Lt.constants.HTTP_STATUS_OK,[Lt.constants.HTTP2_HEADER_CONTENT_TYPE]:&quot;application/grpc+proto&quot;},(l=s.metadata)===null||l===void 0?void 0:l.toHttp2Headers());a.respond(c,{endStream:!0}),this.callTracker.addCallFailed(),i==null||i.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n==null||n.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed();return}let l=i[Wj],c=this._retrieveHandler(l);if(!c){this._respondWithError(dA(l),a,n);return}let u={addMessageSent:()=&gt;{n&amp;&amp;(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=&gt;{n&amp;&amp;(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:_=&gt;{_.code===qe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:_=&gt;{n&amp;&amp;(_?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},f=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,u,c,this.options);this._runHandlerForCall(f,c)||(this.callTracker.addCallFailed(),n==null||n.streamTracker.addCallFailed(),f.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[Wj],l=this._retrieveHandler(n);if(!l){this._respondWithError(dA(n),a,null);return}let c=(0,$j.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,l,this.options);this._runHandlerForCall(c,l)||c.sendStatus({code:qe.Status.INTERNAL,details:`Unknown handler type: ${l.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i===&quot;unary&quot;)fEe(s,a);else if(i===&quot;clientStream&quot;)pEe(s,a);else if(i===&quot;serverStream&quot;)dEe(s,a);else if(i===&quot;bidi&quot;)hEe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n=&quot;null&quot;;i&amp;&amp;(typeof i==&quot;string&quot;?n=i:n=i.address+&quot;:&quot;+i.port),this.serverAddressString=n;let l=this.channelzEnabled?this._channelzHandler:this._streamHandler,c=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on(&quot;stream&quot;,l.bind(this,a)),s.on(&quot;session&quot;,c)}_sessionHandler(s){return a=&gt;{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let l=null,c=null,u=null,f=!1,_=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let I=this.maxConnectionAgeMs/10,M=Math.random()*I*2-I;l=setTimeout(()=&gt;{var F,N;f=!0,this.trace(&quot;Connection dropped by max connection age: &quot;+((F=a.socket)===null||F===void 0?void 0:F.remoteAddress));try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(c=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(N=c.unref)===null||N===void 0||N.call(c))},this.maxConnectionAgeMs+M),(n=l.unref)===null||n===void 0||n.call(l)}let m=()=&gt;{u&amp;&amp;(clearTimeout(u),u=null)},O=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,y,A=()=&gt;{var I;O()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),u=setTimeout(()=&gt;{m(),y()},this.keepaliveTimeMs),(I=u.unref)===null||I===void 0||I.call(u))};y=()=&gt;{var I;if(!O())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let M=&quot;&quot;;try{a.ping((N,z,B)=&gt;{m(),N?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+N.message),f=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),A())})||(M=&quot;Ping returned false&quot;)}catch(F){M=(F instanceof Error?F.message:&quot;&quot;)||&quot;Unknown error&quot;}if(M){this.keepaliveTrace(&quot;Ping send failed: &quot;+M),this.trace(&quot;Connection dropped due to ping send error: &quot;+M),f=!0,a.close();return}u=setTimeout(()=&gt;{m(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.trace(&quot;Connection dropped by keepalive timeout&quot;),f=!0,a.close()},this.keepaliveTimeoutMs),(I=u.unref)===null||I===void 0||I.call(u)},A(),a.on(&quot;close&quot;,()=&gt;{var I,M;f||this.trace(`Connection dropped by client ${(I=a.socket)===null||I===void 0?void 0:I.remoteAddress}`),l&amp;&amp;clearTimeout(l),c&amp;&amp;clearTimeout(c),m(),_!==null&amp;&amp;(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(a)),(M=this.http2Servers.get(s))===null||M===void 0||M.sessions.delete(a)})}}_channelzSessionHandler(s){return a=&gt;{var i,n,l,c;let u=(0,Qe.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&amp;&amp;n!==void 0?n:&quot;unknown&quot;,this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),f={ref:u,streamTracker:new Qe.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(l=this.http2Servers.get(s))===null||l===void 0||l.sessions.add(a),this.sessions.set(a,f);let _=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection established by client &quot;+_),this.trace(&quot;Connection established by client &quot;+_),this.sessionChildrenTracker.refChild(u);let m=null,O=null,y=null,A=!1,I=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==Aa){let B=this.maxConnectionAgeMs/10,G=Math.random()*B*2-B;m=setTimeout(()=&gt;{var te;A=!0,this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by max connection age from &quot;+_);try{a.goaway(Lt.constants.NGHTTP2_NO_ERROR,~(1&lt;&lt;31),Jj)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==Aa&amp;&amp;(O=setTimeout(()=&gt;{a.destroy()},this.maxConnectionAgeGraceMs),(te=O.unref)===null||te===void 0||te.call(O))},this.maxConnectionAgeMs+G),(c=m.unref)===null||c===void 0||c.call(m)}let M=()=&gt;{y&amp;&amp;(clearTimeout(y),y=null)},F=()=&gt;!a.destroyed&amp;&amp;this.keepaliveTimeMs&lt;pA&amp;&amp;this.keepaliveTimeMs&gt;0,N,z=()=&gt;{var B;F()&amp;&amp;(this.keepaliveTrace(&quot;Starting keepalive timer for &quot;+this.keepaliveTimeMs+&quot;ms&quot;),y=setTimeout(()=&gt;{M(),N()},this.keepaliveTimeMs),(B=y.unref)===null||B===void 0||B.call(y))};N=()=&gt;{var B;if(!F())return;this.keepaliveTrace(&quot;Sending ping with timeout &quot;+this.keepaliveTimeoutMs+&quot;ms&quot;);let G=&quot;&quot;;try{a.ping(($,le,v)=&gt;{M(),$?(this.keepaliveTrace(&quot;Ping failed with error: &quot;+$.message),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to error of a ping frame &quot;+$.message+&quot; return in &quot;+le),A=!0,a.close()):(this.keepaliveTrace(&quot;Received ping response&quot;),z())})||(G=&quot;Ping returned false&quot;)}catch(te){G=(te instanceof Error?te.message:&quot;&quot;)||&quot;Unknown error&quot;}if(G){this.keepaliveTrace(&quot;Ping send failed: &quot;+G),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped due to ping send error: &quot;+G),A=!0,a.close();return}f.keepAlivesSent+=1,y=setTimeout(()=&gt;{M(),this.keepaliveTrace(&quot;Ping timeout passed without response&quot;),this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by keepalive timeout from &quot;+_),A=!0,a.close()},this.keepaliveTimeoutMs),(B=y.unref)===null||B===void 0||B.call(y)},z(),a.on(&quot;close&quot;,()=&gt;{var B;A||this.channelzTrace.addTrace(&quot;CT_INFO&quot;,&quot;Connection dropped by client &quot;+_),this.sessionChildrenTracker.unrefChild(u),(0,Qe.unregisterChannelzRef)(u),m&amp;&amp;clearTimeout(m),O&amp;&amp;clearTimeout(O),M(),I!==null&amp;&amp;(clearTimeout(I.timeout),this.sessionIdleTimeouts.delete(a)),(B=this.http2Servers.get(s))===null||B===void 0||B.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout&gt;=Xj)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:l}=s;return this.trace(&quot;Enable idle timeout for &quot;+l.remoteAddress+&quot;:&quot;+l.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&amp;&amp;n.activeStreams===0&amp;&amp;(Date.now()-n.lastIdle&gt;=s.sessionIdleTimeout?(s.trace(&quot;Session idle timeout triggered for &quot;+(i==null?void 0:i.remoteAddress)+&quot;:&quot;+(i==null?void 0:i.remotePort)+&quot; last idle at &quot;+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&amp;&amp;(i.activeStreams+=1,s.once(&quot;close&quot;,i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&amp;&amp;(n.activeStreams-=1,n.activeStreams===0&amp;&amp;(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace(&quot;Session onStreamClose&quot;+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+&quot;:&quot;+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+&quot; at &quot;+n.lastIdle)))}},(()=&gt;{let o=typeof Symbol==&quot;function&quot;&amp;&amp;Symbol.metadata?Object.create(null):void 0;t=[lEe(&quot;Calling start() is no longer necessary. It can be safely omitted.&quot;)],nEe(r,null,t,{kind:&quot;method&quot;,name:&quot;start&quot;,static:!1,private:!1,access:{has:s=&gt;&quot;start&quot;in s,get:s=&gt;s.start},metadata:o},null,e),o&amp;&amp;Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r})();fi.Server=uEe;async function fEe(r,e){let t;function o(i,n,l,c){if(i){r.sendStatus((0,Na.serverErrorToStatus)(i,l));return}r.sendMessage(n,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:l??null})})}let s,a=null;r.start({onReceiveMetadata(i){s=i,r.startRead()},onReceiveMessage(i){if(a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,r.startRead()},onReceiveHalfClose(){if(!a){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,s,a);try{e.func(t,o)}catch(i){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;))}})}function pEe(r,e){let t;function o(s,a,i,n){if(s){r.sendStatus((0,Na.serverErrorToStatus)(s,i));return}r.sendMessage(a,()=&gt;{r.sendStatus({code:qe.Status.OK,details:&quot;OK&quot;,metadata:i??null})})}r.start({onReceiveMetadata(s){t=new Na.ServerDuplexStreamImpl(e.path,r,s);try{e.func(t,o)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){t.push(s)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function dEe(r,e){let t,o,s=null;r.start({onReceiveMetadata(a){o=a,r.startRead()},onReceiveMessage(a){if(s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:qe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Na.ServerWritableStreamImpl(e.path,r,o,s);try{e.func(t)}catch(a){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}function hEe(r,e){let t;r.start({onReceiveMetadata(o){t=new Na.ServerDuplexStreamImpl(e.path,r,o);try{e.func(t)}catch(s){r.sendStatus({code:qe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){t.push(o)},onReceiveHalfClose(){t.push(null)},onCancel(){t&amp;&amp;(t.cancelled=!0,t.emit(&quot;cancelled&quot;,&quot;cancelled&quot;),t.destroy())}})}});var e4=T(lE=&gt;{&quot;use strict&quot;;Object.defineProperty(lE,&quot;__esModule&quot;,{value:!0});lE.StatusBuilder=void 0;var hA=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&amp;&amp;(e.code=this.code),this.details!==null&amp;&amp;(e.details=this.details),this.metadata!==null&amp;&amp;(e.metadata=this.metadata),e}};lE.StatusBuilder=hA});var _A=T(Ca=&gt;{&quot;use strict&quot;;Object.defineProperty(Ca,&quot;__esModule&quot;,{value:!0});Ca.msToDuration=_Ee;Ca.durationToMs=EEe;Ca.isDuration=mEe;Ca.parseDuration=SEe;function _Ee(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function EEe(r){return r.seconds*1e3+r.nanos/1e6|0}function mEe(r){return typeof r.seconds==&quot;number&quot;&amp;&amp;typeof r.nanos==&quot;number&quot;}var TEe=/^(\d+)(?:\.(\d+))?s$/;function SEe(r){let e=r.match(TEe);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,&quot;0&quot;),10):0}:null}});var cE=T(on=&gt;{&quot;use strict&quot;;Object.defineProperty(on,&quot;__esModule&quot;,{value:!0});on.LeafLoadBalancer=on.PickFirstLoadBalancer=on.PickFirstLoadBalancingConfig=void 0;on.shuffled=i4;on.setup=NEe;var EA=so(),$e=rr(),Ao=Zn(),t4=nr(),gEe=Pe(),vEe=ue(),r4=nr(),n4=V(&quot;net&quot;),yEe=&quot;pick_first&quot;;function su(r){gEe.trace(vEe.LogVerbosity.DEBUG,yEe,r)}var au=&quot;pick_first&quot;,OEe=250,Pa=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return au}toJsonObject(){return{[au]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if(&quot;shuffleAddressList&quot;in e&amp;&amp;typeof e.shuffleAddressList!=&quot;boolean&quot;)throw new Error(&quot;pick_first config field shuffleAddressList must be a boolean if provided&quot;);return new r(e.shuffleAddressList===!0)}};on.PickFirstLoadBalancingConfig=Pa;var mA=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Ao.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function i4(r){let e=r.slice();for(let t=e.length-1;t&gt;1;t--){let o=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[o],e[o]=s}return e}function AEe(r){if(r.length===0)return[];let e=[],t=[],o=[],s=(0,r4.isTcpSubchannelAddress)(r[0])&amp;&amp;(0,n4.isIPv6)(r[0].host);for(let n of r)(0,r4.isTcpSubchannelAddress)(n)&amp;&amp;(0,n4.isIPv6)(n.host)?t.push(n):o.push(n);let a=s?t:o,i=s?o:t;for(let n=0;n&lt;Math.max(a.length,i.length);n++)n&lt;a.length&amp;&amp;e.push(a[n]),n&lt;i.length&amp;&amp;e.push(i[n]);return e}var o4=&quot;grpc-node.internal.pick-first.report_health_status&quot;,lu=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=$e.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,o,s,a,i)=&gt;{this.onSubchannelStateUpdate(t,o,s,i)},this.pickedSubchannelHealthListener=()=&gt;this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.connectionDelayTimeout=setTimeout(()=&gt;{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=&gt;e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=&gt;e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&amp;&amp;!this.currentPick.isHealthy()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.READY,new mA(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState($e.ConnectivityState.IDLE,new Ao.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState($e.ConnectivityState.TRANSIENT_FAILURE,new Ao.UnavailablePicker({details:t}),t)}else this.updateState($e.ConnectivityState.CONNECTING,new Ao.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&amp;&amp;(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&amp;&amp;a.realSubchannelEquals(e)){o!==$e.ConnectivityState.READY&amp;&amp;(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===$e.ConnectivityState.READY&amp;&amp;this.pickSubchannel(n.subchannel),o===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(n.hasReportedTransientFailure=!0,s&amp;&amp;(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&amp;&amp;this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,o]of this.children.entries())if(t&gt;=e){let s=o.subchannel.getConnectivityState();if(s===$e.ConnectivityState.IDLE||s===$e.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===$e.ConnectivityState.IDLE&amp;&amp;(su(&quot;Start connecting to subchannel with address &quot;+this.children[e].subchannel.getAddress()),process.nextTick(()=&gt;{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=&gt;{this.startNextSubchannelConnecting(e+1)},OEe),(o=(t=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(t)}pickSubchannel(e){su(&quot;Pick subchannel with address &quot;+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,o){su($e.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+$e.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){su(&quot;connectToAddressList([&quot;+e.map(s=&gt;(0,t4.subchannelAddressToString)(s))+&quot;])&quot;);let o=e.map(s=&gt;({subchannel:this.channelControlHelper.createSubchannel(s,t),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===$e.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===$e.ConnectivityState.TRANSIENT_FAILURE&amp;&amp;(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,o){if(!(t instanceof Pa))return;this.reportHealthStatus=o[o4],t.getShuffleAddressList()&amp;&amp;(e=i4(e));let s=[].concat(...e.map(i=&gt;i.addresses));su(&quot;updateAddressList([&quot;+s.map(i=&gt;(0,t4.subchannelAddressToString)(i))+&quot;])&quot;),s.length===0&amp;&amp;(this.lastError=&quot;No addresses resolved&quot;);let a=AEe(s);this.latestAddressList=a,this.latestOptions=o,this.connectToAddressList(a,o)}exitIdle(){this.currentState===$e.ConnectivityState.IDLE&amp;&amp;this.latestAddressList&amp;&amp;this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return au}};on.PickFirstLoadBalancer=lu;var REe=new Pa(!1),TA=class{constructor(e,t,o){this.endpoint=e,this.options=o,this.latestState=$e.ConnectivityState.IDLE;let s=(0,EA.createChildChannelControlHelper)(t,{updateState:(a,i,n)=&gt;{this.latestState=a,this.latestPicker=i,t.updateState(a,i,n)}});this.pickFirstBalancer=new lu(s),this.latestPicker=new Ao.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],REe,Object.assign(Object.assign({},this.options),{[o4]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==$e.ConnectivityState.IDLE&amp;&amp;this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};on.LeafLoadBalancer=TA;function NEe(){(0,EA.registerLoadBalancerType)(au,lu,Pa),(0,EA.registerDefaultLoadBalancerType)(au)}});var s4=T(fE=&gt;{&quot;use strict&quot;;Object.defineProperty(fE,&quot;__esModule&quot;,{value:!0});fE.FileWatcherCertificateProvider=void 0;var CEe=V(&quot;fs&quot;),PEe=Pe(),IEe=ue(),bEe=V(&quot;util&quot;),LEe=&quot;certificate_provider&quot;;function uE(r){PEe.trace(IEe.LogVerbosity.DEBUG,LEe,r)}var SA=(0,bEe.promisify)(CEe.readFile),gA=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error(&quot;certificateFile and privateKeyFile must be set or unset together&quot;);if(e.certificateFile===void 0&amp;&amp;e.caCertificateFile===void 0)throw new Error(&quot;At least one of certificateFile and caCertificateFile must be set&quot;);uE(&quot;File watcher constructed with config &quot;+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?SA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?SA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?SA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,o])=&gt;{if(this.refreshTimer){uE(&quot;File watcher read certificates certificate &quot;+e.status+&quot;, privateKey &quot;+t.status+&quot;, CA certificate &quot;+o.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===&quot;fulfilled&quot;&amp;&amp;t.status===&quot;fulfilled&quot;?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,o.status===&quot;fulfilled&quot;?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),uE(&quot;File watcher initiated certificate update&quot;))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e&gt;this.config.refreshIntervalMs&amp;&amp;this.updateCertificates(),e&gt;this.config.refreshIntervalMs*2&amp;&amp;(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=&gt;this.updateCertificates(),this.config.refreshIntervalMs),uE(&quot;File watcher started watching&quot;)}}maybeStopWatchingFiles(){this.caListeners.size===0&amp;&amp;this.identityListeners.size===0&amp;&amp;(this.fileResultPromise=null,this.refreshTimer&amp;&amp;(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&amp;&amp;process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};fE.FileWatcherCertificateProvider=gA});var yA=T(k=&gt;{&quot;use strict&quot;;Object.defineProperty(k,&quot;__esModule&quot;,{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var a4=Pe();Object.defineProperty(k,&quot;trace&quot;,{enumerable:!0,get:function(){return a4.trace}});Object.defineProperty(k,&quot;log&quot;,{enumerable:!0,get:function(){return a4.log}});var l4=jr();Object.defineProperty(k,&quot;registerResolver&quot;,{enumerable:!0,get:function(){return l4.registerResolver}});Object.defineProperty(k,&quot;createResolver&quot;,{enumerable:!0,get:function(){return l4.createResolver}});var c4=Pt();Object.defineProperty(k,&quot;uriToString&quot;,{enumerable:!0,get:function(){return c4.uriToString}});Object.defineProperty(k,&quot;splitHostPort&quot;,{enumerable:!0,get:function(){return c4.splitHostPort}});var u4=_A();Object.defineProperty(k,&quot;durationToMs&quot;,{enumerable:!0,get:function(){return u4.durationToMs}});Object.defineProperty(k,&quot;parseDuration&quot;,{enumerable:!0,get:function(){return u4.parseDuration}});var xEe=Nc();Object.defineProperty(k,&quot;BackoffTimeout&quot;,{enumerable:!0,get:function(){return xEe.BackoffTimeout}});var cu=so();Object.defineProperty(k,&quot;createChildChannelControlHelper&quot;,{enumerable:!0,get:function(){return cu.createChildChannelControlHelper}});Object.defineProperty(k,&quot;registerLoadBalancerType&quot;,{enumerable:!0,get:function(){return cu.registerLoadBalancerType}});Object.defineProperty(k,&quot;selectLbConfigFromList&quot;,{enumerable:!0,get:function(){return cu.selectLbConfigFromList}});Object.defineProperty(k,&quot;parseLoadBalancingConfig&quot;,{enumerable:!0,get:function(){return cu.parseLoadBalancingConfig}});Object.defineProperty(k,&quot;isLoadBalancerNameRegistered&quot;,{enumerable:!0,get:function(){return cu.isLoadBalancerNameRegistered}});var MEe=cE();Object.defineProperty(k,&quot;LeafLoadBalancer&quot;,{enumerable:!0,get:function(){return MEe.LeafLoadBalancer}});var pE=nr();Object.defineProperty(k,&quot;subchannelAddressToString&quot;,{enumerable:!0,get:function(){return pE.subchannelAddressToString}});Object.defineProperty(k,&quot;endpointToString&quot;,{enumerable:!0,get:function(){return pE.endpointToString}});Object.defineProperty(k,&quot;endpointHasAddress&quot;,{enumerable:!0,get:function(){return pE.endpointHasAddress}});Object.defineProperty(k,&quot;EndpointMap&quot;,{enumerable:!0,get:function(){return pE.EndpointMap}});var wEe=$h();Object.defineProperty(k,&quot;ChildLoadBalancerHandler&quot;,{enumerable:!0,get:function(){return wEe.ChildLoadBalancerHandler}});var vA=Zn();Object.defineProperty(k,&quot;UnavailablePicker&quot;,{enumerable:!0,get:function(){return vA.UnavailablePicker}});Object.defineProperty(k,&quot;QueuePicker&quot;,{enumerable:!0,get:function(){return vA.QueuePicker}});Object.defineProperty(k,&quot;PickResultType&quot;,{enumerable:!0,get:function(){return vA.PickResultType}});var DEe=yO();Object.defineProperty(k,&quot;BaseFilter&quot;,{enumerable:!0,get:function(){return DEe.BaseFilter}});var UEe=SO();Object.defineProperty(k,&quot;FilterStackFactory&quot;,{enumerable:!0,get:function(){return UEe.FilterStackFactory}});var kEe=Qh();Object.defineProperty(k,&quot;registerAdminService&quot;,{enumerable:!0,get:function(){return kEe.registerAdminService}});var BEe=Z_();Object.defineProperty(k,&quot;BaseSubchannelWrapper&quot;,{enumerable:!0,get:function(){return BEe.BaseSubchannelWrapper}});var f4=iE();Object.defineProperty(k,&quot;createServerCredentialsWithInterceptors&quot;,{enumerable:!0,get:function(){return f4.createServerCredentialsWithInterceptors}});Object.defineProperty(k,&quot;createCertificateProviderServerCredentials&quot;,{enumerable:!0,get:function(){return f4.createCertificateProviderServerCredentials}});var VEe=s4();Object.defineProperty(k,&quot;FileWatcherCertificateProvider&quot;,{enumerable:!0,get:function(){return VEe.FileWatcherCertificateProvider}});var FEe=Oc();Object.defineProperty(k,&quot;createCertificateProviderChannelCredentials&quot;,{enumerable:!0,get:function(){return FEe.createCertificateProviderChannelCredentials}});var GEe=qO();Object.defineProperty(k,&quot;SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX&quot;,{enumerable:!0,get:function(){return GEe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var p4=T(AA=&gt;{&quot;use strict&quot;;Object.defineProperty(AA,&quot;__esModule&quot;,{value:!0});AA.setup=qEe;var HEe=jr(),OA=class{constructor(e,t,o){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===&quot;&quot;?s=&quot;/&quot;+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return&quot;localhost&quot;}};function qEe(){(0,HEe.registerResolver)(&quot;unix&quot;,OA)}});var m4=T(PA=&gt;{&quot;use strict&quot;;Object.defineProperty(PA,&quot;__esModule&quot;,{value:!0});PA.setup=KEe;var d4=V(&quot;net&quot;),dE=ue(),RA=ht(),h4=jr(),_4=Pt(),jEe=Pe(),YEe=&quot;ip_resolver&quot;;function E4(r){jEe.trace(dE.LogVerbosity.DEBUG,YEe,r)}var NA=&quot;ipv4&quot;,CA=&quot;ipv6&quot;,zEe=443,hE=class{constructor(e,t,o){var s;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,E4(&quot;Resolver constructed for target &quot;+(0,_4.uriToString)(e));let a=[];if(!(e.scheme===NA||e.scheme===CA)){this.error={code:dE.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new RA.Metadata};return}let i=e.path.split(&quot;,&quot;);for(let n of i){let l=(0,_4.splitHostPort)(n);if(l===null){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}if(e.scheme===NA&amp;&amp;!(0,d4.isIPv4)(l.host)||e.scheme===CA&amp;&amp;!(0,d4.isIPv6)(l.host)){this.error={code:dE.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new RA.Metadata};return}a.push({host:l.host,port:(s=l.port)!==null&amp;&amp;s!==void 0?s:zEe})}this.endpoints=a.map(n=&gt;({addresses:[n]})),E4(&quot;Parsed &quot;+e.scheme+&quot; address list &quot;+a)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=&gt;{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(&quot;,&quot;)[0]}};function KEe(){(0,h4.registerResolver)(NA,hE),(0,h4.registerResolver)(CA,hE)}});var v4=T(uu=&gt;{&quot;use strict&quot;;Object.defineProperty(uu,&quot;__esModule&quot;,{value:!0});uu.RoundRobinLoadBalancer=void 0;uu.setup=QEe;var g4=so(),yt=rr(),IA=Zn(),$Ee=Pe(),XEe=ue(),T4=nr(),WEe=cE(),JEe=&quot;round_robin&quot;;function S4(r){$Ee.trace(XEe.LogVerbosity.DEBUG,JEe,r)}var _E=&quot;round_robin&quot;,bA=class r{getLoadBalancerName(){return _E}constructor(){}toJsonObject(){return{[_E]:{}}}static createFromJson(e){return new r}},LA=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},EE=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=yt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,g4.createChildChannelControlHelper)(e,{updateState:(t,o,s)=&gt;{this.currentState===yt.ConnectivityState.READY&amp;&amp;t!==yt.ConnectivityState.READY&amp;&amp;this.channelControlHelper.requestReresolution(),s&amp;&amp;(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=&gt;t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(yt.ConnectivityState.READY)&gt;0){let e=this.children.filter(o=&gt;o.getConnectivityState()===yt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(s=&gt;(0,T4.endpointEqual)(s.getEndpoint(),o)),t&lt;0&amp;&amp;(t=0)}this.updateState(yt.ConnectivityState.READY,new LA(e.map(o=&gt;({endpoint:o.getEndpoint(),picker:o.getPicker()})),t),null)}else if(this.countChildrenWithState(yt.ConnectivityState.CONNECTING)&gt;0)this.updateState(yt.ConnectivityState.CONNECTING,new IA.QueuePicker(this),null);else if(this.countChildrenWithState(yt.ConnectivityState.TRANSIENT_FAILURE)&gt;0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(yt.ConnectivityState.TRANSIENT_FAILURE,new IA.UnavailablePicker({details:e}),e)}else this.updateState(yt.ConnectivityState.IDLE,new IA.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===yt.ConnectivityState.IDLE&amp;&amp;e.exitIdle()}}updateState(e,t,o){S4(yt.ConnectivityState[this.currentState]+&quot; -&gt; &quot;+yt.ConnectivityState[e]),e===yt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,o)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,o){this.resetSubchannelList(),S4(&quot;Connect to endpoint list &quot;+e.map(T4.endpointToString)),this.updatesPaused=!0,this.children=e.map(s=&gt;new WEe.LeafLoadBalancer(s,this.childChannelControlHelper,o));for(let s of this.children)s.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return _E}};uu.RoundRobinLoadBalancer=EE;function QEe(){(0,g4.registerLoadBalancerType)(_E,EE,bA)}});var A4=T(No=&gt;{&quot;use strict&quot;;var xA;Object.defineProperty(No,&quot;__esModule&quot;,{value:!0});No.OutlierDetectionLoadBalancer=No.OutlierDetectionLoadBalancingConfig=void 0;No.setup=cme;var ZEe=rr(),y4=ue(),Ro=_A(),O4=yA(),eme=so(),tme=$h(),rme=Zn(),MA=nr(),nme=Z_(),ime=Pe(),ome=&quot;outlier_detection&quot;;function it(r){ime.trace(y4.LogVerbosity.DEBUG,ome,r)}var VA=&quot;outlier_detection&quot;,sme=((xA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&amp;&amp;xA!==void 0?xA:&quot;true&quot;)===&quot;true&quot;,ame={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},lme={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ia(r,e,t,o){if(e in r&amp;&amp;r[e]!==void 0&amp;&amp;typeof r[e]!==t){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${t}, got ${typeof r[e]}`)}}function wA(r,e,t){let o=t?`${t}.${e}`:e;if(e in r&amp;&amp;r[e]!==void 0){if(!(0,Ro.isDuration)(r[e]))throw new Error(`outlier detection config ${o} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds&gt;=0&amp;&amp;r[e].seconds&lt;=315576e6&amp;&amp;r[e].nanos&gt;=0&amp;&amp;r[e].nanos&lt;=999999999))throw new Error(`outlier detection config ${o} parse error: values out of range for non-negative Duaration`)}}function mE(r,e,t){let o=t?`${t}.${e}`:e;if(Ia(r,e,&quot;number&quot;,t),e in r&amp;&amp;r[e]!==void 0&amp;&amp;!(r[e]&gt;=0&amp;&amp;r[e]&lt;=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var fu=class r{constructor(e,t,o,s,a,i,n){if(this.childPolicy=n,n.getLoadBalancerName()===&quot;pick_first&quot;)throw new Error(&quot;outlier_detection LB policy cannot have a pick_first child policy&quot;);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},ame),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},lme),i):null}getLoadBalancerName(){return VA}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ro.msToDuration)(this.intervalMs),base_ejection_time:(0,Ro.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ro.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&amp;&amp;e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&amp;&amp;t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(wA(e,&quot;interval&quot;),wA(e,&quot;base_ejection_time&quot;),wA(e,&quot;max_ejection_time&quot;),mE(e,&quot;max_ejection_percent&quot;),&quot;success_rate_ejection&quot;in e&amp;&amp;e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config success_rate_ejection must be an object&quot;);Ia(e.success_rate_ejection,&quot;stdev_factor&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),mE(e.success_rate_ejection,&quot;enforcement_percentage&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;),Ia(e.success_rate_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;success_rate_ejection&quot;)}if(&quot;failure_percentage_ejection&quot;in e&amp;&amp;e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!=&quot;object&quot;)throw new Error(&quot;outlier detection config failure_percentage_ejection must be an object&quot;);mE(e.failure_percentage_ejection,&quot;threshold&quot;,&quot;failure_percentage_ejection&quot;),mE(e.failure_percentage_ejection,&quot;enforcement_percentage&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;minimum_hosts&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;),Ia(e.failure_percentage_ejection,&quot;request_volume&quot;,&quot;number&quot;,&quot;failure_percentage_ejection&quot;)}if(!(&quot;child_policy&quot;in e)||!Array.isArray(e.child_policy))throw new Error(&quot;outlier detection config child_policy must be an array&quot;);let o=(0,eme.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error(&quot;outlier detection config child_policy: no valid recognized policy found&quot;);return new r(e.interval?(0,Ro.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ro.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ro.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&amp;&amp;t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,o)}};No.OutlierDetectionLoadBalancingConfig=fu;var UA=class extends nme.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount&lt;=0&amp;&amp;this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e&gt;=0&amp;&amp;this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function DA(){return{success:0,failure:0}}var kA=class{constructor(){this.activeBucket=DA(),this.inactiveBucket=DA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=DA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},BA=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===rme.PickResultType.COMPLETE){let o=t.subchannel,s=o.getMapEntry();if(s){let a=t.onCallEnded;return this.countCalls&amp;&amp;(a=i=&gt;{var n;i===y4.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(n=t.onCallEnded)===null||n===void 0||n.call(t,i)}),Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},t),{subchannel:o.getWrappedSubchannel()})}else return t}},TE=class{constructor(e){this.entryMap=new MA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new tme.ChildLoadBalancerHandler((0,O4.createChildChannelControlHelper)(e,{createSubchannel:(t,o)=&gt;{let s=e.createSubchannel(t,o),a=this.entryMap.getForSubchannelAddress(t),i=new UA(s,a);return(a==null?void 0:a.currentEjectionTimestamp)!==null&amp;&amp;i.eject(),a==null||a.subchannelWrappers.push(i),i},updateState:(t,o,s)=&gt;{t===ZEe.ConnectivityState.READY?e.updateState(t,new BA(o,this.isCountingEnabled()),s):e.updateState(t,o,s)}})),this.ejectionTimer=setInterval(()=&gt;{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&amp;&amp;(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&amp;&amp;(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;it(&quot;Running success rate check&quot;);let o=t.request_volume,s=0,a=[];for(let[f,_]of this.entryMap.entries()){let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();it(&quot;Stats for &quot;+(0,MA.endpointToString)(f)+&quot;: successes=&quot;+m+&quot; failures=&quot;+O+&quot; targetRequestVolume=&quot;+o),m+O&gt;=o&amp;&amp;(s+=1,a.push(m/(m+O)))}if(it(&quot;Found &quot;+s+&quot; success rate candidates; currentEjectionPercent=&quot;+this.getCurrentEjectionPercent()+&quot; successRates=[&quot;+a+&quot;]&quot;),s&lt;t.minimum_hosts)return;let i=a.reduce((f,_)=&gt;f+_)/a.length,n=0;for(let f of a){let _=f-i;n+=_*_}let l=n/a.length,c=Math.sqrt(l),u=i-c*(t.stdev_factor/1e3);it(&quot;stdev=&quot;+c+&quot; ejectionThreshold=&quot;+u);for(let[f,_]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let m=_.counter.getLastSuccesses(),O=_.counter.getLastFailures();if(m+O&lt;o)continue;let y=m/(m+O);if(it(&quot;Checking candidate &quot;+f+&quot; successRate=&quot;+y),y&lt;u){let A=Math.random()*100;it(&quot;Candidate &quot;+f+&quot; randomNumber=&quot;+A+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),A&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+f),this.eject(_,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;it(&quot;Running failure percentage check. threshold=&quot;+t.threshold+&quot; request volume threshold=&quot;+t.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i&gt;=t.request_volume&amp;&amp;(o+=1)}if(!(o&lt;t.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()&gt;=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(it(&quot;Candidate successes=&quot;+i+&quot; failures=&quot;+n),i+n&lt;t.request_volume)continue;if(n*100/(n+i)&gt;t.threshold){let c=Math.random()*100;it(&quot;Candidate &quot;+s+&quot; randomNumber=&quot;+c+&quot; enforcement_percentage=&quot;+t.enforcement_percentage),c&lt;t.enforcement_percentage&amp;&amp;(it(&quot;Ejecting candidate &quot;+s),this.eject(a,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,o;this.ejectionTimer=setTimeout(()=&gt;this.runChecks(),e),(o=(t=this.ejectionTimer).unref)===null||o===void 0||o.call(t)}runChecks(){let e=new Date;if(it(&quot;Ejection timer running&quot;),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier&gt;0&amp;&amp;(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i&lt;new Date&amp;&amp;(it(&quot;Unejecting &quot;+t),this.uneject(o))}}}updateAddressList(e,t,o){if(!(t instanceof fu))return;it(&quot;Received update with config: &quot;+JSON.stringify(t.toJsonObject(),void 0,2));for(let a of e)this.entryMap.has(a)||(it(&quot;Adding map entry for &quot;+(0,MA.endpointToString)(a)),this.entryMap.set(a,{counter:new kA,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let s=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,o),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){it(&quot;Previous timer existed. Replacing timer&quot;),clearTimeout(this.ejectionTimer);let a=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else it(&quot;Starting new timer&quot;),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{it(&quot;Counting disabled. Cancelling timer.&quot;),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.entryMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return VA}};No.OutlierDetectionLoadBalancer=TE;function cme(){sme&amp;&amp;(0,O4.registerLoadBalancerType)(VA,TE,fu)}});var pu=T(w=&gt;{&quot;use strict&quot;;Object.defineProperty(w,&quot;__esModule&quot;,{value:!0});w.experimental=w.ServerInterceptingCall=w.ResponderBuilder=w.ServerListenerBuilder=w.addAdminServicesToServer=w.getChannelzHandlers=w.getChannelzServiceDefinition=w.InterceptorConfigurationError=w.InterceptingCall=w.RequesterBuilder=w.ListenerBuilder=w.StatusBuilder=w.getClientChannel=w.ServerCredentials=w.Server=w.setLogVerbosity=w.setLogger=w.load=w.loadObject=w.CallCredentials=w.ChannelCredentials=w.waitForClientReady=w.closeClient=w.Channel=w.makeGenericClientConstructor=w.makeClientConstructor=w.loadPackageDefinition=w.Client=w.compressionAlgorithms=w.propagate=w.connectivityState=w.status=w.logVerbosity=w.Metadata=w.credentials=void 0;var SE=kh();Object.defineProperty(w,&quot;CallCredentials&quot;,{enumerable:!0,get:function(){return SE.CallCredentials}});var ume=ey();Object.defineProperty(w,&quot;Channel&quot;,{enumerable:!0,get:function(){return ume.ChannelImplementation}});var fme=gO();Object.defineProperty(w,&quot;compressionAlgorithms&quot;,{enumerable:!0,get:function(){return fme.CompressionAlgorithms}});var pme=rr();Object.defineProperty(w,&quot;connectivityState&quot;,{enumerable:!0,get:function(){return pme.ConnectivityState}});var gE=Oc();Object.defineProperty(w,&quot;ChannelCredentials&quot;,{enumerable:!0,get:function(){return gE.ChannelCredentials}});var R4=Zv();Object.defineProperty(w,&quot;Client&quot;,{enumerable:!0,get:function(){return R4.Client}});var FA=ue();Object.defineProperty(w,&quot;logVerbosity&quot;,{enumerable:!0,get:function(){return FA.LogVerbosity}});Object.defineProperty(w,&quot;status&quot;,{enumerable:!0,get:function(){return FA.Status}});Object.defineProperty(w,&quot;propagate&quot;,{enumerable:!0,get:function(){return FA.Propagate}});var N4=Pe(),GA=ry();Object.defineProperty(w,&quot;loadPackageDefinition&quot;,{enumerable:!0,get:function(){return GA.loadPackageDefinition}});Object.defineProperty(w,&quot;makeClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});Object.defineProperty(w,&quot;makeGenericClientConstructor&quot;,{enumerable:!0,get:function(){return GA.makeClientConstructor}});var dme=ht();Object.defineProperty(w,&quot;Metadata&quot;,{enumerable:!0,get:function(){return dme.Metadata}});var hme=Zj();Object.defineProperty(w,&quot;Server&quot;,{enumerable:!0,get:function(){return hme.Server}});var _me=iE();Object.defineProperty(w,&quot;ServerCredentials&quot;,{enumerable:!0,get:function(){return _me.ServerCredentials}});var Eme=e4();Object.defineProperty(w,&quot;StatusBuilder&quot;,{enumerable:!0,get:function(){return Eme.StatusBuilder}});w.credentials={combineChannelCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),combineCallCredentials:(r,...e)=&gt;e.reduce((t,o)=&gt;t.compose(o),r),createInsecure:gE.ChannelCredentials.createInsecure,createSsl:gE.ChannelCredentials.createSsl,createFromSecureContext:gE.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SE.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SE.CallCredentials.createFromGoogleCredential,createEmpty:SE.CallCredentials.createEmpty};var mme=r=&gt;r.close();w.closeClient=mme;var Tme=(r,e,t)=&gt;r.waitForReady(e,t);w.waitForClientReady=Tme;var Sme=(r,e)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.loadObject=Sme;var gme=(r,e,t)=&gt;{throw new Error(&quot;Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead&quot;)};w.load=gme;var vme=r=&gt;{N4.setLogger(r)};w.setLogger=vme;var yme=r=&gt;{N4.setLoggerVerbosity(r)};w.setLogVerbosity=yme;var Ome=r=&gt;R4.Client.prototype.getChannel.call(r);w.getClientChannel=Ome;var vE=Wv();Object.defineProperty(w,&quot;ListenerBuilder&quot;,{enumerable:!0,get:function(){return vE.ListenerBuilder}});Object.defineProperty(w,&quot;RequesterBuilder&quot;,{enumerable:!0,get:function(){return vE.RequesterBuilder}});Object.defineProperty(w,&quot;InterceptingCall&quot;,{enumerable:!0,get:function(){return vE.InterceptingCall}});Object.defineProperty(w,&quot;InterceptorConfigurationError&quot;,{enumerable:!0,get:function(){return vE.InterceptorConfigurationError}});var C4=_o();Object.defineProperty(w,&quot;getChannelzServiceDefinition&quot;,{enumerable:!0,get:function(){return C4.getChannelzServiceDefinition}});Object.defineProperty(w,&quot;getChannelzHandlers&quot;,{enumerable:!0,get:function(){return C4.getChannelzHandlers}});var Ame=Qh();Object.defineProperty(w,&quot;addAdminServicesToServer&quot;,{enumerable:!0,get:function(){return Ame.addAdminServicesToServer}});var HA=uA();Object.defineProperty(w,&quot;ServerListenerBuilder&quot;,{enumerable:!0,get:function(){return HA.ServerListenerBuilder}});Object.defineProperty(w,&quot;ResponderBuilder&quot;,{enumerable:!0,get:function(){return HA.ResponderBuilder}});Object.defineProperty(w,&quot;ServerInterceptingCall&quot;,{enumerable:!0,get:function(){return HA.ServerInterceptingCall}});var Rme=yA();w.experimental=Rme;var Nme=oO(),Cme=p4(),Pme=m4(),Ime=cE(),bme=v4(),Lme=A4(),xme=_o();Nme.setup(),Cme.setup(),Pme.setup(),Ime.setup(),bme.setup(),Lme.setup(),xme.setup()});var P4=T(yE=&gt;{&quot;use strict&quot;;Object.defineProperty(yE,&quot;__esModule&quot;,{value:!0});yE.createServiceClientConstructor=void 0;var Mme=pu();function wme(r,e){let t={export:{path:r,requestStream:!1,responseStream:!1,requestSerialize:o=&gt;o,requestDeserialize:o=&gt;o,responseSerialize:o=&gt;o,responseDeserialize:o=&gt;o}};return Mme.makeGenericClientConstructor(t,e)}yE.createServiceClientConstructor=wme});var du=T(lr=&gt;{&quot;use strict&quot;;Object.defineProperty(lr,&quot;__esModule&quot;,{value:!0});lr.createOtlpGrpcExporterTransport=lr.GrpcExporterTransport=lr.createEmptyMetadata=lr.createSslCredentials=lr.createInsecureCredentials=void 0;var Dme=0,Ume=2;function kme(r){return r===&quot;gzip&quot;?Ume:Dme}function Bme(){let{credentials:r}=pu();return r.createInsecure()}lr.createInsecureCredentials=Bme;function Vme(r,e,t){let{credentials:o}=pu();return o.createSsl(r,e,t)}lr.createSslCredentials=Vme;function Fme(){let{Metadata:r}=pu();return new r}lr.createEmptyMetadata=Fme;var OE=class{constructor(e){this._parameters=e}shutdown(){var e;(e=this._client)===null||e===void 0||e.close()}send(e,t){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=P4();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{&quot;grpc.default_compression_algorithm&quot;:kme(this._parameters.compression)})}catch(i){return Promise.resolve({status:&quot;failure&quot;,error:i})}}return new Promise(s=&gt;{let a=Date.now()+t;if(this._metadata==null)return s({error:new Error(&quot;metadata was null&quot;),status:&quot;failure&quot;});this._client.export(o,this._metadata,{deadline:a},(i,n)=&gt;{s(i?{status:&quot;failure&quot;,error:i}:{data:n,status:&quot;success&quot;})})})}};lr.GrpcExporterTransport=OE;function Gme(r){return new OE(r)}lr.createOtlpGrpcExporterTransport=Gme});var I4=T(AE=&gt;{&quot;use strict&quot;;Object.defineProperty(AE,&quot;__esModule&quot;,{value:!0});AE.VERSION=void 0;AE.VERSION=&quot;0.56.0&quot;});var w4=T(pi=&gt;{&quot;use strict&quot;;Object.defineProperty(pi,&quot;__esModule&quot;,{value:!0});pi.getOtlpGrpcDefaultConfiguration=pi.mergeOtlpGrpcConfigurationWithDefaults=pi.validateAndNormalizeUrl=void 0;var x4=(_n(),ee(hc)),hu=du(),Hme=I4(),qme=V(&quot;url&quot;),b4=(P(),ee(ot));function M4(r){var e;r=r.trim(),r.match(/^([\w]{1,8}):\/\//)||(r=`https://${r}`);let o=new qme.URL(r);return o.protocol===&quot;unix:&quot;?r:(o.pathname&amp;&amp;o.pathname!==&quot;/&quot;&amp;&amp;b4.diag.warn(&quot;URL path should not be set when using grpc, the path part of the URL will be ignored.&quot;),o.protocol!==&quot;&quot;&amp;&amp;!(!((e=o.protocol)===null||e===void 0)&amp;&amp;e.match(/^(http)s?:$/))&amp;&amp;b4.diag.warn(&quot;URL protocol should be http(s)://. Using http://.&quot;),o.host)}pi.validateAndNormalizeUrl=M4;function L4(r,e){for(let[t,o]of Object.entries(e.getMap()))r.get(t).length&lt;1&amp;&amp;r.set(t,o)}function jme(r,e,t){var o,s,a,i,n;let l=(s=(o=r.url)!==null&amp;&amp;o!==void 0?o:e.url)!==null&amp;&amp;s!==void 0?s:t.url;return Object.assign(Object.assign({},(0,x4.mergeOtlpSharedConfigurationWithDefaults)(r,e,t)),{metadata:()=&gt;{var c,u,f,_;let m=t.metadata();return L4(m,(u=(c=r.metadata)===null||c===void 0?void 0:c.call(r).clone())!==null&amp;&amp;u!==void 0?u:(0,hu.createEmptyMetadata)()),L4(m,(_=(f=e.metadata)===null||f===void 0?void 0:f.call(e))!==null&amp;&amp;_!==void 0?_:(0,hu.createEmptyMetadata)()),m},url:M4(l),credentials:(n=(a=r.credentials)!==null&amp;&amp;a!==void 0?a:(i=e.credentials)===null||i===void 0?void 0:i.call(e,l))!==null&amp;&amp;n!==void 0?n:t.credentials(l)})}pi.mergeOtlpGrpcConfigurationWithDefaults=jme;function Yme(){return Object.assign(Object.assign({},(0,x4.getSharedConfigurationDefaults)()),{metadata:()=&gt;{let r=(0,hu.createEmptyMetadata)();return r.set(&quot;User-Agent&quot;,`OTel-OTLP-Exporter-JavaScript/${Hme.VERSION}`),r},url:&quot;http://localhost:4317&quot;,credentials:r=&gt;r.startsWith(&quot;http://&quot;)?()=&gt;(0,hu.createInsecureCredentials)():()=&gt;(0,hu.createSslCredentials)()})}pi.getOtlpGrpcDefaultConfiguration=Yme});function RE(r){return r.setValue(qA,!0)}function D4(r){return r.deleteValue(qA)}function ba(r){return r.getValue(qA)===!0}var qA,_u=p(()=&gt;{P();qA=De(&quot;OpenTelemetry SDK Context Key SUPPRESS_TRACING&quot;)});var NE,U4=p(()=&gt;{NE=&quot;baggage&quot;});function PE(r){return r.reduce((e,t)=&gt;{let o=`${e}${e!==&quot;&quot;?&quot;,&quot;:&quot;&quot;}${t}`;return o.length&gt;8192?e:o},&quot;&quot;)}function IE(r){return r.getAllEntries().map(([e,t])=&gt;{let o=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&amp;&amp;(o+=&quot;;&quot;+t.metadata.toString()),o})}function Eu(r){let e=r.split(&quot;;&quot;);if(e.length&lt;=0)return;let t=e.shift();if(!t)return;let o=t.indexOf(&quot;=&quot;);if(o&lt;=0)return;let s=decodeURIComponent(t.substring(0,o).trim()),a=decodeURIComponent(t.substring(o+1).trim()),i;return e.length&gt;0&amp;&amp;(i=Lr(e.join(&quot;;&quot;))),{key:s,value:a,metadata:i}}function B4(r){return typeof r!=&quot;string&quot;||r.length===0?{}:r.split(&quot;,&quot;).map(e=&gt;Eu(e)).filter(e=&gt;e!==void 0&amp;&amp;e.value.length&gt;0).reduce((e,t)=&gt;(e[t.key]=t.value,e),{})}var jA=p(()=&gt;{P()});var bE,V4=p(()=&gt;{P();_u();U4();jA();bE=class{inject(e,t,o){let s=Ue.getBaggage(e);if(!s||ba(e))return;let a=IE(s).filter(n=&gt;n.length&lt;=4096).slice(0,180),i=PE(a);i.length&gt;0&amp;&amp;o.set(t,NE,i)}extract(e,t,o){let s=o.get(t,NE),a=Array.isArray(s)?s.join(&quot;,&quot;):s;if(!a)return e;let i={};return a.length===0||(a.split(&quot;,&quot;).forEach(l=&gt;{let c=Eu(l);if(c){let u={value:c.value};c.metadata&amp;&amp;(u.metadata=c.metadata),i[c.key]=u}}),Object.entries(i).length===0)?e:Ue.setBaggage(e,Ue.createBaggage(i))}fields(){return[NE]}}});var LE,F4=p(()=&gt;{LE=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function G4(r){let e={};if(typeof r!=&quot;object&quot;||r==null)return e;for(let[t,o]of Object.entries(r)){if(!YA(t)){S.warn(`Invalid attribute key: ${t}`);continue}if(!zA(o)){S.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(o)?e[t]=o.slice():e[t]=o}return e}function YA(r){return typeof r==&quot;string&quot;&amp;&amp;r.length&gt;0}function zA(r){return r==null?!0:Array.isArray(r)?$me(r):H4(r)}function $me(r){let e;for(let t of r)if(t!=null){if(!e){if(H4(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function H4(r){switch(typeof r){case&quot;number&quot;:case&quot;boolean&quot;:case&quot;string&quot;:return!0}return!1}var q4=p(()=&gt;{P()});function xE(){return r=&gt;{S.error(Xme(r))}}function Xme(r){return typeof r==&quot;string&quot;?r:JSON.stringify(Wme(r))}function Wme(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(o=&gt;{if(e[o])return;let s=t[o];s&amp;&amp;(e[o]=String(s))}),t=Object.getPrototypeOf(t);return e}var KA=p(()=&gt;{P()});function Y4(r){j4=r}function ME(r){try{j4(r)}catch{}}var j4,$A=p(()=&gt;{KA();j4=xE()});var La,XA=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(La||(La={}))});function Zme(r){return Qme.indexOf(r)&gt;-1}function tTe(r){return eTe.indexOf(r)&gt;-1}function nTe(r){return rTe.indexOf(r)&gt;-1}function iTe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function oTe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function sTe(r,e,t,o=Jme){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function lTe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=aTe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function gu(r){let e={};for(let t in Su){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:lTe(o,e,r);break;default:if(Zme(o))iTe(o,e,r);else if(tTe(o))oTe(o,e,r);else if(nTe(o))sTe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var Jme,Qme,eTe,rTe,mu,Tu,WA,JA,Su,aTe,QA=p(()=&gt;{P();XA();Jme=&quot;,&quot;,Qme=[&quot;OTEL_SDK_DISABLED&quot;];eTe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];rTe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];mu=1/0,Tu=128,WA=128,JA=128,Su={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mu,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tu,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:WA,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:JA,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:La.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};aTe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function wE(){let r=gu(process.env);return Object.assign({},Su,r)}function DE(){return gu(process.env)}var z4=p(()=&gt;{QA()});var UE,K4=p(()=&gt;{UE=typeof globalThis==&quot;object&quot;?globalThis:global});function $4(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function kE(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=$4(r.charCodeAt(o)),a=$4(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var ZA=p(()=&gt;{});function BE(r){return Buffer.from(kE(r)).toString(&quot;base64&quot;)}var X4=p(()=&gt;{ZA()});function W4(r){return function(){for(let t=0;t&lt;r/4;t++)VE.writeUInt32BE(Math.random()*2**32&gt;&gt;&gt;0,t*4);for(let t=0;t&lt;r&amp;&amp;!(VE[t]&gt;0);t++)t===r-1&amp;&amp;(VE[r-1]=1);return VE.toString(&quot;hex&quot;,0,r)}}var xa,VE,J4=p(()=&gt;{xa=class{constructor(){this.generateTraceId=W4(16),this.generateSpanId=W4(8)}},VE=Buffer.allocUnsafe(16)});import{performance as cTe}from&quot;perf_hooks&quot;;var di,Q4=p(()=&gt;{di=cTe});var FE,eR=p(()=&gt;{FE=&quot;1.29.0&quot;});var GE,Z4=p(()=&gt;{eR();Ve();GE={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:FE}});function HE(r){r.unref()}var e6=p(()=&gt;{});var t6=p(()=&gt;{z4();K4();X4();J4();Q4();Z4();e6()});var tR=p(()=&gt;{t6()});function Ma(r){let e=r/1e3,t=Math.trunc(e),o=Math.round(r%1e3*fTe);return[t,o]}function jE(){let r=di.timeOrigin;if(typeof r!=&quot;number&quot;){let e=di;r=e.timing&amp;&amp;e.timing.fetchStart}return r}function rR(r){let e=Ma(jE()),t=Ma(typeof r==&quot;number&quot;?r:di.now());return nR(e,t)}function n6(r){if(YE(r))return r;if(typeof r==&quot;number&quot;)return r&lt;jE()?rR(r):Ma(r);if(r instanceof Date)return Ma(r.getTime());throw TypeError(&quot;Invalid input type&quot;)}function i6(r,e){let t=e[0]-r[0],o=e[1]-r[1];return o&lt;0&amp;&amp;(t-=1,o+=qE),[t,o]}function o6(r){let e=r6,t=`${&quot;0&quot;.repeat(e)}${r[1]}Z`,o=t.substring(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace(&quot;000Z&quot;,o)}function s6(r){return r[0]*qE+r[1]}function a6(r){return r[0]*1e3+r[1]/1e6}function l6(r){return r[0]*1e6+r[1]/1e3}function YE(r){return Array.isArray(r)&amp;&amp;r.length===2&amp;&amp;typeof r[0]==&quot;number&quot;&amp;&amp;typeof r[1]==&quot;number&quot;}function c6(r){return YE(r)||typeof r==&quot;number&quot;||r instanceof Date}function nR(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]&gt;=qE&amp;&amp;(t[1]-=qE,t[0]+=1),t}var r6,uTe,fTe,qE,u6=p(()=&gt;{tR();r6=9,uTe=6,fTe=Math.pow(10,uTe),qE=Math.pow(10,r6)});var zE,f6=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(zE||(zE={}))});var KE,p6=p(()=&gt;{P();KE=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&amp;&amp;t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(o=&gt;typeof o.fields==&quot;function&quot;?o.fields():[]).reduce((o,s)=&gt;o.concat(s),[])))}inject(e,t,o){for(let s of this._propagators)try{s.inject(e,t,o)}catch(a){S.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,t,o){return this._propagators.reduce((s,a)=&gt;{try{return a.extract(s,t,o)}catch(i){S.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}}});function d6(r){return hTe.test(r)}function h6(r){return _Te.test(r)&amp;&amp;!ETe.test(r)}var iR,pTe,dTe,hTe,_Te,ETe,_6=p(()=&gt;{iR=&quot;[_0-9a-z-*/]&quot;,pTe=`[a-z]${iR}{0,255}`,dTe=`[a-z0-9]${iR}{0,240}@[a-z]${iR}{0,13}`,hTe=new RegExp(`^(?:${pTe}|${dTe})$`),_Te=/^[ -~]{0,255}[!-~]$/,ETe=/,|=/});var E6,mTe,m6,T6,wa,oR=p(()=&gt;{_6();E6=32,mTe=512,m6=&quot;,&quot;,T6=&quot;=&quot;,wa=class r{constructor(e){this._internalState=new Map,e&amp;&amp;this._parse(e)}set(e,t){let o=this._clone();return o._internalState.has(e)&amp;&amp;o._internalState.delete(e),o._internalState.set(e,t),o}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=&gt;(e.push(t+T6+this.get(t)),e),[]).join(m6)}_parse(e){e.length&gt;mTe||(this._internalState=e.split(m6).reverse().reduce((t,o)=&gt;{let s=o.trim(),a=s.indexOf(T6);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);d6(i)&amp;&amp;h6(n)&amp;&amp;t.set(i,n)}return t},new Map),this._internalState.size&gt;E6&amp;&amp;(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,E6))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}}});function sR(r){let e=OTe.exec(r);return!e||e[1]===&quot;00&quot;&amp;&amp;e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var vu,yu,TTe,STe,gTe,vTe,yTe,OTe,$E,S6=p(()=&gt;{P();_u();oR();vu=&quot;traceparent&quot;,yu=&quot;tracestate&quot;,TTe=&quot;00&quot;,STe=&quot;(?!ff)[\\da-f]{2}&quot;,gTe=&quot;(?![0]{32})[\\da-f]{32}&quot;,vTe=&quot;(?![0]{16})[\\da-f]{16}&quot;,yTe=&quot;[\\da-f]{2}&quot;,OTe=new RegExp(`^\\s?(${STe})-(${gTe})-(${vTe})-(${yTe})(-.*)?\\s?$`);$E=class{inject(e,t,o){let s=ie.getSpanContext(e);if(!s||ba(e)||!xe(s))return;let a=`${TTe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||se.NONE).toString(16)}`;o.set(t,vu,a),s.traceState&amp;&amp;o.set(t,yu,s.traceState.serialize())}extract(e,t,o){let s=o.get(t,vu);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!=&quot;string&quot;)return e;let i=sR(a);if(!i)return e;i.isRemote=!0;let n=o.get(t,yu);if(n){let l=Array.isArray(n)?n.join(&quot;,&quot;):n;i.traceState=new wa(typeof l==&quot;string&quot;?l:void 0)}return ie.setSpanContext(e,i)}fields(){return[vu,yu]}}});function g6(r,e){return r.setValue(aR,e)}function v6(r){return r.deleteValue(aR)}function y6(r){return r.getValue(aR)}var aR,XE,O6=p(()=&gt;{P();aR=De(&quot;OpenTelemetry SDK Context Key RPC_METADATA&quot;);(function(r){r.HTTP=&quot;http&quot;})(XE||(XE={}))});var Co,lR=p(()=&gt;{P();Co=class{shouldSample(){return{decision:ke.NOT_RECORD}}toString(){return&quot;AlwaysOffSampler&quot;}}});var hi,cR=p(()=&gt;{P();hi=class{shouldSample(){return{decision:ke.RECORD_AND_SAMPLED}}toString(){return&quot;AlwaysOnSampler&quot;}}});var WE,A6=p(()=&gt;{P();$A();lR();cR();WE=class{constructor(e){var t,o,s,a;this._root=e.root,this._root||(ME(new Error(&quot;ParentBasedSampler must have a root sampler configured&quot;)),this._root=new hi),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&amp;&amp;t!==void 0?t:new hi,this._remoteParentNotSampled=(o=e.remoteParentNotSampled)!==null&amp;&amp;o!==void 0?o:new Co,this._localParentSampled=(s=e.localParentSampled)!==null&amp;&amp;s!==void 0?s:new hi,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&amp;&amp;a!==void 0?a:new Co}shouldSample(e,t,o,s,a,i){let n=ie.getSpanContext(e);return!n||!xe(n)?this._root.shouldSample(e,t,o,s,a,i):n.isRemote?n.traceFlags&amp;se.SAMPLED?this._remoteParentSampled.shouldSample(e,t,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,t,o,s,a,i):n.traceFlags&amp;se.SAMPLED?this._localParentSampled.shouldSample(e,t,o,s,a,i):this._localParentNotSampled.shouldSample(e,t,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}});var JE,R6=p(()=&gt;{P();JE=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Mt(t)&amp;&amp;this._accumulate(t)&lt;this._upperBound?ke.RECORD_AND_SAMPLED:ke.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=&quot;number&quot;||isNaN(e)?0:e&gt;=1?1:e&lt;=0?0:e}_accumulate(e){let t=0;for(let o=0;o&lt;e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);t=(t^a)&gt;&gt;&gt;0}return t}}});function bTe(r,e){return function(t){return r(e(t))}}function uR(r){if(!LTe(r)||xTe(r)!==ATe)return!1;let e=ITe(r);if(e===null)return!0;let t=P6.call(e,&quot;constructor&quot;)&amp;&amp;e.constructor;return typeof t==&quot;function&quot;&amp;&amp;t instanceof t&amp;&amp;N6.call(t)===PTe}function LTe(r){return r!=null&amp;&amp;typeof r==&quot;object&quot;}function xTe(r){return r==null?r===void 0?NTe:RTe:Po&amp;&amp;Po in Object(r)?MTe(r):wTe(r)}function MTe(r){let e=P6.call(r,Po),t=r[Po],o=!1;try{r[Po]=void 0,o=!0}catch{}let s=I6.call(r);return o&amp;&amp;(e?r[Po]=t:delete r[Po]),s}function wTe(r){return I6.call(r)}var ATe,RTe,NTe,CTe,N6,PTe,ITe,C6,P6,Po,I6,b6=p(()=&gt;{ATe=&quot;[object Object]&quot;,RTe=&quot;[object Null]&quot;,NTe=&quot;[object Undefined]&quot;,CTe=Function.prototype,N6=CTe.toString,PTe=N6.call(Object),ITe=bTe(Object.getPrototypeOf,Object),C6=Object.prototype,P6=C6.hasOwnProperty,Po=Symbol?Symbol.toStringTag:void 0,I6=C6.toString});function x6(...r){let e=r.shift(),t=new WeakMap;for(;r.length&gt;0;)e=M6(e,r.shift(),0,t);return e}function fR(r){return ZE(r)?r.slice():r}function M6(r,e,t=0,o){let s;if(!(t&gt;DTe)){if(t++,QE(r)||QE(e)||w6(e))s=fR(e);else if(ZE(r)){if(s=r.slice(),ZE(e))for(let a=0,i=e.length;a&lt;i;a++)s.push(fR(e[a]));else if(Ou(e)){let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i];s[l]=fR(e[l])}}}else if(Ou(r))if(Ou(e)){if(!UTe(r,e))return e;s=Object.assign({},r);let a=Object.keys(e);for(let i=0,n=a.length;i&lt;n;i++){let l=a[i],c=e[l];if(QE(c))typeof c&gt;&quot;u&quot;?delete s[l]:s[l]=c;else{let u=s[l],f=c;if(L6(r,l,o)||L6(e,l,o))delete s[l];else{if(Ou(u)&amp;&amp;Ou(f)){let _=o.get(u)||[],m=o.get(f)||[];_.push({obj:r,key:l}),m.push({obj:e,key:l}),o.set(u,_),o.set(f,m)}s[l]=M6(s[l],c,t,o)}}}}else s=e;return s}}function L6(r,e,t){let o=t.get(r[e])||[];for(let s=0,a=o.length;s&lt;a;s++){let i=o[s];if(i.key===e&amp;&amp;i.obj===r)return!0}return!1}function ZE(r){return Array.isArray(r)}function w6(r){return typeof r==&quot;function&quot;}function Ou(r){return!QE(r)&amp;&amp;!ZE(r)&amp;&amp;!w6(r)&amp;&amp;typeof r==&quot;object&quot;}function QE(r){return typeof r==&quot;string&quot;||typeof r==&quot;number&quot;||typeof r==&quot;boolean&quot;||typeof r&gt;&quot;u&quot;||r instanceof Date||r instanceof RegExp||r===null}function UTe(r,e){return!(!uR(r)||!uR(e))}var DTe,D6=p(()=&gt;{b6();DTe=20});function U6(r,e){let t,o=new Promise(function(a,i){t=setTimeout(function(){i(new Au(&quot;Operation timed out.&quot;))},e)});return Promise.race([r,o]).then(s=&gt;(clearTimeout(t),s),s=&gt;{throw clearTimeout(t),s})}var Au,k6=p(()=&gt;{Au=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}});function pR(r,e){return typeof e==&quot;string&quot;?r===e:!!r.match(e)}function B6(r,e){if(!e)return!1;for(let t of e)if(pR(r,t))return!0;return!1}var V6=p(()=&gt;{});function F6(r){return typeof r==&quot;function&quot;&amp;&amp;typeof r.__original==&quot;function&quot;&amp;&amp;typeof r.__unwrap==&quot;function&quot;&amp;&amp;r.__wrapped===!0}var G6=p(()=&gt;{});var em,H6=p(()=&gt;{em=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var tm,q6=p(()=&gt;{H6();tm=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new em}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}});function j6(r,e){return new Promise(t=&gt;{he.with(RE(he.active()),()=&gt;{r.export(e,o=&gt;{t(o)})})})}var Y6=p(()=&gt;{P();_u()});var z6={};Ae(z6,{AlwaysOffSampler:()=&gt;Co,AlwaysOnSampler:()=&gt;hi,AnchoredClock:()=&gt;LE,BindOnceFuture:()=&gt;tm,CompositePropagator:()=&gt;KE,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=&gt;Tu,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=&gt;mu,DEFAULT_ENVIRONMENT:()=&gt;Su,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=&gt;WA,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=&gt;JA,ExportResultCode:()=&gt;zE,ParentBasedSampler:()=&gt;WE,RPCType:()=&gt;XE,RandomIdGenerator:()=&gt;xa,SDK_INFO:()=&gt;GE,TRACE_PARENT_HEADER:()=&gt;vu,TRACE_STATE_HEADER:()=&gt;yu,TimeoutError:()=&gt;Au,TraceIdRatioBasedSampler:()=&gt;JE,TraceState:()=&gt;wa,TracesSamplerValues:()=&gt;La,VERSION:()=&gt;FE,W3CBaggagePropagator:()=&gt;bE,W3CTraceContextPropagator:()=&gt;$E,_globalThis:()=&gt;UE,addHrTimes:()=&gt;nR,baggageUtils:()=&gt;kTe,callWithTimeout:()=&gt;U6,deleteRPCMetadata:()=&gt;v6,getEnv:()=&gt;wE,getEnvWithoutDefaults:()=&gt;DE,getRPCMetadata:()=&gt;y6,getTimeOrigin:()=&gt;jE,globalErrorHandler:()=&gt;ME,hexToBase64:()=&gt;BE,hexToBinary:()=&gt;kE,hrTime:()=&gt;rR,hrTimeDuration:()=&gt;i6,hrTimeToMicroseconds:()=&gt;l6,hrTimeToMilliseconds:()=&gt;a6,hrTimeToNanoseconds:()=&gt;s6,hrTimeToTimeStamp:()=&gt;o6,internal:()=&gt;BTe,isAttributeKey:()=&gt;YA,isAttributeValue:()=&gt;zA,isTimeInput:()=&gt;c6,isTimeInputHrTime:()=&gt;YE,isTracingSuppressed:()=&gt;ba,isUrlIgnored:()=&gt;B6,isWrapped:()=&gt;F6,loggingErrorHandler:()=&gt;xE,merge:()=&gt;x6,millisToHrTime:()=&gt;Ma,otperformance:()=&gt;di,parseEnvironment:()=&gt;gu,parseTraceParent:()=&gt;sR,sanitizeAttributes:()=&gt;G4,setGlobalErrorHandler:()=&gt;Y4,setRPCMetadata:()=&gt;g6,suppressTracing:()=&gt;RE,timeInputToHrTime:()=&gt;n6,unrefTimer:()=&gt;HE,unsuppressTracing:()=&gt;D4,urlMatches:()=&gt;pR});var kTe,BTe,K6=p(()=&gt;{V4();F4();q4();$A();KA();u6();ZA();f6();jA();tR();p6();S6();O6();lR();cR();A6();R6();_u();oR();QA();D6();XA();k6();V6();G6();q6();eR();Y6();kTe={getKeyPairs:IE,serializeKeyPairs:PE,parseKeyPairsIntoRecord:B4,parsePairKeyValue:Eu},BTe={_export:j6}});var Q6=T(rm=&gt;{&quot;use strict&quot;;Object.defineProperty(rm,&quot;__esModule&quot;,{value:!0});rm.getOtlpGrpcConfigurationFromEnv=void 0;var $6=(K6(),ee(z6)),Ru=du(),VTe=(Js(),ee(C3)),FTe=V(&quot;fs&quot;),GTe=V(&quot;path&quot;),W6=(P(),ee(ot));function dR(r,e){if(r!=null&amp;&amp;r!==&quot;&quot;)return r;if(e!=null&amp;&amp;e!==&quot;&quot;)return e}function HTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_HEADERS`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_HEADERS)===null||t===void 0?void 0:t.trim(),a=$6.baggageUtils.parseKeyPairsIntoRecord(o),i=$6.baggageUtils.parseKeyPairsIntoRecord(s);if(Object.keys(a).length===0&amp;&amp;Object.keys(i).length===0)return;let n=Object.assign({},i,a),l=(0,Ru.createEmptyMetadata)();for(let[c,u]of Object.entries(n))l.set(c,u);return l}function qTe(r){let e=HTe(r);if(e!=null)return()=&gt;e}function jTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_ENDPOINT`])===null||e===void 0?void 0:e.trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT)===null||t===void 0?void 0:t.trim();return dR(o,s)}function YTe(r){var e,t;let o=(e=process.env[`OTEL_EXPORTER_OTLP_${r}_INSECURE`])===null||e===void 0?void 0:e.toLowerCase().trim(),s=(t=process.env.OTEL_EXPORTER_OTLP_INSECURE)===null||t===void 0?void 0:t.toLowerCase().trim();return dR(o,s)===&quot;true&quot;}function hR(r,e,t){var o,s;let a=(o=process.env[r])===null||o===void 0?void 0:o.trim(),i=(s=process.env[e])===null||s===void 0?void 0:s.trim(),n=dR(a,i);if(n!=null)try{return FTe.readFileSync(GTe.resolve(process.cwd(),n))}catch{W6.diag.warn(t);return}else return}function zTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE&quot;,&quot;Failed to read client certificate chain file&quot;)}function KTe(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CLIENT_KEY`,&quot;OTEL_EXPORTER_OTLP_CLIENT_KEY&quot;,&quot;Failed to read client certificate private key file&quot;)}function X6(r){return hR(`OTEL_EXPORTER_OTLP_${r}_CERTIFICATE`,&quot;OTEL_EXPORTER_OTLP_CERTIFICATE&quot;,&quot;Failed to read root certificate file&quot;)}function J6(r){let e=KTe(r),t=zTe(r),o=X6(r),s=e!=null&amp;&amp;t!=null;return o!=null&amp;&amp;!s?(W6.diag.warn(&quot;Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate&quot;),(0,Ru.createSslCredentials)(X6(r))):(0,Ru.createSslCredentials)(o,e,t)}function $Te(r){return YTe(r)?(0,Ru.createInsecureCredentials)():J6(r)}function XTe(r){return Object.assign(Object.assign({},(0,VTe.getSharedConfigurationFromEnvironment)(r)),{metadata:qTe(r),url:jTe(r),credentials:e=&gt;e.startsWith(&quot;http://&quot;)?()=&gt;(0,Ru.createInsecureCredentials)():e.startsWith(&quot;https://&quot;)?()=&gt;J6(r):()=&gt;$Te(r)})}rm.getOtlpGrpcConfigurationFromEnv=XTe});var eY=T(nm=&gt;{&quot;use strict&quot;;Object.defineProperty(nm,&quot;__esModule&quot;,{value:!0});nm.convertLegacyOtlpGrpcOptions=void 0;var WTe=(P(),ee(ot)),Z6=w4(),JTe=du(),QTe=Q6();function ZTe(r,e){r.headers&amp;&amp;WTe.diag.warn(&quot;Headers cannot be set when using grpc&quot;);let t=r.credentials;return(0,Z6.mergeOtlpGrpcConfigurationWithDefaults)({url:r.url,metadata:()=&gt;{var o;return(o=r.metadata)!==null&amp;&amp;o!==void 0?o:(0,JTe.createEmptyMetadata)()},compression:r.compression,timeoutMillis:r.timeoutMillis,concurrencyLimit:r.concurrencyLimit,credentials:t!=null?()=&gt;t:void 0},(0,QTe.getOtlpGrpcConfigurationFromEnv)(e),(0,Z6.getOtlpGrpcDefaultConfiguration)())}nm.convertLegacyOtlpGrpcOptions=ZTe});var tY=T(im=&gt;{&quot;use strict&quot;;Object.defineProperty(im,&quot;__esModule&quot;,{value:!0});im.createOtlpGrpcExportDelegate=void 0;var eSe=(_n(),ee(hc)),tSe=du();function rSe(r,e,t,o){return(0,eSe.createOtlpNetworkExportDelegate)(r,e,(0,tSe.createOtlpGrpcExporterTransport)({address:r.url,compression:r.compression,credentials:r.credentials,metadata:r.metadata,grpcName:t,grpcPath:o}))}im.createOtlpGrpcExportDelegate=rSe});var _R=T(Da=&gt;{&quot;use strict&quot;;Object.defineProperty(Da,&quot;__esModule&quot;,{value:!0});Da.createOtlpGrpcExportDelegate=Da.convertLegacyOtlpGrpcOptions=void 0;var nSe=eY();Object.defineProperty(Da,&quot;convertLegacyOtlpGrpcOptions&quot;,{enumerable:!0,get:function(){return nSe.convertLegacyOtlpGrpcOptions}});var iSe=tY();Object.defineProperty(Da,&quot;createOtlpGrpcExportDelegate&quot;,{enumerable:!0,get:function(){return iSe.createOtlpGrpcExportDelegate}})});var nY=T(om=&gt;{&quot;use strict&quot;;Object.defineProperty(om,&quot;__esModule&quot;,{value:!0});om.OTLPLogExporter=void 0;var rY=_R(),oSe=(to(),ee(av)),sSe=(_n(),ee(hc)),ER=class extends sSe.OTLPExporterBase{constructor(e={}){super((0,rY.createOtlpGrpcExportDelegate)((0,rY.convertLegacyOtlpGrpcOptions)(e,&quot;LOGS&quot;),oSe.ProtobufLogsSerializer,&quot;LogsExportService&quot;,&quot;/opentelemetry.proto.collector.logs.v1.LogsService/Export&quot;))}};om.OTLPLogExporter=ER});var iY=T(Io=&gt;{&quot;use strict&quot;;var aSe=Io&amp;&amp;Io.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),lSe=Io&amp;&amp;Io.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;aSe(e,r,t)};Object.defineProperty(Io,&quot;__esModule&quot;,{value:!0});lSe(nY(),Io)});var oY,sY=p(()=&gt;{oY=&quot;0.56.0&quot;});var Ua,aY=p(()=&gt;{_n();to();Js();sY();Ua=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;LOGS&quot;,&quot;v1/logs&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${oY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Ah))}}});var lY=p(()=&gt;{aY()});var cY=p(()=&gt;{lY()});var uY={};Ae(uY,{OTLPLogExporter:()=&gt;Ua});var fY=p(()=&gt;{cY()});var pY,dY=p(()=&gt;{pY=&quot;0.56.0&quot;});var ka,hY=p(()=&gt;{_n();to();dY();Js();ka=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${pY}`,&quot;Content-Type&quot;:&quot;application/x-protobuf&quot;}),Rh))}}});var _Y=p(()=&gt;{hY()});var EY=p(()=&gt;{_Y()});var mY={};Ae(mY,{OTLPTraceExporter:()=&gt;ka});var TY=p(()=&gt;{EY()});var SY,gY=p(()=&gt;{SY=&quot;0.56.0&quot;});var mR,vY=p(()=&gt;{_n();gY();to();Js();mR=class extends Br{constructor(e={}){super(Hr(qr(e,&quot;TRACES&quot;,&quot;v1/traces&quot;,{&quot;User-Agent&quot;:`OTel-OTLP-Exporter-JavaScript/${SY}`,&quot;Content-Type&quot;:&quot;application/json&quot;}),Nh))}}});var yY=p(()=&gt;{vY()});var OY=p(()=&gt;{yY()});var AY={};Ae(AY,{OTLPTraceExporter:()=&gt;mR});var RY=p(()=&gt;{OY()});var CY=T(sm=&gt;{&quot;use strict&quot;;Object.defineProperty(sm,&quot;__esModule&quot;,{value:!0});sm.OTLPTraceExporter=void 0;var NY=_R(),cSe=(to(),ee(av)),uSe=(_n(),ee(hc)),TR=class extends uSe.OTLPExporterBase{constructor(e={}){super((0,NY.createOtlpGrpcExportDelegate)((0,NY.convertLegacyOtlpGrpcOptions)(e,&quot;TRACES&quot;),cSe.ProtobufTraceSerializer,&quot;TraceExportService&quot;,&quot;/opentelemetry.proto.collector.trace.v1.TraceService/Export&quot;))}};sm.OTLPTraceExporter=TR});var PY=T(bo=&gt;{&quot;use strict&quot;;var fSe=bo&amp;&amp;bo.__createBinding||(Object.create?(function(r,e,t,o){o===void 0&amp;&amp;(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,o){o===void 0&amp;&amp;(o=t),r[o]=e[t]})),pSe=bo&amp;&amp;bo.__exportStar||function(r,e){for(var t in r)t!==&quot;default&quot;&amp;&amp;!Object.prototype.hasOwnProperty.call(e,t)&amp;&amp;fSe(e,r,t)};Object.defineProperty(bo,&quot;__esModule&quot;,{value:!0});pSe(CY(),bo)});var am,IY=p(()=&gt;{(function(r){r.AlwaysOff=&quot;always_off&quot;,r.AlwaysOn=&quot;always_on&quot;,r.ParentBasedAlwaysOff=&quot;parentbased_always_off&quot;,r.ParentBasedAlwaysOn=&quot;parentbased_always_on&quot;,r.ParentBasedTraceIdRatio=&quot;parentbased_traceidratio&quot;,r.TraceIdRatio=&quot;traceidratio&quot;})(am||(am={}))});function _Se(r){return hSe.indexOf(r)&gt;-1}function mSe(r){return ESe.indexOf(r)&gt;-1}function SSe(r){return TSe.indexOf(r)&gt;-1}function ySe(r,e,t){if(typeof t[r]&gt;&quot;u&quot;)return;let o=String(t[r]);e[r]=o.toLowerCase()===&quot;true&quot;}function OSe(r,e,t,o=-1/0,s=1/0){if(typeof t[r]&lt;&quot;u&quot;){let a=Number(t[r]);isNaN(a)||(a&lt;o?e[r]=o:a&gt;s?e[r]=s:e[r]=a)}}function ASe(r,e,t,o=dSe){let s=t[r];typeof s==&quot;string&quot;&amp;&amp;(e[r]=s.split(o).map(a=&gt;a.trim()))}function NSe(r,e,t){let o=t[r];if(typeof o==&quot;string&quot;){let s=RSe[o.toUpperCase()];s!=null&amp;&amp;(e[r]=s)}}function bY(r){let e={};for(let t in vR){let o=t;switch(o){case&quot;OTEL_LOG_LEVEL&quot;:NSe(o,e,r);break;default:if(_Se(o))ySe(o,e,r);else if(mSe(o))OSe(o,e,r);else if(SSe(o))ASe(o,e,r);else{let s=r[o];typeof s&lt;&quot;u&quot;&amp;&amp;s!==null&amp;&amp;(e[o]=String(s))}}}return e}var dSe,hSe,ESe,TSe,SR,gR,gSe,vSe,vR,RSe,LY=p(()=&gt;{P();IY();dSe=&quot;,&quot;,hSe=[&quot;OTEL_SDK_DISABLED&quot;];ESe=[&quot;OTEL_BSP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BSP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BSP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BSP_SCHEDULE_DELAY&quot;,&quot;OTEL_BLRP_EXPORT_TIMEOUT&quot;,&quot;OTEL_BLRP_MAX_EXPORT_BATCH_SIZE&quot;,&quot;OTEL_BLRP_MAX_QUEUE_SIZE&quot;,&quot;OTEL_BLRP_SCHEDULE_DELAY&quot;,&quot;OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT&quot;,&quot;OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_LINK_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT&quot;,&quot;OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT&quot;,&quot;OTEL_EXPORTER_OTLP_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_TRACES_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_METRICS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_OTLP_LOGS_TIMEOUT&quot;,&quot;OTEL_EXPORTER_JAEGER_AGENT_PORT&quot;];TSe=[&quot;OTEL_NO_PATCH_MODULES&quot;,&quot;OTEL_PROPAGATORS&quot;,&quot;OTEL_SEMCONV_STABILITY_OPT_IN&quot;];SR=1/0,gR=128,gSe=128,vSe=128,vR={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:&quot;&quot;,ECS_CONTAINER_METADATA_URI_V4:&quot;&quot;,ECS_CONTAINER_METADATA_URI:&quot;&quot;,HOSTNAME:&quot;&quot;,KUBERNETES_SERVICE_HOST:&quot;&quot;,NAMESPACE:&quot;&quot;,OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:&quot;&quot;,OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_JAEGER_PASSWORD:&quot;&quot;,OTEL_EXPORTER_JAEGER_USER:&quot;&quot;,OTEL_EXPORTER_OTLP_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:&quot;&quot;,OTEL_EXPORTER_OTLP_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_HEADERS:&quot;&quot;,OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:&quot;http://localhost:9411/api/v2/spans&quot;,OTEL_LOG_LEVEL:H.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:[&quot;tracecontext&quot;,&quot;baggage&quot;],OTEL_RESOURCE_ATTRIBUTES:&quot;&quot;,OTEL_SERVICE_NAME:&quot;&quot;,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SR,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gR,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gSe,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vSe,OTEL_TRACES_EXPORTER:&quot;&quot;,OTEL_TRACES_SAMPLER:am.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:&quot;&quot;,OTEL_LOGS_EXPORTER:&quot;&quot;,OTEL_EXPORTER_OTLP_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_INSECURE:&quot;&quot;,OTEL_EXPORTER_OTLP_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:&quot;&quot;,OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:&quot;&quot;,OTEL_EXPORTER_OTLP_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:&quot;http/protobuf&quot;,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:&quot;cumulative&quot;,OTEL_SEMCONV_STABILITY_OPT_IN:[]};RSe={ALL:H.ALL,VERBOSE:H.VERBOSE,DEBUG:H.DEBUG,INFO:H.INFO,WARN:H.WARN,ERROR:H.ERROR,NONE:H.NONE}});function Nu(){let r=bY(process.env);return Object.assign({},vR,r)}var xY=p(()=&gt;{LY()});var wY=p(()=&gt;{xY()});var DY=p(()=&gt;{wY()});function Cu(r){return r[0]*1e6+r[1]/1e3}var MSe,wSe,yqe,Oqe,UY=p(()=&gt;{MSe=9,wSe=6,yqe=Math.pow(10,wSe),Oqe=Math.pow(10,MSe)});var sn,kY=p(()=&gt;{(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(sn||(sn={}))});var lm=p(()=&gt;{UY();kY();DY()});import*as DSe from&quot;http&quot;;import*as USe from&quot;https&quot;;import*as BY from&quot;url&quot;;function Lo(r,e){let t=BY.parse(r),o=Object.assign({method:&quot;POST&quot;,headers:Object.assign({&quot;Content-Type&quot;:&quot;application/json&quot;},e)},t);return function(a,i){if(a.length===0)return S.debug(&quot;Zipkin send with empty spans&quot;),i({code:sn.SUCCESS});let{request:n}=o.protocol===&quot;http:&quot;?DSe:USe,l=n(o,u=&gt;{let f=&quot;&quot;;u.on(&quot;data&quot;,_=&gt;{f+=_}),u.on(&quot;end&quot;,()=&gt;{let _=u.statusCode||0;return S.debug(`Zipkin response status code: ${_}, body: ${f}`),_&lt;400?i({code:sn.SUCCESS}):i({code:sn.FAILED,error:new Error(`Got unexpected status code from zipkin: ${_}`)})})});l.on(&quot;error&quot;,u=&gt;i({code:sn.FAILED,error:u}));let c=JSON.stringify(a);S.debug(`Zipkin request payload: ${c}`),l.write(c,&quot;utf8&quot;),l.end()}}var VY=p(()=&gt;{P();lm()});var FY=p(()=&gt;{VY()});var yR=p(()=&gt;{FY()});var xo,GY=p(()=&gt;{(function(r){r.CLIENT=&quot;CLIENT&quot;,r.SERVER=&quot;SERVER&quot;,r.CONSUMER=&quot;CONSUMER&quot;,r.PRODUCER=&quot;PRODUCER&quot;})(xo||(xo={}))});function jY(r,e,t,o){return{traceId:r.spanContext().traceId,parentId:r.parentSpanId,name:r.name,id:r.spanContext().spanId,kind:BSe[r.kind],timestamp:Cu(r.startTime),duration:Math.round(Cu(r.duration)),localEndpoint:{serviceName:e},tags:VSe(r,t,o),annotations:r.events.length?FSe(r.events):void 0}}function VSe({attributes:r,resource:e,status:t,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let l={};for(let c of Object.keys(r))l[c]=String(r[c]);return t.code!==jt.UNSET&amp;&amp;(l[i]=String(jt[t.code])),t.code===jt.ERROR&amp;&amp;t.message&amp;&amp;(l[n]=t.message),o&amp;&amp;(l[&quot;otel.dropped_attributes_count&quot;]=String(o)),s&amp;&amp;(l[&quot;otel.dropped_events_count&quot;]=String(s)),a&amp;&amp;(l[&quot;otel.dropped_links_count&quot;]=String(a)),Object.keys(e.attributes).forEach(c=&gt;l[c]=String(e.attributes[c])),l}function FSe(r){return r.map(e=&gt;({timestamp:Math.round(Cu(e.time)),value:e.name}))}var BSe,HY,qY,YY=p(()=&gt;{P();lm();GY();BSe={[qt.CLIENT]:xo.CLIENT,[qt.SERVER]:xo.SERVER,[qt.CONSUMER]:xo.CONSUMER,[qt.PRODUCER]:xo.PRODUCER,[qt.INTERNAL]:void 0},HY=&quot;otel.status_code&quot;,qY=&quot;error&quot;});function zY(r){return function(){return r()}}var KY=p(()=&gt;{});var cm,$Y=p(()=&gt;{P();lm();yR();YY();Ve();KY();cm=class{constructor(e={}){this.DEFAULT_SERVICE_NAME=&quot;OpenTelemetry Service&quot;,this._sendingPromises=[],this._urlStr=e.url||Nu().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=Lo(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||HY,this._statusDescriptionTagName=e.statusDescriptionTagName||qY,this._isShutdown=!1,typeof e.getExportRequestHeaders==&quot;function&quot;?this._getHeaders=zY(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,t){let o=String(this._serviceName||e[0].resource.attributes[at]||this.DEFAULT_SERVICE_NAME);if(S.debug(&quot;Zipkin exporter export&quot;),this._isShutdown){setTimeout(()=&gt;t({code:sn.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)}));return}let s=new Promise(i=&gt;{this._sendSpans(e,o,n=&gt;{i(),t(n)})});this._sendingPromises.push(s);let a=()=&gt;{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return S.debug(&quot;Zipkin exporter shutdown&quot;),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,t)=&gt;{Promise.all(this._sendingPromises).then(()=&gt;{e()},t)})}_beforeSend(){this._getHeaders&amp;&amp;(this._send=Lo(this._urlStr,this._getHeaders()))}_sendSpans(e,t,o){let s=e.map(a=&gt;jY(a,String(a.attributes[at]||a.resource.attributes[at]||t),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=&gt;{if(o)return o(a)})}}});var XY={};Ae(XY,{ZipkinExporter:()=&gt;cm,prepareSend:()=&gt;Lo});var WY=p(()=&gt;{yR();$Y()});var ez=T(an=&gt;{&quot;use strict&quot;;Object.defineProperty(an,&quot;__esModule&quot;,{value:!0});an.getSpanProcessorsFromEnv=an.getOtlpProtocolFromEnv=an.filterBlanksAndNulls=an.getResourceDetectorsFromEnv=void 0;var Mo=(P(),ee(ot)),fm=(xr(),ee(Pf)),JY=(TY(),ee(mY)),GSe=(RY(),ee(AY)),HSe=PY(),qSe=(WY(),ee(XY)),Pu=(Fd(),ee(Vd)),um=(Gi(),ee(xs)),jSe=&quot;env&quot;,YSe=&quot;host&quot;,zSe=&quot;os&quot;,KSe=&quot;process&quot;,$Se=&quot;serviceinstance&quot;;function XSe(){var r,e;let t=new Map([[jSe,Pu.envDetectorSync],[YSe,Pu.hostDetectorSync],[zSe,Pu.osDetectorSync],[$Se,Pu.serviceInstanceIdDetectorSync],[KSe,Pu.processDetectorSync]]),o=(e=(r=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||r===void 0?void 0:r.split(&quot;,&quot;))!==null&amp;&amp;e!==void 0?e:[&quot;all&quot;];return o.includes(&quot;all&quot;)?[...t.values()].flat():o.includes(&quot;none&quot;)?[]:o.flatMap(s=&gt;{let a=t.get(s);return a||Mo.diag.warn(`Invalid resource detector &quot;${s}&quot; specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),a||[]})}an.getResourceDetectorsFromEnv=XSe;function QY(r){return r.map(e=&gt;e.trim()).filter(e=&gt;e!==&quot;null&quot;&amp;&amp;e!==&quot;&quot;)}an.filterBlanksAndNulls=QY;function ZY(){var r,e,t;let o=(0,fm.getEnvWithoutDefaults)();return(t=(e=(r=o.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;r!==void 0?r:o.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&amp;&amp;e!==void 0?e:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&amp;&amp;t!==void 0?t:(0,fm.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}an.getOtlpProtocolFromEnv=ZY;function WSe(){let r=ZY();switch(r){case&quot;grpc&quot;:return new HSe.OTLPTraceExporter;case&quot;http/json&quot;:return new GSe.OTLPTraceExporter;case&quot;http/protobuf&quot;:return new JY.OTLPTraceExporter;default:return Mo.diag.warn(`Unsupported OTLP traces protocol: ${r}. Using http/protobuf.`),new JY.OTLPTraceExporter}}function JSe(){try{let{JaegerExporter:r}=V(&quot;@opentelemetry/exporter-jaeger&quot;);return new r}catch(r){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter&#x27;s lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${r}`)}}function QSe(){var r;let e=new Map([[&quot;otlp&quot;,()=&gt;WSe()],[&quot;zipkin&quot;,()=&gt;new qSe.ZipkinExporter],[&quot;console&quot;,()=&gt;new um.ConsoleSpanExporter],[&quot;jaeger&quot;,()=&gt;JSe()]]),t=[],o=[],s=QY(Array.from(new Set((0,fm.getEnv)().OTEL_TRACES_EXPORTER.split(&quot;,&quot;))));if(s[0]===&quot;none&quot;)return Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot;. SDK will not be initialized.&#x27;),[];s.length===0?(Mo.diag.warn(&quot;OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.&quot;),s=[&quot;otlp&quot;]):s.length&gt;1&amp;&amp;s.includes(&quot;none&quot;)&amp;&amp;(Mo.diag.warn(&#x27;OTEL_TRACES_EXPORTER contains &quot;none&quot; along with other exporters. Using default otlp exporter.&#x27;),s=[&quot;otlp&quot;]);for(let a of s){let i=(r=e.get(a))===null||r===void 0?void 0:r();i?t.push(i):Mo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${a}.`)}for(let a of t)a instanceof um.ConsoleSpanExporter?o.push(new um.SimpleSpanProcessor(a)):o.push(new um.BatchSpanProcessor(a));return t.length===0&amp;&amp;Mo.diag.warn(&quot;Unable to set up trace exporter(s) due to invalid exporter and/or protocol values.&quot;),o}an.getSpanProcessorsFromEnv=QSe});var rz=T(pm=&gt;{&quot;use strict&quot;;Object.defineProperty(pm,&quot;__esModule&quot;,{value:!0});pm.NodeSDK=void 0;var ln=(P(),ee(ot)),ZSe=(El(),ee(Uw)),ege=(MF(),ee(xF)),Ba=(Fd(),ee(Vd)),Iu=(UT(),ee(DT)),tge=(x3(),ee(L3)),rge=iY(),OR=(fY(),ee(uY)),nge=(Gp(),ee(eS)),ige=(Gi(),ee(xs)),oge=zS(),sge=(Ve(),ee(Qx)),tz=(xr(),ee(Pf)),AR=ez(),RR=class{constructor(e={}){var t,o,s,a,i,n,l;let c=(0,tz.getEnv)(),u=(0,tz.getEnvWithoutDefaults)();if(c.OTEL_SDK_DISABLED&amp;&amp;(this._disabled=!0),u.OTEL_LOG_LEVEL&amp;&amp;ln.diag.setLogger(new ln.DiagConsoleLogger,{logLevel:u.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(t=e.resource)!==null&amp;&amp;t!==void 0?t:new Ba.Resource({}),this._mergeResourceWithDefaults=(o=e.mergeResourceWithDefaults)!==null&amp;&amp;o!==void 0?o:!0,this._autoDetectResources=(s=e.autoDetectResources)!==null&amp;&amp;s!==void 0?s:!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?this._resourceDetectors=(0,AR.getResourceDetectorsFromEnv)():this._resourceDetectors=[Ba.envDetector,Ba.processDetector,Ba.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let f={};e.sampler&amp;&amp;(f.sampler=e.sampler),e.spanLimits&amp;&amp;(f.spanLimits=e.spanLimits),e.idGenerator&amp;&amp;(f.idGenerator=e.idGenerator),e.spanProcessor&amp;&amp;ln.diag.warn(&quot;The &#x27;spanProcessor&#x27; option is deprecated. Please use &#x27;spanProcessors&#x27; instead.&quot;);let _=(a=e.spanProcessor)!==null&amp;&amp;a!==void 0?a:new ige.BatchSpanProcessor(e.traceExporter),m=(i=e.spanProcessors)!==null&amp;&amp;i!==void 0?i:[_];this._tracerProviderConfig={tracerConfig:f,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},ln.diag.warn(&quot;The &#x27;logRecordProcessor&#x27; option is deprecated. Please use &#x27;logRecordProcessors&#x27; instead.&quot;)):this.configureLoggerProviderFromEnv(),e.metricReader||e.views){let f={};e.metricReader&amp;&amp;(f.reader=e.metricReader),e.views&amp;&amp;(f.views=e.views),this._meterProviderConfig=f}this._instrumentations=(l=(n=e.instrumentations)===null||n===void 0?void 0:n.flat())!==null&amp;&amp;l!==void 0?l:[]}start(){var e,t,o,s,a,i;if(this._disabled)return;if((0,ege.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let l={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Ba.detectResourcesSync)(l))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Ba.Resource({[sge.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let n=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,AR.getSpanProcessorsFromEnv)();if(this._tracerProvider=new oge.NodeTracerProvider(Object.assign(Object.assign({},this._configuration),{resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults,spanProcessors:n})),n.length&gt;0&amp;&amp;this._tracerProvider.register({contextManager:(t=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&amp;&amp;t!==void 0?t:(o=this._configuration)===null||o===void 0?void 0:o.contextManager,propagator:(s=this._tracerProviderConfig)===null||s===void 0?void 0:s.textMapPropagator}),this._loggerProviderConfig){let l=new Iu.LoggerProvider({resource:this._resource,mergeResourceWithDefaults:this._mergeResourceWithDefaults});for(let c of this._loggerProviderConfig.logRecordProcessors)l.addLogRecordProcessor(c);this._loggerProvider=l,ZSe.logs.setGlobalLoggerProvider(l)}if(this._meterProviderConfig){let l=[];this._meterProviderConfig.reader&amp;&amp;l.push(this._meterProviderConfig.reader);let c=new nge.MeterProvider({resource:this._resource,views:(i=(a=this._meterProviderConfig)===null||a===void 0?void 0:a.views)!==null&amp;&amp;i!==void 0?i:[],readers:l,mergeResourceWithDefaults:this._mergeResourceWithDefaults});this._meterProvider=c,ln.metrics.setGlobalMeterProvider(c);for(let u of this._instrumentations)u.setMeterProvider(ln.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&amp;&amp;e.push(this._tracerProvider.shutdown()),this._loggerProvider&amp;&amp;e.push(this._loggerProvider.shutdown()),this._meterProvider&amp;&amp;e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=&gt;{})}configureLoggerProviderFromEnv(){var e;let t=(e=process.env.OTEL_LOGS_EXPORTER)!==null&amp;&amp;e!==void 0?e:&quot;&quot;,o=(0,AR.filterBlanksAndNulls)(t.split(&quot;,&quot;));if(o.length===0&amp;&amp;(ln.diag.info(&quot;OTEL_LOGS_EXPORTER is empty. Using default otlp exporter.&quot;),o.push(&quot;otlp&quot;)),o.includes(&quot;none&quot;)){ln.diag.info(&#x27;OTEL_LOGS_EXPORTER contains &quot;none&quot;. Logger provider will not be initialized.&#x27;);return}let s=[];o.forEach(a=&gt;{var i,n;if(a===&quot;otlp&quot;){let l=(n=(i=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL)!==null&amp;&amp;i!==void 0?i:process.env.OTEL_EXPORTER_OTLP_PROTOCOL)===null||n===void 0?void 0:n.trim();switch(l){case&quot;grpc&quot;:s.push(new rge.OTLPLogExporter);break;case&quot;http/json&quot;:s.push(new tge.OTLPLogExporter);break;case&quot;http/protobuf&quot;:s.push(new OR.OTLPLogExporter);break;case void 0:case&quot;&quot;:s.push(new OR.OTLPLogExporter);break;default:ln.diag.warn(`Unsupported OTLP logs protocol: &quot;${l}&quot;. Using http/protobuf.`),s.push(new OR.OTLPLogExporter)}}else a===&quot;console&quot;?s.push(new Iu.ConsoleLogRecordExporter):ln.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: &quot;${a}&quot;. Supported values are: otlp, console, none.`)}),s.length&gt;0&amp;&amp;(this._loggerProviderConfig={logRecordProcessors:s.map(a=&gt;a instanceof Iu.ConsoleLogRecordExporter?new Iu.SimpleLogRecordProcessor(a):new Iu.BatchLogRecordProcessor(a))})}};pm.NodeSDK=RR});var nz=T(Xe=&gt;{&quot;use strict&quot;;Object.defineProperty(Xe,&quot;__esModule&quot;,{value:!0});Xe.NodeSDK=Xe.tracing=Xe.resources=Xe.node=Xe.metrics=Xe.logs=Xe.core=Xe.contextBase=Xe.api=void 0;Xe.api=(P(),ee(ot));Xe.contextBase=(P(),ee(ot));Xe.core=(xr(),ee(Pf));Xe.logs=(UT(),ee(DT));Xe.metrics=(Gp(),ee(eS));Xe.node=zS();Xe.resources=(Fd(),ee(Vd));Xe.tracing=(Gi(),ee(xs));var age=rz();Object.defineProperty(Xe,&quot;NodeSDK&quot;,{enumerable:!0,get:function(){return age.NodeSDK}})});import{env as bu,version as lge}from&quot;process&quot;;P();var vi=typeof globalThis==&quot;object&quot;?globalThis:global;function LN(r){return r&gt;=48&amp;&amp;r&lt;=57?r-48:r&gt;=97&amp;&amp;r&lt;=102?r-87:r-55}function $a(r){let e=new Uint8Array(r.length/2),t=0;for(let o=0;o&lt;r.length;o+=2){let s=LN(r.charCodeAt(o)),a=LN(r.charCodeAt(o+1));e[t++]=s&lt;&lt;4|a}return e}var xN=&quot;1.30.1&quot;;Ve();var yi={[Se]:&quot;opentelemetry&quot;,[st]:&quot;node&quot;,[ge]:wt,[ve]:xN};var QQ=9,ZQ=6,rOe=Math.pow(10,ZQ),eZ=Math.pow(10,QQ);function Xm(r){return r[0]*eZ+r[1]}var Bo;(function(r){r[r.SUCCESS=0]=&quot;SUCCESS&quot;,r[r.FAILED=1]=&quot;FAILED&quot;})(Bo||(Bo={}));var Ku=class{constructor(){this._promise=new Promise((e,t)=&gt;{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};var Qa=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Ku}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=&gt;this._deferred.resolve(t),t=&gt;this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function eM(r){let e=BigInt(1e9);return BigInt(r[0])*e+BigInt(r[1])}function tZ(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r&gt;&gt;BigInt(32)));return{low:e,high:t}}function tM(r){let e=eM(r);return tZ(e)}function rZ(r){return eM(r).toString()}var nZ=typeof BigInt&lt;&quot;u&quot;?rZ:Xm;function Zx(r){return r}function rM(r){if(r!==void 0)return $a(r)}var iZ={encodeHrTime:tM,encodeSpanContext:$a,encodeOptionalSpanContext:rM};function nM(r){var e,t;if(r===void 0)return iZ;let o=(e=r.useLongBits)!==null&amp;&amp;e!==void 0?e:!0,s=(t=r.useHex)!==null&amp;&amp;t!==void 0?t:!1;return{encodeHrTime:o?tM:nZ,encodeSpanContext:s?Zx:$a,encodeOptionalSpanContext:s?Zx:rM}}function iM(r){return{attributes:Za(r.attributes),droppedAttributesCount:0}}function oM(r){return{name:r.name,version:r.version}}function Za(r){return Object.keys(r).map(e=&gt;sM(e,r[e]))}function sM(r,e){return{key:r,value:aM(e)}}function aM(r){let e=typeof r;return e===&quot;string&quot;?{stringValue:r}:e===&quot;number&quot;?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e===&quot;boolean&quot;?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(aM)}}:e===&quot;object&quot;&amp;&amp;r!=null?{kvlistValue:{values:Object.entries(r).map(([t,o])=&gt;sM(t,o))}}:{}}P();Ve();function $u(){return`unknown_service:${process.argv0}`}var Oi=class r{constructor(e,t){var o;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(o=this._attributes)!==null&amp;&amp;o!==void 0?o:{},this._asyncAttributesPromise=t==null?void 0:t.then(s=&gt;(this._attributes=Object.assign({},this._attributes,s),this.asyncAttributesPending=!1,s),s=&gt;(S.debug(&quot;a resource&#x27;s async attributes promise rejected: %s&quot;,s),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[at]:$u(),[ge]:yi[ge],[Se]:yi[Se],[ve]:yi[ve]})}get attributes(){var e;return this.asyncAttributesPending&amp;&amp;S.error(&quot;Accessing resource attributes before async attributes settled&quot;),(e=this._attributes)!==null&amp;&amp;e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&amp;&amp;await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let o=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&amp;&amp;t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&amp;&amp;!e._asyncAttributesPromise)return new r(o);let s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([a,i])=&gt;{var n;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),a),(n=e._syncAttributes)!==null&amp;&amp;n!==void 0?n:e.attributes),i)});return new r(o,s)}};Oi.EMPTY=new Oi({});function oZ(r,e){var t;let o=r.spanContext(),s=r.status;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=o.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:Za(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(a=&gt;aZ(a,e)),droppedEventsCount:r.droppedEventsCount,status:{code:s.code,message:s.message},links:r.links.map(a=&gt;sZ(a,e)),droppedLinksCount:r.droppedLinksCount}}function sZ(r,e){var t;return{attributes:r.attributes?Za(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}function aZ(r,e){return{attributes:r.attributes?Za(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}function lM(r,e){let t=nM(e);return{resourceSpans:cZ(r,t)}}function lZ(r){let e=new Map;for(let t of r){let o=e.get(t.resource);o||(o=new Map,e.set(t.resource,o));let s=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||&quot;&quot;}:${t.instrumentationLibrary.schemaUrl||&quot;&quot;}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(t)}return e}function cZ(r,e){let t=lZ(r),o=[],s=t.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,l=[],c=n.values(),u=c.next();for(;!u.done;){let _=u.value;if(_.length&gt;0){let m=_.map(O=&gt;oZ(O,e));l.push({scope:oM(_[0].instrumentationLibrary),spans:m,schemaUrl:_[0].instrumentationLibrary.schemaUrl})}u=c.next()}let f={resource:iM(i),scopeSpans:l,schemaUrl:void 0};o.push(f),a=s.next()}return o}var Xu={serializeRequest:r=&gt;{let e=lM(r,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:r=&gt;{let e=new TextDecoder;return JSON.parse(e.decode(r))}};var uM=r=&gt;{throw TypeError(r)},Jm=(r,e,t)=&gt;e.has(r)||uM(&quot;Cannot &quot;+t),el=(r,e,t)=&gt;(Jm(r,e,&quot;read from private field&quot;),t?t.call(r):e.get(r)),Wu=(r,e,t)=&gt;e.has(r)?uM(&quot;Cannot add the same private member more than once&quot;):e instanceof WeakSet?e.add(r):e.set(r,t),cM=(r,e,t,o)=&gt;(Jm(r,e,&quot;write to private field&quot;),o?o.call(r,t):e.set(r,t),t),uZ=(r,e,t)=&gt;(Jm(r,e,&quot;access private method&quot;),t),fZ=&quot;__nfOTLPTrace&quot;,tl,rl,Qm,Wm,fM,pM=class dM{constructor(){Wu(this,Wm),Wu(this,tl),Wu(this,rl),cM(this,tl,new Qa(uZ(this,Wm,fM),this)),cM(this,rl,S.createComponentLogger({namespace:&quot;netlify-span-exporter&quot;}))}export(e,t){if(el(this,rl).debug(`export ${e.length.toString()} spans`),el(this,tl).isCalled){t({code:Bo.FAILED,error:new Error(&quot;Exporter has been shutdown&quot;)});return}console.log(fZ,el(dM,Qm).decode(Xu.serializeRequest(e))),t({code:Bo.SUCCESS})}shutdown(){return el(this,tl).call()}};tl=new WeakMap;rl=new WeakMap;Qm=new WeakMap;Wm=new WeakSet;fM=function(){return el(this,rl).debug(&quot;Shutting down&quot;),Promise.resolve()};Wu(pM,Qm,new TextDecoder);var hM=pM;P();var pZ=function(r,e){e.recordException(r),e.setStatus({code:jt.ERROR})};var Ju=(function(){function r(e){this._tracer=e,this.startSpan=e.startSpan.bind(this._tracer),this.startActiveSpan=e.startActiveSpan.bind(this._tracer)}return r.prototype.withActiveSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn;return this._tracer.startActiveSpan(e,i,n,function(c){return EM(c,i,l)})},r.prototype.withSpan=function(e,t,o,s){var a=_M(t,o,s),i=a.opts,n=a.ctx,l=a.fn,c=this._tracer.startSpan(e,i,n);return EM(c,i,l)},r})();function _M(r,e,t){var o,s,a;return!e&amp;&amp;!t?a=r:t?(o=r,s=e,a=t):(o=r,a=e),o=o??{},s=s??he.active(),{opts:o,ctx:s,fn:a}}function EM(r,e,t){var o,s=(o=e.onException)!==null&amp;&amp;o!==void 0?o:pZ,a=function(n){throw s(n,r),r.end(),n};try{var i=t(r);return typeof(i==null?void 0:i.then)==&quot;function&quot;?i.then(function(n){return r.end(),n},a):(r.end(),i)}catch(n){throw a(n)}}var mM=class{constructor(r={}){this.instrumentationName=&quot;@netlify/otel/instrumentation-fetch&quot;,this.instrumentationVersion=&quot;1.0.0&quot;,this.originalFetch=null,this.config=r}getConfig(){return this.config}setConfig(){}setMeterProvider(){}setTracerProvider(r){this.provider=r}getTracerProvider(){return this.provider}annotateFromRequest(r,e){var s,a;let t=((a=(s=this.config).getRequestAttributes)==null?void 0:a.call(s,e))??{},o=new URL(e.url);r.setAttributes({...t,&quot;http.request.method&quot;:e.method,&quot;url.full&quot;:o.href,&quot;url.host&quot;:o.host,&quot;url.scheme&quot;:o.protocol.slice(0,-1),&quot;server.address&quot;:o.hostname,&quot;server.port&quot;:o.port,...this.prepareHeaders(&quot;request&quot;,e.headers)})}annotateFromResponse(r,e){var o,s;let t=((s=(o=this.config).getResponseAttributes)==null?void 0:s.call(o,e))??{};r.setAttributes({...t,&quot;http.response.status_code&quot;:e.status,...this.prepareHeaders(&quot;response&quot;,e.headers)})}prepareHeaders(r,e){if(this.config.skipHeaders===!0)return{};let t=[&quot;*&quot;,&quot;/.*/&quot;],o=this.config.skipHeaders??[],s=this.config.redactHeaders??[],a=o.some(l=&gt;t.includes(l.toString())),i={};if(a)return i;let n=e.entries();for(let[l,c]of n){if(o.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l)))continue;let u=`http.${r}.header.${l}`;s===!0||s.some(f=&gt;typeof f==&quot;string&quot;?f==l:f.test(l))?i[u]=&quot;REDACTED&quot;:i[u]=c}return i}getTracer(){if(!this.provider)return;let r=this.provider.getTracer(this.instrumentationName,this.instrumentationVersion);return r instanceof Ju?r:new Ju(r)}enable(){let r=vi.fetch;this.originalFetch=r,vi.fetch=async(e,t)=&gt;{var a;let o=typeof e==&quot;string&quot;?e:e instanceof URL?e.href:e.url,s=this.getTracer();return!s||(a=this.config.skipURLs)!=null&amp;&amp;a.some(i=&gt;typeof i==&quot;string&quot;?o.startsWith(i):i.test(o))?await r(e,t):s.withActiveSpan(&quot;fetch&quot;,async i=&gt;{let n=new Request(e,t);this.annotateFromRequest(i,n);let l=await r(n,t);return this.annotateFromResponse(i,l),l})}}disable(){this.originalFetch&amp;&amp;(vi.fetch=this.originalFetch,this.originalFetch=null)}};P();var oz=Nn(nz(),1);bu.NETLIFY_DEBUG_OPENTELEMETRY&amp;&amp;S.setLogger(new Du,{logLevel:H.ALL,suppressOverrideMessage:!0});var iz,cge=new Oi({&quot;service.name&quot;:SERVICE_NAME??&quot;lambda-function&quot;,&quot;service.version&quot;:SERVICE_VERSION,&quot;process.runtime.name&quot;:&quot;nodejs&quot;,&quot;process.runtime.version&quot;:lge.slice(1),&quot;deployment.environment&quot;:(iz=bu.URL)!=null&amp;&amp;iz.includes(&quot;netlifystg.com&quot;)?&quot;staging&quot;:&quot;production&quot;,&quot;http.url&quot;:bu.URL,&quot;netlify.site.id&quot;:bu.SITE_ID,&quot;netlify.site.name&quot;:bu.SITE_NAME}),uge=new oz.default.NodeSDK({resource:cge,traceExporter:new hM,instrumentations:[new mM({skipHeaders:!0})]});uge.start(); /*! Bundled license information: @grpc/proto-loader/build/src/util.js: @grpc/proto-loader/build/src/index.js: (** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *) long/umd/index.js: (** * @license * Copyright 2009 The Closure Library Authors * Copyright 2020 Daniel Wirtz / The long.js Authors. * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 *) */ </div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ netlify</div> <div class="folder" style="margin-left: 80px;">๐Ÿ“ functions</div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ sitemap-admin.js</div> <div class="content">var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) =&gt; function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; // netlify/functions/sitemap.js var require_sitemap = __commonJS({ &quot;netlify/functions/sitemap.js&quot;(exports2) { var fs = require(&quot;fs&quot;).promises; var path = require(&quot;path&quot;); var SITEMAP_CONFIG = { MAX_URLS_PER_SITEMAP: 5e4, CACHE_DURATION: 24 * 60 * 60 * 1e3, // 24 hours DEFAULT_CHANGEFREQ: &quot;weekly&quot;, DEFAULT_PRIORITY: 0.5, HIGH_PRIORITY: 0.9, MEDIUM_PRIORITY: 0.7, LOW_PRIORITY: 0.3 }; var STATIC_PAGES = [ { path: &quot;/&quot;, changefreq: &quot;daily&quot;, priority: 1 }, { path: &quot;/tools&quot;, changefreq: &quot;weekly&quot;, priority: 0.9 }, { path: &quot;/blog&quot;, changefreq: &quot;daily&quot;, priority: 0.8 }, { path: &quot;/about&quot;, changefreq: &quot;monthly&quot;, priority: 0.6 }, { path: &quot;/contact&quot;, changefreq: &quot;monthly&quot;, priority: 0.6 }, { path: &quot;/privacy-policy&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/terms-of-use&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/dmca&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 }, { path: &quot;/cookies-policy&quot;, changefreq: &quot;yearly&quot;, priority: 0.3 } ]; var sitemapCache = null; function getSiteOrigin() { return process.env.URL || process.env.SITE_URL || &quot;https://modernphototools.com&quot;; } function escapeXml(str) { return str.replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;).replace(/&gt;/g, &quot;&amp;gt;&quot;).replace(/&quot;/g, &quot;&amp;quot;&quot;).replace(/&#x27;/g, &quot;&amp;#39;&quot;); } async function loadBlogArticles() { try { const contentDir = path.join(process.cwd(), &quot;content&quot;, &quot;blog&quot;); const files = await fs.readdir(contentDir); const markdownFiles = files.filter((file) =&gt; file.endsWith(&quot;.md&quot;)); const articles = []; for (const file of markdownFiles) { const filePath = path.join(contentDir, file); const content = await fs.readFile(filePath, &quot;utf-8&quot;); const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); if (frontmatterMatch) { const frontmatter = frontmatterMatch[1]; const slug = file.replace(&quot;.md&quot;, &quot;&quot;); const titleMatch = frontmatter.match(/title:\s*[&quot;&#x27;]?([^&quot;&#x27;\n]+)[&quot;&#x27;]?/); const dateMatch = frontmatter.match(/date:\s*[&quot;&#x27;]?([^&quot;&#x27;\n]+)[&quot;&#x27;]?/); if (titleMatch) { articles.push({ slug, title: titleMatch[1], date: dateMatch ? dateMatch[1] : (/* @__PURE__ */ new Date()).toISOString() }); } } } return articles; } catch (error) { console.error(&quot;Error loading blog articles:&quot;, error); return []; } } async function getImageFiles() { try { const imagesDir = path.join(process.cwd(), &quot;public&quot;, &quot;images&quot;); const images = []; async function scanDirectory(dir, relativePath = &quot;&quot;) { try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { await scanDirectory(itemPath, path.join(relativePath, item)); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { images.push({ path: `/images/${path.join(relativePath, item).replace(/\\/g, &quot;/&quot;)}`, filename: item }); } } } catch (error) { console.warn(`Could not scan directory ${dir}:`, error.message); } } await scanDirectory(imagesDir); return images; } catch (error) { console.error(&quot;Error loading images:&quot;, error); return []; } } async function getAllSitemapUrls() { const baseUrl = getSiteOrigin(); const urls = []; const now = (/* @__PURE__ */ new Date()).toISOString().split(&quot;T&quot;)[0]; STATIC_PAGES.forEach((page) =&gt; { urls.push({ loc: `${baseUrl}${page.path}`, lastmod: now, changefreq: page.changefreq, priority: page.priority }); }); TOOLS.forEach((tool) =&gt; { urls.push({ loc: `${baseUrl}${tool.path}`, lastmod: now, changefreq: &quot;weekly&quot;, priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); try { const articles = await loadBlogArticles(); articles.forEach((article) =&gt; { urls.push({ loc: `${baseUrl}/blog/${article.slug}`, lastmod: article.date.split(&quot;T&quot;)[0], changefreq: &quot;monthly&quot;, priority: SITEMAP_CONFIG.MEDIUM_PRIORITY }); }); } catch (error) { console.error(&quot;Error adding blog articles to sitemap:&quot;, error); } try { const images = await getImageFiles(); images.forEach((image) =&gt; { urls.push({ loc: `${baseUrl}${image.path}`, lastmod: now, changefreq: &quot;yearly&quot;, priority: SITEMAP_CONFIG.LOW_PRIORITY }); }); } catch (error) { console.error(&quot;Error adding images to sitemap:&quot;, error); } return urls; } function formatSitemapXml(urls) { const xmlHeader = &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x27;; const urlsetOpen = &#x27;&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;&#x27;; const urlsetClose = &quot;&lt;/urlset&gt;&quot;; const urlEntries = urls.map((url) =&gt; { let urlXml = ` &lt;url&gt; &lt;loc&gt;${escapeXml(url.loc)}&lt;/loc&gt;`; if (url.lastmod) { urlXml += ` &lt;lastmod&gt;${url.lastmod}&lt;/lastmod&gt;`; } if (url.changefreq) { urlXml += ` &lt;changefreq&gt;${url.changefreq}&lt;/changefreq&gt;`; } if (url.priority !== void 0) { urlXml += ` &lt;priority&gt;${url.priority.toFixed(1)}&lt;/priority&gt;`; } urlXml += &quot;\n &lt;/url&gt;&quot;; return urlXml; }).join(&quot;\n&quot;); return `${xmlHeader} ${urlsetOpen} ${urlEntries} ${urlsetClose}`; } function isCacheValid(timestamp) { return timestamp &amp;&amp; Date.now() - timestamp &lt; SITEMAP_CONFIG.CACHE_DURATION; } async function generateSitemap() { try { if (sitemapCache &amp;&amp; isCacheValid(sitemapCache.timestamp)) { console.log(&quot;Returning cached sitemap&quot;); return sitemapCache.xml; } console.log(&quot;Generating new sitemap...&quot;); const allUrls = await getAllSitemapUrls(); console.log(`Found ${allUrls.length} URLs for sitemap`); const xml = formatSitemapXml(allUrls); sitemapCache = { xml, timestamp: Date.now(), urlCount: allUrls.length }; console.log(&quot;Sitemap generated and cached successfully&quot;); return xml; } catch (error) { console.error(&quot;Error generating sitemap:&quot;, error); throw new Error(&quot;Failed to generate sitemap&quot;); } } exports2.handler = async function(event, context) { if (event.httpMethod === &quot;OPTIONS&quot;) { return { statusCode: 200, headers: { &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;GET, OPTIONS&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot; }, body: &quot;&quot; }; } if (event.httpMethod !== &quot;GET&quot;) { return { statusCode: 405, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot; }, body: &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;error&gt;Method Not Allowed&lt;/error&gt;&#x27; }; } try { console.log(&quot;Sitemap request received&quot;); const sitemapXml = await generateSitemap(); return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot;, &quot;Cache-Control&quot;: &quot;public, max-age=3600, s-maxage=3600&quot;, // Cache for 1 hour &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot; }, body: sitemapXml }; } catch (error) { console.error(&quot;Error serving sitemap:&quot;, error); return { statusCode: 500, headers: { &quot;Content-Type&quot;: &quot;application/xml; charset=utf-8&quot; }, body: &#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;error&gt;Internal Server Error&lt;/error&gt;&#x27; }; } }; } }); // netlify/functions/sitemap-admin.js var { handler: sitemapHandler } = require_sitemap(); var adminCache = { stats: null, lastStatsUpdate: null }; function isValidAdminToken(authHeader) { if (!authHeader) return false; const token = authHeader.replace(&quot;Bearer &quot;, &quot;&quot;); const validTokens = [ process.env.SITEMAP_ADMIN_KEY, process.env.NETLIFY_AUTH_TOKEN // Fallback to Netlify token ].filter(Boolean); return validTokens.includes(token); } async function getSitemapStats() { try { if (adminCache.stats &amp;&amp; adminCache.lastStatsUpdate &amp;&amp; Date.now() - adminCache.lastStatsUpdate &lt; 5 * 60 * 1e3) { return adminCache.stats; } const fs = require(&quot;fs&quot;).promises; const path = require(&quot;path&quot;); let blogCount = 0; try { const contentDir = path.join(process.cwd(), &quot;content&quot;, &quot;blog&quot;); const files = await fs.readdir(contentDir); blogCount = files.filter((file) =&gt; file.endsWith(&quot;.md&quot;)).length; } catch (error) { console.warn(&quot;Could not count blog articles:&quot;, error.message); } let imageCount = 0; try { const imagesDir = path.join(process.cwd(), &quot;public&quot;, &quot;images&quot;); async function countImages(dir) { let count = 0; try { const items = await fs.readdir(dir); for (const item of items) { const itemPath = path.join(dir, item); const stat = await fs.stat(itemPath); if (stat.isDirectory()) { count += await countImages(itemPath); } else if (item.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i)) { count++; } } } catch (error) { console.warn(`Could not count images in ${dir}:`, error.message); } return count; } imageCount = await countImages(imagesDir); } catch (error) { console.warn(&quot;Could not count images:&quot;, error.message); } const staticPages = 9; const toolPages = 15; const totalUrls = staticPages + toolPages + blogCount + imageCount; const stats = { totalUrls, breakdown: { staticPages, toolPages, blogArticles: blogCount, images: imageCount }, sitemapCount: Math.ceil(totalUrls / 5e4), lastGenerated: (/* @__PURE__ */ new Date()).toISOString(), cacheValid: true // Simplified for this implementation }; adminCache.stats = stats; adminCache.lastStatsUpdate = Date.now(); return stats; } catch (error) { console.error(&quot;Error getting sitemap stats:&quot;, error); return { totalUrls: 0, breakdown: { staticPages: 0, toolPages: 0, blogArticles: 0, images: 0 }, sitemapCount: 0, lastGenerated: null, cacheValid: false, error: error.message }; } } function invalidateSitemapCache() { adminCache = { stats: null, lastStatsUpdate: null }; console.log(&quot;Sitemap cache invalidated&quot;); return { success: true, message: &quot;Sitemap cache invalidated successfully&quot;, timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } async function regenerateSitemap() { try { console.log(&quot;Manual sitemap regeneration triggered&quot;); invalidateSitemapCache(); const mockEvent = { httpMethod: &quot;GET&quot;, path: &quot;/sitemap.xml&quot;, headers: {} }; const result = await sitemapHandler(mockEvent, {}); if (result.statusCode === 200) { const stats = await getSitemapStats(); return { success: true, message: &quot;Sitemap regenerated successfully&quot;, stats, timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } else { throw new Error(&quot;Sitemap generation failed&quot;); } } catch (error) { console.error(&quot;Error during manual sitemap regeneration:&quot;, error); return { success: false, message: `Failed to regenerate sitemap: ${error.message}`, timestamp: (/* @__PURE__ */ new Date()).toISOString() }; } } async function handleWebhook(event) { try { const body = JSON.parse(event.body || &quot;{}&quot;); const { action, type } = body; console.log(&quot;Webhook received:&quot;, { action, type }); const shouldRegenerate = [ &quot;published&quot;, &quot;created&quot;, &quot;updated&quot;, &quot;deleted&quot; ].includes(action) &amp;&amp; [ &quot;blog&quot;, &quot;article&quot;, &quot;page&quot;, &quot;tool&quot;, &quot;image&quot; ].includes(type); if (shouldRegenerate) { console.log(&quot;Triggering sitemap regeneration due to content change&quot;); const result = await regenerateSitemap(); return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ message: &quot;Webhook processed successfully&quot;, sitemapRegenerated: true, result }) }; } else { return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ message: &quot;Webhook received but no sitemap regeneration needed&quot;, sitemapRegenerated: false }) }; } } catch (error) { console.error(&quot;Error processing webhook:&quot;, error); return { statusCode: 500, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ error: &quot;Failed to process webhook&quot;, message: error.message }) }; } } exports.handler = async function(event, context) { if (event.httpMethod === &quot;OPTIONS&quot;) { return { statusCode: 200, headers: { &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;, &quot;Access-Control-Allow-Methods&quot;: &quot;GET, POST, OPTIONS&quot;, &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type, Authorization&quot; }, body: &quot;&quot; }; } const path = event.path || &quot;&quot;; const method = event.httpMethod; try { if (path.includes(&quot;/webhook&quot;) &amp;&amp; method === &quot;POST&quot;) { return await handleWebhook(event); } const authHeader = event.headers.authorization || event.headers.Authorization; if (!isValidAdminToken(authHeader)) { return { statusCode: 401, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ error: &quot;Unauthorized&quot;, message: &quot;Valid admin token required&quot; }) }; } if (path.includes(&quot;/stats&quot;) &amp;&amp; method === &quot;GET&quot;) { const stats = await getSitemapStats(); return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Cache-Control&quot;: &quot;no-cache&quot; }, body: JSON.stringify({ success: true, stats, timestamp: (/* @__PURE__ */ new Date()).toISOString() }) }; } if (path.includes(&quot;/regenerate&quot;) &amp;&amp; method === &quot;POST&quot;) { const result = await regenerateSitemap(); return { statusCode: result.success ? 200 : 500, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Cache-Control&quot;: &quot;no-cache&quot; }, body: JSON.stringify(result) }; } if (path.includes(&quot;/invalidate&quot;) &amp;&amp; method === &quot;POST&quot;) { const result = invalidateSitemapCache(); return { statusCode: 200, headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Cache-Control&quot;: &quot;no-cache&quot; }, body: JSON.stringify(result) }; } return { statusCode: 404, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ error: &quot;Not Found&quot;, message: &quot;Unknown admin endpoint&quot;, availableEndpoints: [ &quot;GET /stats&quot;, &quot;POST /regenerate&quot;, &quot;POST /invalidate&quot;, &quot;POST /webhook&quot; ] }) }; } catch (error) { console.error(&quot;Error in sitemap admin function:&quot;, error); return { statusCode: 500, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ error: &quot;Internal Server Error&quot;, message: error.message }) }; } }; //# sourceMappingURL=sitemap-admin.js.map </div> <div class="file" style="margin-left: 100px;">๐Ÿ“„ sitemap-admin.js.map</div> <div class="content">{ &quot;version&quot;: 3, &quot;sources&quot;: [&quot;../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap.js&quot;, &quot;../../../../../../Modern photo tools/photobybolt_1_trae/netlify/functions/sitemap-admin.js&quot;], &quot;sourceRoot&quot;: &quot;C:/Users/6732~1/AppData/Local/Temp/tmp-13180-Oz6uPhesQX1K&quot;, &quot;sourcesContent&quot;: [&quot;// Netlify function for serving sitemap.xml\nconst fs = require(&#x27;fs&#x27;).promises;\nconst path = require(&#x27;path&#x27;);\n\n// Import the sitemap utilities (we&#x27;ll need to adapt these for Node.js)\n// Since we can&#x27;t directly import TypeScript modules in Netlify functions,\n// we&#x27;ll implement the core functionality here\n\n// Configuration\nconst SITEMAP_CONFIG = {\n MAX_URLS_PER_SITEMAP: 50000,\n CACHE_DURATION: 24 * 60 * 60 * 1000, // 24 hours\n DEFAULT_CHANGEFREQ: &#x27;weekly&#x27;,\n DEFAULT_PRIORITY: 0.5,\n HIGH_PRIORITY: 0.9,\n MEDIUM_PRIORITY: 0.7,\n LOW_PRIORITY: 0.3,\n};\n\n// Static pages configuration\nconst STATIC_PAGES = [\n { path: &#x27;/&#x27;, changefreq: &#x27;daily&#x27;, priority: 1.0 },\n { path: &#x27;/tools&#x27;, changefreq: &#x27;weekly&#x27;, priority: 0.9 },\n { path: &#x27;/blog&#x27;, changefreq: &#x27;daily&#x27;, priority: 0.8 },\n { path: &#x27;/about&#x27;, changefreq: &#x27;monthly&#x27;, priority: 0.6 },\n { path: &#x27;/contact&#x27;, changefreq: &#x27;monthly&#x27;, priority: 0.6 },\n { path: &#x27;/privacy-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/terms-of-use&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/dmca&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n { path: &#x27;/cookies-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.3 },\n];\n\n/**\n * Load tools from the actual tools data file\n */\nasync function loadTools() {\n try {\n // Read the tools.ts file and extract the tools array\n const toolsFilePath = path.join(process.cwd(), &#x27;src&#x27;, &#x27;data&#x27;, &#x27;tools.ts&#x27;);\n const toolsContent = await fs.readFile(toolsFilePath, &#x27;utf-8&#x27;);\n \n // Extract tools data using regex (since we can&#x27;t directly import TypeScript)\n const toolsMatch = toolsContent.match(/export const tools: Tool\\[\\] = \\[([\\s\\S]*?)\\];/);\n if (!toolsMatch) {\n throw new Error(&#x27;Could not parse tools from tools.ts&#x27;);\n }\n \n // Parse each tool object\n const toolsArrayContent = toolsMatch[1];\n const toolObjects = [];\n \n // Split by tool objects (looking for id, name, path patterns)\n const toolMatches = toolsArrayContent.match(/\\{[^}]*id:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*name:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*path:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`][^}]*\\}/g);\n \n if (toolMatches) {\n for (const toolMatch of toolMatches) {\n const idMatch = toolMatch.match(/id:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n const nameMatch = toolMatch.match(/name:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n const pathMatch = toolMatch.match(/path:\\s*[&#x27;\&quot;`]([^&#x27;\&quot;`]+)[&#x27;\&quot;`]/);\n \n if (idMatch &amp;&amp; nameMatch &amp;&amp; pathMatch) {\n toolObjects.push({\n id: idMatch[1],\n name: nameMatch[1],\n path: pathMatch[1]\n });\n }\n }\n }\n \n return toolObjects;\n } catch (error) {\n console.error(&#x27;Error loading tools:&#x27;, error);\n // Fallback to empty array if loading fails\n return [];\n }\n}\n\n// Cache storage (in production, this could be in a database or external cache)\nlet sitemapCache = null;\n\n/**\n * Get site origin\n */\nfunction getSiteOrigin() {\n return process.env.URL || process.env.SITE_URL || &#x27;https://modernphototools.com&#x27;;\n}\n\n/**\n * Escape XML characters\n */\nfunction escapeXml(str) {\n return str\n .replace(/&amp;/g, &#x27;&amp;amp;&#x27;)\n .replace(/&lt;/g, &#x27;&amp;lt;&#x27;)\n .replace(/&gt;/g, &#x27;&amp;gt;&#x27;)\n .replace(/\&quot;/g, &#x27;&amp;quot;&#x27;)\n .replace(/&#x27;/g, &#x27;&amp;#39;&#x27;);\n}\n\n/**\n * Load blog articles from markdown files\n */\nasync function loadBlogArticles() {\n try {\n const contentDir = path.join(process.cwd(), &#x27;content&#x27;, &#x27;blog&#x27;);\n const files = await fs.readdir(contentDir);\n const markdownFiles = files.filter(file =&gt; file.endsWith(&#x27;.md&#x27;));\n \n const articles = [];\n for (const file of markdownFiles) {\n const filePath = path.join(contentDir, file);\n const content = await fs.readFile(filePath, &#x27;utf-8&#x27;);\n \n // Extract frontmatter\n const frontmatterMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (frontmatterMatch) {\n const frontmatter = frontmatterMatch[1];\n const slug = file.replace(&#x27;.md&#x27;, &#x27;&#x27;);\n \n // Parse basic frontmatter (simplified)\n const titleMatch = frontmatter.match(/title:\\s*[\&quot;&#x27;]?([^\&quot;&#x27;\\n]+)[\&quot;&#x27;]?/);\n const dateMatch = frontmatter.match(/date:\\s*[\&quot;&#x27;]?([^\&quot;&#x27;\\n]+)[\&quot;&#x27;]?/);\n \n if (titleMatch) {\n articles.push({\n slug,\n title: titleMatch[1],\n date: dateMatch ? dateMatch[1] : new Date().toISOString(),\n });\n }\n }\n }\n \n return articles;\n } catch (error) {\n console.error(&#x27;Error loading blog articles:&#x27;, error);\n return [];\n }\n}\n\n/**\n * Get all image files from public directory\n */\nasync function getImageFiles() {\n try {\n const imagesDir = path.join(process.cwd(), &#x27;public&#x27;, &#x27;images&#x27;);\n const images = [];\n \n async function scanDirectory(dir, relativePath = &#x27;&#x27;) {\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n await scanDirectory(itemPath, path.join(relativePath, item));\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n images.push({\n path: `/images/${path.join(relativePath, item).replace(/\\\\/g, &#x27;/&#x27;)}`,\n filename: item,\n });\n }\n }\n } catch (error) {\n console.warn(`Could not scan directory ${dir}:`, error.message);\n }\n }\n \n await scanDirectory(imagesDir);\n return images;\n } catch (error) {\n console.error(&#x27;Error loading images:&#x27;, error);\n return [];\n }\n}\n\n/**\n * Generate all sitemap URLs\n */\nasync function getAllSitemapUrls() {\n const baseUrl = getSiteOrigin();\n const urls = [];\n const now = new Date().toISOString().split(&#x27;T&#x27;)[0];\n \n // Add static pages\n STATIC_PAGES.forEach(page =&gt; {\n urls.push({\n loc: `${baseUrl}${page.path}`,\n lastmod: now,\n changefreq: page.changefreq,\n priority: page.priority,\n });\n });\n \n // Add tool pages\n TOOLS.forEach(tool =&gt; {\n urls.push({\n loc: `${baseUrl}${tool.path}`,\n lastmod: now,\n changefreq: &#x27;weekly&#x27;,\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n \n // Add blog articles\n try {\n const articles = await loadBlogArticles();\n articles.forEach(article =&gt; {\n urls.push({\n loc: `${baseUrl}/blog/${article.slug}`,\n lastmod: article.date.split(&#x27;T&#x27;)[0],\n changefreq: &#x27;monthly&#x27;,\n priority: SITEMAP_CONFIG.MEDIUM_PRIORITY,\n });\n });\n } catch (error) {\n console.error(&#x27;Error adding blog articles to sitemap:&#x27;, error);\n }\n \n // Add image files\n try {\n const images = await getImageFiles();\n images.forEach(image =&gt; {\n urls.push({\n loc: `${baseUrl}${image.path}`,\n lastmod: now,\n changefreq: &#x27;yearly&#x27;,\n priority: SITEMAP_CONFIG.LOW_PRIORITY,\n });\n });\n } catch (error) {\n console.error(&#x27;Error adding images to sitemap:&#x27;, error);\n }\n \n return urls;\n}\n\n/**\n * Format sitemap XML\n */\nfunction formatSitemapXml(urls) {\n const xmlHeader = &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&#x27;;\n const urlsetOpen = &#x27;&lt;urlset xmlns=\&quot;http://www.sitemaps.org/schemas/sitemap/0.9\&quot;&gt;&#x27;;\n const urlsetClose = &#x27;&lt;/urlset&gt;&#x27;;\n \n const urlEntries = urls.map(url =&gt; {\n let urlXml = ` &lt;url&gt;\\n &lt;loc&gt;${escapeXml(url.loc)}&lt;/loc&gt;`;\n \n if (url.lastmod) {\n urlXml += `\\n &lt;lastmod&gt;${url.lastmod}&lt;/lastmod&gt;`;\n }\n \n if (url.changefreq) {\n urlXml += `\\n &lt;changefreq&gt;${url.changefreq}&lt;/changefreq&gt;`;\n }\n \n if (url.priority !== undefined) {\n urlXml += `\\n &lt;priority&gt;${url.priority.toFixed(1)}&lt;/priority&gt;`;\n }\n \n urlXml += &#x27;\\n &lt;/url&gt;&#x27;;\n return urlXml;\n }).join(&#x27;\\n&#x27;);\n \n return `${xmlHeader}\\n${urlsetOpen}\\n${urlEntries}\\n${urlsetClose}`;\n}\n\n/**\n * Check if cache is valid\n */\nfunction isCacheValid(timestamp) {\n return timestamp &amp;&amp; (Date.now() - timestamp) &lt; SITEMAP_CONFIG.CACHE_DURATION;\n}\n\n/**\n * Generate sitemap\n */\nasync function generateSitemap() {\n try {\n // Check cache first\n if (sitemapCache &amp;&amp; isCacheValid(sitemapCache.timestamp)) {\n console.log(&#x27;Returning cached sitemap&#x27;);\n return sitemapCache.xml;\n }\n \n console.log(&#x27;Generating new sitemap...&#x27;);\n \n // Get all URLs\n const allUrls = await getAllSitemapUrls();\n console.log(`Found ${allUrls.length} URLs for sitemap`);\n \n // Generate XML\n const xml = formatSitemapXml(allUrls);\n \n // Cache the result\n sitemapCache = {\n xml,\n timestamp: Date.now(),\n urlCount: allUrls.length,\n };\n \n console.log(&#x27;Sitemap generated and cached successfully&#x27;);\n return xml;\n \n } catch (error) {\n console.error(&#x27;Error generating sitemap:&#x27;, error);\n throw new Error(&#x27;Failed to generate sitemap&#x27;);\n }\n}\n\n/**\n * Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === &#x27;OPTIONS&#x27;) {\n return {\n statusCode: 200,\n headers: {\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;GET, OPTIONS&#x27;,\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;,\n },\n body: &#x27;&#x27;,\n };\n }\n \n // Only allow GET requests\n if (event.httpMethod !== &#x27;GET&#x27;) {\n return {\n statusCode: 405,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n },\n body: &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&lt;error&gt;Method Not Allowed&lt;/error&gt;&#x27;,\n };\n }\n \n try {\n console.log(&#x27;Sitemap request received&#x27;);\n \n // Generate sitemap\n const sitemapXml = await generateSitemap();\n \n // Return sitemap with appropriate headers\n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n &#x27;Cache-Control&#x27;: &#x27;public, max-age=3600, s-maxage=3600&#x27;, // Cache for 1 hour\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\n },\n body: sitemapXml,\n };\n \n } catch (error) {\n console.error(&#x27;Error serving sitemap:&#x27;, error);\n \n return {\n statusCode: 500,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/xml; charset=utf-8&#x27;,\n },\n body: &#x27;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;&lt;error&gt;Internal Server Error&lt;/error&gt;&#x27;,\n };\n }\n};&quot;, &quot;// Netlify function for sitemap administration\nconst { handler: sitemapHandler } = require(&#x27;./sitemap&#x27;);\n\n// Simple in-memory cache for admin operations\nlet adminCache = {\n stats: null,\n lastStatsUpdate: null,\n};\n\n/**\n * Validate admin authentication\n */\nfunction isValidAdminToken(authHeader) {\n if (!authHeader) return false;\n \n const token = authHeader.replace(&#x27;Bearer &#x27;, &#x27;&#x27;);\n const validTokens = [\n process.env.SITEMAP_ADMIN_KEY,\n process.env.NETLIFY_AUTH_TOKEN, // Fallback to Netlify token\n ].filter(Boolean);\n \n return validTokens.includes(token);\n}\n\n/**\n * Get sitemap statistics\n */\nasync function getSitemapStats() {\n try {\n // Check cache first (cache for 5 minutes)\n if (adminCache.stats &amp;&amp; adminCache.lastStatsUpdate &amp;&amp; \n (Date.now() - adminCache.lastStatsUpdate) &lt; 5 * 60 * 1000) {\n return adminCache.stats;\n }\n \n // Import sitemap utilities\n const fs = require(&#x27;fs&#x27;).promises;\n const path = require(&#x27;path&#x27;);\n \n // Count blog articles\n let blogCount = 0;\n try {\n const contentDir = path.join(process.cwd(), &#x27;content&#x27;, &#x27;blog&#x27;);\n const files = await fs.readdir(contentDir);\n blogCount = files.filter(file =&gt; file.endsWith(&#x27;.md&#x27;)).length;\n } catch (error) {\n console.warn(&#x27;Could not count blog articles:&#x27;, error.message);\n }\n \n // Count images\n let imageCount = 0;\n try {\n const imagesDir = path.join(process.cwd(), &#x27;public&#x27;, &#x27;images&#x27;);\n \n async function countImages(dir) {\n let count = 0;\n try {\n const items = await fs.readdir(dir);\n \n for (const item of items) {\n const itemPath = path.join(dir, item);\n const stat = await fs.stat(itemPath);\n \n if (stat.isDirectory()) {\n count += await countImages(itemPath);\n } else if (item.match(/\\.(jpg|jpeg|png|gif|webp|svg)$/i)) {\n count++;\n }\n }\n } catch (error) {\n console.warn(`Could not count images in ${dir}:`, error.message);\n }\n return count;\n }\n \n imageCount = await countImages(imagesDir);\n } catch (error) {\n console.warn(&#x27;Could not count images:&#x27;, error.message);\n }\n \n // Calculate totals\n const staticPages = 9; // From STATIC_PAGES array\n const toolPages = 15; // From TOOLS array\n const totalUrls = staticPages + toolPages + blogCount + imageCount;\n \n const stats = {\n totalUrls,\n breakdown: {\n staticPages,\n toolPages,\n blogArticles: blogCount,\n images: imageCount,\n },\n sitemapCount: Math.ceil(totalUrls / 50000),\n lastGenerated: new Date().toISOString(),\n cacheValid: true, // Simplified for this implementation\n };\n \n // Cache the results\n adminCache.stats = stats;\n adminCache.lastStatsUpdate = Date.now();\n \n return stats;\n \n } catch (error) {\n console.error(&#x27;Error getting sitemap stats:&#x27;, error);\n return {\n totalUrls: 0,\n breakdown: {\n staticPages: 0,\n toolPages: 0,\n blogArticles: 0,\n images: 0,\n },\n sitemapCount: 0,\n lastGenerated: null,\n cacheValid: false,\n error: error.message,\n };\n }\n}\n\n/**\n * Invalidate sitemap cache\n */\nfunction invalidateSitemapCache() {\n // Clear admin cache\n adminCache = {\n stats: null,\n lastStatsUpdate: null,\n };\n \n // Clear sitemap cache (this would need to be coordinated with the main sitemap function)\n console.log(&#x27;Sitemap cache invalidated&#x27;);\n \n return {\n success: true,\n message: &#x27;Sitemap cache invalidated successfully&#x27;,\n timestamp: new Date().toISOString(),\n };\n}\n\n/**\n * Regenerate sitemap\n */\nasync function regenerateSitemap() {\n try {\n console.log(&#x27;Manual sitemap regeneration triggered&#x27;);\n \n // Invalidate cache first\n invalidateSitemapCache();\n \n // Generate new sitemap by calling the main sitemap function\n const mockEvent = {\n httpMethod: &#x27;GET&#x27;,\n path: &#x27;/sitemap.xml&#x27;,\n headers: {},\n };\n \n const result = await sitemapHandler(mockEvent, {});\n \n if (result.statusCode === 200) {\n const stats = await getSitemapStats();\n \n return {\n success: true,\n message: &#x27;Sitemap regenerated successfully&#x27;,\n stats,\n timestamp: new Date().toISOString(),\n };\n } else {\n throw new Error(&#x27;Sitemap generation failed&#x27;);\n }\n \n } catch (error) {\n console.error(&#x27;Error during manual sitemap regeneration:&#x27;, error);\n return {\n success: false,\n message: `Failed to regenerate sitemap: ${error.message}`,\n timestamp: new Date().toISOString(),\n };\n }\n}\n\n/**\n * Handle webhook for automatic sitemap updates\n */\nasync function handleWebhook(event) {\n try {\n const body = JSON.parse(event.body || &#x27;{}&#x27;);\n const { action, type } = body;\n \n console.log(&#x27;Webhook received:&#x27;, { action, type });\n \n // Determine if we should regenerate the sitemap\n const shouldRegenerate = [\n &#x27;published&#x27;,\n &#x27;created&#x27;,\n &#x27;updated&#x27;,\n &#x27;deleted&#x27;,\n ].includes(action) &amp;&amp; [\n &#x27;blog&#x27;,\n &#x27;article&#x27;,\n &#x27;page&#x27;,\n &#x27;tool&#x27;,\n &#x27;image&#x27;,\n ].includes(type);\n \n if (shouldRegenerate) {\n console.log(&#x27;Triggering sitemap regeneration due to content change&#x27;);\n const result = await regenerateSitemap();\n \n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n message: &#x27;Webhook processed successfully&#x27;,\n sitemapRegenerated: true,\n result,\n }),\n };\n } else {\n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n message: &#x27;Webhook received but no sitemap regeneration needed&#x27;,\n sitemapRegenerated: false,\n }),\n };\n }\n \n } catch (error) {\n console.error(&#x27;Error processing webhook:&#x27;, error);\n return {\n statusCode: 500,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n error: &#x27;Failed to process webhook&#x27;,\n message: error.message,\n }),\n };\n }\n}\n\n/**\n * Main Netlify function handler\n */\nexports.handler = async function(event, context) {\n // Handle CORS preflight\n if (event.httpMethod === &#x27;OPTIONS&#x27;) {\n return {\n statusCode: 200,\n headers: {\n &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;,\n &#x27;Access-Control-Allow-Methods&#x27;: &#x27;GET, POST, OPTIONS&#x27;,\n &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type, Authorization&#x27;,\n },\n body: &#x27;&#x27;,\n };\n }\n \n const path = event.path || &#x27;&#x27;;\n const method = event.httpMethod;\n \n try {\n // Handle webhook (no auth required for webhooks)\n if (path.includes(&#x27;/webhook&#x27;) &amp;&amp; method === &#x27;POST&#x27;) {\n return await handleWebhook(event);\n }\n \n // All other endpoints require authentication\n const authHeader = event.headers.authorization || event.headers.Authorization;\n if (!isValidAdminToken(authHeader)) {\n return {\n statusCode: 401,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n error: &#x27;Unauthorized&#x27;,\n message: &#x27;Valid admin token required&#x27;,\n }),\n };\n }\n \n // Handle stats request\n if (path.includes(&#x27;/stats&#x27;) &amp;&amp; method === &#x27;GET&#x27;) {\n const stats = await getSitemapStats();\n \n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n &#x27;Cache-Control&#x27;: &#x27;no-cache&#x27;,\n },\n body: JSON.stringify({\n success: true,\n stats,\n timestamp: new Date().toISOString(),\n }),\n };\n }\n \n // Handle regenerate request\n if (path.includes(&#x27;/regenerate&#x27;) &amp;&amp; method === &#x27;POST&#x27;) {\n const result = await regenerateSitemap();\n \n return {\n statusCode: result.success ? 200 : 500,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n &#x27;Cache-Control&#x27;: &#x27;no-cache&#x27;,\n },\n body: JSON.stringify(result),\n };\n }\n \n // Handle cache invalidation request\n if (path.includes(&#x27;/invalidate&#x27;) &amp;&amp; method === &#x27;POST&#x27;) {\n const result = invalidateSitemapCache();\n \n return {\n statusCode: 200,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n &#x27;Cache-Control&#x27;: &#x27;no-cache&#x27;,\n },\n body: JSON.stringify(result),\n };\n }\n \n // Default response for unknown endpoints\n return {\n statusCode: 404,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n error: &#x27;Not Found&#x27;,\n message: &#x27;Unknown admin endpoint&#x27;,\n availableEndpoints: [\n &#x27;GET /stats&#x27;,\n &#x27;POST /regenerate&#x27;,\n &#x27;POST /invalidate&#x27;,\n &#x27;POST /webhook&#x27;,\n ],\n }),\n };\n \n } catch (error) {\n console.error(&#x27;Error in sitemap admin function:&#x27;, error);\n \n return {\n statusCode: 500,\n headers: {\n &#x27;Content-Type&#x27;: &#x27;application/json&#x27;,\n },\n body: JSON.stringify({\n error: &#x27;Internal Server Error&#x27;,\n message: error.message,\n }),\n };\n }\n};&quot;], &quot;mappings&quot;: &quot;;;;;;;AAAA;AAAA,iCAAAA,UAAA;AACA,QAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,QAAM,OAAO,QAAQ,MAAM;AAO3B,QAAM,iBAAiB;AAAA,MACrB,sBAAsB;AAAA,MACtB,gBAAgB,KAAK,KAAK,KAAK;AAAA;AAAA,MAC/B,oBAAoB;AAAA,MACpB,kBAAkB;AAAA,MAClB,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,cAAc;AAAA,IAChB;AAGA,QAAM,eAAe;AAAA,MACnB,EAAE,MAAM,KAAK,YAAY,SAAS,UAAU,EAAI;AAAA,MAChD,EAAE,MAAM,UAAU,YAAY,UAAU,UAAU,IAAI;AAAA,MACtD,EAAE,MAAM,SAAS,YAAY,SAAS,UAAU,IAAI;AAAA,MACpD,EAAE,MAAM,UAAU,YAAY,WAAW,UAAU,IAAI;AAAA,MACvD,EAAE,MAAM,YAAY,YAAY,WAAW,UAAU,IAAI;AAAA,MACzD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,MAC/D,EAAE,MAAM,iBAAiB,YAAY,UAAU,UAAU,IAAI;AAAA,MAC7D,EAAE,MAAM,SAAS,YAAY,UAAU,UAAU,IAAI;AAAA,MACrD,EAAE,MAAM,mBAAmB,YAAY,UAAU,UAAU,IAAI;AAAA,IACjE;AAiDA,QAAI,eAAe;AAKnB,aAAS,gBAAgB;AACvB,aAAO,QAAQ,IAAI,OAAO,QAAQ,IAAI,YAAY;AAAA,IACpD;AAKA,aAAS,UAAU,KAAK;AACtB,aAAO,IACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAAA,IAC1B;AAKA,mBAAe,mBAAmB;AAChC,UAAI;AACF,cAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,cAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,cAAM,gBAAgB,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC;AAE/D,cAAM,WAAW,CAAC;AAClB,mBAAW,QAAQ,eAAe;AAChC,gBAAM,WAAW,KAAK,KAAK,YAAY,IAAI;AAC3C,gBAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AAGnD,gBAAM,mBAAmB,QAAQ,MAAM,uBAAuB;AAC9D,cAAI,kBAAkB;AACpB,kBAAM,cAAc,iBAAiB,CAAC;AACtC,kBAAM,OAAO,KAAK,QAAQ,OAAO,EAAE;AAGnC,kBAAM,aAAa,YAAY,MAAM,+BAA+B;AACpE,kBAAM,YAAY,YAAY,MAAM,8BAA8B;AAElE,gBAAI,YAAY;AACd,uBAAS,KAAK;AAAA,gBACZ;AAAA,gBACA,OAAO,WAAW,CAAC;AAAA,gBACnB,MAAM,YAAY,UAAU,CAAC,KAAI,oBAAI,KAAK,GAAE,YAAY;AAAA,cAC1D,CAAC;AAAA,YACH;AAAA,UACF;AAAA,QACF;AAEA,eAAO;AAAA,MACT,SAAS,OAAO;AACd,gBAAQ,MAAM,gCAAgC,KAAK;AACnD,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAKA,mBAAe,gBAAgB;AAC7B,UAAI;AACF,cAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAC7D,cAAM,SAAS,CAAC;AAEhB,uBAAe,cAAc,KAAK,eAAe,IAAI;AACnD,cAAI;AACF,kBAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,uBAAW,QAAQ,OAAO;AACxB,oBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,oBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,kBAAI,KAAK,YAAY,GAAG;AACtB,sBAAM,cAAc,UAAU,KAAK,KAAK,cAAc,IAAI,CAAC;AAAA,cAC7D,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD,uBAAO,KAAK;AAAA,kBACV,MAAM,WAAW,KAAK,KAAK,cAAc,IAAI,EAAE,QAAQ,OAAO,GAAG,CAAC;AAAA,kBAClE,UAAU;AAAA,gBACZ,CAAC;AAAA,cACH;AAAA,YACF;AAAA,UACF,SAAS,OAAO;AACd,oBAAQ,KAAK,4BAA4B,GAAG,KAAK,MAAM,OAAO;AAAA,UAChE;AAAA,QACF;AAEA,cAAM,cAAc,SAAS;AAC7B,eAAO;AAAA,MACT,SAAS,OAAO;AACd,gBAAQ,MAAM,yBAAyB,KAAK;AAC5C,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAKA,mBAAe,oBAAoB;AACjC,YAAM,UAAU,cAAc;AAC9B,YAAM,OAAO,CAAC;AACd,YAAM,OAAM,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAGjD,mBAAa,QAAQ,UAAQ;AAC3B,aAAK,KAAK;AAAA,UACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT,YAAY,KAAK;AAAA,UACjB,UAAU,KAAK;AAAA,QACjB,CAAC;AAAA,MACH,CAAC;AAGD,YAAM,QAAQ,UAAQ;AACpB,aAAK,KAAK;AAAA,UACR,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,UAAU,eAAe;AAAA,QAC3B,CAAC;AAAA,MACH,CAAC;AAGD,UAAI;AACF,cAAM,WAAW,MAAM,iBAAiB;AACxC,iBAAS,QAAQ,aAAW;AAC1B,eAAK,KAAK;AAAA,YACR,KAAK,GAAG,OAAO,SAAS,QAAQ,IAAI;AAAA,YACpC,SAAS,QAAQ,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,YAClC,YAAY;AAAA,YACZ,UAAU,eAAe;AAAA,UAC3B,CAAC;AAAA,QACH,CAAC;AAAA,MACH,SAAS,OAAO;AACd,gBAAQ,MAAM,0CAA0C,KAAK;AAAA,MAC/D;AAGA,UAAI;AACF,cAAM,SAAS,MAAM,cAAc;AACnC,eAAO,QAAQ,WAAS;AACtB,eAAK,KAAK;AAAA,YACR,KAAK,GAAG,OAAO,GAAG,MAAM,IAAI;AAAA,YAC5B,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,UAAU,eAAe;AAAA,UAC3B,CAAC;AAAA,QACH,CAAC;AAAA,MACH,SAAS,OAAO;AACd,gBAAQ,MAAM,mCAAmC,KAAK;AAAA,MACxD;AAEA,aAAO;AAAA,IACT;AAKA,aAAS,iBAAiB,MAAM;AAC9B,YAAM,YAAY;AAClB,YAAM,aAAa;AACnB,YAAM,cAAc;AAEpB,YAAM,aAAa,KAAK,IAAI,SAAO;AACjC,YAAI,SAAS;AAAA,WAAqB,UAAU,IAAI,GAAG,CAAC;AAEpD,YAAI,IAAI,SAAS;AACf,oBAAU;AAAA,eAAkB,IAAI,OAAO;AAAA,QACzC;AAEA,YAAI,IAAI,YAAY;AAClB,oBAAU;AAAA,kBAAqB,IAAI,UAAU;AAAA,QAC/C;AAEA,YAAI,IAAI,aAAa,QAAW;AAC9B,oBAAU;AAAA,gBAAmB,IAAI,SAAS,QAAQ,CAAC,CAAC;AAAA,QACtD;AAEA,kBAAU;AACV,eAAO;AAAA,MACT,CAAC,EAAE,KAAK,IAAI;AAEZ,aAAO,GAAG,SAAS;AAAA,EAAK,UAAU;AAAA,EAAK,UAAU;AAAA,EAAK,WAAW;AAAA,IACnE;AAKA,aAAS,aAAa,WAAW;AAC/B,aAAO,aAAc,KAAK,IAAI,IAAI,YAAa,eAAe;AAAA,IAChE;AAKA,mBAAe,kBAAkB;AAC/B,UAAI;AAEF,YAAI,gBAAgB,aAAa,aAAa,SAAS,GAAG;AACxD,kBAAQ,IAAI,0BAA0B;AACtC,iBAAO,aAAa;AAAA,QACtB;AAEA,gBAAQ,IAAI,2BAA2B;AAGvC,cAAM,UAAU,MAAM,kBAAkB;AACxC,gBAAQ,IAAI,SAAS,QAAQ,MAAM,mBAAmB;AAGtD,cAAM,MAAM,iBAAiB,OAAO;AAGpC,uBAAe;AAAA,UACb;AAAA,UACA,WAAW,KAAK,IAAI;AAAA,UACpB,UAAU,QAAQ;AAAA,QACpB;AAEA,gBAAQ,IAAI,2CAA2C;AACvD,eAAO;AAAA,MAET,SAAS,OAAO;AACd,gBAAQ,MAAM,6BAA6B,KAAK;AAChD,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC9C;AAAA,IACF;AAKA,IAAAA,SAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,UAAI,MAAM,eAAe,WAAW;AAClC,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,+BAA+B;AAAA,YAC/B,gCAAgC;AAAA,YAChC,gCAAgC;AAAA,UAClC;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAGA,UAAI,MAAM,eAAe,OAAO;AAC9B,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,UAClB;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAEA,UAAI;AACF,gBAAQ,IAAI,0BAA0B;AAGtC,cAAM,aAAa,MAAM,gBAAgB;AAGzC,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,YAChB,iBAAiB;AAAA;AAAA,YACjB,+BAA+B;AAAA,UACjC;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MAEF,SAAS,OAAO;AACd,gBAAQ,MAAM,0BAA0B,KAAK;AAE7C,eAAO;AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,YACP,gBAAgB;AAAA,UAClB;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;AChXA,IAAM,EAAE,SAAS,eAAe,IAAI;AAGpC,IAAI,aAAa;AAAA,EACf,OAAO;AAAA,EACP,iBAAiB;AACnB;AAKA,SAAS,kBAAkB,YAAY;AACrC,MAAI,CAAC,WAAY,QAAO;AAExB,QAAM,QAAQ,WAAW,QAAQ,WAAW,EAAE;AAC9C,QAAM,cAAc;AAAA,IAClB,QAAQ,IAAI;AAAA,IACZ,QAAQ,IAAI;AAAA;AAAA,EACd,EAAE,OAAO,OAAO;AAEhB,SAAO,YAAY,SAAS,KAAK;AACnC;AAKA,eAAe,kBAAkB;AAC/B,MAAI;AAEF,QAAI,WAAW,SAAS,WAAW,mBAC9B,KAAK,IAAI,IAAI,WAAW,kBAAmB,IAAI,KAAK,KAAM;AAC7D,aAAO,WAAW;AAAA,IACpB;AAGA,UAAM,KAAK,QAAQ,IAAI,EAAE;AACzB,UAAM,OAAO,QAAQ,MAAM;AAG3B,QAAI,YAAY;AAChB,QAAI;AACF,YAAM,aAAa,KAAK,KAAK,QAAQ,IAAI,GAAG,WAAW,MAAM;AAC7D,YAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,kBAAY,MAAM,OAAO,UAAQ,KAAK,SAAS,KAAK,CAAC,EAAE;AAAA,IACzD,SAAS,OAAO;AACd,cAAQ,KAAK,kCAAkC,MAAM,OAAO;AAAA,IAC9D;AAGA,QAAI,aAAa;AACjB,QAAI;AACF,YAAM,YAAY,KAAK,KAAK,QAAQ,IAAI,GAAG,UAAU,QAAQ;AAE7D,qBAAe,YAAY,KAAK;AAC9B,YAAI,QAAQ;AACZ,YAAI;AACF,gBAAM,QAAQ,MAAM,GAAG,QAAQ,GAAG;AAElC,qBAAW,QAAQ,OAAO;AACxB,kBAAM,WAAW,KAAK,KAAK,KAAK,IAAI;AACpC,kBAAM,OAAO,MAAM,GAAG,KAAK,QAAQ;AAEnC,gBAAI,KAAK,YAAY,GAAG;AACtB,uBAAS,MAAM,YAAY,QAAQ;AAAA,YACrC,WAAW,KAAK,MAAM,iCAAiC,GAAG;AACxD;AAAA,YACF;AAAA,UACF;AAAA,QACF,SAAS,OAAO;AACd,kBAAQ,KAAK,6BAA6B,GAAG,KAAK,MAAM,OAAO;AAAA,QACjE;AACA,eAAO;AAAA,MACT;AAEA,mBAAa,MAAM,YAAY,SAAS;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,KAAK,2BAA2B,MAAM,OAAO;AAAA,IACvD;AAGA,UAAM,cAAc;AACpB,UAAM,YAAY;AAClB,UAAM,YAAY,cAAc,YAAY,YAAY;AAExD,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,cAAc;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MACA,cAAc,KAAK,KAAK,YAAY,GAAK;AAAA,MACzC,gBAAe,oBAAI,KAAK,GAAE,YAAY;AAAA,MACtC,YAAY;AAAA;AAAA,IACd;AAGA,eAAW,QAAQ;AACnB,eAAW,kBAAkB,KAAK,IAAI;AAEtC,WAAO;AAAA,EAET,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO;AAAA,MACL,WAAW;AAAA,MACX,WAAW;AAAA,QACT,aAAa;AAAA,QACb,WAAW;AAAA,QACX,cAAc;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,OAAO,MAAM;AAAA,IACf;AAAA,EACF;AACF;AAKA,SAAS,yBAAyB;AAEhC,eAAa;AAAA,IACX,OAAO;AAAA,IACP,iBAAiB;AAAA,EACnB;AAGA,UAAQ,IAAI,2BAA2B;AAEvC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACF;AAKA,eAAe,oBAAoB;AACjC,MAAI;AACF,YAAQ,IAAI,uCAAuC;AAGnD,2BAAuB;AAGvB,UAAM,YAAY;AAAA,MAChB,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,IACZ;AAEA,UAAM,SAAS,MAAM,eAAe,WAAW,CAAC,CAAC;AAEjD,QAAI,OAAO,eAAe,KAAK;AAC7B,YAAM,QAAQ,MAAM,gBAAgB;AAEpC,aAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MACpC;AAAA,IACF,OAAO;AACL,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,6CAA6C,KAAK;AAChE,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,iCAAiC,MAAM,OAAO;AAAA,MACvD,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAKA,eAAe,cAAc,OAAO;AAClC,MAAI;AACF,UAAM,OAAO,KAAK,MAAM,MAAM,QAAQ,IAAI;AAC1C,UAAM,EAAE,QAAQ,KAAK,IAAI;AAEzB,YAAQ,IAAI,qBAAqB,EAAE,QAAQ,KAAK,CAAC;AAGjD,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,MAAM,KAAK;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,IAAI;AAEf,QAAI,kBAAkB;AACpB,cAAQ,IAAI,uDAAuD;AACnE,YAAM,SAAS,MAAM,kBAAkB;AAEvC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT,oBAAoB;AAAA,UACpB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,OAAO;AACL,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT,oBAAoB;AAAA,QACtB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,6BAA6B,KAAK;AAChD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAKA,QAAQ,UAAU,eAAe,OAAO,SAAS;AAE/C,MAAI,MAAM,eAAe,WAAW;AAClC,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,+BAA+B;AAAA,QAC/B,gCAAgC;AAAA,QAChC,gCAAgC;AAAA,MAClC;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,QAAM,OAAO,MAAM,QAAQ;AAC3B,QAAM,SAAS,MAAM;AAErB,MAAI;AAEF,QAAI,KAAK,SAAS,UAAU,KAAK,WAAW,QAAQ;AAClD,aAAO,MAAM,cAAc,KAAK;AAAA,IAClC;AAGA,UAAM,aAAa,MAAM,QAAQ,iBAAiB,MAAM,QAAQ;AAChE,QAAI,CAAC,kBAAkB,UAAU,GAAG;AAClC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,QAAQ,KAAK,WAAW,OAAO;AAC/C,YAAM,QAAQ,MAAM,gBAAgB;AAEpC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,SAAS;AAAA,UACT;AAAA,UACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,QACpC,CAAC;AAAA,MACH;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,aAAa,KAAK,WAAW,QAAQ;AACrD,YAAM,SAAS,MAAM,kBAAkB;AAEvC,aAAO;AAAA,QACL,YAAY,OAAO,UAAU,MAAM;AAAA,QACnC,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU,MAAM;AAAA,MAC7B;AAAA,IACF;AAGA,QAAI,KAAK,SAAS,aAAa,KAAK,WAAW,QAAQ;AACrD,YAAM,SAAS,uBAAuB;AAEtC,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,UACP,gBAAgB;AAAA,UAChB,iBAAiB;AAAA,QACnB;AAAA,QACA,MAAM,KAAK,UAAU,MAAM;AAAA,MAC7B;AAAA,IACF;AAGA,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS;AAAA,QACT,oBAAoB;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EAEF,SAAS,OAAO;AACd,YAAQ,MAAM,oCAAoC,KAAK;AAEvD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU;AAAA,QACnB,OAAO;AAAA,QACP,SAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF;&quot;, &quot;names&quot;: [&quot;exports&quot;] } </div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ package.json</div> <div class="content">{&quot;type&quot;:&quot;commonjs&quot;}</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ sitemap-admin.js</div> <div class="content">module.exports = require(&#x27;./netlify/functions/sitemap-admin.js&#x27;)</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ state.json</div> <div class="content">{ &quot;geolocation&quot;: { &quot;data&quot;: { &quot;city&quot;: &quot;Damietta&quot;, &quot;country&quot;: { &quot;code&quot;: &quot;EG&quot;, &quot;name&quot;: &quot;Egypt&quot; }, &quot;subdivision&quot;: { &quot;code&quot;: &quot;DT&quot;, &quot;name&quot;: &quot;Damietta Governorate&quot; }, &quot;timezone&quot;: &quot;Africa/Cairo&quot;, &quot;latitude&quot;: 31.4166, &quot;longitude&quot;: 31.8105 }, &quot;timestamp&quot;: 1761763857385 } }</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ v1</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ functions</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ .trae</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ documents</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ .vite</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ deps</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ _metadata.json</div> <div class="content">{ &quot;hash&quot;: &quot;d387aa5f&quot;, &quot;configHash&quot;: &quot;ed5bde56&quot;, &quot;lockfileHash&quot;: &quot;e3b0c442&quot;, &quot;browserHash&quot;: &quot;3351bb2f&quot;, &quot;optimized&quot;: {}, &quot;chunks&quot;: {} }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ package.json</div> <div class="content">{ &quot;type&quot;: &quot;module&quot; } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ NETLIFY_DEPLOYMENT.md</div> <div class="content"># Netlify Deployment Guide This guide explains how to deploy the LightX API proxy function to Netlify. ## Prerequisites 1. A Netlify account 2. Netlify CLI installed (`npm install -g netlify-cli`) 3. Your LightX API key ## Deployment Steps ### 1. Set up Environment Variables You need to set up your LightX API key as an environment variable in Netlify: 1. Go to your Netlify site dashboard 2. Navigate to Site settings &gt; Build &amp; deploy &gt; Environment 3. Add a new variable: - Key: `LIGHTX_API_KEY` - Value: `13fc2dd3a975430b93850487c527d817_90b2d76b36a3491aa0d429457da8e3eb_andoraitools` ### 2. Deploy to Netlify You can deploy to Netlify using the Netlify CLI: ```bash # Login to Netlify npm install -g netlify-cli netlify login # Initialize your site (if not already done) netlify init # Deploy to Netlify netlify deploy --prod ``` Alternatively, you can connect your GitHub repository to Netlify for automatic deployments. ### 3. Verify Function Deployment After deployment, verify that your function is working: 1. Go to your Netlify site dashboard 2. Navigate to Functions 3. You should see `lightx-proxy` listed 4. Test the function by making a request to `https://your-netlify-site.netlify.app/api/lightx-proxy` ## Local Development For local development, you can use the Netlify CLI to test your functions: ```bash # Install dependencies in the functions directory cd netlify/functions npm install # Start the Netlify dev server cd ../.. netlify dev ``` This will start a local development server that simulates the Netlify environment, including your functions. ## Troubleshooting ### Function Not Found If your function is not found, check: 1. The function file is in the correct location (`netlify/functions/lightx-proxy.js`) 2. The `netlify.toml` file has the correct redirects 3. The function has been deployed successfully ### 403 Forbidden Error If you&#x27;re getting a 403 Forbidden error from the LightX API: 1. Check that your API key is correctly set in the Netlify environment variables 2. Verify that your API key is valid and has not expired 3. Check the function logs in the Netlify dashboard for more details ### CORS Issues If you&#x27;re experiencing CORS issues: 1. Check that the function is returning the correct CORS headers 2. Verify that your frontend is making requests to the correct URL ## Additional Resources - [Netlify Functions Documentation](https://docs.netlify.com/functions/overview/) - [Netlify CLI Documentation](https://docs.netlify.com/cli/get-started/)</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ NETLIFY_FUNCTION_SECURITY.md</div> <div class="content"># Netlify Serverless Function Security Guide ## Overview This document outlines the security enhancements implemented in the Netlify serverless function for dynamic environment variable access and secure API key handling. ## Key Security Features ### 1. Runtime Environment Variable Access - **Dynamic Reading**: Environment variables are read at runtime using `process.env`, not at build time - **Validation**: All environment variables are validated before use - **Secure Retrieval**: The `getSecureEnvVar()` function provides secure access with validation ### 2. API Key Security - **Runtime Validation**: API keys are validated for format and length - **Secure Storage**: API keys are stored in Netlify environment variables (not in code) - **No Logging**: API key values are never logged, only their presence is confirmed ### 3. Input Validation - **JSON Parsing**: Safe JSON parsing with error handling - **Endpoint Validation**: Endpoint parameters are validated for type and format - **Request Body Validation**: Request bodies are validated as proper objects ### 4. Error Handling - **Standardized Responses**: All errors use the `createErrorResponse()` function - **Detailed Logging**: Errors are logged with full details for debugging - **No Sensitive Data**: Error responses never expose sensitive information ### 5. Request Security - **Timeout Protection**: 30-second timeout prevents hanging requests - **CORS Headers**: Proper CORS headers for cross-origin requests - **User Agent**: Custom User-Agent header for API identification - **Cache Control**: No-cache headers prevent sensitive data caching ## Environment Variables Required ### Production Environment Set these in your Netlify dashboard under Site Settings &gt; Environment Variables: ``` LIGHTX_API_KEY=your_actual_api_key_here NODE_ENV=production ``` ### Development Environment For local testing, create a `.env` file in the `netlify/functions` directory: ``` LIGHTX_API_KEY=your_test_api_key_here NODE_ENV=development ``` ## Security Best Practices Implemented 1. **No Build-Time Dependencies**: Environment variables are accessed at runtime only 2. **Input Sanitization**: All inputs are validated and sanitized 3. **Error Boundaries**: Comprehensive error handling prevents crashes 4. **Logging Controls**: Sensitive information is never logged 5. **Timeout Protection**: Prevents resource exhaustion attacks 6. **CORS Security**: Proper CORS configuration for web security ## Testing the Function ### Local Testing 1. Install Netlify CLI: `npm install -g netlify-cli` 2. Run locally: `netlify dev` 3. Test endpoint: `http://localhost:8888/.netlify/functions/lightx-proxy` ### Production Testing 1. Deploy to Netlify 2. Set environment variables in Netlify dashboard 3. Test with your application ## Deployment Notes - **No Redeployment Required**: Environment variable changes take effect immediately - **Zero Downtime**: Function updates don&#x27;t require application restarts - **Secure by Default**: All security features are enabled by default ## Monitoring and Debugging - **Development Mode**: Detailed logging when `NODE_ENV` is not &quot;production&quot; - **Error Tracking**: All errors are logged with stack traces - **Performance Monitoring**: Request/response timing information available ## Security Checklist - [ ] Environment variables set in Netlify dashboard - [ ] API keys are not committed to version control - [ ] Function deployed and tested - [ ] Error handling verified - [ ] CORS headers working correctly - [ ] Timeout protection tested - [ ] Input validation confirmed</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ New Text Document.txt</div> <div class="content">Complete Specification: AI Prompt Generator Tool Executive Summary A rule-based, interactive prompt engineering tool that transforms amateur AI prompts into professional-grade prompts using 4 proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Zero authentication required, completely free, educational, and seamlessly integrated into modernphototools.com. 1. Product Overview Core Value Proposition &quot;Turn your simple AI idea into a professional prompt in 60 secondsโ€”no AI expertise required.&quot; Target Users Photographers using AI image generators (Midjourney, DALL-E, Stable Diffusion) Content creators using ChatGPT, Claude, Gemini Marketers writing AI-powered copy Anyone frustrated with generic AI outputs Key Differentiator Educational + Practical: Users don&#x27;t just get a better promptโ€”they learn WHY it&#x27;s better through contextual tooltips. 2. User Journey Flow Landing Page (Quick-Start Wizard) โ†“ [4 Big Visual Cards - User Selects Goal] โ†“ Initial Prompt Input โ†“ Framework Auto-Detected (Rule-Based) โ†“ Adaptive Questionnaire (3-7 questions) โ†“ Before/After Comparison Display โ†“ Copy to Clipboard โ†’ Done 3. Detailed Feature Specification 3.1 Landing Page (/prompt-generator) Layout: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ [Site Header - Existing Component] โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ ๐ŸŽฏ AI Prompt Generator โ”‚ โ”‚ Transform simple ideas into โ”‚ โ”‚ professional AI prompts โ”‚ โ”‚ โ”‚ โ”‚ What do you want to create? โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ ๐Ÿ“Š ICDF โ”‚ โ”‚ ๐Ÿ‘” RCREOCโ”‚ โ”‚ โ”‚ โ”‚ Analyze โ”‚ โ”‚ Expert โ”‚ โ”‚ โ”‚ โ”‚ Data โ”‚ โ”‚ Advice โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โœ๏ธ MICRO โ”‚ โ”‚ ๐Ÿ’ฐ COSTARโ”‚ โ”‚ โ”‚ โ”‚ Create โ”‚ โ”‚ Marketingโ”‚ โ”‚ โ”‚ โ”‚ Content โ”‚ โ”‚ &amp; Sales โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ [Not sure? Describe your goal โ†’] โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Framework Cards: Framework Icon Title Subtitle Use Cases ICDF ๐Ÿ“Š Analyze Data Get precise, analytical results &quot;Review my photos&quot;, &quot;Analyze traffic&quot;, &quot;Evaluate performance&quot; RCREOC ๐Ÿ‘” Expert Advice Create an AI expert consultant &quot;Professional feedback&quot;, &quot;Technical review&quot;, &quot;Expert opinion&quot; MICRO โœ๏ธ Create Content Write compelling content &quot;Blog post&quot;, &quot;YouTube script&quot;, &quot;Social media&quot;, &quot;Image prompt&quot; COSTAR ๐Ÿ’ฐ Marketing &amp; Sales Craft persuasive copy &quot;Sales email&quot;, &quot;Product description&quot;, &quot;Ad copy&quot; Visual Design: Cards: 2x2 grid on desktop, stacked on mobile Each card: Icon (large), Title (bold), Subtitle (light), hover effect Colors: Match existing site palette &quot;Not sure?&quot; fallback: Opens text area with keyword detection 3.2 Framework Detection Logic (Rule-Based) File: /lib/prompt-frameworks/detector.ts typescript interface KeywordMap { framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; keywords: string[]; weight: number; } const DETECTION_RULES: KeywordMap[] = [ { framework: &#x27;ICDF&#x27;, keywords: [&#x27;analyze&#x27;, &#x27;review&#x27;, &#x27;evaluate&#x27;, &#x27;assess&#x27;, &#x27;data&#x27;, &#x27;metrics&#x27;, &#x27;performance&#x27;, &#x27;statistics&#x27;, &#x27;report&#x27;, &#x27;insights&#x27;], weight: 1 }, { framework: &#x27;RCREOC&#x27;, keywords: [&#x27;expert&#x27;, &#x27;professional&#x27;, &#x27;advice&#x27;, &#x27;consult&#x27;, &#x27;opinion&#x27;, &#x27;feedback&#x27;, &#x27;critique&#x27;, &#x27;recommend&#x27;, &#x27;specialist&#x27;], weight: 1 }, { framework: &#x27;MICRO&#x27;, keywords: [&#x27;write&#x27;, &#x27;create&#x27;, &#x27;content&#x27;, &#x27;blog&#x27;, &#x27;script&#x27;, &#x27;post&#x27;, &#x27;article&#x27;, &#x27;story&#x27;, &#x27;caption&#x27;, &#x27;image&#x27;, &#x27;photo&#x27;, &#x27;picture&#x27;, &#x27;generate&#x27;], weight: 1 }, { framework: &#x27;COSTAR&#x27;, keywords: [&#x27;sell&#x27;, &#x27;marketing&#x27;, &#x27;email&#x27;, &#x27;ad&#x27;, &#x27;promotion&#x27;, &#x27;sales&#x27;, &#x27;campaign&#x27;, &#x27;offer&#x27;, &#x27;discount&#x27;, &#x27;buy&#x27;, &#x27;customer&#x27;], weight: 1 } ]; function detectFramework(userInput: string): string { // Scoring logic: count keyword matches // Return framework with highest score // Default to MICRO if no clear match } 3.3 Adaptive Questionnaire System Question Types: Multiple Choice (Buttons) Tone/Style selection Target audience categories Content format types Timeframe/urgency Text Input (Fields) Product/service descriptions Specific context details Custom data inputs Unique requirements Question Sets by Framework: ICDF Questions: Instruction (Text): &quot;What specific task should the AI perform?&quot; Placeholder: &quot;e.g., Analyze my portfolio&#x27;s engagement metrics&quot; Context (Text): &quot;Why do you need this analysis?&quot; Placeholder: &quot;e.g., I want to know which photos get the most client inquiries&quot; Tooltip: &quot;Context helps the AI understand your goals and tailor the analysis&quot; Data Type (Multiple Choice): Numbers/Statistics Text/Documents Images/Visual content Mixed data Tooltip: &quot;Specifying data type ensures proper analysis methods&quot; Output Format (Multiple Choice): Bullet points Table/Chart Detailed report Executive summary Tooltip: &quot;Format determines how readable and actionable your results are&quot; RCREOC Questions: Role (Multiple Choice): Senior Art Director Marketing Strategist Technical Expert Business Consultant Custom (text input) Tooltip: &quot;The AI adopts this professional perspective&quot; Context (Text): &quot;Describe the situation or project&quot; Placeholder: &quot;e.g., Reviewing a new photographer&#x27;s portfolio for a campaign&quot; Request (Text): &quot;What specific task should this expert perform?&quot; Placeholder: &quot;e.g., Identify strengths and weaknesses in composition&quot; Output Structure (Multiple Choice): Table Numbered list Pros/Cons format Detailed paragraphs Tooltip: &quot;Structure makes expert feedback actionable&quot; Tone (Multiple Choice): Constructive &amp; encouraging Direct &amp; critical Formal &amp; professional Friendly &amp; casual Tooltip: &quot;Sets the communication style of your AI expert&quot; MICRO Questions: Message (Text): &quot;What&#x27;s the core idea you want to communicate?&quot; Placeholder: &quot;e.g., Aperture controls both light and depth of field&quot; Tooltip: &quot;Your central thesis or key takeaway&quot; Intention (Multiple Choice): Educate/Teach Persuade/Convince Entertain Inspire action Tooltip: &quot;What should the audience feel or do after reading?&quot; Target Audience (Text): &quot;Who is this for?&quot; Placeholder: &quot;e.g., Beginner photographers, 25-40 years old&quot; Tooltip: &quot;Specific audience = specific language and examples&quot; Rhythm/Tone (Multiple Choice): Fast-paced &amp; exciting Calm &amp; instructional Witty &amp; conversational Formal &amp; authoritative Tooltip: &quot;The &#x27;voice&#x27; and pacing of your content&quot; Output Format (Multiple Choice): Blog post YouTube script Social media post Email newsletter Image generation prompt Tooltip: &quot;Format determines structure and length&quot; Content Length (Multiple Choice - only if applicable): Short (1-2 min read) Medium (5 min read) Long-form (10+ min) COSTAR Questions: Context (Text): &quot;What&#x27;s the situation or launch?&quot; Placeholder: &quot;e.g., Launching new Lightroom presets&quot; Offer (Text): &quot;What&#x27;s the specific product/deal?&quot; Placeholder: &quot;e.g., 25% off for first 3 days&quot; Tooltip: &quot;Clear offers convert better&quot; Style/Tone (Multiple Choice): Elegant &amp; sophisticated Urgent &amp; exciting Friendly &amp; warm Professional &amp; trustworthy Tooltip: &quot;Brand voice affects trust and conversion&quot; Target Audience (Text): &quot;Who are you selling to?&quot; Placeholder: &quot;e.g., 25-45 year old wedding photographers&quot; Tooltip: &quot;Specific targeting = specific messaging&quot; Desired Action (Text): &quot;What should they do?&quot; Placeholder: &quot;e.g., Click to buy before offer expires&quot; Tooltip: &quot;One clear CTA performs best&quot; Business Goal (Multiple Choice): Drive immediate sales Build email list Increase brand awareness Get trial signups Tooltip: &quot;Goal shapes the entire message&quot; 3.4 Smart Defaults System File: /lib/prompt-frameworks/defaults.ts typescript const SMART_DEFAULTS = { ICDF: { context: &quot;For general analysis and insights&quot;, format: &quot;Clear bullet points with key findings&quot; }, RCREOC: { role: &quot;Experienced professional consultant&quot;, tone: &quot;Constructive and professional&quot;, output: &quot;Organized list format&quot; }, MICRO: { tone: &quot;Professional and clear&quot;, audience: &quot;General audience&quot;, length: &quot;Medium-length content&quot; }, COSTAR: { style: &quot;Professional and trustworthy&quot;, goal: &quot;Drive conversions&quot; } }; Logic: If user skips a question, apply the default silently. No warnings neededโ€”the prompt will still be professional-grade. 3.5 Prompt Assembly Engine File: /lib/prompt-frameworks/assembler.ts Each framework has a template structure: typescript // ICDF Template const ICDFTemplate = (answers: ICDFAnswers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context || SMART_DEFAULTS.ICDF.context} **Data:** ${answers.dataType} data is provided. ${answers.dataDetails || &#x27;&#x27;} **Format:** Please provide the output as ${answers.outputFormat || SMART_DEFAULTS.ICDF.format}. `; // RCREOC Template const RCREOCTemplate = (answers: RCREOCAnswers) =&gt; ` **Role:** You are ${answers.role || SMART_DEFAULTS.RCREOC.role}. **Context:** ${answers.context} **Request:** ${answers.request} ${answers.examples ? `**Example:** ${answers.examples}` : &#x27;&#x27;} **Output:** Provide your response as ${answers.outputStructure || SMART_DEFAULTS.RCREOC.output}. **Constraints:** ${answers.tone || SMART_DEFAULTS.RCREOC.tone} tone. ${answers.additionalConstraints || &#x27;&#x27;} `; // MICRO Template const MICROTemplate = (answers: MICROAnswers) =&gt; ` **Message:** ${answers.message} **Intention:** The goal is to ${answers.intention}. **Context:** The audience is ${answers.targetAudience || SMART_DEFAULTS.MICRO.audience}. They will see this as ${answers.outputFormat}. **Rhythm:** The tone should be ${answers.rhythmTone || SMART_DEFAULTS.MICRO.tone}. ${answers.styleNotes || &#x27;&#x27;} **Output:** Create ${answers.outputFormat}${answers.contentLength ? ` (${answers.contentLength})` : &#x27;&#x27;}. `; // COSTAR Template const COSTARTemplate = (answers: COSTARAnswers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.styleTone || SMART_DEFAULTS.COSTAR.style}. **Target:** This is for ${answers.targetAudience}. **Action:** The reader should ${answers.desiredAction}. **Result:** The business goal is to ${answers.businessGoal || SMART_DEFAULTS.COSTAR.goal}. `; 3.6 Before/After Display Desktop Layout (Side-by-Side): โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Transformation โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Your Original Promptโ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ โ”‚ &quot;Write a script โ”‚ **Message:** The script needs โ”‚ โ”‚ about aperture&quot; โ”‚ to explain that aperture... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal is... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Context:** The audience... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ (Full MICRO framework) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Mobile Layout (Stacked): โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Original Prompt โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ &quot;Write a script about โ”‚ โ”‚ aperture&quot; โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ Transformed into โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ **Message:** The script... โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal... โ”‚ โ”‚ โ”‚ โ”‚ (Full framework) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Visual Design: Original prompt: Light gray background, smaller text Professional version: White/highlighted background, larger text Copy button: Primary color, prominent placement Framework labels (Message, Intention, etc.): Bold, colored 3.7 Learning Mode Tooltips Implementation: Small (?) icon next to each question Hover on desktop = tooltip appears Click on mobile = tooltip expands Max 1-2 sentences per tooltip Example Tooltips: Question Tooltip Text Context (ICDF) &quot;Context helps the AI understand your goals and prioritize what matters most in the analysis.&quot; Role (RCREOC) &quot;The AI adopts this professional perspectiveโ€”a marketing expert thinks differently than a technical consultant.&quot; Intention (MICRO) &quot;Knowing the goal (educate vs. persuade) changes word choice, tone, and structure entirely.&quot; Target Audience &quot;Specific audiences need specific languageโ€”&#x27;beginners&#x27; get simpler explanations than &#x27;experts&#x27;.&quot; Output Format &quot;Format affects readabilityโ€”tables for comparisons, bullets for quick scanning, paragraphs for depth.&quot; 4. Technical Implementation 4.1 File Structure app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Inherits site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ WizardCards.tsx # 4 framework selection cards โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ””โ”€โ”€ CopyButton.tsx # Copy to clipboard lib/ โ”œโ”€โ”€ prompt-frameworks/ โ”‚ โ”œโ”€โ”€ detector.ts # Keyword-based detection โ”‚ โ”œโ”€โ”€ questions.ts # Question sets per framework โ”‚ โ”œโ”€โ”€ defaults.ts # Smart default values โ”‚ โ”œโ”€โ”€ assembler.ts # Prompt template engine โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ”œโ”€โ”€ tooltip.tsx # Learning mode tooltips โ””โ”€โ”€ (reuse existing buttons, cards, inputs) 4.2 Data Models TypeScript Interfaces: typescript // types.ts export type Framework = &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; export interface PromptSession { id: string; framework: Framework; originalPrompt: string; userAnswers: Record&lt;string, string&gt;; finalPrompt: string; timestamp: Date; } export interface Question { id: string; text: string; type: &#x27;text&#x27; | &#x27;multipleChoice&#x27;; options?: string[]; placeholder?: string; tooltip?: string; required: boolean; defaultValue?: string; } export interface ICDFAnswers { instruction: string; context?: string; dataType: string; dataDetails?: string; outputFormat?: string; } // Similar interfaces for RCREOC, MICRO, COSTAR 4.3 Analytics Tracking File: /lib/analytics/prompt-tracker.ts typescript interface AnalyticsEvent { event: &#x27;framework_selected&#x27; | &#x27;prompt_generated&#x27; | &#x27;prompt_copied&#x27; | &#x27;question_skipped&#x27;; framework?: Framework; questionId?: string; timestamp: Date; } // Use existing analytics setup (Google Analytics, Plausible, etc.) // Track: // 1. Framework selection distribution // 2. Question completion rates // 3. Copy button clicks // 4. Session duration Metrics to Track: Most popular framework Average questions answered per session Drop-off points in questionnaire Copy rate (% who copy the final prompt) 4.4 Component Specifications WizardCards Component tsx // components/WizardCards.tsx interface CardData { framework: Framework; icon: string; title: string; subtitle: string; useCases: string[]; } const CARDS: CardData[] = [ { framework: &#x27;ICDF&#x27;, icon: &#x27;๐Ÿ“Š&#x27;, title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise, analytical results&#x27;, useCases: [&#x27;Review photos&#x27;, &#x27;Analyze metrics&#x27;, &#x27;Evaluate performance&#x27;] }, // ... other cards ]; export function WizardCards({ onSelect }: { onSelect: (framework: Framework) =&gt; void }) { return ( &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt; {CARDS.map(card =&gt; ( &lt;Card key={card.framework} onClick={() =&gt; onSelect(card.framework)} className=&quot;cursor-pointer hover:shadow-lg transition-shadow&quot; &gt; &lt;div className=&quot;text-6xl mb-4&quot;&gt;{card.icon}&lt;/div&gt; &lt;h3 className=&quot;text-2xl font-bold&quot;&gt;{card.title}&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt;{card.subtitle}&lt;/p&gt; &lt;ul className=&quot;mt-4 text-sm text-gray-500&quot;&gt; {card.useCases.map(use =&gt; &lt;li key={use}&gt;โ€ข {use}&lt;/li&gt;)} &lt;/ul&gt; &lt;/Card&gt; ))} &lt;/div&gt; ); } QuestionFlow Component tsx // components/QuestionFlow.tsx export function QuestionFlow({ framework, onComplete }: { framework: Framework; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; }) { const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const questions = getQuestionsForFramework(framework); const handleNext = () =&gt; { if (currentQuestion &lt; questions.length - 1) { setCurrentQuestion(prev =&gt; prev + 1); } else { onComplete(answers); } }; return ( &lt;div className=&quot;max-w-2xl mx-auto&quot;&gt; &lt;Progress value={(currentQuestion + 1) / questions.length * 100} /&gt; &lt;Question question={questions[currentQuestion]} value={answers[questions[currentQuestion].id]} onChange={(value) =&gt; setAnswers({...answers, [questions[currentQuestion].id]: value})} /&gt; &lt;div className=&quot;flex justify-between mt-6&quot;&gt; &lt;Button variant=&quot;ghost&quot; onClick={() =&gt; setCurrentQuestion(prev =&gt; prev - 1)} disabled={currentQuestion === 0} &gt; Back &lt;/Button&gt; &lt;Button onClick={handleNext}&gt; {currentQuestion === questions.length - 1 ? &#x27;Generate Prompt&#x27; : &#x27;Next&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } BeforeAfter Component tsx // components/BeforeAfter.tsx export function BeforeAfter({ original, enhanced }: { original: string; enhanced: string; }) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(enhanced); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-6xl mx-auto&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold mb-6&quot;&gt;Your Transformation&lt;/h2&gt; &lt;div className=&quot;grid md:grid-cols-2 gap-6&quot;&gt; {/* Original */} &lt;div className=&quot;bg-gray-50 p-6 rounded-lg&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Your Original Prompt&lt;/h3&gt; &lt;p className=&quot;text-gray-700 whitespace-pre-wrap&quot;&gt;{original}&lt;/p&gt; &lt;/div&gt; {/* Enhanced */} &lt;div className=&quot;bg-white border-2 border-primary p-6 rounded-lg&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 flex items-center&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;div className=&quot;text-gray-900 whitespace-pre-wrap font-mono text-sm&quot;&gt; {enhanced} &lt;/div&gt; &lt;Button onClick={handleCopy} className=&quot;w-full mt-6&quot; &gt; {copied ? &#x27;โœ“ Copied!&#x27; : &#x27;๐Ÿ“‹ Copy to Clipboard&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;Button variant=&quot;outline&quot; onClick={() =&gt; window.location.reload()}&gt; Create Another Prompt &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } 5. Framework Icons/Visuals For the 4 wizard cards, use these visual identities: Framework Icon Color Accent Visual Style ICDF ๐Ÿ“Š Chart/Graph Blue (#3B82F6) Data-focused, analytical RCREOC ๐Ÿ‘” Professional Purple (#8B5CF6) Expert, authoritative MICRO โœ๏ธ Pen/Create Green (#10B981) Creative, content-focused COSTAR ๐Ÿ’ฐ Money/Target Orange (#F59E0B) Sales, conversion-focused Optional Enhancement: Create simple SVG icons or use an icon library (Lucide, Heroicons) matching these themes. 6. Example Prompts (For Testing) ICDF Example: User Input: &quot;Analyze my photography website traffic&quot; Generated Prompt: **Instruction:** Analyze the provided traffic and engagement data for my photography website. **Context:** I want to understand which pages and content types drive the most visitor engagement and contact form submissions. **Data:** Website analytics data including page views, bounce rates, time-on-page, and conversion rates. **Format:** Please provide the output as a clear table with three sections: 1. Top Performing Pages, 2. High Bounce Rate Pages, 3. Actionable Recommendations. RCREOC Example: User Input: &quot;Get feedback on my portrait photos&quot; Generated Prompt: **Role:** You are a Senior Art Director at a high-end portrait photography studio. **Context:** We are reviewing a photographer&#x27;s portfolio to determine if their work meets our quality standards for client projects. **Request:** Review the attached portrait images and identify: 1. Technical strengths, 2. Areas for improvement, 3. Overall artistic direction. **Output:** Provide your response as a table with columns: &#x27;Strength&#x27;, &#x27;Improvement Area&#x27;, &#x27;Specific Recommendation&#x27;. **Constraints:** Constructive and professional tone. Each recommendation must be actionable and specific. MICRO Example: User Input: &quot;Write a blog post about golden hour photography&quot; Generated Prompt: **Message:** Golden hour is the secret weapon for stunning outdoor portraitsโ€”it creates soft, flattering light that makes anyone look amazing. **Intention:** The goal is to educate beginner photographers and persuade them to shoot during golden hour instead of harsh midday sun. **Context:** The audience is beginner photographers (ages 25-40) reading the Modern Photo Tools blog. They want practical, actionable tips. **Rhythm:** The tone should be encouraging and conversational, with clear examples. Use a &quot;myth vs. reality&quot; structure to bust common lighting mistakes. **Output:** Create a blog post (5-minute read) with sections: 1. What is Golden Hour?, 2. Why It Works, 3. 3 Golden Hour Shooting Tips, 4. Common Mistakes to Avoid. COSTAR Example: User Input: &quot;Write a sales email for my Lightroom presets&quot; Generated Prompt: **Context:** Write a marketing email for the launch of my new &quot;California Light&quot; Lightroom preset pack. **Offer:** 25% off for the first 3 days only. **Style:** The tone should be elegant and warm, like a message from a trusted creative friendโ€”not a pushy salesperson. **Target:** This is for 25-45 year old lifestyle and wedding photographers who want to speed up their editing workflow and achieve a consistent aesthetic. **Action:** The reader should click the &quot;Get 25% Off Now&quot; button before the 3-day deadline. **Result:** The business goal is to drive immediate sales in the first 72 hours and convert new customers who will buy future products. 7. Implementation Roadmap Phase 1: Core Setup (Week 1) โœ… Create /prompt-generator route โœ… Build WizardCards landing page โœ… Implement framework detector logic โœ… Set up TypeScript interfaces Phase 2: Question System (Week 2) โœ… Build QuestionFlow component โœ… Create question sets for all 4 frameworks โœ… Implement adaptive question types (multiple choice + text) โœ… Add smart defaults system โœ… Build tooltip system for learning mode Phase 3: Prompt Generation (Week 3) โœ… Build prompt assembler templates โœ… Create BeforeAfter comparison component โœ… Implement copy-to-clipboard functionality โœ… Add mobile responsiveness โœ… Style matching existing site design Phase 4: Polish &amp; Launch (Week 4) โœ… Add analytics tracking โœ… Create example prompts/use cases โœ… Write documentation โœ… SEO optimization โœ… User testing &amp; refinement โœ… Launch! ๐Ÿš€ 8. Gap Analysis โœ… Use As-Is (From Boilerplate - 70%) Next.js routing &amp; page structure UI components (Button, Card, Input, Textarea) Responsive layout system TypeScript setup Analytics infrastructure Site header/footer/navigation ๐Ÿ”ง Customize (15%) Create new route /prompt-generator Add framework-specific styling/colors Customize tooltip component for learning mode Adapt existing form components for questionnaire โœจ Build New (15%) Framework detection logic (detector.ts) Question sets and adaptive flow (questions.ts) Prompt assembly templates (assembler.ts) WizardCards component QuestionFlow component BeforeAfter comparison component Smart defaults system 9. Success Metrics Week 1: 100+ unique visitors 50+ prompts generated 30%+ copy rate Month 1: Code Snippet 1 Plain Textโ€ข 13 lines Landing Page (Quick-Start Wizard) โ†“ [4 Big Visual Cards - User Selects Goal] โ†“ Initial Prompt Input โ†“ Framework Auto-Detected (Rule-Based) โ†“ Adaptive Questionnaire (3-7 questions) โ†“ Before/After Comparison Display โ†“ Copy to Clipboard โ†’ Done Code Snippet 2 Plain Textโ€ข 25 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ [Site Header - Existing Component] โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ ๐ŸŽฏ AI Prompt Generator โ”‚ โ”‚ Transform simple ideas into โ”‚ โ”‚ professional AI prompts โ”‚ โ”‚ โ”‚ โ”‚ What do you want to create? โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ ๐Ÿ“Š ICDF โ”‚ โ”‚ ๐Ÿ‘” RCREOCโ”‚ โ”‚ โ”‚ โ”‚ Analyze โ”‚ โ”‚ Expert โ”‚ โ”‚ โ”‚ โ”‚ Data โ”‚ โ”‚ Advice โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โœ๏ธ MICRO โ”‚ โ”‚ ๐Ÿ’ฐ COSTARโ”‚ โ”‚ โ”‚ โ”‚ Create โ”‚ โ”‚ Marketingโ”‚ โ”‚ โ”‚ โ”‚ Content โ”‚ โ”‚ &amp; Sales โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ [Not sure? Describe your goal โ†’] โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ TypeScript TypeScriptโ€ข 34 lines interface KeywordMap { framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; keywords: string[]; weight: number; } const DETECTION_RULES: KeywordMap[] = [ { framework: &#x27;ICDF&#x27;, keywords: [&#x27;analyze&#x27;, &#x27;review&#x27;, &#x27;evaluate&#x27;, &#x27;assess&#x27;, &#x27;data&#x27;, &#x27;metrics&#x27;, &#x27;performance&#x27;, &#x27;statistics&#x27;, &#x27;report&#x27;, &#x27;insights&#x27;], weight: 1 }, { framework: &#x27;RCREOC&#x27;, keywords: [&#x27;expert&#x27;, &#x27;professional&#x27;, &#x27;advice&#x27;, &#x27;consult&#x27;, &#x27;opinion&#x27;, &#x27;feedback&#x27;, &#x27;critique&#x27;, &#x27;recommend&#x27;, &#x27;specialist&#x27;], weight: 1 }, { framework: &#x27;MICRO&#x27;, keywords: [&#x27;write&#x27;, &#x27;create&#x27;, &#x27;content&#x27;, &#x27;blog&#x27;, &#x27;script&#x27;, &#x27;post&#x27;, &#x27;article&#x27;, &#x27;story&#x27;, &#x27;caption&#x27;, &#x27;image&#x27;, &#x27;photo&#x27;, &#x27;picture&#x27;, &#x27;generate&#x27;], weight: 1 }, { framework: &#x27;COSTAR&#x27;, keywords: [&#x27;sell&#x27;, &#x27;marketing&#x27;, &#x27;email&#x27;, &#x27;ad&#x27;, &#x27;promotion&#x27;, &#x27;sales&#x27;, &#x27;campaign&#x27;, &#x27;offer&#x27;, &#x27;discount&#x27;, &#x27;buy&#x27;, &#x27;customer&#x27;], weight: 1 } ]; function detectFramework(userInput: string): string { // Scoring logic: count keyword matches // Return framework with highest score // Default to MICRO if no clear match } TypeScript TypeScriptโ€ข 20 lines const SMART_DEFAULTS = { ICDF: { context: &quot;For general analysis and insights&quot;, format: &quot;Clear bullet points with key findings&quot; }, RCREOC: { role: &quot;Experienced professional consultant&quot;, tone: &quot;Constructive and professional&quot;, output: &quot;Organized list format&quot; }, MICRO: { tone: &quot;Professional and clear&quot;, audience: &quot;General audience&quot;, length: &quot;Medium-length content&quot; }, COSTAR: { style: &quot;Professional and trustworthy&quot;, goal: &quot;Drive conversions&quot; } }; TypeScript TypeScriptโ€ข 53 lines // ICDF Template const ICDFTemplate = (answers: ICDFAnswers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context || SMART_DEFAULTS.ICDF.context} **Data:** ${answers.dataType} data is provided. ${answers.dataDetails || &#x27;&#x27;} **Format:** Please provide the output as ${answers.outputFormat || SMART_DEFAULTS.ICDF.format}. `; // RCREOC Template const RCREOCTemplate = (answers: RCREOCAnswers) =&gt; ` **Role:** You are ${answers.role || SMART_DEFAULTS.RCREOC.role}. **Context:** ${answers.context} **Request:** ${answers.request} ${answers.examples ? `**Example:** ${answers.examples}` : &#x27;&#x27;} **Output:** Provide your response as ${answers.outputStructure || SMART_DEFAULTS.RCREOC.output}. **Constraints:** ${answers.tone || SMART_DEFAULTS.RCREOC.tone} tone. ${answers.additionalConstraints || &#x27;&#x27;} `; // MICRO Template const MICROTemplate = (answers: MICROAnswers) =&gt; ` **Message:** ${answers.message} **Intention:** The goal is to ${answers.intention}. **Context:** The audience is ${answers.targetAudience || SMART_DEFAULTS.MICRO.audience}. They will see this as ${answers.outputFormat}. **Rhythm:** The tone should be ${answers.rhythmTone || SMART_DEFAULTS.MICRO.tone}. ${answers.styleNotes || &#x27;&#x27;} **Output:** Create ${answers.outputFormat}${answers.contentLength ? ` (${answers.contentLength})` : &#x27;&#x27;}. `; // COSTAR Template const COSTARTemplate = (answers: COSTARAnswers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.styleTone || SMART_DEFAULTS.COSTAR.style}. **Target:** This is for ${answers.targetAudience}. **Action:** The reader should ${answers.desiredAction}. **Result:** The business goal is to ${answers.businessGoal || SMART_DEFAULTS.COSTAR.goal}. `; Code Snippet 6 Plain Textโ€ข 18 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Transformation โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Your Original Promptโ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ โ”‚ &quot;Write a script โ”‚ **Message:** The script needs โ”‚ โ”‚ about aperture&quot; โ”‚ to explain that aperture... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal is... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ **Context:** The audience... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ (Full MICRO framework) โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Code Snippet 7 Plain Textโ€ข 20 lines โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your Original Prompt โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ &quot;Write a script about โ”‚ โ”‚ aperture&quot; โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ Transformed into โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โœจ Professional Version โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ **Message:** The script... โ”‚ โ”‚ โ”‚ โ”‚ **Intention:** The goal... โ”‚ โ”‚ โ”‚ โ”‚ (Full framework) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ [๐Ÿ“‹ Copy to Clipboard] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Code Snippet 8 Plain Textโ€ข 23 lines app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Inherits site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ WizardCards.tsx # 4 framework selection cards โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ””โ”€โ”€ CopyButton.tsx # Copy to clipboard lib/ โ”œโ”€โ”€ prompt-frameworks/ โ”‚ โ”œโ”€โ”€ detector.ts # Keyword-based detection โ”‚ โ”œโ”€โ”€ questions.ts # Question sets per framework โ”‚ โ”œโ”€โ”€ defaults.ts # Smart default values โ”‚ โ”œโ”€โ”€ assembler.ts # Prompt template engine โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ”œโ”€โ”€ tooltip.tsx # Learning mode tooltips โ””โ”€โ”€ (reuse existing buttons, cards, inputs) TypeScript TypeScriptโ€ข 32 lines // types.ts export type Framework = &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; export interface PromptSession { id: string; framework: Framework; originalPrompt: string; userAnswers: Record&lt;string, string&gt;; finalPrompt: string; timestamp: Date; } export interface Question { id: string; text: string; type: &#x27;text&#x27; | &#x27;multipleChoice&#x27;; options?: string[]; placeholder?: string; tooltip?: string; required: boolean; defaultValue?: string; } export interface ICDFAnswers { instruction: string; context?: string; dataType: string; dataDetails?: string; outputFormat?: string; } // Similar interfaces for RCREOC, MICRO, COSTAR TypeScript TypeScriptโ€ข 13 lines interface AnalyticsEvent { event: &#x27;framework_selected&#x27; | &#x27;prompt_generated&#x27; | &#x27;prompt_copied&#x27; | &#x27;question_skipped&#x27;; framework?: Framework; questionId?: string; timestamp: Date; } // Use existing analytics setup (Google Analytics, Plausible, etc.) // Track: // 1. Framework selection distribution // 2. Question completion rates // 3. Copy button clicks // 4. Session duration TypeScript React React TSXโ€ข 40 lines // components/WizardCards.tsx interface CardData { framework: Framework; icon: string; title: string; subtitle: string; useCases: string[]; } const CARDS: CardData[] = [ { framework: &#x27;ICDF&#x27;, icon: &#x27;๐Ÿ“Š&#x27;, title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise, analytical results&#x27;, useCases: [&#x27;Review photos&#x27;, &#x27;Analyze metrics&#x27;, &#x27;Evaluate performance&#x27;] }, // ... other cards ]; export function WizardCards({ onSelect }: { onSelect: (framework: Framework) =&gt; void }) { return ( &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt; {CARDS.map(card =&gt; ( &lt;Card key={card.framework} onClick={() =&gt; onSelect(card.framework)} className=&quot;cursor-pointer hover:shadow-lg transition-shadow&quot; &gt; &lt;div className=&quot;text-6xl mb-4&quot;&gt;{card.icon}&lt;/div&gt; &lt;h3 className=&quot;text-2xl font-bold&quot;&gt;{card.title}&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt;{card.subtitle}&lt;/p&gt; &lt;ul className=&quot;mt-4 text-sm text-gray-500&quot;&gt; {card.useCases.map(use =&gt; &lt;li key={use}&gt;โ€ข {use}&lt;/li&gt;)} &lt;/ul&gt; &lt;/Card&gt; ))} &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 46 lines // components/QuestionFlow.tsx export function QuestionFlow({ framework, onComplete }: { framework: Framework; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; }) { const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const questions = getQuestionsForFramework(framework); const handleNext = () =&gt; { if (currentQuestion &lt; questions.length - 1) { setCurrentQuestion(prev =&gt; prev + 1); } else { onComplete(answers); } }; return ( &lt;div className=&quot;max-w-2xl mx-auto&quot;&gt; &lt;Progress value={(currentQuestion + 1) / questions.length * 100} /&gt; &lt;Question question={questions[currentQuestion]} value={answers[questions[currentQuestion].id]} onChange={(value) =&gt; setAnswers({...answers, [questions[currentQuestion].id]: value})} /&gt; &lt;div className=&quot;flex justify-between mt-6&quot;&gt; &lt;Button variant=&quot;ghost&quot; onClick={() =&gt; setCurrentQuestion(prev =&gt; prev - 1)} disabled={currentQuestion === 0} &gt; Back &lt;/Button&gt; &lt;Button onClick={handleNext}&gt; {currentQuestion === questions.length - 1 ? &#x27;Generate Prompt&#x27; : &#x27;Next&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 52 lines // components/BeforeAfter.tsx export function BeforeAfter({ original, enhanced }: { original: string; enhanced: string; }) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(enhanced); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-6xl mx-auto&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold mb-6&quot;&gt;Your Transformation&lt;/h2&gt; &lt;div className=&quot;grid md:grid-cols-2 gap-6&quot;&gt; {/* Original */} &lt;div className=&quot;bg-gray-50 p-6 rounded-lg&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Your Original Prompt&lt;/h3&gt; &lt;p className=&quot;text-gray-700 whitespace-pre-wrap&quot;&gt;{original}&lt;/p&gt; &lt;/div&gt; {/* Enhanced */} &lt;div className=&quot;bg-white border-2 border-primary p-6 rounded-lg&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 flex items-center&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;div className=&quot;text-gray-900 whitespace-pre-wrap font-mono text-sm&quot;&gt; {enhanced} &lt;/div&gt; &lt;Button onClick={handleCopy} className=&quot;w-full mt-6&quot; &gt; {copied ? &#x27;โœ“ Copied!&#x27; : &#x27;๐Ÿ“‹ Copy to Clipboard&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;Button variant=&quot;outline&quot; onClick={() =&gt; window.location.reload()}&gt; Create Another Prompt &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code Code Snippet 14 Plain Textโ€ข 7 lines **Instruction:** Analyze the provided traffic and engagement data for my photography website. **Context:** I want to understand which pages and content types drive the most visitor engagement and contact form submissions. **Data:** Website analytics data including page views, bounce rates, time-on-page, and conversion rates. **Format:** Please provide the output as a clear table with three sections: 1. Top Performing Pages, 2. High Bounce Rate Pages, 3. Actionable Recommendations. Code Snippet 15 Plain Textโ€ข 9 lines **Role:** You are a Senior Art Director at a high-end portrait photography studio. **Context:** We are reviewing a photographer&#x27;s portfolio to determine if their work meets our quality standards for client projects. **Request:** Review the attached portrait images and identify: 1. Technical strengths, 2. Areas for improvement, 3. Overall artistic direction. **Output:** Provide your response as a table with columns: &#x27;Strength&#x27;, &#x27;Improvement Area&#x27;, &#x27;Specific Recommendation&#x27;. **Constraints:** Constructive and professional tone. Each recommendation must be actionable and specific. Code Snippet 16 Plain Textโ€ข 9 lines **Message:** Golden hour is the secret weapon for stunning outdoor portraitsโ€”it creates soft, flattering light that makes anyone look amazing. **Intention:** The goal is to educate beginner photographers and persuade them to shoot during golden hour instead of harsh midday sun. **Context:** The audience is beginner photographers (ages 25-40) reading the Modern Photo Tools blog. They want practical, actionable tips. **Rhythm:** The tone should be encouraging and conversational, with clear examples. Use a &quot;myth vs. reality&quot; structure to bust common lighting mistakes. **Output:** Create a blog post (5-minute read) with sections: 1. What is Golden Hour?, 2. Why It Works, 3. 3 Golden Hour Shooting Tips, 4. Common Mistakes to Avoid. Code Snippet 17 Plain Textโ€ข 11 lines **Context:** Write a marketing email for the launch of my new &quot;California Light&quot; Lightroom preset pack. **Offer:** 25% off for the first 3 days only. **Style:** The tone should be elegant and warm, like a message from a trusted creative friendโ€”not a pushy salesperson. **Target:** This is for 25-45 year old lifestyle and wedding photographers who want to speed up their editing workflow and achieve a consistent aesthetic. **Action:** The reader should click the &quot;Get 25% Off Now&quot; button before the 3-day deadline. **Result:** The business goal is to drive immediate sales in the first 72 hours and convert new customers who will buy future products. Used 86 credits continue Used 0 credits continue Used 0 credits Landing Page (Quick-Start Wizard) โ†“ [4 Framework Cards with Icons] โ†“ User Selects Goal โ†’ Framework Auto-Selected โ†“ Initial Prompt Input &quot;Describe what you need in your own words...&quot; โ†“ Keyword Analysis (Rule-Based Detection) โ†“ Adaptive Questionnaire (3-7 questions) - Simple questions: Multiple choice buttons - Complex questions: Text fields - Learning tooltips on each question โ†“ Smart Defaults Applied (if user skips) โ†“ Before/After Comparison Page - Left: Original prompt - Right: Professional prompt (highlighted) - Copy button - Learning mode explanations โ†“ Success State &quot;โœ“ Your professional prompt is ready!&quot; [Copy to Clipboard] [Start Another] 3. Framework Detection Rules Keyword Mapping (Rule-Based Logic) javascript const frameworkDetection = { ICDF: { keywords: [&#x27;analyze&#x27;, &#x27;review&#x27;, &#x27;evaluate&#x27;, &#x27;assess&#x27;, &#x27;data&#x27;, &#x27;report&#x27;, &#x27;examine&#x27;, &#x27;study&#x27;, &#x27;metrics&#x27;, &#x27;statistics&#x27;], icon: &#x27;๐Ÿ“Š&#x27;, // Analytics/Chart icon color: &#x27;#3B82F6&#x27;, // Blue title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise analytical insights&#x27; }, RCREOC: { keywords: [&#x27;expert&#x27;, &#x27;professional&#x27;, &#x27;advice&#x27;, &#x27;consult&#x27;, &#x27;opinion&#x27;, &#x27;recommend&#x27;, &#x27;specialist&#x27;, &#x27;coach&#x27;, &#x27;mentor&#x27;, &#x27;guide&#x27;], icon: &#x27;๐ŸŽฏ&#x27;, // Target/Expert icon color: &#x27;#8B5CF6&#x27;, // Purple title: &#x27;Get Expert Advice&#x27;, subtitle: &#x27;AI becomes your specialist consultant&#x27; }, MICRO: { keywords: [&#x27;write&#x27;, &#x27;create&#x27;, &#x27;content&#x27;, &#x27;blog&#x27;, &#x27;script&#x27;, &#x27;article&#x27;, &#x27;post&#x27;, &#x27;story&#x27;, &#x27;copy&#x27;, &#x27;draft&#x27;, &#x27;compose&#x27;], icon: &#x27;โœ๏ธ&#x27;, // Writing icon color: &#x27;#10B981&#x27;, // Green title: &#x27;Create Content&#x27;, subtitle: &#x27;Generate engaging written content&#x27; }, COSTAR: { keywords: [&#x27;sell&#x27;, &#x27;marketing&#x27;, &#x27;email&#x27;, &#x27;ad&#x27;, &#x27;promotion&#x27;, &#x27;campaign&#x27;, &#x27;sales&#x27;, &#x27;advertise&#x27;, &#x27;pitch&#x27;, &#x27;convert&#x27;], icon: &#x27;๐Ÿš€&#x27;, // Rocket/Growth icon color: &#x27;#F59E0B&#x27;, // Orange title: &#x27;Write Marketing Copy&#x27;, subtitle: &#x27;Craft persuasive sales messages&#x27; } }; Detection Algorithm javascript function detectFramework(userInput) { const input = userInput.toLowerCase(); const scores = {}; // Count keyword matches for each framework Object.keys(frameworkDetection).forEach(framework =&gt; { scores[framework] = frameworkDetection[framework].keywords .filter(keyword =&gt; input.includes(keyword)) .length; }); // Return framework with highest score const winner = Object.keys(scores).reduce((a, b) =&gt; scores[a] &gt; scores[b] ? a : b ); // If no clear winner (all zeros), default to MICRO (most general) return scores[winner] &gt; 0 ? winner : &#x27;MICRO&#x27;; } 4. Question Sets by Framework ICDF Framework Questions javascript const icdfQuestions = [ { id: &#x27;instruction&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should the AI perform?&#x27;, placeholder: &#x27;e.g., Analyze traffic patterns and identify top-performing content&#x27;, required: true, tooltip: &#x27;Be specific about the action you wantโ€”this is your core instruction.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the background or purpose?&#x27;, placeholder: &#x27;e.g., I run a photography blog and need to understand what content drives bookings&#x27;, default: &#x27;General business analysis&#x27;, tooltip: &#x27;Context helps AI understand WHY you need thisโ€”it tailors the analysis to your goals.&#x27; }, { id: &#x27;data&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What data will you provide to the AI?&#x27;, placeholder: &#x27;e.g., 3 months of Google Analytics data including traffic sources, bounce rates, and conversions&#x27;, default: &#x27;Standard dataset&#x27;, tooltip: &#x27;Specify what information the AI will work withโ€”this sets expectations.&#x27; }, { id: &#x27;format&#x27;, type: &#x27;choice&#x27;, label: &#x27;How should the output be structured?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Table/Spreadsheet&#x27; }, { value: &#x27;list&#x27;, label: &#x27;๐Ÿ“ Bullet Points&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;summary&#x27;, label: &#x27;โšก Executive Summary&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], default: &#x27;list&#x27;, tooltip: &#x27;Format determines how readable and actionable your results will be.&#x27; } ]; RCREOC Framework Questions javascript const rcreocQuestions = [ { id: &#x27;role&#x27;, type: &#x27;choice&#x27;, label: &#x27;What expert role should the AI take?&#x27;, options: [ { value: &#x27;art-director&#x27;, label: &#x27;๐ŸŽจ Senior Art Director&#x27; }, { value: &#x27;photo-editor&#x27;, label: &#x27;๐Ÿ“ธ Professional Photo Editor&#x27; }, { value: &#x27;business-consultant&#x27;, label: &#x27;๐Ÿ’ผ Business Consultant&#x27; }, { value: &#x27;marketing-strategist&#x27;, label: &#x27;๐Ÿ“ˆ Marketing Strategist&#x27; }, { value: &#x27;technical-expert&#x27;, label: &#x27;โš™๏ธ Technical Specialist&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Role&#x27;, hasInput: true } ], required: true, tooltip: &#x27;The role shapes how the AI thinks and respondsโ€”choose the expert you need.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Describe the situation this expert is working in&#x27;, placeholder: &#x27;e.g., You are reviewing portfolio submissions for a high-end fashion campaign&#x27;, default: &#x27;Professional consulting environment&#x27;, tooltip: &#x27;Context gives the &quot;expert&quot; the scenarioโ€”this makes advice more targeted.&#x27; }, { id: &#x27;request&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should this expert complete?&#x27;, placeholder: &#x27;e.g., Review these 10 images and identify technical issues and strengths&#x27;, required: true, tooltip: &#x27;The specific task the expert will performโ€”be clear and actionable.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this as an issue and recommend using a light meter&#x27;, default: &#x27;Use professional industry standards&#x27;, tooltip: &#x27;Examples guide the AI&#x27;s reasoning styleโ€”show what &quot;good&quot; looks like.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;choice&#x27;, label: &#x27;What format should the expert deliver?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Structured Table&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;checklist&#x27;, label: &#x27;โœ… Action Checklist&#x27; }, { value: &#x27;recommendations&#x27;, label: &#x27;๐Ÿ’ก Recommendation List&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], default: &#x27;recommendations&#x27;, tooltip: &#x27;Output format determines how you&#x27;ll use the expert&#x27;s advice.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone and style should the expert use?&#x27;, options: [ { value: &#x27;professional-constructive&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Constructive&#x27; }, { value: &#x27;direct-concise&#x27;, label: &#x27;โšก Direct &amp; Concise&#x27; }, { value: &#x27;detailed-educational&#x27;, label: &#x27;๐Ÿ“š Detailed &amp; Educational&#x27; }, { value: &#x27;friendly-encouraging&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Encouraging&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Tone&#x27;, hasInput: true } ], default: &#x27;professional-constructive&#x27;, tooltip: &#x27;Constraints set boundariesโ€”tone, length, and style rules for the output.&#x27; } ]; MICRO Framework Questions javascript const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the core idea or thesis?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of fieldโ€”it&#x27;s the most important camera setting to learn first&#x27;, required: true, tooltip: &#x27;Your message is the central pointโ€”what should the audience remember?&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after reading?&#x27;, placeholder: &#x27;e.g., Feel confident experimenting with aperture settings and excited to try it themselves&#x27;, required: true, tooltip: &#x27;Intention drives the emotional outcomeโ€”persuade, inspire, educate, or entertain?&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is the audience and where will they see this?&#x27;, placeholder: &#x27;e.g., Beginner photographers aged 25-40 watching on YouTube&#x27;, default: &#x27;General online audience&#x27;, tooltip: &#x27;Context shapes language, tone, and examplesโ€”know your reader.&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone and pace should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐Ÿ“š Calm &amp; Educational&#x27; }, { value: &#x27;witty-conversational&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Conversational&#x27; }, { value: &#x27;professional-authoritative&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Authoritative&#x27; }, { value: &#x27;inspiring-motivational&#x27;, label: &#x27;โœจ Inspiring &amp; Motivational&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Rhythm&#x27;, hasInput: true } ], default: &#x27;calm-educational&#x27;, tooltip: &#x27;Rhythm is the voice and energyโ€”fast or slow, serious or playful?&#x27; }, { id: &#x27;output&#x27;, type: &#x27;choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;youtube-script&#x27;, label: &#x27;๐ŸŽฅ YouTube Script&#x27; }, { value: &#x27;blog-post&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;social-media&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], required: true, tooltip: &#x27;Output type determines structureโ€”scripts need hooks, blogs need SEO, etc.&#x27; } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the marketing situation?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack for wedding photographers&#x27;, required: true, tooltip: &#x27;Context sets the stageโ€”new product, seasonal sale, or re-engagement campaign?&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the specific offer or product?&#x27;, placeholder: &#x27;e.g., &quot;California Light&quot; preset collection, 25% off for 3 days&#x27;, required: true, tooltip: &#x27;The offer is what you&#x27;re sellingโ€”be specific about the deal and urgency.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone should the marketing copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimal&#x27; }, { value: &#x27;urgent-exciting&#x27;, label: &#x27;โšก Urgent &amp; Exciting&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Warm&#x27; }, { value: &#x27;professional-trustworthy&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Trustworthy&#x27; }, { value: &#x27;bold-provocative&#x27;, label: &#x27;๐Ÿ”ฅ Bold &amp; Provocative&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Style&#x27;, hasInput: true } ], default: &#x27;friendly-warm&#x27;, tooltip: &#x27;Style creates the emotional connectionโ€”match your brand voice.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your target customer?&#x27;, placeholder: &#x27;e.g., Wedding and lifestyle photographers aged 25-45 who want to speed up their editing workflow&#x27;, required: true, tooltip: &#x27;Target audience determines language, pain points, and benefits to highlight.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;choice&#x27;, label: &#x27;What&#x27;s the primary call-to-action?&#x27;, options: [ { value: &#x27;buy-now&#x27;, label: &#x27;๐Ÿ›’ Buy Now&#x27; }, { value: &#x27;sign-up&#x27;, label: &#x27;๐Ÿ“ Sign Up&#x27; }, { value: &#x27;learn-more&#x27;, label: &#x27;๐Ÿ“š Learn More&#x27; }, { value: &#x27;download&#x27;, label: &#x27;โฌ‡๏ธ Download&#x27; }, { value: &#x27;book-call&#x27;, label: &#x27;๐Ÿ“ž Book a Call&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom CTA&#x27;, hasInput: true } ], required: true, tooltip: &#x27;Action is the ONE thing you want them to doโ€”make it crystal clear.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s your business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build email list of potential customers&#x27;, default: &#x27;Increase conversions and revenue&#x27;, tooltip: &#x27;Result aligns the copy with your business objectiveโ€”sales, leads, or awareness?&#x27; } ]; 5. Prompt Assembly Logic Template Structure for Each Framework ICDF Template: javascript function assembleICDF(answers) { return `**Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data:** ${answers.data} **Format:** Please provide the output as ${answers.format === &#x27;custom&#x27; ? answers.formatCustom : answers.format}. ${getFormatGuidance(answers.format)}`; } function getFormatGuidance(format) { const guidance = { &#x27;table&#x27;: &#x27;Structure the information in clear columns with headers.&#x27;, &#x27;list&#x27;: &#x27;Use bullet points for easy scanning.&#x27;, &#x27;report&#x27;: &#x27;Write in paragraph form with clear sections and headers.&#x27;, &#x27;summary&#x27;: &#x27;Provide a concise executive summary highlighting key findings.&#x27; }; return guidance[format] || &#x27;&#x27;; } RCREOC Template: javascript function assembleRCREOC(answers) { const role = answers.role === &#x27;custom&#x27; ? answers.roleCustom : getRoleTitle(answers.role); return `**Role:** You are a ${role}. **Context:** ${answers.context} **Request:** ${answers.request} **Examples:** ${answers.examples} **Output:** ${getOutputFormat(answers.output)} **Constraints:** ${getConstraints(answers.constraints)}`; } function getRoleTitle(roleKey) { const roles = { &#x27;art-director&#x27;: &#x27;Senior Art Director at a high-fashion advertising agency&#x27;, &#x27;photo-editor&#x27;: &#x27;Professional Photo Editor with 10+ years experience&#x27;, &#x27;business-consultant&#x27;: &#x27;Senior Business Strategy Consultant&#x27;, &#x27;marketing-strategist&#x27;: &#x27;Marketing Strategy Director&#x27;, &#x27;technical-expert&#x27;: &#x27;Technical Specialist and Industry Expert&#x27; }; return roles[roleKey]; } MICRO Template: javascript function assembleMICRO(answers) { return `**Message:** ${answers.message} **Intention:** ${answers.intention} **Context:** ${answers.context} **Rhythm:** ${getRhythmDescription(answers.rhythm)} **Output:** Create a ${answers.output === &#x27;custom&#x27; ? answers.outputCustom : getOutputType(answers.output)} that ${answers.intention}`; } function getRhythmDescription(rhythm) { const rhythms = { &#x27;fast-exciting&#x27;: &#x27;Use a fast-paced, exciting tone with short sentences and dynamic language.&#x27;, &#x27;calm-educational&#x27;: &#x27;Maintain a calm, educational tone that explains concepts clearly.&#x27;, &#x27;witty-conversational&#x27;: &#x27;Write in a witty, conversational style that feels like talking to a friend.&#x27;, &#x27;professional-authoritative&#x27;: &#x27;Use a professional, authoritative voice that establishes credibility.&#x27;, &#x27;inspiring-motivational&#x27;: &#x27;Create an inspiring, motivational tone that energizes the reader.&#x27; }; return rhythm === &#x27;custom&#x27; ? answers.rhythmCustom : rhythms[rhythm]; } COSTAR Template: javascript function assembleCOSTAR(answers) { return `**Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** ${getStyleDescription(answers.style)} **Target:** ${answers.target} **Action:** ${getActionCTA(answers.action)} **Result:** The goal is to ${answers.result}`; } function getStyleDescription(style) { const styles = { &#x27;elegant-minimal&#x27;: &#x27;Write in an elegant, minimalist styleโ€”simple, sophisticated, and chic.&#x27;, &#x27;urgent-exciting&#x27;: &#x27;Create urgency and excitementโ€”make them feel they can&#x27;t miss this.&#x27;, &#x27;friendly-warm&#x27;: &#x27;Use a friendly, warm tone like a message from a trusted friend.&#x27;, &#x27;professional-trustworthy&#x27;: &#x27;Maintain a professional, trustworthy voice that builds confidence.&#x27;, &#x27;bold-provocative&#x27;: &#x27;Be bold and provocativeโ€”challenge assumptions and grab attention.&#x27; }; return style === &#x27;custom&#x27; ? answers.styleCustom : styles[style]; } 6. UI/UX Specifications Landing Page (/prompt-generator) Hero Section: jsx &lt;section className=&quot;hero-section&quot;&gt; &lt;h1&gt;AI Prompt Generator&lt;/h1&gt; &lt;p className=&quot;subtitle&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;div className=&quot;framework-wizard&quot;&gt; &lt;h2&gt;What do you want to do?&lt;/h2&gt; &lt;div className=&quot;framework-grid&quot;&gt; {/* 4 Framework Cards */} &lt;FrameworkCard icon=&quot;๐Ÿ“Š&quot; title=&quot;Analyze Data&quot; subtitle=&quot;Get precise analytical insights&quot; color=&quot;#3B82F6&quot; onClick={() =&gt; selectFramework(&#x27;ICDF&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;๐ŸŽฏ&quot; title=&quot;Get Expert Advice&quot; subtitle=&quot;AI becomes your specialist consultant&quot; color=&quot;#8B5CF6&quot; onClick={() =&gt; selectFramework(&#x27;RCREOC&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;โœ๏ธ&quot; title=&quot;Create Content&quot; subtitle=&quot;Generate engaging written content&quot; color=&quot;#10B981&quot; onClick={() =&gt; selectFramework(&#x27;MICRO&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;๐Ÿš€&quot; title=&quot;Write Marketing Copy&quot; subtitle=&quot;Craft persuasive sales messages&quot; color=&quot;#F59E0B&quot; onClick={() =&gt; selectFramework(&#x27;COSTAR&#x27;)} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; Framework Card Component: jsx const FrameworkCard = ({ icon, title, subtitle, color, onClick }) =&gt; ( &lt;button className=&quot;framework-card&quot; style={{ borderColor: color }} onClick={onClick} &gt; &lt;div className=&quot;icon&quot; style={{ color }}&gt;{icon}&lt;/div&gt; &lt;h3&gt;{title}&lt;/h3&gt; &lt;p&gt;{subtitle}&lt;/p&gt; &lt;span className=&quot;arrow&quot;&gt;โ†’&lt;/span&gt; &lt;/button&gt; ); Initial Prompt Input Screen jsx &lt;section className=&quot;prompt-input-section&quot;&gt; &lt;div className=&quot;back-button&quot; onClick={goBack}&gt; โ† Back to framework selection &lt;/div&gt; &lt;div className=&quot;selected-framework-badge&quot; style={{ backgroundColor: frameworkColor }}&gt; {frameworkIcon} {frameworkTitle} &lt;/div&gt; &lt;h2&gt;Describe what you need&lt;/h2&gt; &lt;p className=&quot;helper-text&quot;&gt; Write in your own wordsโ€”we&#x27;ll ask follow-up questions to make it perfect. &lt;/p&gt; &lt;textarea className=&quot;initial-prompt-input&quot; placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts get the most engagement...&quot; value={userPrompt} onChange={(e) =&gt; setUserPrompt(e.target.value)} rows={6} /&gt; &lt;button className=&quot;continue-btn&quot; onClick={startQuestionnaire} disabled={userPrompt.length &lt; 10} &gt; Continue โ†’ &lt;/button&gt; &lt;/section&gt; Adaptive Questionnaire Screen jsx &lt;section className=&quot;questionnaire-section&quot;&gt; {/* Progress indicator */} &lt;div className=&quot;progress-bar&quot;&gt; &lt;div className=&quot;progress-fill&quot; style={{ width: `${(currentQuestion / totalQuestions) * 100}%` }} /&gt; &lt;/div&gt; &lt;p className=&quot;progress-text&quot;&gt; Question {currentQuestion} of {totalQuestions} &lt;/p&gt; {/* Question card */} &lt;div className=&quot;question-card&quot;&gt; &lt;label className=&quot;question-label&quot;&gt; {question.label} {question.tooltip &amp;&amp; ( &lt;Tooltip content={question.tooltip}&gt; &lt;span className=&quot;info-icon&quot;&gt;โ„น๏ธ&lt;/span&gt; &lt;/Tooltip&gt; )} &lt;/label&gt; {/* Render based on question type */} {question.type === &#x27;choice&#x27; &amp;&amp; ( &lt;div className=&quot;choice-grid&quot;&gt; {question.options.map(option =&gt; ( &lt;button key={option.value} className={`choice-btn ${selectedValue === option.value ? &#x27;selected&#x27; : &#x27;&#x27;}`} onClick={() =&gt; handleChoice(option.value)} &gt; {option.label} &lt;/button&gt; ))} &lt;/div&gt; )} {question.type === &#x27;textarea&#x27; &amp;&amp; ( &lt;textarea className=&quot;question-textarea&quot; placeholder={question.placeholder} value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} rows={4} /&gt; )} {/* Custom input for &quot;Other&quot; options */} {showCustomInput &amp;&amp; ( &lt;input type=&quot;text&quot; className=&quot;custom-input&quot; placeholder=&quot;Specify...&quot; value={customValue} onChange={(e) =&gt; setCustomValue(e.target.value)} /&gt; )} &lt;/div&gt; {/* Navigation */} &lt;div className=&quot;question-nav&quot;&gt; &lt;button className=&quot;btn-secondary&quot; onClick={previousQuestion} disabled={currentQuestion === 1} &gt; โ† Previous &lt;/button&gt; &lt;button className=&quot;btn-skip&quot; onClick={skipQuestion} &gt; Skip (use default) &lt;/button&gt; &lt;button className=&quot;btn-primary&quot; onClick={nextQuestion} &gt; {currentQuestion === totalQuestions ? &#x27;Generate Prompt&#x27; : &#x27;Next โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/section&gt; Before/After Comparison Screen jsx &lt;section className=&quot;results-section&quot;&gt; &lt;div className=&quot;success-header&quot;&gt; &lt;span className=&quot;success-icon&quot;&gt;โœ“&lt;/span&gt; &lt;h2&gt;Your Professional Prompt is Ready!&lt;/h2&gt; &lt;/div&gt; {/* Desktop: Side-by-side, Mobile: Stacked */} &lt;div className=&quot;comparison-container&quot;&gt; &lt;div className=&quot;prompt-box original&quot;&gt; &lt;div className=&quot;prompt-header&quot;&gt; &lt;h3&gt;Your Original Prompt&lt;/h3&gt; &lt;span className=&quot;badge amateur&quot;&gt;Amateur&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;prompt-content&quot;&gt; {originalPrompt} &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;arrow-separator&quot;&gt; &lt;span className=&quot;transform-arrow&quot;&gt;โ†’&lt;/span&gt; &lt;span className=&quot;transform-text&quot;&gt;Transformed into&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;prompt-box enhanced&quot;&gt; &lt;div className=&quot;prompt-header&quot;&gt; &lt;h3&gt;Professional Version&lt;/h3&gt; &lt;span className=&quot;badge pro&quot;&gt;Pro&lt;/span&gt; &lt;button className=&quot;copy-btn&quot; onClick={() =&gt; copyToClipboard(enhancedPrompt)} &gt; {copied ? &#x27;โœ“ Copied!&#x27; : &#x27;๐Ÿ“‹ Copy&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;div className=&quot;prompt-content highlighted&quot;&gt; {enhancedPrompt} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {/* Learning Mode Explanations */} &lt;div className=&quot;learning-section&quot;&gt; &lt;h3&gt; &lt;span className=&quot;icon&quot;&gt;๐Ÿ’ก&lt;/span&gt; Why This Works Better &lt;/h3&gt; &lt;div className=&quot;improvements-list&quot;&gt; {improvements.map((improvement, index) =&gt; ( &lt;div key={index} className=&quot;improvement-item&quot;&gt; &lt;span className=&quot;check&quot;&gt;โœ“&lt;/span&gt; &lt;div&gt; &lt;strong&gt;{improvement.title}&lt;/strong&gt; &lt;p&gt;{improvement.explanation}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Actions */} &lt;div className=&quot;results-actions&quot;&gt; &lt;button className=&quot;btn-secondary&quot; onClick={startOver}&gt; โ† Create Another Prompt &lt;/button&gt; &lt;button className=&quot;btn-primary&quot; onClick={() =&gt; copyToClipboard(enhancedPrompt)}&gt; ๐Ÿ“‹ Copy Professional Prompt &lt;/button&gt; &lt;/div&gt; &lt;/section&gt; Learning Mode Improvement Generator javascript function generateImprovements(framework, originalPrompt, answers) { const improvements = []; switch(framework) { case &#x27;ICDF&#x27;: improvements.push({ title: &#x27;Added Clear Instruction&#x27;, explanation: &#x27;Instead of vague direction, we specified exactly what task the AI should perform.&#x27; }); if (answers.context !== &#x27;General business analysis&#x27;) { improvements.push({ title: &#x27;Provided Context&#x27;, explanation: &#x27;Context helps the AI understand WHY you need this, leading to more relevant results.&#x27; }); } if (answers.data) { improvements.push({ title: &#x27;Defined Data Scope&#x27;, explanation: &#x27;Telling the AI what data to work with sets clear expectations and boundaries.&#x27; }); } improvements.push({ title: &#x27;Specified Output Format&#x27;, explanation: `Requesting ${answers.format} format ensures the results are structured and actionable.` }); break; case &#x27;RCREOC&#x27;: improvements.push({ title: &#x27;Assigned Expert Role&#x27;, explanation: `Making the AI act as a ${answers.role} changes how it thinks and responds.` }); improvements.push({ title: &#x27;Set Professional Context&#x27;, explanation: &#x27;Describing the work environment makes the AI\&#x27;s advice more targeted and realistic.&#x27; }); if (answers.examples) { improvements.push({ title: &#x27;Provided Examples&#x27;, explanation: &#x27;Examples guide the AI\&#x27;s reasoning styleโ€”showing what &quot;good&quot; looks like.&#x27; }); } improvements.push({ title: &#x27;Defined Constraints&#x27;, explanation: &#x27;Setting tone and style rules ensures the output matches your needs.&#x27; }); break; case &#x27;MICRO&#x27;: improvements.push({ title: &#x27;Clarified Core Message&#x27;, explanation: &#x27;A clear thesis ensures the content stays focused on one main idea.&#x27; }); improvements.push({ title: &#x27;Defined Intention&#x27;, explanation: &#x27;Specifying what the audience should feel or do drives the content\&#x27;s direction.&#x27; }); improvements.push({ title: &#x27;Set Rhythm &amp; Tone&#x27;, explanation: `${answers.rhythm} creates the right energy and voice for your audience.` }); improvements.push({ title: &#x27;Specified Content Type&#x27;, explanation: `Different formats (${answers.output}) have different structuresโ€”scripts need hooks, blogs need SEO.` }); break; case &#x27;COSTAR&#x27;: improvements.push({ title: &#x27;Defined Target Audience&#x27;, explanation: &#x27;Knowing WHO you\&#x27;re selling to shapes the language, pain points, and benefits.&#x27; }); improvements.push({ title: &#x27;Clarified the Offer&#x27;, explanation: &#x27;Being specific about the deal and urgency increases conversion rates.&#x27; }); improvements.push({ title: &#x27;Set Brand Style&#x27;, explanation: `${answers.style} tone creates emotional connection and matches your brand voice.` }); improvements.push({ title: &#x27;Added Clear CTA&#x27;, explanation: &#x27;A single, clear call-to-action tells people exactly what to do next.&#x27; }); break; } return improvements; } 7. Technical Implementation File Structure /app /prompt-generator /page.tsx # Main landing page /layout.tsx # Layout wrapper /components /FrameworkWizard.tsx # 4-card selection UI /PromptInput.tsx # Initial prompt textarea /Questionnaire.tsx # Adaptive question flow /ResultsComparison.tsx # Before/After display /Tooltip.tsx # Learning mode tooltips /lib /frameworkDetection.ts # Keyword matching logic /questionSets.ts # All framework questions /promptAssembly.ts # Template generation /improvements.ts # Learning explanations /types /index.ts # TypeScript interfaces /styles /prompt-generator.css # Component styles Core Types (TypeScript) typescript // types/index.ts export type Framework = &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; export interface FrameworkConfig { id: Framework; keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: &#x27;choice&#x27; | &#x27;textarea&#x27;; label: string; placeholder?: string; required: boolean; default?: string; tooltip?: string; options?: ChoiceOption[]; } export interface ChoiceOption { value: string; label: string; hasInput?: boolean; } export interface Answer { questionId: string; value: string; customValue?: string; } export interface PromptSession { framework: Framework; originalPrompt: string; Code Snippet 1 Plain Textโ€ข 27 lines Landing Page (Quick-Start Wizard) โ†“ [4 Framework Cards with Icons] โ†“ User Selects Goal โ†’ Framework Auto-Selected โ†“ Initial Prompt Input &quot;Describe what you need in your own words...&quot; โ†“ Keyword Analysis (Rule-Based Detection) โ†“ Adaptive Questionnaire (3-7 questions) - Simple questions: Multiple choice buttons - Complex questions: Text fields - Learning tooltips on each question โ†“ Smart Defaults Applied (if user skips) โ†“ Before/After Comparison Page - Left: Original prompt - Right: Professional prompt (highlighted) - Copy button - Learning mode explanations โ†“ Success State &quot;โœ“ Your professional prompt is ready!&quot; [Copy to Clipboard] [Start Another] JavaScript JavaScriptโ€ข 33 lines const frameworkDetection = { ICDF: { keywords: [&#x27;analyze&#x27;, &#x27;review&#x27;, &#x27;evaluate&#x27;, &#x27;assess&#x27;, &#x27;data&#x27;, &#x27;report&#x27;, &#x27;examine&#x27;, &#x27;study&#x27;, &#x27;metrics&#x27;, &#x27;statistics&#x27;], icon: &#x27;๐Ÿ“Š&#x27;, // Analytics/Chart icon color: &#x27;#3B82F6&#x27;, // Blue title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise analytical insights&#x27; }, RCREOC: { keywords: [&#x27;expert&#x27;, &#x27;professional&#x27;, &#x27;advice&#x27;, &#x27;consult&#x27;, &#x27;opinion&#x27;, &#x27;recommend&#x27;, &#x27;specialist&#x27;, &#x27;coach&#x27;, &#x27;mentor&#x27;, &#x27;guide&#x27;], icon: &#x27;๐ŸŽฏ&#x27;, // Target/Expert icon color: &#x27;#8B5CF6&#x27;, // Purple title: &#x27;Get Expert Advice&#x27;, subtitle: &#x27;AI becomes your specialist consultant&#x27; }, MICRO: { keywords: [&#x27;write&#x27;, &#x27;create&#x27;, &#x27;content&#x27;, &#x27;blog&#x27;, &#x27;script&#x27;, &#x27;article&#x27;, &#x27;post&#x27;, &#x27;story&#x27;, &#x27;copy&#x27;, &#x27;draft&#x27;, &#x27;compose&#x27;], icon: &#x27;โœ๏ธ&#x27;, // Writing icon color: &#x27;#10B981&#x27;, // Green title: &#x27;Create Content&#x27;, subtitle: &#x27;Generate engaging written content&#x27; }, COSTAR: { keywords: [&#x27;sell&#x27;, &#x27;marketing&#x27;, &#x27;email&#x27;, &#x27;ad&#x27;, &#x27;promotion&#x27;, &#x27;campaign&#x27;, &#x27;sales&#x27;, &#x27;advertise&#x27;, &#x27;pitch&#x27;, &#x27;convert&#x27;], icon: &#x27;๐Ÿš€&#x27;, // Rocket/Growth icon color: &#x27;#F59E0B&#x27;, // Orange title: &#x27;Write Marketing Copy&#x27;, subtitle: &#x27;Craft persuasive sales messages&#x27; } }; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 19 lines function detectFramework(userInput) { const input = userInput.toLowerCase(); const scores = {}; // Count keyword matches for each framework Object.keys(frameworkDetection).forEach(framework =&gt; { scores[framework] = frameworkDetection[framework].keywords .filter(keyword =&gt; input.includes(keyword)) .length; }); // Return framework with highest score const winner = Object.keys(scores).reduce((a, b) =&gt; scores[a] &gt; scores[b] ? a : b ); // If no clear winner (all zeros), default to MICRO (most general) return scores[winner] &gt; 0 ? winner : &#x27;MICRO&#x27;; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 40 lines const icdfQuestions = [ { id: &#x27;instruction&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should the AI perform?&#x27;, placeholder: &#x27;e.g., Analyze traffic patterns and identify top-performing content&#x27;, required: true, tooltip: &#x27;Be specific about the action you wantโ€”this is your core instruction.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the background or purpose?&#x27;, placeholder: &#x27;e.g., I run a photography blog and need to understand what content drives bookings&#x27;, default: &#x27;General business analysis&#x27;, tooltip: &#x27;Context helps AI understand WHY you need thisโ€”it tailors the analysis to your goals.&#x27; }, { id: &#x27;data&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What data will you provide to the AI?&#x27;, placeholder: &#x27;e.g., 3 months of Google Analytics data including traffic sources, bounce rates, and conversions&#x27;, default: &#x27;Standard dataset&#x27;, tooltip: &#x27;Specify what information the AI will work withโ€”this sets expectations.&#x27; }, { id: &#x27;format&#x27;, type: &#x27;choice&#x27;, label: &#x27;How should the output be structured?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Table/Spreadsheet&#x27; }, { value: &#x27;list&#x27;, label: &#x27;๐Ÿ“ Bullet Points&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;summary&#x27;, label: &#x27;โšก Executive Summary&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], default: &#x27;list&#x27;, tooltip: &#x27;Format determines how readable and actionable your results will be.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 69 lines const rcreocQuestions = [ { id: &#x27;role&#x27;, type: &#x27;choice&#x27;, label: &#x27;What expert role should the AI take?&#x27;, options: [ { value: &#x27;art-director&#x27;, label: &#x27;๐ŸŽจ Senior Art Director&#x27; }, { value: &#x27;photo-editor&#x27;, label: &#x27;๐Ÿ“ธ Professional Photo Editor&#x27; }, { value: &#x27;business-consultant&#x27;, label: &#x27;๐Ÿ’ผ Business Consultant&#x27; }, { value: &#x27;marketing-strategist&#x27;, label: &#x27;๐Ÿ“ˆ Marketing Strategist&#x27; }, { value: &#x27;technical-expert&#x27;, label: &#x27;โš™๏ธ Technical Specialist&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Role&#x27;, hasInput: true } ], required: true, tooltip: &#x27;The role shapes how the AI thinks and respondsโ€”choose the expert you need.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Describe the situation this expert is working in&#x27;, placeholder: &#x27;e.g., You are reviewing portfolio submissions for a high-end fashion campaign&#x27;, default: &#x27;Professional consulting environment&#x27;, tooltip: &#x27;Context gives the &quot;expert&quot; the scenarioโ€”this makes advice more targeted.&#x27; }, { id: &#x27;request&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should this expert complete?&#x27;, placeholder: &#x27;e.g., Review these 10 images and identify technical issues and strengths&#x27;, required: true, tooltip: &#x27;The specific task the expert will performโ€”be clear and actionable.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this as an issue and recommend using a light meter&#x27;, default: &#x27;Use professional industry standards&#x27;, tooltip: &#x27;Examples guide the AI&#x27;s reasoning styleโ€”show what &quot;good&quot; looks like.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;choice&#x27;, label: &#x27;What format should the expert deliver?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Structured Table&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;checklist&#x27;, label: &#x27;โœ… Action Checklist&#x27; }, { value: &#x27;recommendations&#x27;, label: &#x27;๐Ÿ’ก Recommendation List&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], default: &#x27;recommendations&#x27;, tooltip: &#x27;Output format determines how you&#x27;ll use the expert&#x27;s advice.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone and style should the expert use?&#x27;, options: [ { value: &#x27;professional-constructive&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Constructive&#x27; }, { value: &#x27;direct-concise&#x27;, label: &#x27;โšก Direct &amp; Concise&#x27; }, { value: &#x27;detailed-educational&#x27;, label: &#x27;๐Ÿ“š Detailed &amp; Educational&#x27; }, { value: &#x27;friendly-encouraging&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Encouraging&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Tone&#x27;, hasInput: true } ], default: &#x27;professional-constructive&#x27;, tooltip: &#x27;Constraints set boundariesโ€”tone, length, and style rules for the output.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 56 lines const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the core idea or thesis?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of fieldโ€”it&#x27;s the most important camera setting to learn first&#x27;, required: true, tooltip: &#x27;Your message is the central pointโ€”what should the audience remember?&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after reading?&#x27;, placeholder: &#x27;e.g., Feel confident experimenting with aperture settings and excited to try it themselves&#x27;, required: true, tooltip: &#x27;Intention drives the emotional outcomeโ€”persuade, inspire, educate, or entertain?&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is the audience and where will they see this?&#x27;, placeholder: &#x27;e.g., Beginner photographers aged 25-40 watching on YouTube&#x27;, default: &#x27;General online audience&#x27;, tooltip: &#x27;Context shapes language, tone, and examplesโ€”know your reader.&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone and pace should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐Ÿ“š Calm &amp; Educational&#x27; }, { value: &#x27;witty-conversational&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Conversational&#x27; }, { value: &#x27;professional-authoritative&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Authoritative&#x27; }, { value: &#x27;inspiring-motivational&#x27;, label: &#x27;โœจ Inspiring &amp; Motivational&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Rhythm&#x27;, hasInput: true } ], default: &#x27;calm-educational&#x27;, tooltip: &#x27;Rhythm is the voice and energyโ€”fast or slow, serious or playful?&#x27; }, { id: &#x27;output&#x27;, type: &#x27;choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;youtube-script&#x27;, label: &#x27;๐ŸŽฅ YouTube Script&#x27; }, { value: &#x27;blog-post&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;social-media&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Format&#x27;, hasInput: true } ], required: true, tooltip: &#x27;Output type determines structureโ€”scripts need hooks, blogs need SEO, etc.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 64 lines const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the marketing situation?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack for wedding photographers&#x27;, required: true, tooltip: &#x27;Context sets the stageโ€”new product, seasonal sale, or re-engagement campaign?&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s the specific offer or product?&#x27;, placeholder: &#x27;e.g., &quot;California Light&quot; preset collection, 25% off for 3 days&#x27;, required: true, tooltip: &#x27;The offer is what you&#x27;re sellingโ€”be specific about the deal and urgency.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;choice&#x27;, label: &#x27;What tone should the marketing copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimal&#x27; }, { value: &#x27;urgent-exciting&#x27;, label: &#x27;โšก Urgent &amp; Exciting&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Warm&#x27; }, { value: &#x27;professional-trustworthy&#x27;, label: &#x27;๐ŸŽฏ Professional &amp; Trustworthy&#x27; }, { value: &#x27;bold-provocative&#x27;, label: &#x27;๐Ÿ”ฅ Bold &amp; Provocative&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom Style&#x27;, hasInput: true } ], default: &#x27;friendly-warm&#x27;, tooltip: &#x27;Style creates the emotional connectionโ€”match your brand voice.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your target customer?&#x27;, placeholder: &#x27;e.g., Wedding and lifestyle photographers aged 25-45 who want to speed up their editing workflow&#x27;, required: true, tooltip: &#x27;Target audience determines language, pain points, and benefits to highlight.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;choice&#x27;, label: &#x27;What&#x27;s the primary call-to-action?&#x27;, options: [ { value: &#x27;buy-now&#x27;, label: &#x27;๐Ÿ›’ Buy Now&#x27; }, { value: &#x27;sign-up&#x27;, label: &#x27;๐Ÿ“ Sign Up&#x27; }, { value: &#x27;learn-more&#x27;, label: &#x27;๐Ÿ“š Learn More&#x27; }, { value: &#x27;download&#x27;, label: &#x27;โฌ‡๏ธ Download&#x27; }, { value: &#x27;book-call&#x27;, label: &#x27;๐Ÿ“ž Book a Call&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;โœ๏ธ Custom CTA&#x27;, hasInput: true } ], required: true, tooltip: &#x27;Action is the ONE thing you want them to doโ€”make it crystal clear.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What&#x27;s your business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build email list of potential customers&#x27;, default: &#x27;Increase conversions and revenue&#x27;, tooltip: &#x27;Result aligns the copy with your business objectiveโ€”sales, leads, or awareness?&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 19 lines function assembleICDF(answers) { return `**Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data:** ${answers.data} **Format:** Please provide the output as ${answers.format === &#x27;custom&#x27; ? answers.formatCustom : answers.format}. ${getFormatGuidance(answers.format)}`; } function getFormatGuidance(format) { const guidance = { &#x27;table&#x27;: &#x27;Structure the information in clear columns with headers.&#x27;, &#x27;list&#x27;: &#x27;Use bullet points for easy scanning.&#x27;, &#x27;report&#x27;: &#x27;Write in paragraph form with clear sections and headers.&#x27;, &#x27;summary&#x27;: &#x27;Provide a concise executive summary highlighting key findings.&#x27; }; return guidance[format] || &#x27;&#x27;; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 26 lines function assembleRCREOC(answers) { const role = answers.role === &#x27;custom&#x27; ? answers.roleCustom : getRoleTitle(answers.role); return `**Role:** You are a ${role}. **Context:** ${answers.context} **Request:** ${answers.request} **Examples:** ${answers.examples} **Output:** ${getOutputFormat(answers.output)} **Constraints:** ${getConstraints(answers.constraints)}`; } function getRoleTitle(roleKey) { const roles = { &#x27;art-director&#x27;: &#x27;Senior Art Director at a high-fashion advertising agency&#x27;, &#x27;photo-editor&#x27;: &#x27;Professional Photo Editor with 10+ years experience&#x27;, &#x27;business-consultant&#x27;: &#x27;Senior Business Strategy Consultant&#x27;, &#x27;marketing-strategist&#x27;: &#x27;Marketing Strategy Director&#x27;, &#x27;technical-expert&#x27;: &#x27;Technical Specialist and Industry Expert&#x27; }; return roles[roleKey]; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 22 lines function assembleMICRO(answers) { return `**Message:** ${answers.message} **Intention:** ${answers.intention} **Context:** ${answers.context} **Rhythm:** ${getRhythmDescription(answers.rhythm)} **Output:** Create a ${answers.output === &#x27;custom&#x27; ? answers.outputCustom : getOutputType(answers.output)} that ${answers.intention}`; } function getRhythmDescription(rhythm) { const rhythms = { &#x27;fast-exciting&#x27;: &#x27;Use a fast-paced, exciting tone with short sentences and dynamic language.&#x27;, &#x27;calm-educational&#x27;: &#x27;Maintain a calm, educational tone that explains concepts clearly.&#x27;, &#x27;witty-conversational&#x27;: &#x27;Write in a witty, conversational style that feels like talking to a friend.&#x27;, &#x27;professional-authoritative&#x27;: &#x27;Use a professional, authoritative voice that establishes credibility.&#x27;, &#x27;inspiring-motivational&#x27;: &#x27;Create an inspiring, motivational tone that energizes the reader.&#x27; }; return rhythm === &#x27;custom&#x27; ? answers.rhythmCustom : rhythms[rhythm]; } This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 24 lines function assembleCOSTAR(answers) { return `**Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** ${getStyleDescription(answers.style)} **Target:** ${answers.target} **Action:** ${getActionCTA(answers.action)} **Result:** The goal is to ${answers.result}`; } function getStyleDescription(style) { const styles = { &#x27;elegant-minimal&#x27;: &#x27;Write in an elegant, minimalist styleโ€”simple, sophisticated, and chic.&#x27;, &#x27;urgent-exciting&#x27;: &#x27;Create urgency and excitementโ€”make them feel they can&#x27;t miss this.&#x27;, &#x27;friendly-warm&#x27;: &#x27;Use a friendly, warm tone like a message from a trusted friend.&#x27;, &#x27;professional-trustworthy&#x27;: &#x27;Maintain a professional, trustworthy voice that builds confidence.&#x27;, &#x27;bold-provocative&#x27;: &#x27;Be bold and provocativeโ€”challenge assumptions and grab attention.&#x27; }; return style === &#x27;custom&#x27; ? answers.styleCustom : styles[style]; } This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 41 lines &lt;section className=&quot;hero-section&quot;&gt; &lt;h1&gt;AI Prompt Generator&lt;/h1&gt; &lt;p className=&quot;subtitle&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;div className=&quot;framework-wizard&quot;&gt; &lt;h2&gt;What do you want to do?&lt;/h2&gt; &lt;div className=&quot;framework-grid&quot;&gt; {/* 4 Framework Cards */} &lt;FrameworkCard icon=&quot;๐Ÿ“Š&quot; title=&quot;Analyze Data&quot; subtitle=&quot;Get precise analytical insights&quot; color=&quot;#3B82F6&quot; onClick={() =&gt; selectFramework(&#x27;ICDF&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;๐ŸŽฏ&quot; title=&quot;Get Expert Advice&quot; subtitle=&quot;AI becomes your specialist consultant&quot; color=&quot;#8B5CF6&quot; onClick={() =&gt; selectFramework(&#x27;RCREOC&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;โœ๏ธ&quot; title=&quot;Create Content&quot; subtitle=&quot;Generate engaging written content&quot; color=&quot;#10B981&quot; onClick={() =&gt; selectFramework(&#x27;MICRO&#x27;)} /&gt; &lt;FrameworkCard icon=&quot;๐Ÿš€&quot; title=&quot;Write Marketing Copy&quot; subtitle=&quot;Craft persuasive sales messages&quot; color=&quot;#F59E0B&quot; onClick={() =&gt; selectFramework(&#x27;COSTAR&#x27;)} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 12 lines const FrameworkCard = ({ icon, title, subtitle, color, onClick }) =&gt; ( &lt;button className=&quot;framework-card&quot; style={{ borderColor: color }} onClick={onClick} &gt; &lt;div className=&quot;icon&quot; style={{ color }}&gt;{icon}&lt;/div&gt; &lt;h3&gt;{title}&lt;/h3&gt; &lt;p&gt;{subtitle}&lt;/p&gt; &lt;span className=&quot;arrow&quot;&gt;โ†’&lt;/span&gt; &lt;/button&gt; ); This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 30 lines &lt;section className=&quot;prompt-input-section&quot;&gt; &lt;div className=&quot;back-button&quot; onClick={goBack}&gt; โ† Back to framework selection &lt;/div&gt; &lt;div className=&quot;selected-framework-badge&quot; style={{ backgroundColor: frameworkColor }}&gt; {frameworkIcon} {frameworkTitle} &lt;/div&gt; &lt;h2&gt;Describe what you need&lt;/h2&gt; &lt;p className=&quot;helper-text&quot;&gt; Write in your own wordsโ€”we&#x27;ll ask follow-up questions to make it perfect. &lt;/p&gt; &lt;textarea className=&quot;initial-prompt-input&quot; placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts get the most engagement...&quot; value={userPrompt} onChange={(e) =&gt; setUserPrompt(e.target.value)} rows={6} /&gt; &lt;button className=&quot;continue-btn&quot; onClick={startQuestionnaire} disabled={userPrompt.length &lt; 10} &gt; Continue โ†’ &lt;/button&gt; &lt;/section&gt; This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 85 lines &lt;section className=&quot;questionnaire-section&quot;&gt; {/* Progress indicator */} &lt;div className=&quot;progress-bar&quot;&gt; &lt;div className=&quot;progress-fill&quot; style={{ width: `${(currentQuestion / totalQuestions) * 100}%` }} /&gt; &lt;/div&gt; &lt;p className=&quot;progress-text&quot;&gt; Question {currentQuestion} of {totalQuestions} &lt;/p&gt; {/* Question card */} &lt;div className=&quot;question-card&quot;&gt; &lt;label className=&quot;question-label&quot;&gt; {question.label} {question.tooltip &amp;&amp; ( &lt;Tooltip content={question.tooltip}&gt; &lt;span className=&quot;info-icon&quot;&gt;โ„น๏ธ&lt;/span&gt; &lt;/Tooltip&gt; )} &lt;/label&gt; {/* Render based on question type */} {question.type === &#x27;choice&#x27; &amp;&amp; ( &lt;div className=&quot;choice-grid&quot;&gt; {question.options.map(option =&gt; ( &lt;button key={option.value} className={`choice-btn ${selectedValue === option.value ? &#x27;selected&#x27; : &#x27;&#x27;}`} onClick={() =&gt; handleChoice(option.value)} &gt; {option.label} &lt;/button&gt; ))} &lt;/div&gt; )} {question.type === &#x27;textarea&#x27; &amp;&amp; ( &lt;textarea className=&quot;question-textarea&quot; placeholder={question.placeholder} value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} rows={4} /&gt; )} {/* Custom input for &quot;Other&quot; options */} {showCustomInput &amp;&amp; ( &lt;input type=&quot;text&quot; className=&quot;custom-input&quot; placeholder=&quot;Specify...&quot; value={customValue} onChange={(e) =&gt; setCustomValue(e.target.value)} /&gt; )} &lt;/div&gt; {/* Navigation */} &lt;div className=&quot;question-nav&quot;&gt; &lt;button className=&quot;btn-secondary&quot; onClick={previousQuestion} disabled={currentQuestion === 1} &gt; โ† Previous &lt;/button&gt; &lt;button className=&quot;btn-skip&quot; onClick={skipQuestion} &gt; Skip (use default) &lt;/button&gt; &lt;button className=&quot;btn-primary&quot; onClick={nextQuestion} &gt; {currentQuestion === totalQuestions ? &#x27;Generate Prompt&#x27; : &#x27;Next โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/section&gt; This code can be executed in the preview sandbox Run Code React Component React JSXโ€ข 69 lines &lt;section className=&quot;results-section&quot;&gt; &lt;div className=&quot;success-header&quot;&gt; &lt;span className=&quot;success-icon&quot;&gt;โœ“&lt;/span&gt; &lt;h2&gt;Your Professional Prompt is Ready!&lt;/h2&gt; &lt;/div&gt; {/* Desktop: Side-by-side, Mobile: Stacked */} &lt;div className=&quot;comparison-container&quot;&gt; &lt;div className=&quot;prompt-box original&quot;&gt; &lt;div className=&quot;prompt-header&quot;&gt; &lt;h3&gt;Your Original Prompt&lt;/h3&gt; &lt;span className=&quot;badge amateur&quot;&gt;Amateur&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;prompt-content&quot;&gt; {originalPrompt} &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;arrow-separator&quot;&gt; &lt;span className=&quot;transform-arrow&quot;&gt;โ†’&lt;/span&gt; &lt;span className=&quot;transform-text&quot;&gt;Transformed into&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;prompt-box enhanced&quot;&gt; &lt;div className=&quot;prompt-header&quot;&gt; &lt;h3&gt;Professional Version&lt;/h3&gt; &lt;span className=&quot;badge pro&quot;&gt;Pro&lt;/span&gt; &lt;button className=&quot;copy-btn&quot; onClick={() =&gt; copyToClipboard(enhancedPrompt)} &gt; {copied ? &#x27;โœ“ Copied!&#x27; : &#x27;๐Ÿ“‹ Copy&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;div className=&quot;prompt-content highlighted&quot;&gt; {enhancedPrompt} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {/* Learning Mode Explanations */} &lt;div className=&quot;learning-section&quot;&gt; &lt;h3&gt; &lt;span className=&quot;icon&quot;&gt;๐Ÿ’ก&lt;/span&gt; Why This Works Better &lt;/h3&gt; &lt;div className=&quot;improvements-list&quot;&gt; {improvements.map((improvement, index) =&gt; ( &lt;div key={index} className=&quot;improvement-item&quot;&gt; &lt;span className=&quot;check&quot;&gt;โœ“&lt;/span&gt; &lt;div&gt; &lt;strong&gt;{improvement.title}&lt;/strong&gt; &lt;p&gt;{improvement.explanation}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Actions */} &lt;div className=&quot;results-actions&quot;&gt; &lt;button className=&quot;btn-secondary&quot; onClick={startOver}&gt; โ† Create Another Prompt &lt;/button&gt; &lt;button className=&quot;btn-primary&quot; onClick={() =&gt; copyToClipboard(enhancedPrompt)}&gt; ๐Ÿ“‹ Copy Professional Prompt &lt;/button&gt; &lt;/div&gt; &lt;/section&gt; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 89 lines function generateImprovements(framework, originalPrompt, answers) { const improvements = []; switch(framework) { case &#x27;ICDF&#x27;: improvements.push({ title: &#x27;Added Clear Instruction&#x27;, explanation: &#x27;Instead of vague direction, we specified exactly what task the AI should perform.&#x27; }); if (answers.context !== &#x27;General business analysis&#x27;) { improvements.push({ title: &#x27;Provided Context&#x27;, explanation: &#x27;Context helps the AI understand WHY you need this, leading to more relevant results.&#x27; }); } if (answers.data) { improvements.push({ title: &#x27;Defined Data Scope&#x27;, explanation: &#x27;Telling the AI what data to work with sets clear expectations and boundaries.&#x27; }); } improvements.push({ title: &#x27;Specified Output Format&#x27;, explanation: `Requesting ${answers.format} format ensures the results are structured and actionable.` }); break; case &#x27;RCREOC&#x27;: improvements.push({ title: &#x27;Assigned Expert Role&#x27;, explanation: `Making the AI act as a ${answers.role} changes how it thinks and responds.` }); improvements.push({ title: &#x27;Set Professional Context&#x27;, explanation: &#x27;Describing the work environment makes the AI\&#x27;s advice more targeted and realistic.&#x27; }); if (answers.examples) { improvements.push({ title: &#x27;Provided Examples&#x27;, explanation: &#x27;Examples guide the AI\&#x27;s reasoning styleโ€”showing what &quot;good&quot; looks like.&#x27; }); } improvements.push({ title: &#x27;Defined Constraints&#x27;, explanation: &#x27;Setting tone and style rules ensures the output matches your needs.&#x27; }); break; case &#x27;MICRO&#x27;: improvements.push({ title: &#x27;Clarified Core Message&#x27;, explanation: &#x27;A clear thesis ensures the content stays focused on one main idea.&#x27; }); improvements.push({ title: &#x27;Defined Intention&#x27;, explanation: &#x27;Specifying what the audience should feel or do drives the content\&#x27;s direction.&#x27; }); improvements.push({ title: &#x27;Set Rhythm &amp; Tone&#x27;, explanation: `${answers.rhythm} creates the right energy and voice for your audience.` }); improvements.push({ title: &#x27;Specified Content Type&#x27;, explanation: `Different formats (${answers.output}) have different structuresโ€”scripts need hooks, blogs need SEO.` }); break; case &#x27;COSTAR&#x27;: improvements.push({ title: &#x27;Defined Target Audience&#x27;, explanation: &#x27;Knowing WHO you\&#x27;re selling to shapes the language, pain points, and benefits.&#x27; }); improvements.push({ title: &#x27;Clarified the Offer&#x27;, explanation: &#x27;Being specific about the deal and urgency increases conversion rates.&#x27; }); improvements.push({ title: &#x27;Set Brand Style&#x27;, explanation: `${answers.style} tone creates emotional connection and matches your brand voice.` }); improvements.push({ title: &#x27;Added Clear CTA&#x27;, explanation: &#x27;A single, clear call-to-action tells people exactly what to do next.&#x27; }); break; } return improvements; } This code can be executed in the preview sandbox Run Code Code Snippet 18 Plain Textโ€ข 19 lines /app /prompt-generator /page.tsx # Main landing page /layout.tsx # Layout wrapper /components /FrameworkWizard.tsx # 4-card selection UI /PromptInput.tsx # Initial prompt textarea /Questionnaire.tsx # Adaptive question flow /ResultsComparison.tsx # Before/After display /Tooltip.tsx # Learning mode tooltips /lib /frameworkDetection.ts # Keyword matching logic /questionSets.ts # All framework questions /promptAssembly.ts # Template generation /improvements.ts # Learning explanations /types /index.ts # TypeScript interfaces /styles /prompt-generator.css # Component styles Used 89 credits continue till the end Used 0 credits javascript const icdfQuestions = [ { id: &#x27;instruction&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should the AI perform?&#x27;, placeholder: &#x27;e.g., Analyze my website traffic and identify top-performing pages&#x27;, required: true, tooltip: &#x27;The clearer your instruction, the more precise the AI\&#x27;s response. Be specific about the action you want.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the background or purpose?&#x27;, placeholder: &#x27;e.g., I\&#x27;m a wedding photographer trying to understand which blog posts drive the most inquiries&#x27;, required: false, defaultValue: &#x27;General analysis for decision-making purposes&#x27;, tooltip: &#x27;Context helps the AI understand WHY you need this analysis, leading to more relevant insights.&#x27; }, { id: &#x27;data&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What data or information should the AI work with?&#x27;, placeholder: &#x27;e.g., Traffic data from July-September including bounce rate, time-on-page, and conversions&#x27;, required: false, defaultValue: &#x27;Standard relevant data points&#x27;, tooltip: &#x27;Specify exactly what information the AI should analyze. The more specific, the better.&#x27; }, { id: &#x27;format&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;How should the output be structured?&#x27;, options: [ { value: &#x27;bullet-points&#x27;, label: &#x27;Bullet Points&#x27; }, { value: &#x27;table&#x27;, label: &#x27;Table Format&#x27; }, { value: &#x27;report&#x27;, label: &#x27;Detailed Report&#x27; }, { value: &#x27;summary&#x27;, label: &#x27;Executive Summary&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, organized summary with actionable insights&#x27;, tooltip: &#x27;Defining the output format ensures you get results in the exact structure you need.&#x27; } ]; RCREOC Framework Questions javascript const rcreocQuestions = [ { id: &#x27;role&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What expert role should the AI assume?&#x27;, options: [ { value: &#x27;senior-photographer&#x27;, label: &#x27;๐Ÿ“ธ Senior Photographer&#x27; }, { value: &#x27;art-director&#x27;, label: &#x27;๐ŸŽจ Art Director&#x27; }, { value: &#x27;marketing-expert&#x27;, label: &#x27;๐Ÿ“ˆ Marketing Strategist&#x27; }, { value: &#x27;business-consultant&#x27;, label: &#x27;๐Ÿ’ผ Business Consultant&#x27; }, { value: &#x27;technical-expert&#x27;, label: &#x27;โš™๏ธ Technical Specialist&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Expert...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Assigning a specific role makes the AI respond with the expertise and perspective of that professional.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Describe the situation or environment&#x27;, placeholder: &#x27;e.g., We\&#x27;re reviewing a photographer\&#x27;s portfolio for a potential high-fashion campaign&#x27;, required: false, defaultValue: &#x27;Professional consulting environment&#x27;, tooltip: &#x27;Context sets the stakes and helps the AI understand the real-world implications.&#x27; }, { id: &#x27;request&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should this expert complete?&#x27;, placeholder: &#x27;e.g., Review the portfolio and identify technical issues, strengths, and provide recommendations&#x27;, required: true, tooltip: &#x27;This is the core deliverable you need from your virtual expert.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this under &quot;Issues&quot; and recommend &quot;use a light meter&quot;&#x27;, required: false, defaultValue: &#x27;Professional industry-standard analysis&#x27;, tooltip: &#x27;Examples guide the AI\&#x27;s reasoning process and output style.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What format should the deliverable take?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Table&#x27; }, { value: &#x27;list&#x27;, label: &#x27;๐Ÿ“ Numbered List&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;scorecard&#x27;, label: &#x27;โญ Scorecard&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Structured professional assessment&#x27;, tooltip: &#x27;The output format determines how easy it is to use the AI\&#x27;s advice.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and style should the expert use?&#x27;, options: [ { value: &#x27;professional-constructive&#x27;, label: &#x27;Professional &amp; Constructive&#x27; }, { value: &#x27;direct-actionable&#x27;, label: &#x27;Direct &amp; Actionable&#x27; }, { value: &#x27;encouraging-supportive&#x27;, label: &#x27;Encouraging &amp; Supportive&#x27; }, { value: &#x27;formal-academic&#x27;, label: &#x27;Formal &amp; Academic&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Tone...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and clear&#x27;, tooltip: &#x27;Tone constraints ensure the AI communicates in a way that matches your needs.&#x27; } ]; MICRO Framework Questions javascript const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the core message or main idea?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of fieldโ€”it\&#x27;s the most important camera setting to master first&#x27;, required: true, tooltip: &#x27;Your message is the &quot;thesis&quot;โ€”the one key takeaway your audience should remember.&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after consuming this?&#x27;, placeholder: &#x27;e.g., Feel confident and motivated to experiment with aperture settings on their own camera&#x27;, required: false, defaultValue: &#x27;Inform and engage the audience&#x27;, tooltip: &#x27;Intention drives the emotional arc and call-to-action of your content.&#x27; }, { id: &#x27;context-audience&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your audience and where will they see this?&#x27;, placeholder: &#x27;e.g., Beginner photographers aged 25-40, watching on YouTube during their learning journey&#x27;, required: false, defaultValue: &#x27;General audience on standard platforms&#x27;, tooltip: &#x27;Knowing your audience helps the AI match the complexity and references to their level.&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and pacing should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;conversational-friendly&#x27;, label: &#x27;๐Ÿ’ฌ Conversational &amp; Friendly&#x27; }, { value: &#x27;professional-authoritative&#x27;, label: &#x27;๐ŸŽ“ Professional &amp; Authoritative&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐Ÿ“š Calm &amp; Educational&#x27; }, { value: &#x27;witty-entertaining&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Entertaining&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Rhythm...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Engaging and clear&#x27;, tooltip: &#x27;Rhythm defines the &quot;voice&quot; and energy level of your content.&#x27; }, { id: &#x27;output-type&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;youtube-script&#x27;, label: &#x27;๐ŸŽฅ YouTube Script&#x27; }, { value: &#x27;blog-post&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;social-media&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;instagram-carousel&#x27;, label: &#x27;๐Ÿ“ธ Instagram Carousel&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Format...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Each content type has specific structural requirements the AI will follow.&#x27; }, { id: &#x27;length&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;How long should this content be?&#x27;, options: [ { value: &#x27;short&#x27;, label: &#x27;30 seconds - 1 minute&#x27; }, { value: &#x27;medium&#x27;, label: &#x27;3-5 minutes&#x27; }, { value: &#x27;long&#x27;, label: &#x27;10+ minutes&#x27; }, { value: &#x27;word-count&#x27;, label: &#x27;Specific word count...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Appropriate length for the format&#x27;, tooltip: &#x27;Length constraints help the AI pace the content appropriately.&#x27; } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the marketing situation or campaign?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack called &quot;California Light&quot;&#x27;, required: true, tooltip: &#x27;Context sets the stage for your marketing message.&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the specific product, service, or deal?&#x27;, placeholder: &#x27;e.g., 25% off the preset pack for the first 3 days only&#x27;, required: true, tooltip: &#x27;Your offer is what you\&#x27;re sellingโ€”be crystal clear about value and urgency.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and voice should the copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimal&#x27; }, { value: &#x27;urgent-exciting&#x27;, label: &#x27;๐Ÿ”ฅ Urgent &amp; Exciting&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Warm&#x27; }, { value: &#x27;professional-trustworthy&#x27;, label: &#x27;๐Ÿค Professional &amp; Trustworthy&#x27; }, { value: &#x27;bold-confident&#x27;, label: &#x27;๐Ÿ’ช Bold &amp; Confident&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Style...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and persuasive&#x27;, tooltip: &#x27;Style determines how your brand &quot;sounds&quot; to customers.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your ideal customer?&#x27;, placeholder: &#x27;e.g., 25-45 year old lifestyle and wedding photographers who want faster, more beautiful editing&#x27;, required: false, defaultValue: &#x27;Target customers interested in this offering&#x27;, tooltip: &#x27;The more specific your target audience, the more personalized and effective the copy.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ONE action you want them to take?&#x27;, placeholder: &#x27;e.g., Click &quot;Buy Now&quot; before the 3-day discount expires&#x27;, required: true, tooltip: &#x27;A clear, single call-to-action dramatically increases conversion rates.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s your business goal for this campaign?&#x27;, placeholder: &#x27;e.g., Generate 50 sales in the first 3 days and build momentum for future launches&#x27;, required: false, defaultValue: &#x27;Drive conversions and grow revenue&#x27;, tooltip: &#x27;Understanding the business goal helps craft copy that aligns with your strategy.&#x27; } ]; 5. Prompt Assembly Logic Template Structure Each framework has a template that combines user answers into a professional prompt: javascript // ICDF Template function assembleICDF(answers) { return `${answers.instruction} **Context:** ${answers.context} **Data to analyze:** ${answers.data} **Required output format:** ${answers.format} Please provide a ${answers.format} that directly addresses the instruction above, using the specified data and keeping the context in mind.`; } // RCREOC Template function assembleRCREOC(answers) { return `You are a ${answers.role}. **Context:** ${answers.context} **Your task:** ${answers.request} **Example of expected thinking:** ${answers.examples} **Required output format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as the assigned role, following the output format and constraints specified.`; } // MICRO Template function assembleMICRO(answers) { return `Create a ${answers.outputType} with the following specifications: **Core Message:** ${answers.message} **Intended audience impact:** ${answers.intention} **Target Audience &amp; Platform:** ${answers.contextAudience} **Tone and Pacing:** ${answers.rhythm} **Length:** ${answers.length} The content should communicate the core message clearly while achieving the intended emotional impact and maintaining the specified tone throughout.`; } // COSTAR Template function assembleCOSTAR(answers) { return `Write marketing copy for the following campaign: **Campaign Context:** ${answers.context} **Offer/Product:** ${answers.offer} **Brand Voice &amp; Style:** ${answers.style} **Target Customer:** ${answers.target} **Desired Action (CTA):** ${answers.action} **Business Goal:** ${answers.result} The copy should speak directly to the target customer, highlight the offer&#x27;s value, maintain the brand voice, and drive the desired action while supporting the overall business goal.`; } 6. UI/UX Component Specifications Landing Page (Quick-Start Wizard) tsx // /app/prompt-generator/page.tsx import { FrameworkCard } from &#x27;@/components/prompt-generator/FrameworkCard&#x27;; export default function PromptGeneratorPage() { return ( &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; {/* Hero Section */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds. No expertise required. &lt;/p&gt; &lt;/div&gt; {/* Framework Selection Cards */} &lt;div className=&quot;grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto&quot;&gt; &lt;FrameworkCard icon=&quot;๐Ÿ“Š&quot; color=&quot;#3B82F6&quot; title=&quot;Analyze Data&quot; subtitle=&quot;Get precise analytical insights&quot; framework=&quot;ICDF&quot; examples={[ &quot;Review website analytics&quot;, &quot;Evaluate business metrics&quot;, &quot;Assess survey results&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;๐ŸŽฏ&quot; color=&quot;#8B5CF6&quot; title=&quot;Get Expert Advice&quot; subtitle=&quot;AI becomes your specialist&quot; framework=&quot;RCREOC&quot; examples={[ &quot;Portfolio review&quot;, &quot;Business consultation&quot;, &quot;Technical guidance&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;โœ๏ธ&quot; color=&quot;#10B981&quot; title=&quot;Create Content&quot; subtitle=&quot;Generate engaging content&quot; framework=&quot;MICRO&quot; examples={[ &quot;YouTube scripts&quot;, &quot;Blog posts&quot;, &quot;Social media content&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;๐Ÿš€&quot; color=&quot;#F59E0B&quot; title=&quot;Write Marketing&quot; subtitle=&quot;Craft persuasive copy&quot; framework=&quot;COSTAR&quot; examples={[ &quot;Sales emails&quot;, &quot;Ad campaigns&quot;, &quot;Product descriptions&quot; ]} /&gt; &lt;/div&gt; {/* Not Sure Option */} &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt;Not sure which one you need?&lt;/p&gt; &lt;button className=&quot;btn-secondary&quot;&gt; Describe Your Goal โ†’ &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } Framework Card Component tsx // /components/prompt-generator/FrameworkCard.tsx interface FrameworkCardProps { icon: string; color: string; title: string; subtitle: string; framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; examples: string[]; } export function FrameworkCard({ icon, color, title, subtitle, framework, examples }: FrameworkCardProps) { return ( &lt;div className=&quot;border-2 border-gray-200 rounded-lg p-6 hover:shadow-lg transition-all cursor-pointer group&quot; onClick={() =&gt; window.location.href = `/prompt-generator/${framework.toLowerCase()}`} &gt; {/* Icon */} &lt;div className=&quot;text-5xl mb-4 transition-transform group-hover:scale-110&quot; style={{ filter: `drop-shadow(0 0 8px ${color}40)` }} &gt; {icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-xl font-bold mb-2&quot;&gt;{title}&lt;/h3&gt; &lt;p className=&quot;text-gray-600 text-sm mb-4&quot;&gt;{subtitle}&lt;/p&gt; {/* Examples */} &lt;div className=&quot;space-y-2&quot;&gt; &lt;p className=&quot;text-xs font-semibold text-gray-500 uppercase&quot;&gt;Examples:&lt;/p&gt; {examples.map((example, idx) =&gt; ( &lt;div key={idx} className=&quot;text-sm text-gray-700 flex items-start&quot;&gt; &lt;span className=&quot;mr-2&quot;&gt;โ€ข&lt;/span&gt; &lt;span&gt;{example}&lt;/span&gt; &lt;/div&gt; ))} &lt;/div&gt; {/* CTA */} &lt;div className=&quot;mt-6 text-center py-2 rounded font-semibold text-white transition-colors&quot; style={{ backgroundColor: color }} &gt; Start โ†’ &lt;/div&gt; &lt;/div&gt; ); } 7. Question Flow Component tsx // /components/prompt-generator/QuestionFlow.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Tooltip } from &#x27;@/components/ui/Tooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean }&gt;; required: boolean; defaultValue: string; tooltip: string; } interface QuestionFlowProps { questions: Question[]; framework: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export function QuestionFlow({ questions, framework, onComplete }: QuestionFlowProps) { const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [customInputs, setCustomInputs] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleNext = () =&gt; { // Apply smart default if skipped if (!answers[currentQuestion.id]) { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentStep &lt; questions.length - 1) { setCurrentStep(prev =&gt; prev + 1); } else { // Final step - assemble prompt onComplete(answers); } }; const handlePrevious = () =&gt; { if (currentStep &gt; 0) { setCurrentStep(prev =&gt; prev - 1); } }; return ( &lt;div className=&quot;max-w-3xl mx-auto&quot;&gt; {/* Progress Bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 mb-2&quot;&gt; &lt;span&gt;Question {currentStep + 1} of {questions.length}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full bg-gray-200 rounded-full h-2&quot;&gt; &lt;div className=&quot;bg-blue-600 h-2 rounded-full transition-all duration-300&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Question Card */} &lt;div className=&quot;bg-white border-2 border-gray-200 rounded-lg p-8&quot;&gt; {/* Question Label with Tooltip */} &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;label className=&quot;text-lg font-semibold text-gray-900&quot;&gt; {currentQuestion.label} {currentQuestion.required &amp;&amp; &lt;span className=&quot;text-red-500 ml-1&quot;&gt;*&lt;/span&gt;} &lt;/label&gt; &lt;Tooltip content={currentQuestion.tooltip}&gt; &lt;button className=&quot;text-gray-400 hover:text-gray-600&quot;&gt; &lt;svg className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 20 20&quot;&gt; &lt;path fillRule=&quot;evenodd&quot; d=&quot;M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z&quot; clipRule=&quot;evenodd&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; &lt;/Tooltip&gt; &lt;/div&gt; {/* Input Field */} {currentQuestion.type === &#x27;textarea&#x27; ? ( &lt;textarea className=&quot;w-full border-2 border-gray-300 rounded-lg p-4 focus:border-blue-500 focus:outline-none resize-none&quot; rows={4} placeholder={currentQuestion.placeholder} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(e) =&gt; setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value }))} /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {currentQuestion.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button className={`w-full text-left p-4 border-2 rounded-lg transition-all ${ answers[currentQuestion.id] === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-300 hover:border-gray-400&#x27; }`} onClick={() =&gt; { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: option.value })); }} &gt; {option.label} &lt;/button&gt; {/* Custom text field for &quot;Other&quot; options */} {option.hasTextField &amp;&amp; answers[currentQuestion.id] === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; className=&quot;w-full mt-2 border-2 border-gray-300 rounded-lg p-3 focus:border-blue-500 focus:outline-none&quot; placeholder=&quot;Specify...&quot; value={customInputs[currentQuestion.id] || &#x27;&#x27;} onChange={(e) =&gt; { setCustomInputs(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value })); setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value })); }} /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Skip Notice */} {!currentQuestion.required &amp;&amp; !answers[currentQuestion.id] &amp;&amp; ( &lt;p className=&quot;mt-3 text-sm text-gray-500 italic&quot;&gt; ๐Ÿ’ก You can skip this. We&#x27;ll use: &quot;{currentQuestion.defaultValue}&quot; &lt;/p&gt; )} &lt;/div&gt; {/* Navigation Buttons */} &lt;div className=&quot;flex justify-between mt-6&quot;&gt; &lt;button onClick={handlePrevious} disabled={currentStep === 0} className=&quot;px-6 py-3 border-2 border-gray-300 rounded-lg font-semibold disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50&quot; &gt; โ† Previous &lt;/button&gt; &lt;button onClick={handleNext} className=&quot;px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700&quot; &gt; {currentStep === questions.length - 1 ? &#x27;Generate Prompt โœจ&#x27; : &#x27;Next โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } 8. Before/After Comparison Component tsx // /components/prompt-generator/PromptComparison.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Tooltip } from &#x27;@/components/ui/Tooltip&#x27;; interface PromptComparisonProps { originalPrompt: string; professionalPrompt: string; framework: string; improvements: Array&lt;{ component: string; explanation: string; }&gt;; } export function PromptComparison({ originalPrompt, professionalPrompt, framework, improvements }: PromptComparisonProps) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(professionalPrompt); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-6xl mx-auto&quot;&gt; {/* Success Header */} &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;div className=&quot;inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-4&quot;&gt; &lt;svg className=&quot;w-8 h-8 text-green-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M5 13l4 4L19 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;h2 className=&quot;text-3xl font-bold mb-2&quot;&gt;Your Professional Prompt is Ready!&lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt;Using the {framework} framework&lt;/p&gt; &lt;/div&gt; {/* Side-by-Side Comparison (Desktop) / Stacked (Mobile) */} &lt;div className=&quot;grid md:grid-cols-2 gap-6 mb-8&quot;&gt; {/* Original Prompt */} &lt;div className=&quot;border-2 border-gray-300 rounded-lg p-6 bg-gray-50&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-3 text-gray-700&quot;&gt; ๐Ÿ“ Your Original Prompt &lt;/h3&gt; &lt;div className=&quot;bg-white rounded p-4 text-gray-600 italic&quot;&gt; &quot;{originalPrompt}&quot; &lt;/div&gt; &lt;/div&gt; {/* Professional Prompt */} &lt;div className=&quot;border-2 border-green-500 rounded-lg p-6 bg-green-50&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-3&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-green-700&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;button onClick={handleCopy} className=&quot;flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors&quot; &gt; {copied ? ( &lt;&gt; &lt;svg className=&quot;w-4 h-4&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M5 13l4 4L19 7&quot; /&gt; &lt;/svg&gt; Copied! &lt;/&gt; ) : ( &lt;&gt; &lt;svg className=&quot;w-4 h-4&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z&quot; /&gt; &lt;/svg&gt; Copy &lt;/&gt; )} &lt;/button&gt; &lt;/div&gt; &lt;div className=&quot;bg-white rounded p-4 text-gray-900 font-mono text-sm whitespace-pre-wrap&quot;&gt; {professionalPrompt} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {/* Learning Mode: What Changed? */} &lt;div className=&quot;bg-blue-50 border-2 border-blue-200 rounded-lg p-6&quot;&gt; &lt;h3 className=&quot;text-xl font-semibold mb-4 flex items-center gap-2&quot;&gt; &lt;span&gt;๐Ÿ“š&lt;/span&gt; &lt;span&gt;What Makes This Professional?&lt;/span&gt; &lt;/h3&gt; &lt;div className=&quot;space-y-4&quot;&gt; {improvements.map((improvement, idx) =&gt; ( &lt;div key={idx} className=&quot;flex items-start gap-3&quot;&gt; &lt;div className=&quot;flex-shrink-0 w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-bold&quot;&gt; {idx + 1} &lt;/div&gt; &lt;div&gt; &lt;h4 className=&quot;font-semibold text-gray-900 mb-1&quot;&gt; {improvement.component} &lt;/h4&gt; &lt;p className=&quot;text-gray-700 text-sm&quot;&gt; {improvement.explanation} &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; JavaScript JavaScriptโ€ข 43 lines const icdfQuestions = [ { id: &#x27;instruction&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should the AI perform?&#x27;, placeholder: &#x27;e.g., Analyze my website traffic and identify top-performing pages&#x27;, required: true, tooltip: &#x27;The clearer your instruction, the more precise the AI\&#x27;s response. Be specific about the action you want.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the background or purpose?&#x27;, placeholder: &#x27;e.g., I\&#x27;m a wedding photographer trying to understand which blog posts drive the most inquiries&#x27;, required: false, defaultValue: &#x27;General analysis for decision-making purposes&#x27;, tooltip: &#x27;Context helps the AI understand WHY you need this analysis, leading to more relevant insights.&#x27; }, { id: &#x27;data&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What data or information should the AI work with?&#x27;, placeholder: &#x27;e.g., Traffic data from July-September including bounce rate, time-on-page, and conversions&#x27;, required: false, defaultValue: &#x27;Standard relevant data points&#x27;, tooltip: &#x27;Specify exactly what information the AI should analyze. The more specific, the better.&#x27; }, { id: &#x27;format&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;How should the output be structured?&#x27;, options: [ { value: &#x27;bullet-points&#x27;, label: &#x27;Bullet Points&#x27; }, { value: &#x27;table&#x27;, label: &#x27;Table Format&#x27; }, { value: &#x27;report&#x27;, label: &#x27;Detailed Report&#x27; }, { value: &#x27;summary&#x27;, label: &#x27;Executive Summary&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, organized summary with actionable insights&#x27;, tooltip: &#x27;Defining the output format ensures you get results in the exact structure you need.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 73 lines const rcreocQuestions = [ { id: &#x27;role&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What expert role should the AI assume?&#x27;, options: [ { value: &#x27;senior-photographer&#x27;, label: &#x27;๐Ÿ“ธ Senior Photographer&#x27; }, { value: &#x27;art-director&#x27;, label: &#x27;๐ŸŽจ Art Director&#x27; }, { value: &#x27;marketing-expert&#x27;, label: &#x27;๐Ÿ“ˆ Marketing Strategist&#x27; }, { value: &#x27;business-consultant&#x27;, label: &#x27;๐Ÿ’ผ Business Consultant&#x27; }, { value: &#x27;technical-expert&#x27;, label: &#x27;โš™๏ธ Technical Specialist&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Expert...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Assigning a specific role makes the AI respond with the expertise and perspective of that professional.&#x27; }, { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Describe the situation or environment&#x27;, placeholder: &#x27;e.g., We\&#x27;re reviewing a photographer\&#x27;s portfolio for a potential high-fashion campaign&#x27;, required: false, defaultValue: &#x27;Professional consulting environment&#x27;, tooltip: &#x27;Context sets the stakes and helps the AI understand the real-world implications.&#x27; }, { id: &#x27;request&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific task should this expert complete?&#x27;, placeholder: &#x27;e.g., Review the portfolio and identify technical issues, strengths, and provide recommendations&#x27;, required: true, tooltip: &#x27;This is the core deliverable you need from your virtual expert.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this under &quot;Issues&quot; and recommend &quot;use a light meter&quot;&#x27;, required: false, defaultValue: &#x27;Professional industry-standard analysis&#x27;, tooltip: &#x27;Examples guide the AI\&#x27;s reasoning process and output style.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What format should the deliverable take?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“Š Table&#x27; }, { value: &#x27;list&#x27;, label: &#x27;๐Ÿ“ Numbered List&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Written Report&#x27; }, { value: &#x27;scorecard&#x27;, label: &#x27;โญ Scorecard&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Structured professional assessment&#x27;, tooltip: &#x27;The output format determines how easy it is to use the AI\&#x27;s advice.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and style should the expert use?&#x27;, options: [ { value: &#x27;professional-constructive&#x27;, label: &#x27;Professional &amp; Constructive&#x27; }, { value: &#x27;direct-actionable&#x27;, label: &#x27;Direct &amp; Actionable&#x27; }, { value: &#x27;encouraging-supportive&#x27;, label: &#x27;Encouraging &amp; Supportive&#x27; }, { value: &#x27;formal-academic&#x27;, label: &#x27;Formal &amp; Academic&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Tone...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and clear&#x27;, tooltip: &#x27;Tone constraints ensure the AI communicates in a way that matches your needs.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 74 lines const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the core message or main idea?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of fieldโ€”it\&#x27;s the most important camera setting to master first&#x27;, required: true, tooltip: &#x27;Your message is the &quot;thesis&quot;โ€”the one key takeaway your audience should remember.&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after consuming this?&#x27;, placeholder: &#x27;e.g., Feel confident and motivated to experiment with aperture settings on their own camera&#x27;, required: false, defaultValue: &#x27;Inform and engage the audience&#x27;, tooltip: &#x27;Intention drives the emotional arc and call-to-action of your content.&#x27; }, { id: &#x27;context-audience&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your audience and where will they see this?&#x27;, placeholder: &#x27;e.g., Beginner photographers aged 25-40, watching on YouTube during their learning journey&#x27;, required: false, defaultValue: &#x27;General audience on standard platforms&#x27;, tooltip: &#x27;Knowing your audience helps the AI match the complexity and references to their level.&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and pacing should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;conversational-friendly&#x27;, label: &#x27;๐Ÿ’ฌ Conversational &amp; Friendly&#x27; }, { value: &#x27;professional-authoritative&#x27;, label: &#x27;๐ŸŽ“ Professional &amp; Authoritative&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐Ÿ“š Calm &amp; Educational&#x27; }, { value: &#x27;witty-entertaining&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Entertaining&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Rhythm...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Engaging and clear&#x27;, tooltip: &#x27;Rhythm defines the &quot;voice&quot; and energy level of your content.&#x27; }, { id: &#x27;output-type&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;youtube-script&#x27;, label: &#x27;๐ŸŽฅ YouTube Script&#x27; }, { value: &#x27;blog-post&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;social-media&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;instagram-carousel&#x27;, label: &#x27;๐Ÿ“ธ Instagram Carousel&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Format...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Each content type has specific structural requirements the AI will follow.&#x27; }, { id: &#x27;length&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;How long should this content be?&#x27;, options: [ { value: &#x27;short&#x27;, label: &#x27;30 seconds - 1 minute&#x27; }, { value: &#x27;medium&#x27;, label: &#x27;3-5 minutes&#x27; }, { value: &#x27;long&#x27;, label: &#x27;10+ minutes&#x27; }, { value: &#x27;word-count&#x27;, label: &#x27;Specific word count...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Appropriate length for the format&#x27;, tooltip: &#x27;Length constraints help the AI pace the content appropriately.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 60 lines const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the marketing situation or campaign?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack called &quot;California Light&quot;&#x27;, required: true, tooltip: &#x27;Context sets the stage for your marketing message.&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the specific product, service, or deal?&#x27;, placeholder: &#x27;e.g., 25% off the preset pack for the first 3 days only&#x27;, required: true, tooltip: &#x27;Your offer is what you\&#x27;re sellingโ€”be crystal clear about value and urgency.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and voice should the copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimal&#x27; }, { value: &#x27;urgent-exciting&#x27;, label: &#x27;๐Ÿ”ฅ Urgent &amp; Exciting&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿ˜Š Friendly &amp; Warm&#x27; }, { value: &#x27;professional-trustworthy&#x27;, label: &#x27;๐Ÿค Professional &amp; Trustworthy&#x27; }, { value: &#x27;bold-confident&#x27;, label: &#x27;๐Ÿ’ช Bold &amp; Confident&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Style...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and persuasive&#x27;, tooltip: &#x27;Style determines how your brand &quot;sounds&quot; to customers.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your ideal customer?&#x27;, placeholder: &#x27;e.g., 25-45 year old lifestyle and wedding photographers who want faster, more beautiful editing&#x27;, required: false, defaultValue: &#x27;Target customers interested in this offering&#x27;, tooltip: &#x27;The more specific your target audience, the more personalized and effective the copy.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ONE action you want them to take?&#x27;, placeholder: &#x27;e.g., Click &quot;Buy Now&quot; before the 3-day discount expires&#x27;, required: true, tooltip: &#x27;A clear, single call-to-action dramatically increases conversion rates.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s your business goal for this campaign?&#x27;, placeholder: &#x27;e.g., Generate 50 sales in the first 3 days and build momentum for future launches&#x27;, required: false, defaultValue: &#x27;Drive conversions and grow revenue&#x27;, tooltip: &#x27;Understanding the business goal helps craft copy that aligns with your strategy.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 65 lines // ICDF Template function assembleICDF(answers) { return `${answers.instruction} **Context:** ${answers.context} **Data to analyze:** ${answers.data} **Required output format:** ${answers.format} Please provide a ${answers.format} that directly addresses the instruction above, using the specified data and keeping the context in mind.`; } // RCREOC Template function assembleRCREOC(answers) { return `You are a ${answers.role}. **Context:** ${answers.context} **Your task:** ${answers.request} **Example of expected thinking:** ${answers.examples} **Required output format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as the assigned role, following the output format and constraints specified.`; } // MICRO Template function assembleMICRO(answers) { return `Create a ${answers.outputType} with the following specifications: **Core Message:** ${answers.message} **Intended audience impact:** ${answers.intention} **Target Audience &amp; Platform:** ${answers.contextAudience} **Tone and Pacing:** ${answers.rhythm} **Length:** ${answers.length} The content should communicate the core message clearly while achieving the intended emotional impact and maintaining the specified tone throughout.`; } // COSTAR Template function assembleCOSTAR(answers) { return `Write marketing copy for the following campaign: **Campaign Context:** ${answers.context} **Offer/Product:** ${answers.offer} **Brand Voice &amp; Style:** ${answers.style} **Target Customer:** ${answers.target} **Desired Action (CTA):** ${answers.action} **Business Goal:** ${answers.result} The copy should speak directly to the target customer, highlight the offer&#x27;s value, maintain the brand voice, and drive the desired action while supporting the overall business goal.`; } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 83 lines // /app/prompt-generator/page.tsx import { FrameworkCard } from &#x27;@/components/prompt-generator/FrameworkCard&#x27;; export default function PromptGeneratorPage() { return ( &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; {/* Hero Section */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds. No expertise required. &lt;/p&gt; &lt;/div&gt; {/* Framework Selection Cards */} &lt;div className=&quot;grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto&quot;&gt; &lt;FrameworkCard icon=&quot;๐Ÿ“Š&quot; color=&quot;#3B82F6&quot; title=&quot;Analyze Data&quot; subtitle=&quot;Get precise analytical insights&quot; framework=&quot;ICDF&quot; examples={[ &quot;Review website analytics&quot;, &quot;Evaluate business metrics&quot;, &quot;Assess survey results&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;๐ŸŽฏ&quot; color=&quot;#8B5CF6&quot; title=&quot;Get Expert Advice&quot; subtitle=&quot;AI becomes your specialist&quot; framework=&quot;RCREOC&quot; examples={[ &quot;Portfolio review&quot;, &quot;Business consultation&quot;, &quot;Technical guidance&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;โœ๏ธ&quot; color=&quot;#10B981&quot; title=&quot;Create Content&quot; subtitle=&quot;Generate engaging content&quot; framework=&quot;MICRO&quot; examples={[ &quot;YouTube scripts&quot;, &quot;Blog posts&quot;, &quot;Social media content&quot; ]} /&gt; &lt;FrameworkCard icon=&quot;๐Ÿš€&quot; color=&quot;#F59E0B&quot; title=&quot;Write Marketing&quot; subtitle=&quot;Craft persuasive copy&quot; framework=&quot;COSTAR&quot; examples={[ &quot;Sales emails&quot;, &quot;Ad campaigns&quot;, &quot;Product descriptions&quot; ]} /&gt; &lt;/div&gt; {/* Not Sure Option */} &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt;Not sure which one you need?&lt;/p&gt; &lt;button className=&quot;btn-secondary&quot;&gt; Describe Your Goal โ†’ &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 52 lines // /components/prompt-generator/FrameworkCard.tsx interface FrameworkCardProps { icon: string; color: string; title: string; subtitle: string; framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; examples: string[]; } export function FrameworkCard({ icon, color, title, subtitle, framework, examples }: FrameworkCardProps) { return ( &lt;div className=&quot;border-2 border-gray-200 rounded-lg p-6 hover:shadow-lg transition-all cursor-pointer group&quot; onClick={() =&gt; window.location.href = `/prompt-generator/${framework.toLowerCase()}`} &gt; {/* Icon */} &lt;div className=&quot;text-5xl mb-4 transition-transform group-hover:scale-110&quot; style={{ filter: `drop-shadow(0 0 8px ${color}40)` }} &gt; {icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-xl font-bold mb-2&quot;&gt;{title}&lt;/h3&gt; &lt;p className=&quot;text-gray-600 text-sm mb-4&quot;&gt;{subtitle}&lt;/p&gt; {/* Examples */} &lt;div className=&quot;space-y-2&quot;&gt; &lt;p className=&quot;text-xs font-semibold text-gray-500 uppercase&quot;&gt;Examples:&lt;/p&gt; {examples.map((example, idx) =&gt; ( &lt;div key={idx} className=&quot;text-sm text-gray-700 flex items-start&quot;&gt; &lt;span className=&quot;mr-2&quot;&gt;โ€ข&lt;/span&gt; &lt;span&gt;{example}&lt;/span&gt; &lt;/div&gt; ))} &lt;/div&gt; {/* CTA */} &lt;div className=&quot;mt-6 text-center py-2 rounded font-semibold text-white transition-colors&quot; style={{ backgroundColor: color }} &gt; Start โ†’ &lt;/div&gt; &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 173 lines // /components/prompt-generator/QuestionFlow.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Tooltip } from &#x27;@/components/ui/Tooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean }&gt;; required: boolean; defaultValue: string; tooltip: string; } interface QuestionFlowProps { questions: Question[]; framework: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export function QuestionFlow({ questions, framework, onComplete }: QuestionFlowProps) { const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [customInputs, setCustomInputs] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleNext = () =&gt; { // Apply smart default if skipped if (!answers[currentQuestion.id]) { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentStep &lt; questions.length - 1) { setCurrentStep(prev =&gt; prev + 1); } else { // Final step - assemble prompt onComplete(answers); } }; const handlePrevious = () =&gt; { if (currentStep &gt; 0) { setCurrentStep(prev =&gt; prev - 1); } }; return ( &lt;div className=&quot;max-w-3xl mx-auto&quot;&gt; {/* Progress Bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 mb-2&quot;&gt; &lt;span&gt;Question {currentStep + 1} of {questions.length}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full bg-gray-200 rounded-full h-2&quot;&gt; &lt;div className=&quot;bg-blue-600 h-2 rounded-full transition-all duration-300&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Question Card */} &lt;div className=&quot;bg-white border-2 border-gray-200 rounded-lg p-8&quot;&gt; {/* Question Label with Tooltip */} &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;label className=&quot;text-lg font-semibold text-gray-900&quot;&gt; {currentQuestion.label} {currentQuestion.required &amp;&amp; &lt;span className=&quot;text-red-500 ml-1&quot;&gt;*&lt;/span&gt;} &lt;/label&gt; &lt;Tooltip content={currentQuestion.tooltip}&gt; &lt;button className=&quot;text-gray-400 hover:text-gray-600&quot;&gt; &lt;svg className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 20 20&quot;&gt; &lt;path fillRule=&quot;evenodd&quot; d=&quot;M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z&quot; clipRule=&quot;evenodd&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; &lt;/Tooltip&gt; &lt;/div&gt; {/* Input Field */} {currentQuestion.type === &#x27;textarea&#x27; ? ( &lt;textarea className=&quot;w-full border-2 border-gray-300 rounded-lg p-4 focus:border-blue-500 focus:outline-none resize-none&quot; rows={4} placeholder={currentQuestion.placeholder} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(e) =&gt; setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value }))} /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {currentQuestion.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button className={`w-full text-left p-4 border-2 rounded-lg transition-all ${ answers[currentQuestion.id] === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-300 hover:border-gray-400&#x27; }`} onClick={() =&gt; { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: option.value })); }} &gt; {option.label} &lt;/button&gt; {/* Custom text field for &quot;Other&quot; options */} {option.hasTextField &amp;&amp; answers[currentQuestion.id] === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; className=&quot;w-full mt-2 border-2 border-gray-300 rounded-lg p-3 focus:border-blue-500 focus:outline-none&quot; placeholder=&quot;Specify...&quot; value={customInputs[currentQuestion.id] || &#x27;&#x27;} onChange={(e) =&gt; { setCustomInputs(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value })); setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: e.target.value })); }} /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Skip Notice */} {!currentQuestion.required &amp;&amp; !answers[currentQuestion.id] &amp;&amp; ( &lt;p className=&quot;mt-3 text-sm text-gray-500 italic&quot;&gt; ๐Ÿ’ก You can skip this. We&#x27;ll use: &quot;{currentQuestion.defaultValue}&quot; &lt;/p&gt; )} &lt;/div&gt; {/* Navigation Buttons */} &lt;div className=&quot;flex justify-between mt-6&quot;&gt; &lt;button onClick={handlePrevious} disabled={currentStep === 0} className=&quot;px-6 py-3 border-2 border-gray-300 rounded-lg font-semibold disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50&quot; &gt; โ† Previous &lt;/button&gt; &lt;button onClick={handleNext} className=&quot;px-6 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700&quot; &gt; {currentStep === questions.length - 1 ? &#x27;Generate Prompt โœจ&#x27; : &#x27;Next โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } This code can be executed in the preview sandbox Run Code Used 94 credits continue Used 0 credits javascript tooltip: &#x27;This is the core task. Be specific about what deliverables you expect from the expert.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output style you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this under &quot;Issues&quot; and recommend &quot;use a light meter&quot;&#x27;, required: false, defaultValue: &#x27;Professional industry-standard analysis&#x27;, tooltip: &#x27;Examples guide the AI\&#x27;s reasoning process and output style. Even one example dramatically improves results.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What format should the expert deliver?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“‹ Table/Spreadsheet&#x27; }, { value: &#x27;numbered-list&#x27;, label: &#x27;๐Ÿ”ข Numbered List&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Formal Report&#x27; }, { value: &#x27;action-plan&#x27;, label: &#x27;โœ… Action Plan&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, professional summary&#x27;, tooltip: &#x27;Defining the deliverable format ensures you get organized, actionable results.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What constraints or rules should apply?&#x27;, options: [ { value: &#x27;concise&#x27;, label: &#x27;Keep it concise (under 3 sentences per point)&#x27; }, { value: &#x27;detailed&#x27;, label: &#x27;Provide detailed explanations&#x27; }, { value: &#x27;formal&#x27;, label: &#x27;Use formal, professional tone&#x27; }, { value: &#x27;actionable&#x27;, label: &#x27;Focus on actionable recommendations only&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom constraints...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional, constructive, and actionable&#x27;, tooltip: &#x27;Constraints ensure the expert stays focused and delivers exactly what you need.&#x27; } ]; MICRO Framework Questions javascript const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the core message or main idea?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of field in a simple, practical way&#x27;, required: true, tooltip: &#x27;Your message is the thesisโ€”the one key takeaway you want your audience to remember.&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after reading/watching?&#x27;, placeholder: &#x27;e.g., Feel confident that aperture is the most important camera setting to learn first&#x27;, required: true, tooltip: &#x27;Intention drives the emotional tone and call-to-action. Be specific about the desired outcome.&#x27; }, { id: &#x27;audience&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Who is your target audience?&#x27;, options: [ { value: &#x27;beginners&#x27;, label: &#x27;๐ŸŒฑ Complete Beginners&#x27; }, { value: &#x27;intermediate&#x27;, label: &#x27;๐Ÿ“š Intermediate Learners&#x27; }, { value: &#x27;professionals&#x27;, label: &#x27;โญ Professionals&#x27; }, { value: &#x27;general&#x27;, label: &#x27;๐Ÿ‘ฅ General Public&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Specific Audience...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;General audience interested in the topic&#x27;, tooltip: &#x27;Knowing your audience shapes vocabulary, tone, and complexity level.&#x27; }, { id: &#x27;platform&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Where will this content be published?&#x27;, options: [ { value: &#x27;youtube&#x27;, label: &#x27;๐Ÿ“บ YouTube&#x27; }, { value: &#x27;blog&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;instagram&#x27;, label: &#x27;๐Ÿ“ธ Instagram&#x27; }, { value: &#x27;twitter&#x27;, label: &#x27;๐Ÿฆ Twitter/X&#x27; }, { value: &#x27;linkedin&#x27;, label: &#x27;๐Ÿ’ผ LinkedIn&#x27; }, { value: &#x27;email&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Platform...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;General web content&#x27;, tooltip: &#x27;Platform dictates format constraints (character limits, visual elements, pacing).&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and pacing should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐ŸŽ“ Calm &amp; Educational&#x27; }, { value: &#x27;witty-entertaining&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Entertaining&#x27; }, { value: &#x27;professional-formal&#x27;, label: &#x27;๐Ÿ‘” Professional &amp; Formal&#x27; }, { value: &#x27;conversational&#x27;, label: &#x27;๐Ÿ’ฌ Conversational &amp; Friendly&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Tone...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, engaging, and accessible&#x27;, tooltip: &#x27;Rhythm and tone shape how your message is delivered and received.&#x27; }, { id: &#x27;output-type&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;video-script&#x27;, label: &#x27;๐ŸŽฌ Video Script&#x27; }, { value: &#x27;blog-article&#x27;, label: &#x27;๐Ÿ“„ Blog Article&#x27; }, { value: &#x27;social-post&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;โœ‰๏ธ Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Written content piece&#x27;, tooltip: &#x27;Content type determines structure, length, and formatting requirements.&#x27; } ]; COSTAR Framework Questions javascript const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the marketing situation or campaign?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack for wedding photographers&#x27;, required: true, tooltip: &#x27;Context sets the stageโ€”what\&#x27;s happening that requires this marketing message?&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the specific offer or product?&#x27;, placeholder: &#x27;e.g., &quot;California Light&quot; preset pack with 25% early-bird discount&#x27;, required: true, tooltip: &#x27;Be crystal clear about what you\&#x27;re selling and any special deals or incentives.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and style should the copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimalist&#x27; }, { value: &#x27;urgent-bold&#x27;, label: &#x27;๐Ÿ”ฅ Urgent &amp; Bold&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿค— Friendly &amp; Warm&#x27; }, { value: &#x27;professional-corporate&#x27;, label: &#x27;๐Ÿ’ผ Professional &amp; Corporate&#x27; }, { value: &#x27;playful-creative&#x27;, label: &#x27;๐ŸŽจ Playful &amp; Creative&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Style...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and persuasive&#x27;, tooltip: &#x27;Style must align with your brand voice and resonate with your target audience.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your target customer? (demographics, psychographics)&#x27;, placeholder: &#x27;e.g., 25-45 year old wedding and lifestyle photographers who want faster editing workflows&#x27;, required: true, tooltip: &#x27;The more specific your target audience, the more personalized and effective your copy will be.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What\&#x27;s the primary call-to-action?&#x27;, options: [ { value: &#x27;buy-now&#x27;, label: &#x27;๐Ÿ›’ Buy Now&#x27; }, { value: &#x27;sign-up&#x27;, label: &#x27;โœ๏ธ Sign Up / Subscribe&#x27; }, { value: &#x27;download&#x27;, label: &#x27;โฌ‡๏ธ Download&#x27; }, { value: &#x27;learn-more&#x27;, label: &#x27;๐Ÿ“– Learn More&#x27; }, { value: &#x27;book-call&#x27;, label: &#x27;๐Ÿ“ž Book a Call&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom CTA...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Every marketing message needs one clear action you want the reader to take.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ultimate business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build email list of potential customers&#x27;, required: false, defaultValue: &#x27;Increase conversions and revenue&#x27;, tooltip: &#x27;Knowing the business goal helps craft copy that\&#x27;s strategically aligned with your objectives.&#x27; } ]; 5. Prompt Assembly Logic Template Structure Each framework has a template that combines user answers into a professional prompt: javascript const promptTemplates = { ICDF: (answers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that addresses the instruction above, taking into account the context and working with the specified data. `.trim(), RCREOC: (answers) =&gt; ` **Your Role:** You are a ${answers.role}. **Context:** ${answers.context} **Your Task:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Required Output Format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as a ${answers.role} would, following the example thinking pattern and adhering to all constraints. `.trim(), MICRO: (answers) =&gt; ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Medium:** ${answers.platform} **Tone &amp; Pacing:** ${answers.rhythm} **Content Type:** Create a ${answers[&#x27;output-type&#x27;]} Please write content that delivers the core message with the specified intention, tailored for the target audience, optimized for the platform, and matching the desired tone and pacing. `.trim(), COSTAR: (answers) =&gt; ` **Marketing Context:** ${answers.context} **The Offer:** ${answers.offer} **Brand Voice &amp; Style:** ${answers.style} **Target Customer:** ${answers.target} **Call-to-Action:** ${answers.action} **Business Goal:** ${answers.result} Please write persuasive marketing copy that presents the offer to the target customer in the specified style, with a clear call-to-action that drives toward the business goal. `.trim() }; 6. Page Structure &amp; Components 6.1 Landing Page (/prompt-generator) Components Needed: typescript // app/prompt-generator/page.tsx import QuickStartWizard from &#x27;@/components/prompt-generator/QuickStartWizard&#x27;; import HeroSection from &#x27;@/components/prompt-generator/HeroSection&#x27;; export default function PromptGeneratorPage() { return ( &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; &lt;HeroSection /&gt; &lt;QuickStartWizard /&gt; &lt;/div&gt; ); } HeroSection Component: typescript // components/prompt-generator/HeroSection.tsx export default function HeroSection() { return ( &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 dark:text-gray-400 mb-2&quot;&gt; Transform your simple AI ideas into professional prompts &lt;/p&gt; &lt;p className=&quot;text-gray-500 dark:text-gray-500&quot;&gt; Using proven frameworks: ICDF, RCREOC, MICRO, and COSTAR &lt;/p&gt; &lt;/div&gt; ); } QuickStartWizard Component: typescript // components/prompt-generator/QuickStartWizard.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { useRouter } from &#x27;next/navigation&#x27;; const frameworks = [ { id: &#x27;ICDF&#x27;, icon: &#x27;๐Ÿ“Š&#x27;, color: &#x27;bg-blue-500&#x27;, title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise analytical insights&#x27;, description: &#x27;Perfect for reviewing data, reports, metrics, or analytics&#x27; }, { id: &#x27;RCREOC&#x27;, icon: &#x27;๐ŸŽฏ&#x27;, color: &#x27;bg-purple-500&#x27;, title: &#x27;Get Expert Advice&#x27;, subtitle: &#x27;AI becomes your specialist consultant&#x27;, description: &#x27;Get professional opinions, recommendations, or expert reviews&#x27; }, { id: &#x27;MICRO&#x27;, icon: &#x27;โœ๏ธ&#x27;, color: &#x27;bg-green-500&#x27;, title: &#x27;Create Content&#x27;, subtitle: &#x27;Generate engaging written content&#x27;, description: &#x27;Write blog posts, scripts, articles, or social media content&#x27; }, { id: &#x27;COSTAR&#x27;, icon: &#x27;๐Ÿš€&#x27;, color: &#x27;bg-orange-500&#x27;, title: &#x27;Write Marketing Copy&#x27;, subtitle: &#x27;Craft persuasive sales messages&#x27;, description: &#x27;Create ads, emails, sales pages, or promotional content&#x27; } ]; export default function QuickStartWizard() { const router = useRouter(); const handleFrameworkSelect = (frameworkId: string) =&gt; { router.push(`/prompt-generator/build?framework=${frameworkId}`); }; return ( &lt;div className=&quot;max-w-5xl mx-auto&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold text-center mb-8&quot;&gt; What do you want to do? &lt;/h2&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt; {frameworks.map((framework) =&gt; ( &lt;button key={framework.id} onClick={() =&gt; handleFrameworkSelect(framework.id)} className=&quot;group p-6 border-2 border-gray-200 dark:border-gray-700 rounded-xl hover:border-gray-400 dark:hover:border-gray-500 transition-all text-left hover:shadow-lg&quot; &gt; &lt;div className=&quot;flex items-start gap-4&quot;&gt; &lt;div className={`text-4xl ${framework.color} bg-opacity-10 p-3 rounded-lg`}&gt; {framework.icon} &lt;/div&gt; &lt;div className=&quot;flex-1&quot;&gt; &lt;h3 className=&quot;text-xl font-semibold mb-1&quot;&gt; {framework.title} &lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 dark:text-gray-400 mb-2&quot;&gt; {framework.subtitle} &lt;/p&gt; &lt;p className=&quot;text-sm text-gray-500 dark:text-gray-500&quot;&gt; {framework.description} &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300&quot;&gt; โ†’ &lt;/div&gt; &lt;/div&gt; &lt;/button&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;p className=&quot;text-gray-500 dark:text-gray-500 mb-4&quot;&gt; Not sure which to choose? &lt;/p&gt; &lt;button onClick={() =&gt; router.push(&#x27;/prompt-generator/build&#x27;)} className=&quot;text-blue-600 dark:text-blue-400 hover:underline&quot; &gt; Describe your goal and we&#x27;ll suggest the best framework โ†’ &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } 6.2 Build Page (/prompt-generator/build) This is where the magic happensโ€”the adaptive questionnaire. typescript // app/prompt-generator/build/page.tsx &#x27;use client&#x27;; import { useState, useEffect } from &#x27;react&#x27;; import { useSearchParams } from &#x27;next/navigation&#x27;; import PromptBuilder from &#x27;@/components/prompt-generator/PromptBuilder&#x27;; import FrameworkDetector from &#x27;@/components/prompt-generator/FrameworkDetector&#x27;; export default function BuildPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams.get(&#x27;framework&#x27;); const [framework, setFramework] = useState&lt;string | null&gt;(preselectedFramework); const [initialPrompt, setInitialPrompt] = useState(&#x27;&#x27;); if (!framework) { return ( &lt;FrameworkDetector onFrameworkDetected={(fw, prompt) =&gt; { setFramework(fw); setInitialPrompt(prompt); }} /&gt; ); } return ( &lt;PromptBuilder framework={framework} initialPrompt={initialPrompt} /&gt; ); } FrameworkDetector Component: typescript // components/prompt-generator/FrameworkDetector.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/framework-detection&#x27;; interface Props { onFrameworkDetected: (framework: string, prompt: string) =&gt; void; } export default function FrameworkDetector({ onFrameworkDetected }: Props) { const [userInput, setUserInput] = useState(&#x27;&#x27;); const handleSubmit = (e: React.FormEvent) =&gt; { e.preventDefault(); const detected = detectFramework(userInput); onFrameworkDetected(detected, userInput); }; return ( &lt;div className=&quot;container mx-auto px-4 py-12 max-w-3xl&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;h1 className=&quot;text-3xl font-bold mb-4&quot;&gt; Describe what you need &lt;/h1&gt; &lt;p className=&quot;text-gray-600 dark:text-gray-400&quot;&gt; Tell us in your own words, and we&#x27;ll guide you to create the perfect prompt &lt;/p&gt; &lt;/div&gt; &lt;form onSubmit={handleSubmit} className=&quot;space-y-4&quot;&gt; &lt;textarea value={userInput} onChange={(e) =&gt; setUserInput(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are most popular...&quot; className=&quot;w-full h-40 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none&quot; autoFocus /&gt; &lt;button type=&quot;submit&quot; disabled={!userInput.trim()} className=&quot;w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors&quot; &gt; Continue โ†’ &lt;/button&gt; &lt;/form&gt; &lt;div className=&quot;mt-8 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg&quot;&gt; &lt;p className=&quot;text-sm text-blue-800 dark:text-blue-200&quot;&gt; &lt;strong&gt;๐Ÿ’ก Tip:&lt;/strong&gt; Just describe your goal naturally. We&#x27;ll automatically detect whether you need to analyze data, get expert advice, create content, or write marketing copy. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } PromptBuilder Component (Main Interactive Form): typescript // components/prompt-generator/PromptBuilder.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { useRouter } from &#x27;next/navigation&#x27;; import { getQuestionSet } from &#x27;@/lib/prompt-generator/questions&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import ProgressBar from &#x27;./ProgressBar&#x27;; interface Props { framework: string; initialPrompt?: string; } export default function PromptBuilder({ framework, initialPrompt }: Props) { const router = useRouter(); const questions = getQuestionSet(framework); const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: value })); }; const handleNext = () =&gt; { if (currentStep &lt; questions.length - 1) { setCurrentStep(prev =&gt; prev + 1); } else { // All questions answered - go to results const queryParams = new URLSearchParams({ framework, original: initialPrompt || &#x27;&#x27;, ...answers }); router.push(`/prompt-generator/result?${queryParams.toString()}`); } }; const handleBack = () =&gt; { if (currentStep &gt; 0) { setCurrentStep(prev =&gt; prev - 1); } }; const canProceed = currentQuestion.required ? !!answers[currentQuestion.id] : true; return ( &lt;div className=&quot;container mx-auto px-4 py-12 max-w-3xl&quot;&gt; &lt;ProgressBar progress={progress} currentStep={currentStep + 1} totalSteps={questions.length} /&gt; &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;inline-block px-3 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 rounded-full text-sm font-medium mb-4&quot;&gt; {framework} Framework &lt;/div&gt; &lt;/div&gt; &lt;QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(value) =&gt; handleAnswer(currentQuestion.id, value)} /&gt; &lt;div className=&quot;flex gap-4 mt-8&quot;&gt; {currentStep &gt; 0 &amp;&amp; ( &lt;button onClick={handleBack} className=&quot;px-6 py-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg font-semibold hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors&quot; &gt; โ† Back &lt;/button&gt; )} &lt;button onClick={handleNext} disabled={!canProceed} className=&quot;flex-1 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors&quot; &gt; {currentStep &lt; questions.length - 1 ? &#x27;Next โ†’&#x27; : &#x27;Generate Prompt โœจ&#x27;} &lt;/button&gt; &lt;/div&gt; {!currentQuestion.required &amp;&amp; !answers[currentQuestion.id] &amp;&amp; ( &lt;p className=&quot;text-sm text-gray-500 dark:text-gray-400 mt-4 text-center&quot;&gt; This question is optional. We&#x27;ll use a smart default if you skip it. &lt;/p&gt; )} &lt;/div&gt; ); } QuestionCard Component: typescript // components/prompt-generator/QuestionCard.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import type { Question } from &#x27;@/lib/prompt-generator/types&#x27;; interface Props { question: Question; value: string; onChange: (value: string) =&gt; void; } export default function QuestionCard({ question, value, onChange }: Props) { const [showTooltip, setShowTooltip] = useState(false); return ( &lt;div className=&quot;bg-white dark:bg-gray-800 p-6 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700&quot;&gt; &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold flex-1&quot;&gt; {question.label} {question.required &amp;&amp; &lt;span className=&quot;text-red-500 ml-1&quot;&gt;*&lt;/span&gt;} &lt;/h2&gt; &lt;button onMouseEnter={() =&gt; setShowTooltip(true)} onMouseLeave={() =&gt; setShowTooltip(false)} className=&quot;text-blue-500 hover:text-blue-600 ml-2&quot; aria-label=&quot;Help&quot; &gt; &lt;svg className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 20 20&quot;&gt; &lt;path fillRule=&quot;evenodd&quot; d=&quot;M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z&quot; clipRule=&quot;evenodd&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; &lt;/div&gt; {showTooltip &amp;&amp; ( &lt;div className=&quot;mb-4 p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg text-sm text-blue-800 dark:text-blue-200&quot;&gt; ๐Ÿ’ก {question.tooltip} &lt;/div&gt; )} {question.type === &#x27;textarea&#x27; &amp;&amp; ( &lt;textarea value={value} onChange={(e) =&gt; onChange(e.target.value)} placeholder={question.placeholder} className=&quot;w-full h-32 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none&quot; /&gt; )} {question.type === &#x27;multiple-choice&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-2&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; onChange(option.value)} className={`w-full p-4 text-left rounded-lg border-2 transition-all ${ value === option.value ? &#x27;border-blue-500 bg-blue-50 dark:bg-blue-900/20&#x27; : &#x27;border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600&#x27; }`} &gt; &lt;div className=&quot;flex items-center gap-3&quot;&gt; &lt;div className={`w-5 h-5 rounded-full border-2 flex items-center justify-center ${ value === option.value ? &#x27;border-blue-500 bg-blue-500&#x27; : &#x27;border-gray-300 dark:border-gray-600&#x27; }`}&gt; {value === option.value &amp;&amp; ( &lt;div className=&quot;w-2 h-2 bg-white rounded-full&quot; /&gt; )} &lt;/div&gt; &lt;span className=&quot;font-medium&quot;&gt;{option.label}&lt;/span&gt; &lt;/div&gt; &lt;/button&gt; {option.hasTextField &amp;&amp; value === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; placeholder=&quot;Specify...&quot; className=&quot;w-full mt-2 p-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 outline-none&quot; onChange={(e) =&gt; onChange(`custom:${e.target.value}`)} /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} &lt;/div&gt; ); } ProgressBar Component: typescript // components/prompt-generator/ProgressBar.tsx interface Props { progress: number; currentStep: number; totalSteps: number; } export default function ProgressBar({ progress, currentStep, totalSteps }: Props) { return ( &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-2&quot;&gt; &lt;span&gt;Step {currentStep} of {totalSteps}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-blue-600 transition-all duration-300 ease-out&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; ); } 6.3 Result Page (/prompt-generator/result) Before/After Comparison with Copy &amp; Learning Mode typescript // app/prompt-generator/result/page.tsx &#x27;use client&#x27;; import { useSearchParams } from &#x27;next/navigation&#x27;; import { useState } from &#x27;react&#x27;; import { assemblePrompt } from &#x27;@/lib/prompt-generator/prompt-assembly&#x27;; import { trackPromptGeneration } from &#x27;@/lib/analytics&#x27;; export default function ResultPage() { const searchParams = useSearchParams(); const framework = searchParams.get(&#x27;framework&#x27;) || &#x27;&#x27;; const originalPrompt = searchParams.get(&#x27;original&#x27;) || &#x27;&#x27;; // Extract all answers from query params const answers: Record&lt;string, string&gt; = {}; searchParams.forEach((value, key) =&gt; { if (key !== &#x27;framework&#x27; &amp;&amp; key !== &#x27;original&#x27;) { answers[key] = value; } }); const professionalPrompt = assemblePrompt(framework, answers); const [copied, setCopied] = useState(false); const [showLearning, setShowLearning] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(professionalPrompt); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); // Track analytics trackPromptGeneration(framework); }; return ( &lt;div className=&quot;container mx-auto px-4 py-12 max-w-6xl&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;div className=&quot;inline-block px-4 py-2 bg-green-100 dark:bg-green-900/30 JavaScript JavaScriptโ€ข 42 lines tooltip: &#x27;This is the core task. Be specific about what deliverables you expect from the expert.&#x27; }, { id: &#x27;examples&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Provide an example of the thinking or output style you want&#x27;, placeholder: &#x27;e.g., If you see underexposed images, note this under &quot;Issues&quot; and recommend &quot;use a light meter&quot;&#x27;, required: false, defaultValue: &#x27;Professional industry-standard analysis&#x27;, tooltip: &#x27;Examples guide the AI\&#x27;s reasoning process and output style. Even one example dramatically improves results.&#x27; }, { id: &#x27;output&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What format should the expert deliver?&#x27;, options: [ { value: &#x27;table&#x27;, label: &#x27;๐Ÿ“‹ Table/Spreadsheet&#x27; }, { value: &#x27;numbered-list&#x27;, label: &#x27;๐Ÿ”ข Numbered List&#x27; }, { value: &#x27;report&#x27;, label: &#x27;๐Ÿ“„ Formal Report&#x27; }, { value: &#x27;action-plan&#x27;, label: &#x27;โœ… Action Plan&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, professional summary&#x27;, tooltip: &#x27;Defining the deliverable format ensures you get organized, actionable results.&#x27; }, { id: &#x27;constraints&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What constraints or rules should apply?&#x27;, options: [ { value: &#x27;concise&#x27;, label: &#x27;Keep it concise (under 3 sentences per point)&#x27; }, { value: &#x27;detailed&#x27;, label: &#x27;Provide detailed explanations&#x27; }, { value: &#x27;formal&#x27;, label: &#x27;Use formal, professional tone&#x27; }, { value: &#x27;actionable&#x27;, label: &#x27;Focus on actionable recommendations only&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom constraints...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional, constructive, and actionable&#x27;, tooltip: &#x27;Constraints ensure the expert stays focused and delivers exactly what you need.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 82 lines const microQuestions = [ { id: &#x27;message&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the core message or main idea?&#x27;, placeholder: &#x27;e.g., Aperture controls both light and depth of field in a simple, practical way&#x27;, required: true, tooltip: &#x27;Your message is the thesisโ€”the one key takeaway you want your audience to remember.&#x27; }, { id: &#x27;intention&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What should the audience feel or do after reading/watching?&#x27;, placeholder: &#x27;e.g., Feel confident that aperture is the most important camera setting to learn first&#x27;, required: true, tooltip: &#x27;Intention drives the emotional tone and call-to-action. Be specific about the desired outcome.&#x27; }, { id: &#x27;audience&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Who is your target audience?&#x27;, options: [ { value: &#x27;beginners&#x27;, label: &#x27;๐ŸŒฑ Complete Beginners&#x27; }, { value: &#x27;intermediate&#x27;, label: &#x27;๐Ÿ“š Intermediate Learners&#x27; }, { value: &#x27;professionals&#x27;, label: &#x27;โญ Professionals&#x27; }, { value: &#x27;general&#x27;, label: &#x27;๐Ÿ‘ฅ General Public&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Specific Audience...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;General audience interested in the topic&#x27;, tooltip: &#x27;Knowing your audience shapes vocabulary, tone, and complexity level.&#x27; }, { id: &#x27;platform&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Where will this content be published?&#x27;, options: [ { value: &#x27;youtube&#x27;, label: &#x27;๐Ÿ“บ YouTube&#x27; }, { value: &#x27;blog&#x27;, label: &#x27;๐Ÿ“ Blog Post&#x27; }, { value: &#x27;instagram&#x27;, label: &#x27;๐Ÿ“ธ Instagram&#x27; }, { value: &#x27;twitter&#x27;, label: &#x27;๐Ÿฆ Twitter/X&#x27; }, { value: &#x27;linkedin&#x27;, label: &#x27;๐Ÿ’ผ LinkedIn&#x27; }, { value: &#x27;email&#x27;, label: &#x27;๐Ÿ“ง Email Newsletter&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Platform...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;General web content&#x27;, tooltip: &#x27;Platform dictates format constraints (character limits, visual elements, pacing).&#x27; }, { id: &#x27;rhythm&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and pacing should the content have?&#x27;, options: [ { value: &#x27;fast-exciting&#x27;, label: &#x27;โšก Fast-paced &amp; Exciting&#x27; }, { value: &#x27;calm-educational&#x27;, label: &#x27;๐ŸŽ“ Calm &amp; Educational&#x27; }, { value: &#x27;witty-entertaining&#x27;, label: &#x27;๐Ÿ˜„ Witty &amp; Entertaining&#x27; }, { value: &#x27;professional-formal&#x27;, label: &#x27;๐Ÿ‘” Professional &amp; Formal&#x27; }, { value: &#x27;conversational&#x27;, label: &#x27;๐Ÿ’ฌ Conversational &amp; Friendly&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Tone...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Clear, engaging, and accessible&#x27;, tooltip: &#x27;Rhythm and tone shape how your message is delivered and received.&#x27; }, { id: &#x27;output-type&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What type of content are you creating?&#x27;, options: [ { value: &#x27;video-script&#x27;, label: &#x27;๐ŸŽฌ Video Script&#x27; }, { value: &#x27;blog-article&#x27;, label: &#x27;๐Ÿ“„ Blog Article&#x27; }, { value: &#x27;social-post&#x27;, label: &#x27;๐Ÿ“ฑ Social Media Post&#x27; }, { value: &#x27;email-newsletter&#x27;, label: &#x27;โœ‰๏ธ Email Newsletter&#x27; }, { value: &#x27;podcast-script&#x27;, label: &#x27;๐ŸŽ™๏ธ Podcast Script&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Other Format...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Written content piece&#x27;, tooltip: &#x27;Content type determines structure, length, and formatting requirements.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 66 lines const costarQuestions = [ { id: &#x27;context&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the marketing situation or campaign?&#x27;, placeholder: &#x27;e.g., Launching a new Lightroom preset pack for wedding photographers&#x27;, required: true, tooltip: &#x27;Context sets the stageโ€”what\&#x27;s happening that requires this marketing message?&#x27; }, { id: &#x27;offer&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the specific offer or product?&#x27;, placeholder: &#x27;e.g., &quot;California Light&quot; preset pack with 25% early-bird discount&#x27;, required: true, tooltip: &#x27;Be crystal clear about what you\&#x27;re selling and any special deals or incentives.&#x27; }, { id: &#x27;style&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What tone and style should the copy have?&#x27;, options: [ { value: &#x27;elegant-minimal&#x27;, label: &#x27;โœจ Elegant &amp; Minimalist&#x27; }, { value: &#x27;urgent-bold&#x27;, label: &#x27;๐Ÿ”ฅ Urgent &amp; Bold&#x27; }, { value: &#x27;friendly-warm&#x27;, label: &#x27;๐Ÿค— Friendly &amp; Warm&#x27; }, { value: &#x27;professional-corporate&#x27;, label: &#x27;๐Ÿ’ผ Professional &amp; Corporate&#x27; }, { value: &#x27;playful-creative&#x27;, label: &#x27;๐ŸŽจ Playful &amp; Creative&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Style...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Professional and persuasive&#x27;, tooltip: &#x27;Style must align with your brand voice and resonate with your target audience.&#x27; }, { id: &#x27;target&#x27;, type: &#x27;textarea&#x27;, label: &#x27;Who is your target customer? (demographics, psychographics)&#x27;, placeholder: &#x27;e.g., 25-45 year old wedding and lifestyle photographers who want faster editing workflows&#x27;, required: true, tooltip: &#x27;The more specific your target audience, the more personalized and effective your copy will be.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;What\&#x27;s the primary call-to-action?&#x27;, options: [ { value: &#x27;buy-now&#x27;, label: &#x27;๐Ÿ›’ Buy Now&#x27; }, { value: &#x27;sign-up&#x27;, label: &#x27;โœ๏ธ Sign Up / Subscribe&#x27; }, { value: &#x27;download&#x27;, label: &#x27;โฌ‡๏ธ Download&#x27; }, { value: &#x27;learn-more&#x27;, label: &#x27;๐Ÿ“– Learn More&#x27; }, { value: &#x27;book-call&#x27;, label: &#x27;๐Ÿ“ž Book a Call&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom CTA...&#x27;, hasTextField: true } ], required: true, tooltip: &#x27;Every marketing message needs one clear action you want the reader to take.&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ultimate business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build email list of potential customers&#x27;, required: false, defaultValue: &#x27;Increase conversions and revenue&#x27;, tooltip: &#x27;Knowing the business goal helps craft copy that\&#x27;s strategically aligned with your objectives.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 61 lines const promptTemplates = { ICDF: (answers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that addresses the instruction above, taking into account the context and working with the specified data. `.trim(), RCREOC: (answers) =&gt; ` **Your Role:** You are a ${answers.role}. **Context:** ${answers.context} **Your Task:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Required Output Format:** ${answers.output} **Constraints:** ${answers.constraints} Please complete this task as a ${answers.role} would, following the example thinking pattern and adhering to all constraints. `.trim(), MICRO: (answers) =&gt; ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Medium:** ${answers.platform} **Tone &amp; Pacing:** ${answers.rhythm} **Content Type:** Create a ${answers[&#x27;output-type&#x27;]} Please write content that delivers the core message with the specified intention, tailored for the target audience, optimized for the platform, and matching the desired tone and pacing. `.trim(), COSTAR: (answers) =&gt; ` **Marketing Context:** ${answers.context} **The Offer:** ${answers.offer} **Brand Voice &amp; Style:** ${answers.style} **Target Customer:** ${answers.target} **Call-to-Action:** ${answers.action} **Business Goal:** ${answers.result} Please write persuasive marketing copy that presents the offer to the target customer in the specified style, with a clear call-to-action that drives toward the business goal. `.trim() }; This code can be executed in the preview sandbox Run Code TypeScript TypeScriptโ€ข 13 lines // app/prompt-generator/page.tsx import QuickStartWizard from &#x27;@/components/prompt-generator/QuickStartWizard&#x27;; import HeroSection from &#x27;@/components/prompt-generator/HeroSection&#x27;; export default function PromptGeneratorPage() { return ( &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; &lt;HeroSection /&gt; &lt;QuickStartWizard /&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 17 lines // components/prompt-generator/HeroSection.tsx export default function HeroSection() { return ( &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 dark:text-gray-400 mb-2&quot;&gt; Transform your simple AI ideas into professional prompts &lt;/p&gt; &lt;p className=&quot;text-gray-500 dark:text-gray-500&quot;&gt; Using proven frameworks: ICDF, RCREOC, MICRO, and COSTAR &lt;/p&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 99 lines // components/prompt-generator/QuickStartWizard.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { useRouter } from &#x27;next/navigation&#x27;; const frameworks = [ { id: &#x27;ICDF&#x27;, icon: &#x27;๐Ÿ“Š&#x27;, color: &#x27;bg-blue-500&#x27;, title: &#x27;Analyze Data&#x27;, subtitle: &#x27;Get precise analytical insights&#x27;, description: &#x27;Perfect for reviewing data, reports, metrics, or analytics&#x27; }, { id: &#x27;RCREOC&#x27;, icon: &#x27;๐ŸŽฏ&#x27;, color: &#x27;bg-purple-500&#x27;, title: &#x27;Get Expert Advice&#x27;, subtitle: &#x27;AI becomes your specialist consultant&#x27;, description: &#x27;Get professional opinions, recommendations, or expert reviews&#x27; }, { id: &#x27;MICRO&#x27;, icon: &#x27;โœ๏ธ&#x27;, color: &#x27;bg-green-500&#x27;, title: &#x27;Create Content&#x27;, subtitle: &#x27;Generate engaging written content&#x27;, description: &#x27;Write blog posts, scripts, articles, or social media content&#x27; }, { id: &#x27;COSTAR&#x27;, icon: &#x27;๐Ÿš€&#x27;, color: &#x27;bg-orange-500&#x27;, title: &#x27;Write Marketing Copy&#x27;, subtitle: &#x27;Craft persuasive sales messages&#x27;, description: &#x27;Create ads, emails, sales pages, or promotional content&#x27; } ]; export default function QuickStartWizard() { const router = useRouter(); const handleFrameworkSelect = (frameworkId: string) =&gt; { router.push(`/prompt-generator/build?framework=${frameworkId}`); }; return ( &lt;div className=&quot;max-w-5xl mx-auto&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold text-center mb-8&quot;&gt; What do you want to do? &lt;/h2&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt; {frameworks.map((framework) =&gt; ( &lt;button key={framework.id} onClick={() =&gt; handleFrameworkSelect(framework.id)} className=&quot;group p-6 border-2 border-gray-200 dark:border-gray-700 rounded-xl hover:border-gray-400 dark:hover:border-gray-500 transition-all text-left hover:shadow-lg&quot; &gt; &lt;div className=&quot;flex items-start gap-4&quot;&gt; &lt;div className={`text-4xl ${framework.color} bg-opacity-10 p-3 rounded-lg`}&gt; {framework.icon} &lt;/div&gt; &lt;div className=&quot;flex-1&quot;&gt; &lt;h3 className=&quot;text-xl font-semibold mb-1&quot;&gt; {framework.title} &lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 dark:text-gray-400 mb-2&quot;&gt; {framework.subtitle} &lt;/p&gt; &lt;p className=&quot;text-sm text-gray-500 dark:text-gray-500&quot;&gt; {framework.description} &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300&quot;&gt; โ†’ &lt;/div&gt; &lt;/div&gt; &lt;/button&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-8 text-center&quot;&gt; &lt;p className=&quot;text-gray-500 dark:text-gray-500 mb-4&quot;&gt; Not sure which to choose? &lt;/p&gt; &lt;button onClick={() =&gt; router.push(&#x27;/prompt-generator/build&#x27;)} className=&quot;text-blue-600 dark:text-blue-400 hover:underline&quot; &gt; Describe your goal and we&#x27;ll suggest the best framework โ†’ &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 34 lines // app/prompt-generator/build/page.tsx &#x27;use client&#x27;; import { useState, useEffect } from &#x27;react&#x27;; import { useSearchParams } from &#x27;next/navigation&#x27;; import PromptBuilder from &#x27;@/components/prompt-generator/PromptBuilder&#x27;; import FrameworkDetector from &#x27;@/components/prompt-generator/FrameworkDetector&#x27;; export default function BuildPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams.get(&#x27;framework&#x27;); const [framework, setFramework] = useState&lt;string | null&gt;(preselectedFramework); const [initialPrompt, setInitialPrompt] = useState(&#x27;&#x27;); if (!framework) { return ( &lt;FrameworkDetector onFrameworkDetected={(fw, prompt) =&gt; { setFramework(fw); setInitialPrompt(prompt); }} /&gt; ); } return ( &lt;PromptBuilder framework={framework} initialPrompt={initialPrompt} /&gt; ); } TypeScript TypeScriptโ€ข 57 lines // components/prompt-generator/FrameworkDetector.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/framework-detection&#x27;; interface Props { onFrameworkDetected: (framework: string, prompt: string) =&gt; void; } export default function FrameworkDetector({ onFrameworkDetected }: Props) { const [userInput, setUserInput] = useState(&#x27;&#x27;); const handleSubmit = (e: React.FormEvent) =&gt; { e.preventDefault(); const detected = detectFramework(userInput); onFrameworkDetected(detected, userInput); }; return ( &lt;div className=&quot;container mx-auto px-4 py-12 max-w-3xl&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;h1 className=&quot;text-3xl font-bold mb-4&quot;&gt; Describe what you need &lt;/h1&gt; &lt;p className=&quot;text-gray-600 dark:text-gray-400&quot;&gt; Tell us in your own words, and we&#x27;ll guide you to create the perfect prompt &lt;/p&gt; &lt;/div&gt; &lt;form onSubmit={handleSubmit} className=&quot;space-y-4&quot;&gt; &lt;textarea value={userInput} onChange={(e) =&gt; setUserInput(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are most popular...&quot; className=&quot;w-full h-40 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none&quot; autoFocus /&gt; &lt;button type=&quot;submit&quot; disabled={!userInput.trim()} className=&quot;w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors&quot; &gt; Continue โ†’ &lt;/button&gt; &lt;/form&gt; &lt;div className=&quot;mt-8 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg&quot;&gt; &lt;p className=&quot;text-sm text-blue-800 dark:text-blue-200&quot;&gt; &lt;strong&gt;๐Ÿ’ก Tip:&lt;/strong&gt; Just describe your goal naturally. We&#x27;ll automatically detect whether you need to analyze data, get expert advice, create content, or write marketing copy. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 96 lines // components/prompt-generator/PromptBuilder.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { useRouter } from &#x27;next/navigation&#x27;; import { getQuestionSet } from &#x27;@/lib/prompt-generator/questions&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import ProgressBar from &#x27;./ProgressBar&#x27;; interface Props { framework: string; initialPrompt?: string; } export default function PromptBuilder({ framework, initialPrompt }: Props) { const router = useRouter(); const questions = getQuestionSet(framework); const [currentStep, setCurrentStep] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentStep]; const progress = ((currentStep + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: value })); }; const handleNext = () =&gt; { if (currentStep &lt; questions.length - 1) { setCurrentStep(prev =&gt; prev + 1); } else { // All questions answered - go to results const queryParams = new URLSearchParams({ framework, original: initialPrompt || &#x27;&#x27;, ...answers }); router.push(`/prompt-generator/result?${queryParams.toString()}`); } }; const handleBack = () =&gt; { if (currentStep &gt; 0) { setCurrentStep(prev =&gt; prev - 1); } }; const canProceed = currentQuestion.required ? !!answers[currentQuestion.id] : true; return ( &lt;div className=&quot;container mx-auto px-4 py-12 max-w-3xl&quot;&gt; &lt;ProgressBar progress={progress} currentStep={currentStep + 1} totalSteps={questions.length} /&gt; &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;inline-block px-3 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 rounded-full text-sm font-medium mb-4&quot;&gt; {framework} Framework &lt;/div&gt; &lt;/div&gt; &lt;QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(value) =&gt; handleAnswer(currentQuestion.id, value)} /&gt; &lt;div className=&quot;flex gap-4 mt-8&quot;&gt; {currentStep &gt; 0 &amp;&amp; ( &lt;button onClick={handleBack} className=&quot;px-6 py-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg font-semibold hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors&quot; &gt; โ† Back &lt;/button&gt; )} &lt;button onClick={handleNext} disabled={!canProceed} className=&quot;flex-1 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white font-semibold rounded-lg transition-colors&quot; &gt; {currentStep &lt; questions.length - 1 ? &#x27;Next โ†’&#x27; : &#x27;Generate Prompt โœจ&#x27;} &lt;/button&gt; &lt;/div&gt; {!currentQuestion.required &amp;&amp; !answers[currentQuestion.id] &amp;&amp; ( &lt;p className=&quot;text-sm text-gray-500 dark:text-gray-400 mt-4 text-center&quot;&gt; This question is optional. We&#x27;ll use a smart default if you skip it. &lt;/p&gt; )} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 92 lines // components/prompt-generator/QuestionCard.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import type { Question } from &#x27;@/lib/prompt-generator/types&#x27;; interface Props { question: Question; value: string; onChange: (value: string) =&gt; void; } export default function QuestionCard({ question, value, onChange }: Props) { const [showTooltip, setShowTooltip] = useState(false); return ( &lt;div className=&quot;bg-white dark:bg-gray-800 p-6 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700&quot;&gt; &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold flex-1&quot;&gt; {question.label} {question.required &amp;&amp; &lt;span className=&quot;text-red-500 ml-1&quot;&gt;*&lt;/span&gt;} &lt;/h2&gt; &lt;button onMouseEnter={() =&gt; setShowTooltip(true)} onMouseLeave={() =&gt; setShowTooltip(false)} className=&quot;text-blue-500 hover:text-blue-600 ml-2&quot; aria-label=&quot;Help&quot; &gt; &lt;svg className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 20 20&quot;&gt; &lt;path fillRule=&quot;evenodd&quot; d=&quot;M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z&quot; clipRule=&quot;evenodd&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; &lt;/div&gt; {showTooltip &amp;&amp; ( &lt;div className=&quot;mb-4 p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg text-sm text-blue-800 dark:text-blue-200&quot;&gt; ๐Ÿ’ก {question.tooltip} &lt;/div&gt; )} {question.type === &#x27;textarea&#x27; &amp;&amp; ( &lt;textarea value={value} onChange={(e) =&gt; onChange(e.target.value)} placeholder={question.placeholder} className=&quot;w-full h-32 p-4 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 dark:focus:border-blue-400 outline-none resize-none&quot; /&gt; )} {question.type === &#x27;multiple-choice&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-2&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; onChange(option.value)} className={`w-full p-4 text-left rounded-lg border-2 transition-all ${ value === option.value ? &#x27;border-blue-500 bg-blue-50 dark:bg-blue-900/20&#x27; : &#x27;border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600&#x27; }`} &gt; &lt;div className=&quot;flex items-center gap-3&quot;&gt; &lt;div className={`w-5 h-5 rounded-full border-2 flex items-center justify-center ${ value === option.value ? &#x27;border-blue-500 bg-blue-500&#x27; : &#x27;border-gray-300 dark:border-gray-600&#x27; }`}&gt; {value === option.value &amp;&amp; ( &lt;div className=&quot;w-2 h-2 bg-white rounded-full&quot; /&gt; )} &lt;/div&gt; &lt;span className=&quot;font-medium&quot;&gt;{option.label}&lt;/span&gt; &lt;/div&gt; &lt;/button&gt; {option.hasTextField &amp;&amp; value === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; placeholder=&quot;Specify...&quot; className=&quot;w-full mt-2 p-3 border-2 border-gray-300 dark:border-gray-600 rounded-lg focus:border-blue-500 outline-none&quot; onChange={(e) =&gt; onChange(`custom:${e.target.value}`)} /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 24 lines // components/prompt-generator/ProgressBar.tsx interface Props { progress: number; currentStep: number; totalSteps: number; } export default function ProgressBar({ progress, currentStep, totalSteps }: Props) { return ( &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-2&quot;&gt; &lt;span&gt;Step {currentStep} of {totalSteps}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-blue-600 transition-all duration-300 ease-out&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; ); } Used 98 credits continue Used 0 credits javascript label: &#x27;Who is your target audience?&#x27;, placeholder: &#x27;e.g., 25-45 year old wedding and lifestyle photographers who want to speed up their editing workflow&#x27;, required: true, tooltip: &#x27;The more specific your audience definition, the more targeted and effective your copy will be.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific action do you want them to take?&#x27;, placeholder: &#x27;e.g., Click &quot;Buy Now&quot; before the 3-day discount expires&#x27;, required: true, tooltip: &#x27;Every marketing message needs ONE clear call-to-action. What\&#x27;s the next step?&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ultimate business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build customer base for future products&#x27;, required: false, defaultValue: &#x27;Generate conversions and revenue&#x27;, tooltip: &#x27;Understanding the business objective helps craft copy that aligns with your strategy.&#x27; }, { id: &#x27;urgency&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Is there a time-sensitive element?&#x27;, options: [ { value: &#x27;limited-time&#x27;, label: &#x27;โฐ Limited Time Offer&#x27; }, { value: &#x27;limited-quantity&#x27;, label: &#x27;๐Ÿ“ฆ Limited Quantity&#x27; }, { value: &#x27;early-bird&#x27;, label: &#x27;๐Ÿฆ Early Bird Special&#x27; }, { value: &#x27;seasonal&#x27;, label: &#x27;๐ŸŽ„ Seasonal/Event-Based&#x27; }, { value: &#x27;none&#x27;, label: &#x27;No Urgency&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Urgency...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Standard marketing timeframe&#x27;, tooltip: &#x27;Urgency drives immediate action. Use it authentically to boost conversions.&#x27; } ]; 5. Prompt Assembly Logic Template Structure javascript const promptTemplates = { ICDF: (answers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that is clear, actionable, and directly addresses the instruction within the given context. `.trim(), RCREOC: (answers) =&gt; ` **Role:** You are a ${answers.role}. **Context:** ${answers.context} **Request:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Output Format:** Deliver your analysis as ${answers.output}. **Constraints:** ${answers.constraints} Provide professional, expert-level guidance that is constructive and actionable. `.trim(), MICRO: (answers) =&gt; ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Context:** This content will be published on ${answers.platform} **Tone &amp; Rhythm:** ${answers.rhythm} **Content Type:** Create a ${answers[&#x27;output-type&#x27;]} Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.style} **Target Audience:** ${answers.target} **Desired Action:** The reader should ${answers.action} **Business Result:** The ultimate goal is to ${answers.result} **Urgency Element:** ${answers.urgency} Write persuasive copy that speaks directly to the target audience, clearly presents the offer, and motivates immediate action while maintaining the specified style. `.trim() }; 6. Database Schema Analytics Tracking (No User Data) prisma model PromptGeneration { id String @id @default(cuid()) createdAt DateTime @default(now()) // Framework used framework String // &#x27;ICDF&#x27;, &#x27;RCREOC&#x27;, &#x27;MICRO&#x27;, &#x27;COSTAR&#x27; // User journey tracking initialPromptLength Int // Character count of original input questionsAnswered Int // How many questions user answered questionsSkipped Int // How many used smart defaults timeToComplete Int // Seconds from start to finish // Outcome completed Boolean @default(false) copiedToClipboard Boolean @default(false) // Anonymous session (for rate limiting) sessionHash String // Hashed IP + User Agent @@index([framework, createdAt]) @@index([sessionHash, createdAt]) } model FrameworkUsage { id String @id @default(cuid()) date DateTime @default(now()) framework String count Int @default(1) @@unique([date, framework]) @@index([date]) } 7. File Structure src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”œโ”€โ”€ InitialPromptInput.tsx # First text input โ”‚ โ”œโ”€โ”€ AdaptiveQuestionnaire.tsx # Dynamic question renderer โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover/click tooltip โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ””โ”€โ”€ SuccessActions.tsx # Copy button + restart โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword matching logic โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”œโ”€โ”€ smartDefaults.ts # Default values โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ track/ โ”‚ โ””โ”€โ”€ route.ts # POST - Log analytics โ””โ”€โ”€ rate-limit/ โ””โ”€โ”€ route.ts # GET - Check usage limits 8. Component Specifications 8.1 QuickStartWizard.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworkDetection&#x27;; interface QuickStartWizardProps { onFrameworkSelect: (framework: string) =&gt; void; } export default function QuickStartWizard({ onFrameworkSelect }: QuickStartWizardProps) { return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {Object.entries(frameworkDetection).map(([key, framework]) =&gt; ( &lt;button key={key} onClick={() =&gt; onFrameworkSelect(key)} className=&quot;group relative p-8 bg-white rounded-2xl border-2 border-gray-200 hover:border-current hover:shadow-xl transition-all duration-300&quot; style={{ &#x27;--hover-color&#x27;: framework.color, color: &#x27;inherit&#x27; } as React.CSSProperties} &gt; {/* Icon */} &lt;div className=&quot;text-6xl mb-4 transition-transform group-hover:scale-110&quot; style={{ color: framework.color }} &gt; {framework.icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-xl font-bold mb-2&quot;&gt; {framework.title} &lt;/h3&gt; {/* Subtitle */} &lt;p className=&quot;text-gray-600 text-sm&quot;&gt; {framework.subtitle} &lt;/p&gt; {/* Hover indicator */} &lt;div className=&quot;absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transition-opacity&quot;&gt; &lt;svg className=&quot;w-6 h-6&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/button&gt; ))} &lt;/div&gt; {/* Example prompts section */} &lt;div className=&quot;mt-16 text-center&quot;&gt; &lt;p className=&quot;text-gray-500 text-sm mb-4&quot;&gt; Popular examples: &lt;/p&gt; &lt;div className=&quot;flex flex-wrap justify-center gap-3&quot;&gt; {[ { text: &#x27;Analyze my website traffic&#x27;, framework: &#x27;ICDF&#x27; }, { text: &#x27;Review my photography portfolio&#x27;, framework: &#x27;RCREOC&#x27; }, { text: &#x27;Write a YouTube script about lighting&#x27;, framework: &#x27;MICRO&#x27; }, { text: &#x27;Create a sales email for presets&#x27;, framework: &#x27;COSTAR&#x27; } ].map((example, idx) =&gt; ( &lt;button key={idx} onClick={() =&gt; onFrameworkSelect(example.framework)} className=&quot;px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition-colors&quot; &gt; &quot;{example.text}&quot; &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ); } 8.2 InitialPromptInput.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/frameworkDetection&#x27;; interface InitialPromptInputProps { selectedFramework: string; onSubmit: (prompt: string, detectedFramework: string) =&gt; void; onBack: () =&gt; void; } export default function InitialPromptInput({ selectedFramework, onSubmit, onBack }: InitialPromptInputProps) { const [prompt, setPrompt] = useState(&#x27;&#x27;); const [isAnalyzing, setIsAnalyzing] = useState(false); const handleSubmit = () =&gt; { if (!prompt.trim()) return; setIsAnalyzing(true); // Simulate brief analysis delay for UX setTimeout(() =&gt; { const detected = detectFramework(prompt); onSubmit(prompt, detected); }, 500); }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Back button */} &lt;button onClick={onBack} className=&quot;flex items-center text-gray-600 hover:text-gray-900 mb-8&quot; &gt; &lt;svg className=&quot;w-5 h-5 mr-2&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; Back to framework selection &lt;/button&gt; {/* Header */} &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold mb-3&quot;&gt; Describe what you need &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Write your idea in plain language. We&#x27;ll ask follow-up questions to make it professional. &lt;/p&gt; &lt;/div&gt; {/* Input area */} &lt;div className=&quot;bg-white rounded-2xl border-2 border-gray-200 p-6 shadow-sm&quot;&gt; &lt;textarea value={prompt} onChange={(e) =&gt; setPrompt(e.target.value)} placeholder=&quot;Example: I want to analyze my photography website traffic to see which blog posts get the most engagement...&quot; className=&quot;w-full min-h-[200px] text-lg border-none focus:outline-none resize-none&quot; autoFocus /&gt; &lt;div className=&quot;flex items-center justify-between mt-4 pt-4 border-t border-gray-200&quot;&gt; &lt;span className=&quot;text-sm text-gray-500&quot;&gt; {prompt.length} characters &lt;/span&gt; &lt;button onClick={handleSubmit} disabled={!prompt.trim() || isAnalyzing} className=&quot;px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors&quot; &gt; {isAnalyzing ? ( &lt;span className=&quot;flex items-center&quot;&gt; &lt;svg className=&quot;animate-spin -ml-1 mr-3 h-5 w-5 text-white&quot; fill=&quot;none&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;circle className=&quot;opacity-25&quot; cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;10&quot; stroke=&quot;currentColor&quot; strokeWidth=&quot;4&quot;&gt;&lt;/circle&gt; &lt;path className=&quot;opacity-75&quot; fill=&quot;currentColor&quot; d=&quot;M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z&quot;&gt;&lt;/path&gt; &lt;/svg&gt; Analyzing... &lt;/span&gt; ) : ( &#x27;Continue โ†’&#x27; )} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Tips */} &lt;div className=&quot;mt-8 p-6 bg-blue-50 rounded-xl&quot;&gt; &lt;h4 className=&quot;font-semibold mb-2 flex items-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 mr-2 text-blue-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z&quot; /&gt; &lt;/svg&gt; Pro tip &lt;/h4&gt; &lt;p className=&quot;text-sm text-gray-700&quot;&gt; Don&#x27;t worry about being perfect. Just describe your goal naturallyโ€”we&#x27;ll ask the right questions to fill in the details. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } 8.3 AdaptiveQuestionnaire.tsx typescript &#x27;use client&#x27;; import { useState, useEffect } from &#x27;react&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import { getQuestionSet } from &#x27;@/lib/prompt-generator/questionSets&#x27;; import { getSmartDefault } from &#x27;@/lib/prompt-generator/smartDefaults&#x27;; interface AdaptiveQuestionnaireProps { framework: string; initialPrompt: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; onBack: () =&gt; void; } export default function AdaptiveQuestionnaire({ framework, initialPrompt, onComplete, onBack }: AdaptiveQuestionnaireProps) { const questions = getQuestionSet(framework); const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [skippedQuestions, setSkippedQuestions] = useState&lt;string[]&gt;([]); const currentQuestion = questions[currentQuestionIndex]; const progress = ((currentQuestionIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, answer: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: answer })); if (currentQuestionIndex &lt; questions.length - 1) { setCurrentQuestionIndex(prev =&gt; prev + 1); } else { // Last question answered - finalize finalizeAnswers({ ...answers, [questionId]: answer }); } }; const handleSkip = (questionId: string) =&gt; { const defaultValue = getSmartDefault(framework, questionId); setAnswers(prev =&gt; ({ ...prev, [questionId]: defaultValue })); setSkippedQuestions(prev =&gt; [...prev, questionId]); if (currentQuestionIndex &lt; questions.length - 1) { setCurrentQuestionIndex(prev =&gt; prev + 1); } else { finalizeAnswers({ ...answers, [questionId]: defaultValue }); } }; const finalizeAnswers = (finalAnswers: Record&lt;string, string&gt;) =&gt; { // Track analytics fetch(&#x27;/api/prompt-generator/track&#x27;, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ framework, questionsAnswered: questions.length - skippedQuestions.length, questionsSkipped: skippedQuestions.length, initialPromptLength: initialPrompt.length }) }); onComplete(finalAnswers); }; return ( &lt;div className=&quot;max-w-4xl mx-auto px-4 py-12&quot;&gt; {/* Progress bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-2&quot;&gt; &lt;button onClick={onBack} className=&quot;text-gray-600 hover:text-gray-900 flex items-center&quot; &gt; &lt;svg className=&quot;w-5 h-5 mr-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; Back &lt;/button&gt; &lt;span className=&quot;text-sm text-gray-600&quot;&gt; Question {currentQuestionIndex + 1} of {questions.length} &lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-blue-600 transition-all duration-300&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Current question */} &lt;QuestionCard question={currentQuestion} onAnswer={(answer) =&gt; handleAnswer(currentQuestion.id, answer)} onSkip={() =&gt; handleSkip(currentQuestion.id)} /&gt; {/* Framework indicator */} &lt;div className=&quot;mt-8 text-center text-sm text-gray-500&quot;&gt; Using &lt;span className=&quot;font-semibold&quot;&gt;{framework}&lt;/span&gt; framework &lt;/div&gt; &lt;/div&gt; ); } 8.4 QuestionCard.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import LearningTooltip from &#x27;./LearningTooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean }&gt;; required: boolean; defaultValue?: string; tooltip: string; } interface QuestionCardProps { question: Question; onAnswer: (answer: string) =&gt; void; onSkip: () =&gt; void; } export default function QuestionCard({ question, onAnswer, onSkip }: QuestionCardProps) { const [answer, setAnswer] = useState(&#x27;&#x27;); const [selectedOption, setSelectedOption] = useState(&#x27;&#x27;); const [customText, setCustomText] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { if (question.type === &#x27;textarea&#x27;) { if (answer.trim()) { onAnswer(answer); } } else { // Multiple choice const finalAnswer = selectedOption === &#x27;custom&#x27; ? customText : selectedOption; if (finalAnswer) { onAnswer(finalAnswer); } } }; const canSubmit = question.type === &#x27;textarea&#x27; ? answer.trim().length &gt; 0 : selectedOption &amp;&amp; (selectedOption !== &#x27;custom&#x27; || customText.trim().length &gt; 0); return ( &lt;div className=&quot;bg-white rounded-2xl border-2 border-gray-200 p-8 shadow-sm&quot;&gt; {/* Question label with tooltip */} &lt;div className=&quot;flex items-start justify-between mb-6&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold pr-4&quot;&gt; {question.label} {!question.required &amp;&amp; ( &lt;span className=&quot;ml-2 text-sm font-normal text-gray-500&quot;&gt;(Optional)&lt;/span&gt; )} &lt;/h3&gt; &lt;LearningTooltip content={question.tooltip} /&gt; &lt;/div&gt; {/* Input based on type */} {question.type === &#x27;textarea&#x27; ? ( &lt;textarea value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} placeholder={question.placeholder} className=&quot;w-full min-h-[150px] p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:outline-none text-lg resize-none&quot; autoFocus /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; setSelectedOption(option.value)} className={`w-full p-4 text-left rounded-xl border-2 transition-all ${ selectedOption === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-200 hover:border-gray-300&#x27; }`} &gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;div className={`w-5 h-5 rounded-full border-2 mr-3 flex items-center justify-center ${ selectedOption === option.value ? &#x27;border-blue-500 bg-blue-500&#x27; : &#x27;border-gray-300&#x27; }`}&gt; {selectedOption === option.value &amp;&amp; ( &lt;div className=&quot;w-2 h-2 bg-white rounded-full&quot; /&gt; )} &lt;/div&gt; &lt;span className=&quot;font-medium&quot;&gt;{option.label}&lt;/span&gt; &lt;/div&gt; &lt;/button&gt; {/* Custom text field for &quot;Other&quot; options */} {option.hasTextField &amp;&amp; selectedOption === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; value={customText} onChange={(e) =&gt; setCustomText(e.target.value)} placeholder=&quot;Please specify...&quot; className=&quot;w-full mt-2 p-3 border-2 border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none&quot; autoFocus /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Action buttons */} &lt;div className=&quot;flex items-center justify-between mt-6 pt-6 border-t border-gray-200&quot;&gt; {!question.required ? ( &lt;button onClick={onSkip} className=&quot;text-gray-600 hover:text-gray-900 font-medium&quot; &gt; Skip question โ†’ &lt;/button&gt; ) : ( &lt;div /&gt; )} &lt;button onClick={handleSubmit} disabled={!canSubmit} className=&quot;px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors&quot; &gt; {question.required ? &#x27;Continue โ†’&#x27; : &#x27;Answer &amp; Continue โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } 8.5 LearningTooltip.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; interface LearningTooltipProps { content: string; } export default function LearningTooltip({ content }: LearningTooltipProps) { const [isVisible, setIsVisible] = useState(false); return ( &lt;div className=&quot;relative&quot;&gt; &lt;button onMouseEnter={() =&gt; setIsVisible(true)} onMouseLeave={() =&gt; setIsVisible(false)} onClick={() =&gt; setIsVisible(!isVisible)} className=&quot;flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center hover:bg-blue-200 transition-colors&quot; aria-label=&quot;Learn why this matters&quot; &gt; &lt;svg className=&quot;w-4 h-4&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; {/* Tooltip content */} {isVisible &amp;&amp; ( &lt;div className=&quot;absolute right-0 top-8 z-10 w-80 p-4 bg-gray-900 text-white text-sm rounded-lg shadow-xl&quot;&gt; &lt;div className=&quot;absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45&quot; /&gt; &lt;div className=&quot;relative&quot;&gt; &lt;div className=&quot;flex items-start mb-2&quot;&gt; &lt;svg className=&quot;w-5 h-5 mr-2 flex-shrink-0 text-blue-400&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z&quot; /&gt; &lt;/svg&gt; &lt;strong className=&quot;text-blue-400&quot;&gt;Why this matters:&lt;/strong&gt; &lt;/div&gt; &lt;p className=&quot;leading-relaxed&quot;&gt;{content}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; ); } 8.6 BeforeAfterComparison.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; interface BeforeAfterComparisonProps { originalPrompt: string; enhancedPrompt: string; framework: string; onRestart: () =&gt; void; } export default function BeforeAfterComparison({ originalPrompt, enhancedPrompt, framework, onRestart }: BeforeAfterComparisonProps) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(enhancedPrompt); setCopied(true); // Track copy event fetch(&#x27;/api/prompt-generator/track&#x27;, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ event: &#x27;copy&#x27;, framework }) }); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-7xl mx-auto px-4 py-12&quot;&gt; {/* Success header */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;div className=&quot;inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-4&quot;&gt; &lt;svg className=&quot;w-8 h-8 text-green-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M5 13l4 4L19 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;h2 className=&quot;text-3xl font-bold mb-2&quot;&gt; Your Professional Prompt is Ready! &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; See how we transformed your idea using the {framework} framework &lt;/p&gt; &lt;/div&gt; {/* Before/After Comparison */} &lt;div className=&quot;grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8&quot;&gt; {/* BEFORE */} &lt;div className=&quot;bg-gray-50 rounded-2xl p-6 border-2 border-gray-200&quot;&gt; &lt;div className=&quot;flex items-center mb-4&quot;&gt; &lt;div className=&quot;w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center mr-3&quot;&gt; &lt;span className=&quot;text-sm font-bold text-gray-600&quot;&gt;1&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-lg font-bold text-gray-700&quot;&gt;Your Original Prompt&lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;bg-white rounded-xl p-4 min-h-[200px] text-gray-700 leading-relaxed&quot;&gt; {originalPrompt} &lt;/div&gt; &lt;/div&gt; {/* AFTER */} &lt;div className=&quot;bg-gradient-to-br from-blue-50 to-purple-50 rounded-2xl p-6 border-2 border-blue-200&quot;&gt; &lt;div className=&quot;flex items-center mb-4&quot;&gt; &lt;div className=&quot;w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center mr-3&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-white&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;h3 className=&quot;text-lg font-bold text-blue-900&quot;&gt;Professional Version&lt;/h JavaScript JavaScriptโ€ข 39 lines label: &#x27;Who is your target audience?&#x27;, placeholder: &#x27;e.g., 25-45 year old wedding and lifestyle photographers who want to speed up their editing workflow&#x27;, required: true, tooltip: &#x27;The more specific your audience definition, the more targeted and effective your copy will be.&#x27; }, { id: &#x27;action&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What specific action do you want them to take?&#x27;, placeholder: &#x27;e.g., Click &quot;Buy Now&quot; before the 3-day discount expires&#x27;, required: true, tooltip: &#x27;Every marketing message needs ONE clear call-to-action. What\&#x27;s the next step?&#x27; }, { id: &#x27;result&#x27;, type: &#x27;textarea&#x27;, label: &#x27;What\&#x27;s the ultimate business goal?&#x27;, placeholder: &#x27;e.g., Drive 100 sales in the first 3 days and build customer base for future products&#x27;, required: false, defaultValue: &#x27;Generate conversions and revenue&#x27;, tooltip: &#x27;Understanding the business objective helps craft copy that aligns with your strategy.&#x27; }, { id: &#x27;urgency&#x27;, type: &#x27;multiple-choice&#x27;, label: &#x27;Is there a time-sensitive element?&#x27;, options: [ { value: &#x27;limited-time&#x27;, label: &#x27;โฐ Limited Time Offer&#x27; }, { value: &#x27;limited-quantity&#x27;, label: &#x27;๐Ÿ“ฆ Limited Quantity&#x27; }, { value: &#x27;early-bird&#x27;, label: &#x27;๐Ÿฆ Early Bird Special&#x27; }, { value: &#x27;seasonal&#x27;, label: &#x27;๐ŸŽ„ Seasonal/Event-Based&#x27; }, { value: &#x27;none&#x27;, label: &#x27;No Urgency&#x27; }, { value: &#x27;custom&#x27;, label: &#x27;Custom Urgency...&#x27;, hasTextField: true } ], required: false, defaultValue: &#x27;Standard marketing timeframe&#x27;, tooltip: &#x27;Urgency drives immediate action. Use it authentically to boost conversions.&#x27; } ]; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 63 lines const promptTemplates = { ICDF: (answers) =&gt; ` **Instruction:** ${answers.instruction} **Context:** ${answers.context} **Data to Analyze:** ${answers.data} **Required Output Format:** ${answers.format} Please provide a ${answers.format} that is clear, actionable, and directly addresses the instruction within the given context. `.trim(), RCREOC: (answers) =&gt; ` **Role:** You are a ${answers.role}. **Context:** ${answers.context} **Request:** ${answers.request} **Example of Expected Thinking:** ${answers.examples} **Output Format:** Deliver your analysis as ${answers.output}. **Constraints:** ${answers.constraints} Provide professional, expert-level guidance that is constructive and actionable. `.trim(), MICRO: (answers) =&gt; ` **Core Message:** ${answers.message} **Intention:** The goal is to make the audience ${answers.intention} **Target Audience:** ${answers.audience} **Platform/Context:** This content will be published on ${answers.platform} **Tone &amp; Rhythm:** ${answers.rhythm} **Content Type:** Create a ${answers[&#x27;output-type&#x27;]} Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The tone should be ${answers.style} **Target Audience:** ${answers.target} **Desired Action:** The reader should ${answers.action} **Business Result:** The ultimate goal is to ${answers.result} **Urgency Element:** ${answers.urgency} Write persuasive copy that speaks directly to the target audience, clearly presents the offer, and motivates immediate action while maintaining the specified style. `.trim() }; This code can be executed in the preview sandbox Run Code PRISMA Code PRISMAโ€ข 33 lines model PromptGeneration { id String @id @default(cuid()) createdAt DateTime @default(now()) // Framework used framework String // &#x27;ICDF&#x27;, &#x27;RCREOC&#x27;, &#x27;MICRO&#x27;, &#x27;COSTAR&#x27; // User journey tracking initialPromptLength Int // Character count of original input questionsAnswered Int // How many questions user answered questionsSkipped Int // How many used smart defaults timeToComplete Int // Seconds from start to finish // Outcome completed Boolean @default(false) copiedToClipboard Boolean @default(false) // Anonymous session (for rate limiting) sessionHash String // Hashed IP + User Agent @@index([framework, createdAt]) @@index([sessionHash, createdAt]) } model FrameworkUsage { id String @id @default(cuid()) date DateTime @default(now()) framework String count Int @default(1) @@unique([date, framework]) @@index([date]) } Code Snippet 4 Plain Textโ€ข 28 lines src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”œโ”€โ”€ InitialPromptInput.tsx # First text input โ”‚ โ”œโ”€โ”€ AdaptiveQuestionnaire.tsx # Dynamic question renderer โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover/click tooltip โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ””โ”€โ”€ SuccessActions.tsx # Copy button + restart โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword matching logic โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”œโ”€โ”€ smartDefaults.ts # Default values โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ track/ โ”‚ โ””โ”€โ”€ route.ts # POST - Log analytics โ””โ”€โ”€ rate-limit/ โ””โ”€โ”€ route.ts # GET - Check usage limits TypeScript TypeScriptโ€ข 85 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworkDetection&#x27;; interface QuickStartWizardProps { onFrameworkSelect: (framework: string) =&gt; void; } export default function QuickStartWizard({ onFrameworkSelect }: QuickStartWizardProps) { return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {Object.entries(frameworkDetection).map(([key, framework]) =&gt; ( &lt;button key={key} onClick={() =&gt; onFrameworkSelect(key)} className=&quot;group relative p-8 bg-white rounded-2xl border-2 border-gray-200 hover:border-current hover:shadow-xl transition-all duration-300&quot; style={{ &#x27;--hover-color&#x27;: framework.color, color: &#x27;inherit&#x27; } as React.CSSProperties} &gt; {/* Icon */} &lt;div className=&quot;text-6xl mb-4 transition-transform group-hover:scale-110&quot; style={{ color: framework.color }} &gt; {framework.icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-xl font-bold mb-2&quot;&gt; {framework.title} &lt;/h3&gt; {/* Subtitle */} &lt;p className=&quot;text-gray-600 text-sm&quot;&gt; {framework.subtitle} &lt;/p&gt; {/* Hover indicator */} &lt;div className=&quot;absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transition-opacity&quot;&gt; &lt;svg className=&quot;w-6 h-6&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/button&gt; ))} &lt;/div&gt; {/* Example prompts section */} &lt;div className=&quot;mt-16 text-center&quot;&gt; &lt;p className=&quot;text-gray-500 text-sm mb-4&quot;&gt; Popular examples: &lt;/p&gt; &lt;div className=&quot;flex flex-wrap justify-center gap-3&quot;&gt; {[ { text: &#x27;Analyze my website traffic&#x27;, framework: &#x27;ICDF&#x27; }, { text: &#x27;Review my photography portfolio&#x27;, framework: &#x27;RCREOC&#x27; }, { text: &#x27;Write a YouTube script about lighting&#x27;, framework: &#x27;MICRO&#x27; }, { text: &#x27;Create a sales email for presets&#x27;, framework: &#x27;COSTAR&#x27; } ].map((example, idx) =&gt; ( &lt;button key={idx} onClick={() =&gt; onFrameworkSelect(example.framework)} className=&quot;px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition-colors&quot; &gt; &quot;{example.text}&quot; &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 104 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/frameworkDetection&#x27;; interface InitialPromptInputProps { selectedFramework: string; onSubmit: (prompt: string, detectedFramework: string) =&gt; void; onBack: () =&gt; void; } export default function InitialPromptInput({ selectedFramework, onSubmit, onBack }: InitialPromptInputProps) { const [prompt, setPrompt] = useState(&#x27;&#x27;); const [isAnalyzing, setIsAnalyzing] = useState(false); const handleSubmit = () =&gt; { if (!prompt.trim()) return; setIsAnalyzing(true); // Simulate brief analysis delay for UX setTimeout(() =&gt; { const detected = detectFramework(prompt); onSubmit(prompt, detected); }, 500); }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Back button */} &lt;button onClick={onBack} className=&quot;flex items-center text-gray-600 hover:text-gray-900 mb-8&quot; &gt; &lt;svg className=&quot;w-5 h-5 mr-2&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; Back to framework selection &lt;/button&gt; {/* Header */} &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold mb-3&quot;&gt; Describe what you need &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Write your idea in plain language. We&#x27;ll ask follow-up questions to make it professional. &lt;/p&gt; &lt;/div&gt; {/* Input area */} &lt;div className=&quot;bg-white rounded-2xl border-2 border-gray-200 p-6 shadow-sm&quot;&gt; &lt;textarea value={prompt} onChange={(e) =&gt; setPrompt(e.target.value)} placeholder=&quot;Example: I want to analyze my photography website traffic to see which blog posts get the most engagement...&quot; className=&quot;w-full min-h-[200px] text-lg border-none focus:outline-none resize-none&quot; autoFocus /&gt; &lt;div className=&quot;flex items-center justify-between mt-4 pt-4 border-t border-gray-200&quot;&gt; &lt;span className=&quot;text-sm text-gray-500&quot;&gt; {prompt.length} characters &lt;/span&gt; &lt;button onClick={handleSubmit} disabled={!prompt.trim() || isAnalyzing} className=&quot;px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors&quot; &gt; {isAnalyzing ? ( &lt;span className=&quot;flex items-center&quot;&gt; &lt;svg className=&quot;animate-spin -ml-1 mr-3 h-5 w-5 text-white&quot; fill=&quot;none&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;circle className=&quot;opacity-25&quot; cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;10&quot; stroke=&quot;currentColor&quot; strokeWidth=&quot;4&quot;&gt;&lt;/circle&gt; &lt;path className=&quot;opacity-75&quot; fill=&quot;currentColor&quot; d=&quot;M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z&quot;&gt;&lt;/path&gt; &lt;/svg&gt; Analyzing... &lt;/span&gt; ) : ( &#x27;Continue โ†’&#x27; )} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Tips */} &lt;div className=&quot;mt-8 p-6 bg-blue-50 rounded-xl&quot;&gt; &lt;h4 className=&quot;font-semibold mb-2 flex items-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 mr-2 text-blue-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z&quot; /&gt; &lt;/svg&gt; Pro tip &lt;/h4&gt; &lt;p className=&quot;text-sm text-gray-700&quot;&gt; Don&#x27;t worry about being perfect. Just describe your goal naturallyโ€”we&#x27;ll ask the right questions to fill in the details. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 109 lines &#x27;use client&#x27;; import { useState, useEffect } from &#x27;react&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import { getQuestionSet } from &#x27;@/lib/prompt-generator/questionSets&#x27;; import { getSmartDefault } from &#x27;@/lib/prompt-generator/smartDefaults&#x27;; interface AdaptiveQuestionnaireProps { framework: string; initialPrompt: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; onBack: () =&gt; void; } export default function AdaptiveQuestionnaire({ framework, initialPrompt, onComplete, onBack }: AdaptiveQuestionnaireProps) { const questions = getQuestionSet(framework); const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [skippedQuestions, setSkippedQuestions] = useState&lt;string[]&gt;([]); const currentQuestion = questions[currentQuestionIndex]; const progress = ((currentQuestionIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, answer: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: answer })); if (currentQuestionIndex &lt; questions.length - 1) { setCurrentQuestionIndex(prev =&gt; prev + 1); } else { // Last question answered - finalize finalizeAnswers({ ...answers, [questionId]: answer }); } }; const handleSkip = (questionId: string) =&gt; { const defaultValue = getSmartDefault(framework, questionId); setAnswers(prev =&gt; ({ ...prev, [questionId]: defaultValue })); setSkippedQuestions(prev =&gt; [...prev, questionId]); if (currentQuestionIndex &lt; questions.length - 1) { setCurrentQuestionIndex(prev =&gt; prev + 1); } else { finalizeAnswers({ ...answers, [questionId]: defaultValue }); } }; const finalizeAnswers = (finalAnswers: Record&lt;string, string&gt;) =&gt; { // Track analytics fetch(&#x27;/api/prompt-generator/track&#x27;, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ framework, questionsAnswered: questions.length - skippedQuestions.length, questionsSkipped: skippedQuestions.length, initialPromptLength: initialPrompt.length }) }); onComplete(finalAnswers); }; return ( &lt;div className=&quot;max-w-4xl mx-auto px-4 py-12&quot;&gt; {/* Progress bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-2&quot;&gt; &lt;button onClick={onBack} className=&quot;text-gray-600 hover:text-gray-900 flex items-center&quot; &gt; &lt;svg className=&quot;w-5 h-5 mr-1&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; Back &lt;/button&gt; &lt;span className=&quot;text-sm text-gray-600&quot;&gt; Question {currentQuestionIndex + 1} of {questions.length} &lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-blue-600 transition-all duration-300&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Current question */} &lt;QuestionCard question={currentQuestion} onAnswer={(answer) =&gt; handleAnswer(currentQuestion.id, answer)} onSkip={() =&gt; handleSkip(currentQuestion.id)} /&gt; {/* Framework indicator */} &lt;div className=&quot;mt-8 text-center text-sm text-gray-500&quot;&gt; Using &lt;span className=&quot;font-semibold&quot;&gt;{framework}&lt;/span&gt; framework &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 134 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import LearningTooltip from &#x27;./LearningTooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean }&gt;; required: boolean; defaultValue?: string; tooltip: string; } interface QuestionCardProps { question: Question; onAnswer: (answer: string) =&gt; void; onSkip: () =&gt; void; } export default function QuestionCard({ question, onAnswer, onSkip }: QuestionCardProps) { const [answer, setAnswer] = useState(&#x27;&#x27;); const [selectedOption, setSelectedOption] = useState(&#x27;&#x27;); const [customText, setCustomText] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { if (question.type === &#x27;textarea&#x27;) { if (answer.trim()) { onAnswer(answer); } } else { // Multiple choice const finalAnswer = selectedOption === &#x27;custom&#x27; ? customText : selectedOption; if (finalAnswer) { onAnswer(finalAnswer); } } }; const canSubmit = question.type === &#x27;textarea&#x27; ? answer.trim().length &gt; 0 : selectedOption &amp;&amp; (selectedOption !== &#x27;custom&#x27; || customText.trim().length &gt; 0); return ( &lt;div className=&quot;bg-white rounded-2xl border-2 border-gray-200 p-8 shadow-sm&quot;&gt; {/* Question label with tooltip */} &lt;div className=&quot;flex items-start justify-between mb-6&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold pr-4&quot;&gt; {question.label} {!question.required &amp;&amp; ( &lt;span className=&quot;ml-2 text-sm font-normal text-gray-500&quot;&gt;(Optional)&lt;/span&gt; )} &lt;/h3&gt; &lt;LearningTooltip content={question.tooltip} /&gt; &lt;/div&gt; {/* Input based on type */} {question.type === &#x27;textarea&#x27; ? ( &lt;textarea value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} placeholder={question.placeholder} className=&quot;w-full min-h-[150px] p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:outline-none text-lg resize-none&quot; autoFocus /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; setSelectedOption(option.value)} className={`w-full p-4 text-left rounded-xl border-2 transition-all ${ selectedOption === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-200 hover:border-gray-300&#x27; }`} &gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;div className={`w-5 h-5 rounded-full border-2 mr-3 flex items-center justify-center ${ selectedOption === option.value ? &#x27;border-blue-500 bg-blue-500&#x27; : &#x27;border-gray-300&#x27; }`}&gt; {selectedOption === option.value &amp;&amp; ( &lt;div className=&quot;w-2 h-2 bg-white rounded-full&quot; /&gt; )} &lt;/div&gt; &lt;span className=&quot;font-medium&quot;&gt;{option.label}&lt;/span&gt; &lt;/div&gt; &lt;/button&gt; {/* Custom text field for &quot;Other&quot; options */} {option.hasTextField &amp;&amp; selectedOption === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; value={customText} onChange={(e) =&gt; setCustomText(e.target.value)} placeholder=&quot;Please specify...&quot; className=&quot;w-full mt-2 p-3 border-2 border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none&quot; autoFocus /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Action buttons */} &lt;div className=&quot;flex items-center justify-between mt-6 pt-6 border-t border-gray-200&quot;&gt; {!question.required ? ( &lt;button onClick={onSkip} className=&quot;text-gray-600 hover:text-gray-900 font-medium&quot; &gt; Skip question โ†’ &lt;/button&gt; ) : ( &lt;div /&gt; )} &lt;button onClick={handleSubmit} disabled={!canSubmit} className=&quot;px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors&quot; &gt; {question.required ? &#x27;Continue โ†’&#x27; : &#x27;Answer &amp; Continue โ†’&#x27;} &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 43 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; interface LearningTooltipProps { content: string; } export default function LearningTooltip({ content }: LearningTooltipProps) { const [isVisible, setIsVisible] = useState(false); return ( &lt;div className=&quot;relative&quot;&gt; &lt;button onMouseEnter={() =&gt; setIsVisible(true)} onMouseLeave={() =&gt; setIsVisible(false)} onClick={() =&gt; setIsVisible(!isVisible)} className=&quot;flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center hover:bg-blue-200 transition-colors&quot; aria-label=&quot;Learn why this matters&quot; &gt; &lt;svg className=&quot;w-4 h-4&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; {/* Tooltip content */} {isVisible &amp;&amp; ( &lt;div className=&quot;absolute right-0 top-8 z-10 w-80 p-4 bg-gray-900 text-white text-sm rounded-lg shadow-xl&quot;&gt; &lt;div className=&quot;absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45&quot; /&gt; &lt;div className=&quot;relative&quot;&gt; &lt;div className=&quot;flex items-start mb-2&quot;&gt; &lt;svg className=&quot;w-5 h-5 mr-2 flex-shrink-0 text-blue-400&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z&quot; /&gt; &lt;/svg&gt; &lt;strong className=&quot;text-blue-400&quot;&gt;Why this matters:&lt;/strong&gt; &lt;/div&gt; &lt;p className=&quot;leading-relaxed&quot;&gt;{content}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; ); } Used 109 credits javascript Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The copy should have a ${answers.style} tone and style. **Target Audience:** ${answers.target} **Action:** The primary call-to-action is: ${answers.action} **Result:** The business goal is to ${answers.result} ${answers.urgency !== &#x27;none&#x27; ? `**Urgency Factor:** ${answers.urgency}\n` : &#x27;&#x27;} Write persuasive marketing copy that speaks directly to the target audience, clearly presents the offer, and drives them to take action. `.trim() }; Before/After Comparison Generator javascript function generateComparison(originalPrompt, framework, answers) { const professionalPrompt = promptTemplates[framework](answers); return { original: originalPrompt, professional: professionalPrompt, improvements: generateImprovements(framework, answers), framework: framework, frameworkName: getFrameworkName(framework) }; } function generateImprovements(framework, answers) { const improvements = []; // Framework-specific improvement explanations const explanations = { ICDF: [ { added: &#x27;Instruction&#x27;, why: &#x27;Clearly defines the specific task, eliminating ambiguity&#x27; }, { added: &#x27;Context&#x27;, why: &#x27;Provides background so the AI understands the purpose and stakes&#x27; }, { added: &#x27;Data&#x27;, why: &#x27;Specifies exactly what information to analyze&#x27; }, { added: &#x27;Format&#x27;, why: &#x27;Ensures you get results in the exact structure you need&#x27; } ], RCREOC: [ { added: &#x27;Role&#x27;, why: &#x27;AI responds with the expertise and perspective of a professional&#x27; }, { added: &#x27;Context&#x27;, why: &#x27;Sets the real-world environment and stakes&#x27; }, { added: &#x27;Request&#x27;, why: &#x27;Defines specific deliverables expected from the expert&#x27; }, { added: &#x27;Examples&#x27;, why: &#x27;Guides the AI\&#x27;s reasoning process and output style&#x27; }, { added: &#x27;Output Format&#x27;, why: &#x27;Structures the response for maximum usability&#x27; }, { added: &#x27;Constraints&#x27;, why: &#x27;Keeps the expert focused on what matters most&#x27; } ], MICRO: [ { added: &#x27;Message&#x27;, why: &#x27;Establishes the core thesis and key takeaway&#x27; }, { added: &#x27;Intention&#x27;, why: &#x27;Drives the emotional tone and desired outcome&#x27; }, { added: &#x27;Audience&#x27;, why: &#x27;Shapes vocabulary, tone, and complexity level&#x27; }, { added: &#x27;Platform&#x27;, why: &#x27;Dictates format constraints and optimal structure&#x27; }, { added: &#x27;Rhythm&#x27;, why: &#x27;Determines pacing and delivery style&#x27; } ], COSTAR: [ { added: &#x27;Context&#x27;, why: &#x27;Sets the campaign stage and market situation&#x27; }, { added: &#x27;Offer&#x27;, why: &#x27;Crystal clear value proposition and deal&#x27; }, { added: &#x27;Style&#x27;, why: &#x27;Aligns with brand voice and audience expectations&#x27; }, { added: &#x27;Target&#x27;, why: &#x27;Enables hyper-relevant, personalized messaging&#x27; }, { added: &#x27;Action&#x27;, why: &#x27;Provides one clear, compelling call-to-action&#x27; }, { added: &#x27;Result&#x27;, why: &#x27;Aligns copy with business objectives&#x27; } ] }; return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: &#x27;ICDF Framework (Analytical)&#x27;, RCREOC: &#x27;RCREOC Framework (Expert Consultation)&#x27;, MICRO: &#x27;MICRO Framework (Content Creation)&#x27;, COSTAR: &#x27;COSTAR Framework (Marketing &amp; Sales)&#x27; }; return names[framework]; } 6. File Structure &amp; Implementation Directory Structure app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page (Quick-start wizard) โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout (uses site header/footer) โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”‚ โ”œโ”€โ”€ MultipleChoice.tsx # Button-based choices โ”‚ โ”‚ โ”œโ”€โ”€ TextInput.tsx # Text field with placeholder โ”‚ โ”‚ โ”œโ”€โ”€ Tooltip.tsx # Learning mode tooltips โ”‚ โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ”‚ โ”œโ”€โ”€ ImprovementsList.tsx # &quot;Why this matters&quot; explanations โ”‚ โ”‚ โ””โ”€โ”€ CopyButton.tsx # One-click copy functionality โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword analysis logic โ”‚ โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ types/ โ”‚ โ””โ”€โ”€ index.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ””โ”€โ”€ (reuse existing components: Button, Card, Input, Textarea, etc.) Key Component Implementations 1. QuickStartWizard.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { frameworkDetection } from &#x27;../lib/frameworkDetection&#x27;; export default function QuickStartWizard({ onSelect }: { onSelect: (framework: string) =&gt; void }) { return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-muted-foreground&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {Object.entries(frameworkDetection).map(([key, framework]) =&gt; ( &lt;Card key={key} className=&quot;p-6 cursor-pointer hover:shadow-lg transition-all hover:scale-105&quot; style={{ borderTop: `4px solid ${framework.color}` }} onClick={() =&gt; onSelect(key)} &gt; &lt;div className=&quot;text-5xl mb-4&quot;&gt;{framework.icon}&lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold mb-2&quot;&gt;{framework.title}&lt;/h3&gt; &lt;p className=&quot;text-sm text-muted-foreground&quot;&gt;{framework.subtitle}&lt;/p&gt; &lt;/Card&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-12 text-center&quot;&gt; &lt;p className=&quot;text-sm text-muted-foreground mb-4&quot;&gt; Not sure which one? Describe your goal and we&#x27;ll guide you. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } 2. PromptInput.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Textarea } from &#x27;@/components/ui/textarea&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { detectFramework } from &#x27;../lib/frameworkDetection&#x27;; interface PromptInputProps { selectedFramework?: string; onSubmit: (prompt: string, detectedFramework: string) =&gt; void; } export default function PromptInput({ selectedFramework, onSubmit }: PromptInputProps) { const [prompt, setPrompt] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { const framework = selectedFramework || detectFramework(prompt); onSubmit(prompt, framework); }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-8&quot;&gt; &lt;div className=&quot;mb-6&quot;&gt; &lt;label className=&quot;block text-lg font-medium mb-2&quot;&gt; Describe what you need in your own words &lt;/label&gt; &lt;Textarea value={prompt} onChange={(e) =&gt; setPrompt(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are performing best...&quot; rows={6} className=&quot;text-base&quot; /&gt; &lt;/div&gt; &lt;Button onClick={handleSubmit} disabled={prompt.trim().length &lt; 10} size=&quot;lg&quot; className=&quot;w-full&quot; &gt; Continue โ†’ &lt;/Button&gt; {selectedFramework &amp;&amp; ( &lt;p className=&quot;text-sm text-muted-foreground mt-4 text-center&quot;&gt; Using {frameworkDetection[selectedFramework].title} framework &lt;/p&gt; )} &lt;/div&gt; ); } 3. QuestionFlow.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { questionSets } from &#x27;../lib/questionSets&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { Progress } from &#x27;@/components/ui/progress&#x27;; interface QuestionFlowProps { framework: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export default function QuestionFlow({ framework, onComplete }: QuestionFlowProps) { const questions = questionSets[framework]; const [currentIndex, setCurrentIndex] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentIndex]; const progress = ((currentIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: value })); }; const handleNext = () =&gt; { // Apply smart default if skipped if (!answers[currentQuestion.id] &amp;&amp; currentQuestion.defaultValue) { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentIndex &lt; questions.length - 1) { setCurrentIndex(prev =&gt; prev + 1); } else { // Apply defaults to any remaining unanswered questions const finalAnswers = { ...answers }; questions.forEach(q =&gt; { if (!finalAnswers[q.id] &amp;&amp; q.defaultValue) { finalAnswers[q.id] = q.defaultValue; } }); onComplete(finalAnswers); } }; const handleBack = () =&gt; { if (currentIndex &gt; 0) { setCurrentIndex(prev =&gt; prev - 1); } }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-8&quot;&gt; &lt;Progress value={progress} className=&quot;mb-8&quot; /&gt; &lt;div className=&quot;mb-4 text-sm text-muted-foreground&quot;&gt; Question {currentIndex + 1} of {questions.length} &lt;/div&gt; &lt;QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(value) =&gt; handleAnswer(currentQuestion.id, value)} /&gt; &lt;div className=&quot;flex gap-4 mt-8&quot;&gt; {currentIndex &gt; 0 &amp;&amp; ( &lt;Button variant=&quot;outline&quot; onClick={handleBack} className=&quot;flex-1&quot; &gt; โ† Back &lt;/Button&gt; )} &lt;Button onClick={handleNext} className=&quot;flex-1&quot; &gt; {currentIndex &lt; questions.length - 1 ? &#x27;Next โ†’&#x27; : &#x27;Generate Prompt โœจ&#x27;} &lt;/Button&gt; &lt;/div&gt; {!answers[currentQuestion.id] &amp;&amp; currentQuestion.defaultValue &amp;&amp; ( &lt;p className=&quot;text-sm text-muted-foreground mt-4 text-center&quot;&gt; ๐Ÿ’ก Tip: Skip this if unsureโ€”we&#x27;ll use a smart default &lt;/p&gt; )} &lt;/div&gt; ); } 4. QuestionCard.tsx typescript &#x27;use client&#x27;; import { Textarea } from &#x27;@/components/ui/textarea&#x27;; import MultipleChoice from &#x27;./MultipleChoice&#x27;; import Tooltip from &#x27;./Tooltip&#x27;; interface QuestionCardProps { question: any; value: string; onChange: (value: string) =&gt; void; } export default function QuestionCard({ question, value, onChange }: QuestionCardProps) { return ( &lt;div className=&quot;bg-card rounded-lg border p-6&quot;&gt; &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;label className=&quot;text-lg font-medium&quot;&gt; {question.label} {question.required &amp;&amp; &lt;span className=&quot;text-destructive ml-1&quot;&gt;*&lt;/span&gt;} &lt;/label&gt; &lt;Tooltip content={question.tooltip} /&gt; &lt;/div&gt; {question.type === &#x27;textarea&#x27; ? ( &lt;Textarea value={value} onChange={(e) =&gt; onChange(e.target.value)} placeholder={question.placeholder} rows={4} className=&quot;text-base&quot; /&gt; ) : question.type === &#x27;multiple-choice&#x27; ? ( &lt;MultipleChoice options={question.options} value={value} onChange={onChange} /&gt; ) : null} &lt;/div&gt; ); } 5. BeforeAfter.tsx typescript &#x27;use client&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { Copy, Check } from &#x27;lucide-react&#x27;; import { useState } from &#x27;react&#x27;; import ImprovementsList from &#x27;./ImprovementsList&#x27;; interface BeforeAfterProps { original: string; professional: string; improvements: Array&lt;{ added: string; why: string }&gt;; frameworkName: string; onStartNew: () =&gt; void; } export default function BeforeAfter({ original, professional, improvements, frameworkName, onStartNew }: BeforeAfterProps) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-7xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;div className=&quot;inline-block bg-green-100 text-green-800 px-4 py-2 rounded-full mb-4&quot;&gt; โœ“ Your professional prompt is ready! &lt;/div&gt; &lt;h2 className=&quot;text-3xl font-bold mb-2&quot;&gt;Before &amp; After&lt;/h2&gt; &lt;p className=&quot;text-muted-foreground&quot;&gt;Using {frameworkName}&lt;/p&gt; &lt;/div&gt; {/* Desktop: Side by side */} &lt;div className=&quot;hidden md:grid md:grid-cols-2 gap-6 mb-8&quot;&gt; &lt;Card className=&quot;p-6&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 text-muted-foreground&quot;&gt; Your Original Prompt &lt;/h3&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-muted p-4 rounded&quot;&gt; {original} &lt;/div&gt; &lt;/Card&gt; &lt;Card className=&quot;p-6 border-2 border-primary&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-primary&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;Button onClick={handleCopy} size=&quot;sm&quot; variant=&quot;outline&quot; &gt; {copied ? &lt;Check className=&quot;w-4 h-4 mr-2&quot; /&gt; : &lt;Copy className=&quot;w-4 h-4 mr-2&quot; /&gt;} {copied ? &#x27;Copied!&#x27; : &#x27;Copy&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium&quot;&gt; {professional} &lt;/div&gt; &lt;/Card&gt; &lt;/div&gt; {/* Mobile: Stacked */} &lt;div className=&quot;md:hidden space-y-6 mb-8&quot;&gt; &lt;Card className=&quot;p-6&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 text-muted-foreground&quot;&gt; Your Original Prompt &lt;/h3&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-muted p-4 rounded&quot;&gt; {original} &lt;/div&gt; &lt;/Card&gt; &lt;Card className=&quot;p-6 border-2 border-primary&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-primary&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;Button onClick={handleCopy} size=&quot;sm&quot; variant=&quot;outline&quot; &gt; {copied ? &lt;Check className=&quot;w-4 h-4 mr-2&quot; /&gt; : &lt;Copy className=&quot;w-4 h-4 mr-2&quot; /&gt;} {copied ? &#x27;Copied!&#x27; : &#x27;Copy&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium&quot;&gt; {professional} &lt;/div&gt; &lt;/Card&gt; &lt;/div&gt; {/* Learning Mode: Improvements */} &lt;ImprovementsList improvements={improvements} /&gt; {/* Action Buttons */} &lt;div className=&quot;flex flex-col sm:flex-row gap-4 justify-center mt-8&quot;&gt; &lt;Button onClick={onStartNew} size=&quot;lg&quot;&gt; Create Another Prompt &lt;/Button&gt; &lt;Button onClick={handleCopy} variant=&quot;outline&quot; size=&quot;lg&quot;&gt; {copied ? &#x27;Copied!&#x27; : &#x27;Copy to Clipboard&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } 6. ImprovementsList.tsx typescript &#x27;use client&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { Lightbulb } from &#x27;lucide-react&#x27;; interface ImprovementsListProps { improvements: Array&lt;{ added: string; why: string }&gt;; } export default function ImprovementsList({ improvements }: ImprovementsListProps) { return ( &lt;Card className=&quot;p-6 bg-blue-50 border-blue-200&quot;&gt; &lt;div className=&quot;flex items-center gap-2 mb-4&quot;&gt; &lt;Lightbulb className=&quot;w-5 h-5 text-blue-600&quot; /&gt; &lt;h3 className=&quot;text-lg font-semibold text-blue-900&quot;&gt; What Makes This Prompt Professional? &lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;space-y-3&quot;&gt; {improvements.map((item, index) =&gt; ( &lt;div key={index} className=&quot;flex gap-3&quot;&gt; &lt;div className=&quot;flex-shrink-0 w-6 h-6 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm font-bold&quot;&gt; {index + 1} &lt;/div&gt; &lt;div&gt; &lt;div className=&quot;font-medium text-blue-900&quot;&gt;{item.added}&lt;/div&gt; &lt;div className=&quot;text-sm text-blue-700&quot;&gt;{item.why}&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/Card&gt; ); } 7. Analytics Implementation lib/analytics.ts typescript &#x27;use client&#x27;; interface AnalyticsEvent { event: string; framework?: string; completed?: boolean; timestamp: number; } export function trackFrameworkSelection(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; // Send to your analytics service (Google Analytics, Plausible, etc.) if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;framework_selected&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } // Also store locally for admin dashboard saveToLocalAnalytics({ event: &#x27;framework_selected&#x27;, framework, timestamp: Date.now() }); } export function trackPromptCompleted(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;prompt_completed&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } saveToLocalAnalytics({ event: &#x27;prompt_completed&#x27;, framework, completed: true, timestamp: Date.now() }); } export function trackPromptCopied(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;prompt_copied&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } } function saveToLocalAnalytics(event: AnalyticsEvent) { // Store in localStorage for simple analytics dashboard const key = &#x27;prompt_generator_analytics&#x27;; const existing = localStorage.getItem(key); const data = existing ? JSON.parse(existing) : []; data.push(event); // Keep only last 1000 events if (data.length &gt; 1000) { data.shift(); } localStorage.setItem(key, JSON.stringify(data)); } // Admin dashboard helper export function getAnalyticsSummary() { if (typeof window === &#x27;undefined&#x27;) return null; const key = &#x27;prompt_generator_analytics&#x27;; const data = localStorage.getItem(key); if (!data) return null; const events = JSON.parse(data); const summary = { totalSessions: events.filter(e =&gt; e.event === &#x27;framework_selected&#x27;).length, completedPrompts: events.filter(e =&gt; e.event === &#x27;prompt_completed&#x27;).length, frameworkUsage: { ICDF: events.filter(e =&gt; e.framework === &#x27;ICDF&#x27;).length, RCREOC: events.filter(e =&gt; e.framework === &#x27;RCREOC&#x27;).length, MICRO: events.filter(e =&gt; e.framework === &#x27;MICRO&#x27;).length, COSTAR: events.filter(e =&gt; e.framework === &#x27;COSTAR&#x27;).length }, completionRate: 0 }; summary.completionRate = summary.totalSessions &gt; 0 ? (summary.completedPrompts / summary.totalSessions) * 100 : 0; return summary; } 8. Main Page Implementation app/prompt-generator/page.tsx typescript &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import QuickStartWizard from &#x27;./components/QuickStartWizard&#x27;; import PromptInput from &#x27;./components/PromptInput&#x27;; import QuestionFlow from &#x27;./components/QuestionFlow&#x27;; import BeforeAfter from &#x27;./components/BeforeAfter&#x27;; import { generateComparison } from &#x27;./lib/promptTemplates&#x27;; import { trackFrameworkSelection, trackPromptCompleted } from &#x27;./lib/analytics&#x27;; type Step = &#x27;wizard&#x27; | &#x27;input&#x27; | &#x27;questions&#x27; | &#x27;result&#x27;; export default function PromptGeneratorPage() { const [step, setStep] = useState&lt;Step&gt;(&#x27;wizard&#x27;); const [selectedFramework, setSelectedFramework] = useState&lt;string | null&gt;(null); const [originalPrompt, setOriginalPrompt] = useState(&#x27;&#x27;); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [result, setResult] = useState&lt;any&gt;(null); const handleFrameworkSelect = (framework: string) =&gt; { setSelectedFramework(framework); setStep(&#x27;input&#x27;); trackFrameworkSelection(framework); }; const handlePromptSubmit = (prompt: string, detectedFramework: string) =&gt; { setOriginalPrompt(prompt); setSelectedFramework(detectedFramework); setStep(&#x27;questions&#x27;); }; const handleQuestionsComplete = (questionAnswers: Record&lt;string, string&gt;) =&gt; { setAnswers(questionAnswers); const comparison = generateComparison( originalPrompt, selectedFramework!, questionAnswers ); setResult(comparison); setStep(&#x27;result&#x27;); trackPromptCompleted(selectedFramework!); }; const handleStartNew = () =&gt; { setStep(&#x27;wizard&#x27;); setSelectedFramework(null); setOriginalPrompt(&#x27;&#x27;); setAnswers({}); setResult(null); }; return ( &lt;div className=&quot;min-h-screen bg-background&quot;&gt; {step === &#x27;wizard&#x27; &amp;&amp; ( &lt;QuickStartWizard onSelect={handleFrameworkSelect} /&gt; )} {step === &#x27;input&#x27; &amp;&amp; ( &lt;PromptInput selectedFramework={selectedFramework || undefined} onSubmit={handlePromptSubmit} /&gt; )} {step === &#x27;questions&#x27; &amp;&amp; selectedFramework &amp;&amp; ( &lt;QuestionFlow framework={selectedFramework} onComplete={handleQuestionsComplete} /&gt; )} {step === &#x27;result&#x27; &amp;&amp; result &amp;&amp; ( &lt;BeforeAfter original={result.original} professional={result.professional} improvements={result.improvements} frameworkName={result.frameworkName} onStartNew={handleStartNew} /&gt; )} &lt;/div&gt; ); } 9. TypeScript Interfaces app/prompt-generator/types/index.ts typescript export interface Framework { keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: QuestionOption[]; } export interface QuestionOption { value: string; label: string; hasTextField?: boolean; } export interface PromptComparison { original: string; professional: string; improvements: Improvement[]; framework: string; frameworkName: string; } export interface Improvement { added: string; why: string; } export interface AnalyticsSummary { totalSessions: number; completedPrompts: number; frameworkUsage: { ICDF: number; RCREOC: number; MICRO: number; COSTAR: number; }; completionRate: number; } 10. Integration with Existing Site Navigation Update Add to your main navigation: typescript // In your navigation component const navItems = [ { name: &#x27;Photo Tools&#x27;, href: &#x27;/&#x27; }, { name: &#x27;AI Prompt Generator&#x27;, href: &#x27;/prompt-generator&#x27; }, // NEW { name: &#x27;Blog&#x27;, href: &#x27;/blog&#x27; }, // ... other items ]; SEO &amp; Metadata typescript // app/prompt-generator/layout.tsx import type { Metadata } from &#x27;next&#x27;; export const metadata: Metadata = { title: &#x27;AI Prompt Generator | Modern Photo Tools&#x27;, description: &#x27;Transform your simple AI ideas into professional prompts using proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Free tool for better AI results.&#x27;, keywords: [&#x27;AI prompts&#x27;, &#x27;prompt engineering&#x27;, &#x27;ChatGPT prompts&#x27;, &#x27;Midjourney prompts&#x27;, &#x27;AI tools&#x27;], openGraph: { title: &#x27;AI Prompt Generator - Get Professional Results&#x27;, description: &#x27;Free tool that transforms amateur prompts into professional-grade AI instructions&#x27;, type: &#x27;website&#x27;, } }; export default function PromptGeneratorLayout({ children, }: { children: React.ReactNode; }) { return &lt;&gt;{children}&lt;/&gt;; } 11. Testing Checklist Functional Testing Framework detection works correctly for all 4 types All question types render properly (textarea, multiple-choice) Smart defaults apply when questions are skipped Before/After displays correctly on desktop and mobile Copy button works and shows feedback &quot;Start Another&quot; resets the flow completely Tooltips display on hover/click Analytics events fire correctly UX Testing Wizard cards are visually distinct and clickable Questions flow smoothly with back/next buttons Progress bar updates accurately Mobile experience is smooth (stacked layout) Loading states (if any) are clear Error states handled gracefully Content Testing All tooltips are helpful and concise Framework explanations are accurate Example placeholders are realistic Improvement explanations make sense Generated prompts are well-formatted 12. Launch Checklist Pre-Launch Test on multiple browsers (Chrome, Safari, Firefox) Test on mobile devices (iOS, Android) Verify analytics tracking works Add Google Analytics / Plausible event tracking Create social media preview images Write launch blog post explaining the tool Set up simple admin dashboard to view analytics Post-Launch Monitor analytics for usage patterns Collect user feedback Identify most-used frameworks Track completion rates Iterate on question sets based on data Consider adding more frameworks if needed 13. Future Enhancements (Optional) Phase 2 Features Prompt Templates Library Pre-built prompts users can customize &quot;Photography prompt templates&quot; &quot;Marketing email templates&quot; Save &amp; Share Generate shareable links to prompts &quot;Share this prompt&quot; button No login required, just URL-based AI Provider Optimization Toggle: &quot;Optimize for ChatGPT / Claude / Gemini / Midjourney&quot; Slight variations in prompt structure Prompt History (LocalStorage) Save last 10 prompts in browser Quick access to previous work Still no login required Advanced Mode &quot;Show all questions&quot; toggle Manual framework selection override Custom framework creation 14. Cost Analysis Development Time Estimate Setup &amp; Configuration: 2-3 hours Core Components: 8-10 hours Question Sets &amp; Logic: 4-5 hours Before/After UI: 3-4 hours Analytics Integration: 2-3 hours Testing &amp; Polish: 4-5 hours Total: 23-30 hours Ongoing Costs Hosting: $0 (uses existing Next.js deployment) API Calls: $0 (rule-based, JavaScript JavaScriptโ€ข 20 lines Craft content that clearly communicates the message, achieves the intention, and resonates with the target audience in the appropriate tone. `.trim(), COSTAR: (answers) =&gt; ` **Context:** ${answers.context} **Offer:** ${answers.offer} **Style:** The copy should have a ${answers.style} tone and style. **Target Audience:** ${answers.target} **Action:** The primary call-to-action is: ${answers.action} **Result:** The business goal is to ${answers.result} ${answers.urgency !== &#x27;none&#x27; ? `**Urgency Factor:** ${answers.urgency}\n` : &#x27;&#x27;} Write persuasive marketing copy that speaks directly to the target audience, clearly presents the offer, and drives them to take action. `.trim() }; This code can be executed in the preview sandbox Run Code JavaScript JavaScriptโ€ข 60 lines function generateComparison(originalPrompt, framework, answers) { const professionalPrompt = promptTemplates[framework](answers); return { original: originalPrompt, professional: professionalPrompt, improvements: generateImprovements(framework, answers), framework: framework, frameworkName: getFrameworkName(framework) }; } function generateImprovements(framework, answers) { const improvements = []; // Framework-specific improvement explanations const explanations = { ICDF: [ { added: &#x27;Instruction&#x27;, why: &#x27;Clearly defines the specific task, eliminating ambiguity&#x27; }, { added: &#x27;Context&#x27;, why: &#x27;Provides background so the AI understands the purpose and stakes&#x27; }, { added: &#x27;Data&#x27;, why: &#x27;Specifies exactly what information to analyze&#x27; }, { added: &#x27;Format&#x27;, why: &#x27;Ensures you get results in the exact structure you need&#x27; } ], RCREOC: [ { added: &#x27;Role&#x27;, why: &#x27;AI responds with the expertise and perspective of a professional&#x27; }, { added: &#x27;Context&#x27;, why: &#x27;Sets the real-world environment and stakes&#x27; }, { added: &#x27;Request&#x27;, why: &#x27;Defines specific deliverables expected from the expert&#x27; }, { added: &#x27;Examples&#x27;, why: &#x27;Guides the AI\&#x27;s reasoning process and output style&#x27; }, { added: &#x27;Output Format&#x27;, why: &#x27;Structures the response for maximum usability&#x27; }, { added: &#x27;Constraints&#x27;, why: &#x27;Keeps the expert focused on what matters most&#x27; } ], MICRO: [ { added: &#x27;Message&#x27;, why: &#x27;Establishes the core thesis and key takeaway&#x27; }, { added: &#x27;Intention&#x27;, why: &#x27;Drives the emotional tone and desired outcome&#x27; }, { added: &#x27;Audience&#x27;, why: &#x27;Shapes vocabulary, tone, and complexity level&#x27; }, { added: &#x27;Platform&#x27;, why: &#x27;Dictates format constraints and optimal structure&#x27; }, { added: &#x27;Rhythm&#x27;, why: &#x27;Determines pacing and delivery style&#x27; } ], COSTAR: [ { added: &#x27;Context&#x27;, why: &#x27;Sets the campaign stage and market situation&#x27; }, { added: &#x27;Offer&#x27;, why: &#x27;Crystal clear value proposition and deal&#x27; }, { added: &#x27;Style&#x27;, why: &#x27;Aligns with brand voice and audience expectations&#x27; }, { added: &#x27;Target&#x27;, why: &#x27;Enables hyper-relevant, personalized messaging&#x27; }, { added: &#x27;Action&#x27;, why: &#x27;Provides one clear, compelling call-to-action&#x27; }, { added: &#x27;Result&#x27;, why: &#x27;Aligns copy with business objectives&#x27; } ] }; return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: &#x27;ICDF Framework (Analytical)&#x27;, RCREOC: &#x27;RCREOC Framework (Expert Consultation)&#x27;, MICRO: &#x27;MICRO Framework (Content Creation)&#x27;, COSTAR: &#x27;COSTAR Framework (Marketing &amp; Sales)&#x27; }; return names[framework]; } This code can be executed in the preview sandbox Run Code Code Snippet 3 Plain Textโ€ข 26 lines app/ โ”œโ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page (Quick-start wizard) โ”‚ โ”œโ”€โ”€ layout.tsx # Shared layout (uses site header/footer) โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-card framework selector โ”‚ โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”‚ โ”œโ”€โ”€ QuestionFlow.tsx # Adaptive questionnaire โ”‚ โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”‚ โ”œโ”€โ”€ MultipleChoice.tsx # Button-based choices โ”‚ โ”‚ โ”œโ”€โ”€ TextInput.tsx # Text field with placeholder โ”‚ โ”‚ โ”œโ”€โ”€ Tooltip.tsx # Learning mode tooltips โ”‚ โ”‚ โ”œโ”€โ”€ BeforeAfter.tsx # Comparison display โ”‚ โ”‚ โ”œโ”€โ”€ ImprovementsList.tsx # &quot;Why this matters&quot; explanations โ”‚ โ”‚ โ””โ”€โ”€ CopyButton.tsx # One-click copy functionality โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ”‚ โ”œโ”€โ”€ frameworkDetection.ts # Keyword analysis logic โ”‚ โ”‚ โ”œโ”€โ”€ questionSets.ts # All framework questions โ”‚ โ”‚ โ”œโ”€โ”€ promptTemplates.ts # Assembly logic โ”‚ โ”‚ โ””โ”€โ”€ analytics.ts # Usage tracking โ”‚ โ””โ”€โ”€ types/ โ”‚ โ””โ”€โ”€ index.ts # TypeScript interfaces components/ โ””โ”€โ”€ ui/ โ””โ”€โ”€ (reuse existing components: Button, Card, Input, Textarea, etc.) TypeScript TypeScriptโ€ข 41 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { frameworkDetection } from &#x27;../lib/frameworkDetection&#x27;; export default function QuickStartWizard({ onSelect }: { onSelect: (framework: string) =&gt; void }) { return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold mb-4&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-muted-foreground&quot;&gt; Transform your simple idea into a professional AI prompt in 60 seconds &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {Object.entries(frameworkDetection).map(([key, framework]) =&gt; ( &lt;Card key={key} className=&quot;p-6 cursor-pointer hover:shadow-lg transition-all hover:scale-105&quot; style={{ borderTop: `4px solid ${framework.color}` }} onClick={() =&gt; onSelect(key)} &gt; &lt;div className=&quot;text-5xl mb-4&quot;&gt;{framework.icon}&lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold mb-2&quot;&gt;{framework.title}&lt;/h3&gt; &lt;p className=&quot;text-sm text-muted-foreground&quot;&gt;{framework.subtitle}&lt;/p&gt; &lt;/Card&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-12 text-center&quot;&gt; &lt;p className=&quot;text-sm text-muted-foreground mb-4&quot;&gt; Not sure which one? Describe your goal and we&#x27;ll guide you. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 52 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { Textarea } from &#x27;@/components/ui/textarea&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { detectFramework } from &#x27;../lib/frameworkDetection&#x27;; interface PromptInputProps { selectedFramework?: string; onSubmit: (prompt: string, detectedFramework: string) =&gt; void; } export default function PromptInput({ selectedFramework, onSubmit }: PromptInputProps) { const [prompt, setPrompt] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { const framework = selectedFramework || detectFramework(prompt); onSubmit(prompt, framework); }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-8&quot;&gt; &lt;div className=&quot;mb-6&quot;&gt; &lt;label className=&quot;block text-lg font-medium mb-2&quot;&gt; Describe what you need in your own words &lt;/label&gt; &lt;Textarea value={prompt} onChange={(e) =&gt; setPrompt(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are performing best...&quot; rows={6} className=&quot;text-base&quot; /&gt; &lt;/div&gt; &lt;Button onClick={handleSubmit} disabled={prompt.trim().length &lt; 10} size=&quot;lg&quot; className=&quot;w-full&quot; &gt; Continue โ†’ &lt;/Button&gt; {selectedFramework &amp;&amp; ( &lt;p className=&quot;text-sm text-muted-foreground mt-4 text-center&quot;&gt; Using {frameworkDetection[selectedFramework].title} framework &lt;/p&gt; )} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 95 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { questionSets } from &#x27;../lib/questionSets&#x27;; import QuestionCard from &#x27;./QuestionCard&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { Progress } from &#x27;@/components/ui/progress&#x27;; interface QuestionFlowProps { framework: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export default function QuestionFlow({ framework, onComplete }: QuestionFlowProps) { const questions = questionSets[framework]; const [currentIndex, setCurrentIndex] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const currentQuestion = questions[currentIndex]; const progress = ((currentIndex + 1) / questions.length) * 100; const handleAnswer = (questionId: string, value: string) =&gt; { setAnswers(prev =&gt; ({ ...prev, [questionId]: value })); }; const handleNext = () =&gt; { // Apply smart default if skipped if (!answers[currentQuestion.id] &amp;&amp; currentQuestion.defaultValue) { setAnswers(prev =&gt; ({ ...prev, [currentQuestion.id]: currentQuestion.defaultValue })); } if (currentIndex &lt; questions.length - 1) { setCurrentIndex(prev =&gt; prev + 1); } else { // Apply defaults to any remaining unanswered questions const finalAnswers = { ...answers }; questions.forEach(q =&gt; { if (!finalAnswers[q.id] &amp;&amp; q.defaultValue) { finalAnswers[q.id] = q.defaultValue; } }); onComplete(finalAnswers); } }; const handleBack = () =&gt; { if (currentIndex &gt; 0) { setCurrentIndex(prev =&gt; prev - 1); } }; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-8&quot;&gt; &lt;Progress value={progress} className=&quot;mb-8&quot; /&gt; &lt;div className=&quot;mb-4 text-sm text-muted-foreground&quot;&gt; Question {currentIndex + 1} of {questions.length} &lt;/div&gt; &lt;QuestionCard question={currentQuestion} value={answers[currentQuestion.id] || &#x27;&#x27;} onChange={(value) =&gt; handleAnswer(currentQuestion.id, value)} /&gt; &lt;div className=&quot;flex gap-4 mt-8&quot;&gt; {currentIndex &gt; 0 &amp;&amp; ( &lt;Button variant=&quot;outline&quot; onClick={handleBack} className=&quot;flex-1&quot; &gt; โ† Back &lt;/Button&gt; )} &lt;Button onClick={handleNext} className=&quot;flex-1&quot; &gt; {currentIndex &lt; questions.length - 1 ? &#x27;Next โ†’&#x27; : &#x27;Generate Prompt โœจ&#x27;} &lt;/Button&gt; &lt;/div&gt; {!answers[currentQuestion.id] &amp;&amp; currentQuestion.defaultValue &amp;&amp; ( &lt;p className=&quot;text-sm text-muted-foreground mt-4 text-center&quot;&gt; ๐Ÿ’ก Tip: Skip this if unsureโ€”we&#x27;ll use a smart default &lt;/p&gt; )} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 42 lines &#x27;use client&#x27;; import { Textarea } from &#x27;@/components/ui/textarea&#x27;; import MultipleChoice from &#x27;./MultipleChoice&#x27;; import Tooltip from &#x27;./Tooltip&#x27;; interface QuestionCardProps { question: any; value: string; onChange: (value: string) =&gt; void; } export default function QuestionCard({ question, value, onChange }: QuestionCardProps) { return ( &lt;div className=&quot;bg-card rounded-lg border p-6&quot;&gt; &lt;div className=&quot;flex items-start justify-between mb-4&quot;&gt; &lt;label className=&quot;text-lg font-medium&quot;&gt; {question.label} {question.required &amp;&amp; &lt;span className=&quot;text-destructive ml-1&quot;&gt;*&lt;/span&gt;} &lt;/label&gt; &lt;Tooltip content={question.tooltip} /&gt; &lt;/div&gt; {question.type === &#x27;textarea&#x27; ? ( &lt;Textarea value={value} onChange={(e) =&gt; onChange(e.target.value)} placeholder={question.placeholder} rows={4} className=&quot;text-base&quot; /&gt; ) : question.type === &#x27;multiple-choice&#x27; ? ( &lt;MultipleChoice options={question.options} value={value} onChange={onChange} /&gt; ) : null} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 118 lines &#x27;use client&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { Button } from &#x27;@/components/ui/button&#x27;; import { Copy, Check } from &#x27;lucide-react&#x27;; import { useState } from &#x27;react&#x27;; import ImprovementsList from &#x27;./ImprovementsList&#x27;; interface BeforeAfterProps { original: string; professional: string; improvements: Array&lt;{ added: string; why: string }&gt;; frameworkName: string; onStartNew: () =&gt; void; } export default function BeforeAfter({ original, professional, improvements, frameworkName, onStartNew }: BeforeAfterProps) { const [copied, setCopied] = useState(false); const handleCopy = async () =&gt; { await navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-7xl mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;div className=&quot;inline-block bg-green-100 text-green-800 px-4 py-2 rounded-full mb-4&quot;&gt; โœ“ Your professional prompt is ready! &lt;/div&gt; &lt;h2 className=&quot;text-3xl font-bold mb-2&quot;&gt;Before &amp; After&lt;/h2&gt; &lt;p className=&quot;text-muted-foreground&quot;&gt;Using {frameworkName}&lt;/p&gt; &lt;/div&gt; {/* Desktop: Side by side */} &lt;div className=&quot;hidden md:grid md:grid-cols-2 gap-6 mb-8&quot;&gt; &lt;Card className=&quot;p-6&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 text-muted-foreground&quot;&gt; Your Original Prompt &lt;/h3&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-muted p-4 rounded&quot;&gt; {original} &lt;/div&gt; &lt;/Card&gt; &lt;Card className=&quot;p-6 border-2 border-primary&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-primary&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;Button onClick={handleCopy} size=&quot;sm&quot; variant=&quot;outline&quot; &gt; {copied ? &lt;Check className=&quot;w-4 h-4 mr-2&quot; /&gt; : &lt;Copy className=&quot;w-4 h-4 mr-2&quot; /&gt;} {copied ? &#x27;Copied!&#x27; : &#x27;Copy&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium&quot;&gt; {professional} &lt;/div&gt; &lt;/Card&gt; &lt;/div&gt; {/* Mobile: Stacked */} &lt;div className=&quot;md:hidden space-y-6 mb-8&quot;&gt; &lt;Card className=&quot;p-6&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4 text-muted-foreground&quot;&gt; Your Original Prompt &lt;/h3&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-muted p-4 rounded&quot;&gt; {original} &lt;/div&gt; &lt;/Card&gt; &lt;Card className=&quot;p-6 border-2 border-primary&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-primary&quot;&gt; โœจ Professional Version &lt;/h3&gt; &lt;Button onClick={handleCopy} size=&quot;sm&quot; variant=&quot;outline&quot; &gt; {copied ? &lt;Check className=&quot;w-4 h-4 mr-2&quot; /&gt; : &lt;Copy className=&quot;w-4 h-4 mr-2&quot; /&gt;} {copied ? &#x27;Copied!&#x27; : &#x27;Copy&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;div className=&quot;text-sm whitespace-pre-wrap bg-primary/5 p-4 rounded font-medium&quot;&gt; {professional} &lt;/div&gt; &lt;/Card&gt; &lt;/div&gt; {/* Learning Mode: Improvements */} &lt;ImprovementsList improvements={improvements} /&gt; {/* Action Buttons */} &lt;div className=&quot;flex flex-col sm:flex-row gap-4 justify-center mt-8&quot;&gt; &lt;Button onClick={onStartNew} size=&quot;lg&quot;&gt; Create Another Prompt &lt;/Button&gt; &lt;Button onClick={handleCopy} variant=&quot;outline&quot; size=&quot;lg&quot;&gt; {copied ? &#x27;Copied!&#x27; : &#x27;Copy to Clipboard&#x27;} &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 35 lines &#x27;use client&#x27;; import { Card } from &#x27;@/components/ui/card&#x27;; import { Lightbulb } from &#x27;lucide-react&#x27;; interface ImprovementsListProps { improvements: Array&lt;{ added: string; why: string }&gt;; } export default function ImprovementsList({ improvements }: ImprovementsListProps) { return ( &lt;Card className=&quot;p-6 bg-blue-50 border-blue-200&quot;&gt; &lt;div className=&quot;flex items-center gap-2 mb-4&quot;&gt; &lt;Lightbulb className=&quot;w-5 h-5 text-blue-600&quot; /&gt; &lt;h3 className=&quot;text-lg font-semibold text-blue-900&quot;&gt; What Makes This Prompt Professional? &lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;space-y-3&quot;&gt; {improvements.map((item, index) =&gt; ( &lt;div key={index} className=&quot;flex gap-3&quot;&gt; &lt;div className=&quot;flex-shrink-0 w-6 h-6 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm font-bold&quot;&gt; {index + 1} &lt;/div&gt; &lt;div&gt; &lt;div className=&quot;font-medium text-blue-900&quot;&gt;{item.added}&lt;/div&gt; &lt;div className=&quot;text-sm text-blue-700&quot;&gt;{item.why}&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/Card&gt; ); } TypeScript TypeScriptโ€ข 100 lines &#x27;use client&#x27;; interface AnalyticsEvent { event: string; framework?: string; completed?: boolean; timestamp: number; } export function trackFrameworkSelection(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; // Send to your analytics service (Google Analytics, Plausible, etc.) if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;framework_selected&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } // Also store locally for admin dashboard saveToLocalAnalytics({ event: &#x27;framework_selected&#x27;, framework, timestamp: Date.now() }); } export function trackPromptCompleted(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;prompt_completed&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } saveToLocalAnalytics({ event: &#x27;prompt_completed&#x27;, framework, completed: true, timestamp: Date.now() }); } export function trackPromptCopied(framework: string) { if (typeof window === &#x27;undefined&#x27;) return; if (window.gtag) { window.gtag(&#x27;event&#x27;, &#x27;prompt_copied&#x27;, { framework: framework, page: &#x27;/prompt-generator&#x27; }); } } function saveToLocalAnalytics(event: AnalyticsEvent) { // Store in localStorage for simple analytics dashboard const key = &#x27;prompt_generator_analytics&#x27;; const existing = localStorage.getItem(key); const data = existing ? JSON.parse(existing) : []; data.push(event); // Keep only last 1000 events if (data.length &gt; 1000) { data.shift(); } localStorage.setItem(key, JSON.stringify(data)); } // Admin dashboard helper export function getAnalyticsSummary() { if (typeof window === &#x27;undefined&#x27;) return null; const key = &#x27;prompt_generator_analytics&#x27;; const data = localStorage.getItem(key); if (!data) return null; const events = JSON.parse(data); const summary = { totalSessions: events.filter(e =&gt; e.event === &#x27;framework_selected&#x27;).length, completedPrompts: events.filter(e =&gt; e.event === &#x27;prompt_completed&#x27;).length, frameworkUsage: { ICDF: events.filter(e =&gt; e.framework === &#x27;ICDF&#x27;).length, RCREOC: events.filter(e =&gt; e.framework === &#x27;RCREOC&#x27;).length, MICRO: events.filter(e =&gt; e.framework === &#x27;MICRO&#x27;).length, COSTAR: events.filter(e =&gt; e.framework === &#x27;COSTAR&#x27;).length }, completionRate: 0 }; summary.completionRate = summary.totalSessions &gt; 0 ? (summary.completedPrompts / summary.totalSessions) * 100 : 0; return summary; } TypeScript TypeScriptโ€ข 85 lines &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import QuickStartWizard from &#x27;./components/QuickStartWizard&#x27;; import PromptInput from &#x27;./components/PromptInput&#x27;; import QuestionFlow from &#x27;./components/QuestionFlow&#x27;; import BeforeAfter from &#x27;./components/BeforeAfter&#x27;; import { generateComparison } from &#x27;./lib/promptTemplates&#x27;; import { trackFrameworkSelection, trackPromptCompleted } from &#x27;./lib/analytics&#x27;; type Step = &#x27;wizard&#x27; | &#x27;input&#x27; | &#x27;questions&#x27; | &#x27;result&#x27;; export default function PromptGeneratorPage() { const [step, setStep] = useState&lt;Step&gt;(&#x27;wizard&#x27;); const [selectedFramework, setSelectedFramework] = useState&lt;string | null&gt;(null); const [originalPrompt, setOriginalPrompt] = useState(&#x27;&#x27;); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const [result, setResult] = useState&lt;any&gt;(null); const handleFrameworkSelect = (framework: string) =&gt; { setSelectedFramework(framework); setStep(&#x27;input&#x27;); trackFrameworkSelection(framework); }; const handlePromptSubmit = (prompt: string, detectedFramework: string) =&gt; { setOriginalPrompt(prompt); setSelectedFramework(detectedFramework); setStep(&#x27;questions&#x27;); }; const handleQuestionsComplete = (questionAnswers: Record&lt;string, string&gt;) =&gt; { setAnswers(questionAnswers); const comparison = generateComparison( originalPrompt, selectedFramework!, questionAnswers ); setResult(comparison); setStep(&#x27;result&#x27;); trackPromptCompleted(selectedFramework!); }; const handleStartNew = () =&gt; { setStep(&#x27;wizard&#x27;); setSelectedFramework(null); setOriginalPrompt(&#x27;&#x27;); setAnswers({}); setResult(null); }; return ( &lt;div className=&quot;min-h-screen bg-background&quot;&gt; {step === &#x27;wizard&#x27; &amp;&amp; ( &lt;QuickStartWizard onSelect={handleFrameworkSelect} /&gt; )} {step === &#x27;input&#x27; &amp;&amp; ( &lt;PromptInput selectedFramework={selectedFramework || undefined} onSubmit={handlePromptSubmit} /&gt; )} {step === &#x27;questions&#x27; &amp;&amp; selectedFramework &amp;&amp; ( &lt;QuestionFlow framework={selectedFramework} onComplete={handleQuestionsComplete} /&gt; )} {step === &#x27;result&#x27; &amp;&amp; result &amp;&amp; ( &lt;BeforeAfter original={result.original} professional={result.professional} improvements={result.improvements} frameworkName={result.frameworkName} onStartNew={handleStartNew} /&gt; )} &lt;/div&gt; ); } TypeScript TypeScriptโ€ข 49 lines export interface Framework { keywords: string[]; icon: string; color: string; title: string; subtitle: string; } export interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: QuestionOption[]; } export interface QuestionOption { value: string; label: string; hasTextField?: boolean; } export interface PromptComparison { original: string; professional: string; improvements: Improvement[]; framework: string; frameworkName: string; } export interface Improvement { added: string; why: string; } export interface AnalyticsSummary { totalSessions: number; completedPrompts: number; frameworkUsage: { ICDF: number; RCREOC: number; MICRO: number; COSTAR: number; }; completionRate: number; } TypeScript TypeScriptโ€ข 7 lines // In your navigation component const navItems = [ { name: &#x27;Photo Tools&#x27;, href: &#x27;/&#x27; }, { name: &#x27;AI Prompt Generator&#x27;, href: &#x27;/prompt-generator&#x27; }, // NEW { name: &#x27;Blog&#x27;, href: &#x27;/blog&#x27; }, // ... other items ]; TypeScript TypeScriptโ€ข 21 lines // app/prompt-generator/layout.tsx import type { Metadata } from &#x27;next&#x27;; export const metadata: Metadata = { title: &#x27;AI Prompt Generator | Modern Photo Tools&#x27;, description: &#x27;Transform your simple AI ideas into professional prompts using proven frameworks (ICDF, RCREOC, MICRO, COSTAR). Free tool for better AI results.&#x27;, keywords: [&#x27;AI prompts&#x27;, &#x27;prompt engineering&#x27;, &#x27;ChatGPT prompts&#x27;, &#x27;Midjourney prompts&#x27;, &#x27;AI tools&#x27;], openGraph: { title: &#x27;AI Prompt Generator - Get Professional Results&#x27;, description: &#x27;Free tool that transforms amateur prompts into professional-grade AI instructions&#x27;, type: &#x27;website&#x27;, } }; export default function PromptGeneratorLayout({ children, }: { children: React.ReactNode; }) { return &lt;&gt;{children}&lt;/&gt;; } Used 113 credits javascript return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: &#x27;ICDF Framework (Instruction, Context, Data, Format)&#x27;, RCREOC: &#x27;RCREOC Framework (Role, Context, Request, Examples, Output, Constraints)&#x27;, MICRO: &#x27;MICRO Framework (Message, Intention, Context, Rhythm, Output)&#x27;, COSTAR: &#x27;COSTAR Framework (Context, Offer, Style, Target, Action, Result)&#x27; }; return names[framework]; } 6. Database Schema Since this is a no-login, free tool, we only need minimal tracking for analytics. prisma // Add to your existing schema.prisma model PromptGeneration { id String @id @default(cuid()) // Analytics data framework String // ICDF, RCREOC, MICRO, COSTAR completed Boolean @default(false) // Anonymized tracking sessionId String // Browser fingerprint or session ID ipHash String? // Hashed IP for rate limiting // Metadata createdAt DateTime @default(now()) userAgent String? @@index([framework]) @@index([createdAt]) @@index([ipHash]) } model PromptAnalytics { id String @id @default(cuid()) date DateTime @default(now()) // Daily aggregates totalGenerations Int @default(0) icdfCount Int @default(0) rcreocCount Int @default(0) microCount Int @default(0) costarCount Int @default(0) completionRate Float @default(0) // Percentage who completed vs abandoned @@unique([date]) } 7. File Structure src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page with wizard โ”‚ โ”œโ”€โ”€ layout.tsx # Shares main site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-button framework selector โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionnaireFlow.tsx # Adaptive question system โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover tooltip component โ”‚ โ””โ”€โ”€ FrameworkIcon.tsx # Visual icons for each framework โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworks.ts # Framework definitions &amp; questions โ”‚ โ”œโ”€โ”€ detection.ts # Keyword detection logic โ”‚ โ”œโ”€โ”€ templates.ts # Prompt assembly templates โ”‚ โ”œโ”€โ”€ analytics.ts # Analytics tracking functions โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ generate/ โ”‚ โ””โ”€โ”€ route.ts # POST: Generate professional prompt โ””โ”€โ”€ analytics/ โ””โ”€โ”€ route.ts # POST: Track usage (anonymous) 8. Component Specifications 8.1 QuickStartWizard Component tsx // src/app/prompt-generator/components/QuickStartWizard.tsx import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface WizardCardProps { framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; onSelect: (framework: string) =&gt; void; } const WizardCard: React.FC&lt;WizardCardProps&gt; = ({ framework, onSelect }) =&gt; { const config = frameworkDetection[framework]; return ( &lt;button onClick={() =&gt; onSelect(framework)} className=&quot;group relative p-8 rounded-xl border-2 border-gray-200 hover:border-blue-500 transition-all duration-300 hover:shadow-xl bg-white&quot; style={{ &#x27;--accent-color&#x27;: config.color } as React.CSSProperties} &gt; {/* Icon */} &lt;div className=&quot;text-6xl mb-4 group-hover:scale-110 transition-transform&quot;&gt; {config.icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-2xl font-bold mb-2 text-gray-900&quot;&gt; {config.title} &lt;/h3&gt; {/* Subtitle */} &lt;p className=&quot;text-gray-600 mb-4&quot;&gt; {config.subtitle} &lt;/p&gt; {/* Framework Badge */} &lt;div className=&quot;inline-block px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-700&quot;&gt; {framework} Framework &lt;/div&gt; {/* Hover Effect */} &lt;div className=&quot;absolute inset-0 rounded-xl bg-gradient-to-br from-blue-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none&quot; /&gt; &lt;/button&gt; ); }; export const QuickStartWizard: React.FC = () =&gt; { const frameworks: Array&lt;&#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;&gt; = [&#x27;ICDF&#x27;, &#x27;RCREOC&#x27;, &#x27;MICRO&#x27;, &#x27;COSTAR&#x27;]; return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-16&quot;&gt; {/* Header */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-5xl font-bold mb-4 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; Transform your simple AI ideas into professional-grade prompts in 60 seconds &lt;/p&gt; &lt;/div&gt; {/* Wizard Cards Grid */} &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {frameworks.map(framework =&gt; ( &lt;WizardCard key={framework} framework={framework} onSelect={(fw) =&gt; { // Navigate to questionnaire with selected framework window.location.href = `/prompt-generator?framework=${fw}`; }} /&gt; ))} &lt;/div&gt; {/* Alternative: &quot;Not Sure?&quot; Option */} &lt;div className=&quot;mt-12 text-center&quot;&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt;Not sure which framework to use?&lt;/p&gt; &lt;button className=&quot;px-6 py-3 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors font-medium&quot; onClick={() =&gt; { // Show prompt input for auto-detection window.location.href = &#x27;/prompt-generator?mode=auto&#x27;; }} &gt; Describe your goal and we&#x27;ll suggest the best framework &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); }; 8.2 PromptInput Component tsx // src/app/prompt-generator/components/PromptInput.tsx import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/detection&#x27;; import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface PromptInputProps { preselectedFramework?: string; onSubmit: (prompt: string, framework: string) =&gt; void; } export const PromptInput: React.FC&lt;PromptInputProps&gt; = ({ preselectedFramework, onSubmit }) =&gt; { const [prompt, setPrompt] = useState(&#x27;&#x27;); const [detectedFramework, setDetectedFramework] = useState&lt;string | null&gt;(null); const handlePromptChange = (value: string) =&gt; { setPrompt(value); // Auto-detect framework as user types (if not preselected) if (!preselectedFramework &amp;&amp; value.length &gt; 20) { const detected = detectFramework(value); setDetectedFramework(detected); } }; const handleSubmit = () =&gt; { const framework = preselectedFramework || detectedFramework || &#x27;MICRO&#x27;; onSubmit(prompt, framework); }; const config = frameworkDetection[detectedFramework || preselectedFramework || &#x27;MICRO&#x27;]; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Framework Badge (if detected) */} {detectedFramework &amp;&amp; !preselectedFramework &amp;&amp; ( &lt;div className=&quot;mb-4 p-4 bg-blue-50 rounded-lg border border-blue-200&quot;&gt; &lt;div className=&quot;flex items-center gap-3&quot;&gt; &lt;span className=&quot;text-3xl&quot;&gt;{config.icon}&lt;/span&gt; &lt;div&gt; &lt;p className=&quot;font-semibold text-blue-900&quot;&gt; Detected: {config.title} &lt;/p&gt; &lt;p className=&quot;text-sm text-blue-700&quot;&gt; We&#x27;ll use the {detectedFramework} framework for your prompt &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* Prompt Textarea */} &lt;div className=&quot;mb-6&quot;&gt; &lt;label className=&quot;block text-lg font-semibold mb-3 text-gray-900&quot;&gt; {preselectedFramework ? `Describe what you need (${config.title})` : &#x27;Describe what you need in your own words&#x27;} &lt;/label&gt; &lt;textarea value={prompt} onChange={(e) =&gt; handlePromptChange(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are most popular...&quot; className=&quot;w-full h-40 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none text-lg&quot; autoFocus /&gt; &lt;p className=&quot;mt-2 text-sm text-gray-500&quot;&gt; {prompt.length} characters โ€ข Be as specific as possible &lt;/p&gt; &lt;/div&gt; {/* Submit Button */} &lt;button onClick={handleSubmit} disabled={prompt.length &lt; 10} className=&quot;w-full py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg text-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all shadow-lg hover:shadow-xl&quot; &gt; Continue to Questions โ†’ &lt;/button&gt; &lt;/div&gt; ); }; 8.3 QuestionnaireFlow Component tsx // src/app/prompt-generator/components/QuestionnaireFlow.tsx import { useState } from &#x27;react&#x27;; import { QuestionCard } from &#x27;./QuestionCard&#x27;; import { getQuestions } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface QuestionnaireFlowProps { framework: string; initialPrompt: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export const QuestionnaireFlow: React.FC&lt;QuestionnaireFlowProps&gt; = ({ framework, initialPrompt, onComplete }) =&gt; { const questions = getQuestions(framework); const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const handleAnswer = (questionId: string, answer: string) =&gt; { const newAnswers = { ...answers, [questionId]: answer }; setAnswers(newAnswers); // Auto-advance to next question if (currentQuestion &lt; questions.length - 1) { setTimeout(() =&gt; setCurrentQuestion(currentQuestion + 1), 300); } else { // All questions answered onComplete(newAnswers); } }; const handleSkip = (questionId: string) =&gt; { const question = questions[currentQuestion]; const defaultAnswer = question.defaultValue || &#x27;&#x27;; handleAnswer(questionId, defaultAnswer); }; const progress = ((currentQuestion + 1) / questions.length) * 100; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Progress Bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 mb-2&quot;&gt; &lt;span&gt;Question {currentQuestion + 1} of {questions.length}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-gradient-to-r from-blue-600 to-purple-600 transition-all duration-500&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Current Question */} &lt;QuestionCard question={questions[currentQuestion]} onAnswer={handleAnswer} onSkip={handleSkip} /&gt; {/* Navigation */} {currentQuestion &gt; 0 &amp;&amp; ( &lt;button onClick={() =&gt; setCurrentQuestion(currentQuestion - 1)} className=&quot;mt-6 text-blue-600 hover:text-blue-700 font-medium&quot; &gt; โ† Previous Question &lt;/button&gt; )} &lt;/div&gt; ); }; 8.4 QuestionCard Component tsx // src/app/prompt-generator/components/QuestionCard.tsx import { useState } from &#x27;react&#x27;; import { LearningTooltip } from &#x27;./LearningTooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean; }&gt;; } interface QuestionCardProps { question: Question; onAnswer: (questionId: string, answer: string) =&gt; void; onSkip: (questionId: string) =&gt; void; } export const QuestionCard: React.FC&lt;QuestionCardProps&gt; = ({ question, onAnswer, onSkip }) =&gt; { const [answer, setAnswer] = useState(&#x27;&#x27;); const [selectedOption, setSelectedOption] = useState(&#x27;&#x27;); const [customText, setCustomText] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { let finalAnswer = answer; if (question.type === &#x27;multiple-choice&#x27;) { const selected = question.options?.find(opt =&gt; opt.value === selectedOption); if (selected?.hasTextField &amp;&amp; customText) { finalAnswer = customText; } else { finalAnswer = selected?.label || selectedOption; } } if (finalAnswer.trim()) { onAnswer(question.id, finalAnswer); } }; return ( &lt;div className=&quot;bg-white rounded-xl shadow-lg p-8 border border-gray-200&quot;&gt; {/* Question Label with Tooltip */} &lt;div className=&quot;flex items-start justify-between mb-6&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold text-gray-900 flex-1&quot;&gt; {question.label} {!question.required &amp;&amp; ( &lt;span className=&quot;ml-2 text-sm font-normal text-gray-500&quot;&gt; (Optional) &lt;/span&gt; )} &lt;/h3&gt; &lt;LearningTooltip content={question.tooltip} /&gt; &lt;/div&gt; {/* Question Input */} {question.type === &#x27;textarea&#x27; ? ( &lt;textarea value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} placeholder={question.placeholder} className=&quot;w-full h-32 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none&quot; autoFocus /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; setSelectedOption(option.value)} className={`w-full p-4 rounded-lg border-2 text-left transition-all ${selectedOption === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-300 hover:border-gray-400&#x27; }`} &gt; {option.label} &lt;/button&gt; {/* Custom Text Field */} {option.hasTextField &amp;&amp; selectedOption === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; value={customText} onChange={(e) =&gt; setCustomText(e.target.value)} placeholder=&quot;Specify...&quot; className=&quot;mt-2 w-full p-3 border-2 border-gray-300 rounded-lg focus:border-blue-500&quot; autoFocus /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Action Buttons */} &lt;div className=&quot;flex gap-4 mt-6&quot;&gt; &lt;button onClick={handleSubmit} disabled={ question.type === &#x27;textarea&#x27; ? !answer.trim() : !selectedOption || ( question.options?.find(o =&gt; o.value === selectedOption)?.hasTextField &amp;&amp; !customText ) } className=&quot;flex-1 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all&quot; &gt; {question.required ? &#x27;Continue&#x27; : &#x27;Continue&#x27;} &lt;/button&gt; {!question.required &amp;&amp; ( &lt;button onClick={() =&gt; onSkip(question.id)} className=&quot;px-6 py-3 border-2 border-gray-300 rounded-lg hover:bg-gray-50 transition-colors font-medium&quot; &gt; Skip &lt;/button&gt; )} &lt;/div&gt; &lt;/div&gt; ); }; 8.5 LearningTooltip Component tsx // src/app/prompt-generator/components/LearningTooltip.tsx import { useState } from &#x27;react&#x27;; interface LearningTooltipProps { content: string; } export const LearningTooltip: React.FC&lt;LearningTooltipProps&gt; = ({ content }) =&gt; { const [isVisible, setIsVisible] = useState(false); return ( &lt;div className=&quot;relative&quot;&gt; &lt;button onMouseEnter={() =&gt; setIsVisible(true)} onMouseLeave={() =&gt; setIsVisible(false)} onClick={() =&gt; setIsVisible(!isVisible)} className=&quot;w-6 h-6 rounded-full bg-blue-100 text-blue-600 hover:bg-blue-200 transition-colors flex items-center justify-center text-sm font-bold&quot; aria-label=&quot;Learn more&quot; &gt; ? &lt;/button&gt; {isVisible &amp;&amp; ( &lt;div className=&quot;absolute right-0 top-8 w-72 p-4 bg-gray-900 text-white rounded-lg shadow-xl z-50 text-sm leading-relaxed&quot;&gt; &lt;div className=&quot;absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45&quot; /&gt; {content} &lt;/div&gt; )} &lt;/div&gt; ); }; 8.6 BeforeAfterComparison Component tsx // src/app/prompt-generator/components/BeforeAfterComparison.tsx import { useState } from &#x27;react&#x27;; import { Copy, Check, RotateCcw } from &#x27;lucide-react&#x27;; interface BeforeAfterComparisonProps { original: string; professional: string; improvements: Array&lt;{ added: string; why: string }&gt;; frameworkName: string; onStartNew: () =&gt; void; } export const BeforeAfterComparison: React.FC&lt;BeforeAfterComparisonProps&gt; = ({ original, professional, improvements, frameworkName, onStartNew }) =&gt; { const [copied, setCopied] = useState(false); const handleCopy = () =&gt; { navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-7xl mx-auto px-4 py-12&quot;&gt; {/* Success Header */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;div className=&quot;inline-block p-3 bg-green-100 rounded-full mb-4&quot;&gt; &lt;Check className=&quot;w-8 h-8 text-green-600&quot; /&gt; &lt;/div&gt; &lt;h2 className=&quot;text-4xl font-bold mb-2&quot;&gt; Your Professional Prompt is Ready! &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Using the {frameworkName} &lt;/p&gt; &lt;/div&gt; {/* Before/After Comparison */} &lt;div className=&quot;grid grid-cols-1 lg:grid-cols-2 gap-8 mb-12&quot;&gt; {/* Before (Original) */} &lt;div className=&quot;bg-gray-50 rounded-xl p-6 border border-gray-200&quot;&gt; &lt;div className=&quot;flex items-center gap-2 mb-4&quot;&gt; &lt;div className=&quot;w-3 h-3 rounded-full bg-gray-400&quot; /&gt; &lt;h3 className=&quot;font-bold text-gray-700&quot;&gt;Your Original Prompt&lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-4 rounded-lg border border-gray-300 text-gray-600 whitespace-pre-wrap font-mono text-sm&quot;&gt; {original} &lt;/div&gt; &lt;/div&gt; {/* After (Professional) */} &lt;div className=&quot;bg-gradient-to-br from-blue-50 to-purple-50 rounded-xl p-6 border-2 border-blue-300&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;div className=&quot;flex items-center gap-2&quot;&gt; &lt;div className=&quot;w-3 h-3 rounded-full bg-blue-500&quot; /&gt; &lt;h3 className=&quot;font-bold text-blue-900&quot;&gt;Professional Version&lt;/h3&gt; &lt;/div&gt; &lt;button onClick={handleCopy} className=&quot;flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors&quot; &gt; {copied ? ( &lt;&gt; &lt;Check className=&quot;w-4 h-4&quot; /&gt; Copied! &lt;/&gt; ) : ( &lt;&gt; &lt;Copy className=&quot;w-4 h-4&quot; /&gt; Copy &lt;/&gt; )} &lt;/button&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-4 rounded-lg border border-blue-200 text-gray-900 whitespace-pre-wrap font-mono text-sm&quot;&gt; {professional} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {/* Learning Mode: What Improved */} &lt;div className=&quot;bg-white rounded-xl p-8 border border-gray-200 mb-8&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold mb-6 flex items-center gap-2&quot;&gt; &lt;span className=&quot;text-2xl&quot;&gt;๐Ÿ’ก&lt;/span&gt; What Makes This Prompt Professional? &lt;/h3&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-4&quot;&gt; {improvements.map((improvement, index) =&gt; ( &lt;div key={index} className=&quot;p-4 bg-blue-50 rounded-lg border border-blue-200&quot; &gt; &lt;div className=&quot;font-bold text-blue-900 mb-2&quot;&gt; โœ“ Added: {improvement.added} &lt;/div&gt; &lt;div className=&quot;text-sm text-blue-700&quot;&gt; {improvement.why} &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Action Buttons */} &lt;div className=&quot;flex flex-col sm:flex-row gap-4 justify-center&quot;&gt; &lt;button onClick={onStartNew} className=&quot;flex items-center justify-center gap-2 px-8 py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg&quot; &gt; &lt;RotateCcw className=&quot;w-5 h-5&quot; /&gt; Create Another Prompt &lt;/button&gt; &lt;button onClick={handleCopy} className=&quot;px-8 py-4 border-2 border-blue-600 text-blue-600 font-bold rounded-lg hover:bg-blue-50 transition-colors&quot; &gt; Copy and Close &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); }; 9. API Routes 9.1 Generate Prompt API typescript // src/app/api/prompt-generator/generate/route.ts import { NextRequest, NextResponse } from &#x27;next/server&#x27;; import { generateComparison } from &#x27;@/lib/prompt-generator/templates&#x27;; import { trackGeneration } from &#x27;@/lib/prompt-generator/analytics&#x27;; export async function POST(req: NextRequest) { try { const { originalPrompt, framework, answers } = await req.json(); // Validate input if (!originalPrompt || !framework || !answers) { return NextResponse.json( { error: &#x27;Missing required fields&#x27; }, { status: 400 } ); } // Generate the professional prompt const result = generateComparison(originalPrompt, framework, answers); // Track analytics (anonymous) await trackGeneration({ framework, completed: true, ipHash: hashIP(req.ip || &#x27;unknown&#x27;), userAgent: req.headers.get(&#x27;user-agent&#x27;) || undefined }); return NextResponse.json(result); } catch (error) { console.error(&#x27;Prompt generation error:&#x27;, error); return NextResponse.json( { error: &#x27;Failed to generate prompt&#x27; }, { status: 500 } ); } } function hashIP(ip: string): string { // Simple hash for privacy (use crypto in production) return Buffer.from(ip).toString(&#x27;base64&#x27;); } 9.2 Analytics API typescript // src/app/api/prompt-generator/analytics/route.ts import { NextRequest, NextResponse } from &#x27;next/server&#x27;; import { prisma } from &#x27;@/lib/prisma&#x27;; export async function POST(req: NextRequest) { try { const { framework, completed } = await req.json(); // Rate limiting check const ipHash = hashIP(req.ip || &#x27;unknown&#x27;); const recentGenerations = await prisma.promptGeneration.count({ where: { ipHash, createdAt: { gte: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours } } }); if (recentGenerations &gt;= 20) { return NextResponse.json( { error: &#x27;Rate limit exceeded. Please try again tomorrow.&#x27; }, { status: 429 } ); } // Track generation await prisma.promptGeneration.create({ data: { framework, completed, ipHash, sessionId: req.cookies.get(&#x27;session&#x27;)?.value || &#x27;unknown&#x27;, userAgent: req.headers.get(&#x27;user-agent&#x27;) } }); // Update daily aggregates const today = new Date(); today.setHours(0, 0, 0, 0); await prisma.promptAnalytics.upsert({ where: { date: today }, update: { totalGenerations: { increment: 1 }, [`${framework.toLowerCase()}Count`]: { increment: 1 } }, create: { date: today, totalGenerations: 1, [`${framework.toLowerCase()}Count`]: 1 } }); return NextResponse.json({ success: true }); } catch (error) { console.error(&#x27;Analytics tracking error:&#x27;, error); return NextResponse.json( { error: &#x27;Failed to track analytics&#x27; }, { status: 500 } ); } } function hashIP(ip: string): string { return Buffer.from(ip).toString(&#x27;base64&#x27;); } 10. Main Page Implementation tsx // src/app/prompt-generator/page.tsx &#x27;use client&#x27;; import { useState } from &#x27;react&#x27;; import { useSearchParams } from &#x27;next/navigation&#x27;; import { QuickStartWizard } from &#x27;./components/QuickStartWizard&#x27;; import { PromptInput } from &#x27;./components/PromptInput&#x27;; import { QuestionnaireFlow } from &#x27;./components/QuestionnaireFlow&#x27;; import { BeforeAfterComparison } from &#x27;./components/BeforeAfterComparison&#x27;; type Step = &#x27;wizard&#x27; | &#x27;input&#x27; | &#x27;questionnaire&#x27; | &#x27;result&#x27;; export default function PromptGeneratorPage() { const searchParams = useSearchParams(); const preselectedFramework = searchParams?.get(&#x27;framework&#x27;); const mode = searchParams?.get(&#x27;mode&#x27;); const [step, setStep] = useState&lt;Step&gt;( preselectedFramework ? &#x27;input&#x27; : mode === &#x27;auto&#x27; ? &#x27;input&#x27; : &#x27;wizard&#x27; ); const [framework, setFramework] = useState&lt;string&gt;(preselectedFramework || &#x27;&#x27;); const [originalPrompt, setOriginalPrompt] = useState(&#x27;&#x27;); const [result, setResult] = useState&lt;any&gt;(null); const handlePromptSubmit = (prompt: string, detectedFramework: string) =&gt; { setOrig JavaScript JavaScriptโ€ข 12 lines return explanations[framework] || []; } function getFrameworkName(framework) { const names = { ICDF: &#x27;ICDF Framework (Instruction, Context, Data, Format)&#x27;, RCREOC: &#x27;RCREOC Framework (Role, Context, Request, Examples, Output, Constraints)&#x27;, MICRO: &#x27;MICRO Framework (Message, Intention, Context, Rhythm, Output)&#x27;, COSTAR: &#x27;COSTAR Framework (Context, Offer, Style, Target, Action, Result)&#x27; }; return names[framework]; } This code can be executed in the preview sandbox Run Code PRISMA Code PRISMAโ€ข 37 lines // Add to your existing schema.prisma model PromptGeneration { id String @id @default(cuid()) // Analytics data framework String // ICDF, RCREOC, MICRO, COSTAR completed Boolean @default(false) // Anonymized tracking sessionId String // Browser fingerprint or session ID ipHash String? // Hashed IP for rate limiting // Metadata createdAt DateTime @default(now()) userAgent String? @@index([framework]) @@index([createdAt]) @@index([ipHash]) } model PromptAnalytics { id String @id @default(cuid()) date DateTime @default(now()) // Daily aggregates totalGenerations Int @default(0) icdfCount Int @default(0) rcreocCount Int @default(0) microCount Int @default(0) costarCount Int @default(0) completionRate Float @default(0) // Percentage who completed vs abandoned @@unique([date]) } Code Snippet 3 Plain Textโ€ข 28 lines src/ โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ page.tsx # Main landing page with wizard โ”‚ โ”œโ”€โ”€ layout.tsx # Shares main site layout โ”‚ โ””โ”€โ”€ components/ โ”‚ โ”œโ”€โ”€ QuickStartWizard.tsx # 4-button framework selector โ”‚ โ”œโ”€โ”€ PromptInput.tsx # Initial prompt textarea โ”‚ โ”œโ”€โ”€ QuestionnaireFlow.tsx # Adaptive question system โ”‚ โ”œโ”€โ”€ QuestionCard.tsx # Individual question component โ”‚ โ”œโ”€โ”€ BeforeAfterComparison.tsx # Side-by-side display โ”‚ โ”œโ”€โ”€ LearningTooltip.tsx # Hover tooltip component โ”‚ โ””โ”€โ”€ FrameworkIcon.tsx # Visual icons for each framework โ”‚ โ”œโ”€โ”€ lib/ โ”‚ โ””โ”€โ”€ prompt-generator/ โ”‚ โ”œโ”€โ”€ frameworks.ts # Framework definitions &amp; questions โ”‚ โ”œโ”€โ”€ detection.ts # Keyword detection logic โ”‚ โ”œโ”€โ”€ templates.ts # Prompt assembly templates โ”‚ โ”œโ”€โ”€ analytics.ts # Analytics tracking functions โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces โ”‚ โ””โ”€โ”€ api/ โ””โ”€โ”€ prompt-generator/ โ”œโ”€โ”€ generate/ โ”‚ โ””โ”€โ”€ route.ts # POST: Generate professional prompt โ””โ”€โ”€ analytics/ โ””โ”€โ”€ route.ts # POST: Track usage (anonymous) TypeScript React React TSXโ€ข 94 lines // src/app/prompt-generator/components/QuickStartWizard.tsx import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface WizardCardProps { framework: &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;; onSelect: (framework: string) =&gt; void; } const WizardCard: React.FC&lt;WizardCardProps&gt; = ({ framework, onSelect }) =&gt; { const config = frameworkDetection[framework]; return ( &lt;button onClick={() =&gt; onSelect(framework)} className=&quot;group relative p-8 rounded-xl border-2 border-gray-200 hover:border-blue-500 transition-all duration-300 hover:shadow-xl bg-white&quot; style={{ &#x27;--accent-color&#x27;: config.color } as React.CSSProperties} &gt; {/* Icon */} &lt;div className=&quot;text-6xl mb-4 group-hover:scale-110 transition-transform&quot;&gt; {config.icon} &lt;/div&gt; {/* Title */} &lt;h3 className=&quot;text-2xl font-bold mb-2 text-gray-900&quot;&gt; {config.title} &lt;/h3&gt; {/* Subtitle */} &lt;p className=&quot;text-gray-600 mb-4&quot;&gt; {config.subtitle} &lt;/p&gt; {/* Framework Badge */} &lt;div className=&quot;inline-block px-3 py-1 bg-gray-100 rounded-full text-sm text-gray-700&quot;&gt; {framework} Framework &lt;/div&gt; {/* Hover Effect */} &lt;div className=&quot;absolute inset-0 rounded-xl bg-gradient-to-br from-blue-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none&quot; /&gt; &lt;/button&gt; ); }; export const QuickStartWizard: React.FC = () =&gt; { const frameworks: Array&lt;&#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27;&gt; = [&#x27;ICDF&#x27;, &#x27;RCREOC&#x27;, &#x27;MICRO&#x27;, &#x27;COSTAR&#x27;]; return ( &lt;div className=&quot;max-w-6xl mx-auto px-4 py-16&quot;&gt; {/* Header */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-5xl font-bold mb-4 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent&quot;&gt; AI Prompt Generator &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; Transform your simple AI ideas into professional-grade prompts in 60 seconds &lt;/p&gt; &lt;/div&gt; {/* Wizard Cards Grid */} &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6&quot;&gt; {frameworks.map(framework =&gt; ( &lt;WizardCard key={framework} framework={framework} onSelect={(fw) =&gt; { // Navigate to questionnaire with selected framework window.location.href = `/prompt-generator?framework=${fw}`; }} /&gt; ))} &lt;/div&gt; {/* Alternative: &quot;Not Sure?&quot; Option */} &lt;div className=&quot;mt-12 text-center&quot;&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt;Not sure which framework to use?&lt;/p&gt; &lt;button className=&quot;px-6 py-3 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors font-medium&quot; onClick={() =&gt; { // Show prompt input for auto-detection window.location.href = &#x27;/prompt-generator?mode=auto&#x27;; }} &gt; Describe your goal and we&#x27;ll suggest the best framework &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 90 lines // src/app/prompt-generator/components/PromptInput.tsx import { useState } from &#x27;react&#x27;; import { detectFramework } from &#x27;@/lib/prompt-generator/detection&#x27;; import { frameworkDetection } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface PromptInputProps { preselectedFramework?: string; onSubmit: (prompt: string, framework: string) =&gt; void; } export const PromptInput: React.FC&lt;PromptInputProps&gt; = ({ preselectedFramework, onSubmit }) =&gt; { const [prompt, setPrompt] = useState(&#x27;&#x27;); const [detectedFramework, setDetectedFramework] = useState&lt;string | null&gt;(null); const handlePromptChange = (value: string) =&gt; { setPrompt(value); // Auto-detect framework as user types (if not preselected) if (!preselectedFramework &amp;&amp; value.length &gt; 20) { const detected = detectFramework(value); setDetectedFramework(detected); } }; const handleSubmit = () =&gt; { const framework = preselectedFramework || detectedFramework || &#x27;MICRO&#x27;; onSubmit(prompt, framework); }; const config = frameworkDetection[detectedFramework || preselectedFramework || &#x27;MICRO&#x27;]; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Framework Badge (if detected) */} {detectedFramework &amp;&amp; !preselectedFramework &amp;&amp; ( &lt;div className=&quot;mb-4 p-4 bg-blue-50 rounded-lg border border-blue-200&quot;&gt; &lt;div className=&quot;flex items-center gap-3&quot;&gt; &lt;span className=&quot;text-3xl&quot;&gt;{config.icon}&lt;/span&gt; &lt;div&gt; &lt;p className=&quot;font-semibold text-blue-900&quot;&gt; Detected: {config.title} &lt;/p&gt; &lt;p className=&quot;text-sm text-blue-700&quot;&gt; We&#x27;ll use the {detectedFramework} framework for your prompt &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* Prompt Textarea */} &lt;div className=&quot;mb-6&quot;&gt; &lt;label className=&quot;block text-lg font-semibold mb-3 text-gray-900&quot;&gt; {preselectedFramework ? `Describe what you need (${config.title})` : &#x27;Describe what you need in your own words&#x27;} &lt;/label&gt; &lt;textarea value={prompt} onChange={(e) =&gt; handlePromptChange(e.target.value)} placeholder=&quot;e.g., I need to analyze my website traffic to see which blog posts are most popular...&quot; className=&quot;w-full h-40 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none text-lg&quot; autoFocus /&gt; &lt;p className=&quot;mt-2 text-sm text-gray-500&quot;&gt; {prompt.length} characters โ€ข Be as specific as possible &lt;/p&gt; &lt;/div&gt; {/* Submit Button */} &lt;button onClick={handleSubmit} disabled={prompt.length &lt; 10} className=&quot;w-full py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg text-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all shadow-lg hover:shadow-xl&quot; &gt; Continue to Questions โ†’ &lt;/button&gt; &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 78 lines // src/app/prompt-generator/components/QuestionnaireFlow.tsx import { useState } from &#x27;react&#x27;; import { QuestionCard } from &#x27;./QuestionCard&#x27;; import { getQuestions } from &#x27;@/lib/prompt-generator/frameworks&#x27;; interface QuestionnaireFlowProps { framework: string; initialPrompt: string; onComplete: (answers: Record&lt;string, string&gt;) =&gt; void; } export const QuestionnaireFlow: React.FC&lt;QuestionnaireFlowProps&gt; = ({ framework, initialPrompt, onComplete }) =&gt; { const questions = getQuestions(framework); const [currentQuestion, setCurrentQuestion] = useState(0); const [answers, setAnswers] = useState&lt;Record&lt;string, string&gt;&gt;({}); const handleAnswer = (questionId: string, answer: string) =&gt; { const newAnswers = { ...answers, [questionId]: answer }; setAnswers(newAnswers); // Auto-advance to next question if (currentQuestion &lt; questions.length - 1) { setTimeout(() =&gt; setCurrentQuestion(currentQuestion + 1), 300); } else { // All questions answered onComplete(newAnswers); } }; const handleSkip = (questionId: string) =&gt; { const question = questions[currentQuestion]; const defaultAnswer = question.defaultValue || &#x27;&#x27;; handleAnswer(questionId, defaultAnswer); }; const progress = ((currentQuestion + 1) / questions.length) * 100; return ( &lt;div className=&quot;max-w-3xl mx-auto px-4 py-12&quot;&gt; {/* Progress Bar */} &lt;div className=&quot;mb-8&quot;&gt; &lt;div className=&quot;flex justify-between text-sm text-gray-600 mb-2&quot;&gt; &lt;span&gt;Question {currentQuestion + 1} of {questions.length}&lt;/span&gt; &lt;span&gt;{Math.round(progress)}% Complete&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;w-full h-2 bg-gray-200 rounded-full overflow-hidden&quot;&gt; &lt;div className=&quot;h-full bg-gradient-to-r from-blue-600 to-purple-600 transition-all duration-500&quot; style={{ width: `${progress}%` }} /&gt; &lt;/div&gt; &lt;/div&gt; {/* Current Question */} &lt;QuestionCard question={questions[currentQuestion]} onAnswer={handleAnswer} onSkip={handleSkip} /&gt; {/* Navigation */} {currentQuestion &gt; 0 &amp;&amp; ( &lt;button onClick={() =&gt; setCurrentQuestion(currentQuestion - 1)} className=&quot;mt-6 text-blue-600 hover:text-blue-700 font-medium&quot; &gt; โ† Previous Question &lt;/button&gt; )} &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 143 lines // src/app/prompt-generator/components/QuestionCard.tsx import { useState } from &#x27;react&#x27;; import { LearningTooltip } from &#x27;./LearningTooltip&#x27;; interface Question { id: string; type: &#x27;textarea&#x27; | &#x27;multiple-choice&#x27;; label: string; placeholder?: string; required: boolean; defaultValue?: string; tooltip: string; options?: Array&lt;{ value: string; label: string; hasTextField?: boolean; }&gt;; } interface QuestionCardProps { question: Question; onAnswer: (questionId: string, answer: string) =&gt; void; onSkip: (questionId: string) =&gt; void; } export const QuestionCard: React.FC&lt;QuestionCardProps&gt; = ({ question, onAnswer, onSkip }) =&gt; { const [answer, setAnswer] = useState(&#x27;&#x27;); const [selectedOption, setSelectedOption] = useState(&#x27;&#x27;); const [customText, setCustomText] = useState(&#x27;&#x27;); const handleSubmit = () =&gt; { let finalAnswer = answer; if (question.type === &#x27;multiple-choice&#x27;) { const selected = question.options?.find(opt =&gt; opt.value === selectedOption); if (selected?.hasTextField &amp;&amp; customText) { finalAnswer = customText; } else { finalAnswer = selected?.label || selectedOption; } } if (finalAnswer.trim()) { onAnswer(question.id, finalAnswer); } }; return ( &lt;div className=&quot;bg-white rounded-xl shadow-lg p-8 border border-gray-200&quot;&gt; {/* Question Label with Tooltip */} &lt;div className=&quot;flex items-start justify-between mb-6&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold text-gray-900 flex-1&quot;&gt; {question.label} {!question.required &amp;&amp; ( &lt;span className=&quot;ml-2 text-sm font-normal text-gray-500&quot;&gt; (Optional) &lt;/span&gt; )} &lt;/h3&gt; &lt;LearningTooltip content={question.tooltip} /&gt; &lt;/div&gt; {/* Question Input */} {question.type === &#x27;textarea&#x27; ? ( &lt;textarea value={answer} onChange={(e) =&gt; setAnswer(e.target.value)} placeholder={question.placeholder} className=&quot;w-full h-32 p-4 border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all resize-none&quot; autoFocus /&gt; ) : ( &lt;div className=&quot;space-y-3&quot;&gt; {question.options?.map((option) =&gt; ( &lt;div key={option.value}&gt; &lt;button onClick={() =&gt; setSelectedOption(option.value)} className={`w-full p-4 rounded-lg border-2 text-left transition-all ${selectedOption === option.value ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-300 hover:border-gray-400&#x27; }`} &gt; {option.label} &lt;/button&gt; {/* Custom Text Field */} {option.hasTextField &amp;&amp; selectedOption === option.value &amp;&amp; ( &lt;input type=&quot;text&quot; value={customText} onChange={(e) =&gt; setCustomText(e.target.value)} placeholder=&quot;Specify...&quot; className=&quot;mt-2 w-full p-3 border-2 border-gray-300 rounded-lg focus:border-blue-500&quot; autoFocus /&gt; )} &lt;/div&gt; ))} &lt;/div&gt; )} {/* Action Buttons */} &lt;div className=&quot;flex gap-4 mt-6&quot;&gt; &lt;button onClick={handleSubmit} disabled={ question.type === &#x27;textarea&#x27; ? !answer.trim() : !selectedOption || ( question.options?.find(o =&gt; o.value === selectedOption)?.hasTextField &amp;&amp; !customText ) } className=&quot;flex-1 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all&quot; &gt; {question.required ? &#x27;Continue&#x27; : &#x27;Continue&#x27;} &lt;/button&gt; {!question.required &amp;&amp; ( &lt;button onClick={() =&gt; onSkip(question.id)} className=&quot;px-6 py-3 border-2 border-gray-300 rounded-lg hover:bg-gray-50 transition-colors font-medium&quot; &gt; Skip &lt;/button&gt; )} &lt;/div&gt; &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 36 lines // src/app/prompt-generator/components/LearningTooltip.tsx import { useState } from &#x27;react&#x27;; interface LearningTooltipProps { content: string; } export const LearningTooltip: React.FC&lt;LearningTooltipProps&gt; = ({ content }) =&gt; { const [isVisible, setIsVisible] = useState(false); return ( &lt;div className=&quot;relative&quot;&gt; &lt;button onMouseEnter={() =&gt; setIsVisible(true)} onMouseLeave={() =&gt; setIsVisible(false)} onClick={() =&gt; setIsVisible(!isVisible)} className=&quot;w-6 h-6 rounded-full bg-blue-100 text-blue-600 hover:bg-blue-200 transition-colors flex items-center justify-center text-sm font-bold&quot; aria-label=&quot;Learn more&quot; &gt; ? &lt;/button&gt; {isVisible &amp;&amp; ( &lt;div className=&quot;absolute right-0 top-8 w-72 p-4 bg-gray-900 text-white rounded-lg shadow-xl z-50 text-sm leading-relaxed&quot;&gt; &lt;div className=&quot;absolute -top-2 right-2 w-4 h-4 bg-gray-900 transform rotate-45&quot; /&gt; {content} &lt;/div&gt; )} &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript React React TSXโ€ข 137 lines // src/app/prompt-generator/components/BeforeAfterComparison.tsx import { useState } from &#x27;react&#x27;; import { Copy, Check, RotateCcw } from &#x27;lucide-react&#x27;; interface BeforeAfterComparisonProps { original: string; professional: string; improvements: Array&lt;{ added: string; why: string }&gt;; frameworkName: string; onStartNew: () =&gt; void; } export const BeforeAfterComparison: React.FC&lt;BeforeAfterComparisonProps&gt; = ({ original, professional, improvements, frameworkName, onStartNew }) =&gt; { const [copied, setCopied] = useState(false); const handleCopy = () =&gt; { navigator.clipboard.writeText(professional); setCopied(true); setTimeout(() =&gt; setCopied(false), 2000); }; return ( &lt;div className=&quot;max-w-7xl mx-auto px-4 py-12&quot;&gt; {/* Success Header */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;div className=&quot;inline-block p-3 bg-green-100 rounded-full mb-4&quot;&gt; &lt;Check className=&quot;w-8 h-8 text-green-600&quot; /&gt; &lt;/div&gt; &lt;h2 className=&quot;text-4xl font-bold mb-2&quot;&gt; Your Professional Prompt is Ready! &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Using the {frameworkName} &lt;/p&gt; &lt;/div&gt; {/* Before/After Comparison */} &lt;div className=&quot;grid grid-cols-1 lg:grid-cols-2 gap-8 mb-12&quot;&gt; {/* Before (Original) */} &lt;div className=&quot;bg-gray-50 rounded-xl p-6 border border-gray-200&quot;&gt; &lt;div className=&quot;flex items-center gap-2 mb-4&quot;&gt; &lt;div className=&quot;w-3 h-3 rounded-full bg-gray-400&quot; /&gt; &lt;h3 className=&quot;font-bold text-gray-700&quot;&gt;Your Original Prompt&lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-4 rounded-lg border border-gray-300 text-gray-600 whitespace-pre-wrap font-mono text-sm&quot;&gt; {original} &lt;/div&gt; &lt;/div&gt; {/* After (Professional) */} &lt;div className=&quot;bg-gradient-to-br from-blue-50 to-purple-50 rounded-xl p-6 border-2 border-blue-300&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-4&quot;&gt; &lt;div className=&quot;flex items-center gap-2&quot;&gt; &lt;div className=&quot;w-3 h-3 rounded-full bg-blue-500&quot; /&gt; &lt;h3 className=&quot;font-bold text-blue-900&quot;&gt;Professional Version&lt;/h3&gt; &lt;/div&gt; &lt;button onClick={handleCopy} className=&quot;flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors&quot; &gt; {copied ? ( &lt;&gt; &lt;Check className=&quot;w-4 h-4&quot; /&gt; Copied! &lt;/&gt; ) : ( &lt;&gt; &lt;Copy className=&quot;w-4 h-4&quot; /&gt; Copy &lt;/&gt; )} &lt;/button&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-4 rounded-lg border border-blue-200 text-gray-900 whitespace-pre-wrap font-mono text-sm&quot;&gt; {professional} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; {/* Learning Mode: What Improved */} &lt;div className=&quot;bg-white rounded-xl p-8 border border-gray-200 mb-8&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold mb-6 flex items-center gap-2&quot;&gt; &lt;span className=&quot;text-2xl&quot;&gt;๐Ÿ’ก&lt;/span&gt; What Makes This Prompt Professional? &lt;/h3&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-4&quot;&gt; {improvements.map((improvement, index) =&gt; ( &lt;div key={index} className=&quot;p-4 bg-blue-50 rounded-lg border border-blue-200&quot; &gt; &lt;div className=&quot;font-bold text-blue-900 mb-2&quot;&gt; โœ“ Added: {improvement.added} &lt;/div&gt; &lt;div className=&quot;text-sm text-blue-700&quot;&gt; {improvement.why} &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Action Buttons */} &lt;div className=&quot;flex flex-col sm:flex-row gap-4 justify-center&quot;&gt; &lt;button onClick={onStartNew} className=&quot;flex items-center justify-center gap-2 px-8 py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-bold rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all shadow-lg&quot; &gt; &lt;RotateCcw className=&quot;w-5 h-5&quot; /&gt; Create Another Prompt &lt;/button&gt; &lt;button onClick={handleCopy} className=&quot;px-8 py-4 border-2 border-blue-600 text-blue-600 font-bold rounded-lg hover:bg-blue-50 transition-colors&quot; &gt; Copy and Close &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); }; This code can be executed in the preview sandbox Run Code TypeScript TypeScriptโ€ข 44 lines // src/app/api/prompt-generator/generate/route.ts import { NextRequest, NextResponse } from &#x27;next/server&#x27;; import { generateComparison } from &#x27;@/lib/prompt-generator/templates&#x27;; import { trackGeneration } from &#x27;@/lib/prompt-generator/analytics&#x27;; export async function POST(req: NextRequest) { try { const { originalPrompt, framework, answers } = await req.json(); // Validate input if (!originalPrompt || !framework || !answers) { return NextResponse.json( { error: &#x27;Missing required fields&#x27; }, { status: 400 } ); } // Generate the professional prompt const result = generateComparison(originalPrompt, framework, answers); // Track analytics (anonymous) await trackGeneration({ framework, completed: true, ipHash: hashIP(req.ip || &#x27;unknown&#x27;), userAgent: req.headers.get(&#x27;user-agent&#x27;) || undefined }); return NextResponse.json(result); } catch (error) { console.error(&#x27;Prompt generation error:&#x27;, error); return NextResponse.json( { error: &#x27;Failed to generate prompt&#x27; }, { status: 500 } ); } } function hashIP(ip: string): string { // Simple hash for privacy (use crypto in production) return Buffer.from(ip).toString(&#x27;base64&#x27;); } TypeScript TypeScriptโ€ข 69 lines // src/app/api/prompt-generator/analytics/route.ts import { NextRequest, NextResponse } from &#x27;next/server&#x27;; import { prisma } from &#x27;@/lib/prisma&#x27;; export async function POST(req: NextRequest) { try { const { framework, completed } = await req.json(); // Rate limiting check const ipHash = hashIP(req.ip || &#x27;unknown&#x27;); const recentGenerations = await prisma.promptGeneration.count({ where: { ipHash, createdAt: { gte: new Date(Date.now() - 24 * 60 * 60 * 1000) // Last 24 hours } } }); if (recentGenerations &gt;= 20) { return NextResponse.json( { error: &#x27;Rate limit exceeded. Please try again tomorrow.&#x27; }, { status: 429 } ); } // Track generation await prisma.promptGeneration.create({ data: { framework, completed, ipHash, sessionId: req.cookies.get(&#x27;session&#x27;)?.value || &#x27;unknown&#x27;, userAgent: req.headers.get(&#x27;user-agent&#x27;) } }); // Update daily aggregates const today = new Date(); today.setHours(0, 0, 0, 0); await prisma.promptAnalytics.upsert({ where: { date: today }, update: { totalGenerations: { increment: 1 }, [`${framework.toLowerCase()}Count`]: { increment: 1 } }, create: { date: today, totalGenerations: 1, [`${framework.toLowerCase()}Count`]: 1 } }); return NextResponse.json({ success: true }); } catch (error) { console.error(&#x27;Analytics tracking error:&#x27;, error); return NextResponse.json( { error: &#x27;Failed to track analytics&#x27; }, { status: 500 } ); } } function hashIP(ip: string): string { return Buffer.from(ip).toString(&#x27;base64&#x27;); } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ README.md</div> <div class="content">photobybolt_0 </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ blog.txt</div> <div class="content">The problem isn&#x27;t the AI. It&#x27;s how you&#x27;re talking to it. Why Your Prompts Fail An AI can&#x27;t read your mind. It understands what you *write*, not what you *think*. A vague question gets a vague answer. A specific, detailed prompt gets a specific, detailed result. This is the entire secret to &quot;prompt engineering.&quot; The Vague Prompt You ask a coworker, &quot;How&#x27;s it going?&quot; Prompt: &quot;Analyze this sales data.&quot; Result: A generic, unhelpful summary. You get a list of numbers, but no insights and no direction. The Pro Prompt You ask, &quot;Where are we on the Q3 report for the exec meeting tomorrow?&quot; Prompt: &quot;Analyze the attached Q3 sales data for our marketing meeting. I need to identify the top-performing product and the product with the sharpest decline. Format the analysis as a 3-section email...&quot; Result: A detailed, actionable report in the exact format you need. Use a Framework, Not a Guess Professionals don&#x27;t guess. They use frameworksโ€”structured templatesโ€”to ensure every prompt contains all the information an AI needs. Here are the four frameworks you can use to get expert results, every time. Secret 1: The ICDF Framework This is the perfect framework for daily tasks and data analysis. It ensures you provide a complete request. Most users only provide the &quot;Instruction,&quot; leading to incomplete results. I - Instruction: What is the core task? (e.g., &quot;Analyze...&quot;) C - Context: Why do you need this? Who is it for? (e.g., &quot;For a marketing meeting...&quot;) D - Data: What data should it use? (e.g., &quot;Use the attached file...&quot;) F - Format: How should it be presented? (e.g., &quot;As a 3-section email...&quot;) Example: Analyzing Sales Data [Instruction] Analyze the attached sales data. [Context] I need to present a monthly summary to my manager for our marketing team meeting. The goal is to identify our top-performing product and the product with the most significant drop. [Data] The data includes product names, units sold, and revenue for July, August, and September. [Format] Present the analysis as a clean, bulleted list with three clear sections: 1. Top Performing Products, 2. Underperforming Products, and 3. Short Recommendations. Secret 2: The RCREOC Framework Use this to turn the AI from a simple tool into an expert &quot;AI Agent&quot; that works for you by giving it a specific job. The &quot;AI Agent&quot; Workflow Role โ†’ Context โ†’ Request โ†’ Examples โ†’ Output โ†’ Constraints R - Role: Who is the AI? (e.g., &quot;You are an expert Assistant Project Manager...&quot;) C - Context: What is the situation? (e.g., &quot;You review weekly reports...&quot;) R - Request: What is the specific task? (e.g., &quot;Extract recurring problems...&quot;) E - Examples: Show it what a good answer looks like. O - Output: What is the final format? (e.g., &quot;A table with 3 columns...&quot;) C - Constraints: What are the rules? (e.g., &quot;Each entry must be less than 3 lines...&quot;) Example: Analyzing Team Reports [Role] You are an Assistant Project Manager on a tech team. [Context] Your job is to review weekly reports to find problems and solutions. [Request] Review this report and extract: 1. Recurring issues, 2. Team suggestions, 3. Your recommendations. [Output] Format as a 3-column table: &#x27;Issue&#x27;, &#x27;Proposed Solution&#x27;, &#x27;Recommendation&#x27;. [Constraints] Each entry must be under 3 lines. Secret 3: The MICRO Framework This is the ultimate framework for all content creation, from blog posts to video scripts. A great piece of content balances all axes. M - Message: What is the core takeaway? I - Intention: What is the goal? (Persuade, inform, motivate...) C - Context (Audience): Who is this for? R - Rhythm (Tone): What is the style? (Formal, funny, motivational...) O - Output: What is the final format? (Blog post, 5-min video script...) Example: Writing a YouTube Script [Output] Write a 5-minute YouTube script with an intro, body, and conclusion. [Message] Help college students organize their study time effectively. [Intention] Persuade students that AI is a tool for success, not for cutting corners. [Context/Audience] US college students who are stressed and want realistic solutions. [Rhythm/Tone] Fast-paced, encouraging, and motivational. Secret 4: The COSTAR Framework This framework makes the AI think like a professional marketer. Perfect for emails, ads, and landing pages. The Marketing Funnel Workflow Context โ†’ Offer โ†’ Style โ†’ Target โ†’ Action โ†’ Result C - Context: What is this for? (e.g., &quot;A marketing email...&quot;) O - Offer: What is the promotion? (e.g., &quot;25% off for 72 hours...&quot;) S - Style: What is the tone? (e.g., &quot;Simple, warm, and helpful...&quot;) T - Target: Who is the audience? (e.g., &quot;Busy homeowners 25-45...&quot;) A - Action: What should they do? (e.g., &quot;Click the &#x27;Shop Now&#x27; link...&quot;) R - Result: What is the business goal? (e.g., &quot;Boost sales...&quot;) Example: Writing a Promo Email [Context] Write a marketing email for a new promotion on smart home cleaning products. [Offer] 25% off all smart cleaning tools, online only for 72 hours. [Style] Simple, warm, and helpful. Like a friendly tip, not a sales pitch. [Target] Busy homeowners (25-45) who value their free time. [Action] Click the &#x27;Shop Now&#x27; link before the sale ends. [Result] Boost sales and attract new customers. Stop Guessing. Start Directing. The difference between an amateur and a pro is structure. Use these frameworks to provide the clarity, context, and constraints the AI needs to deliver exceptional results. OR this, 4 Secrets to Writing AI Prompts Like a Pro Introduction: From &quot;Good Enough&quot; to &quot;Unbelievable&quot; Youโ€™ve been there. You have a crystal-clear image in your mindโ€”a striking portrait, a dynamic product shot, a breathtaking landscape. You turn to an AI image generator, type in your idea, and the result isโ€ฆ flat. Generic. Plastic-looking. It&#x27;s a &quot;cool car photo&quot; that looks like a 10-year-old video game render, or a &quot;sad man&quot; that looks like a rejected stock photo. This frustration is the single biggest barrier for modern creatives. The gap between the idea in your head and the image on the screen feels vast. But what if that gap wasn&#x27;t a failure of the AI, but simply a failure of communication? Welcome to the world of prompt engineering. If &quot;prompt engineering&quot; sounds like a technical term for coders, it&#x27;s time to reframe it. For creatives, photographers, and artists, prompt engineering is simply the art of creative direction. It&#x27;s the new literacy for a modern artist, no different than learning how to dial in a strobe, choose the right lens, or post-process a raw file. Your prompt is your creative brief, your shot list, and your lighting diagram, all in one. The difference between an amateur&#x27;s AI results and a professional&#x27;s is not luck. Itโ€™s a methodology. This article will deliver four powerful, professional frameworksโ€”ICDF, RCREOC, MICRO, and COSTARโ€”that will transform you from a passive AI user into an active AI director. The core mindset shift is this: Amateurs treat AI as a vending machineโ€”one input, one output, and you hope for the best. Professionals treat AI as a creative collaboratorโ€”an infinitely skilled, lightning-fast, but extremely literal assistant that requires precise, expert direction. It&#x27;s time to become the director. Secret #1: The ICDF Framework (Instruction, Context, Data, Format) The ICDF framework is a simple, powerful structure for getting a precise, analytical result. Most amateurs only provide the &quot;Instruction,&quot; but the AI&#x27;s &quot;Context,&quot; &quot;Data,&quot; and &quot;Format&quot; are what create a professional-grade response. I - Instruction: The specific task you want the AI to perform. C - Context: The background, purpose, or &quot;why&quot; behind the instruction. D - Data: The specific information or inputs the AI should work with. F - Format: The shape and structure of the desired output. Let&#x27;s see how a pro uses this to analyze business data. Prompt Transformation: The ICDF Effect Vague Prompt (Amateur) Pro-Prompt (ICDF Framework) &quot;Analyze my website traffic data.&quot; (I) Instruction: &quot;Analyze the provided traffic and engagement data for my photography portfolio website.&quot; (C) Context: &quot;I am a professional wedding photographer. My goal is to understand which blog posts and gallery pages drive the most &#x27;Contact Form&#x27; submissions. I need to know what content to create next.&quot; (D) Data: &quot;The data includes traffic source, bounce rate, time-on-page, and conversion rate for July-September.&quot; (F) Format: &quot;Provide the analysis in three clear sections: 1. Top 3 Performing Blog Posts, 2. Most-Viewed Gallery Pages, 3. Actionable recommendations for two new blog post ideas. The tone should be professional and concise.&quot; Actionable Takeaway: By providing all four elements, you&#x27;ve taken the guesswork out of it. You&#x27;ve told the AI what to do (Instruction), why (Context), what to use (Data), and how to deliver it (Format). Secret #2: The RCREOC Framework (Role, Context, Request, Examples, Output, Constraints) This is the &quot;AI Agent&quot; framework. This technique stops treating the AI as a simple tool and starts treating it as an expert employee. You give it a Role and a complete &quot;work environment&quot; to operate within. R - Role: Assign it a job title (e.g., &quot;You are a senior photo editor&quot;). C - Context: Describe the situation and the world the &quot;Role&quot; lives in. R - Request: The specific task for the &quot;Role&quot; to complete. E - Examples: Provide a sample of the thinking or output you want. O - Output: Define the structure of the final deliverable (e.g., &quot;a table,&quot; &quot;a list&quot;). C - Constraints: Set the &quot;rules&quot; (e.g., &quot;under 3 sentences,&quot; &quot;use a formal tone&quot;). Prompt Transformation: The RCREOC Effect Vague Prompt (Amateur) Pro-Prompt (RCREOC Framework) &quot;Review these new photos I took.&quot; (R) Role: &quot;You are a senior Art Director at a high-fashion advertising agency.&quot; (C) Context: &quot;We are reviewing a new photographer&#x27;s test shoot for a potential campaign. Your job is to review their weekly reports and identify recurring problems and strengths.&quot; (R) Request: &quot;Review the attached portfolio images and extract: 1. Recurring technical issues, 2. Key compositional strengths, 3. Your professional recommendations for improvement.&quot; (E) Example: &quot;e.g., If you see &#x27;underexposed images,&#x27; note this under &#x27;Issues&#x27; and recommend &#x27;use a light meter&#x27; under &#x27;Recommendations&#x27;.&quot; (O) Output: &quot;The output must be a table with three columns: &#x27;Identified Issue&#x27;, &#x27;Observed Strength&#x27;, and &#x27;Director&#x27;s Recommendation&#x27;.&quot; (C) Constraints: &quot;Each recommendation must be a single, actionable sentence. The tone must be professional, constructive, and clear.&quot; Actionable Takeaway: With RCREOC, you&#x27;ve built a virtual expert. The AI now understands who it is, what the stakes are, what to do, and how to do it. The results will be dramatically more targeted and useful. Secret #3: The MICRO Framework (Message, Intention, Context, Rhythm, Output) This is the ultimate framework for creative content generation. If you write blog posts, scripts, or social media updates, MICRO ensures your &quot;voice&quot; and purpose are not lost in translation. M - Message: The core idea or &quot;thesis&quot; you want to communicate. I - Intention: The purpose of the content. What do you want the audience to feel or do? C - Context: Who is the audience? Where are they seeing this? R - Rhythm: The tone, style, and pace of the content (e.g., &quot;fast-paced,&quot; &quot;academic,&quot; &quot;witty&quot;). O - Output: The final deliverable (e.g., &quot;YouTube script,&quot; &quot;Instagram carousel&quot;). Prompt Transformation: The MICRO Effect Vague Prompt (Amateur) Pro-Prompt (MICRO Framework) &quot;Write a script for a YouTube video about aperture.&quot; (M) Message: &quot;The script needs to explain that aperture controls both light and depth of field in a simple, practical way.&quot; (I) Intention: &quot;The goal is to persuade beginner photographers that aperture is the most important setting to learn first, and to make them feel confident, not intimidated.&quot; (C) Context: &quot;The audience is for the &#x27;Modern Photo Tools&#x27; blog; they are tech-savvy beginners who are new to camera fundamentals. They are watching on YouTube.&quot; (R) Rhythm: &quot;The tone should be fast-paced, encouraging, and simple. Use a &#x27;myth vs. fact&#x27; comparison. Keep it exciting and avoid overly technical jargon.&quot; (O) Output: &quot;A 5-minute YouTube script, complete with an intro hook, main body, and a strong Call-to-Action (CTA) to &#x27;try this at home and share your results&#x27;.&quot; Actionable Takeaway: MICRO forces the AI to think like a writer. It&#x27;s no longer just &quot;writing about aperture&quot;; it&#x27;s persuading a specific audience with a specific tone to achieve a specific goal. Secret #4: The COSTAR Framework (Context, Offer, Style, Target, Action, Result) This is the professional&#x27;s framework for marketing and persuasion. Whether you&#x27;re writing a sales email, a product description, or an ad, COSTAR guides the AI to think like a seasoned marketer. C - Context: What is the situation? (e.g., &quot;launching a new product&quot;). O - Offer: What is the specific deal or product? (e.g., &quot;25% off&quot;). S - Style: The tone and voice (e.g., &quot;elegant,&quot; &quot;urgent,&quot; &quot;friendly&quot;). T - Target: Who is this for? (e.g., &quot;25-45 year old women&quot;). A - Action: What is the one thing you want the reader to do? R - Result: What is the ultimate business goal? Prompt Transformation: The COSTAR Effect Vague Prompt (Amateur) Pro-Prompt (COSTAR Framework) &quot;Write a sales email for my new photo presets.&quot; (C) Context: &quot;Write a marketing email for the launch of my new &#x27;California Light&#x27; Lightroom preset pack.&quot; (O) Offer: &quot;The offer is a 25% discount for the first 3 days.&quot; (S) Style: &quot;The style should be simple, elegant, and warm. Like a message from a trusted friend, not a pushy salesperson. Minimalist and chic.&quot; (T) Target:** &quot;The audience is 25-45 year old lifestyle and wedding photographers who want to improve their editing speed and aesthetics.&quot; (A) Action: &quot;The required action is to &#x27;Click to buy before the offer expires&#x27;.&quot; (R) Result: &quot;The goal is to drive sales in the first 3 days and encourage new customers to try the presets.&quot; Actionable Takeaway: The amateur prompt gets a generic, salesy email. The COSTAR prompt gets a targeted, on-brand message that speaks directly to a specific audience, with a clear call to action, all aligned with a business goal. Conclusion: Your New Creative Partner The four secrets to writing prompts like a pro are not &quot;hacks.&quot; They are a methodology: ICDF (For clear, analytical tasks) RCREOC (For creating an expert &quot;AI Agent&quot;) MICRO (For high-impact creative content) COSTAR (For powerful, targeted marketing) AI is not a replacement for your creative vision; it is a multiplier for it. It is an assistant that can execute your most complex ideas at the speed of thought, but only if you give it the high-quality direction it needs. The photographer, the artist, the directorโ€”that&#x27;s you. You are, and always will be, the creative force. The AI is just the most powerful and versatile camera you&#x27;ve ever owned. You have the framework. You have the professional techniques. Now, go create. What&#x27;s the first &#x27;pro&#x27; prompt you&#x27;re going to try? Share which framework you&#x27;re most excited to use in the comments below! </div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ content</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ blog</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ai-background-generators-2025.md</div> <div class="content">--- id: ai-background-generators-2025 title: &quot;Best AI Background Generators in 2025: Top Tools Compared&quot; excerpt: Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly. publishDate: 2025-02-19 readTime: 12 min read category: tools featuredImage: \images\tools images\AI Background Generator Tool.jpg relatedTool: ai-background-generator keywords: [&quot;AI background generators&quot;, &quot;AI background tools&quot;, &quot;background generation&quot;, &quot;AI photo editing&quot;, &quot;background replacement&quot;] metaTitle: &quot;Best AI Background Generators in 2025: Top Tools Compared&quot; metaDescription: &quot;Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly.&quot; faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How important is integration with my existing workflow?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;If you&#x27;re already invested in specific ecosystems (like Adobe), tools that integrate seamlessly (like Firefly) may be worth prioritizing even if standalone alternatives offer more features. Consider the time saved through smooth integration.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Do I need background generation, replacement, or both?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Some tools excel at creating new backgrounds from prompts (DALL-E 3, Midjourney) while others specialize in replacing backgrounds in existing images (ModernPhotoTools, Adobe Firefly). For comprehensive needs, choose tools that handle both effectively.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;Best AI Background Generators in 2025: Transform Your Visuals Instantly&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;Creating the perfect background for your photos &lt;strong&gt;best photo background editors&lt;/strong&gt; , designs, or marketing materials has never been easier thanks to AI background generators. These innovative tools are revolutionizing how photographers, designers, and content creators work by eliminating hours of manual editing and unleashing new creative possibilities.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Background Generators Tool&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;Generate AI Background Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;In 2025, AI background technology has reached impressive new heights, offering photorealistic results, incredible customization options, and seamless integration with existing workflows. Whether you&#x27;re looking to replace dull backgrounds in product photos, create fantasy landscapes for creative projects, or generate consistent branded backdrops for your marketing campaigns, the right AI tool can transform your process.&lt;/p&gt; &lt;p&gt;This comprehensive guide examines the best AI background generators available in 2025, comparing their features, pricing, strengths, and ideal use cases to help you find the perfect tool for your specific needs.&lt;/p&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#what-are-ai-background-generators&quot;&gt;What Are AI Background Generators and Why Use Them?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison-table&quot;&gt;Comparison of the Best AI Background Generators in 2025&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#modernphototools&quot;&gt;ModernPhotoTools AI Background Generator - Professional-Grade Results&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#dall-e&quot;&gt;DALL-E 3 - Unparalleled Detail and Creative Interpretation&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#midjourney&quot;&gt;Midjourney - Artistic Excellence for Stunning Visual Backgrounds&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#adobe-firefly&quot;&gt;Adobe Firefly - Seamless Creative Cloud Integration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#canva&quot;&gt;Canva - User-Friendly Background Generation for Quick Results&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#other-tools&quot;&gt;Other Notable AI Background Generators in 2025&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Industry-Specific Use Cases for AI Background Generators&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#future-trends&quot;&gt;Future Trends in AI Background Generation for 2025 and Beyond&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-to-choose&quot;&gt;How to Choose the Right AI Background Generator for Your Needs&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion: The Future of Backgrounds is AI-Powered&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;img src=&quot;/images/blog/Modern-Phototools-AI-Background-Generator.webp&quot; alt=&quot;Collection of AI-generated backgrounds showing various styles from photorealistic to abstract&quot;&gt; &lt;/section&gt; &lt;section id=&quot;what-are-ai-background-generators&quot;&gt; &lt;h2&gt;What Are AI Background Generators and Why Use Them?&lt;/h2&gt; &lt;p&gt;AI background generators are specialized tools that use artificial intelligence and machine learning algorithms to create, modify, or replace image backgrounds. These sophisticated systems can generate entirely new backgrounds from text descriptions, seamlessly replace existing backgrounds in photos, or intelligently extend image boundaries beyond their original frame.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Key Benefits of AI Background Generators&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Time Efficiency:&lt;/strong&gt; Create professional backgrounds in seconds instead of hours of manual design work&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Cost Savings:&lt;/strong&gt; Eliminate the need for expensive photo shoots, studio rentals, or purchasing stock images&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Creative Freedom:&lt;/strong&gt; Generate unlimited background variations to find the perfect match for your subject&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Accessibility:&lt;/strong&gt; Create professional-quality backgrounds without advanced design skills&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Consistency:&lt;/strong&gt; Maintain visual cohesion across product lines or marketing campaigns&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt; Easily adapt backgrounds for different platforms, formats, and purposes&lt;/li&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/fb74f267-3dd8-4c93-98b6-d244062c2784.jpg&quot; alt=&quot;Before and after comparison of AI background generation&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Who Benefits Most from AI Background Generators?&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Photographers&lt;/h4&gt; &lt;p&gt;Professional photographers use AI background tools to offer clients more options without additional shoots, create composite images, and rescue otherwise unusable photos with background replacement.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;E-commerce Businesses&lt;/h4&gt; &lt;p&gt;Online retailers leverage AI backgrounds to create consistent product imagery, quickly adapt product photos for seasonal campaigns, and reduce photography costs while maintaining visual quality.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Marketers &amp;amp; Content Creators&lt;/h4&gt; &lt;p&gt;Digital marketers and content creators use these tools to produce engaging social media graphics, create branded content at scale, and maintain visual consistency across campaigns.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;As we explore the best AI background generators of 2025, we&#x27;ll evaluate each tool based on output quality, ease of use, customization options, integration capabilities, and value for money to help you find the perfect match for your specific needs.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;comparison-table&quot;&gt; &lt;h2&gt;Comparison of the Best AI Background Generators in 2025&lt;/h2&gt; &lt;p&gt;Before diving into detailed reviews, let&#x27;s compare the top AI background generators side by side to help you quickly identify which tools might best suit your needs:&lt;/p&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;td data-row=&quot;head&quot;&gt;Tool&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Best For&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Key Features&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Pricing&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Output Quality&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Ease of Use&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;ModernPhotoTools AI Background Generator&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Professional photographers and designers needing precision and customization&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Advanced style control, seamless background blending, batch processing, custom prompt library&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Totally Free &lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;5/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;5/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;DALL-E 3&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Creative professionals needing highly detailed custom backgrounds&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Exceptional detail, creative interpretation, style variety&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;$20/month (ChatGPT Plus)&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;5/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;4/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Midjourney&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Artists and designers seeking aesthetic backgrounds&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Artistic quality, style consistency, community features&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;$10-$60/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4.8/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;3.5/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Adobe Firefly&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Adobe users needing seamless Creative Cloud integration&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Generative fill, background extension, Creative Cloud integration&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;$9.99/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4.7/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;4.5/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Canva&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Marketing teams and beginners needing quick results&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Template library, intuitive interface, multi-format export&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Pro at $12.99/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;5/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Fotor&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Casual users needing simple background solutions&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;One-click background removal, template library, basic editing&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Pro at $8.99/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;3.8/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;4.8/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Picsart&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Social media content creators&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Mobile-friendly, quick generation, social media templates&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Premium from $9/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;3.7/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;4.7/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Artbreeder&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Experimental artists seeking unique backgrounds&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Image blending, collaborative creation, style mixing&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Premium options&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4.2/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;3.5/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Videoleap&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Video content creators&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Video background replacement, motion tracking, effects library&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Pro at $7.99/month&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;4.2/5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Deep Dream Generator&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Abstract and artistic background creation&lt;/td&gt; &lt;td data-label=&quot;Key Features&quot;&gt;Surreal effects, pattern enhancement, style transfer&lt;/td&gt; &lt;td data-label=&quot;Pricing&quot;&gt;Free tier with Premium options&lt;/td&gt; &lt;td data-label=&quot;Output Quality&quot;&gt;4.3/5&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;3.8/5&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;p&gt;Now let&#x27;s explore each of these powerful AI background generators in detail to help you determine which one best fits your specific needs and workflow.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;modernphototools&quot;&gt; &lt;h2&gt;ModernPhotoTools AI Background Generator: Professional-Grade Results with Unmatched Control&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;ModernPhotoTools AI Background Generator stands out in 2025 as one of the most versatile and powerful options for photographers, designers, and content creators who demand precision and customization. This tool combines cutting-edge AI technology with an intuitive interface to deliver exceptional background generation capabilities.&lt;/p&gt; &lt;p&gt;What sets ModernPhotoTools apart is its unique approach to background generation that prioritizes both quality and control. Unlike many competitors that offer limited customization options, this tool provides granular control over every aspect of your generated backgrounds while maintaining an accessible user experience.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;/images/blog/Modern-Phototools-AI-Background-Generator.webp&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.8&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;div class=&quot;rating-label&quot;&gt;Overall Rating&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-details&quot;&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Output Quality&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 96%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.8/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Ease of Use&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 90%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Customization Options&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 98%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.9/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Integration Capabilities&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 92%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.6/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Value for Money&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 94%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.7/5&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Key Features of ModernPhotoTools AI Background Generator&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Advanced Style Control:&lt;/strong&gt; Fine-tune every aspect of your generated backgrounds with precise controls for lighting, texture, depth, and color harmony&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Seamless Background Blending:&lt;/strong&gt; Proprietary AI algorithms ensure subjects blend naturally with new backgrounds, maintaining realistic lighting and shadows&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Batch Processing:&lt;/strong&gt; Generate consistent backgrounds across multiple images simultaneously, perfect for product catalogs or marketing campaigns&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Custom Prompt Library:&lt;/strong&gt; Save and organize your favorite prompts and settings for quick access to your most successful background styles&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Background Extension:&lt;/strong&gt; Intelligently expand existing backgrounds beyond their original boundaries for more composition flexibility&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Multi-Format Export:&lt;/strong&gt; Export your creations in various formats and resolutions optimized for different platforms and purposes&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Pros&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Exceptional output quality with photorealistic results&lt;/li&gt; &lt;li&gt;Intuitive interface balancing power with accessibility&lt;/li&gt; &lt;li&gt;Unmatched customization options for precise control&lt;/li&gt; &lt;li&gt;Generous free tier with substantial features&lt;/li&gt; &lt;li&gt;Regular updates with new features and improvements&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h4 class=&quot;cons-title&quot;&gt;Cons&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Some specialized industry-specific templates still in development&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Pricing&lt;/h3&gt; &lt;div class=&quot;list-comparison&quot;&gt; &lt;ul class=&quot;list-comparison-column list-comparison-primary&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Totally Free &lt;/h4&gt; &lt;li&gt;Unlimited &lt;/li&gt; &lt;li&gt;Access to basic style controls&lt;/li&gt; &lt;li&gt;Export in standard resolution&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;h3&gt;Ideal Use Cases&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Professional Photography&lt;/h4&gt; &lt;p&gt;Perfect for portrait photographers who need to offer clients multiple background options or product photographers requiring consistent, high-quality backgrounds across entire catalogs.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;E-commerce&lt;/h4&gt; &lt;p&gt;Ideal for online retailers who need to maintain visual consistency across product lines or quickly update product backgrounds for seasonal campaigns without reshooting.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Digital Marketing&lt;/h4&gt; &lt;p&gt;Excellent for marketing teams creating cohesive visual content across multiple platforms, allowing for quick adaptation of imagery to different formats and contexts.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Experience Professional-Grade AI Background Generation&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Transform your creative workflow with ModernPhotoTools AI Background Generator. Start creating stunning, customized backgrounds in minutes with our powerful yet intuitive platform.&lt;/p&gt; &lt;div class=&quot;cta-block-buttons&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try For Free&lt;/a&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-secondary&quot;&gt;View Examples&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;dall-e&quot;&gt; &lt;h2&gt;DALL-E 3: Unparalleled Detail and Creative Interpretation&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;DALL-E 3, integrated with ChatGPT Plus, represents the pinnacle of AI-generated imagery in 2025. This powerful model excels at transforming detailed text descriptions into stunning, highly detailed backgrounds with remarkable accuracy and creative interpretation.&lt;/p&gt; &lt;p&gt;What makes DALL-E 3 stand out is its exceptional understanding of complex prompts and ability to generate backgrounds with intricate details, consistent lighting, and coherent themes. The integration with ChatGPT provides a conversational interface that helps refine prompts for optimal results.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b0bd8cf9-c5d7-4fbe-85d0-e81a8a996251.jpg&quot; alt=&quot;DALL-E 3 generated backgrounds showing exceptional detail and creative interpretation&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.7&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;div class=&quot;rating-label&quot;&gt;Overall Rating&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-details&quot;&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Output Quality&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 98%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.9/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Ease of Use&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 80%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.0/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Customization Options&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 90%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Integration Capabilities&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 84%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.2/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Value for Money&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 88%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.4/5&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Key Features&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Exceptional Detail:&lt;/strong&gt; Creates backgrounds with remarkable intricacy and coherence, capturing subtle elements described in prompts&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Creative Interpretation:&lt;/strong&gt; Intelligently fills in details not explicitly mentioned, creating cohesive and imaginative scenes&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style Versatility:&lt;/strong&gt; Excels at generating backgrounds in various styles, from photorealistic to artistic or stylized&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Conversational Refinement:&lt;/strong&gt; Leverages ChatGPT to help refine prompts through natural conversation&lt;/li&gt; &lt;li&gt;&lt;strong&gt;High Resolution:&lt;/strong&gt; Generates backgrounds at 1792ร—1024 pixels, suitable for most professional applications&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Multiple Variations:&lt;/strong&gt; Produces four different interpretations of each prompt, offering creative options&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Pros&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Unmatched detail and realism in generated backgrounds&lt;/li&gt; &lt;li&gt;Excellent understanding of complex prompts&lt;/li&gt; &lt;li&gt;Consistent lighting and perspective across the image&lt;/li&gt; &lt;li&gt;Helpful conversational interface for prompt refinement&lt;/li&gt; &lt;li&gt;Regular model improvements and updates&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h4 class=&quot;cons-title&quot;&gt;Cons&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Requires ChatGPT Plus subscription ($20/month)&lt;/li&gt; &lt;li&gt;Limited post-generation editing capabilities&lt;/li&gt; &lt;li&gt;No batch processing for multiple backgrounds&lt;/li&gt; &lt;li&gt;Cannot directly edit existing images or replace backgrounds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Pricing&lt;/h3&gt; &lt;p&gt;DALL-E 3 is available exclusively through a ChatGPT Plus subscription, priced at $20 per month. This subscription includes access to GPT-4, DALL-E 3, and other premium features.&lt;/p&gt; &lt;h3&gt;Ideal Use Cases&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Concept Art&lt;/h4&gt; &lt;p&gt;Perfect for artists and designers who need detailed background concepts for illustrations, games, or film projects, allowing quick visualization of complex scenes.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Marketing Visuals&lt;/h4&gt; &lt;p&gt;Excellent for creating unique, eye-catching backgrounds for advertising campaigns, social media content, and brand materials that stand out from stock imagery.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Editorial Content&lt;/h4&gt; &lt;p&gt;Ideal for publishers and content creators who need custom backgrounds for articles, blog posts, and digital publications with specific thematic requirements.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;While DALL-E 3 excels at generating highly detailed, creative backgrounds from text prompts, it&#x27;s important to note that it doesn&#x27;t offer background replacement or editing features for existing images. For those specific needs, tools like ModernPhotoTools AI Background Generator provide more comprehensive solutions.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/73888f78-82ef-4d15-a4fb-b06e5d776ff7.jpg&quot; alt=&quot;Comparison of DALL-E 3 outputs from different prompts showing style versatility&quot;&gt; &lt;/section&gt; &lt;section id=&quot;midjourney&quot;&gt; &lt;h2&gt;Midjourney: Artistic Excellence for Stunning Visual Backgrounds&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;Midjourney has established itself as a premier choice for artists and designers seeking aesthetically pleasing, artistic backgrounds. In 2025, it continues to stand out for its exceptional ability to generate visually striking imagery with a distinctive artistic quality that many creators find irresistible.&lt;/p&gt; &lt;p&gt;What distinguishes Midjourney is its remarkable aesthetic sensibilityโ€”backgrounds created with this tool often have a painterly quality with beautiful composition, lighting, and color harmony that feels intentionally crafted rather than algorithmically generated.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ed9a2214-4b10-42a7-8f1c-3948aca4e2a3.jpg&quot; alt=&quot;Midjourney generated artistic backgrounds showing its distinctive aesthetic quality&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.6&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;div class=&quot;rating-label&quot;&gt;Overall Rating&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-details&quot;&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Output Quality&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 96%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.8/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Ease of Use&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 70%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;3.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Customization Options&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 88%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.4/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Integration Capabilities&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 76%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;3.8/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Value for Money&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 84%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.2/5&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Key Features&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Artistic Quality:&lt;/strong&gt; Creates backgrounds with exceptional aesthetic appeal and artistic coherence&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style Consistency:&lt;/strong&gt; Maintains consistent artistic style across different prompts when using similar parameters&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Parameter Control:&lt;/strong&gt; Offers advanced parameters for fine-tuning aspects like stylization, chaos, quality, and aspect ratio&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Variation Commands:&lt;/strong&gt; Generates multiple variations of a concept with simple commands&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Community Features:&lt;/strong&gt; Provides inspiration through a vibrant community of creators sharing their work&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Discord Integration:&lt;/strong&gt; Operates primarily through Discord, allowing for collaborative creation and feedback&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Pros&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Exceptional artistic quality and aesthetic appeal&lt;/li&gt; &lt;li&gt;Strong community for inspiration and learning&lt;/li&gt; &lt;li&gt;Regular model updates improving capabilities&lt;/li&gt; &lt;li&gt;Ability to create unique, distinctive backgrounds&lt;/li&gt; &lt;li&gt;High-resolution output options&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h4 class=&quot;cons-title&quot;&gt;Cons&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Discord-based interface may be unfamiliar to some users&lt;/li&gt; &lt;li&gt;Steeper learning curve for optimal results&lt;/li&gt; &lt;li&gt;Limited background replacement capabilities&lt;/li&gt; &lt;li&gt;Higher-tier subscriptions needed for private mode&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Pricing&lt;/h3&gt; &lt;div class=&quot;list-comparison&quot;&gt; &lt;ul class=&quot;list-comparison-column list-comparison-primary&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Basic Plan ($10/month)&lt;/h4&gt; &lt;li&gt;3.3 hours of GPU time per month&lt;/li&gt; &lt;li&gt;Standard generation speed&lt;/li&gt; &lt;li&gt;Community features&lt;/li&gt; &lt;li&gt;Basic resolution options&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-success&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Standard Plan ($30/month)&lt;/h4&gt; &lt;li&gt;15 hours of GPU time per month&lt;/li&gt; &lt;li&gt;Faster generation speed&lt;/li&gt; &lt;li&gt;Community features&lt;/li&gt; &lt;li&gt;Higher resolution options&lt;/li&gt; &lt;li&gt;Relaxed usage limits&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-warning&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Pro Plan ($60/month)&lt;/h4&gt; &lt;li&gt;30 hours of GPU time per month&lt;/li&gt; &lt;li&gt;Maximum generation speed&lt;/li&gt; &lt;li&gt;Community features&lt;/li&gt; &lt;li&gt;Highest resolution options&lt;/li&gt; &lt;li&gt;Stealth/private mode&lt;/li&gt; &lt;li&gt;Priority support&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;h3&gt;Ideal Use Cases&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Creative Projects&lt;/h4&gt; &lt;p&gt;Perfect for artists, illustrators, and designers seeking unique, aesthetically pleasing backgrounds with artistic flair for creative projects and portfolios.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Concept Development&lt;/h4&gt; &lt;p&gt;Excellent for quickly visualizing concepts for film, gaming, or illustration projects with consistent artistic style and mood.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Artistic Marketing&lt;/h4&gt; &lt;p&gt;Ideal for brands with an artistic aesthetic who want distinctive, eye-catching backgrounds for campaigns that stand out from typical commercial imagery.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Midjourney excels at creating beautiful, artistic backgrounds from text prompts, but like DALL-E 3, it doesn&#x27;t offer background replacement features for existing images. For comprehensive background generation and replacement capabilities, consider ModernPhotoTools AI Background Generator, which combines artistic quality with practical editing features.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/9e0fbe4e-09cd-4d86-ae7f-b8e6f8d7d814.jpg&quot; alt=&quot;Examples of Midjourney parameter variations showing how different settings affect the same basic prompt&quot;&gt; &lt;/section&gt; &lt;section id=&quot;adobe-firefly&quot;&gt; &lt;h2&gt;Adobe Firefly: Seamless Creative Cloud Integration with Powerful Generation&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;Adobe Firefly has evolved into a formidable AI background generation tool in 2025, particularly for professionals already embedded in the Adobe ecosystem. Its tight integration with Creative Cloud applications like Photoshop and Illustrator makes it an efficient choice for designers and creative professionals.&lt;/p&gt; &lt;p&gt;What sets Firefly apart is its focus on commercial safety and seamless workflow integration. Trained on licensed content and public domain imagery, Firefly provides peace of mind for commercial projects while offering powerful features like generative fill and background extension that work directly within familiar Adobe interfaces.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/406dd4bc-6703-4ce9-a83d-d1fe477099ec.jpg&quot; alt=&quot;Adobe Firefly interface showing background generation and integration with Photoshop&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.6&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;div class=&quot;rating-label&quot;&gt;Overall Rating&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-details&quot;&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Output Quality&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 90%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Ease of Use&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 90%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Customization Options&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 88%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.4/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Integration Capabilities&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 98%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.9/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Value for Money&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 86%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.3/5&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Key Features&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Generative Fill:&lt;/strong&gt; Intelligently fills selected areas with AI-generated content that matches the surrounding context&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Background Extension:&lt;/strong&gt; Seamlessly extends backgrounds beyond their original boundaries with contextually appropriate content&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Creative Cloud Integration:&lt;/strong&gt; Works directly within Photoshop, Illustrator, and other Adobe applications&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Commercial Safety:&lt;/strong&gt; Trained on licensed content, providing confidence for commercial usage&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Text-to-Image Generation:&lt;/strong&gt; Creates backgrounds from text descriptions with style controls&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Bulk Processing:&lt;/strong&gt; Applies consistent background modifications across multiple images&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Pros&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Seamless integration with Adobe Creative Cloud&lt;/li&gt; &lt;li&gt;Commercially safe content generation&lt;/li&gt; &lt;li&gt;Powerful in-context editing capabilities&lt;/li&gt; &lt;li&gt;Familiar interface for Adobe users&lt;/li&gt; &lt;li&gt;Regular updates aligned with Creative Cloud&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h4 class=&quot;cons-title&quot;&gt;Cons&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Requires Adobe subscription for full functionality&lt;/li&gt; &lt;li&gt;Limited standalone capabilities outside Adobe ecosystem&lt;/li&gt; &lt;li&gt;Fewer artistic style options than specialized tools&lt;/li&gt; &lt;li&gt;Higher combined cost when factoring in Creative Cloud&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Pricing&lt;/h3&gt; &lt;p&gt;Adobe Firefly is available as part of Adobe&#x27;s Creative Cloud subscription or as a standalone service:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Standalone Firefly:&lt;/strong&gt; $9.99/month&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Creative Cloud Single App (with Firefly):&lt;/strong&gt; Starting at $20.99/month&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Creative Cloud All Apps (with Firefly):&lt;/strong&gt; Starting at $54.99/month&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Ideal Use Cases&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Professional Design&lt;/h4&gt; &lt;p&gt;Perfect for designers already working in the Adobe ecosystem who need to seamlessly integrate AI background generation into their established workflows.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Commercial Projects&lt;/h4&gt; &lt;p&gt;Ideal for agencies and businesses requiring commercially safe content generation with proper licensing for client work and marketing materials.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Complex Edits&lt;/h4&gt; &lt;p&gt;Excellent for projects requiring sophisticated background manipulation within existing images, leveraging Photoshop&#x27;s editing capabilities enhanced by AI.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Adobe Firefly offers powerful background generation capabilities, especially for those already invested in the Adobe ecosystem. However, for users seeking a standalone solution with more specialized background generation features, ModernPhotoTools AI Background Generator provides a more focused and cost-effective alternative.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/92f5bb56-41a5-4a03-b58f-a01a495cfde8.jpg&quot; alt=&quot;Before and after examples of Adobe Firefly&#x27;s background extension and generative fill capabilities&quot;&gt; &lt;/section&gt; &lt;section id=&quot;canva&quot;&gt; &lt;h2&gt;Canva: User-Friendly Background Generation for Quick Results&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;Canva has solidified its position as one of the most accessible AI background generators in 2025, particularly for marketing teams, social media managers, and users without extensive design experience. Its intuitive interface and template-based approach make it exceptionally easy to create professional-looking backgrounds quickly.&lt;/p&gt; &lt;p&gt;What makes Canva stand out is its all-in-one approach that combines AI background generation with a comprehensive design platform. Users can not only create backgrounds but also immediately incorporate them into designs with text, graphics, and other elements, streamlining the entire creative process.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b6ab490a-a3f2-475d-9220-babc2733d65c.jpg&quot; alt=&quot;Canva&#x27;s AI background generator interface showing template options and customization tools&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.5&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;div class=&quot;rating-label&quot;&gt;Overall Rating&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-details&quot;&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Output Quality&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 80%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.0/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Ease of Use&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 98%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.9/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Customization Options&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 82%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.1/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Integration Capabilities&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 90%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.5/5&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-item&quot;&gt; &lt;div class=&quot;rating-name&quot;&gt;Value for Money&lt;/div&gt; &lt;div class=&quot;rating-bar-container&quot;&gt; &lt;div class=&quot;rating-bar&quot; style=&quot;width: 92%&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;rating-value&quot;&gt;4.6/5&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Key Features&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Text-to-Background Generation:&lt;/strong&gt; Creates backgrounds from simple text prompts with style presets&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Background Removal:&lt;/strong&gt; Automatically removes backgrounds from uploaded images&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Template Library:&lt;/strong&gt; Offers thousands of templates with customizable backgrounds&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style Controls:&lt;/strong&gt; Provides sliders for adjusting colors, gradients, and patterns&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Multi-Format Export:&lt;/strong&gt; Exports designs in various formats optimized for different platforms&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Collaboration Tools:&lt;/strong&gt; Enables team collaboration on background designs&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Pros&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Exceptionally intuitive interface requiring minimal learning&lt;/li&gt; &lt;li&gt;All-in-one platform for background creation and design&lt;/li&gt; &lt;li&gt;Extensive template library for quick starting points&lt;/li&gt; &lt;li&gt;Strong free tier with substantial features&lt;/li&gt; &lt;li&gt;Excellent mobile app for on-the-go creation&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h4 class=&quot;cons-title&quot;&gt;Cons&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Less detailed output compared to specialized AI tools&lt;/li&gt; &lt;li&gt;Limited fine control over generation parameters&lt;/li&gt; &lt;li&gt;Advanced features require Pro subscription&lt;/li&gt; &lt;li&gt;Occasional rendering delays with complex designs&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Pricing&lt;/h3&gt; &lt;div class=&quot;list-comparison&quot;&gt; &lt;ul class=&quot;list-comparison-column list-comparison-primary&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Free Plan&lt;/h4&gt; &lt;li&gt;Basic AI background generation&lt;/li&gt; &lt;li&gt;250,000+ free templates&lt;/li&gt; &lt;li&gt;5GB cloud storage&lt;/li&gt; &lt;li&gt;Limited background removal&lt;/li&gt; &lt;li&gt;Basic collaboration&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-success&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Pro Plan ($12.99/month)&lt;/h4&gt; &lt;li&gt;Advanced AI background generation&lt;/li&gt; &lt;li&gt;100+ million premium stock photos&lt;/li&gt; &lt;li&gt;100GB cloud storage&lt;/li&gt; &lt;li&gt;Background remover tool&lt;/li&gt; &lt;li&gt;Magic resize for multiple formats&lt;/li&gt; &lt;li&gt;Brand kit for consistent designs&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-warning&quot;&gt; &lt;h4 class=&quot;list-comparison-title&quot;&gt;Teams ($14.99/user/month)&lt;/h4&gt; &lt;li&gt;All Pro features&lt;/li&gt; &lt;li&gt;Team templates and folders&lt;/li&gt; &lt;li&gt;Team collaboration tools&lt;/li&gt; &lt;li&gt;Approval workflows&lt;/li&gt; &lt;li&gt;Unlimited storage&lt;/li&gt; &lt;li&gt;Single sign-on&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;h3&gt;Ideal Use Cases&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Social Media Marketing&lt;/h4&gt; &lt;p&gt;Perfect for social media managers who need to quickly create and adapt background designs for multiple platforms and campaigns with consistent branding.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Small Business Marketing&lt;/h4&gt; &lt;p&gt;Ideal for small business owners without design teams who need professional-looking backgrounds for marketing materials, websites, and social media.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Content Creation&lt;/h4&gt; &lt;p&gt;Excellent for content creators, bloggers, and YouTubers who need attractive backgrounds for thumbnails, featured images, and presentation graphics.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Canva offers a user-friendly approach to AI background generation that&#x27;s perfect for quick results and all-in-one design needs. However, for users requiring more specialized background generation with greater control and higher-quality outputs, ModernPhotoTools AI Background Generator provides a more focused solution with professional-grade results.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/c99ef565-d8d5-41c5-ae54-ce39c4e7b846.jpg&quot; alt=&quot;Examples of Canva&#x27;s AI-generated backgrounds used in different design contexts&quot;&gt; &lt;/section&gt; &lt;section id=&quot;other-tools&quot;&gt; &lt;h2&gt;Other Notable AI Background Generators in 2025&lt;/h2&gt; &lt;p&gt;Beyond our top five picks, several other AI background generators offer unique features and capabilities worth considering depending on your specific needs:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Fotor: Intuitive Background Generation for Casual Users&lt;/h3&gt; &lt;p&gt;Fotor has evolved into a reliable AI background generator that balances simplicity with effective results. Its straightforward interface makes it accessible to users with minimal technical expertise, while still delivering quality backgrounds for everyday use.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Key Features:&lt;/strong&gt; One-click background removal, text-to-image generation, template library&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Best For:&lt;/strong&gt; Casual users needing simple background solutions&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; Free tier with Pro at $8.99/month&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;rating-container compact&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.2&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Picsart: Mobile-First Background Generation&lt;/h3&gt; &lt;p&gt;Picsart excels as a mobile-centric AI background generator, perfect for content creators who work primarily on smartphones and tablets. Its touch-optimized interface and social media focus make it particularly valuable for influencers and social media managers.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Key Features:&lt;/strong&gt; Mobile-optimized interface, quick generation, social templates&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Best For:&lt;/strong&gt; Social media content creators working on mobile&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; Free tier with Premium from $9/month&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;rating-container compact&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.1&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Artbreeder: Experimental Background Blending&lt;/h3&gt; &lt;p&gt;Artbreeder offers a unique approach to AI background generation through its collaborative breeding system. By blending existing images and controlling their genetic attributes, users can create truly unique backgrounds that evolve through iterative refinement.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Key Features:&lt;/strong&gt; Image blending, collaborative creation, style mixing&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Best For:&lt;/strong&gt; Experimental artists seeking unique backgrounds&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; Free tier with Premium options&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;rating-container compact&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.0&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Videoleap: Video Background Generation&lt;/h3&gt; &lt;p&gt;Videoleap specializes in AI background generation for video content, filling an important niche for content creators working with motion rather than still images. Its ability to replace video backgrounds without green screens makes it invaluable for video producers.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Key Features:&lt;/strong&gt; Video background replacement, motion tracking, effects library&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Best For:&lt;/strong&gt; Video content creators&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; Free tier with Pro at $7.99/month&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;rating-container compact&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;4.1&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Deep Dream Generator: Abstract Artistic Backgrounds&lt;/h3&gt; &lt;p&gt;Deep Dream Generator creates distinctively surreal and abstract backgrounds by enhancing and exaggerating patterns within images. This unique approach makes it perfect for artistic projects requiring dreamlike, psychedelic, or highly stylized backgrounds.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Key Features:&lt;/strong&gt; Surreal effects, pattern enhancement, style transfer&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Best For:&lt;/strong&gt; Abstract and artistic background creation&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pricing:&lt;/strong&gt; Free tier with Premium options&lt;/li&gt; &lt;/div&gt; &lt;div class=&quot;rating-container compact&quot;&gt; &lt;div class=&quot;rating-overall&quot;&gt; &lt;div class=&quot;rating-score&quot;&gt;3.9&lt;/div&gt; &lt;div class=&quot;rating-stars&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/f869219d-351f-4937-993d-dd12176a2590.jpg&quot; alt=&quot;Collage of backgrounds created with various specialized AI background generators&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;While these tools offer valuable specialized features, they generally provide more focused functionality compared to our top recommendations. For users seeking the most comprehensive and versatile AI background generation solution, ModernPhotoTools AI Background Generator combines the best aspects of these specialized tools with an intuitive interface and professional-grade results.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Industry-Specific Use Cases for AI Background Generators&lt;/h2&gt; &lt;p&gt;AI background generators are transforming workflows across numerous industries. Here&#x27;s how different professionals are leveraging these tools in 2025:&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Photography&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/0c316758-21a1-419d-80dd-7005a52aa420.jpg&quot; alt=&quot;Professional photographer using AI background generator to offer client multiple background options&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Portrait Enhancement:&lt;/strong&gt; Offering clients multiple background options without additional shoots&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Product Photography:&lt;/strong&gt; Creating consistent backgrounds across product lines&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Composite Creation:&lt;/strong&gt; Combining subjects from different shoots into cohesive scenes&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Portfolio Diversification:&lt;/strong&gt; Showcasing versatility with varied background styles&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; ModernPhotoTools AI Background Generator excels for photographers with its precise control and professional-quality outputs.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;E-commerce&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b854b716-b096-4cbd-b546-a85a87bcb6e2.jpg&quot; alt=&quot;E-commerce product lineup with consistent AI-generated backgrounds&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Product Catalog Consistency:&lt;/strong&gt; Maintaining visual cohesion across entire product lines&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Seasonal Updates:&lt;/strong&gt; Quickly adapting product imagery for holiday or seasonal campaigns&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Cost Reduction:&lt;/strong&gt; Eliminating expensive photo shoots for background variations&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Marketplace Optimization:&lt;/strong&gt; Creating backgrounds that increase conversion on specific platforms&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; ModernPhotoTools AI Background Generator&#x27;s batch processing makes it ideal for e-commerce businesses managing large product catalogs.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Digital Marketing&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/6eeacdbd-9211-40a1-9f06-294798a3ffbd.jpg&quot; alt=&quot;Marketing team creating campaign materials with consistent AI backgrounds across different formats&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Multi-Platform Campaigns:&lt;/strong&gt; Creating consistent visuals across different marketing channels&lt;/li&gt; &lt;li&gt;&lt;strong&gt;A/B Testing:&lt;/strong&gt; Quickly generating background variations to test audience response&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Content Calendars:&lt;/strong&gt; Producing background templates for ongoing content needs&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Ad Personalization:&lt;/strong&gt; Tailoring backgrounds to specific audience segments&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; Canva works well for marketing teams needing quick results across multiple formats, while ModernPhotoTools offers higher quality for premium campaigns.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Game Development&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/cab5b35e-9a03-4b00-8e5b-baf0da861fe7.jpg&quot; alt=&quot;Game development team using AI background generators for concept art and environment design&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Concept Art:&lt;/strong&gt; Rapidly generating environment concepts for review&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Texture Creation:&lt;/strong&gt; Developing unique textures and patterns for game assets&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Level Design:&lt;/strong&gt; Creating background variations for different game levels&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Marketing Assets:&lt;/strong&gt; Producing promotional imagery for game marketing&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; Midjourney&#x27;s artistic quality makes it excellent for game concept art, while DALL-E 3 excels at detailed environment concepts.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Real Estate&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/59f0b9e3-4e2d-499a-8834-a40d354bf9f9.jpg&quot; alt=&quot;Real estate professional using AI to stage virtual properties with different background styles&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Virtual Staging:&lt;/strong&gt; Digitally furnishing empty properties with different styles&lt;/li&gt; &lt;li&gt;&lt;strong&gt;View Enhancement:&lt;/strong&gt; Improving window views or outdoor spaces&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Season Adaptation:&lt;/strong&gt; Showing properties in different seasons or times of day&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Renovation Visualization:&lt;/strong&gt; Demonstrating potential renovation outcomes&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; Adobe Firefly&#x27;s generative fill and realistic outputs work well for real estate applications requiring subtle, believable enhancements.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Education&lt;/h3&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ed419ca0-5e0e-4cef-8eb8-b5732736ba23.jpg&quot; alt=&quot;Educator creating engaging learning materials with AI-generated historical or scientific backgrounds&quot;&gt; &lt;h4&gt;Key Applications:&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Historical Visualization:&lt;/strong&gt; Creating period-accurate backgrounds for history lessons&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Scientific Illustration:&lt;/strong&gt; Generating backgrounds that visualize scientific concepts&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Interactive Learning:&lt;/strong&gt; Developing engaging visual contexts for educational content&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Presentation Enhancement:&lt;/strong&gt; Improving the visual appeal of educational presentations&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Recommended Tool:&lt;/strong&gt; DALL-E 3&#x27;s detailed outputs and educational accuracy make it valuable for creating instructional backgrounds.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Find the Perfect AI Background Solution for Your Industry&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Whether you&#x27;re a photographer, marketer, educator, or e-commerce professional, ModernPhotoTools AI Background Generator offers the versatility, quality, and control you need to transform your visual content.&lt;/p&gt; &lt;div class=&quot;cta-block-buttons&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try ModernPhotoTools Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;future-trends&quot;&gt; &lt;h2&gt;Future Trends in AI Background Generation for 2025 and Beyond&lt;/h2&gt; &lt;p&gt;The field of AI background generation continues to evolve rapidly. Here are the key trends shaping the future of this technology in 2025 and beyond:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Hyper-Personalization&lt;/h3&gt; &lt;p&gt;AI background generators are becoming increasingly capable of creating highly personalized backgrounds tailored to specific brand identities, individual preferences, and target audiences. This trend is enabling unprecedented levels of customization without requiring extensive manual design work.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Brand DNA Analysis:&lt;/strong&gt; AI systems analyzing brand assets to generate perfectly matched backgrounds&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Audience-Adaptive Backgrounds:&lt;/strong&gt; Backgrounds that automatically adjust based on viewer demographics or preferences&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Personal Style Learning:&lt;/strong&gt; Systems that learn individual creative preferences over time&lt;/li&gt; &lt;/div&gt; &lt;p&gt;Tools like ModernPhotoTools AI Background Generator are leading this trend with advanced customization options and style controls that allow for precise alignment with specific visual identities.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/21bb8fcf-9856-4c72-96a6-535d394b48e4.jpg&quot; alt=&quot;Futuristic interface showing AI analyzing brand elements to create perfectly matched backgrounds&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/e35265c0-f0cd-47cc-bd96-f9302603f094.jpg&quot; alt=&quot;Demonstration of AI-generated video backgrounds with consistent style across motion sequences&quot;&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Video Background Generation&lt;/h3&gt; &lt;p&gt;While still image background generation has matured, video background generation is emerging as the next frontier. AI systems are now beginning to generate consistent, high-quality animated backgrounds or replace backgrounds in video content without requiring green screens.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Temporal Consistency:&lt;/strong&gt; Maintaining perfect style and element consistency across frames&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Motion Generation:&lt;/strong&gt; Creating natural movement within generated backgrounds&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Real-Time Processing:&lt;/strong&gt; Enabling live background replacement for streaming and video calls&lt;/li&gt; &lt;/div&gt; &lt;p&gt;Videoleap is currently pioneering in this space, but we expect to see more comprehensive solutions emerging from leaders like ModernPhotoTools as the technology matures.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;3D and Immersive Backgrounds&lt;/h3&gt; &lt;p&gt;The line between 2D background generation and 3D environment creation is blurring. Next-generation AI tools are beginning to generate three-dimensional, navigable spaces from simple prompts, opening new possibilities for virtual reality, augmented reality, and interactive media.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Depth Map Generation:&lt;/strong&gt; Creating accurate spatial information for immersive experiences&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Multi-Angle Consistency:&lt;/strong&gt; Generating backgrounds that maintain coherence when viewed from different angles&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Interactive Elements:&lt;/strong&gt; Including responsive elements within generated backgrounds&lt;/li&gt; &lt;/div&gt; &lt;p&gt;This trend represents a significant evolution beyond traditional background generation, potentially transforming how we create and interact with virtual environments.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/2af146ce-3cf8-43b9-8ff7-2a49d6595c03.jpg&quot; alt=&quot;3D environment generated from a simple text prompt showing depth and spatial coherence&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/ce9a1ee5-bccd-424c-8ed8-951f77731170.jpg&quot; alt=&quot;Collaborative AI background generation with multiple users contributing to a shared creative process&quot;&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Collaborative Creation&lt;/h3&gt; &lt;p&gt;AI background generators are evolving to support collaborative workflows, allowing multiple users to contribute to and refine generated backgrounds in real-time. This trend is particularly valuable for creative teams working remotely or across different disciplines.&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Multi-User Editing:&lt;/strong&gt; Simultaneous contribution to background generation by team members&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Role-Based Controls:&lt;/strong&gt; Specialized interfaces for different team roles (art director, designer, client)&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Version History:&lt;/strong&gt; Tracking the evolution of generated backgrounds through iterations&lt;/li&gt; &lt;/div&gt; &lt;p&gt;Tools with strong collaboration features like Canva are expanding in this direction, while specialized platforms like ModernPhotoTools are adding team-oriented capabilities to their professional toolsets.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Ethical and Sustainable AI&lt;/h3&gt; &lt;p&gt;As AI background generation becomes more widespread, ethical considerations and sustainability are emerging as important factors in tool selection and development:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h4&gt;Ethical Considerations&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Transparent Training:&lt;/strong&gt; Clear disclosure of what data was used to train AI models&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Artist Attribution:&lt;/strong&gt; Systems that acknowledge artistic influences or compensate artists&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Content Safeguards:&lt;/strong&gt; Preventing the generation of harmful or inappropriate content&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Authenticity Indicators:&lt;/strong&gt; Clear marking of AI-generated content to prevent misrepresentation&lt;/li&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h4&gt;Sustainability Focus&lt;/h4&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Energy Efficiency:&lt;/strong&gt; Optimized models that require less computational power&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Local Processing:&lt;/strong&gt; On-device generation to reduce cloud server demands&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Resource Optimization:&lt;/strong&gt; Smarter caching and processing to minimize environmental impact&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Longevity Design:&lt;/strong&gt; Creating timeless backgrounds that reduce the need for frequent regeneration&lt;/li&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Leaders in the space like Adobe Firefly (with its focus on commercially licensed training data) and ModernPhotoTools (with its efficient processing algorithms) are setting standards for responsible AI background generation that others are likely to follow.&lt;/p&gt; &lt;div class=&quot;highlight-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Expert Insight:&lt;/strong&gt; &quot;The future of AI background generation isn&#x27;t just about more realistic imagesโ€”it&#x27;s about creating intelligent environments that understand context, adapt to needs, and integrate seamlessly with human creativity. The tools that will lead in 2026 and beyond are those that augment rather than replace the creative process.&quot;&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;how-to-choose&quot;&gt; &lt;h2&gt;How to Choose the Right AI Background Generator for Your Needs&lt;/h2&gt; &lt;p&gt;With so many options available, selecting the ideal AI background generator requires careful consideration of your specific requirements. Here&#x27;s a framework to help you make the right choice:&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Assess Your Primary Use Case&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Content Creation:&lt;/strong&gt; Focus on tools with diverse style options and quick generation&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Professional Photography:&lt;/strong&gt; Prioritize output quality and precise control&lt;/li&gt; &lt;li&gt;&lt;strong&gt;E-commerce:&lt;/strong&gt; Look for batch processing and consistent results&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Marketing:&lt;/strong&gt; Consider multi-format support and brand consistency features&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Concept Art:&lt;/strong&gt; Emphasize creative interpretation and artistic quality&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Best Match:&lt;/strong&gt; For professional photography and precision, ModernPhotoTools AI Background Generator offers unmatched control and quality.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Evaluate Technical Requirements&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Output Resolution:&lt;/strong&gt; Higher resolution needs may require premium tools&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Processing Speed:&lt;/strong&gt; Consider how quickly you need results&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Integration Needs:&lt;/strong&gt; Assess compatibility with your existing workflow&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Batch Capabilities:&lt;/strong&gt; Essential for processing multiple images&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Export Formats:&lt;/strong&gt; Ensure support for your required file types&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Best Match:&lt;/strong&gt; For Adobe users, Firefly offers seamless integration, while ModernPhotoTools provides excellent standalone capabilities with robust export options.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Consider Practical Factors&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Budget:&lt;/strong&gt; Balance features against cost constraints&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Learning Curve:&lt;/strong&gt; Assess time available to master new tools&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Usage Volume:&lt;/strong&gt; Match subscription tier to your generation needs&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Support Quality:&lt;/strong&gt; Consider available help resources&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Future-Proofing:&lt;/strong&gt; Look for tools with regular updates&lt;/li&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Best Match:&lt;/strong&gt; For beginners, Canva offers an easy entry point, while ModernPhotoTools balances accessibility with professional features at competitive pricing.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Questions to Ask Before Choosing&lt;/h3&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h4 class=&quot;faq-question&quot;&gt;What level of quality do I absolutely require?&lt;/h4&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Be honest about your quality needs. For professional client work or premium brands, invest in tools with superior output like ModernPhotoTools or DALL-E 3. For social media or internal use, more accessible options like Canva may suffice.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h4 class=&quot;faq-question&quot;&gt;How important is integration with my existing workflow?&lt;/h4&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;If you&#x27;re already invested in specific ecosystems (like Adobe), tools that integrate seamlessly (like Firefly) may be worth prioritizing even if standalone alternatives offer more features. Consider the time saved through smooth integration.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h4 class=&quot;faq-question&quot;&gt;Do I need background generation, replacement, or both?&lt;/h4&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Some tools excel at creating new backgrounds from prompts (DALL-E 3, Midjourney) while others specialize in replacing backgrounds in existing images (ModernPhotoTools, Adobe Firefly). For comprehensive needs, choose tools that handle both effectively.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h4 class=&quot;faq-question&quot;&gt;What&#x27;s my volume of background generation?&lt;/h4&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;For high-volume needs like e-commerce product catalogs, prioritize tools with robust batch processing and favorable pricing for high usage. ModernPhotoTools and Canva offer strong options for different volume requirements.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h4 class=&quot;faq-question&quot;&gt;How much control do I need over the generation process?&lt;/h4&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;If you need precise control over every aspect of your backgrounds, tools like ModernPhotoTools and Midjourney offer extensive parameters. If you prefer simplicity, Canva and Fotor provide more streamlined experiences.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;The best AI background generator isn&#x27;t necessarily the one with the most features or highest price tagโ€”it&#x27;s the one that aligns most closely with your specific workflow, quality requirements, and creative objectives.&lt;/p&gt; &lt;p class=&quot;blockquote-author&quot;&gt;โ€” Professional Photographer and AI Consultant&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try the Most Versatile AI Background Generator Today&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;ModernPhotoTools AI Background Generator offers the perfect balance of professional quality, intuitive controls, and flexible features to meet the needs of photographers, designers, and content creators.&lt;/p&gt; &lt;div class=&quot;cta-block-buttons&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Start Creating Beautiful Backgrounds&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Conclusion: The Future of Backgrounds is AI-Powered&lt;/h2&gt; &lt;p&gt;As we&#x27;ve explored throughout this comprehensive guide to the best AI background generators in 2025, artificial intelligence has fundamentally transformed how we create, edit, and conceptualize visual backgrounds. What once required expensive photo shoots, complex manual editing, or limited stock image libraries can now be accomplished in minutes with the right AI tools.&lt;/p&gt; &lt;p&gt;The landscape of AI background generation continues to evolve rapidly, with tools becoming increasingly specialized, powerful, and accessible. From the artistic excellence of Midjourney to the intuitive simplicity of Canva, from the professional precision of ModernPhotoTools to the ecosystem integration of Adobe Firefly, there&#x27;s now a solution for virtually every background generation need.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Key Takeaways&lt;/h3&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Quality Matters:&lt;/strong&gt; The gap between professional and consumer-grade AI background tools has narrowed, but significant differences remain in output quality and control&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Specialization Continues:&lt;/strong&gt; Tools are increasingly focusing on specific use cases rather than trying to be all-in-one solutions&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Integration is Key:&lt;/strong&gt; The most effective tools work seamlessly with existing creative workflows&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Ethical Considerations Growing:&lt;/strong&gt; Transparency about AI training data and usage rights is becoming a critical factor in tool selection&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Democratization of Creation:&lt;/strong&gt; AI background generators are making professional-quality visual creation accessible to everyone&lt;/li&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/bdf7dd76-af6e-4f71-a6e7-1822468e7d61.jpg&quot; alt=&quot;Visual representation of the evolution of AI background generation from basic to advanced capabilities&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Our Top Recommendations&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Best Overall: ModernPhotoTools AI Background Generator&lt;/h4&gt; &lt;p&gt;Combining professional-grade output quality with an intuitive interface and comprehensive feature set, ModernPhotoTools offers the most balanced solution for serious creators who demand both quality and efficiency.&lt;/p&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-small&quot;&gt;Try It Free&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Best for Artistic Quality: Midjourney&lt;/h4&gt; &lt;p&gt;For creators who prioritize aesthetic excellence and artistic coherence in their backgrounds, Midjourney&#x27;s distinctive style and powerful parameter controls make it the standout choice.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;Best for Beginners: Canva&lt;/h4&gt; &lt;p&gt;With its unmatched ease of use and all-in-one design capabilities, Canva remains the most accessible entry point for those new to AI background generation.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;As AI background generation technology continues to advance, we can expect even more impressive capabilities, greater specialization, and more seamless integration with creative workflows. The tools that will lead the field will be those that balance technological innovation with user-centered design and ethical considerations.&lt;/p&gt; &lt;p&gt;Whether you&#x27;re a professional photographer looking to expand your client offerings, an e-commerce business seeking to streamline product imagery, or a content creator wanting to elevate your visual storytelling, there&#x27;s never been a better time to incorporate AI background generation into your creative process.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Experience the Future of Background Creation Today&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of photographers, designers, and content creators who are transforming their visual content with ModernPhotoTools AI Background Generator.&lt;/p&gt; &lt;div class=&quot;cta-block-buttons&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Get Started Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt;&lt;/div&gt; &lt;style&gt;.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0}.styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5}.styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1}.styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5}.styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2}.styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5}.styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3}.styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5}.styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4}.styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1}.styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2}.styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3}.styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4}.styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5}.styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6}.styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7}.styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8}.styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9}.styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;}.styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;]{margin-bottom:20px}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns&gt;div:not([class]),.styled-container .three-columns&gt;div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}&lt;/style&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ai-image-enhancement-guide.md</div> <div class="content">--- id: ai-image-enhancement-guide title: &quot;AI Image Enhancement: Transform Your Photos with AI Technology&quot; excerpt: &quot;Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools&#x27; AI Image Upscaler for professional-quality results.&quot; publishDate: &quot;2025-03-14&quot; readTime: &quot;16 min read&quot; category: tools featuredImage: &quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg&quot; relatedTool: &quot;ai-image-enhancer&quot; keywords: [&quot;AI image enhancement&quot;, &quot;photo enhancement&quot;, &quot;image upscaler&quot;, &quot;AI photo editor&quot;, &quot;image quality improvement&quot;] metaTitle: &quot;AI Image Enhancement: Transform Your Photos with AI Technology&quot; metaDescription: &quot;Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools&#x27; AI Image Upscaler for professional-quality results.&quot; faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Can AI really improve low-quality images?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, AI image enhancement can significantly improve low-quality images by reducing noise, sharpening details, and even reconstructing missing information based on trained patterns. While it can&#x27;t create details that don&#x27;t exist in some form in the original, modern AI is remarkably effective at bringing out hidden details and improving overall quality.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Is AI enhancement better than professional manual editing?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;AI enhancement and professional manual editing serve different purposes. AI excels at speed, consistency, and accessibility, making it ideal for batch processing or users without editing expertise. Professional manual editing offers more precise control and creative direction. Many professionals now use AI as a starting point before applying manual finishing touches.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;AI Image Enhancement: Transform Your Photos with AI Technology&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;Have you ever taken what should have been a perfect photo, only to find it blurry, pixelated, or lacking detail? Or perhaps you&#x27;ve discovered old family photos that have faded with time? &lt;strong&gt;AI image enhancement&lt;/strong&gt; is revolutionizing how we restore, improve, and transform digital images. This cutting-edge technology can breathe new life into your photos with just a few clicks, delivering results that once required hours of expert editing.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Image Upscaler&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Transform your photos with professional-quality AI enhancement in seconds. No signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; rel=&quot;nofollow&quot;&gt;Enhance Images Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#what-is-ai-image-enhancement&quot;&gt;What Is AI Image Enhancement?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-ai-image-enhancement-works&quot;&gt;How AI Image Enhancement Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#benefits&quot;&gt;Benefits of AI Image Enhancement&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Common Use Cases for AI Image Enhancement&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison-table&quot;&gt;Comparing AI Enhancement Approaches&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-to-use&quot;&gt;How to Use Modern Photo Tools&#x27; AI Image Upscaler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#best-practices&quot;&gt;Best Practices for Optimal Results&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#future-trends&quot;&gt;Future Trends in AI Image Enhancement&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;what-is-ai-image-enhancement&quot;&gt; &lt;h2&gt;What Is AI Image Enhancement?&lt;/h2&gt; &lt;p&gt;AI image enhancement uses artificial intelligence algorithms to automatically improve digital images by reducing noise, increasing resolution, sharpening details, and correcting various quality issues. Unlike traditional photo editing that requires manual adjustments, AI enhancement analyzes your image and applies sophisticated improvements based on patterns learned from millions of high-quality images.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Before and after comparison showing AI image enhancement results&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;p class=&quot;image-caption&quot;&gt;AI enhancement can dramatically improve image quality with a single click&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The technology works by training neural networks on vast datasets of image pairsโ€”low-quality images matched with their high-quality counterparts. This training enables the AI to &quot;understand&quot; what a sharp, clear version of a blurry or pixelated image should look like.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;how-ai-image-enhancement-works&quot;&gt; &lt;h2&gt;How AI Image Enhancement Works&lt;/h2&gt; &lt;p&gt;Understanding the technology behind AI image enhancement helps you make the most of these powerful tools. Here&#x27;s how the process works:&lt;/p&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Machine Learning&lt;/h3&gt; &lt;p&gt;AI models are trained on millions of image pairs to learn patterns of degradation and restoration. This training enables them to recognize and correct common image problems automatically.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Pattern Recognition&lt;/h3&gt; &lt;p&gt;The AI analyzes your image to identify specific issues like noise, blur, or low resolution, then applies the most appropriate enhancement techniques for each problem area.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Super-Resolution Technology&lt;/h3&gt; &lt;p&gt;Advanced algorithms can intelligently predict and generate new pixels when upscaling images, creating detail that looks natural and maintains image integrity.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Diagram showing AI image enhancement process workflow&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9725f897-d086-454c-81f7-e8d4e13d5a2b.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;p class=&quot;image-caption&quot;&gt;The AI enhancement process: from analysis to intelligent improvement&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Experience AI Enhancement&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;See how our AI technology can transform your images with intelligent, automatic improvements.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;2&quot; rel=&quot;nofollow&quot;&gt;Try AI Enhancement&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;benefits&quot;&gt; &lt;h2&gt;Benefits of AI Image Enhancement&lt;/h2&gt; &lt;p&gt;AI image enhancement offers numerous advantages over traditional editing methods. Understanding these benefits helps explain why this technology has become so popular among photographers, content creators, and businesses.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/3cbdaf46-cb5e-49e5-8f6d-6aca5de18800.jpg&quot; alt=&quot;Photographer reviewing enhanced images on computer screen&quot; class=&quot;article-image&quot;&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;benefits-section&quot;&gt; &lt;h3&gt;โœ… Advantages of AI Enhancement&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Saves hours of manual editing time&lt;/li&gt; &lt;li&gt;Recovers details in low-quality or damaged photos&lt;/li&gt; &lt;li&gt;Increases resolution without losing quality&lt;/li&gt; &lt;li&gt;Maintains natural-looking results&lt;/li&gt; &lt;li&gt;Works with various image types (portraits, landscapes, products)&lt;/li&gt; &lt;li&gt;Accessible to non-professionals&lt;/li&gt; &lt;li&gt;Consistent results across multiple images&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;limitations-section&quot;&gt; &lt;h3&gt;โŒ Limitations of Traditional Editing&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Requires technical expertise&lt;/li&gt; &lt;li&gt;Time-consuming manual adjustments&lt;/li&gt; &lt;li&gt;Limited ability to recover lost details&lt;/li&gt; &lt;li&gt;Inconsistent results between images&lt;/li&gt; &lt;li&gt;Enlarging images causes quality loss&lt;/li&gt; &lt;li&gt;Steep learning curve for software&lt;/li&gt; &lt;li&gt;Often requires expensive software&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;โšก Time Efficiency&lt;/h4&gt; &lt;p&gt;Perhaps the most significant advantage of AI enhancement is time savings. What might take an expert editor 30 minutes to an hour can be accomplished in seconds with AI. This efficiency is particularly valuable for photographers, content creators, and businesses that need to process multiple images quickly.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐ŸŽฏ Quality Improvement&lt;/h4&gt; &lt;p&gt;AI enhancers can dramatically improve image quality by reducing noise, sharpening details, and optimizing colors. The technology is particularly effective at recovering details in underexposed or overexposed areas, fixing blurriness, and enhancing textures.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐ŸŒŸ Accessibility&lt;/h4&gt; &lt;p&gt;You don&#x27;t need to be a Photoshop expert to achieve professional results with AI enhancement tools. The technology democratizes high-quality image editing, making it accessible to everyone from casual photographers to business owners managing their own content.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Common Use Cases for AI Image Enhancement&lt;/h2&gt; &lt;p&gt;AI image enhancement has applications across numerous fields and scenarios. Here are some of the most common ways people are using this technology:&lt;/p&gt; &lt;div class=&quot;use-case-grid&quot;&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Old family photo being restored with AI&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/2766a62e-9c48-4e3e-b53a-f555d6855805.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;Restoring Old Photos&lt;/h3&gt; &lt;p&gt;Breathe new life into faded family photos, fix scratches and damage, and even colorize black and white images. AI restoration preserves precious memories that might otherwise be lost to time.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Product photography enhancement for e-commerce&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/c6b37a5a-dd14-46cb-af32-2f1ea8f31bf4.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;E-Commerce Product Images&lt;/h3&gt; &lt;p&gt;Online retailers use AI enhancement to create professional-looking product photos that drive sales. Enhanced images show greater detail, better color accuracy, and more appealing presentation.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Social media content being enhanced for better engagement&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d790bc37-0cba-4b81-877d-ba6339e9cc49.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;Social Media Content&lt;/h3&gt; &lt;p&gt;Content creators enhance images to stand out in crowded social feeds. AI tools help create eye-catching posts that generate higher engagement without requiring professional photography equipment.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Real estate photography enhanced to showcase property features&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/130ba461-4d2a-4bc9-aeb8-dfcb2435a86c.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;Real Estate Photography&lt;/h3&gt; &lt;p&gt;Real estate professionals use AI enhancement to make property listings more attractive. Enhanced photos can highlight architectural details, improve lighting, and make spaces appear more inviting.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Professional photographer editing portfolio images&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/56d62bc3-113a-4a3e-af8f-9aa3fbaa4c5f.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;Professional Photography&lt;/h3&gt; &lt;p&gt;Even professional photographers use AI enhancement to refine their work, fix minor issues, and save time in post-processing. It&#x27;s becoming an essential tool in modern photography workflows.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;use-case-item&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Digital art being upscaled and enhanced&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/e2308c97-59c7-4b55-ad55-5389515bd93d.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;h3&gt;Digital Art Enhancement&lt;/h3&gt; &lt;p&gt;Artists and designers use AI upscaling to enhance digital artwork, illustrations, and graphics. This allows for larger prints and displays without quality loss.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Have photos that need enhancement?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Whether you&#x27;re restoring old memories or preparing images for professional use, our AI Image Upscaler can help.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;3&quot; rel=&quot;nofollow&quot;&gt;Try AI Image Upscaler&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;comparison-table&quot;&gt; &lt;h2&gt;Comparing AI Enhancement Approaches&lt;/h2&gt; &lt;p&gt;Not all AI image enhancers are created equal. Different tools use various approaches and algorithms, each with their own strengths. Let&#x27;s compare some of the leading approaches to AI image enhancement:&lt;/p&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Enhancement Approach&lt;/th&gt; &lt;th&gt;Best For&lt;/th&gt; &lt;th&gt;Processing Speed&lt;/th&gt; &lt;th&gt;Quality Results&lt;/th&gt; &lt;th&gt;Ease of Use&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Enhancement Approach&quot;&gt;General AI Enhancement&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;All-purpose photo improvement&lt;/td&gt; &lt;td data-label=&quot;Processing Speed&quot;&gt;Fast&lt;/td&gt; &lt;td data-label=&quot;Quality Results&quot;&gt;Good&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;Very Easy&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Enhancement Approach&quot;&gt;Super-Resolution&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Enlarging small images&lt;/td&gt; &lt;td data-label=&quot;Processing Speed&quot;&gt;Medium&lt;/td&gt; &lt;td data-label=&quot;Quality Results&quot;&gt;Excellent&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;Easy&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Enhancement Approach&quot;&gt;Noise Reduction AI&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Low-light photos&lt;/td&gt; &lt;td data-label=&quot;Processing Speed&quot;&gt;Medium&lt;/td&gt; &lt;td data-label=&quot;Quality Results&quot;&gt;Very Good&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;Easy&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Enhancement Approach&quot;&gt;Portrait Enhancement&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Face and skin improvement&lt;/td&gt; &lt;td data-label=&quot;Processing Speed&quot;&gt;Medium&lt;/td&gt; &lt;td data-label=&quot;Quality Results&quot;&gt;Excellent&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;Medium&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Enhancement Approach&quot;&gt;Photo Restoration&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Damaged or old photos&lt;/td&gt; &lt;td data-label=&quot;Processing Speed&quot;&gt;Slow&lt;/td&gt; &lt;td data-label=&quot;Quality Results&quot;&gt;Very Good&lt;/td&gt; &lt;td data-label=&quot;Ease of Use&quot;&gt;Medium&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class=&quot;modern-tools-section&quot;&gt; &lt;h3&gt;Modern Photo Tools&#x27; Approach&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;AI Image Upscaler Tool - Modern Phototools&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/346bac7e-dc27-4799-8eac-c6e559453cb7.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Modern Photo Tools&#x27; AI Image Upscaler combines multiple AI enhancement technologies to deliver optimal results across various image types. Our approach balances processing speed with quality results, focusing on creating natural-looking enhancements rather than over-processed images.&lt;/p&gt; &lt;p&gt;The tool uses advanced neural networks trained on millions of high-quality images to recognize patterns, textures, and details that should be present in your photos. This allows it to intelligently enhance images without the artificial look that can come from traditional filters.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;how-to-use&quot;&gt; &lt;h2&gt;How to Use Modern Photo Tools&#x27; AI Image Upscaler&lt;/h2&gt; &lt;p&gt;Enhancing your images with our AI tool is quick and straightforward. Follow these simple steps to transform your photos in seconds:&lt;/p&gt; &lt;div class=&quot;steps-container&quot;&gt; &lt;ol class=&quot;step-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Visit Our AI Image Upscaler tool&lt;/strong&gt; at &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Image Upscaler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Upload your image&lt;/strong&gt; by dragging and dropping it onto the page or clicking the upload button&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Select your enhancement options&lt;/strong&gt; based on your needs 2X Or 4X (resolution increase, noise reduction, etc.)&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Click &quot;Enhance&quot;&lt;/strong&gt; and wait a few seconds for the AI to process your image&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Preview the results&lt;/strong&gt; and make any adjustments if needed&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Download your enhanced image&lt;/strong&gt; in your preferred format&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Step-by-step process of using Modern Photo Tools&#x27; AI Image Upscaler&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/1b8d36cb-0a8c-42dd-93ca-4141aed561b2.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;supported-formats&quot;&gt; &lt;h3&gt;Supported Image Formats&lt;/h3&gt; &lt;p&gt;Our AI Image Upscaler supports all common image formats, including:&lt;/p&gt; &lt;ul class=&quot;format-list&quot;&gt; &lt;li&gt;JPEG/JPG&lt;/li&gt; &lt;li&gt;PNG&lt;/li&gt; &lt;li&gt;WEBP&lt;/li&gt; &lt;li&gt;HEIC&lt;/li&gt; &lt;li&gt;BMP&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;tip-box&quot;&gt; &lt;h4&gt;๐Ÿ’ก Pro Tip&lt;/h4&gt; &lt;p&gt;For best results, start with the highest quality original image available. While our AI can work wonders, beginning with a better source image will always yield superior results.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;best-practices&quot;&gt; &lt;h2&gt;Best Practices for Optimal Results&lt;/h2&gt; &lt;p&gt;To get the most out of AI image enhancement, follow these expert recommendations:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;dos-section&quot;&gt; &lt;h3&gt;โœ… Do&#x27;s&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Start with the best original possible&lt;/strong&gt; - Use the highest resolution version of your image&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Be selective with enhancement levels&lt;/strong&gt; - Sometimes subtle enhancement looks more natural than maximum settings&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Compare before and after&lt;/strong&gt; - Check that the enhancement preserves the important details and character of your image&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Use specific enhancement types for specific problems&lt;/strong&gt; - Target noise reduction for grainy photos, super-resolution for small images&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Save in high-quality formats&lt;/strong&gt; - Use PNG for graphics or JPG at 90%+ quality for photos&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;donts-section&quot;&gt; &lt;h3&gt;โŒ Don&#x27;ts&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Don&#x27;t over-enhance&lt;/strong&gt; - Excessive enhancement can create unnatural results&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Don&#x27;t expect miracles from extremely poor sources&lt;/strong&gt; - Even AI has limits with severely damaged or tiny images&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Don&#x27;t ignore artifacts&lt;/strong&gt; - Check enhanced images for any unusual patterns or distortions&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Don&#x27;t compress heavily after enhancement&lt;/strong&gt; - This defeats the purpose of enhancement&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Don&#x27;t use a one-size-fits-all approach&lt;/strong&gt; - Different image types benefit from different enhancement settings&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Before and after comparison showing proper enhancement versus over-enhancement&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/edc260b9-c44c-49cb-b907-f6f109c62128.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;p class=&quot;image-caption&quot;&gt;Comparison showing original image (left), proper enhancement (center), and over-enhancement (right)&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;future-trends&quot;&gt; &lt;h2&gt;Future Trends in AI Image Enhancement&lt;/h2&gt; &lt;p&gt;The field of AI image enhancement continues to evolve rapidly. Here are the key trends shaping the future:&lt;/p&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Context-Aware Enhancement&lt;/h3&gt; &lt;p&gt;Future AI systems will better understand image content, applying different enhancement techniques to faces, landscapes, text, and objects within the same image for more intelligent processing.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Video Enhancement&lt;/h3&gt; &lt;p&gt;Real-time video enhancement is becoming more accessible, allowing for live streaming improvements and batch processing of video content with temporal consistency.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Real-Time Processing&lt;/h3&gt; &lt;p&gt;Mobile devices and web browsers are gaining the capability to perform AI enhancement in real-time, making professional-quality enhancement available instantly.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Can AI really improve low-quality images?&lt;/h3&gt; &lt;p&gt;Yes, AI can significantly improve low-quality images by reducing noise, enhancing details, and increasing resolution. However, the results depend on the original image quality and the specific AI algorithms used. While AI can work wonders, it cannot create detail that was never there in the first place.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;How does AI enhancement compare to manual photo editing?&lt;/h3&gt; &lt;p&gt;AI enhancement is much faster and more consistent than manual editing, making it ideal for batch processing and quick improvements. Manual editing offers more creative control and can achieve specific artistic effects that AI might not replicate. The best approach often combines both methods.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Will AI-enhanced images look artificial?&lt;/h3&gt; &lt;p&gt;Modern AI enhancement tools are designed to produce natural-looking results. However, over-enhancement or using inappropriate settings can create artificial appearances. The key is using the right level of enhancement for your specific image and purpose.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Can AI upscale images without losing quality?&lt;/h3&gt; &lt;p&gt;AI upscaling can increase image size while maintaining and often improving quality, especially compared to traditional interpolation methods. AI can intelligently predict and reconstruct details, making enlarged images look sharper and more detailed than conventional upscaling methods.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Is my data safe when using online AI enhancement tools?&lt;/h3&gt; &lt;p&gt;Reputable AI enhancement services prioritize data security and privacy. Look for tools that process images securely, don&#x27;t store your images permanently, and have clear privacy policies. Modern Photo Tools, for example, processes images securely and doesn&#x27;t retain your personal photos.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h2&gt;Transform Your Photos Today&lt;/h2&gt; &lt;p&gt;Ready to experience the power of AI image enhancement? Try our advanced AI Image Upscaler and see the difference intelligent enhancement can make to your photos.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;4&quot; rel=&quot;nofollow&quot;&gt;Enhance Your Images Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ best-photo-background-editors-2025.md</div> <div class="content">--- id: &quot;best-photo-background-editors-2025&quot; title: &quot;10 Best Photo Background Editors for Perfect Images in 2025&quot; excerpt: &quot;Discover the best photo background editors of 2025! Compare top tools for removing, replacing, and enhancing backgrounds. Try our free online editor to transform your images instantly.&quot; publishDate: &quot;2025-10-01&quot; readTime: &quot;18 min read&quot; category: &quot;tools&quot; featuredImage: &quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg&quot; relatedTool: &quot;remove-background&quot; keywords: [&quot;best photo background editors&quot;, &quot;background removal tools&quot;, &quot;photo editing software&quot;, &quot;image background editor&quot;, &quot;AI background removal&quot;] metaTitle: &quot;10 Best Photo Background Editors for Perfect Images in 2025&quot; metaDescription: &quot;Discover the best photo background editors of 2025! Compare top tools for removing, replacing, and enhancing backgrounds. Try our free online editor to transform your images instantly.&quot; faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What are the best photo background editors in 2025?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;The best photo background editors in 2025 include Modern Photo Tools, PhotoRoom, Remove.bg, Canva, Adobe Photoshop, PicsArt, Fotor, GIMP, Photoshop Express, and Affinity Photo. Each offers unique features for different user needs and skill levels.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Which photo background editor is best for beginners?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Modern Photo Tools and Remove.bg are the best photo background editors for beginners, offering one-click background removal with AI technology. They require no technical skills and provide instant results.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Are there free photo background editors available?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, several free photo background editors are available including Modern Photo Tools (completely free), GIMP (open-source), and free versions of PhotoRoom, Canva, and PicsArt with some limitations.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What should I look for in a photo background editor?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;When choosing the best photo background editors, consider accuracy of background removal, ease of use, processing speed, supported file formats, pricing, and additional editing features like background replacement and object removal.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;10 Best Photo Background Editors for Perfect Images in 2025&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;Finding the perfect &lt;strong&gt;best photo background editors&lt;/strong&gt; can transform your photography workflow and dramatically improve your image quality. Whether you&#x27;re a professional photographer, e-commerce seller, or social media enthusiast, having the right background editing tool is essential for creating stunning visuals that stand out.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free Background Removal Tool&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;Remove Background Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#why-you-need-background-editor&quot;&gt;Why You Need a Quality Background Editor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison-table&quot;&gt;Quick Comparison: Top Background Editors&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#modern-photo-tools&quot;&gt;1. Modern Photo Tools - Best All-Around Background Editor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#photoroom&quot;&gt;2. PhotoRoom - Best for E-commerce Product Photos&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#remove-bg&quot;&gt;3. Remove.bg - Best for One-Click Background Removal&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#canva&quot;&gt;4. Canva - Best for Design Integration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#adobe-photoshop&quot;&gt;5. Adobe Photoshop - Best for Professional Editing&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#picsart&quot;&gt;6. PicsArt - Best Mobile Background Editor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#fotor&quot;&gt;7. Fotor - Best for Batch Processing&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#gimp&quot;&gt;8. GIMP - Best Free Desktop Alternative&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#photoshop-express&quot;&gt;9. Photoshop Express - Best Quick Mobile Editor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#affinity-photo&quot;&gt;10. Affinity Photo - Best One-Time Purchase&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-to-choose&quot;&gt;How to Choose the Right Background Editor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tips-tricks&quot;&gt;Tips for Better Background Removal&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;why-you-need-background-editor&quot;&gt; &lt;h2&gt;Why You Need a Quality Background Editor&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Before and after comparison of product photo with background removed&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Background editing has become an essential skill for anyone working with digital images. Here&#x27;s why investing in a quality background editor is worth your time:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;For E-commerce Sellers&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Create consistent product photos with clean white backgrounds&lt;/li&gt; &lt;li&gt;Increase conversion rates with professional-looking listings&lt;/li&gt; &lt;li&gt;Meet marketplace requirements (like Amazon&#x27;s white background policy)&lt;/li&gt; &lt;li&gt;Easily create seasonal promotional images by swapping backgrounds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;For Content Creators&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Remove distractions from portrait and profile photos&lt;/li&gt; &lt;li&gt;Create consistent branding across social media platforms&lt;/li&gt; &lt;li&gt;Produce professional-looking content without a studio setup&lt;/li&gt; &lt;li&gt;Save time with batch processing for multiple images&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free Background Removal Tool&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience professional-quality background removal in seconds with Modern Photo Tools. No signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;Remove Background Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;comparison-table&quot;&gt; &lt;h2&gt;Quick Comparison: Top Background Editors&lt;/h2&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;td data-row=&quot;head&quot;&gt;Tool&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Best For&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Free Option&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;AI-Powered&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Platforms&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Modern Photo Tools&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;All-purpose, quick edits&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Web&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;PhotoRoom&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;E-commerce products&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Limited&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;iOS, Android&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Remove.bg&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;One-click removal&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Limited&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Web, API&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Canva&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Design integration&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;No (Pro feature)&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Web, iOS, Android&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Adobe Photoshop&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Professional editing&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;No&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Windows, Mac&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;PicsArt&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Mobile background editing&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Limited (with watermarks)&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;iOS, Android, Web&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Fotor&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Batch processing&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Limited&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Web, iOS, Android&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;GIMP&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Free desktop alternative&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Yes (completely free)&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;No (manual tools)&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Windows, Mac, Linux&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Photoshop Express&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;Quick mobile editing&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;Limited&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;iOS, Android&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Tool&quot;&gt;Affinity Photo&lt;/td&gt; &lt;td data-label=&quot;Best For&quot;&gt;One-time purchase&lt;/td&gt; &lt;td data-label=&quot;Free Option&quot;&gt;No&lt;/td&gt; &lt;td data-label=&quot;AI-Powered&quot;&gt;No (manual tools)&lt;/td&gt; &lt;td data-label=&quot;Platforms&quot;&gt;Windows, Mac, iPad&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;p&gt;Now let&#x27;s dive deeper into each of these tools to help you find the perfect match for your background editing needs.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;modern-photo-tools&quot;&gt; &lt;h2&gt;1. Modern Photo Tools - Best All-Around Background Editor&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Modern Photo Tools interface showing advanced background removal capabilities&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/8620e47a-f327-4c8f-aeff-ebeec96d90ad.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.9&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.9/5 - Excellent&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Modern Photo Tools stands out as the &lt;strong&gt;best photo background editor&lt;/strong&gt; for 2025, offering a perfect combination of advanced AI technology, user-friendly interface, and completely free access. This tool has revolutionized background removal by making professional-quality editing accessible to everyone.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Completely free with no limitations&lt;/li&gt; &lt;li&gt;Advanced AI technology for precise edge detection&lt;/li&gt; &lt;li&gt;Handles complex subjects like hair and fur excellently&lt;/li&gt; &lt;li&gt;Fast processing (under 5 seconds)&lt;/li&gt; &lt;li&gt;No watermarks or signup required&lt;/li&gt; &lt;li&gt;Privacy-focused - images not stored&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Web-based only (no desktop app)&lt;/li&gt; &lt;li&gt;Limited advanced editing features&lt;/li&gt; &lt;li&gt;Requires internet connection&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐Ÿค– AI Technology&lt;/h4&gt; &lt;p&gt;State-of-the-art machine learning algorithms that accurately detect and remove backgrounds from complex images&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;โšก Lightning Fast&lt;/h4&gt; &lt;p&gt;Process images in under 5 seconds with exceptional quality results&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐Ÿ”’ Privacy First&lt;/h4&gt; &lt;p&gt;All processing happens securely without storing your images on our servers&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐Ÿ’ฐ Completely Free&lt;/h4&gt; &lt;p&gt;No hidden costs, subscriptions, or limitations on your final images&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Modern Photo Tools Now&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience the fastest and most accurate background removal tool available online - completely free!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;2&quot; &gt;Remove Backgrounds Instantly&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;photoroom&quot;&gt; &lt;h2&gt;2. PhotoRoom - Best for E-commerce Product Photos&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;PhotoRoom app interface showing product photography editing&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/aaffc191-1822-453a-af38-349874b14c96.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.7&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.7/5 - Very Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;PhotoRoom has carved out a niche as the go-to background editor for e-commerce sellers and product photographers. With specialized templates and features designed specifically for product photography, it&#x27;s an excellent choice for online retailers.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Specialized e-commerce templates&lt;/li&gt; &lt;li&gt;Excellent product photo optimization&lt;/li&gt; &lt;li&gt;Mobile-first design&lt;/li&gt; &lt;li&gt;Batch processing capabilities&lt;/li&gt; &lt;li&gt;Professional product backgrounds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Limited free version&lt;/li&gt; &lt;li&gt;Subscription required for full features&lt;/li&gt; &lt;li&gt;Mobile app only&lt;/li&gt; &lt;li&gt;Can struggle with complex backgrounds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;pricing-card&quot;&gt; &lt;h4&gt;๐Ÿ’ฐ Pricing&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Free:&lt;/strong&gt; 40 images/month with watermark&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Pro:&lt;/strong&gt; $9.99/month - Unlimited images, no watermark&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Team:&lt;/strong&gt; $19.99/month - Multiple users, advanced features&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;remove-bg&quot;&gt; &lt;h2&gt;3. Remove.bg - Best for One-Click Background Removal&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Remove.bg interface showing one-click background removal&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/462244b9-c856-4b37-a265-abab02c62742.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.6&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.6/5 - Very Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Remove.bg pioneered the one-click background removal concept and remains one of the most popular tools in this category. It&#x27;s particularly effective for portraits and people photography.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Extremely simple to use&lt;/li&gt; &lt;li&gt;Excellent for portraits&lt;/li&gt; &lt;li&gt;API available for developers&lt;/li&gt; &lt;li&gt;Consistent results&lt;/li&gt; &lt;li&gt;Fast processing&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Limited free credits&lt;/li&gt; &lt;li&gt;Struggles with complex objects&lt;/li&gt; &lt;li&gt;No manual editing tools&lt;/li&gt; &lt;li&gt;Expensive for high volume&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;canva&quot;&gt; &lt;h2&gt;4. Canva - Best for Design Integration&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Canva background remover integrated with design tools at Modern Phototools&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/f6ed16fe-6875-4799-bd57-3d88384ef62b.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.5&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.5/5 - Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Canva&#x27;s background remover is part of their comprehensive design platform, making it ideal for users who need background removal as part of a larger design workflow.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Integrated with design tools&lt;/li&gt; &lt;li&gt;Extensive template library&lt;/li&gt; &lt;li&gt;Easy to use interface&lt;/li&gt; &lt;li&gt;Good for social media content&lt;/li&gt; &lt;li&gt;Collaborative features&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Requires Canva Pro subscription&lt;/li&gt; &lt;li&gt;Limited to Canva ecosystem&lt;/li&gt; &lt;li&gt;Not as accurate as specialized tools&lt;/li&gt; &lt;li&gt;Can be slow with large images&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;adobe-photoshop&quot;&gt; &lt;h2&gt;5. Adobe Photoshop - Best for Professional Editing&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Adobe Photoshop advanced background removal tools&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/6159469b-2a19-4228-95e0-ec1247142735.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.8&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.8/5 - Excellent&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Adobe Photoshop remains the gold standard for professional image editing, offering the most advanced and precise background removal tools available.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Most advanced editing capabilities&lt;/li&gt; &lt;li&gt;Perfect precision control&lt;/li&gt; &lt;li&gt;Professional-grade tools&lt;/li&gt; &lt;li&gt;Extensive plugin ecosystem&lt;/li&gt; &lt;li&gt;Industry standard&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Steep learning curve&lt;/li&gt; &lt;li&gt;Expensive subscription&lt;/li&gt; &lt;li&gt;Overkill for simple tasks&lt;/li&gt; &lt;li&gt;Resource intensive&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;picsart&quot;&gt; &lt;h2&gt;6. PicsArt - Best Mobile Background Editor&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;PicsArt background removal interface&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/b008104c-0f4a-40cd-b3ba-c874e93eb849.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.3&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.3/5 - Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;PicsArt is a popular mobile-first editor with strong social media integration, offering AI background removal, replacement, and effects. It&#x27;s particularly well-suited for creative content creators and social media enthusiasts.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Excellent mobile interface&lt;/li&gt; &lt;li&gt;Strong social media integration&lt;/li&gt; &lt;li&gt;Creative effects and filters&lt;/li&gt; &lt;li&gt;Active community features&lt;/li&gt; &lt;li&gt;Regular updates and new features&lt;/li&gt; &lt;li&gt;Good AI background removal&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Free version includes watermarks&lt;/li&gt; &lt;li&gt;Subscription required for best features&lt;/li&gt; &lt;li&gt;Can be overwhelming for beginners&lt;/li&gt; &lt;li&gt;Limited desktop functionality&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;fotor&quot;&gt; &lt;h2&gt;7. Fotor - Best for Batch Processing&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Fotor background editing tools&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/83d8f480-ccc1-4c3b-b5f5-370a4de262bd.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.2&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.2/5 - Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Fotor is a web-based editor with AI background removal and extensive photo enhancement tools. It offers a good balance between features and accessibility, making it ideal for users who need to process multiple images efficiently.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Excellent batch processing capabilities&lt;/li&gt; &lt;li&gt;User-friendly web interface&lt;/li&gt; &lt;li&gt;Good AI background removal&lt;/li&gt; &lt;li&gt;Comprehensive editing tools&lt;/li&gt; &lt;li&gt;Template library included&lt;/li&gt; &lt;li&gt;Cross-platform availability&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Limited free features&lt;/li&gt; &lt;li&gt;Requires subscription for advanced tools&lt;/li&gt; &lt;li&gt;Can be slow with large files&lt;/li&gt; &lt;li&gt;Internet connection required&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;gimp&quot;&gt; &lt;h2&gt;8. GIMP - Best Free Desktop Alternative&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;GIMP with background removal plugins&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/c96fc9eb-d654-40fe-a458-65d9d45496c8.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.0&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.0/5 - Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;GIMP (GNU Image Manipulation Program) is a free, open-source alternative to Photoshop. While it requires more manual work for background removal, it offers powerful tools for those willing to learn and invest time in mastering the software.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Completely free and open-source&lt;/li&gt; &lt;li&gt;Powerful professional-grade tools&lt;/li&gt; &lt;li&gt;Extensive plugin ecosystem&lt;/li&gt; &lt;li&gt;Cross-platform compatibility&lt;/li&gt; &lt;li&gt;No subscription fees ever&lt;/li&gt; &lt;li&gt;Active community support&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Steep learning curve&lt;/li&gt; &lt;li&gt;No built-in AI background removal&lt;/li&gt; &lt;li&gt;Interface can be confusing&lt;/li&gt; &lt;li&gt;Requires manual selection techniques&lt;/li&gt; &lt;li&gt;Time-consuming for beginners&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;photoshop-express&quot;&gt; &lt;h2&gt;9. Photoshop Express - Best Quick Mobile Editor&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Photoshop Express mobile app background removal&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/e010a5f9-d568-4c1a-b5e1-856f496f693e.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.1&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.1/5 - Good&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Adobe&#x27;s mobile app offers simplified background removal tools perfect for quick edits on the go. While it lacks the precision of desktop Photoshop, it provides reliable results for mobile photography and social media content.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;Adobe&#x27;s trusted technology&lt;/li&gt; &lt;li&gt;Optimized for mobile devices&lt;/li&gt; &lt;li&gt;Quick and easy to use&lt;/li&gt; &lt;li&gt;Good integration with Adobe ecosystem&lt;/li&gt; &lt;li&gt;Regular updates and improvements&lt;/li&gt; &lt;li&gt;Free basic features&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;Limited compared to desktop Photoshop&lt;/li&gt; &lt;li&gt;Premium features require subscription&lt;/li&gt; &lt;li&gt;Mobile-only interface limitations&lt;/li&gt; &lt;li&gt;Less precise than specialized tools&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;affinity-photo&quot;&gt; &lt;h2&gt;10. Affinity Photo - Best One-Time Purchase&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img alt=&quot;Affinity Photo background removal tools&quot; src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/0e5ddecd-5d43-4843-95a4-5caf4ef0a999.jpg&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;rating-container&quot;&gt; &lt;div class=&quot;rating-stars&quot; data-rating=&quot;4.6&quot;&gt;&lt;/div&gt; &lt;span class=&quot;rating-text&quot;&gt;4.6/5 - Excellent&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Affinity Photo is a professional alternative to Photoshop with excellent selection tools for background removal. It offers a one-time purchase model with no subscription required, making it an attractive option for budget-conscious professionals.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โœ… Pros&lt;/h3&gt; &lt;ul class=&quot;pros&quot;&gt; &lt;li&gt;One-time purchase, no subscription&lt;/li&gt; &lt;li&gt;Professional-grade selection tools&lt;/li&gt; &lt;li&gt;Excellent performance and speed&lt;/li&gt; &lt;li&gt;Clean, modern interface&lt;/li&gt; &lt;li&gt;Regular free updates&lt;/li&gt; &lt;li&gt;Cross-platform compatibility&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;h3&gt;โŒ Cons&lt;/h3&gt; &lt;ul class=&quot;cons&quot;&gt; &lt;li&gt;No built-in AI background removal&lt;/li&gt; &lt;li&gt;Learning curve for new users&lt;/li&gt; &lt;li&gt;Manual selection techniques required&lt;/li&gt; &lt;li&gt;Smaller plugin ecosystem than Photoshop&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;how-to-choose&quot;&gt; &lt;h2&gt;How to Choose the Right Background Editor&lt;/h2&gt; &lt;p&gt;Selecting the best photo background editor depends on your specific needs, skill level, and budget. Here are the key factors to consider:&lt;/p&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐ŸŽฏ Accuracy&lt;/h4&gt; &lt;p&gt;Look for tools that handle complex edges, hair, and transparent objects well&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;โšก Speed&lt;/h4&gt; &lt;p&gt;Consider processing time, especially if you need to edit many images&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐Ÿ’ฐ Cost&lt;/h4&gt; &lt;p&gt;Evaluate free options vs. paid features based on your usage volume&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h4&gt;๐Ÿ› ๏ธ Features&lt;/h4&gt; &lt;p&gt;Determine if you need basic removal or advanced editing capabilities&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tips-tricks&quot;&gt; &lt;h2&gt;Tips for Better Background Removal&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Before You Start&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Use high-contrast backgrounds when possible&lt;/li&gt; &lt;li&gt;Ensure good lighting on your subject&lt;/li&gt; &lt;li&gt;Avoid shadows falling on the background&lt;/li&gt; &lt;li&gt;Keep the subject away from the background&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;During Editing&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Start with the highest resolution image available&lt;/li&gt; &lt;li&gt;Use manual refinement tools for complex areas&lt;/li&gt; &lt;li&gt;Pay special attention to hair and fine details&lt;/li&gt; &lt;li&gt;Preview your results at 100% zoom&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;What are the best photo background editors in 2025?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;The best photo background editors in 2025 include Modern Photo Tools, PhotoRoom, Remove.bg, Canva, Adobe Photoshop, PicsArt, Fotor, GIMP, Photoshop Express, and Affinity Photo. Each offers unique features for different user needs and skill levels.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Which photo background editor is best for beginners?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Modern Photo Tools and Remove.bg are the best photo background editors for beginners, offering one-click background removal with AI technology. They require no technical skills and provide instant results.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Are there free photo background editors available?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes, several free photo background editors are available including Modern Photo Tools (completely free), GIMP (open-source), and free versions of PhotoRoom, Canva, and PicsArt with some limitations.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;What should I look for in a photo background editor?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;When choosing the best photo background editors, consider accuracy of background removal, ease of use, processing speed, supported file formats, pricing, and additional editing features like background replacement and object removal.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Conclusion&lt;/h2&gt; &lt;p&gt;Choosing the right background editor can significantly impact your image quality and workflow efficiency. For most users, &lt;strong&gt;Modern Photo Tools&lt;/strong&gt; offers the best combination of accuracy, speed, and value with its completely free, AI-powered background removal.&lt;/p&gt; &lt;p&gt;For specialized needs like e-commerce, PhotoRoom excels, while professionals may prefer the advanced capabilities of Adobe Photoshop. Whatever your choice, the tools listed in this guide represent the best photo background editors available in 2025.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Transform Your Images?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Start with our free background removal tool and see the difference professional editing can make!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;3&quot; &gt;Try Our Modern Tool Free&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt; &lt;style&gt; .styled-container { max-width: 1200px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6; color: #333; } .article-header { text-align: center; margin-bottom: 40px; padding: 40px 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 12px; } .article-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); } .article-intro { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; } .table-of-contents { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin: 30px 0; } .table-of-contents h2 { color: #495057; font-size: 1.5rem; margin-bottom: 20px; border-bottom: 2px solid #3498db; padding-bottom: 10px; } .toc-list { list-style: none; padding: 0; margin: 0; } .toc-list li { margin-bottom: 8px; padding-left: 20px; position: relative; } .toc-list li:before { content: &quot;โ†’&quot;; position: absolute; left: 0; color: #3498db; font-weight: bold; } .toc-list a { color: #495057; text-decoration: none; font-weight: 500; transition: color 0.3s ease; } .toc-list a:hover { color: #3498db; text-decoration: underline; } .two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px 0; } @media (max-width: 768px) { .two-columns { grid-template-columns: 1fr; gap: 20px; } } .custom-list { list-style: none; padding: 0; } .custom-list li { position: relative; padding-left: 25px; margin-bottom: 10px; } .custom-list li:before { content: &quot;โœ“&quot;; position: absolute; left: 0; color: #28a745; font-weight: bold; } .cta-block { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 30px; border-radius: 12px; text-align: center; margin: 40px 0; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); } .cta-block-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; } .cta-block-text { font-size: 1.1rem; margin-bottom: 25px; opacity: 0.95; } .cta-btn { display: inline-block; background: white; color: #28a745; padding: 15px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); color: #1e7e34; } .table-container { overflow-x: auto; margin: 30px 0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .responsive-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; } .responsive-table thead tr { background-color: #3498db; color: #fff; text-align: left; } .responsive-table td { padding: 12px 15px; border-bottom: 1px solid #dddddd; overflow-wrap: break-word; } .responsive-table tbody tr { border-bottom: 1px solid #dddddd; background-color: #fff; transition: background-color .3s ease; } .responsive-table tbody tr:nth-of-type(2n) { background-color: #f8f9fa; } .responsive-table tbody tr:hover { background-color: #e3f2fd; } .img-container { margin: 30px 0; text-align: center; } .responsive-image { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } .rating-container { display: flex; align-items: center; gap: 15px; margin: 20px 0; } .rating-stars { position: relative; display: inline-block; font-size: 20px; color: #ddd; } .rating-stars:before { content: &quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;; position: absolute; top: 0; left: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: #ffc107; } .rating-stars:after { content: &quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;; } .rating-text { font-weight: 600; color: #495057; } .pros-cons h3 { font-size: 1.2rem; margin-bottom: 15px; } .pros, .cons { list-style: none; padding: 0; } .pros li, .cons li { position: relative; padding-left: 25px; margin-bottom: 8px; line-height: 1.5; } .pros li:before { content: &quot;โœ“&quot;; position: absolute; left: 0; color: #28a745; font-weight: bold; } .cons li:before { content: &quot;โœ—&quot;; position: absolute; left: 0; color: #dc3545; font-weight: bold; } .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 30px 0; } .feature-card { background: white; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; } .feature-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); } .feature-card h4 { color: #3498db; font-size: 1.1rem; margin-bottom: 10px; } .pricing-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin: 20px 0; } .pricing-card h4 { color: #495057; margin-bottom: 15px; } .pricing-card ul { list-style: none; padding: 0; } .pricing-card li { padding: 8px 0; border-bottom: 1px solid #dee2e6; } .pricing-card li:last-child { border-bottom: none; } .faq-container { margin: 30px 0; } .faq-item { background: white; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 15px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } .faq-question { padding: 20px; background-color: #f8f9fa; font-weight: 600; margin: 0; border-bottom: 1px solid #e0e0e0; cursor: pointer; transition: background-color 0.3s ease; } .faq-question:hover { background-color: #e9ecef; } .faq-answer { padding: 20px; background-color: #fff; } .faq-answer p { margin: 0; line-height: 1.6; } section { margin: 50px 0; } section h2 { color: #2c3e50; font-size: 2rem; font-weight: 700; margin-bottom: 25px; border-bottom: 3px solid #3498db; padding-bottom: 10px; } section h3 { color: #34495e; font-size: 1.4rem; font-weight: 600; margin: 25px 0 15px 0; } section p { font-size: 1.1rem; line-height: 1.7; margin-bottom: 20px; color: #555; } @media (max-width: 768px) { .styled-container { padding: 15px; } .article-header h1 { font-size: 2rem; } .article-intro { font-size: 1.1rem; } .feature-grid { grid-template-columns: 1fr; } .table-container { font-size: 14px; } } &lt;/style&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ easter-card-messages-2025.md</div> <div class="content">--- id: easter-card-messages-2025 title: 100+ Easter Card Message Ideas in 2025 | Modern PhotoTools excerpt: Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs. publishDate: 2025-02-30 readTime: 18 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/43b3a8d0-02da-49a5-91b1-4a27d9f12e48.jpg keywords: [&quot;Easter card messages&quot;, &quot;Easter greetings&quot;, &quot;Easter card ideas&quot;, &quot;holiday card messages&quot;, &quot;Easter wishes&quot;, &quot;religious Easter messages&quot;, &quot;funny Easter messages&quot;] metaTitle: 100+ Easter Card Message Ideas in 2025 | Modern PhotoTools metaDescription: Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs. faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What makes a good Easter card message?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;A good Easter card message should match the tone of your relationship with the recipient and reflect the spirit of Easter. Consider religious messages for faith-based celebrations, funny puns for lighthearted relationships, and heartfelt personal messages for close family and friends. The best messages are sincere and appropriate for the occasion.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How do I choose the right Easter message for different people?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Choose Easter messages based on your relationship and the recipient&#x27;s preferences. Use religious messages for those who celebrate Easter&#x27;s spiritual significance, funny messages for children or close friends who enjoy humor, professional messages for colleagues, and heartfelt personal messages for family members. Consider the recipient&#x27;s age, beliefs, and your relationship when selecting the perfect message.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;100+ Easter Card Message Ideas in 2025 | Modern PhotoTools&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;Easter is a time of renewal, hope, and celebration. Whether you&#x27;re honoring the religious significance of the holiday or simply enjoying the arrival of spring, the right message can transform your Easter cards into meaningful keepsakes. From heartfelt religious blessings to playful puns that bring smiles, we&#x27;ve compiled over 100 Easter card message ideas to help you express your feelings perfectly.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Image Generator Tool&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Creating the perfect Easter card goes beyond just choosing beautiful imageryโ€”it&#x27;s about pairing that visual appeal with words that resonate. Whether you&#x27;re sending cards to family members, friends, colleagues, or children, you&#x27;ll find the ideal message in our comprehensive collection below.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;Create your Imaginary perfect Easter&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#religious-easter-messages&quot;&gt;Religious Easter Messages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#funny-easter-messages&quot;&gt;Funny Easter Messages &amp; Puns&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#heartfelt-easter-messages&quot;&gt;Heartfelt Easter Messages for Family&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#short-easter-messages&quot;&gt;Short &amp; Sweet Easter Messages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#professional-easter-messages&quot;&gt;Professional Easter Card Message Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#photo-tips&quot;&gt;Tips for Pairing Easter Messages with Photos&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Create Memorable Easter Cards in 2025&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;religious-easter-messages&quot;&gt; &lt;h2&gt;Religious Easter Messages&lt;/h2&gt; &lt;p&gt;For those celebrating Easter&#x27;s spiritual significance, these religious messages honor the resurrection of Jesus Christ and the hope it brings to believers worldwide.&lt;/p&gt; &lt;h3&gt;Traditional Religious Easter Greetings&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;He is risen! May the miracle of Easter fill your heart with joy and your life with blessings.&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating the resurrection of our Lord and the promise of eternal life. Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;May the hope of Easter morning shine brightly in your heart today and always.&quot;&lt;/li&gt; &lt;li&gt;&quot;Rejoicing in Christ&#x27;s victory over death and the new life He offers us all.&quot;&lt;/li&gt; &lt;li&gt;&quot;May God&#x27;s love surround you this Easter and His peace fill your heart.&quot;&lt;/li&gt; &lt;li&gt;&quot;The tomb is empty, our hearts are full. Wishing you a blessed Easter celebration.&quot;&lt;/li&gt; &lt;li&gt;&quot;May the joy of the resurrection bring you comfort, hope, and endless blessings.&quot;&lt;/li&gt; &lt;li&gt;&quot;Christ has risen! May this Easter bring you closer to God&#x27;s infinite love.&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating the greatest love story ever told. May Easter bless you abundantly.&quot;&lt;/li&gt; &lt;li&gt;&quot;May the light of Christ&#x27;s resurrection illuminate your path this Easter and beyond.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Easter Blessings for Family&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;May our family be blessed with God&#x27;s grace, love, and the joy of Easter.&quot;&lt;/li&gt; &lt;li&gt;&quot;Praying that Easter brings our family closer together in faith and love.&quot;&lt;/li&gt; &lt;li&gt;&quot;May the Lord&#x27;s blessings be upon our family this Easter season.&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating Easter with grateful hearts for the family God has given us.&quot;&lt;/li&gt; &lt;li&gt;&quot;May God&#x27;s love bind our family together this Easter and always.&quot;&lt;/li&gt; &lt;li&gt;&quot;Blessed to celebrate the resurrection with the family I love most.&quot;&lt;/li&gt; &lt;li&gt;&quot;May Easter remind us of God&#x27;s greatest giftโ€”His love and our family.&quot;&lt;/li&gt; &lt;li&gt;&quot;Praying for continued blessings on our family this Easter season.&quot;&lt;/li&gt; &lt;li&gt;&quot;May the peace of Easter fill our home and hearts with joy.&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating God&#x27;s love through the blessing of our family this Easter.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Create Beautiful Religious Easter Cards&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Design meaningful Easter cards that honor your faith with our religious-themed templates and photo editing tools.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; class=&quot;cta-btn&quot; target=&quot;_blank&quot;&gt;Create Religious Templates By AI Image Tool&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;funny-easter-messages&quot;&gt; &lt;h2&gt;Funny Easter Messages &amp; Puns&lt;/h2&gt; &lt;p&gt;Bring smiles and laughter to your Easter celebrations with these playful messages and clever puns that are perfect for friends, family, and anyone who enjoys a good laugh.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/d68e3503-86c5-4760-a8bc-4811946c2d71.jpg&quot; alt=&quot;Funny Easter bunny card with colorful eggs and playful design&quot;&gt; &lt;/div&gt; &lt;h3&gt;Easter Puns and Wordplay&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Have an egg-stra special Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Some bunny loves you very much!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hoppy Easter to some-bunny special!&quot;&lt;/li&gt; &lt;li&gt;&quot;You&#x27;re egg-cellent in every way!&quot;&lt;/li&gt; &lt;li&gt;&quot;Don&#x27;t worry, be hoppyโ€”it&#x27;s Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter: the only time it&#x27;s okay to put all your eggs in one basket!&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you an egg-straordinary Easter celebration!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope your Easter is filled with egg-citement!&quot;&lt;/li&gt; &lt;li&gt;&quot;You crack me up! Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Having a good hare day? Happy Easter!&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Funny Easter Messages for Kids&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;The Easter Bunny told me you&#x27;ve been egg-stra good this year!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hoppy Easter! May your basket be full of treats and your day full of fun!&quot;&lt;/li&gt; &lt;li&gt;&quot;Some bunny thinks you&#x27;re the best! Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter hugs and bunny kisses coming your way!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope the Easter Bunny brings you everything on your wish list!&quot;&lt;/li&gt; &lt;li&gt;&quot;You&#x27;re one cool chick! Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you a basket full of joy and chocolate this Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be as sweet as chocolate and as colorful as Easter eggs!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hippity hoppity, Easter&#x27;s on its way with treats for you today!&quot;&lt;/li&gt; &lt;li&gt;&quot;You make every day brighter, just like Easter morning!&quot;&lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/df734811-d074-45aa-8176-b8d481ffe256.jpg&quot; alt=&quot;Children enjoying Easter egg hunt with colorful baskets and smiling faces&quot;&gt; &lt;/div&gt; &lt;h3&gt;Lighthearted Easter Greetings for Adults&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Age is just a number, but chocolate is eternal. Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be filled with more chocolate than calories count!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter: the one day when eating chocolate for breakfast is socially acceptable.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you an Easter that&#x27;s sweeter than a Peeps marshmallow!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope your Easter is as bright as your smile and as sweet as chocolate!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter basket be full and your heart be fuller!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter calories don&#x27;t count, right? Asking for a friend...&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you a spring-time of happiness and chocolate abundance!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be filled with beautiful moments and zero diet guilt!&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope your Easter is egg-actly what you need to brighten your spring!&quot;&lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Design Fun Easter Cards&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Create playful Easter cards that bring smiles with our fun templates and easy-to-use design tools. Perfect for kids and the young at heart!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; class=&quot;cta-btn&quot; target=&quot;_blank&quot;&gt;Create Fun Cards By AI Image Tool&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;heartfelt-easter-messages&quot;&gt; &lt;h2&gt;Heartfelt Easter Messages for Family&lt;/h2&gt; &lt;p&gt;Express your deepest feelings with these sincere and touching Easter messages designed to strengthen family bonds and share genuine love during this special season.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b3656dfb-4d92-41ed-8976-ad8f3153689a.jpg&quot; alt=&quot;Family gathering around Easter dinner table with warm lighting and happy faces&quot;&gt; &lt;/div&gt; &lt;h3&gt;Messages for Parents and Grandparents&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Thank you for filling my childhood Easters with magic and my adult Easters with meaning. Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Your love has been the greatest Easter gift of my life. Wishing you joy and blessings.&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter bring you the same happiness you&#x27;ve brought to our family for years.&quot;&lt;/li&gt; &lt;li&gt;&quot;Grateful for parents who taught me the true meaning of Easter and unconditional love.&quot;&lt;/li&gt; &lt;li&gt;&quot;Your wisdom and love have been my guiding light. Happy Easter to the best parents ever!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be filled with the love and joy you&#x27;ve given us throughout the years.&quot;&lt;/li&gt; &lt;li&gt;&quot;Thank you for creating Easter memories that I&#x27;ll treasure forever. Love you always.&quot;&lt;/li&gt; &lt;li&gt;&quot;Your faith and love have shaped who I am today. Wishing you a blessed Easter.&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter remind you of how much you mean to our entire family.&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating Easter with gratitude for parents who made every holiday special.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Messages for Children and Grandchildren&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Watching you grow brings me more joy than any Easter morning. Happy Easter, my dear!&quot;&lt;/li&gt; &lt;li&gt;&quot;You are the sunshine that makes every Easter brighter. Love you to the moon and back!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be filled with wonder, joy, and all the love in my heart.&quot;&lt;/li&gt; &lt;li&gt;&quot;You make every day feel like Easter morningโ€”full of hope and happiness.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing my precious child an Easter as beautiful and special as you are.&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter bring you dreams as colorful as Easter eggs and as sweet as chocolate.&quot;&lt;/li&gt; &lt;li&gt;&quot;You are God&#x27;s greatest gift to our family. Happy Easter, my beloved child!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be filled with laughter, love, and all your favorite things.&quot;&lt;/li&gt; &lt;li&gt;&quot;Watching you discover the world fills my heart with Easter joy every day.&quot;&lt;/li&gt; &lt;li&gt;&quot;You are the reason every Easter feels like a celebration of new beginnings.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Messages for Siblings&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;From childhood Easter egg hunts to adult celebrations, you&#x27;ve made every Easter special.&quot;&lt;/li&gt; &lt;li&gt;&quot;Lucky to have a sibling who makes life brighter every day, especially at Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be as wonderful as the memories we&#x27;ve created together.&quot;&lt;/li&gt; &lt;li&gt;&quot;Thank you for being my partner in Easter mischief and my friend for life.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing my amazing sibling an Easter filled with love, laughter, and chocolate!&quot;&lt;/li&gt; &lt;li&gt;&quot;From fighting over Easter candy to sharing Easter blessingsโ€”we&#x27;ve come so far!&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter bring you all the happiness you&#x27;ve brought to my life.&quot;&lt;/li&gt; &lt;li&gt;&quot;Grateful for a sibling who makes every holiday feel like home. Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;You&#x27;re not just my sibling, you&#x27;re my lifelong Easter buddy. Love you!&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be as bright and beautiful as our childhood memories together.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Create Heartfelt Family Easter Cards&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Design meaningful Easter cards for your family with our heartfelt templates and personalization options. Show your loved ones how much they mean to you.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; class=&quot;cta-btn&quot; target=&quot;_blank&quot;&gt;Design Family Cards By Our Tool&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;short-easter-messages&quot;&gt; &lt;h2&gt;Short &amp; Sweet Easter Messages&lt;/h2&gt; &lt;p&gt;Sometimes the most powerful messages are the simplest ones. These concise Easter greetings pack maximum impact in minimal words, perfect for social media, quick notes, or when space is limited.&lt;/p&gt; &lt;h3&gt;Quick Easter Greetings&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Happy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter blessings to you!&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you joy this Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;May Easter bring you peace.&quot;&lt;/li&gt; &lt;li&gt;&quot;Hoppy Easter!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter love and hugs!&quot;&lt;/li&gt; &lt;li&gt;&quot;Blessed Easter to you!&quot;&lt;/li&gt; &lt;li&gt;&quot;Spring joy and Easter cheer!&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter wishes your way!&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating Easter with you in heart!&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;One-Line Easter Messages&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;May your Easter be as bright as spring flowers.&quot;&lt;/li&gt; &lt;li&gt;&quot;Sending you Easter sunshine and smiles.&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope your Easter basket overflows with joy.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you an Easter filled with love and laughter.&quot;&lt;/li&gt; &lt;li&gt;&quot;May Easter bring renewal to your heart and home.&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter joy is coming your way!&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating new beginnings this Easter.&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be sweet and bright.&quot;&lt;/li&gt; &lt;li&gt;&quot;Sending Easter love across the miles.&quot;&lt;/li&gt; &lt;li&gt;&quot;Hope your Easter is egg-stra wonderful!&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Social Media Easter Messages&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Easter vibes: renewal, hope, chocolate. ๐Ÿฐ๐Ÿฅš&quot;&lt;/li&gt; &lt;li&gt;&quot;Grateful hearts and Easter starts! ๐Ÿ’•&quot;&lt;/li&gt; &lt;li&gt;&quot;Some bunny loves you! Happy Easter! ๐Ÿฐ&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter joy in every moment. โœจ&quot;&lt;/li&gt; &lt;li&gt;&quot;Hoppy Easter from our family to yours! ๐ŸŒธ&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter blessings and spring feelings! ๐ŸŒท&quot;&lt;/li&gt; &lt;li&gt;&quot;Celebrating life, love, and Easter! ๐Ÿ’&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter magic is in the air! ๐ŸŒˆ&quot;&lt;/li&gt; &lt;li&gt;&quot;New season, new blessings, Happy Easter! ๐ŸŒฑ&quot;&lt;/li&gt; &lt;li&gt;&quot;Easter joy: simple, sweet, perfect. ๐Ÿฅš&quot;&lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Create Quick Easter Cards&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Short on time? Our quick Easter card templates let you create beautiful cards in minutes. Add a short message and you&#x27;re ready to share!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; class=&quot;cta-btn&quot; target=&quot;_blank&quot;&gt;Make Quick Cards Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;professional-easter-messages&quot;&gt; &lt;h2&gt;Professional Easter Card Message Ideas&lt;/h2&gt; &lt;p&gt;Maintain professional relationships while sharing Easter greetings with these appropriate messages for colleagues, clients, and business associates.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/a0d5be55-efa0-43b2-bccc-b25a88db2309.jpg&quot; alt=&quot;Professional Easter card for business associates and clients&quot;&gt; &lt;/div&gt; &lt;h3&gt;Easter Messages for Colleagues&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Wishing you and your family a wonderful Easter weekend. Enjoy the well-deserved break!&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter! May this season bring renewed energy and inspiration.&quot;&lt;/li&gt; &lt;li&gt;&quot;Sending Easter greetings to a valued colleague. Enjoy the holiday!&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you a refreshing Easter weekend and a productive spring ahead.&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter! Thank you for being such a great team member.&quot;&lt;/li&gt; &lt;li&gt;&quot;May your Easter be relaxing and rejuvenating. See you back at work refreshed!&quot;&lt;/li&gt; &lt;li&gt;&quot;Enjoy your Easter weekend! Looking forward to our continued collaboration.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you a pleasant Easter holiday with your loved ones.&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter to a colleague who makes work more enjoyable every day.&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter bring you joy and the spring season bring new opportunities.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;Easter Wishes for Clients and Business Partners&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/633cb66b-10ea-4712-a1e5-75bc8660504a.jpg&quot; alt=&quot;Business Easter cards being prepared for clients with professional messages&quot;&gt; &lt;/div&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Wishing you and your organization a Happy Easter and continued success this spring.&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter from all of us at [Your Company]. We value our partnership.&quot;&lt;/li&gt; &lt;li&gt;&quot;May this Easter bring renewed prosperity and growth to your business.&quot;&lt;/li&gt; &lt;li&gt;&quot;Sending Easter greetings and appreciation for our business relationship.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you a joyful Easter season and a successful second quarter.&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter! Thank you for your continued trust in our services.&quot;&lt;/li&gt; &lt;li&gt;&quot;May the spring season bring fresh opportunities for our continued collaboration.&quot;&lt;/li&gt; &lt;li&gt;&quot;Wishing you and your team a wonderful Easter and successful spring ahead.&quot;&lt;/li&gt; &lt;li&gt;&quot;Happy Easter from our business family to yours. We appreciate your partnership.&quot;&lt;/li&gt; &lt;li&gt;&quot;Sending Easter greetings and looking forward to our continued success together.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;section id=&quot;photo-tips&quot;&gt; &lt;h2&gt;Tips for Pairing Easter Messages with Photos&lt;/h2&gt; &lt;p&gt;The perfect Easter card combines the right message with complementary imagery. Here are some tips for creating cohesive, beautiful Easter cards that recipients will treasure.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/9618b433-471d-429e-a8e9-fb0a5c370ceb.jpg&quot; alt=&quot;Easter card creation process showing message and photo pairing&quot;&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Message and Photo Alignment Tips&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Match the tone:&lt;/strong&gt; Pair funny messages with lighthearted photos, and religious messages with more solemn or symbolic imagery.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Consider color harmony:&lt;/strong&gt; Choose message colors that complement your photo&#x27;s color palette.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Balance space:&lt;/strong&gt; Leave enough room for your message to be readable without overwhelming the image.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Use appropriate fonts:&lt;/strong&gt; Select fonts that match the moodโ€”playful for children&#x27;s cards, elegant for formal greetings.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Create visual flow:&lt;/strong&gt; Position your message so it naturally guides the eye through the entire card.&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Photo Selection for Easter Cards&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Family photos:&lt;/strong&gt; Recent family gatherings work beautifully with heartfelt messages.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Spring scenes:&lt;/strong&gt; Flowers, green landscapes, and sunny skies pair well with messages about renewal.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Easter symbols:&lt;/strong&gt; Eggs, bunnies, and baskets complement traditional Easter greetings.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Religious imagery:&lt;/strong&gt; Crosses, lilies, and sunrise scenes enhance spiritual messages.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Children&#x27;s photos:&lt;/strong&gt; Pictures of kids with Easter baskets or on egg hunts work perfectly with playful messages.&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/38e69b62-9a0c-4a1b-bd5b-cd43269a6ea2.jpg&quot; alt=&quot;Examples of Easter cards with well-paired messages and photos&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Create Memorable Easter Cards in 2025&lt;/h2&gt; &lt;p&gt;Easter is a time to connect with loved ones and share messages of hope, renewal, and joy. Whether you prefer traditional religious greetings, funny puns, or heartfelt personal messages, the perfect Easter card message can make someone&#x27;s day special.&lt;/p&gt; &lt;p&gt;With over 100 Easter card message ideas to choose from, you&#x27;re now equipped to create cards that perfectly express your feelings. Remember that the most meaningful cards combine thoughtful words with beautiful imagery that reflects the spirit of your message.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/b1c3fa49-c0ca-4dd0-9fb8-10e5b1b3083c.jpg&quot; alt=&quot;Beautiful Easter card display showing various styles and messages for Easter card ideas&quot;&gt; &lt;/div&gt; &lt;p&gt;At ModernPhotoTools.com, we&#x27;re dedicated to helping you create Easter cards that stand out. Our easy-to-use photo editing tools and card templates make it simple to pair your chosen Easter message with the perfect design.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Start Creating Your Easter Cards Today&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Turn these Easter message ideas into beautiful cards with our easy-to-use tools. No design experience needed!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; class=&quot;cta-btn cta-btn-large&quot; target=&quot;_blank&quot;&gt;Create Your Easter Cards&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/FAQPage&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;What makes a good Easter card message?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;div itemprop=&quot;text&quot;&gt; &lt;p&gt;A good Easter card message should match the tone of your relationship with the recipient and reflect the spirit of Easter. Consider religious messages for faith-based celebrations, funny puns for lighthearted relationships, and heartfelt personal messages for close family and friends. The best messages are sincere and appropriate for the occasion.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;How do I choose the right Easter message for different people?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;div itemprop=&quot;text&quot;&gt; &lt;p&gt;Choose Easter messages based on your relationship and the recipient&#x27;s preferences. Use religious messages for those who celebrate Easter&#x27;s spiritual significance, funny messages for children or close friends who enjoy humor, professional messages for colleagues, and heartfelt personal messages for family members. Consider the recipient&#x27;s age, beliefs, and your relationship when selecting the perfect message.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ free-watermark-remover-easy-ai-tool-for-perfect-results.md</div> <div class="content">--- id: free-watermark-remover-easy-ai-tool-for-perfect-results title: &quot;Free Watermark Remover: Easy AI Tool for Perfect Results&quot; excerpt: Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds. publishDate: 2025-11-15 readTime: 12 min read category: tools featuredImage: /images/tools images/AI Watermark Remover Tool.jpg relatedTool: watermark-remover keywords: [&quot;watermark remover&quot;, &quot;remove watermark&quot;, &quot;TikTok watermark remover&quot;, &quot;Free Watermark remover&quot;, &quot;remover watermarks images&quot;] metaTitle: &quot;Free Watermark Remover: Easy AI Tool for Perfect Results&quot; metaDescription: &quot;Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds.&quot; --- &lt;div class=&quot;styled-container&quot;&gt; &lt;style&gt; .styled-container *{box-sizing:border-box} .styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff} .styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700} .styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)} .styled-container h1{font-size:32px;margin-bottom:16px} .styled-container h2{font-size:28px;margin-bottom:12px} .styled-container h3{font-size:24px;margin-bottom:12px} .styled-container h4{font-size:20px;margin-bottom:8px} .styled-container h5{font-size:18px;margin-bottom:8px} .styled-container h6{font-size:16px;margin-bottom:8px} .styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em} .styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s} .styled-container a:not([class]):hover{color:#2980b9} .styled-container img{max-width:100%;height:auto} .styled-container .section-gap{margin:60px 0} .styled-container .section-gap-small{margin:30px 0} .styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0} .styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)} .styled-container .cta-btn-secondary{background-color:#27ae60} .styled-container .cta-btn-secondary:hover{background-color:#219653} .styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c} .styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b} .styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center} .styled-container .elementor-element.cta-block{display:flow} .styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333} .styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555} .styled-container .cta-btn-small{padding:8px 16px;font-size:14px} .styled-container .cta-btn-large{padding:16px 32px;font-size:18px} .styled-container .cta-btn-full{display:block;width:100%} .styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative} .styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease} .styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)} .styled-container form{width:100%} .styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden} .styled-container .form-group{margin-bottom:20px;width:100%} .styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333} .styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s} .styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff} .styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)} .styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s} .styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)} .styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto} .styled-container .form-btn:hover{background-color:#2980b9} .styled-container .form-help{margin-top:12px} .styled-container .cta-block .cta-block-buttons{margin:0} .styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden} .styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden} .styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden} .styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2} @media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}} .styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s} .styled-container .card.elementor-element{padding-bottom:0} .styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none} .styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)} .styled-container .card-img{width:100%;height:auto;display:block} .styled-container .card-content{flex-grow:1;padding:0} .styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word} .styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5} .styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px} .styled-container .card-footer.e-con{--width: auto} .styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow} .styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex} .styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0} .styled-container .card-grid .card{margin:0;height:100%} .styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0} .styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px} .styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3} .styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1} .styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center} .styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold} .styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold} .styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px} .styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px} .styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5} .styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px} .styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%} .styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0} .styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px} .styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0} .styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5} .styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1} .styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5} .styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2} .styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5} .styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3} .styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5} .styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4} .styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1} .styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2} .styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3} .styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4} .styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5} .styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6} .styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7} .styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8} .styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9} .styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5} .styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;} .styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden} .styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc} .styled-container .rating-label{font-size:14px;color:#666} .styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px} .styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px} .styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word} .styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%} .styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block} .styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap} @media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}} .styled-container .rating-container.vertical{flex-direction:column} .styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%} .styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px} .styled-container .rating-container.compact .rating-bar-container{height:6px} .styled-container .rating-container.expanded .rating-details{max-width:none} .styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2} .styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c} .styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f} .styled-container .custom-list{list-style:none;padding:0;margin:20px 0} .styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee} .styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat} .styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0} .styled-container [dir=rtl] .custom-list li:before{left:initial;right:0} .styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0} .styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px} .styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold} .styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0} .styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0} .styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0} .styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)} .styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0} .styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff} .styled-container .list-comparison-column li:last-child{border-bottom:none} .styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat} .styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px} .styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px} .styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db} .styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)} .styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60} .styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)} .styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12} .styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)} .styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c} .styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)} @media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}} .styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px} .styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none} .styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff} .styled-container table tr:first-child th:first-child{border-top-left-radius:8px} .styled-container table tr:first-child th:last-child{border-top-right-radius:8px} .styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px} .styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px} .styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left} .styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word} .styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0} .styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease} .styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa} .styled-container table tbody tr:hover{background-color:#edf2f7} .styled-container table span{display:contents} @media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}} @media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}} .styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative} .styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1} .styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333} /* Three-column grid for step cards and use cases */ .styled-container .three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;align-items:stretch;margin:20px 0} @media(max-width: 1024px){.styled-container .three-columns{grid-template-columns:repeat(2,1fr)}} @media(max-width: 640px){.styled-container .three-columns{grid-template-columns:1fr}} .styled-container .column-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:16px;box-shadow:0 2px 10px rgba(0,0,0,.08);height:100%} .styled-container .column-card h4,.styled-container .column-card h3{margin-top:0;font-weight:700} .styled-container .column-card .img-container{margin-top:12px} .styled-container .column-card .img-container img{width:100%;height:auto;border-radius:6px;display:block} /* Simple TOC styling */ .styled-container .toc{border:1px solid #e0e0e0;background:#fafafa;border-radius:8px;padding:16px;margin:20px 0} .styled-container .toc h3{margin:0 0 8px} .styled-container .toc ul{list-style:none;padding:0;margin:0} .styled-container .toc li{margin:6px 0} .styled-container .toc a{color:#3498db} &lt;/style&gt; &lt;section id=&quot;introduction&quot;&gt; &lt;h1&gt;Free Watermark Remover: Easy AI Tool for Perfect Results&lt;/h1&gt; &lt;p&gt;Struggling with unwanted watermarks on your photos and videos? Whether it&#x27;s a stock image logo, TikTok branding, or any other watermark, our free AI-powered watermark remover tool makes it simple to get clean, professional results in seconds. No technical skills required, no software to install, and best of all โ€“ it&#x27;s completely free to use.&lt;/p&gt; &lt;/section&gt; &lt;!-- Table of Contents --&gt; &lt;section class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#tool-overview&quot;&gt;Why You Need a Free Watermark Remover&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-it-works&quot;&gt;How Our Free Watermark Remover Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tiktok-watermark&quot;&gt;How to Remove TikTok Watermark in Seconds&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#benefits&quot;&gt;Benefits of Using Our Free Watermark Remover&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison&quot;&gt;How Our Tool Compares to Other Methods&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#best-practices&quot;&gt;Best Practices for Watermark Removal&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Common Use Cases&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#testimonials&quot;&gt;What Our Users Say&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Start Removing Watermarks for Free Today&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section id=&quot;tool-overview&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;/images/tools images/AI Watermark Remover Tool.jpg&quot; alt=&quot;AI Watermark Remover Tool&quot; data-method=&quot;insert&quot; /&gt; &lt;/div&gt; &lt;h2&gt;Why You Need a Free Watermark Remover&lt;/h2&gt; &lt;p&gt;Watermarks can ruin otherwise perfect images and videos. Whether you&#x27;re working with stock photos, screenshots, or social media content, watermarks create distractions that detract from your visual message. Our free watermark remover tool gives you the power to:&lt;/p&gt; &lt;div class=&quot;custom-list&quot;&gt; &lt;ul&gt; &lt;li&gt;Remove logos, text, and watermarks from any image&lt;/li&gt; &lt;li&gt;Clean up TikTok videos by removing the platform&#x27;s watermark&lt;/li&gt; &lt;li&gt;Preserve image quality during the watermark removal process&lt;/li&gt; &lt;li&gt;Process photos in seconds with AI-powered technology&lt;/li&gt; &lt;li&gt;Use a professional solution without any cost&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Remove Watermarks?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Try our free AI watermark remover tool now โ€“ no signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; rel=&quot;nofollow&quot;&gt;Remove Watermarks Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;how-it-works&quot;&gt; &lt;h2&gt;How Our Free Watermark Remover Works&lt;/h2&gt; &lt;p&gt;Our AI-powered watermark remover uses advanced machine learning algorithms to detect and remove watermarks while preserving the original image quality. The technology identifies the watermark pattern and intelligently reconstructs the area underneath, resulting in clean, natural-looking images.&lt;/p&gt; &lt;style&gt; .styled-container .video-embed { display: flex; justify-content: center; align-items: center; margin: 24px auto; } .styled-container .video-embed video { width: 100%; max-width: 480px; aspect-ratio: 2 / 3; height: auto; max-height: 80vh; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); background: #000; } @media (max-width: 640px) { .styled-container .video-embed video { max-width: 360px; } } &lt;/style&gt; &lt;div class=&quot;video-embed&quot;&gt; &lt;video controls playsinline autoplay muted preload=&quot;auto&quot; aria-label=&quot;Watermark Remover demo video&quot;&gt; &lt;source src=&quot;/tools%20videos/Watermark%20Remover.mp4&quot; type=&quot;video/mp4&quot; /&gt; Your browser does not support the video tag. &lt;/video&gt; &lt;/div&gt; &lt;h3&gt;Simple 3-Step Process&lt;/h3&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;1. Upload Your Image&lt;/h4&gt; &lt;p&gt;Select any image with a watermark or drag and drop it directly into our tool. We support all common formats including JPG, PNG, and WEBP.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;2. AI Processing&lt;/h4&gt; &lt;p&gt;Our advanced AI automatically detects and removes the watermark, reconstructing the image with remarkable accuracy in just seconds.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h4&gt;3. Download Result&lt;/h4&gt; &lt;p&gt;Preview your watermark-free image and download it immediately. No quality loss, no registration required.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/a3f5da97-9cf5-4c41-9fb6-4fa013123764.jpg&quot; alt=&quot;Before and after comparison of watermark removal on a landscape photo&quot; data-method=&quot;insert&quot; /&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tiktok-watermark&quot;&gt; &lt;h2&gt;How to Remove TikTok Watermark in Seconds&lt;/h2&gt; &lt;p&gt;TikTok videos always come with the platform&#x27;s watermark, which can be distracting when sharing content across different platforms. Our tool makes TikTok watermark removal quick and simple:&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/7518a168-550c-4017-9a29-d58e9b42637d.jpg&quot; alt=&quot;TikTok watermark removal process showing before and after results&quot; data-method=&quot;insert&quot; /&gt; &lt;/div&gt; &lt;div class=&quot;list-numbers&quot;&gt; &lt;ol&gt; &lt;li&gt;Save the TikTok video to your device&lt;/li&gt; &lt;li&gt;Upload the video to our &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;tiktok watermark remover&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Wait a few seconds for the AI to process the video&lt;/li&gt; &lt;li&gt;Download your watermark-free TikTok video&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;I needed to use TikTok content for a client presentation but the watermarks were unprofessional. This tool removed them perfectly without any quality loss!&quot;&lt;/p&gt; &lt;p class=&quot;blockquote-author&quot;&gt;โ€” Sarah K., Marketing Consultant&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Remove TikTok Watermarks Now&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Get clean, professional videos for cross-platform sharing&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; rel=&quot;nofollow&quot;&gt;Remove TikTok Watermark&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;benefits&quot;&gt; &lt;h2&gt;Benefits of Using Our Free Watermark Remover&lt;/h2&gt; &lt;p&gt;When it comes to removing watermarks from photos and videos, our tool offers several advantages over other methods:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Completely Free&lt;/h3&gt; &lt;p&gt;Unlike expensive photo editing software or subscription services, our watermark remover is 100% free to use. No hidden fees, no premium upgrades required to access core functionality.&lt;/p&gt; &lt;h3&gt;No Installation Required&lt;/h3&gt; &lt;p&gt;Access our tool directly in your browser without downloading or installing any software. This saves disk space and eliminates security concerns associated with installing third-party applications.&lt;/p&gt; &lt;h3&gt;Preserves Image Quality&lt;/h3&gt; &lt;p&gt;Our AI technology ensures that image quality remains intact during the watermark removal process. No blurry patches or obvious editing marks โ€“ just clean, professional results.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Works on Any Device&lt;/h3&gt; &lt;p&gt;Whether you&#x27;re using a desktop computer, laptop, tablet, or smartphone, our free watermark remover works seamlessly across all devices with an internet connection.&lt;/p&gt; &lt;h3&gt;Fast Processing&lt;/h3&gt; &lt;p&gt;Get results in seconds rather than spending minutes or hours manually editing images. Our AI processes watermark removal quickly and efficiently.&lt;/p&gt; &lt;h3&gt;No Technical Skills Needed&lt;/h3&gt; &lt;p&gt;You don&#x27;t need to be a Photoshop expert to remove watermarks effectively. Our intuitive interface makes it easy for anyone to achieve professional results.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;\images\blog\Modern PhotoTools Watermark remover.webp&quot; /&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;comparison&quot;&gt; &lt;h2&gt;How Our Free Watermark Remover Compares to Other Methods&lt;/h2&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;td data-row=&quot;head&quot;&gt;Feature&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Our Free AI Tool&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Manual Editing&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Paid Software&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Cost&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;Free&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;Free (time cost)&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;$10-50/month&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Ease of Use&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;Very Easy&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;Difficult&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;Moderate&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Processing Time&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;Seconds&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;10-30 minutes&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;1-5 minutes&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Quality of Results&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;Excellent&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;Varies with skill&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;Good&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Technical Skills Required&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;None&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;Advanced&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;Moderate&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Installation Needed&lt;/td&gt; &lt;td data-label=&quot;Our Free AI Tool&quot;&gt;No&lt;/td&gt; &lt;td data-label=&quot;Manual Editing&quot;&gt;Yes&lt;/td&gt; &lt;td data-label=&quot;Paid Software&quot;&gt;Yes&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Why Struggle with Complicated Methods?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Our free watermark remover gives you professional results without the hassle.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; rel=&quot;nofollow&quot;&gt;Try Our Free Tool Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;best-practices&quot;&gt; &lt;h2&gt;Best Practices for Watermark Removal&lt;/h2&gt; &lt;p&gt;To get the best results when using our free watermark remover, follow these expert tips:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Choose High-Quality Images&lt;/h3&gt; &lt;p&gt;Starting with higher resolution images gives the AI more data to work with, resulting in cleaner watermark removal. Whenever possible, use the highest quality version of your image.&lt;/p&gt; &lt;h3&gt;Consider Watermark Placement&lt;/h3&gt; &lt;p&gt;Images with watermarks on solid backgrounds or less detailed areas tend to yield better results. If you have multiple versions of an image, choose the one where the watermark interferes least with important details.&lt;/p&gt; &lt;h3&gt;Check Legal Considerations&lt;/h3&gt; &lt;p&gt;Always ensure you have the right to use the image after removing the watermark. Our tool is designed for removing watermarks from your own content or images you have permission to modify.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Preview Before Downloading&lt;/h3&gt; &lt;p&gt;Always check the preview of your watermark-free image before downloading. This allows you to verify the quality of the result and make any necessary adjustments.&lt;/p&gt; &lt;h3&gt;Process in Batches&lt;/h3&gt; &lt;p&gt;If you have multiple images that need watermark removal, consider processing them in batches to save time. Our tool is optimized for efficient processing of multiple files.&lt;/p&gt; &lt;h3&gt;Save in the Right Format&lt;/h3&gt; &lt;p&gt;For photos and images with many colors, save as JPG. For graphics with text or transparent elements, choose PNG format for the best quality.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;highlight-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; For complex watermarks that cover large portions of an image, try processing the image twice. First to remove the main watermark, then a second pass to clean up any remaining artifacts.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Common Use Cases for Our Free Watermark Remover&lt;/h2&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Content Creators&lt;/h3&gt; &lt;p&gt;Remove watermarks from stock images and videos to create clean, professional content for blogs, social media, and marketing materials.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/1a5ee4b4-65f7-4a0d-ae10-2629a61b963d.jpg&quot; alt=&quot;Content creator working with watermark-free images&quot; data-method=&quot;text-to-image&quot; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Social Media Managers&lt;/h3&gt; &lt;p&gt;Clean up TikTok videos by removing watermarks for cross-platform sharing on Instagram, YouTube, and other social networks.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/60a28b85-2f34-4407-ae69-23281ef56307.jpg&quot; alt=&quot;Social media manager removing TikTok watermark from video&quot; data-method=&quot;text-to-image&quot; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Photographers&lt;/h3&gt; &lt;p&gt;Remove watermarks from preview images to see how final photos will look before making a purchase decision.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/f05afd51-dbfc-4729-bdbb-219afdaa644c.jpg&quot; alt=&quot;Photographer reviewing watermark-free preview images&quot; data-method=&quot;text-to-image&quot; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Transform Your Images?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of users who trust our free watermark remover for professional results.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; rel=&quot;nofollow&quot;&gt;Remove Watermarks Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot; itemscope itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/FAQPage&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-item&quot; itemscope itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Is this watermark remover really free?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Yes, our watermark remover is completely free to use. There are no hidden fees, subscriptions, or premium features that limit core functionality. We believe in providing accessible tools for everyone.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;How do I remove a watermark from a photo?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Simply visit our &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;free watermark remover&lt;/a&gt; tool, upload your image, wait a few seconds for the AI to process it, and download your watermark-free result. The entire process takes less than a minute.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Can I remove TikTok watermarks from videos?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Yes, our tool specifically supports TikTok watermark removal. Upload your saved TikTok video to our tool, and our AI will remove the watermark while preserving video quality.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Will removing watermarks affect image quality?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;No, our AI-powered watermark remover is designed to preserve image quality during the removal process. Unlike manual editing which can leave obvious marks, our tool intelligently reconstructs the area under the watermark for natural-looking results.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- FAQ JSON-LD Schema --&gt; &lt;script type=&quot;application/ld+json&quot;&gt; { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Is this watermark remover really free?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, our watermark remover is completely free to use. There are no hidden fees, subscriptions, or premium features that limit core functionality. We believe in providing accessible tools for everyone.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How do I remove a watermark from a photo?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Simply visit our free watermark remover tool, upload your image, wait a few seconds for the AI to process it, and download your watermark-free result. The entire process takes less than a minute.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Can I remove TikTok watermarks from videos?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, our tool specifically supports TikTok watermark removal. Upload your saved TikTok video to our tool, and our AI will remove the watermark while preserving video quality.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Will removing watermarks affect image quality?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;No, our AI-powered watermark remover is designed to preserve image quality during the removal process. Unlike manual editing which can leave obvious marks, our tool intelligently reconstructs the area under the watermark for natural-looking results.&quot; } } ] } &lt;/script&gt; &lt;section id=&quot;testimonials&quot;&gt; &lt;h2&gt;What Our Users Say&lt;/h2&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;I needed to remove watermarks from stock photos for my small business website. This tool saved me hundreds of dollars in design costs and worked perfectly!&quot;&lt;/p&gt; &lt;p class=&quot;blockquote-author&quot;&gt;โ€” Michael T., Small Business Owner&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;As a content creator, I often need to remove TikTok watermarks for cross-posting. This free watermark remover is now an essential part of my workflow.&quot;&lt;/p&gt; &lt;p class=&quot;blockquote-author&quot;&gt;โ€” Jamie L., Content Creator&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;I was skeptical about a free tool, but the results are amazing! It removed complex watermarks from my photos with no quality loss. Highly recommended!&quot;&lt;/p&gt; &lt;p class=&quot;blockquote-author&quot;&gt;โ€” Rebecca A., Photographer&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Start Removing Watermarks for Free Today&lt;/h2&gt; &lt;p&gt;Don&#x27;t let watermarks ruin your perfect images and videos. Our free AI watermark remover gives you professional-quality results in seconds, with no technical skills required. Whether you need to remove watermarks from photos or clean up TikTok videos, our tool makes the process simple, fast, and effective.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Transform Your Images Now&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of satisfied users who trust our free watermark remover&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/watermark-remove&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; rel=&quot;nofollow&quot;&gt;Try Our Free Watermark Remover&lt;/a&gt; &lt;/div&gt; &lt;div class=&quot;info-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; While our free watermark remover is powerful, please ensure you have the right to modify images before removing watermarks. Our tool is intended for use with your own content or images you have permission to edit.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ holi-photoshoot-ideas-2025.md</div> <div class="content">--- id: holi-photoshoot-ideas-2025 title: 15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks excerpt: Discover creative Holi photoshoot ideas to capture the festival&#x27;s vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools. publishDate: 2025-08-07 readTime: 14 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg keywords: [&quot;Holi photoshoot ideas&quot;, &quot;festival photography&quot;, &quot;color powder photography&quot;, &quot;Holi portrait ideas&quot;, &quot;AI photo enhancement&quot;, &quot;creative photography&quot;] metaTitle: 15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks metaDescription: Discover creative Holi photoshoot ideas to capture the festival&#x27;s vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools. faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What camera settings work best for Holi photography?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;For Holi photography, use a fast shutter speed (1/1000s or faster) to freeze powder in mid-air, shoot in burst mode for action shots, use a wide aperture (f/1.8-f/2.8) for portraits with shallow depth of field, and protect your camera with weather sealing or plastic covers.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How can I enhance my Holi photos with AI tools?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;AI tools can significantly enhance Holi photos by boosting color saturation and vibrancy, removing unwanted background elements, upscaling image resolution for better detail, replacing cluttered backgrounds with clean alternatives, and applying artistic filters while maintaining natural skin tones.&quot; } } ] } --- &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;&lt;strong&gt;Holi, the festival of colors, offers photographers a canvas of vibrant hues, joyful expressions, and dynamic moments.&lt;/strong&gt; Capturing the essence of this lively celebration requires both creative vision and technical skill. In this guide, we&#x27;ll explore unique Holi photoshoot ideas that will help you create stunning images filled with color, emotion, and festive spirit.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Tools&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience professional-quality AI Images with Modern Photo Tools. No signup required!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;Explore All AI Tools&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#outdoor-ideas&quot;&gt;Outdoor Holi Photoshoot Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#portrait-ideas&quot;&gt;Creative Holi Portrait Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#group-ideas&quot;&gt;Group Holi Photoshoot Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#indoor-ideas&quot;&gt;Indoor Holi Photoshoot Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#creative-concepts&quot;&gt;Creative Concept Holi Photoshoot Ideas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#equipment-protection&quot;&gt;Protecting Your Camera During Holi Photography&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#editing-tips&quot;&gt;Enhancing Your Holi Photos with AI Tools&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Capturing the Spirit of Holi&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;outdoor-ideas&quot;&gt; &lt;h2&gt;Outdoor Holi Photoshoot Ideas&lt;/h2&gt; &lt;p&gt;The natural light and open spaces of outdoor settings create the perfect backdrop for vibrant Holi photography. Here are some creative ideas to capture the festival&#x27;s energy in outdoor environments.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/58f5fccd-f68c-4d53-b51f-4c5d2fdab3c8.jpg&quot; alt=&quot;Person throwing colorful Holi powder against blue sky&quot;&gt; &lt;/div&gt; &lt;h3&gt;1. Color Powder Explosion&lt;/h3&gt; &lt;p&gt;One of the most iconic Holi photoshoot ideas involves capturing the moment colored powder explodes into the air. Position your subject against the sky and ask them to throw or blow Holi powder upward. Use a fast shutter speed (1/1000s or faster) to freeze the powder in mid-air, creating a dramatic explosion of color.&lt;/p&gt; &lt;p&gt;For the best results, shoot during the golden hour when the sunlight is soft and warm. This natural lighting will make the colors appear more vibrant and create a magical glow around your subject.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Enhance Your Color Explosions&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Sometimes unwanted elements can distract from your perfect powder shot. Our AI Cleanup tool can remove photobombers, distracting background elements, or imperfections while preserving the vibrant colors of your Holi photos.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Cleanup Tool&lt;/a&gt; &lt;/div&gt; &lt;h3&gt;2. Action Shots with Water Balloons&lt;/h3&gt; &lt;p&gt;Capture the playful spirit of Holi by photographing the moment colorful water balloons burst. This creates dynamic splashes that look spectacular in photos. Use burst mode to take multiple shots in quick succession, increasing your chances of capturing the perfect splash moment.&lt;/p&gt; &lt;p&gt;To freeze the water droplets in mid-air, use a shutter speed of at least 1/2000s. Position yourself at a safe distance to protect your equipment while still getting close enough to capture the details of the splash.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg&quot; alt=&quot;Water balloon bursting with colorful water during Holi celebration&quot;&gt; &lt;/div&gt; &lt;h3&gt;3. Golden Hour Portraits&lt;/h3&gt; &lt;p&gt;The soft, warm light during the golden hour (shortly after sunrise or before sunset) creates a magical atmosphere for Holi portraits. Position your subject with the sun behind them to create a beautiful backlit effect that makes the colored powder particles glow.&lt;/p&gt; &lt;p&gt;Ask your subject to gently toss powder into the air above them while you capture the moment the particles catch the sunlight. This creates a dreamy, ethereal effect that enhances the festive mood of your Holi photos.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/2e985803-caa6-4833-8e59-a6ca111e976f.jpg&quot; alt=&quot;Golden hour portrait with Holi colors glowing in backlight&quot;&gt; &lt;/div&gt; &lt;h3&gt;4. Aerial Perspective&lt;/h3&gt; &lt;p&gt;Capture the full scale and vibrancy of Holi celebrations by shooting from an elevated position. This could be from a balcony, rooftop, or using a drone if available. This perspective allows you to photograph patterns of color created by groups of people and the colorful chaos of the festival from above.&lt;/p&gt; &lt;p&gt;Look for interesting formations or moments when multiple people throw colors simultaneously. The resulting image will showcase the collective joy and energy of the celebration in a unique way.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;portrait-ideas&quot;&gt; &lt;h2&gt;Creative Holi Portrait Ideas&lt;/h2&gt; &lt;p&gt;Portraits during Holi can capture the personal joy and vibrant spirit of participants. Here are some creative approaches to Holi portrait photography that will result in stunning, memorable images.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/573ac44f-d645-4752-83af-940819d6d6f9.jpg&quot; alt=&quot;Close-up portrait of face covered with colorful Holi powder&quot;&gt; &lt;/div&gt; &lt;h3&gt;5. Colorful Close-Up Portraits&lt;/h3&gt; &lt;p&gt;Create striking portraits by focusing on close-up shots of faces covered in Holi colors. Use a portrait lens (85mm or 50mm) with a wide aperture (f/1.8-f/2.8) to create a shallow depth of field that blurs the background while keeping the subject&#x27;s face in sharp focus.&lt;/p&gt; &lt;p&gt;Direct your subject to look directly into the camera to create an emotional connection with viewers. The contrast between their eyes and the colorful powder on their face creates a powerful visual impact.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Perfect Your Portraits&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Turn good portraits into stunning ones with our AI Portrait tool. Enhance facial features, balance colors, and create professional-quality portraits with just a few clicks.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-portrait&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Enhance With AI Portrait&lt;/a&gt; &lt;/div&gt; &lt;h3&gt;6. Hands Full of Colors&lt;/h3&gt; &lt;p&gt;Sometimes the most expressive Holi photos focus on hands covered in colorful powder. Ask your subject to hold their hands out, palms up, filled with different colored powders. Capture the moment they blow the powder or let it slip through their fingers.&lt;/p&gt; &lt;p&gt;Use a macro lens if available to capture the fine details and textures of the powder. This creates an intimate perspective that highlights the tactile nature of the Holi celebration.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/64bc670d-0e95-47c1-a314-d8693b55e768.jpg&quot; alt=&quot;Close-up of hands holding colorful Holi powder&quot;&gt; &lt;/div&gt; &lt;h3&gt;7. Contrast Portraits&lt;/h3&gt; &lt;p&gt;Create dramatic portraits by photographing subjects against a dark background. The contrast between the vibrant Holi colors and the dark backdrop makes the colors pop and creates a striking visual effect.&lt;/p&gt; &lt;p&gt;For indoor shoots, use a black backdrop or find a dark wall. For outdoor shoots, position your subject in front of a shadowed area or use a portable black backdrop. Add a single light source from the side to create dimension and highlight the colored powder.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;group-ideas&quot;&gt; &lt;h2&gt;Group Holi Photoshoot Ideas&lt;/h2&gt; &lt;p&gt;Holi is a festival of community and togetherness, making group photos an essential part of capturing its spirit. Here are some creative ideas for photographing groups during Holi celebrations.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/031e0b7b-50d1-4549-a25b-adb5b7ed2702.jpg&quot; alt=&quot;Group of friends throwing Holi colors simultaneously&quot;&gt; &lt;/div&gt; &lt;h3&gt;8. Synchronized Color Throw&lt;/h3&gt; &lt;p&gt;Arrange a group in a circle or line and coordinate a simultaneous color throw. Count down and capture the moment everyone throws their powder into the air. This creates a spectacular explosion of multiple colors and showcases the collective joy of the celebration.&lt;/p&gt; &lt;p&gt;Use a wide-angle lens to capture the entire group and the full effect of the color cloud. Position yourself at a slight distance to include all participants and the colorful powder in your frame.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Expand Your Group Shots&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Did your group photo cut off someone important? Our AI Expand tool can extend your image canvas to include everyone in the frame without awkward cropping.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-expand&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Expand Now&lt;/a&gt; &lt;/div&gt; &lt;h3&gt;9. Candid Interaction Shots&lt;/h3&gt; &lt;p&gt;Some of the most authentic Holi photos capture unposed moments of friends and family playing with colors. Move around the celebration and look for genuine moments of laughter, surprise, and joy as people apply colors to each other.&lt;/p&gt; &lt;p&gt;Use a zoom lens to capture these moments without interrupting the natural flow of interactions. Focus on capturing authentic emotions rather than perfectly composed shots.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/5042787f-1129-4477-a0a8-80926e2c84cf.jpg&quot; alt=&quot;Candid shot of friends laughing while playing with Holi colors&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;indoor-ideas&quot;&gt; &lt;h2&gt;Indoor Holi Photoshoot Ideas&lt;/h2&gt; &lt;p&gt;Indoor settings offer controlled environments for creative Holi photography. Here are some ideas that work well in studios or home settings while minimizing mess.&lt;/p&gt; &lt;h3&gt;10. Controlled Lighting with Powder&lt;/h3&gt; &lt;p&gt;In a studio or well-lit indoor space, create dramatic Holi photos by controlling both the lighting and the powder throw. Use side lighting or backlighting to highlight the particles of powder in the air, creating a three-dimensional effect.&lt;/p&gt; &lt;p&gt;Place a light source behind the subject and have them throw powder toward the camera (being careful to protect your equipment). This creates a magical effect as the light passes through the colored particles.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f650fae6-02ec-4183-9035-7aa3f3f2edbe.jpg&quot; alt=&quot;Indoor studio shot with controlled lighting and Holi powder&quot;&gt; &lt;/div&gt; &lt;h3&gt;11. Creative Backgrounds&lt;/h3&gt; &lt;p&gt;For indoor Holi photoshoots, experiment with different backgrounds to complement the colorful powder. White backgrounds create a clean, bright look, while black backgrounds make the colors pop dramatically. You can also use colored backdrops that complement or contrast with your Holi powder colors.&lt;/p&gt; &lt;p&gt;Consider using textured backgrounds like fabric or paper for added visual interest. The contrast between the smooth powder and textured background creates depth in your images.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Create Perfect Backgrounds&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Need a specific background for your Holi portraits? Our AI Background Generator can create custom backgrounds that perfectly complement your Holi colors.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Generate Custom Backgrounds&lt;/a&gt; &lt;/div&gt; &lt;h3&gt;12. UV Reactive Holi Colors&lt;/h3&gt; &lt;p&gt;Create a unique twist on traditional Holi photography by using UV-reactive colors and blacklight. In a darkened room with UV lights, these special colors will glow vibrantly, creating a surreal, otherworldly effect in your photos.&lt;/p&gt; &lt;p&gt;Experiment with different poses and movements under the blacklight. The glowing colors against the dark background create dramatic, artistic images unlike traditional Holi photos.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/b399f9bf-2528-4d2a-8601-6edfbc6bf6c1.jpg&quot; alt=&quot;Portrait with UV-reactive Holi colors under blacklight&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;creative-concepts&quot;&gt; &lt;h2&gt;Creative Concept Holi Photoshoot Ideas&lt;/h2&gt; &lt;p&gt;Take your Holi photography to the next level with these creative conceptual ideas that produce unique, artistic images.&lt;/p&gt; &lt;h3&gt;13. Holi Color Silhouettes&lt;/h3&gt; &lt;p&gt;Create artistic silhouette photos by positioning your subject between the camera and a bright light source (like the sun or a studio light). Have them throw Holi powder while you expose for the background, turning your subject into a dark silhouette surrounded by colorful powder.&lt;/p&gt; &lt;p&gt;This technique creates a dramatic, artistic effect that highlights the shape and movement of both the subject and the colored powder. Experiment with different poses and powder throws to create unique silhouettes.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a0562a14-b4a8-4213-96df-26aeae1218ff.jpg&quot; alt=&quot;Silhouette of person throwing Holi powder against bright background&quot;&gt; &lt;/div&gt; &lt;h3&gt;14. Slow Motion Effect&lt;/h3&gt; &lt;p&gt;While traditional photography freezes motion, you can create artistic Holi photos by intentionally capturing motion blur. Use a slower shutter speed (1/15s to 1/60s) and ask your subject to move while throwing or blowing powder.&lt;/p&gt; &lt;p&gt;This technique creates dreamy, abstract images where the colors blend and streak across the frame. The result is a dynamic representation of the festival&#x27;s energy and movement.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Enhance Image Quality&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Motion blur shots sometimes lose detail. Our AI Image Upscaler can enhance resolution and bring back clarity to your creative Holi photos.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Upscale Your Images&lt;/a&gt; &lt;/div&gt; &lt;h3&gt;15. Holi Face as Art&lt;/h3&gt; &lt;p&gt;Transform Holi makeup into artistic face painting by applying colors in intentional patterns rather than the usual random application. Create geometric designs, gradients, or other artistic patterns using Holi colors on the face.&lt;/p&gt; &lt;p&gt;Photograph these artistic creations as portraits, focusing on the detailed application of color and the expression of the subject. This approach combines traditional Holi elements with contemporary body art concepts.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/edb740b0-5ab9-4963-b580-53c5c58d54f3.jpg&quot; alt=&quot;Artistic Holi face painting with intentional color patterns&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;equipment-protection&quot;&gt; &lt;h2&gt;Protecting Your Camera During Holi Photography&lt;/h2&gt; &lt;p&gt;Holi&#x27;s colorful powders and water can damage camera equipment if proper precautions aren&#x27;t taken. Here are essential tips to protect your gear while capturing the festival.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Essential Protection Tips&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Use a weather-sealed camera if available&lt;/li&gt; &lt;li&gt;Cover your camera with a clear plastic bag or dedicated rain cover&lt;/li&gt; &lt;li&gt;Apply UV filters to protect your lenses&lt;/li&gt; &lt;li&gt;Avoid changing lenses in dusty environments&lt;/li&gt; &lt;li&gt;Keep lens caps on when not shooting&lt;/li&gt; &lt;li&gt;Use a lens hood for additional protection&lt;/li&gt; &lt;li&gt;Clean equipment thoroughly after the shoot&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/136c584c-46e0-4d7a-85f6-4011e231e008.jpg&quot; alt=&quot;Camera protected with plastic cover during Holi festival&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Rescue Imperfect Photos&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;If your photos didn&#x27;t turn out perfect due to equipment issues or challenging conditions, our AI tools can help rescue and enhance your Holi memories.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Enhance With AI Filters&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;editing-tips&quot;&gt; &lt;h2&gt;Enhancing Your Holi Photos with AI Tools&lt;/h2&gt; &lt;p&gt;Even with perfect shooting techniques, Holi photos often benefit from post-processing to bring out their full potential. Here&#x27;s how our AI tools can transform your Holi photography.&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Color Enhancement&lt;/h3&gt; &lt;p&gt;Holi photos should pop with vibrant colors. Our AI Filter tool can automatically enhance color saturation and contrast while maintaining natural skin tones.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/6cfe45f4-4827-4c9f-8855-395c3eeefd5c.jpg&quot; alt=&quot;Before and after of Holi photo with enhanced colors&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Background Replacement&lt;/h3&gt; &lt;p&gt;Remove distracting backgrounds from your Holi portraits with our AI Replace tool. Swap cluttered backgrounds with clean, complementary alternatives.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a1d26bbd-f38d-4b03-bd65-c5103c93cb81.jpg&quot; alt=&quot;Holi portrait with background replaced using AI&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Detail Enhancement&lt;/h3&gt; &lt;p&gt;Bring out the fine details of powder particles and expressions with our AI Image Upscaler, which enhances resolution without introducing artifacts.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/602f86b8-f6ce-4d07-9f86-5bb520ac93a4.jpg&quot; alt=&quot;Close-up of Holi powder details enhanced with AI upscaling&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Transform Your Holi Photos&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Ready to take your Holi photography to the next level? Our complete suite of AI photo editing tools can help you create stunning, professional-quality images from your Holi celebration.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Explore All AI Tools&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Capturing the Spirit of Holi&lt;/h2&gt; &lt;p&gt;Holi photography offers a unique opportunity to capture vibrant colors, genuine emotions, and cultural traditions. With the right techniques and creative approaches, you can create stunning images that preserve the joy and energy of this colorful festival.&lt;/p&gt; &lt;p&gt;Remember that the best Holi photos often come from a balance of technical skill and spontaneity. Be prepared with the right equipment protection, but also be ready to capture unplanned moments of joy and celebration.&lt;/p&gt; &lt;p&gt;Whether you&#x27;re shooting outdoors in natural light or creating controlled studio setups, these Holi photoshoot ideas will help you create memorable images. And with our powerful AI editing tools, you can enhance your photos to truly capture the vibrant spirit of the festival of colors.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h4 class=&quot;cta-block-title&quot;&gt;Start Creating Stunning Holi Photos Today&lt;/h4&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Explore our complete suite of AI photo editing tools and transform your Holi photography from ordinary to extraordinary.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large cta-btn-accent&quot;&gt;Get Started Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt;&lt;/div&gt; &lt;style&gt;.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0}.styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5}.styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1}.styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5}.styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2}.styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5}.styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3}.styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5}.styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4}.styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1}.styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2}.styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3}.styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4}.styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5}.styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6}.styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7}.styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8}.styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9}.styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;}.styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;]{margin-bottom:20px}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns&gt;div:not([class]),.styled-container .three-columns&gt;div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}&lt;/style&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ how-to-create-professional-product-photos-with-ai.md</div> <div class="content">--- id: how-to-create-professional-product-photos-with-ai title: &quot;How to Create Professional Product Photos with AI | Modern Photo Tools&quot; excerpt: &quot;Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills.&quot; publishDate: oct 27, 2025 readTime: 14 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg keywords: [&quot;AI product photography&quot;, &quot;product photos&quot;,&quot;e-commerce images&quot;] metaTitle: &quot;How to Create Professional Product Photos with AI | Modern Photo Tools&quot; metaDescription: &quot;Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills.&quot; --- &lt;style&gt; :root { --bg: #ffffff; --text: #1f2937; --muted: #6b7280; --primary: #2563eb; --primary-dark: #1d4ed8; --accent: #7c3aed; --card: #f9fafb; --border: #e5e7eb; --success: #16a34a; } body { background: var(--bg); color: var(--text); } .container { max-width: 1100px; margin: 0 auto; padding: 24px; } h1 { font-size: 2.2rem; line-height: 1.2; margin: 24px 0; color: #0f172a; } h2 { font-size: 1.6rem; margin: 24px 0 16px; color: #111827; } h3 { font-size: 1.2rem; margin: 18px 0 10px; color: #1f2937; } p { font-size: 1rem; line-height: 1.75; color: var(--text); margin: 12px 0; } a { color: var(--primary); text-decoration: none; } a:hover { color: var(--primary-dark); text-decoration: underline; } ul.custom-list { list-style: disc; padding-left: 20px; } li { margin: 6px 0; } .img-container { border-radius: 12px; overflow: hidden; background: #f3f4f6; border: 1px solid var(--border); margin: 12px 0 18px; } .img-container img { width: 100%; display: block; object-fit: cover; } .hero-intro { background: linear-gradient(135deg, #eef2ff, #faf5ff); border: 1px solid var(--border); border-radius: 16px; padding: 20px; } .two-columns { display: grid; grid-template-columns: 1fr; gap: 18px; } @media (min-width: 768px) { .two-columns { grid-template-columns: 1fr 1fr; } } .three-columns { display: grid; grid-template-columns: 1fr; gap: 18px; } @media (min-width: 900px) { .three-columns { grid-template-columns: repeat(3, 1fr); } } .column-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; } .cta-block { background: linear-gradient(135deg, #eff6ff, #f5f3ff); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 24px 0; text-align: center; } .cta-block-title { font-size: 1.3rem; margin-bottom: 6px; } .cta-block-text { color: var(--muted); margin-bottom: 12px; } .cta-btn { display: inline-block; padding: 10px 16px; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; font-weight: 600; } .cta-btn:hover { filter: brightness(1.05); } .cta-btn-large { padding: 12px 18px; } .table-container { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: #fff; } table.responsive-table { width: 100%; border-collapse: collapse; } table.responsive-table td { border-bottom: 1px solid var(--border); padding: 12px; text-align: left; } .responsive-table-striped tbody tr:nth-child(odd) { background: #f9fafb; } td[data-row=&quot;head&quot;] { font-weight: 700; color: #111827; background: #f3f4f6; } .toc { border: 1px solid var(--border); background: #fafafa; border-radius: 12px; padding: 16px; margin: 16px 0 24px; } .toc h2 { margin-top: 0; } .toc ul { list-style: none; padding: 0; } .toc li { margin: 8px 0; } .toc a { font-weight: 600; } .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: #000; } .video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; } .faq-question { font-size: 1.05rem; font-weight: 700; } .faq-answer p { color: var(--muted); } &lt;/style&gt; &lt;div class=&quot;container&quot;&gt; &lt;h1&gt;How to Create Professional Product Photos with AI | ModernPhoto Tools&lt;/h1&gt; &lt;!-- Featured Image --&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg&quot; alt=&quot;AI-generated professional product photo on desire background&quot;&gt; &lt;/div&gt; &lt;!-- Intro --&gt; &lt;section class=&quot;hero-intro&quot;&gt; &lt;p&gt;Want studio-quality product photos without hiring photographers or buying expensive lighting gear? With AI, you can turn simple product shots into polished, professional visuals in minutes. This guide shows you how to create modern, high-impact product photos using accessible AI toolsโ€”perfect for e-commerce, social media, and marketing.&lt;/p&gt; &lt;/section&gt; &lt;!-- Table of Contents --&gt; &lt;section class=&quot;toc&quot; aria-label=&quot;Table of Contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#benefits&quot;&gt;Why Use AI for Product Photography?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-it-works&quot;&gt;How AI Product Photography Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#getting-started&quot;&gt;Getting Started with AI Product Photography&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tips&quot;&gt;Pro Tips for Better AI Product Photos&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Creative Use Cases for AI Product Photos&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tool-introduction&quot;&gt;Introducing Our AI Product Photoshoot Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison&quot;&gt;AI vs. Traditional Product Photography&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Transform Your Product Photography Today&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;!-- Why Use AI --&gt; &lt;section id=&quot;benefits&quot;&gt; &lt;h2&gt;Why Use AI for Product Photography?&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;p&gt;AI makes professional product photography accessible to everyone. Instead of building a studio, you can capture basic product shots on a phone and let AI handle backgrounds, lighting, and the scene.&lt;/p&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Save costโ€”no studio gear or expensive sessions&lt;/li&gt; &lt;li&gt;Create polished results in minutes, not days&lt;/li&gt; &lt;li&gt;Generate unlimited variations and consistent branding&lt;/li&gt; &lt;li&gt;Scale content across catalogs and campaigns easily&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- How It Works --&gt; &lt;section id=&quot;how-it-works&quot;&gt; &lt;h2&gt;How AI Product Photography Works&lt;/h2&gt; &lt;div&gt; &lt;div class=&quot;video-container&quot; aria-label=&quot;AI Product Photography video&quot;&gt; &lt;iframe src=&quot;https://www.youtube.com/embed/gTKpgCNS3V8&quot; title=&quot;AI Product Photography Overview&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;p&gt;Watch how AI turns simple product shots into professional visuals suitable for eโ€‘commerce, ads, and social media.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Background Removal&lt;/h3&gt; &lt;p&gt;Precisely removes the original background while preserving product edges and fine details.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Scene Generation&lt;/h3&gt; &lt;p&gt;Builds photorealistic environments from simple text prompts, aligned to your brand style.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Lighting &amp; Enhancement&lt;/h3&gt; &lt;p&gt;Applies studio-quality lighting, natural shadows, and clarity adjustments for a premium look.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- Getting Started --&gt; &lt;section id=&quot;getting-started&quot;&gt; &lt;h2&gt;Getting Started with AI Product Photography&lt;/h2&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Capture a clear product photo in soft, even light&lt;/li&gt; &lt;li&gt;Upload the image to your AI product photography tool&lt;/li&gt; &lt;li&gt;Choose a clean background or generate a lifestyle scene&lt;/li&gt; &lt;li&gt;Adjust lighting, shadows, and composition if needed&lt;/li&gt; &lt;li&gt;Export high-resolution images ready for web or print&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;!-- Pro Tips --&gt; &lt;section id=&quot;tips&quot;&gt; &lt;h2&gt;Pro Tips for Better AI Product Photos&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Optimize Your Input Image&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/14aad0f8-8e68-4e43-aa56-804854ef29ef.jpg&quot; alt=&quot;Comparison showing poor vs good input images&quot;&gt; &lt;/div&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Use diffused light to avoid harsh shadows&lt;/li&gt; &lt;li&gt;Shoot against a simple, contrasting background&lt;/li&gt; &lt;li&gt;Keep the product fully in frame and in focus&lt;/li&gt; &lt;li&gt;Clean surfaces to remove dust and fingerprints&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Craft Effective Text Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/130ce90a-8df3-4f0d-8135-deb20972db8d.jpg&quot; alt=&quot;Examples of effective prompts for product scenes&quot;&gt; &lt;/div&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Specify materials: โ€œmarble countertopโ€, โ€œoak tableโ€, etc.&lt;/li&gt; &lt;li&gt;Describe lighting: โ€œsoft natural light from the leftโ€&lt;/li&gt; &lt;li&gt;Add mood: โ€œminimalist kitchen setting, morning lightโ€&lt;/li&gt; &lt;li&gt;Include brand cues: โ€œluxury bathroom with gold accentsโ€&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- Use Cases --&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Creative Use Cases for AI Product Photography&lt;/h2&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;E-commerce Product Listings&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c3d1a62d-831d-4f52-96c5-5d98622d8f09.jpg&quot; alt=&quot;Consistent AI product listing images&quot;&gt; &lt;/div&gt; &lt;p&gt;Maintain consistent backgrounds and lighting across hundreds of SKUsโ€”without reshoots.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Social Media Content&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/786dd410-14d2-4a38-a8bf-4169f03b1c54.jpg&quot; alt=&quot;Lifestyle product photos for social media&quot;&gt; &lt;/div&gt; &lt;p&gt;Generate on-brand lifestyle images for seasonal campaigns and high engagement posts.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Marketing Campaigns&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/1cdb328b-cc6c-4f96-97b3-18372a3e368b.jpg&quot; alt=&quot;AI product photos for campaigns&quot;&gt; &lt;/div&gt; &lt;p&gt;Produce campaign-specific visuals fast. Test multiple concepts without costly production.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- Tool Introduction --&gt; &lt;section id=&quot;tool-introduction&quot;&gt; &lt;h2&gt;Introducing Our AI Product Photoshoot Tool&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/a75d28c5-5d79-4a08-b3ac-217358d9a03b.jpg&quot; alt=&quot;Modern Photo Tools AI Product Photoshoot interface&quot;&gt; &lt;/div&gt; &lt;p&gt;Combine powerful AI with an intuitive interface to create studio-quality product photos in minutes.&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;Intelligent Background Removal&lt;/h3&gt;&lt;p&gt;Exceptional accuracy, even for complex edges and textures.&lt;/p&gt;&lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;Realistic Scene Generation&lt;/h3&gt;&lt;p&gt;Limitless variations from simple prompts for brand-aligned visuals.&lt;/p&gt;&lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;Professional Lighting Effects&lt;/h3&gt;&lt;p&gt;Natural shadows, reflections, and balanced highlights.&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;Batch Processing&lt;/h3&gt;&lt;p&gt;Create consistent visuals across your full catalog at once.&lt;/p&gt;&lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;High-Resolution Exports&lt;/h3&gt;&lt;p&gt;Ready for websites, marketplaces, print, and ads.&lt;/p&gt;&lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt;&lt;h3&gt;User-Friendly Interface&lt;/h3&gt;&lt;p&gt;No technical skills requiredโ€”accessible to everyone.&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Transform Your Product Photos?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands using our AI Product Photoshoot Tool to create professional images fast.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-product-photoshoot&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; rel=&quot;nofollow&quot;&gt;Create professional product photos with AI&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- Comparison --&gt; &lt;section id=&quot;comparison&quot;&gt; &lt;h2&gt;AI vs. Traditional Product Photography&lt;/h2&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;td data-row=&quot;head&quot;&gt;Feature&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;AI Product Photography&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Traditional Photography&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Cost&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;$10โ€“50/month subscription&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;$200โ€“500+ per product/session&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Time Required&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;Minutes per product&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;Hours to days per session&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Equipment Needed&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;Basic smartphone camera&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;Pro camera, lighting, studio&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Skill Level&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;Beginnerโ€‘friendly&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;Professional expertise required&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Revisions&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;Unlimited, instant&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;Limited, requires reshoots&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Scaling&lt;/td&gt; &lt;td data-label=&quot;AI Product Photography&quot;&gt;Scale to hundreds of products easily&lt;/td&gt; &lt;td data-label=&quot;Traditional Photography&quot;&gt;Linear cost increase with more products&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/section&gt; &lt;!-- FAQ --&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Will AI-generated product photos look realistic?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes. Modern AI tools create highly realistic product photos that often look indistinguishable from traditional studio photography. Quality depends on your input image and the tool used; our approach ensures natural lighting, shadows, and reflections.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Do I need any special equipment to get started?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;No special equipment is required. A smartphone in natural light is enough to capture a solid input image. AI handles backgrounds, lighting, and scene creation to produce professional results.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type=&quot;application/ld+json&quot;&gt; { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Will AI-generated product photos look realistic?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes. Modern AI tools create highly realistic product photos that often look indistinguishable from traditional studio photography. Quality depends on your input image and the tool used; our approach ensures natural lighting, shadows, and reflections.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Do I need any special equipment to get started?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;No special equipment is required. A smartphone in natural light is enough to capture a solid input image. AI handles backgrounds, lighting, and scene creation to produce professional results.&quot; } } ] } &lt;/script&gt; &lt;/section&gt; &lt;!-- Conclusion --&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Transform Your Product Photography Today&lt;/h2&gt; &lt;p&gt;AI product photography is changing how brands create visuals. With the right tool, you can produce professional, consistent, and on-brand images quicklyโ€”without the cost of studio production.&lt;/p&gt; &lt;p&gt;Whether you run an online store, post on social media, or build ad campaigns, AI helps you scale high-quality product imagery with minimal effort.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Start Creating Professional Product Photos Now&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;No photography skills needed. No expensive equipment required. Just upload your product and let AI do the magic.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-product-photoshoot&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; rel=&quot;nofollow&quot;&gt;Create professional product photos with AI&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ how-to-restore-old-family-photos.md</div> <div class="content">--- id: how-to-restore-old-family-photos title: &quot;How to Restore Old Family Photos: A Step-by-Step AI Guide&quot; excerpt: &quot;Learn how to breathe new life into damaged family photos with AI photo restoration. Our step-by-step guide shows you how to fix scratches, enhance details, and preserve precious memories.&quot; publishDate: &quot;2025-010-18&quot; readTime: &quot;12 min read&quot; category: tutorial featuredImage: &quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg&quot; relatedTool: &quot;ai-image-upscaler&quot; keywords: [&quot;AI photo restoration&quot;, &quot;restore old photos&quot;, &quot;family photo restoration&quot;, &quot;AI image upscaler&quot;, &quot;photo repair&quot;, &quot;digital photo restoration&quot;] metaTitle: &quot;How to Restore Old Family Photos: A Step-by-Step AI Guide&quot; metaDescription: &quot;Learn how to breathe new life into damaged family photos with AI photo restoration. Our step-by-step guide shows you how to fix scratches, enhance details, and preserve precious memories.&quot; faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Can AI restore any damaged photo?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;AI can restore most damaged photos, but results vary based on damage severity. Our tool works best with photos that have scratches, tears, fading, and blurriness. Extremely damaged photos with large missing sections may have limitations, but you&#x27;ll be surprised by what modern AI can accomplish.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Will AI photo restoration change how people look in my photos?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Our AI is designed to enhance while preserving authenticity. It improves clarity and detail but maintains the original appearance and expressions of people in your photos. The goal is restoration, not alteration.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How accurate is AI colorization for black and white photos?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;AI colorization has become remarkably accurate. The algorithm analyzes context clues and historical data to apply natural, period-appropriate colors. While not 100% historically accurate in every detail, the results are usually very convincing and bring new life to black and white photos.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Is my data safe when using your AI photo restoration tool?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, we take privacy seriously. Your uploaded photos are processed securely and are not stored permanently on our servers. All uploads are automatically deleted after processing, and we never use your personal photos for AI training without explicit consent.&quot; } } ] } --- &lt;title&gt;How to Restore Old Family Photos: A Step-by-Step AI Guide&lt;/title&gt; &lt;style&gt;.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0}.styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5}.styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1}.styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5}.styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2}.styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5}.styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3}.styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5}.styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4}.styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1}.styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2}.styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3}.styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4}.styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5}.styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6}.styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7}.styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8}.styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9}.styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;}.styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;]{margin-bottom:20px}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns&gt;div:not([class]),.styled-container .three-columns&gt;div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}&lt;/style&gt; &lt;div class=&quot;styled-container&quot;&gt;&lt;section id=&quot;introduction&quot;&gt; &lt;h1&gt;How to Restore Old Family Photos: A Step-by-Step AI Guide&lt;/h1&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#why-restore&quot;&gt;Why Restore Your Old Family Photos?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#how-ai-works&quot;&gt;How AI Photo Restoration Works&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#preparation&quot;&gt;Preparing Your Photos for AI Restoration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#step-by-step&quot;&gt;Step-by-Step Guide to AI Photo Restoration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#advanced-techniques&quot;&gt;Advanced AI Photo Restoration Techniques&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tips-tricks&quot;&gt;Tips and Tricks for Better Results&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions About AI Photo Restoration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;p&gt;Those faded, scratched, and torn family photographs tucked away in albums and shoeboxes hold irreplaceable memories. Until recently, restoring these treasured images required expensive professional services or complex photo editing skills. Today, AI photo restoration technology has made it possible for anyone to breathe new life into damaged photos with just a few clicks. This guide will walk you through the simple process of transforming your deteriorating family photos into vibrant, clear images that can be preserved for generations to come.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;why-restore&quot;&gt; &lt;h2&gt;Why Restore Your Old Family Photos?&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg&quot; alt=&quot;Before and after comparison of AI photo restoration showing a damaged family photo transformed into a clear, vibrant image&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Old photographs are more than just imagesโ€”they&#x27;re irreplaceable windows into your family&#x27;s history. Unfortunately, time takes its toll on physical photos. Colors fade, paper deteriorates, and handling causes scratches and tears. Restoring these photos preserves your family legacy and brings forgotten memories back to life.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Common Issues with Old Photos&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Fading and color shifts&lt;/li&gt; &lt;li&gt;Scratches, creases, and tears&lt;/li&gt; &lt;li&gt;Water damage and stains&lt;/li&gt; &lt;li&gt;Blurriness and loss of detail&lt;/li&gt; &lt;li&gt;Yellowing and sepia toning&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Benefits of AI Photo Restoration&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Restore damaged photos in seconds&lt;/li&gt; &lt;li&gt;Enhance facial details and expressions&lt;/li&gt; &lt;li&gt;Revive faded colors or colorize black and white photos&lt;/li&gt; &lt;li&gt;Improve overall clarity and sharpness&lt;/li&gt; &lt;li&gt;Preserve precious memories for future generations&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Bring Your Old Photos Back to Life?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Our AI Image Upscaler tool can help restore your precious memories in just a few clicks.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; rel=&quot;nofollow&quot;&gt;Restore Your Photos Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;how-ai-works&quot;&gt; &lt;h2&gt;How AI Photo Restoration Works&lt;/h2&gt; &lt;p&gt;Before diving into the restoration process, it helps to understand how AI photo restoration actually works. Unlike traditional photo editing that requires manual adjustments, AI-powered tools use machine learning algorithms trained on millions of images to automatically identify and fix damage.&lt;/p&gt; &lt;div class=&quot;video-embed&quot;&gt; &lt;iframe src=&quot;https://www.youtube.com/embed/u317ockLJ44&quot; width=&quot;100%&quot; height=&quot;450&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Pattern Recognition&lt;/h3&gt; &lt;p&gt;AI analyzes your photo to identify patterns of damage like scratches, tears, and stains, distinguishing them from the actual image content.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Detail Reconstruction&lt;/h3&gt; &lt;p&gt;Using what it&#x27;s learned from millions of images, the AI fills in missing details, restores faded areas, and enhances facial features.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Color Enhancement&lt;/h3&gt; &lt;p&gt;AI algorithms can revive faded colors or even intelligently colorize black and white photos based on contextual understanding.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;preparation&quot;&gt; &lt;h2&gt;Preparing Your Photos for AI Restoration&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/665e2d19-22b0-4558-9544-af49c4906d05.jpg&quot; alt=&quot;Person scanning an old damaged family photo using a flatbed scanner for AI photo restoration&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Before you can restore old photos with AI, you&#x27;ll need to digitize them. The quality of your digital scan directly impacts the restoration results, so follow these steps for the best outcome:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Digitizing Options&lt;/h3&gt; &lt;ul class=&quot;list-numbers&quot;&gt; &lt;li&gt;Use a flatbed scanner at 300-600 DPI for best results&lt;/li&gt; &lt;li&gt;If you don&#x27;t have a scanner, use a smartphone with good lighting&lt;/li&gt; &lt;li&gt;For valuable photos, consider professional scanning services&lt;/li&gt; &lt;li&gt;Ensure the entire photo is captured, including edges&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Scanning Tips&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Clean the scanner glass thoroughly before scanning&lt;/li&gt; &lt;li&gt;Place photos flat to avoid additional shadows or distortion&lt;/li&gt; &lt;li&gt;Scan in color even for black and white photos&lt;/li&gt; &lt;li&gt;Save files as uncompressed TIFF or high-quality JPG&lt;/li&gt; &lt;li&gt;Create a backup of original scans before restoration&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;The better your initial scan quality, the better your restoration results will be. Take time to properly digitize your photos before starting the AI restoration process.&quot;&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;step-by-step&quot;&gt; &lt;h2&gt;Step-by-Step Guide to AI Photo Restoration&lt;/h2&gt; &lt;p&gt;Now that you understand how AI photo restoration works and have digitized your photos, let&#x27;s walk through the restoration process using our AI Image Upscaler tool.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/8d03fae9-f7c9-4eb2-b078-dddc3f2e60fb.jpg&quot; alt=&quot;ModernPhotoTools AI Image Upscaler interface showing the upload Process&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;ol class=&quot;list-numbers&quot;&gt; &lt;li&gt; &lt;h3&gt;Upload Your Photo&lt;/h3&gt; &lt;p&gt;Visit our &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;2&quot; rel=&quot;nofollow&quot;&gt;AI Image Upscaler tool&lt;/a&gt; and click the &quot;Upload Image&quot; button. You can drag and drop your photo or browse to select it from your computer.&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Select Restoration Options&lt;/h3&gt; &lt;p&gt;Once your photo is uploaded, you&#x27;ll see several restoration options. For old family photos, we recommend selecting:&lt;/p&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Fix Scratches &amp;amp; Damage:&lt;/strong&gt; Removes physical imperfections&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Enhance Faces:&lt;/strong&gt; Improves facial details and expressions&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Color Correction:&lt;/strong&gt; Restores natural colors or colorizes B&amp;amp;W photos&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Upscale:&lt;/strong&gt; Increases resolution for better printing quality&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Start the Restoration Process&lt;/h3&gt; &lt;p&gt;Click the &quot;Restore Photo&quot; button to begin the AI restoration process. The advanced algorithms will analyze your photo and apply the selected enhancements automatically.&lt;/p&gt; &lt;div class=&quot;highlight-box&quot;&gt; &lt;p&gt;The restoration process typically takes 30-60 seconds depending on the photo size and selected options. Larger photos or more extensive damage may take slightly longer to process.&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Review and Adjust&lt;/h3&gt; &lt;p&gt;After processing, you&#x27;ll see a side-by-side comparison of your original and restored photo. Use the slider to compare the differences and see the improvements.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/73041e80-c93c-4f1a-9a6e-4604609189ed.jpg&quot; alt=&quot;Side-by-side comparison of original damaged photo and AI-restored version with comparison slider&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Fine-tune Results (Optional)&lt;/h3&gt; &lt;p&gt;If needed, you can adjust specific settings to fine-tune the restoration:&lt;/p&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Detail Enhancement:&lt;/strong&gt; Adjust the level of detail recovery&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Color Intensity:&lt;/strong&gt; Control how vibrant the restored colors appear&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Sharpness:&lt;/strong&gt; Fine-tune the overall sharpness of the image&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Download Your Restored Photo&lt;/h3&gt; &lt;p&gt;Once you&#x27;re satisfied with the results, click the &quot;Download&quot; button to save your restored photo. We recommend saving in high-quality JPG or PNG format for the best balance of quality and file size.&lt;/p&gt; &lt;/li&gt; &lt;/ol&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Try It Yourself?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Restore your precious family photos in just a few clicks with our powerful AI technology.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;3&quot; rel=&quot;nofollow&quot;&gt;Start Restoring Your Photos&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;advanced-techniques&quot;&gt; &lt;h2&gt;Advanced AI Photo Restoration Techniques&lt;/h2&gt; &lt;p&gt;While our AI Image Upscaler tool handles most restoration needs automatically, here are some advanced techniques for specific photo issues:&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Fixing Severely Damaged Photos&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/b8054665-ddb8-493a-8aea-7656aac8bf8a.jpg&quot; alt=&quot;Before and after of a severely damaged photo restored with AI photo restoration&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;p&gt;For photos with extensive damage, try multiple restoration passes. First, focus on fixing structural damage (tears, missing pieces), then enhance details and colors in a second pass.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Enhancing Facial Details&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/ead2a21b-8baf-43a4-a709-0a6f7f605f94.jpg&quot; alt=&quot;Close-up comparison of facial details before and after AI photo restoration&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Our AI is specially trained to recognize and enhance facial features. For family portraits, select the &quot;Enhance Faces&quot; option for the best results in recovering expressions and details.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Colorizing Black &amp;amp; White Photos&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/ceb353d2-ba50-40a9-a53f-ab0b5aaf44a5.jpg&quot; alt=&quot;Black and white family photo colorized using AI photo restoration&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;p&gt;Our AI can add natural-looking color to black and white photos. The algorithm analyzes the image context to apply historically accurate colors to clothing, skin tones, and backgrounds.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;AI photo restoration isn&#x27;t just about fixing damageโ€”it&#x27;s about bringing memories back to life with enhanced details and colors that make the past feel present again.&quot;&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Tackle Even the Most Challenging Photos&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Our advanced AI can handle severely damaged photos, enhance facial details, and add natural color to black and white images.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;4&quot; rel=&quot;nofollow&quot;&gt;Restore Challenging Photos&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tips-tricks&quot;&gt; &lt;h2&gt;Tips and Tricks for Better Results&lt;/h2&gt; &lt;p&gt;Get the most out of AI photo restoration with these expert tips:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Before Restoration&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Clean physical photos&lt;/strong&gt; gently with a soft cloth before scanning&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Scan at high resolution&lt;/strong&gt; (at least 300 DPI, preferably 600 DPI)&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Crop out borders and frames&lt;/strong&gt; unless they&#x27;re part of the photo you want to preserve&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Adjust brightness and contrast&lt;/strong&gt; of your scan if the original is extremely faded&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;After Restoration&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Compare multiple restoration attempts&lt;/strong&gt; with different settings&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Save in high-quality formats&lt;/strong&gt; like PNG or TIFF for archiving&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Print on acid-free paper&lt;/strong&gt; if creating physical copies&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Create digital backups&lt;/strong&gt; of both original scans and restored versions&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;/div&gt; &lt;div class=&quot;info-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; For precious family photos, consider creating a restoration project. Organize photos by decade or family member, restore them systematically, and create a digital family archive to share with relatives.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/FAQPage&quot;&gt; &lt;h2&gt;Frequently Asked Questions About AI Photo Restoration&lt;/h2&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Can AI restore any damaged photo?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;AI can restore most damaged photos, but results vary based on damage severity. Our tool works best with photos that have scratches, tears, fading, and blurriness. Extremely damaged photos with large missing sections may have limitations, but you&#x27;ll be surprised by what modern AI can accomplish.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Will AI photo restoration change how people look in my photos?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Our AI is designed to enhance while preserving authenticity. It improves clarity and detail but maintains the original appearance and expressions of people in your photos. The goal is restoration, not alteration.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;How accurate is AI colorization for black and white photos?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;AI colorization has become remarkably accurate. The algorithm analyzes context clues and historical data to apply natural, period-appropriate colors. While not 100% historically accurate in every detail, the results are usually very convincing and bring new life to black and white photos.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Is my data safe when using your AI photo restoration tool?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Yes, we take privacy seriously. Your uploaded photos are processed securely and are not stored permanently on our servers. All uploads are automatically deleted after processing, and we never use your personal photos for AI training without explicit consent.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot; itemscope=&quot;&quot; itemprop=&quot;mainEntity&quot; itemtype=&quot;https://schema.org/Question&quot;&gt; &lt;h3 class=&quot;faq-question&quot; itemprop=&quot;name&quot;&gt;Can I restore multiple photos at once?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot; itemscope=&quot;&quot; itemprop=&quot;acceptedAnswer&quot; itemtype=&quot;https://schema.org/Answer&quot;&gt; &lt;p itemprop=&quot;text&quot;&gt;Yes, our AI Image Upscaler tool allows batch processing. You can upload multiple photos and restore them in sequence, saving you time when working with large family photo collections.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Conclusion: Preserve Your Family Legacy with AI Photo Restoration&lt;/h2&gt; &lt;p&gt;Old family photos are irreplaceable treasures that connect us to our past. With AI photo restoration technology, you now have the power to rescue these memories from the ravages of time. Our easy-to-use tools make it possible for anyoneโ€”regardless of technical skillโ€”to restore clarity, color, and life to damaged photos.&lt;/p&gt; &lt;p&gt;Don&#x27;t let your precious family memories fade away. Start your restoration journey today and create a digital legacy that can be shared with generations to come.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Bring Your Family Memories Back to Life?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Our AI Image Upscaler tool makes photo restoration simple, fast, and accessible to everyone.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;5&quot; rel=&quot;nofollow&quot;&gt;Start Restoring Your Family Photos Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt;&lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator.md</div> <div class="content">--- id: how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator title: &quot;How to Test a New Hairstyle with an AI Hairstyle Generator&quot; excerpt: &quot;Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!&quot; publishDate: nov 5, 2025 readTime: 12 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp relatedTool: ai-hairstyle keywords: [&quot;ai hairstyle generator&quot;, &quot;virtual hairstyle try-on&quot;, &quot;test a new hairstyle&quot;, &quot;try hairstyles online&quot;, &quot;hair color preview&quot;] metaTitle: &quot;How to Test a New Hairstyle with an AI Hairstyle Generator&quot; metaDescription: &quot;Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!&quot; --- &lt;style&gt; .styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0}.styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5}.styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1}.styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5}.styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2}.styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5}.styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3}.styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5}.styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4}.styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1}.styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2}.styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3}.styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4}.styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5}.styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6}.styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7}.styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8}.styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9}.styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;}.styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333} &lt;/style&gt; &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp&quot; alt=&quot;AI hairstyle generator featured preview image&quot; /&gt; &lt;/div&gt; &lt;h1&gt;How to Test a New Hairstyle with an AI Hairstyle Generator&lt;/h1&gt; &lt;section class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#why-change&quot;&gt;Why People Hesitate to Change Their Hairstyle&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#ai-solution&quot;&gt;How AI Technology Solves the Hairstyle Dilemma&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tool-guide&quot;&gt;How to Use ModernPhotoTools&#x27; AI Hairstyle Generator&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#interface-navigation&quot;&gt;Navigating the Interface&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#benefits&quot;&gt;Benefits of Using an AI Hairstyle Generator&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#best-practices&quot;&gt;Tips for Getting the Best Results&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#extreme-styles&quot;&gt;Exploring Extreme Styles Without Commitment&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Transform Your Look with Confidence&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section id=&quot;why-change&quot;&gt; &lt;h2&gt;Why People Hesitate to Change Their Hairstyle&lt;/h2&gt; &lt;p&gt;Changing your hairstyle is one of the most impactful ways to transform your appearance. Yet, it&#x27;s also one of the decisions people struggle with the most. The fear of regret after cutting off inches of hair or trying a bold new color can be paralyzing. Unlike clothing or makeup that can be easily changed, a haircut requires months to grow back if you&#x27;re unhappy with the results.&lt;/p&gt; &lt;p&gt;This hesitation is completely normal. Your hair is a significant part of your identity, and making changes to it can feel like a big risk. Traditional methods of previewing new hairstylesโ€”like holding up magazine pictures or using primitive photo editing appsโ€”often fall short of providing realistic previews.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to See Your New Look?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Stop wondering and start seeing! Try our AI Hairstyle Generator and visualize your new look in seconds.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-hairstyle&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; rel=&quot;nofollow&quot;&gt;Try Different Hairstyles Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;ai-solution&quot;&gt; &lt;h2&gt;How AI Technology Solves the Hairstyle Dilemma&lt;/h2&gt; &lt;p&gt;Artificial intelligence has transformed the way we approach hairstyle changes. Unlike traditional visualization methods, AI hairstyle generators use advanced algorithms to analyze your facial features, head shape, and existing hair to create remarkably realistic previews of different styles on your actual photo.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Traditional Methods&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Magazine cutouts that don&#x27;t show how the style looks on you&lt;/li&gt; &lt;li&gt;Basic photo editing that looks obviously fake&lt;/li&gt; &lt;li&gt;Verbal descriptions to stylists that get misinterpreted&lt;/li&gt; &lt;li&gt;Trying on wigs that don&#x27;t match your hairline&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;AI Hairstyle Generator&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Realistic visualization on your actual photo&lt;/li&gt; &lt;li&gt;Adapts styles to your unique face shape&lt;/li&gt; &lt;li&gt;Shows accurate hair texture and color&lt;/li&gt; &lt;li&gt;Creates natural-looking results in seconds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/e455aefd-93bb-431e-9bcf-b7a154cc3610.webp&quot; alt=&quot;Side-by-side comparison of traditional hairstyle visualization vs AI hairstyle generator results&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tool-guide&quot;&gt; &lt;h2&gt;How to Use ModernPhotoTools&#x27; AI Hairstyle Generator&lt;/h2&gt; &lt;p&gt;Our AI Hairstyle Generator makes it incredibly easy to visualize yourself with a new look. Follow these simple steps to see yourself transformed:&lt;/p&gt; &lt;!-- Local vertical video embed (2:3) --&gt; &lt;style&gt; .styled-container .video-embed { display: flex; justify-content: center; align-items: center; margin: 24px auto; } .styled-container .video-embed video { width: 100%; max-width: 480px; aspect-ratio: 2 / 3; height: auto; max-height: 80vh; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); background: #000; } @media (max-width: 640px) { .styled-container .video-embed video { max-width: 360px; } } &lt;/style&gt; &lt;div class=&quot;video-embed&quot;&gt; &lt;video controls playsinline autoplay muted preload=&quot;auto&quot; aria-label=&quot;AI Hairstyle vertical demo video&quot;&gt; &lt;source src=&quot;/tools%20videos/AI%20Hairstyle.mp4&quot; type=&quot;video/mp4&quot; /&gt; Your browser does not support the video tag. &lt;/video&gt; &lt;/div&gt; &lt;div class=&quot;list-comparison&quot;&gt; &lt;ul class=&quot;list-comparison-column list-comparison-primary&quot;&gt; &lt;h3 class=&quot;list-comparison-title&quot;&gt;Step 1: Upload Your Photo&lt;/h3&gt; &lt;li&gt;Visit the &lt;a href=&quot;https://modernphototools.com/tools/ai-hairstyle&quot; data-link=&quot;true&quot; data-id=&quot;2&quot; rel=&quot;nofollow&quot;&gt;AI Hairstyle Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Click the &quot;Upload&quot; button or drag and drop your photo&lt;/li&gt; &lt;li&gt;Choose a clear, front-facing photo with good lighting&lt;/li&gt; &lt;li&gt;Make sure your current hairstyle is visible&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-success&quot;&gt; &lt;h3 class=&quot;list-comparison-title&quot;&gt;Step 2: Select Hairstyle Options&lt;/h3&gt; &lt;li&gt;Browse through available hairstyle categories&lt;/li&gt; &lt;li&gt;Filter by length, style, or color if desired&lt;/li&gt; &lt;li&gt;Click on styles that interest you to preview&lt;/li&gt; &lt;li&gt;Adjust settings for more personalized results&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;list-comparison-column list-comparison-warning&quot;&gt; &lt;h3 class=&quot;list-comparison-title&quot;&gt;Step 3: View &amp;amp; Save Results&lt;/h3&gt; &lt;li&gt;See your transformation in real-time&lt;/li&gt; &lt;li&gt;Compare different styles side by side&lt;/li&gt; &lt;li&gt;Download your favorite looks&lt;/li&gt; &lt;li&gt;Share directly with your stylist or on social media&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/b97564ba-00b7-464a-b6be-526f5182c64c.jpg&quot; alt=&quot;ModernPhotoTools&#x27; AI Hairstyle Generator&quot; data-method=&quot;insert&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;interface-navigation&quot;&gt; &lt;h2&gt;Navigating the Interface&lt;/h2&gt; &lt;p&gt;Once you&#x27;ve uploaded your photo, you&#x27;ll be presented with an intuitive interface designed to make hairstyle exploration fun and easy. Here&#x27;s what you&#x27;ll find:&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Style Categories&lt;/h3&gt; &lt;p&gt;Browse through organized categories including short cuts, medium styles, long hairstyles, and color options. Each category contains multiple variations to explore.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Customization Panel&lt;/h3&gt; &lt;p&gt;Fine-tune your selected hairstyle with adjustments for volume, texture, and positioning to get the most realistic and flattering result possible.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Comparison View&lt;/h3&gt; &lt;p&gt;See your original photo alongside the transformed version for easy comparison. Toggle between different styles you&#x27;ve tried to find your favorite.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/a09f07a3-b830-4dad-ae10-c30254595cf6.jpg&quot; alt=&quot;Close-up of the AI Hairstyle Generator interface showing the customization options and style selection panel&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;highlight-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; Save multiple styles you like to your account gallery so you can revisit them later or show them to your stylist for a more accurate consultation.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;benefits&quot;&gt; &lt;h2&gt;Benefits of Using an AI Hairstyle Generator&lt;/h2&gt; &lt;p&gt;Using our AI Hairstyle Generator offers numerous advantages beyond simple curiosity. Here&#x27;s how this technology can transform your approach to hair changes:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/09315ad2-caa7-4a0e-98ef-db8337793f8b.jpg&quot; alt=&quot;Person smiling confidently after seeing their AI hairstyle preview&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Risk-Free Experimentation&lt;/h3&gt; &lt;p&gt;Try bold, dramatic styles you might never have considered without any commitment. Always wondered how you&#x27;d look with a pixie cut or vibrant red hair? Now you can see it before making any permanent changes.&lt;/p&gt; &lt;h3&gt;Time and Cost Savings&lt;/h3&gt; &lt;p&gt;Avoid costly hair mistakes and the time spent correcting them. By visualizing the end result first, you can confidently choose styles that work for you, saving both time and money on salon visits.&lt;/p&gt; &lt;h3&gt;Better Communication with Stylists&lt;/h3&gt; &lt;p&gt;Show your stylist exactly what you want by bringing your AI-generated images to your appointment. This eliminates miscommunication and ensures you get precisely the look you&#x27;re hoping for.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;I was terrified to cut my long hair into a bob, but after seeing how it would look using the AI Hairstyle Generator, I felt confident enough to go for it. My stylist was impressed with how accurately the AI predicted the final result!&quot;&lt;/p&gt; &lt;div class=&quot;blockquote-author&quot;&gt;- Sarah, ModernPhotoTools user&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Transform Your Look?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of users who have found their perfect hairstyle with our AI tool.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-hairstyle&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;3&quot; rel=&quot;nofollow&quot;&gt;Try the AI Hairstyle Generator&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;best-practices&quot;&gt; &lt;h2&gt;Tips for Getting the Best Results&lt;/h2&gt; &lt;p&gt;To ensure the most accurate and realistic previews from our AI Hairstyle Generator, follow these expert recommendations:&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/54a32c54-8255-4e15-b592-66e1ec93815f.jpg&quot; alt=&quot;Comparison of poor quality photo input versus ideal photo input for AI hairstyle generation&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Photo Quality&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Use a recent, high-resolution photo&lt;/li&gt; &lt;li&gt;Ensure your face is clearly visible and well-lit&lt;/li&gt; &lt;li&gt;Choose a photo where your hair is visible and not covered&lt;/li&gt; &lt;li&gt;Avoid extreme filters or heavy makeup that might interfere with AI analysis&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Lighting Considerations&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Front-facing photos provide the most accurate results&lt;/li&gt; &lt;li&gt;Keep your head straight, not tilted&lt;/li&gt; &lt;li&gt;Maintain a neutral expression&lt;/li&gt; &lt;li&gt;Position yourself at eye level with the camera&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Pose &amp;amp; Angle&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Take photos in natural lighting for best color accuracy&lt;/li&gt; &lt;li&gt;Avoid shadows across your face&lt;/li&gt; &lt;li&gt;Ensure the background isnโ€™t too bright or dark&lt;/li&gt; &lt;li&gt;Use consistent lighting across multiple photos for comparisons&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;info-box&quot;&gt; &lt;p&gt;&lt;strong&gt;Did you know?&lt;/strong&gt; Our AI Hairstyle Generator can also account for different face shapes and suggest styles that are particularly flattering for your specific features.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;extreme-styles&quot;&gt; &lt;h2&gt;Exploring Extreme Styles Without Commitment&lt;/h2&gt; &lt;p&gt;One of the most exciting aspects of our AI Hairstyle Generator is the ability to try styles you might never dare to attempt in real life without seeing them first. From dramatic color changes to bold cuts, you can explore the full spectrum of possibilities.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/ec413c4e-8b8c-4c92-aff7-302102de3a7e.jpg&quot; alt=&quot;Before and after comparison showing a dramatic hairstyle transformation using the AI Hairstyle Generator&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;Bold Color Transformations&lt;/h3&gt; &lt;p&gt;Ever wondered how you&#x27;d look with platinum blonde, vibrant purple, or fiery red hair? Our AI tool lets you try these dramatic color changes without the commitment of bleach or dye. See how different shades complement your skin tone and eye color before making a decision.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;Dramatic Length Changes&lt;/h3&gt; &lt;p&gt;Considering chopping off your long locks for a pixie cut? Or growing out your short style into flowing waves? Visualize these dramatic length changes and see how they frame your face. This can help you decide if you&#x27;re ready for a big change or if you&#x27;d prefer a more gradual transition.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;gallery&quot;&gt; &lt;div class=&quot;gallery-item&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/3a26ef85-376f-4bdf-89d6-a38ff9309cdf.jpg&quot; alt=&quot;AI-generated image showing a person with a bold pixie cut hairstyle&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;gallery-item&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/17da87c4-abba-4ed2-a448-b10e2c310459.jpg&quot; alt=&quot;AI-generated image showing a person with vibrant blue hair&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;gallery-item&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/71003609-9417-4b8d-8ac9-2128441df73b.jpg&quot; alt=&quot;AI-generated image showing a person with a dramatic long layered hairstyle&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;How accurate are the AI hairstyle previews?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Our AI Hairstyle Generator creates highly realistic previews by analyzing your facial features, head shape, and existing hair. While no simulation is perfect, users report that the results are remarkably close to their actual appearance after getting the hairstyle. The accuracy depends partly on the quality of your uploaded photo and how well you follow our photo guidelines.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Can I try different hair colors as well as styles?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Absolutely! Our AI Hairstyle Generator allows you to experiment with both styles and colors. You can try everything from natural shades to vibrant fashion colors to see what complements your skin tone and personal style best.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Is the AI Hairstyle Generator free to use?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes, our basic AI Hairstyle Generator features are free to use. You can upload your photo and try multiple hairstyles without any cost. We also offer premium features for users who want additional options and higher-resolution downloads.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Can men use this tool too?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Definitely! Our AI Hairstyle Generator works for all genders and includes a wide variety of men&#x27;s hairstyles, from classic cuts to trendy styles. The same photo quality guidelines apply for optimal results.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;script type=&quot;application/ld+json&quot;&gt; { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How accurate are the AI hairstyle previews?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Our AI Hairstyle Generator creates highly realistic previews by analyzing your facial features, head shape, and existing hair. While no simulation is perfect, users report that the results are remarkably close to their actual appearance after getting the hairstyle. The accuracy depends partly on the quality of your uploaded photo and how well you follow our photo guidelines.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Can I try different hair colors as well as styles?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Absolutely! Our AI Hairstyle Generator allows you to experiment with both styles and colors. You can try everything from natural shades to vibrant fashion colors to see what complements your skin tone and personal style best.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Is the AI Hairstyle Generator free to use?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, our basic AI Hairstyle Generator features are free to use. You can upload your photo and try multiple hairstyles without any cost. We also offer premium features for users who want additional options and higher-resolution downloads.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Can men use this tool too?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Definitely! Our AI Hairstyle Generator works for all genders and includes a wide variety of men&#x27;s hairstyles, from classic cuts to trendy styles. The same photo quality guidelines apply for optimal results.&quot; } } ] } &lt;/script&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Transform Your Look with Confidence&lt;/h2&gt; &lt;p&gt;Changing your hairstyle doesn&#x27;t have to be a leap of faith anymore. With ModernPhotoTools&#x27; AI Hairstyle Generator, you can see exactly how you&#x27;ll look with a new style before making any commitments. This technology empowers you to make confident decisions about your appearance and communicate effectively with your stylist.&lt;/p&gt; &lt;p&gt;Whether you&#x27;re contemplating a subtle change or a dramatic transformation, our tool provides the visual preview you need to move forward with confidence. No more post-haircut regrets or wondering &quot;what if&quot; โ€“ just clear visualization and better hair decisions.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/7063e946-75d7-4c92-934a-2efcde6178c7.jpg&quot; alt=&quot;Person showing their stylist an AI-generated hairstyle image on their phone at a salon&quot; data-method=&quot;text-to-image&quot;&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to See Your New Look?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of satisfied users who have found their perfect hairstyle with our AI tool.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-hairstyle&quot; class=&quot;cta-btn cta-btn-large cta-btn-full&quot; data-link=&quot;true&quot; data-id=&quot;4&quot; rel=&quot;nofollow&quot;&gt;Try Different Hairstyles with AI Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ master-ai-photo-editing-prompts.md</div> <div class="content">--- id: master-ai-photo-editing-prompts title: &quot;Master AI Photo Editing Prompts: Create Stunning Images&quot; excerpt: Learn how to craft perfect AI prompts for photo editing. Discover advanced techniques, tool-specific prompts, and practical examples to transform your images with AI. publishDate: 2025-10-04 readTime: 15 min read category: general featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg relatedTool: ai-image-generator keywords: - ai photo editing prompts - ai image prompts - photo editing ai - ai photography prompts - image enhancement ai seoTitle: &quot;Master AI Photo Editing Prompts: Create Stunning Images | ModernPhotoTools&quot; seoDescription: Learn to craft perfect AI photo editing prompts. Get advanced techniques, tool-specific examples, and practical tips to create stunning images with AI. faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Cinematic Effects Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Create a cinematic double exposure of me in profile, with a post-apocalyptic cityscape inside my silhouette. The inner scene shows me walking through a destroyed urban street, with dramatic lighting and warm tones, in 8K resolution.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;High-Fashion Portrait Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Edit this photo to give it a luxury fashion magazine vibe, with dramatic lighting emphasizing facial structure. The background should be minimal, and the composition should be symmetrical.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Resolution Enhancements Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Enhance this photo to 16K resolution, ensuring clarity and color fidelity.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Character Transformations Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Turn my pet into a human character, preserving its personality while removing all animal features. Focus on capturing the expression and emotional vibe.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Thematic Edits Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Edit this photo to give it a cyberpunk aesthetic, with neon colors and futuristic elements.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Artistic Transformations Prompt&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Make this image look like a watercolor painting, focusing on soft edges and vibrant colors.&quot; } } ] } --- &lt;style&gt;.styled-container *{box-sizing:border-box}.styled-container{font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen-Sans,Ubuntu,Cantarell,&quot;Helvetica Neue&quot;,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff}.styled-container h1,.styled-container h2,.styled-container h3,.styled-container h4,.styled-container h5,.styled-container h6{line-height:1.2;font-weight:700}.styled-container h1.elementor-heading-title,.styled-container h2.elementor-heading-title,.styled-container h3.elementor-heading-title,.styled-container h4.elementor-heading-title,.styled-container h5.elementor-heading-title,.styled-container h6.elementor-heading-title{color:var(--head-color)}.styled-container h1{font-size:32px;margin-bottom:16px}.styled-container h2{font-size:28px;margin-bottom:12px}.styled-container h3{font-size:24px;margin-bottom:12px}.styled-container h4{font-size:20px;margin-bottom:8px}.styled-container h5{font-size:18px;margin-bottom:8px}.styled-container h6{font-size:16px;margin-bottom:8px}.styled-container p,.styled-container ul,.styled-container ol{margin-bottom:1.5em}.styled-container a:not([class]){color:#3498db;text-decoration:none;transition:color .3s}.styled-container a:not([class]):hover{color:#2980b9}.styled-container img{max-width:100%;height:auto}.styled-container .section-gap{margin:60px 0}.styled-container .section-gap-small{margin:30px 0}.styled-container .cta-btn,.styled-container .elementor-widget-button.cta-btn a{display:inline-block;width:fit-content;padding:12px 24px;background-color:#3498db;color:#fff;font-weight:700;font-size:16px;text-align:center;text-decoration:none;border-radius:4px;border:none;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 6px rgba(0,0,0,.1);margin:10px 0}.styled-container .cta-btn:hover,.styled-container .elementor-widget-button.cta-btn a:hover{background-color:#2980b9;color:#fff;transform:translateY(-2px);box-shadow:0 6px 8px rgba(0,0,0,.15)}.styled-container .cta-btn-secondary{background-color:#27ae60}.styled-container .cta-btn-secondary:hover{background-color:#219653}.styled-container .cta-btn-accent,.styled-container .elementor-element.cta-btn-accent a{background-color:#e74c3c}.styled-container .cta-btn-accent:hover,.styled-container .elementor-element.cta-btn-accent a:hover{background-color:#c0392b}.styled-container .cta-block{background-color:#f8f9fa;border-radius:8px;padding:30px;margin:30px 0;text-align:center;border:1px solid #e9ecef;display:flex;flex-direction:column;align-items:center}.styled-container .elementor-element.cta-block{display:flow}.styled-container .cta-block-title{font-size:24px;font-weight:700;margin-bottom:15px;color:#333}.styled-container .cta-block-text{font-size:16px;margin-bottom:16px;color:#555}.styled-container .cta-btn-small{padding:8px 16px;font-size:14px}.styled-container .cta-btn-large{padding:16px 32px;font-size:18px}.styled-container .cta-btn-full{display:block;width:100%}.styled-container .cta-btn-display{display:flex;justify-content:center;align-items:center;margin:28px 0;gap:16px;flex-wrap:wrap;position:relative}.styled-container .cta-btn-icon{display:inline-flex;align-items:center;justify-content:center;margin-right:10px;font-size:1.2em;transform:translateY(-1px);transition:transform .2s ease}.styled-container .cta-btn:hover .cta-btn-icon{transform:translateY(-1px) scale(1.15)}.styled-container form{width:100%}.styled-container .form-container{background-color:#fff;border-radius:8px;padding:25px;margin:20px 0;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd;overflow:hidden}.styled-container .form-group{margin-bottom:20px;width:100%}.styled-container .form-label{display:block;margin-bottom:8px;font-weight:600;color:#333}.styled-container .form-input{width:100%;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;font-size:16px;transition:border-color .3s}.styled-container select.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; width=&#x27;10&#x27; height=&#x27;6&#x27;%3E%3Cpath d=&#x27;M1 1l4 4 4-4&#x27; stroke=&#x27;%23666&#x27; stroke-width=&#x27;1.5&#x27; fill=&#x27;none&#x27;/%3E%3C/svg%3E&quot;);background-repeat:no-repeat;background-position:right 15px center;padding-right:2.5rem;background-color:#fff}.styled-container .form-input:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-textarea{width:100%;min-height:120px;resize:vertical;padding:12px 15px;border:1px solid #ced4da;border-radius:4px;transition:border-color .3s}.styled-container .form-textarea:focus{border-color:#3498db;outline:none;box-shadow:0 0 0 3px rgba(52,152,219,.25)}.styled-container .form-btn{padding:12px 20px;background-color:#3498db;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:600;transition:background-color .3s;width:auto}.styled-container .form-btn:hover{background-color:#2980b9}.styled-container .form-help{margin-top:12px}.styled-container .cta-block .cta-block-buttons{margin:0}.styled-container .cta-block-primary{background-color:#f0f6ff;border-left:4px solid #2563eb;position:relative;overflow:hidden}.styled-container .cta-block-secondary{background-color:#ecfdf5;border-left:4px solid #10b981;position:relative;overflow:hidden}.styled-container .cta-block-accent{background-color:#fef2f2;border-left:4px solid #ef4444;position:relative;overflow:hidden}.styled-container .cta-block-buttons{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0 0;position:relative;z-index:2}@media(max-width: 576px){.styled-container .cta-block-buttons{flex-direction:column;gap:12px}.styled-container .cta-block-buttons .cta-btn{width:100%}}.styled-container .card{display:flex;flex-direction:column;height:fit-content;border-radius:8px;overflow:hidden;margin:20px 0;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.1);background-color:#fff;border:1px solid #e0e0e0;transition:transform .3s,box-shadow .3s}.styled-container .card.elementor-element{padding-bottom:0}.styled-container .card .elementor-widget-container ol li::marker,.styled-container .card .elementor-widget-container ul li::marker,.styled-container .two-columns .elementor-widget-container ol li::marker,.styled-container .two-columns .elementor-widget-container ul li::marker{content:none}.styled-container .card:hover{transform:translateY(-5px);box-shadow:0 8px 15px rgba(0,0,0,.15)}.styled-container .card-img{width:100%;height:auto;display:block}.styled-container .card-content{flex-grow:1;padding:0}.styled-container .card-title{font-size:20px;font-weight:700;margin-bottom:10px;color:#333;word-wrap:break-word}.styled-container .card-text{font-size:16px;color:#555;margin-bottom:15px;line-height:1.5}.styled-container .card-footer{margin-top:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:15px 20px;background-color:#f8f9fa;border-top:1px solid #e0e0e0;margin-left:-20px;margin-right:-20px;margin-bottom:-20px}.styled-container .card-footer.e-con{--width: auto}.styled-container .card-footer.e-con,.styled-container .card-footer.e-con&gt;.e-con-inner{display:flow}.styled-container .card-footer .elementor-button-wrapper{justify-content:center;display:flex}.styled-container .card-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:20px;margin:20px 0}.styled-container .card-grid .card{margin:0;height:100%}.styled-container .pros-cons{display:flex;flex-wrap:wrap;gap:20px;margin:25px 0}.styled-container .pros,.styled-container .cons{flex:1;min-width:300px;padding:20px;border-radius:8px}.styled-container .pros{background-color:#e9f7ef;border:1px solid #d5f5e3}.styled-container .cons{background-color:#fdedec;border:1px solid #f5b7b1}.styled-container .pros-title,.styled-container .cons-title{font-size:18px;font-weight:700;margin-bottom:15px;display:flex;align-items:center}.styled-container .pros-title:before{content:&quot;โœ“&quot;;color:#27ae60;margin-right:10px;font-weight:bold}.styled-container .cons-title:before{content:&quot;โœ—&quot;;color:#e74c3c;margin-right:10px;font-weight:bold}.styled-container [dir=rtl] .pros-title:before,.styled-container [dir=rtl] .cons-title:before{margin-right:0;margin-left:10px}.styled-container .pros ul,.styled-container .cons ul{margin:0;padding-left:30px}.styled-container .pros li,.styled-container .cons li{margin-bottom:8px;line-height:1.5}.styled-container .rating-container{padding:24px;display:flex;flex-wrap:wrap;gap:24px;align-items:stretch;border-bottom:1px solid #f0f0f0;margin-bottom:20px}.styled-container .elementor-element.rating-container,.styled-container .elementor-element.rating-container .elementor-widget-container{width:100%}.styled-container .rating-overall{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding-right:24px;border-right:1px solid #f0f0f0}.styled-container .rating-score{font-size:36px;font-weight:700;color:#333;line-height:1;margin-bottom:8px}.styled-container .rating-stars[data-rating=&quot;0&quot;]{--rating: 0}.styled-container .rating-stars[data-rating=&quot;0.5&quot;]{--rating: 0.5}.styled-container .rating-stars[data-rating=&quot;1&quot;]{--rating: 1}.styled-container .rating-stars[data-rating=&quot;1.5&quot;]{--rating: 1.5}.styled-container .rating-stars[data-rating=&quot;2&quot;]{--rating: 2}.styled-container .rating-stars[data-rating=&quot;2.5&quot;]{--rating: 2.5}.styled-container .rating-stars[data-rating=&quot;3&quot;]{--rating: 3}.styled-container .rating-stars[data-rating=&quot;3.5&quot;]{--rating: 3.5}.styled-container .rating-stars[data-rating=&quot;4&quot;]{--rating: 4}.styled-container .rating-stars[data-rating=&quot;4.1&quot;]{--rating: 4.1}.styled-container .rating-stars[data-rating=&quot;4.2&quot;]{--rating: 4.2}.styled-container .rating-stars[data-rating=&quot;4.3&quot;]{--rating: 4.3}.styled-container .rating-stars[data-rating=&quot;4.4&quot;]{--rating: 4.4}.styled-container .rating-stars[data-rating=&quot;4.5&quot;]{--rating: 4.5}.styled-container .rating-stars[data-rating=&quot;4.6&quot;]{--rating: 4.6}.styled-container .rating-stars[data-rating=&quot;4.7&quot;]{--rating: 4.7}.styled-container .rating-stars[data-rating=&quot;4.8&quot;]{--rating: 4.8}.styled-container .rating-stars[data-rating=&quot;4.9&quot;]{--rating: 4.9}.styled-container .rating-stars[data-rating=&quot;5&quot;]{--rating: 5}.styled-container .rating-stars{--rating: 5;color:rgba(0,0,0,0);font-size:20px;margin-bottom:6px;position:relative;display:inline-block;line-height:1;unicode-bidi:bidi-override;white-space:nowrap;overflow:hidden;content:&quot;&quot;}.styled-container .rating-stars::after{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;position:absolute;top:0;left:0;color:#f5a623;width:calc(var(--rating)/5*100%);overflow:hidden}.styled-container .rating-stars::before{content:&quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;;color:#ccc}.styled-container .rating-label{font-size:14px;color:#666}.styled-container .rating-details{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px}.styled-container .rating-item{display:grid;grid-template-columns:150px 1fr auto;align-items:center;gap:12px}.styled-container .rating-name{font-size:14px;font-weight:500;color:#555;word-break:break-word}.styled-container .rating-bar-container{height:8px;background-color:#eee;border-radius:4px;overflow:hidden;width:100%}.styled-container .rating-bar{height:100%;background-color:#f5a623;border-radius:4px;display:block}.styled-container .rating-value{font-size:14px;font-weight:600;color:#333;white-space:nowrap}@media(max-width: 768px){.styled-container .rating-container{flex-direction:column;gap:20px}.styled-container .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%;align-items:center}.styled-container .rating-item{grid-template-columns:90px 1fr auto}}.styled-container .rating-container.vertical{flex-direction:column}.styled-container .rating-container.vertical .rating-overall{border-right:none;border-bottom:1px solid #f0f0f0;padding-right:0;padding-bottom:20px;width:100%}.styled-container .rating-container.compact .rating-item{grid-template-columns:80px 1fr auto;gap:8px}.styled-container .rating-container.compact .rating-bar-container{height:6px}.styled-container .rating-container.expanded .rating-details{max-width:none}.styled-container .rating-container.theme-blue .rating-bar,.styled-container .rating-container.theme-blue .rating-stars{background-color:#1976d2;color:#1976d2}.styled-container .rating-container.theme-green .rating-bar,.styled-container .rating-container.theme-green .rating-stars{background-color:#388e3c;color:#388e3c}.styled-container .rating-container.theme-red .rating-bar,.styled-container .rating-container.theme-red .rating-stars{background-color:#d32f2f;color:#d32f2f}.styled-container .custom-list{list-style:none;padding:0;margin:20px 0}.styled-container .custom-list li{padding:10px 0 10px 25px;position:relative;margin-bottom:10px;border-bottom:1px solid #eee}.styled-container .custom-list li:before{content:&quot;&quot;;position:absolute;left:0;top:16px;width:14px;height:14px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;6&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .custom-list li{padding:10px 35px 10px 0}.styled-container [dir=rtl] .custom-list li:before{left:initial;right:0}.styled-container .list-numbers{counter-reset:list-counter;list-style:none;padding:0;margin:20px 0}.styled-container .list-numbers li{counter-increment:list-counter;padding:10px 0 10px 45px;position:relative;margin-bottom:15px}.styled-container .list-numbers li:before{content:counter(list-counter);position:absolute;left:0;top:8px;width:30px;height:30px;background-color:#3498db;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold}.styled-container [dir=rtl] .list-numbers li{padding:10px 45px 10px 0}.styled-container [dir=rtl] .list-numbers li:before{left:initial;right:0}.styled-container .list-comparison{display:grid;grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));gap:25px;margin:30px 0}.styled-container .list-comparison-column{list-style:none;padding:0;margin:0;border-radius:10px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.1)}.styled-container .list-comparison-title{padding:15px;background-color:#3498db;color:#fff;font-weight:700;font-size:18px;text-align:center;margin:0}.styled-container .list-comparison-column li{padding:14px 15px 14px 42px;position:relative;border-bottom:1px solid #eee;background-color:#fff}.styled-container .list-comparison-column li:last-child{border-bottom:none}.styled-container .list-comparison-column li:before{content:&quot;&quot;;position:absolute;left:15px;top:16px;width:18px;height:18px;background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;);background-size:contain;background-repeat:no-repeat}.styled-container [dir=rtl] .list-comparison-column li{padding:14px 42px 14px 15px}.styled-container [dir=rtl] .list-comparison-column li:before{left:initial;right:15px}.styled-container .list-comparison-primary .list-comparison-title{background-color:#3498db}.styled-container .list-comparison-primary li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%233498db&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-success .list-comparison-title{background-color:#27ae60}.styled-container .list-comparison-success li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%2327ae60&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-warning .list-comparison-title{background-color:#f39c12}.styled-container .list-comparison-warning li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23f39c12&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}.styled-container .list-comparison-danger .list-comparison-title{background-color:#e74c3c}.styled-container .list-comparison-danger li:before{background-image:url(&#x27;data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;%23e74c3c&quot;&gt;&lt;path d=&quot;M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z&quot;/&gt;&lt;/svg&gt;&#x27;)}@media(max-width: 768px){.styled-container .list-comparison{grid-template-columns:1fr;gap:20px}.styled-container .list-comparison-column{margin-bottom:20px}}.styled-container .table-container{width:100%;overflow-x:auto;margin-bottom:20px;border-radius:8px}.styled-container .elementor-element.table-container table,.styled-container .elementor-element.table-container table *{border:none}.styled-container table{width:100%;margin:12px 0;font-size:15px;background-color:#fff}.styled-container table tr:first-child th:first-child{border-top-left-radius:8px}.styled-container table tr:first-child th:last-child{border-top-right-radius:8px}.styled-container table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.styled-container table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.styled-container table thead tr{background-color:#3498db;color:#fff;text-align:left}.styled-container table th,.styled-container table td,.styled-container .elementor-element.table-container table th,.styled-container .elementor-element.table-container table td{padding:12px 15px;border-bottom:1px solid #ddd;overflow-wrap:break-word}.styled-container table th .highlight-box,.styled-container table td .highlight-box{padding:2px;background-color:#fff8e1;border:0;margin:2px;border-radius:0}.styled-container table tbody tr{border-bottom:1px solid #ddd;background-color:#fff;transition:background-color .3s ease}.styled-container table tbody tr:nth-of-type(even){background-color:#f8f9fa}.styled-container table tbody tr:hover{background-color:#edf2f7}.styled-container table span{display:contents}@media screen and (max-width: 768px){.styled-container .table-container{box-shadow:none;overflow-x:visible;border-radius:0}.styled-container table{border:0;box-shadow:none;margin:0}.styled-container table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.styled-container table,.styled-container table tbody,.styled-container table tr,.styled-container table td{display:block;width:100%}.styled-container table tr{margin-bottom:15px;border:1px solid #ddd;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1);background-color:#fff;overflow:hidden}.styled-container table td{position:relative;text-align:right;padding:10px 15px 10px 50%;border-bottom:1px solid #eee;min-height:45px;display:flex;align-items:center;justify-content:flex-end}.styled-container table td:last-child{border-bottom:0}.styled-container table td::before{content:attr(data-label);position:absolute;left:0;top:0;bottom:0;width:45%;padding:10px 15px;font-weight:bold;text-align:left;color:#333;background-color:#f8f9fa;display:flex;align-items:center;border-right:1px solid #eee}.styled-container table td:last-child{justify-content:center;padding-left:15px}.styled-container table td:last-child::before{display:none}}@media screen and (max-width: 480px){.styled-container table td{font-size:14px;padding:8px 10px 8px 45%}.styled-container table td::before{padding:8px 10px;font-size:13px}}.styled-container .blockquote{display:flex;flex-direction:column;font-size:18px;font-style:italic;margin:25px 0;padding:20px 30px;border-left:4px solid #2563eb;background-color:#f8f9fa;color:#555;position:relative}.styled-container .blockquote:before{content:&quot;&quot;;position:absolute;top:0;left:10px;font-size:60px;color:#bdc3c7;font-family:Georgia,serif;line-height:1}.styled-container .blockquote-author{display:block;margin-top:auto;font-weight:600;font-style:normal;color:#333}.styled-container .elementor-element.blockquote{display:flow}.styled-container .elementor-element.blockquote blockquote{border:none}.styled-container .highlight-box{padding:20px;background-color:#fff8e1;border-left:5px solid #ffc107;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.highlight-box{display:flow}.styled-container .info-box{padding:20px;background-color:#e3f2fd;border-left:4px solid #2563eb;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.info-box{display:flow}.styled-container .warning-box{padding:20px;background-color:#fff3e0;border-left:5px solid #ff9800;margin:20px 0;border-radius:0 4px 4px 0}.styled-container .elementor-element.warning-box{display:flow}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;]{margin-bottom:20px}.styled-container section[itemtype=&quot;https://schema.org/FAQPage&quot;] h2{margin-bottom:20px}.styled-container .faq-item{margin-bottom:15px;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.styled-container .faq-item h3,.styled-container .faq-question{padding:15px 20px;background-color:#f8f9fa;font-weight:600;position:relative;border-bottom:1px solid #e0e0e0}.styled-container .faq-answer{padding:20px;background-color:#fff}.styled-container .two-columns{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.styled-container .three-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin:20px 0}.styled-container .two-columns .custom-list,.styled-container .three-columns .custom-list{margin:0}.styled-container .two-columns .card,.styled-container .three-columns .card{margin:0;height:100%}.styled-container .two-columns .cta-btn-display,.styled-container .three-columns .cta-btn-display{margin:auto 0 28px 0}.styled-container .two-columns&gt;div:not([class]),.styled-container .three-columns&gt;div:not([class]){display:flex;flex-direction:column;gap:8px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:1/2/2/3}.styled-container .grid-item:nth-child(3){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(4){grid-area:2/2/3/3}.styled-container .four-columns{display:grid;grid-template-columns:repeat(4, 1fr);gap:20px;margin:20px 0}.styled-container .auto-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:25px;margin:20px 0}.styled-container .columns-start{align-items:start}.styled-container .columns-center{align-items:center}.styled-container .columns-end{align-items:end}.styled-container .columns-stretch{align-items:stretch}.styled-container .columns-1-2{grid-template-columns:1fr 2fr}.styled-container .columns-2-1{grid-template-columns:2fr 1fr}.styled-container .columns-1-3{grid-template-columns:1fr 3fr}.styled-container .columns-3-1{grid-template-columns:3fr 1fr}.styled-container .column-card{height:100%;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);padding:20px;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}.styled-container .column-card .badge,.styled-container .two-columns .img-container:last-child,.styled-container .three-columns .img-container:last-child,.styled-container .four-columns .img-container:last-child{margin-top:auto}.styled-container .column-card:hover{transform:translateY(-5px);box-shadow:0 5px 15px rgba(0,0,0,.15)}.styled-container .column-split{display:grid;grid-template-columns:1fr 1fr;gap:15px}@media(max-width: 992px){.styled-container .four-columns{grid-template-columns:1fr 1fr}}@media(max-width: 768px){.styled-container .two-columns,.styled-container .three-columns,.styled-container .four-columns,.styled-container .columns-1-2,.styled-container .columns-2-1,.styled-container .columns-1-3,.styled-container .columns-3-1{grid-template-columns:1fr;gap:25px}.styled-container .grid-item:nth-child(1){grid-area:1/1/2/2}.styled-container .grid-item:nth-child(2){grid-area:2/1/3/2}.styled-container .grid-item:nth-child(3){grid-area:3/1/4/2}.styled-container .grid-item:nth-child(4){grid-area:4/1/5/2}}.styled-container .two-columns .e-con-inner,.styled-container .three-columns .e-con-inner,.styled-container .pros-cons .e-con-inner{display:contents}.styled-container .pros-cons.e-flex{flex-direction:row}.styled-container .img-container{margin:20px 0;text-align:center}.styled-container .img-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic}.styled-container .img-rounded{border-radius:8px}.styled-container .img-shadow{box-shadow:0 4px 8px rgba(0,0,0,.1)}.styled-container .img-border{border:1px solid #ddd;padding:5px;background-color:#fff}.styled-container .gallery{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:15px;margin:25px 0}.styled-container .elementor-element.gallery{display:contents}.styled-container .gallery-item{overflow:hidden;border-radius:8px;position:relative}.styled-container .elementor-element.gallery-item .e-con-inner{display:inline-block}.styled-container .gallery-img{width:100%;height:auto;display:block;transition:transform .3s}.styled-container .gallery-item:hover .gallery-img{transform:scale(1.05)}@media(max-width: 992px){.styled-container .cta-block{padding:20px}.styled-container .form-container{padding:20px}.styled-container .card-grid{grid-template-columns:repeat(auto-fill, minmax(240px, 1fr))}}@media(max-width: 768px){.styled-container .pros-cons{flex-direction:column}.styled-container .timeline:before{left:40px}.styled-container .timeline-item{width:100%;padding-left:70px;padding-right:20px}.styled-container .timeline-item:nth-child(even){left:0}.styled-container .two-columns,.styled-container .three-columns{grid-template-columns:1fr;gap:20px}}@media(max-width: 576px){.styled-container .cta-btn{display:block;width:100%}.styled-container .section{padding:20px}.styled-container .blockquote{padding:15px 20px}}.styled-container .map-container{margin:25px 0;border-radius:8px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1)}.styled-container .map-container iframe{display:block;width:100%;height:300px;border:none}.styled-container .map-caption{font-size:14px;color:#666;margin-top:10px;font-style:italic;text-align:center}.styled-container .map-h300 iframe{height:300px}.styled-container .map-h400 iframe{height:400px}.styled-container .map-h500 iframe{height:500px}.styled-container .phone-number-cta{font-size:28px;font-weight:700;color:#2c3e50;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;margin:10px 0;transition:all .2s ease}.styled-container .phone-number-cta:hover{color:#3498db}.styled-container .phone-number-small{font-size:18px}.styled-container .phone-number-large{font-size:38px}.styled-container .phone-number-display{display:flex;align-items:center;margin:40px 0;justify-content:center;gap:16px}.styled-container .phone-number-display p{margin-bottom:0}.styled-container .phone-number-caption{display:inline-block;font-size:14px;font-weight:600;padding:6px 12px;border-radius:50px;letter-spacing:.3px;background-color:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.2);text-align:center;white-space:nowrap;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.05);text-transform:uppercase;opacity:.95;margin-bottom:0}.styled-container .phone-number-cta-primary .phone-number-caption{background-color:rgba(37,99,235,.1);color:#2563eb;border:1px solid rgba(37,99,235,.2)}.styled-container .phone-number-cta-secondary .phone-number-caption{background-color:rgba(16,185,129,.1);color:#10b981;border:1px solid rgba(16,185,129,.2)}.styled-container .phone-number-cta-accent .phone-number-caption{background-color:rgba(239,68,68,.1);color:#ef4444;border:1px solid rgba(239,68,68,.2)}.styled-container .phone-number-cta:hover .phone-number-caption{transform:translateY(-2px);box-shadow:0 3px 6px rgba(0,0,0,.1);opacity:1}.styled-container .video-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;margin-bottom:16px}.styled-container .video-container iframe{position:absolute;top:0;left:0;width:100%;height:100%}.styled-container .badge{display:inline-block;padding:4.5px 8px;font-size:13px;font-weight:600;line-height:1;color:#fff;background:#3498db;border-radius:4px;text-align:center;margin-bottom:5px}.styled-container .badge.badge-pill{border-radius:9999px}.styled-container .badge.badge-primary{background:#3498db}.styled-container .badge.badge-success{background:#28a745}.styled-container .badge.badge-info{background:#17a2b8}.styled-container .badge.badge-purple{background:#6c5ce7}.styled-container .badge.badge-small{font-size:12px;padding:3px 6px}.styled-container .badge.badge-medium{font-size:16px;padding:6.4px 12.8px;margin-bottom:8px}.styled-container .badge.badge-large{font-size:20px;padding:10px 20px;margin-bottom:16px}.styled-container .badge.badge-xl{font-size:28px;padding:16.8px 33.6px;margin-bottom:16px}.styled-container .badge.badge-xxl{font-size:36px;padding:25.2px 50.4px;margin-bottom:16px}&lt;/style&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;Mastering AI Photo Editing Prompts: The Ultimate Guide to Transforming Your Images&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;AI photo editing tools become more sophisticated, learning how to communicate effectively with these intelligent systems is becoming an essential skill for photographers, designers, and content creators. In this comprehensive guide, we&#x27;ll explore &lt;strong&gt;how to craft powerful AI photo editing prompts&lt;/strong&gt; that will help you achieve remarkable results with ModernPhotoTools&#x27; suite of AI-powered editing tools.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Image Generator Tool&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;The difference between an ordinary AI-generated image and a stunning masterpiece often comes down to one thing: the quality of your prompts.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; &gt;AI Photo Editing Prompts&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#understanding-ai-prompts&quot;&gt;Understanding AI Photo Editing Prompts: The Basics&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#prompt-structure&quot;&gt;The Anatomy of a Perfect AI Photo Editing Prompt&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tool-specific-prompts&quot;&gt;Tool-Specific AI Photo Editing Prompts&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#advanced-techniques&quot;&gt;Advanced AI Prompt Techniques&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Practical Use Cases for AI Photo Editing Prompts&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#common-mistakes&quot;&gt;Common AI Photo Editing Prompt Mistakes to Avoid&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tool-recommendations&quot;&gt;Recommended Tools for Different Prompt Types&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#prompt-library&quot;&gt;AI Photo Editing Prompt Library&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Mastering the Art of AI Photo Editing Prompts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;understanding-ai-prompts&quot;&gt; &lt;h2&gt;Understanding AI Photo Editing Prompts: The Basics&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg&quot; alt=&quot;How to create effective prompts&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;The dramatic difference between basic and detailed AI photo editing prompts&lt;/p&gt; &lt;/div&gt; &lt;p&gt;AI photo editing prompts are specific instructions you give to AI tools to achieve desired modifications or enhancements to your images. Unlike traditional editing where you manually adjust settings, AI editing relies on your ability to clearly communicate what you want through text prompts.&lt;/p&gt; &lt;p&gt;The quality of your results depends directly on how well you can articulate your vision. Vague prompts like &quot;make this better&quot; will yield unpredictable results, while detailed instructions that specify style, mood, lighting, and specific changes will guide the AI toward your desired outcome.&lt;/p&gt; &lt;h3&gt;Key Elements of Effective AI Photo Editing Prompts&lt;/h3&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Specificity:&lt;/strong&gt; Clearly describe what you want changed or enhanced&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Context:&lt;/strong&gt; Provide information about the image type and purpose&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style references:&lt;/strong&gt; Mention specific artistic styles or visual aesthetics&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Technical details:&lt;/strong&gt; Include lighting, color, texture preferences&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Composition guidance:&lt;/strong&gt; Specify framing, focus, or perspective changes&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Mood indicators:&lt;/strong&gt; Describe the emotional tone you want to convey&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Negative prompts:&lt;/strong&gt; Mention what you want to avoid&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Reference examples:&lt;/strong&gt; Refer to specific visual examples when possible&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;prompt-structure&quot;&gt; &lt;h2&gt;The Anatomy of a Perfect AI Photo Editing Prompt&lt;/h2&gt; &lt;p&gt;Creating effective prompts follows a structure that helps AI tools understand exactly what you want. Here&#x27;s a formula that consistently delivers excellent results:&lt;/p&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;[Action/Modification] + [Subject/Element] + [Style/Aesthetic] + [Technical Specifications] + [Reference/Example] + [Avoid/Negative]&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/468344a1-cab9-4ca3-9ad9-6114ede3614b.jpg&quot; alt=&quot;Diagram showing the structure of an effective AI photo editing prompt with each component labeled&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Breaking down the components of an effective AI photo editing prompt&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Example Breakdown&lt;/h3&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;p&gt;&lt;strong&gt;Basic prompt:&lt;/strong&gt; &quot;Remove the background from this product photo.&quot;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Enhanced prompt:&lt;/strong&gt; &quot;Remove the background from this leather handbag product photo, creating a clean transparent background with subtle drop shadow. Maintain precise edge detail around stitching and hardware. Style should be professional e-commerce ready. Reference high-end fashion websites. Avoid any artifacts or blurry edges.&quot;&lt;/p&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;strong&gt;Action:&lt;/strong&gt; Remove the background&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Leather handbag product photo&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style:&lt;/strong&gt; Professional e-commerce ready&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Technical:&lt;/strong&gt; Clean transparent background with subtle drop shadow, precise edge detail&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Reference:&lt;/strong&gt; High-end fashion websites&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Avoid:&lt;/strong&gt; Artifacts or blurry edges&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tool-specific-prompts&quot;&gt; &lt;h2&gt;Tool-Specific AI Photo Editing Prompts&lt;/h2&gt; &lt;p&gt;Different editing tasks require different approaches to prompting. Let&#x27;s explore specific prompt strategies for some of ModernPhotoTools&#x27; most popular AI editing tools.&lt;/p&gt; &lt;h3&gt;AI Background Removal Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/05c3a3f6-526c-468c-93dd-0280b3134148.jpg&quot; alt=&quot;Before and after comparison of AI background removal with transparent result&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Before and after: AI background removal with a well-crafted prompt&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;1&quot; rel=&quot;nofollow&quot;&gt;Remove Background&lt;/a&gt; tool uses AI to precisely separate subjects from their backgrounds. While the tool is powerful on its own, the right prompts can help you achieve perfect results, especially with complex subjects.&lt;/p&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;h4&gt;Effective Background Removal Prompt Templates:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Remove background from [subject type] maintaining precise edge detail around [specific challenging areas]. Create [transparent/solid color] background. Preserve [shadows/reflections/hair detail] for natural appearance.&quot;&lt;/li&gt; &lt;li&gt;&quot;Extract [subject] from background with professional precision. Retain all fine details in [specific areas]. Output with [transparent background/specific color] background for [intended use].&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Real-World Examples:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Remove background from this product photo of a glass vase, maintaining precise edge detail around transparent areas. Create clean transparent background with no shadows. Preserve reflections on the glass for natural appearance.&quot;&lt;/li&gt; &lt;li&gt;&quot;Extract this portrait subject from background with professional precision. Retain all fine details in hair and clothing edges. Output with soft white background for professional headshot use.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;2&quot; rel=&quot;nofollow&quot;&gt;Try AI Background Removal&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;AI Cleanup Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/bd4a981d-870f-4a12-8cb2-90066b20e515.jpg&quot; alt=&quot;Before and after comparison of AI photo cleanup showing removal of imperfections&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;AI Cleanup transforms photos by removing imperfections while maintaining natural appearance&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;3&quot; rel=&quot;nofollow&quot;&gt;AI Cleanup&lt;/a&gt; tool excels at removing unwanted elements and enhancing image quality. Effective prompts help the AI understand exactly what to fix while preserving the natural look of your photos.&lt;/p&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;h4&gt;Effective Cleanup Prompt Templates:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Remove [specific imperfections] from [subject/area] while maintaining natural texture and appearance. Enhance [specific elements] subtly without creating artificial look.&quot;&lt;/li&gt; &lt;li&gt;&quot;Clean up [specific elements] in this [image type]. Remove [unwanted elements] and improve [specific aspects] while preserving authentic [specific qualities].&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Real-World Examples:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Remove dust spots and sensor marks from this landscape photo while maintaining natural texture and appearance. Enhance cloud detail subtly without creating artificial look.&quot;&lt;/li&gt; &lt;li&gt;&quot;Clean up skin imperfections in this portrait. Remove temporary blemishes and reduce shine while preserving authentic skin texture and natural features. Maintain subject&#x27;s age appearance and characteristic features.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;4&quot; rel=&quot;nofollow&quot;&gt;Try AI Cleanup&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;AI Expand Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/cc630c68-b48b-4b38-a6a8-1958f49d206d.jpg&quot; alt=&quot;Demonstration of AI image expansion showing original cropped image and expanded version&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;AI Expand seamlessly extends images beyond their original boundaries&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The &lt;a href=&quot;https://modernphototools.com/tools/ai-expand&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;5&quot; rel=&quot;nofollow&quot;&gt;AI Expand&lt;/a&gt; tool allows you to extend your images beyond their original boundaries. Detailed prompts help ensure the expanded areas match the style and content of your original image.&lt;/p&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;h4&gt;Effective Expansion Prompt Templates:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Expand [direction/all sides] of image by [amount] maintaining consistent [lighting/style/perspective]. Add [specific elements] that match existing scene. Ensure seamless transition between original and expanded areas.&quot;&lt;/li&gt; &lt;li&gt;&quot;Extend [specific area] of this [image type] to create more [specific purpose]. Continue existing [elements/patterns/textures] naturally. Match original [lighting/color palette/mood].&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Real-World Examples:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Expand top and sides of this landscape photo by 30% maintaining consistent early morning lighting. Add more sky with similar cloud patterns and extend mountain range that matches existing scene. Ensure seamless transition between original and expanded areas.&quot;&lt;/li&gt; &lt;li&gt;&quot;Extend bottom of this product photo to create more negative space for text overlay. Continue existing white marble surface naturally. Match original lighting and subtle shadow patterns for a cohesive look.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-expand&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;6&quot; rel=&quot;nofollow&quot;&gt;Try AI Expand&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;AI Replace Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/ece97c8e-b1a0-4349-a7fd-66f0ed1162d8.jpg&quot; alt=&quot;Example of AI object replacement showing before and after versions&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;AI Replace allows you to swap objects while maintaining lighting and perspective&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;7&quot; rel=&quot;nofollow&quot;&gt;AI Replace&lt;/a&gt; tool lets you swap objects or areas in your images. Detailed prompts ensure replacements blend naturally with the surrounding image.&lt;/p&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;h4&gt;Effective Replacement Prompt Templates:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Replace [original object/area] with [new object/element] maintaining consistent [lighting/perspective/scale]. Match surrounding [specific aspects] for natural integration. Ensure [specific details] appear realistic.&quot;&lt;/li&gt; &lt;li&gt;&quot;Swap [specific element] for [new element] in this [image type]. Maintain original [lighting conditions/shadows/reflections]. Ensure replacement appears [specific quality] and fits naturally in the scene.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Real-World Examples:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Replace cloudy sky with vibrant sunset sky maintaining consistent lighting on landscape elements. Match surrounding color temperature for natural integration. Ensure cloud patterns appear realistic and light direction matches shadows in the original image.&quot;&lt;/li&gt; &lt;li&gt;&quot;Swap empty coffee table for wooden coffee table with decorative books in this interior photo. Maintain original room lighting conditions and shadows. Ensure replacement appears correctly scaled and fits naturally in the scene with appropriate perspective.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;8&quot; rel=&quot;nofollow&quot;&gt;Try AI Replace&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;AI Image Generator Prompts&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/a0403204-16f9-4435-827e-2a898ef3f381.jpg&quot; alt=&quot;Collection of AI-generated images created with different prompt styles&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Diverse images created with the AI Image Generator using varied prompt styles&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;9&quot; rel=&quot;nofollow&quot;&gt;AI Image Generator&lt;/a&gt; creates unique images from text descriptions. Mastering prompts for this tool opens unlimited creative possibilities.&lt;/p&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;h4&gt;Effective Image Generation Prompt Templates:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Create [image type] of [subject] in [style/aesthetic]. Include [specific elements/details]. Lighting should be [lighting description]. [Composition details]. [Technical specifications].&quot;&lt;/li&gt; &lt;li&gt;&quot;Generate [style] image depicting [scene/subject] with [specific qualities]. Use [color palette/mood] and [specific artistic influence]. Include details like [specific elements] for visual interest.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Real-World Examples:&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Create cinematic portrait of a young photographer in a modern studio. Include professional lighting equipment and digital cameras in background. Lighting should be dramatic with blue and orange color contrast. Shallow depth of field with subject in sharp focus. 4K resolution, photorealistic style.&quot;&lt;/li&gt; &lt;li&gt;&quot;Generate watercolor-style image depicting coastal Italian village at sunset with terracotta rooftops. Use warm golden palette and loose brushstroke aesthetic. Include details like small boats in harbor, flowering vines on buildings, and narrow winding streets for visual interest.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot; data-link=&quot;true&quot; data-id=&quot;10&quot; rel=&quot;nofollow&quot;&gt;Try AI Image Generator&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;advanced-techniques&quot;&gt; &lt;h2&gt;Advanced AI Prompt Techniques&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/991b8764-f9f8-4f36-9a64-04ede29cd90b.jpg&quot; alt=&quot;Visual representation of advanced AI prompt techniques with examples&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Advanced techniques to elevate your AI photo editing prompts&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Style Mixing&lt;/h3&gt; &lt;p&gt;Combine multiple artistic styles or aesthetics to create unique results. This technique works particularly well with the &lt;a href=&quot;https://modernphototools.com/tools/ai-image-to-image&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;11&quot; rel=&quot;nofollow&quot;&gt;AI Image to Image&lt;/a&gt; and &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;12&quot; rel=&quot;nofollow&quot;&gt;AI Filter&lt;/a&gt; tools.&lt;/p&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;Transform portrait using mix of [style 1] and [style 2], with [percentage/ratio] balance. Maintain [specific elements] from original while applying stylistic elements including [specific style characteristics].&quot;&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Negative Prompting&lt;/h3&gt; &lt;p&gt;Specify what you don&#x27;t want to see in your results. This helps the AI avoid common issues or unwanted elements.&lt;/p&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;[Main prompt]. Avoid [unwanted element 1], [unwanted element 2], and [unwanted element 3]. Do not include [specific problematic features].&quot;&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Weighted Keywords&lt;/h3&gt; &lt;p&gt;Emphasize certain aspects of your prompt by indicating their importance. This works especially well with the &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;13&quot; rel=&quot;nofollow&quot;&gt;AI Image Generator&lt;/a&gt;.&lt;/p&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;Create [image type] with (important element:1.5) as focal point. Include (secondary element:1.2) and (background element:0.8).&quot;&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Reference Images&lt;/h3&gt; &lt;p&gt;Use existing images as style references to guide the AI. This is particularly effective with the &lt;a href=&quot;https://modernphototools.com/tools/ai-image-to-image&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;14&quot; rel=&quot;nofollow&quot;&gt;AI Image to Image&lt;/a&gt; tool.&lt;/p&gt; &lt;div class=&quot;blockquote&quot;&gt; &lt;p&gt;&quot;Transform image using the style reference provided. Maintain [specific elements] from original while adopting [specific aspects] from reference image.&quot;&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Practical Use Cases for AI Photo Editing Prompts&lt;/h2&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Professional&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Product photography enhancement&lt;/li&gt; &lt;li&gt;Real estate image optimization&lt;/li&gt; &lt;li&gt;Corporate headshot retouching&lt;/li&gt; &lt;li&gt;Marketing material creation&lt;/li&gt; &lt;li&gt;E-commerce catalog preparation&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Creative&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Digital art creation&lt;/li&gt; &lt;li&gt;Concept visualization&lt;/li&gt; &lt;li&gt;Book cover design&lt;/li&gt; &lt;li&gt;Album artwork generation&lt;/li&gt; &lt;li&gt;Character design development&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Personal&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Family photo restoration&lt;/li&gt; &lt;li&gt;Social media content creation&lt;/li&gt; &lt;li&gt;Travel photo enhancement&lt;/li&gt; &lt;li&gt;Custom greeting card design&lt;/li&gt; &lt;li&gt;Personal avatar creation&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/801be7a6-55a0-47fd-9124-99abed33a11b.jpg&quot; alt=&quot;Collection of before/after examples showing AI photo editing for different use cases&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Real-world applications of AI photo editing across different domains&lt;/p&gt; &lt;/div&gt; &lt;h3&gt;Case Study: Product Photography Enhancement&lt;/h3&gt; &lt;div class=&quot;card&quot;&gt; &lt;div class=&quot;card-content&quot;&gt; &lt;p&gt;A small business owner needed professional-looking product images but lacked professional photography equipment. Using ModernPhotoTools&#x27; &lt;a href=&quot;https://modernphototools.com/tools/ai-product-photoshoot&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;15&quot; rel=&quot;nofollow&quot;&gt;AI Product Photoshoot&lt;/a&gt; and &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;16&quot; rel=&quot;nofollow&quot;&gt;Remove Background&lt;/a&gt; tools with carefully crafted prompts, they transformed basic smartphone photos into studio-quality product images.&lt;/p&gt; &lt;h4&gt;The Process:&lt;/h4&gt; &lt;ol class=&quot;list-numbers&quot;&gt; &lt;li&gt;Remove original background: &quot;Remove background from ceramic mug product photo with perfect edge detection. Create transparent background with no artifacts around handle or rim.&quot;&lt;/li&gt; &lt;li&gt;Generate professional setting: &quot;Create professional product photography setup for ceramic mug with soft gradient background in brand colors (light blue to white). Add subtle shadow beneath product for grounding. Use professional product lighting with soft highlights that accentuate glazed ceramic texture.&quot;&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;The result was a collection of professional-looking product images that helped increase online sales by 32% in the first month.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;common-mistakes&quot;&gt; &lt;h2&gt;Common AI Photo Editing Prompt Mistakes to Avoid&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/df8d23d8-7525-42b6-b62e-b1d1493a9c14.jpg&quot; alt=&quot;Illustration showing common AI prompt mistakes and their results&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Learning from common mistakes can dramatically improve your results&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h3 class=&quot;pros-title&quot;&gt;Effective Practices&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Being specific about desired changes&lt;/li&gt; &lt;li&gt;Providing context about the image&lt;/li&gt; &lt;li&gt;Using clear, descriptive language&lt;/li&gt; &lt;li&gt;Including technical details when relevant&lt;/li&gt; &lt;li&gt;Specifying style and aesthetic preferences&lt;/li&gt; &lt;li&gt;Mentioning what to avoid or preserve&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;cons&quot;&gt; &lt;h3 class=&quot;cons-title&quot;&gt;Common Mistakes&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Using vague instructions (&quot;make it better&quot;)&lt;/li&gt; &lt;li&gt;Providing contradictory directions&lt;/li&gt; &lt;li&gt;Overloading with too many requirements&lt;/li&gt; &lt;li&gt;Using technical jargon the AI may misinterpret&lt;/li&gt; &lt;li&gt;Forgetting to specify what to preserve&lt;/li&gt; &lt;li&gt;Neglecting to mention the intended use&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Before and After: Improving Your Prompts&lt;/h3&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;td data-row=&quot;head&quot;&gt;Weak Prompt&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Improved Prompt&lt;/td&gt; &lt;td data-row=&quot;head&quot;&gt;Why It&#x27;s Better&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Weak Prompt&quot;&gt;&quot;Make this portrait look better&quot;&lt;/td&gt; &lt;td data-label=&quot;Improved Prompt&quot;&gt;&quot;Enhance this portrait by improving skin tone evenness, brightening eyes, and adding subtle background blur while maintaining natural skin texture and original lighting mood&quot;&lt;/td&gt; &lt;td data-label=&quot;Why It&#x27;s Better&quot;&gt;Specifies exactly what &quot;better&quot; means and what to preserve&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Weak Prompt&quot;&gt;&quot;Remove background&quot;&lt;/td&gt; &lt;td data-label=&quot;Improved Prompt&quot;&gt;&quot;Remove background from this product image creating perfect transparent background. Maintain precise edge detail around reflective surfaces and fine elements like straps and zippers&quot;&lt;/td&gt; &lt;td data-label=&quot;Why It&#x27;s Better&quot;&gt;Addresses specific challenges and desired outcome&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Weak Prompt&quot;&gt;&quot;Make it look professional&quot;&lt;/td&gt; &lt;td data-label=&quot;Improved Prompt&quot;&gt;&quot;Transform this casual photo into professional corporate headshot with neutral gray background, balanced lighting, professional color grading, and subtle vignette. Maintain natural skin tones and authentic expression&quot;&lt;/td&gt; &lt;td data-label=&quot;Why It&#x27;s Better&quot;&gt;Defines what &quot;professional&quot; means in this context&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tool-recommendations&quot;&gt; &lt;h2&gt;Recommended Tools for Different Prompt Types&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/d64b8586-5fb6-4b93-add3-923ff18014c8.jpg&quot; alt=&quot;Visual guide showing which ModernPhotoTools to use for different editing tasks&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;Matching your editing needs with the right ModernPhotoTools&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Object &amp;amp; Background Manipulation&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;17&quot; rel=&quot;nofollow&quot;&gt;Remove Background&lt;/a&gt; - For isolating subjects&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;18&quot; rel=&quot;nofollow&quot;&gt;AI Replace&lt;/a&gt; - For swapping objects&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-expand&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;19&quot; rel=&quot;nofollow&quot;&gt;AI Expand&lt;/a&gt; - For extending canvas&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-background-generator&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;20&quot; rel=&quot;nofollow&quot;&gt;AI Background Generator&lt;/a&gt; - For creating new backgrounds&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Creative Transformations&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-cartoon&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;21&quot; rel=&quot;nofollow&quot;&gt;AI Cartoon&lt;/a&gt; - For stylized illustrations&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-caricature&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;22&quot; rel=&quot;nofollow&quot;&gt;AI Caricature&lt;/a&gt; - For exaggerated portraits&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-avatar&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;23&quot; rel=&quot;nofollow&quot;&gt;AI Avatar&lt;/a&gt; - For personalized avatars&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-image-to-image&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;24&quot; rel=&quot;nofollow&quot;&gt;AI Image to Image&lt;/a&gt; - For style transfers&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Enhancement &amp;amp; Refinement&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;25&quot; rel=&quot;nofollow&quot;&gt;AI Cleanup&lt;/a&gt; - For removing imperfections&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-portrait&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;26&quot; rel=&quot;nofollow&quot;&gt;AI Portrait&lt;/a&gt; - For portrait enhancement&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-image-upscaler&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;27&quot; rel=&quot;nofollow&quot;&gt;AI Image Upscaler&lt;/a&gt; - For increasing resolution&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;28&quot; rel=&quot;nofollow&quot;&gt;AI Filter&lt;/a&gt; - For applying artistic effects&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;prompt-library&quot;&gt; &lt;h2&gt;AI Photo Editing Prompt Library&lt;/h2&gt; &lt;p&gt;Here&#x27;s a collection of ready-to-use prompts for various editing scenarios. Feel free to copy, customize, and experiment with these templates to achieve your desired results.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/eb9f05ad-ab2d-4927-b3f9-b3bc116a084d.jpg&quot; alt=&quot;Collection of prompt templates organized by editing category&quot; data-method=&quot;text-to-image&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;A library of proven prompt templates to jumpstart your AI photo editing&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Portrait Enhancement Prompts&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Enhance this portrait with professional retouching. Improve skin texture while maintaining natural appearance, brighten eyes subtly, enhance hair definition, and add slight background blur for depth. Preserve original lighting mood and authentic expression.&quot;&lt;/li&gt; &lt;li&gt;&quot;Transform this casual selfie into professional headshot. Create neutral studio background, improve lighting with soft key light from 45-degree angle, enhance facial features subtly, and adjust framing to proper headshot composition while maintaining natural skin texture and authentic appearance.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;&lt;em&gt;Best with: &lt;a href=&quot;https://modernphototools.com/tools/ai-portrait&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;29&quot; rel=&quot;nofollow&quot;&gt;AI Portrait&lt;/a&gt;, &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;30&quot; rel=&quot;nofollow&quot;&gt;AI Cleanup&lt;/a&gt;&lt;/em&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Product Photography Prompts&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Create professional product photo of this [product type] with clean white background, soft shadow beneath for grounding, and subtle reflection. Use professional product lighting setup with main light from upper right and fill light from left to highlight product features and texture. Ensure accurate color representation and sharp detail throughout.&quot;&lt;/li&gt; &lt;li&gt;&quot;Transform this casual product photo into lifestyle product image showing [product] in natural home setting. Create warm, inviting atmosphere with soft natural lighting from nearby window. Add contextual elements like [relevant props] that complement product without distracting. Maintain focus on product while creating aspirational scene.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;&lt;em&gt;Best with: &lt;a href=&quot;https://modernphototools.com/tools/ai-product-photoshoot&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;31&quot; rel=&quot;nofollow&quot;&gt;AI Product Photoshoot&lt;/a&gt;, &lt;a href=&quot;https://modernphototools.com/tools/remove-background&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;32&quot; rel=&quot;nofollow&quot;&gt;Remove Background&lt;/a&gt;&lt;/em&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Landscape Enhancement Prompts&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;&quot;Enhance this landscape photo with dramatic sky. Replace current sky with vibrant sunset featuring rich oranges and purples. Add subtle sun rays filtering through clouds. Maintain natural appearance of landscape elements while adjusting lighting to match new sky. Enhance color vibrance and contrast slightly for more impactful image.&quot;&lt;/li&gt; &lt;li&gt;&quot;Transform this daytime landscape into magical blue hour scene. Adjust lighting to deep blue twilight with remaining warm glow on horizon. Enhance water reflections, add subtle mist in valley, and bring out detail in shadow areas. Maintain natural landscape appearance while creating serene evening atmosphere.&quot;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;&lt;em&gt;Best with: &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;33&quot; rel=&quot;nofollow&quot;&gt;AI Replace&lt;/a&gt;, &lt;a href=&quot;https://modernphototools.com/tools/ai-expand&quot; target=&quot;_blank&quot; data-link=&quot;true&quot; data-id=&quot;34&quot; rel=&quot;nofollow&quot;&gt;AI Expand&lt;/a&gt;&lt;/em&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to Transform Your Photos?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Access our complete library of AI photo editing prompts and start creating stunning images today.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;35&quot; rel=&quot;nofollow&quot;&gt;Explore All Tools&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Mastering the Art of AI Photo Editing Prompts&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/f1611193-e19b-443a-93bc-dc7c7a4537b0.jpg&quot; alt=&quot;How to create effective prompts&quot; data-method=&quot;insert&quot;&gt; &lt;p class=&quot;img-caption&quot;&gt;The journey from basic to masterful AI photo editing through prompt crafting&lt;/p&gt; &lt;/div&gt; &lt;p&gt;The art of crafting effective AI photo editing prompts is a skill that develops with practice and experimentation. As you&#x27;ve seen throughout this guide, the difference between basic and exceptional results often comes down to how well you communicate with the AI through your prompts.&lt;/p&gt; &lt;p&gt;Remember these key principles as you continue your AI photo editing journey:&lt;/p&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Be specific about what you want to achieve&lt;/li&gt; &lt;li&gt;Provide context about your image and its purpose&lt;/li&gt; &lt;li&gt;Include technical details when relevant&lt;/li&gt; &lt;li&gt;Specify what to preserve or avoid&lt;/li&gt; &lt;li&gt;Experiment with different prompt structures&lt;/li&gt; &lt;li&gt;Learn from both successes and failures&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;With ModernPhotoTools&#x27; suite of AI-powered editing tools and the prompt techniques you&#x27;ve learned in this guide, you&#x27;re well-equipped to transform ordinary photos into extraordinary images. Whether you&#x27;re enhancing portraits, creating product photography, or generating entirely new visuals, the power of AI is at your fingertips.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Start Creating Amazing Images Today&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Put your new prompt skills to work with ModernPhotoTools&#x27; powerful AI editing suite.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;36&quot; rel=&quot;nofollow&quot;&gt;Try AI Image Generator&lt;/a&gt; &lt;/div&gt; &lt;/section&gt;&lt;/div&gt; </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ nano-banana-ai-image-generator-with-modern-phototools.md</div> <div class="content">--- id: nano-banana-ai-image-generator-with-modern-phototools title: Nano Banana - AI Image Generator with Modern Phototools excerpt: Discover how Nano Banana AI image generator revolutionizes digital art creation with Modern Phototools. Learn advanced techniques, features, and step-by-step guides for stunning AI-generated images. publishDate: 2025-10-09 readTime: 8 min read category: tools featuredImage: https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg relatedTool: ai-image-generator keywords: [nano banana ai, ai image generator, modern phototools, artificial intelligence photography, image editing software, digital art creation, ai art tools] seoTitle: Nano Banana AI Image Generator with Modern Phototools - Complete Guide 2025 seoDescription: Master Nano Banana AI image generator with Modern Phototools. Create stunning AI art with our comprehensive guide, tips, and advanced techniques for 2025. faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What is Nano Banana AI image generator?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Nano Banana is an innovative AI image generator tool integrated with Modern Phototools that allows users to create stunning visuals with advanced AI technology. It offers intuitive interface, various style options, and professional-grade image generation capabilities.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;How does Nano Banana work with Modern Phototools?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Nano Banana integrates seamlessly with Modern Phototools platform, providing users with an intuitive interface to create and edit images using AI-powered tools. The combination offers advanced features like resolution settings, style customization, and efficient generation speed.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Is Nano Banana suitable for beginners?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Yes, Nano Banana is designed to be user-friendly and accessible to artists of all skill levels. Its intuitive interface makes it easy for beginners to navigate and create professional-grade images without extensive technical knowledge.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What types of projects can I create with Nano Banana?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;With Nano Banana, you can work on various projects including product photography, social media content, interior design, fashion design, digital marketing materials, and graphic design projects. It&#x27;s versatile for both professional and personal use.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;Nano Banana - AI Image Generator with Modern Phototools&lt;/h1&gt; &lt;p class=&quot;article-intro&quot;&gt;Discover how &lt;strong&gt;Nano Banana AI image generator&lt;/strong&gt; revolutionizes digital art creation with Modern Phototools. This comprehensive guide explores advanced techniques, powerful features, and step-by-step instructions for creating stunning AI-generated images that elevate your creative projects.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Try Our Free AI Image Generator&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Experience the power of Nano Banana AI with Modern Photo Tools. Create professional-quality images in seconds!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot; data-link=&quot;true&quot; data-id=&quot;1&quot;&gt;Generate Images Now&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#ai-revolution-art&quot;&gt;The AI Revolution in Art Creation&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#modern-phototools-platform&quot;&gt;Introducing Modern Phototools Platform&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#nano-banana-overview&quot;&gt;Nano Banana - AI Image Generator Overview&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#powerful-features&quot;&gt;Powerful Features&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#technical-capabilities&quot;&gt;Technical Capabilities&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#integration-options&quot;&gt;Integration Options&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#step-by-step-guide&quot;&gt;Step-by-Step Guide to Creating Stunning Images&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#accessing-tool&quot;&gt;Accessing the Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#mastering-prompts&quot;&gt;Mastering Prompt Writing&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#customizing-output&quot;&gt;Customizing Your Output&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#elevate-projects&quot;&gt;Elevate Your Projects with Nano Banana&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;ai-revolution-art&quot;&gt; &lt;h2&gt;The AI Revolution in Art Creation&lt;/h2&gt; &lt;p&gt;The world of &lt;strong&gt;digital art creation&lt;/strong&gt; has been transformed by artificial intelligence, opening up new possibilities for artists and creators. AI-powered tools are revolutionizing how we approach image generation, making it possible to create stunning visuals with unprecedented ease and efficiency.&lt;/p&gt; &lt;p&gt;This technological advancement has democratized art creation, allowing both professionals and beginners to produce high-quality images. The integration of AI in creative workflows has not only streamlined the process but also expanded the creative possibilities beyond traditional boundaries.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;ai-image-revolution&quot;&gt; &lt;a href=&quot;https://www.youtube.com/watch?v=S2TAa4P2IuY&quot;&gt; &lt;h2&gt;AI Image Generation Revolution&lt;/h2&gt; &lt;img src=&quot;\images\blog\7 best free &amp; paid ai image generator.jpg&quot;&gt; &lt;/a&gt; &lt;/section&gt; &lt;section id=&quot;modern-phototools-platform&quot;&gt; &lt;h2&gt;Introducing Modern Phototools Platform&lt;/h2&gt; &lt;p&gt;The &lt;strong&gt;Modern Phototools&lt;/strong&gt; platform is at the forefront of this innovation, providing users with an intuitive interface to create and edit images using AI-powered tools. This platform has made it possible for artists to generate high-quality images with minimal effort.&lt;/p&gt; &lt;p&gt;By leveraging the power of &lt;strong&gt;artificial intelligence photography&lt;/strong&gt;, the Modern Phototools platform enables users to produce professional-grade images. The platform&#x27;s &lt;strong&gt;image editing software&lt;/strong&gt; is designed to be user-friendly, making it accessible to artists of all skill levels.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;nano-banana-overview&quot;&gt; &lt;h2&gt;Nano Banana - AI Image Generator with Modern Phototools&lt;/h2&gt; &lt;p&gt;Nano Banana, combined with Modern Phototools, offers a robust solution for image generation and editing needs. This powerful combination is designed to cater to a wide range of users, from professionals to beginners, by providing an array of tools and features that simplify the image editing process.&lt;/p&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg&quot; alt=&quot;Nano Banana AI Image Generator Interface&quot; class=&quot;featured-image&quot;&gt; &lt;/section&gt; &lt;section id=&quot;powerful-features&quot;&gt; &lt;h3&gt;Powerful Features&lt;/h3&gt; &lt;p&gt;Nano Banana boasts an impressive set of features that make it an ideal choice for image generation and editing. Some of the key features include:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Intuitive User Interface&lt;/strong&gt;: Designed to be user-friendly, making it easy for users to navigate and utilize the tool&#x27;s capabilities.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Style and Aesthetic Options&lt;/strong&gt;: Offers a variety of styles and aesthetics, allowing users to customize their images according to their preferences.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Advanced AI Algorithms&lt;/strong&gt;: Utilizes cutting-edge artificial intelligence to generate high-quality, realistic images.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Real-time Processing&lt;/strong&gt;: Provides instant results with minimal waiting time.&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section id=&quot;technical-capabilities&quot;&gt; &lt;h3&gt;Technical Capabilities&lt;/h3&gt; &lt;p&gt;The technical capabilities of Nano Banana are enhanced by Modern Phototools, providing advanced functionalities such as:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Resolution and Quality Settings&lt;/strong&gt;: Enables users to adjust the resolution and quality of their generated images, ensuring they meet the required standards.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Generation Speed and Efficiency&lt;/strong&gt;: Ensures quick turnaround times without compromising on the quality of the output.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Format Compatibility&lt;/strong&gt;: Supports multiple image formats for versatile usage across different platforms.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Batch Processing&lt;/strong&gt;: Allows users to generate multiple images simultaneously for increased productivity.&lt;/li&gt; &lt;/ol&gt; &lt;/section&gt; &lt;section id=&quot;integration-options&quot;&gt; &lt;h3&gt;Integration Options&lt;/h3&gt; &lt;p&gt;Nano Banana, when integrated with Modern Phototools, offers versatile integration options that allow users to seamlessly incorporate the generated images into various platforms and projects. This flexibility makes it a valuable tool for a wide range of applications, from digital marketing to graphic design.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;step-by-step-guide&quot;&gt; &lt;h2&gt;Step-by-Step Guide to Creating Stunning Images&lt;/h2&gt; &lt;p&gt;With Nano Banana and Modern Phototools, you can unlock a world of creative possibilities. This guide will walk you through the process of accessing the tool, mastering prompt writing, and customizing your output to create breathtaking images.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;accessing-tool&quot;&gt; &lt;h3&gt;Accessing the Tool&lt;/h3&gt; &lt;p&gt;To start using Nano Banana, you need to access it through the Modern Phototools platform. Simply navigate to the platform, sign in or create an account, and you&#x27;re ready to begin your creative journey.&lt;/p&gt; &lt;div id=&quot;ai-image-generator-image&quot;&gt; &lt;img src=&quot;\images\blog\Ai Image Generation - Modern phototools.jpg&quot; alt&quot;Ai Image Generation - Modern phototools&quot;&gt; &lt;/div&gt; &lt;div class=&quot;step-guide&quot;&gt; &lt;ol&gt; &lt;li&gt;Visit &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot;&gt;Modern Phototools AI Image Generator&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Create a good descriptin&lt;/li&gt; &lt;li&gt;Select the proper Image Resolution&lt;/li&gt; &lt;li&gt;Start creating your first AI-generated image&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;mastering-prompts&quot;&gt; &lt;h3&gt;Mastering Prompt Writing&lt;/h3&gt; &lt;p&gt;Effective prompt writing is crucial to getting the most out of Nano Banana. A well-crafted prompt can make all the difference in the quality of the generated image.&lt;/p&gt; &lt;h4&gt;Characteristics of Effective Prompts&lt;/h4&gt; &lt;p&gt;Effective prompts are clear, concise, and descriptive. They provide the AI with enough information to understand your vision and create an image that meets your expectations.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Be specific about the content and style you want&lt;/li&gt; &lt;li&gt;Use descriptive language to paint a vivid picture&lt;/li&gt; &lt;li&gt;Avoid ambiguity and ensure clarity&lt;/li&gt; &lt;li&gt;Include style references and artistic techniques&lt;/li&gt; &lt;/ul&gt; &lt;h4&gt;Example Prompts That Work&lt;/h4&gt; &lt;p&gt;Here are a few examples of effective prompts:&lt;/p&gt; &lt;table class=&quot;prompt-examples&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Prompt&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;A futuristic cityscape at sunset&lt;/td&gt; &lt;td&gt;A detailed, high-resolution image of a cityscape with sleek skyscrapers and a vibrant orange sky&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;A fantasy landscape with rolling hills and a dragon&lt;/td&gt; &lt;td&gt;A whimsical, dreamlike scene featuring rolling green hills, a majestic dragon, and a bright blue sky&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Portrait of a woman in Renaissance style&lt;/td&gt; &lt;td&gt;Classical portrait with Renaissance painting techniques, soft lighting, and period-appropriate clothing&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/section&gt; &lt;section id=&quot;customizing-output&quot;&gt; &lt;h3&gt;Customizing Your Output&lt;/h3&gt; &lt;p&gt;Once you&#x27;ve mastered prompt writing, you can take your image creation to the next level by customizing your output using advanced settings.&lt;/p&gt; &lt;h4&gt;Working with Advanced Settings&lt;/h4&gt; &lt;p&gt;Nano Banana offers a range of advanced settings that allow you to fine-tune your image generation. Experiment with different settings to achieve the desired effect.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Key features to explore:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Image resolution and aspect ratio&lt;/li&gt; &lt;li&gt;Color palette and texture&lt;/li&gt; &lt;li&gt;Style transfer and effects&lt;/li&gt; &lt;li&gt;Lighting and composition adjustments&lt;/li&gt; &lt;/ul&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/aaeffd7f-371d-4095-83de-c2b0d89f6120.jpg&quot; alt=&quot;AI Image Generator Advanced Settings&quot; class=&quot;content-image&quot;&gt; &lt;/section&gt; &lt;section id=&quot;elevate-projects&quot;&gt; &lt;h2&gt;Elevate Your Projects with Nano Banana Today&lt;/h2&gt; &lt;p&gt;I am excited to explore the possibilities that Nano Banana, an &lt;strong&gt;innovative photography software&lt;/strong&gt;, brings to the table. As an &lt;strong&gt;&lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot;&gt;AI image generator&lt;/a&gt;&lt;/strong&gt; integrated with Modern Phototools, Nano Banana is revolutionizing the way we approach image editing and creation.&lt;/p&gt; &lt;p&gt;Nano Banana is driving efficiency across various industries, including product photography, social photos, interior design, and fashion design. Its advanced features and ease of use make it an ideal tool for professionals looking to elevate their projects.&lt;/p&gt; &lt;p&gt;By incorporating Nano Banana into your workflow, you can unlock new creative potential. Whether you&#x27;re creating social media content or designing interiors, this &lt;strong&gt;nano banana ai image generator&lt;/strong&gt; offers the tools you need to succeed. With its powerful &lt;strong&gt;image editing software&lt;/strong&gt; capabilities, you can achieve high-quality results with minimal effort.&lt;/p&gt; &lt;p&gt;Start exploring the possibilities with Nano Banana today and discover a new world of creative potential. As a cutting-edge &lt;strong&gt;image editing software&lt;/strong&gt;, Nano Banana is poised to transform the way you work on your projects.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;What is Nano Banana, and how does it work with Modern Phototools?&lt;/h3&gt; &lt;p&gt;Nano Banana is an innovative AI image generator tool integrated with Modern Phototools, allowing users to create stunning visuals with just a few clicks. You can leverage this powerful tool to enhance your image editing experience with advanced AI technology.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;What are the benefits of using Nano Banana with Modern Phototools?&lt;/h3&gt; &lt;p&gt;By using Nano Banana with Modern Phototools, you can generate high-quality images with an intuitive interface, various style and aesthetic options, and advanced technical capabilities, including resolution and quality settings, and generation speed.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;How do I access the Nano Banana AI image generator tool?&lt;/h3&gt; &lt;p&gt;You can access the free AI image generator tool at &lt;a href=&quot;https://modernphototools.com/tools/ai-image-generator&quot; target=&quot;_blank&quot;&gt;modernphototools.com/tools/ai-image-generator&lt;/a&gt; and start creating amazing images today with Modern Phototools.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;What kind of projects can I work on with Nano Banana and Modern Phototools?&lt;/h3&gt; &lt;p&gt;With Nano Banana and Modern Phototools, you can work on various projects, such as product photography, creating social media content, or designing interiors, and elevate them to new heights with the tools you need to succeed.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Do I need to have extensive technical knowledge to use Nano Banana with Modern Phototools?&lt;/h3&gt; &lt;p&gt;No, Nano Banana with Modern Phototools is designed to be user-friendly, making it accessible to both professionals and beginners, allowing you to create breathtaking images that meet your creative vision.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;Can I customize the output of the AI image generator?&lt;/h3&gt; &lt;p&gt;Yes, you can customize your output by mastering prompt writing and working with advanced settings, unlocking the full potential of Nano Banana and creating images that meet your needs.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3&gt;How does Nano Banana contribute to the evolution of AI in art creation?&lt;/h3&gt; &lt;p&gt;Nano Banana is at the forefront of the innovation in AI art creation, and by integrating it with Modern Phototools, you can be part of this revolution, pushing the boundaries of what&#x27;s possible in image editing and creation.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ remove-people-from-photos-without-photoshop.md</div> <div class="content">--- id: &#x27;remove-people-from-photos-without-photoshop&#x27; title: &#x27;How to Remove People from Photos Without Photoshop | Modern Tools&#x27; excerpt: &#x27;Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.&#x27; publishDate: &#x27;2025-10-14&#x27; readTime: &#x27;12 min read&#x27; category: &#x27;tools&#x27; featuredImage: &#x27;\images\tools images\AI Cleanup Tool.jpg&#x27; relatedTool: &#x27;ai-cleanup&#x27; keywords: [&#x27;remove people from photos&#x27;, &#x27;AI photo editing&#x27;, &#x27;photo cleanup&#x27;, &#x27;remove objects from photos&#x27;, &#x27;AI replace tool&#x27;, &#x27;photo editing without Photoshop&#x27;] seoTitle: &#x27;How to Remove People from Photos Without Photoshop | AI Tools 2025&#x27; seoDescription: &#x27;Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.&#x27; faqSchema: [ { question: &quot;Will the background look natural after removing people?&quot;, answer: &quot;Yes! Our AI Cleanup Tool uses advanced algorithms to analyze the surrounding textures, patterns, and lighting to create a natural-looking fill for the removed areas. The result is typically indistinguishable from the original background, especially in natural settings like landscapes, beaches, or architectural photos.&quot; }, { question: &quot;Do I need any technical skills to use these tools?&quot;, answer: &quot;Not at all. Both our AI Cleanup and AI Replace tools are designed for users of all skill levels. The intuitive interface guides you through the process, and the AI handles all the complex work behind the scenes. If you can use a smartphone app, you can use our tools.&quot; }, { question: &quot;How does AI Replace differ from basic object removal?&quot;, answer: &quot;While object removal (like our AI Cleanup Tool) focuses on erasing unwanted elements and filling in the background, AI Replace takes this a step further by allowing you to substitute the removed element with something new. This gives you creative control to enhance your photos rather than just cleaning them up.&quot; }, { question: &quot;What types of photos work best with these tools?&quot;, answer: &quot;Both tools work well with most photo types, but you&#x27;ll get the best results when: the person to be removed doesn&#x27;t overlap with your main subject, the background has consistent patterns or textures, the lighting is even across the image, and the photo has good resolution and clarity. That said, our advanced AI can handle challenging scenarios too, including complex backgrounds.&quot; }, { question: &quot;Is there a limit to how many people I can remove?&quot;, answer: &quot;There&#x27;s no technical limit to how many people you can remove from a photo. However, for best results, we recommend removing people in smaller groups rather than all at once if your photo contains many people. This gives the AI more surrounding context to work with for each removal.&quot; } ] styled-container: true table-of-contents: [ { id: &quot;introduction&quot;, title: &quot;Introduction&quot; }, { id: &quot;ai-solutions-overview&quot;, title: &quot;AI-Powered Solutions Overview&quot; }, { id: &quot;ai-cleanup-tool&quot;, title: &quot;AI Cleanup Tool&quot; }, { id: &quot;ai-replace-tool&quot;, title: &quot;AI Replace Tool&quot; }, { id: &quot;comparison&quot;, title: &quot;Tool Comparison&quot; }, { id: &quot;use-cases&quot;, title: &quot;Common Use Cases&quot; }, { id: &quot;tips&quot;, title: &quot;Pro Tips&quot; }, { id: &quot;faq&quot;, title: &quot;FAQ&quot; }, { id: &quot;conclusion&quot;, title: &quot;Conclusion&quot; } ] --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;How to Remove People from Photos Without Photoshop&lt;/h1&gt; &lt;div class=&quot;article-meta&quot;&gt; &lt;span class=&quot;read-time&quot;&gt;12 min read&lt;/span&gt; &lt;span class=&quot;category&quot;&gt;Tools&lt;/span&gt; &lt;span class=&quot;publish-date&quot;&gt;October 14, 2025&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#ai-solutions-overview&quot;&gt;AI-Powered Solutions Overview&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#ai-cleanup-tool&quot;&gt;AI Cleanup Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#ai-replace-tool&quot;&gt;AI Replace Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#comparison&quot;&gt;Tool Comparison&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#use-cases&quot;&gt;Common Use Cases&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tips&quot;&gt;Pro Tips&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;FAQ&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;introduction&quot;&gt; &lt;h2&gt;Introduction&lt;/h2&gt; &lt;p&gt;We&#x27;ve all been there โ€“ you capture the perfect vacation shot of a beautiful landmark, only to find random strangers photobombing your otherwise perfect image. Or perhaps you have a great group photo where one person blinked or looked away. Traditionally, removing unwanted people from photos required Photoshop skills, patience, and time. But what if you could achieve professional-looking results in seconds without complex software?&lt;/p&gt; &lt;p&gt;Modern AI technology has revolutionized photo editing, making it possible for anyone to remove people from photos quickly and easily. In this guide, we&#x27;ll show you how to achieve clean, natural-looking results using powerful AI tools that require zero Photoshop knowledge.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;ai-solutions-overview&quot;&gt; &lt;h2&gt;AI-Powered Solutions for Removing People from Photos&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;\images\tools images\AI Cleanup Tool.jpg&quot; alt=&quot;Before and after comparison of a beach photo with people removed using AI&quot;&gt; &lt;/div&gt; &lt;p&gt;AI photo editing has advanced dramatically in recent years. Instead of manually selecting and cloning areas to cover unwanted elements, AI algorithms can now intelligently analyze your image, remove people, and fill in the background naturally โ€“ all with minimal input from you.&lt;/p&gt; &lt;p&gt;At Modern Photo Tools, we offer two specialized AI solutions that make removing people from photos incredibly simple:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;AI Cleanup Tool&lt;/h3&gt; &lt;p&gt;Perfect for removing unwanted people and objects while preserving the natural background. Our advanced AI intelligently fills in the removed areas with realistic textures and patterns.&lt;/p&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Cleanup Free&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;AI Replace Tool&lt;/h3&gt; &lt;p&gt;Goes beyond simple removal by allowing you to replace people with new elements of your choice. Want to replace a stranger with a beautiful tree or landscape feature? This tool makes it possible.&lt;/p&gt; &lt;div class=&quot;card-footer&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Replace Free&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;ai-cleanup-tool&quot;&gt; &lt;h2&gt;Remove People Instantly with AI Cleanup Tool&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/e16a7d95-5833-40dc-bd5c-7a4a22c26a02.jpg&quot; alt=&quot;Screenshot of the AI Cleanup Tool interface showing a photo with a person being removed&quot;&gt; &lt;/div&gt; &lt;p&gt;Our AI Cleanup Tool is designed specifically for removing unwanted elements from photos while maintaining a natural look. Unlike Photoshop, which requires layers, masks, and clone stamping, our tool needs just a few clicks to achieve professional results.&lt;/p&gt; &lt;h3&gt;How to Remove People Using AI Cleanup Tool&lt;/h3&gt; &lt;ol class=&quot;list-numbers&quot;&gt; &lt;li&gt;Upload your photo to the &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot;&gt;AI Cleanup Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Use the brush tool to mark the person or people you want to remove&lt;/li&gt; &lt;li&gt;Click &quot;Remove&quot; and watch as our AI intelligently erases the selected elements&lt;/li&gt; &lt;li&gt;Fine-tune the results if needed with our adjustment tools&lt;/li&gt; &lt;li&gt;Download your clean, people-free photo in high resolution&lt;/li&gt; &lt;/ol&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/03de3378-aaab-4ddf-b2fb-792ace5f8b57.jpg&quot; alt=&quot;Before and after comparison showing tourists removed from a landmark photo&quot;&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to clean up your photos?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Remove unwanted people from your images in seconds - no Photoshop skills required.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Try AI Cleanup Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;ai-replace-tool&quot;&gt; &lt;h2&gt;Replace People with New Elements Using AI Replace Tool&lt;/h2&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/77923853-3801-444e-a781-810305d28e6e.jpg&quot; alt=&quot;Screenshot of the AI Replace Tool interface showing a person being replaced with a tree&quot;&gt; &lt;/div&gt; &lt;p&gt;Sometimes, simply removing people isn&#x27;t enough โ€“ you might want to replace them with something that enhances your photo. Our AI Replace Tool takes photo editing to the next level by allowing you to substitute unwanted people with new elements that blend seamlessly with the environment.&lt;/p&gt; &lt;h3&gt;Creative Ways to Use AI Replace Tool&lt;/h3&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h4&gt;Replace with Natural Elements&lt;/h4&gt; &lt;p&gt;Substitute photobombers with trees, rocks, flowers, or other natural elements that complement your landscape.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;h4&gt;Add Artistic Objects&lt;/h4&gt; &lt;p&gt;Replace unwanted people with statues, fountains, or decorative elements that enhance the composition.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h4&gt;Create Empty Space&lt;/h4&gt; &lt;p&gt;Replace people with extended background elements to create more breathing room in crowded photos.&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;h4&gt;Add Animals&lt;/h4&gt; &lt;p&gt;Substitute people with birds, pets, or wildlife that add interest to your scene.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;How to Replace People Using AI Replace Tool&lt;/h3&gt; &lt;ol class=&quot;list-numbers&quot;&gt; &lt;li&gt;Upload your photo to the &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot;&gt;AI Replace Tool&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Select the person or people you want to replace&lt;/li&gt; &lt;li&gt;Choose what you&#x27;d like to replace them with (or describe it in text)&lt;/li&gt; &lt;li&gt;Click &quot;Replace&quot; and watch the AI transform your image&lt;/li&gt; &lt;li&gt;Make adjustments if needed and download your enhanced photo&lt;/li&gt; &lt;/ol&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;\images\tools images\AI Replace tool.jpg&quot; alt=&quot;Before and after comparison showing a person replaced with a decorative fountain in a garden photo&quot;&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Transform your photos creatively&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Don&#x27;t just remove unwanted people - replace them with something better!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Try AI Replace Now&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;comparison&quot;&gt; &lt;h2&gt;How Our Tools Compare to Other Solutions&lt;/h2&gt; &lt;p&gt;While there are several options for removing people from photos without Photoshop, not all solutions are created equal. We&#x27;ve analyzed the top alternatives to show you why Modern Photo Tools offers superior results.&lt;/p&gt; &lt;div class=&quot;table-container&quot;&gt; &lt;table class=&quot;responsive-table responsive-table-striped&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Feature&lt;/th&gt; &lt;th&gt;Modern Photo Tools&lt;/th&gt; &lt;th&gt;Picsart&lt;/th&gt; &lt;th&gt;Fotor&lt;/th&gt; &lt;th&gt;Other AI Tools&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Processing Speed&lt;/td&gt; &lt;td data-label=&quot;Modern Photo Tools&quot;&gt;2-5 seconds&lt;/td&gt; &lt;td data-label=&quot;Picsart&quot;&gt;10-15 seconds&lt;/td&gt; &lt;td data-label=&quot;Fotor&quot;&gt;15-20 seconds&lt;/td&gt; &lt;td data-label=&quot;Other AI Tools&quot;&gt;20+ seconds&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Natural Background Fill&lt;/td&gt; &lt;td data-label=&quot;Modern Photo Tools&quot;&gt;Advanced AI with texture matching&lt;/td&gt; &lt;td data-label=&quot;Picsart&quot;&gt;Basic AI fill&lt;/td&gt; &lt;td data-label=&quot;Fotor&quot;&gt;Basic AI fill&lt;/td&gt; &lt;td data-label=&quot;Other AI Tools&quot;&gt;Variable quality&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Replacement Options&lt;/td&gt; &lt;td data-label=&quot;Modern Photo Tools&quot;&gt;Unlimited AI-generated options&lt;/td&gt; &lt;td data-label=&quot;Picsart&quot;&gt;Limited templates&lt;/td&gt; &lt;td data-label=&quot;Fotor&quot;&gt;Not available&lt;/td&gt; &lt;td data-label=&quot;Other AI Tools&quot;&gt;Limited or none&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Edge Detection&lt;/td&gt; &lt;td data-label=&quot;Modern Photo Tools&quot;&gt;Precise&lt;/td&gt; &lt;td data-label=&quot;Picsart&quot;&gt;Good&lt;/td&gt; &lt;td data-label=&quot;Fotor&quot;&gt;Basic&lt;/td&gt; &lt;td data-label=&quot;Other AI Tools&quot;&gt;Variable&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td data-label=&quot;Feature&quot;&gt;Free Usage&lt;/td&gt; &lt;td data-label=&quot;Modern Photo Tools&quot;&gt;Generous free tier&lt;/td&gt; &lt;td data-label=&quot;Picsart&quot;&gt;Limited free version&lt;/td&gt; &lt;td data-label=&quot;Fotor&quot;&gt;Very limited free version&lt;/td&gt; &lt;td data-label=&quot;Other AI Tools&quot;&gt;Usually limited&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;h3&gt;Key Advantages of Modern Photo Tools&lt;/h3&gt; &lt;div class=&quot;pros-cons&quot;&gt; &lt;div class=&quot;pros&quot;&gt; &lt;h4 class=&quot;pros-title&quot;&gt;Why Choose Our Tools&lt;/h4&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Faster processing than competitors (2-5 seconds vs 10-20+ seconds)&lt;/li&gt; &lt;li&gt;More natural background reconstruction with advanced texture matching&lt;/li&gt; &lt;li&gt;Unique replacement capabilities not found in most competitors&lt;/li&gt; &lt;li&gt;Intuitive interface designed for beginners&lt;/li&gt; &lt;li&gt;Higher resolution output without quality loss&lt;/li&gt; &lt;li&gt;More generous free usage allowance&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/463695cf-f580-47e4-9010-e9073db7715a.jpg&quot; alt=&quot;Comparison of results from different AI tools removing people from the same photo&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;use-cases&quot;&gt; &lt;h2&gt;Common Scenarios for Removing People from Photos&lt;/h2&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Travel Photography&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/7e811703-b188-4956-939e-7e8e2249bb6d.jpg&quot; alt=&quot;Tourist landmark with crowds removed using AI Cleanup Tool&quot;&gt; &lt;/div&gt; &lt;p&gt;Remove tourists from landmark photos to capture clean, postcard-worthy travel memories.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Real Estate Photography&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/b5c6d53a-71c2-4411-bed3-91534616f544.jpg&quot; alt=&quot;Real estate interior photo with people removed for cleaner presentation&quot;&gt; &lt;/div&gt; &lt;p&gt;Create clean, professional property listings by removing occupants or visitors.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Event Photography&lt;/h3&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6c6833a6-9b86-4c52-90fa-eaf44f0531ee.jpg&quot; alt=&quot;Wedding photo with unwanted guest removed using AI Cleanup Tool&quot;&gt; &lt;/div&gt; &lt;p&gt;Perfect group shots by removing photobombers or combining the best elements from multiple photos.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Perfect your photos today&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of photographers who are creating cleaner, more professional images with our AI tools.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Cleanup&lt;/a&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; class=&quot;cta-btn&quot;&gt;Try AI Replace&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tips&quot;&gt; &lt;h2&gt;Pro Tips for Best Results When Removing People&lt;/h2&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div&gt; &lt;h3&gt;For Simple Removals&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Choose photos where people don&#x27;t overlap with important subjects&lt;/li&gt; &lt;li&gt;Make sure the background behind the person is relatively uniform&lt;/li&gt; &lt;li&gt;Use the brush tool with appropriate size for precise selection&lt;/li&gt; &lt;li&gt;Start with smaller areas if removing multiple people&lt;/li&gt; &lt;li&gt;Use the zoom feature for detailed work around edges&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;For Replacement Effects&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Consider the lighting and perspective when choosing replacement elements&lt;/li&gt; &lt;li&gt;Be specific in your replacement descriptions for better results&lt;/li&gt; &lt;li&gt;Try multiple variations to find the perfect match&lt;/li&gt; &lt;li&gt;Use the adjustment tools to fine-tune size and positioning&lt;/li&gt; &lt;li&gt;Consider the overall composition when adding new elements&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/802eda96-6cbc-4542-b038-c3d27c42543e.jpg&quot; alt=&quot;Demonstration of selection techniques for removing people from complex backgrounds&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions&lt;/h2&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Will the background look natural after removing people?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes! Our AI Cleanup Tool uses advanced algorithms to analyze the surrounding textures, patterns, and lighting to create a natural-looking fill for the removed areas. The result is typically indistinguishable from the original background, especially in natural settings like landscapes, beaches, or architectural photos.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Do I need any technical skills to use these tools?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Not at all. Both our AI Cleanup and AI Replace tools are designed for users of all skill levels. The intuitive interface guides you through the process, and the AI handles all the complex work behind the scenes. If you can use a smartphone app, you can use our tools.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;How does AI Replace differ from basic object removal?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;While object removal (like our AI Cleanup Tool) focuses on erasing unwanted elements and filling in the background, AI Replace takes this a step further by allowing you to substitute the removed element with something new. This gives you creative control to enhance your photos rather than just cleaning them up.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;What types of photos work best with these tools?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Both tools work well with most photo types, but you&#x27;ll get the best results when:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The person to be removed doesn&#x27;t overlap with your main subject&lt;/li&gt; &lt;li&gt;The background has consistent patterns or textures&lt;/li&gt; &lt;li&gt;The lighting is even across the image&lt;/li&gt; &lt;li&gt;The photo has good resolution and clarity&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;That said, our advanced AI can handle challenging scenarios too, including complex backgrounds.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Is there a limit to how many people I can remove?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;There&#x27;s no technical limit to how many people you can remove from a photo. However, for best results, we recommend removing people in smaller groups rather than all at once if your photo contains many people. This gives the AI more surrounding context to work with for each removal.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;conclusion&quot;&gt; &lt;h2&gt;Transform Your Photos Today&lt;/h2&gt; &lt;p&gt;Removing people from photos no longer requires expensive software or technical expertise. With Modern Photo Tools&#x27; AI-powered solutions, you can clean up your images in seconds and achieve professional results that once required hours of skilled Photoshop work.&lt;/p&gt; &lt;p&gt;Whether you need to remove photobombers from your vacation shots, clean up real estate photos, or perfect your portfolio images, our AI Cleanup and AI Replace tools give you the power to create flawless photos with just a few clicks.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3 class=&quot;cta-block-title&quot;&gt;Ready to perfect your photos?&lt;/h3&gt; &lt;p class=&quot;cta-block-text&quot;&gt;Join thousands of photographers who have discovered the power of AI photo editing.&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-cleanup&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Try AI Cleanup Free&lt;/a&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-replace&quot; target=&quot;_blank&quot; class=&quot;cta-btn cta-btn-large&quot;&gt;Try AI Replace Free&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ studio-ghibli-ai-art-guide.md</div> <div class="content">--- id: studio-ghibli-ai-art-guide title: &quot;How to Make Studio Ghibli AI Art: Step-by-Step Guide&quot; excerpt: &quot;Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!&quot; publishDate: &quot;2025-04-27&quot; readTime: &quot;8 min read&quot; category: general featuredImage: &quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg&quot; keywords: [&quot;Studio Ghibli AI art&quot;, &quot;AI art generator&quot;, &quot;Ghibli style filter&quot;, &quot;AI photo transformation&quot;, &quot;anime art AI&quot;, &quot;digital art creation&quot;] metaTitle: &quot;How to Make Studio Ghibli AI Art: Step-by-Step Guide | ModernPhotoTools&quot; metaDescription: &quot;Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!&quot; faqSchema: { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;FAQPage&quot;, &quot;mainEntity&quot;: [ { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;What is Studio Ghibli AI art?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Studio Ghibli AI art refers to images that have been transformed using artificial intelligence to mimic the distinctive animation style of Studio Ghibli films. These transformations capture the characteristic soft colors, detailed backgrounds, and whimsical elements that make Ghibli films so recognizable.&quot; } }, { &quot;@type&quot;: &quot;Question&quot;, &quot;name&quot;: &quot;Do I need artistic skills to create Studio Ghibli AI art?&quot;, &quot;acceptedAnswer&quot;: { &quot;@type&quot;: &quot;Answer&quot;, &quot;text&quot;: &quot;Not at all! Our AI Filter tool handles all the artistic work for you. You simply upload a photo, select the Ghibli style, and the AI transforms it automatically. No drawing, painting, or design skills required.&quot; } } ] } --- &lt;div class=&quot;styled-container&quot;&gt; &lt;div class=&quot;article-header&quot;&gt; &lt;h1&gt;How to Make Studio Ghibli AI Art: Step-by-Step Guide&lt;/h1&gt; &lt;p class=&quot;intro-text&quot;&gt;Transform your photos into magical Studio Ghibli-style artwork using AI technology. Our comprehensive guide shows you how to create enchanting Ghibli art without any artistic skills required.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h2&gt;Transform Your Photos into Ghibli Magic&lt;/h2&gt; &lt;p&gt;Ready to create stunning Studio Ghibli AI art? Try our free AI Filter tool and watch your photos transform into magical Ghibli masterpieces in seconds.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; class=&quot;cta-button&quot;&gt;Start Creating Ghibli Art โ†’&lt;/a&gt; &lt;/div&gt; &lt;div class=&quot;table-of-contents&quot;&gt; &lt;h2&gt;Table of Contents&lt;/h2&gt; &lt;ul class=&quot;toc-list&quot;&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction to Studio Ghibli AI Art&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#what-is-ghibli-style&quot;&gt;What Makes Studio Ghibli Style Unique?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tools-needed&quot;&gt;Tools and Requirements&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#step-by-step-guide&quot;&gt;Step-by-Step Guide to Creating Studio Ghibli AI Art&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#tips-best-practices&quot;&gt;Tips and Best Practices&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#examples-inspiration&quot;&gt;Examples and Inspiration&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#faq&quot;&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;section id=&quot;introduction&quot;&gt; &lt;h2&gt;Introduction to Studio Ghibli AI Art&lt;/h2&gt; &lt;p&gt;Studio Ghibli has enchanted audiences worldwide with its distinctive animation style, characterized by dreamy landscapes, soft color palettes, and magical atmospheres. Now, thanks to advances in artificial intelligence, you can transform your own photos into beautiful Studio Ghibli-inspired artwork without any artistic training.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg&quot; alt=&quot;Studio Ghibli AI art transformation example&quot; class=&quot;responsive-image&quot;&gt; &lt;div class=&quot;image-caption&quot;&gt;Transform any photo into magical Studio Ghibli-style artwork with AI&lt;/div&gt; &lt;/div&gt; &lt;p&gt;Our AI Filter tool makes it incredibly easy to create Studio Ghibli AI art. Whether you want to transform portraits, landscapes, or everyday photos, our advanced AI technology captures the essence of Ghibli&#x27;s artistic style and applies it to your images seamlessly.&lt;/p&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3&gt;Ready to Get Started?&lt;/h3&gt; &lt;p&gt;Transform your photos into Studio Ghibli masterpieces with our free AI Filter tool.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; class=&quot;cta-button&quot;&gt;Try AI Filter Now โ†’&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;what-is-ghibli-style&quot;&gt; &lt;h2&gt;What Makes Studio Ghibli Style Unique?&lt;/h2&gt; &lt;p&gt;Studio Ghibli&#x27;s art style is instantly recognizable and beloved worldwide. Understanding these key characteristics will help you appreciate how our AI Filter captures and recreates this magical aesthetic:&lt;/p&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Soft Color Palettes&lt;/h3&gt; &lt;p&gt;Ghibli films use muted, earthy tones with warm greens, soft blues, and golden lighting that creates a dreamy, nostalgic atmosphere.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Detailed Backgrounds&lt;/h3&gt; &lt;p&gt;Intricate landscapes with lush vegetation, rolling hills, and architectural elements that feel both realistic and fantastical.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;h3&gt;Whimsical Elements&lt;/h3&gt; &lt;p&gt;Magical touches like floating objects, spirits, and otherworldly phenomena that add wonder to everyday scenes.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/1062b9b9-3d2c-4b45-aaf7-f3cb3d29f3b5.jpg&quot; alt=&quot;Studio Ghibli style characteristics&quot; class=&quot;responsive-image&quot;&gt; &lt;div class=&quot;image-caption&quot;&gt;Key visual elements that define Studio Ghibli&#x27;s distinctive art style&lt;/div&gt; &lt;/div&gt; &lt;p&gt;Our AI Filter has been trained to recognize and recreate these distinctive elements, ensuring your transformed images capture the true essence of Studio Ghibli&#x27;s magical world.&lt;/p&gt; &lt;/section&gt; &lt;section id=&quot;tools-needed&quot;&gt; &lt;h2&gt;Tools and Requirements&lt;/h2&gt; &lt;p&gt;Creating Studio Ghibli AI art is surprisingly simple. Here&#x27;s everything you need to get started:&lt;/p&gt; &lt;div class=&quot;three-columns&quot;&gt; &lt;div class=&quot;column-card&quot;&gt; &lt;h3&gt;Your Photo&lt;/h3&gt; &lt;p&gt;Any digital image you&#x27;d like to transform - portraits, landscapes, pets, or everyday scenes work beautifully.&lt;/p&gt; &lt;h3 class=&quot;snipcss0-7-107-134&quot;&gt;AI Filter Tool&lt;/h3&gt; &lt;p&gt;Our free online AI Filter tool that transforms your photos into Ghibli-style artwork.&lt;/p&gt; &lt;h3&gt;Internet Connection&lt;/h3&gt; &lt;p&gt;A stable internet connection to access our online AI Filter tool.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;highlight-box&quot;&gt; &lt;p&gt;&lt;strong&gt;No artistic skills required!&lt;/strong&gt; Our AI Filter tool handles all the creative work, transforming your photos into Studio Ghibli masterpieces with just a few clicks.&lt;/p&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;step-by-step-guide&quot;&gt; &lt;h2&gt;Step-by-Step Guide to Creating Studio Ghibli AI Art&lt;/h2&gt; &lt;p&gt;Follow these simple steps to transform your photos into magical Ghibli-style artwork:&lt;/p&gt; &lt;div class=&quot;steps-container&quot;&gt; &lt;ol class=&quot;custom-list&quot;&gt; &lt;li&gt; &lt;h3&gt;Choose the Right Photo&lt;/h3&gt; &lt;p&gt;Select a high-quality image with good lighting and clear subjects. Portraits, landscapes, pets, and nature scenes work particularly well with the Ghibli style.&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Visit ModernPhotoTools AI Filter&lt;/h3&gt; &lt;p&gt;Navigate to &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; target=&quot;_blank&quot;&gt;our free AI Filter tool&lt;/a&gt;. No registration or download required - it works directly in your browser.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/a98c300a-be0b-4253-9fa5-994b386f4fdd.jpg&quot; alt=&quot;ModernPhotoTools AI Filter interface&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Upload Your Image Or Upload Your Own Style&lt;/h3&gt; &lt;p&gt;Click the upload button or drag and drop your photo into the designated area. The tool accepts most common image formats (JPG, PNG, WEBP).&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Select the Ghibli Style&lt;/h3&gt; &lt;p&gt;From the style options, choose &quot;Studio Ghibli&quot; to apply the distinctive Ghibli aesthetic to your image.&lt;/p&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;\images\blog\Ghibli-Style.webp&quot; alt=&quot;Selecting Studio Ghibli style in AI Filter&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;h3&gt;Process &amp; Download and Share&lt;/h3&gt; &lt;p&gt;Click &quot;Generate&quot; and wait 5-10 seconds for the AI to work its magic. Once complete, download your transformed Studio Ghibli artwork!&lt;/p&gt; &lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;tips-best-practices&quot;&gt; &lt;h2&gt;Tips and Best Practices&lt;/h2&gt; &lt;p&gt;Maximize your Studio Ghibli AI art results with these expert tips:&lt;/p&gt; &lt;div class=&quot;two-columns&quot;&gt; &lt;div class=&quot;dos-section&quot;&gt; &lt;h3&gt;โœ… Do This&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Use high-resolution images for better detail&lt;/li&gt; &lt;li&gt;Choose photos with natural lighting&lt;/li&gt; &lt;li&gt;Experiment with different types of subjects&lt;/li&gt; &lt;li&gt;Try landscape and nature photos for stunning results&lt;/li&gt; &lt;li&gt;Use portraits with clear facial features&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class=&quot;donts-section&quot;&gt; &lt;h3&gt;โŒ Avoid This&lt;/h3&gt; &lt;ul class=&quot;custom-list&quot;&gt; &lt;li&gt;Very dark or poorly lit images&lt;/li&gt; &lt;li&gt;Extremely busy or cluttered compositions&lt;/li&gt; &lt;li&gt;Images with heavy digital filters already applied&lt;/li&gt; &lt;li&gt;Very low resolution or pixelated photos&lt;/li&gt; &lt;li&gt;Images with copyright watermarks&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;img-container&quot;&gt; &lt;img src=&quot;\images\blog\DO&amp;AVOID.webp&quot; alt=&quot;Tips and Best Practices&quot; class=&quot;responsive-image&quot;&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;examples-inspiration&quot;&gt; &lt;h2&gt;Examples and Inspiration&lt;/h2&gt; &lt;p&gt;See the incredible transformations possible with our Studio Ghibli AI Filter:&lt;/p&gt; &lt;div class=&quot;feature-grid&quot;&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/b6cc6629-5c2b-4330-a9ef-c2b3a9277b83.jpg&quot; alt=&quot;Studio Ghibli Portrait Transformation&quot; class=&quot;responsive-image&quot;&gt; &lt;h3&gt;Portrait Transformations&lt;/h3&gt; &lt;p&gt;Turn everyday portraits into magical Ghibli characters with soft features and dreamy backgrounds.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/440a3d51-8ebd-42ca-ac42-548ae7096ee3.jpg&quot; alt=&quot;Studio Ghibli Landscape Transformation&quot; class=&quot;responsive-image&quot;&gt; &lt;h3&gt;Landscape Magic&lt;/h3&gt; &lt;p&gt;Transform scenic photos into enchanting Ghibli-style landscapes with rolling hills and mystical atmospheres.&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;feature-card&quot;&gt; &lt;img src=&quot;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/3f73abc7-a748-4ea6-80a1-9b59806d4c73.jpg&quot; alt=&quot;Studio Ghibli Pet Adventures&quot; class=&quot;responsive-image&quot;&gt; &lt;h3&gt;Pet Adventures&lt;/h3&gt; &lt;p&gt;Give your furry friends the Ghibli treatment, creating adorable anime-style pet portraits.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h3&gt;Ready to Create Your Own Ghibli Masterpiece?&lt;/h3&gt; &lt;p&gt;Join thousands of users who have already transformed their photos into magical Studio Ghibli artwork.&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; class=&quot;cta-button&quot;&gt;Start Creating Now โ†’&lt;/a&gt; &lt;/div&gt; &lt;/section&gt; &lt;section id=&quot;faq&quot;&gt; &lt;h2&gt;Frequently Asked Questions About Studio Ghibli AI Art&lt;/h2&gt; &lt;div class=&quot;faq-container&quot;&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;What is Studio Ghibli AI art?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Studio Ghibli AI art refers to images that have been transformed using artificial intelligence to mimic the distinctive animation style of Studio Ghibli films. These transformations capture the characteristic soft colors, detailed backgrounds, and whimsical elements that make Ghibli films so recognizable.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Do I need artistic skills to create Studio Ghibli AI art?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Not at all! Our AI Filter tool handles all the artistic work for you. You simply upload a photo, select the Ghibli style, and the AI transforms it automatically. No drawing, painting, or design skills required.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Is your Studio Ghibli AI Filter tool really free?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes! Our AI Filter tool is completely free to use. There are no hidden fees, subscriptions, or limitations on the number of images you can transform.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;What types of images work best with the Ghibli AI Filter?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;While our AI Filter works with virtually any image, certain subjects tend to produce more stunning results. Portraits, landscapes, nature scenes, pets, and architectural photos typically transform beautifully into the Ghibli style.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;How long does it take to transform an image into Ghibli style?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;The transformation process typically takes just 5-10 seconds, depending on your internet connection and the size of your image. You&#x27;ll have your Ghibli-style artwork ready to download almost instantly.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;faq-item&quot;&gt; &lt;h3 class=&quot;faq-question&quot;&gt;Can I use my Ghibli AI art commercially?&lt;/h3&gt; &lt;div class=&quot;faq-answer&quot;&gt; &lt;p&gt;Yes, you can use your transformed images for personal and commercial purposes. However, please note that while you own the rights to your transformed images, the Studio Ghibli style itself is inspired by copyrighted work, so use discretion when commercializing.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;div class=&quot;cta-block&quot;&gt; &lt;h2&gt;Start Creating Your Studio Ghibli AI Art Today&lt;/h2&gt; &lt;p&gt;Transform your photos into magical Studio Ghibli masterpieces with our free AI Filter tool. No artistic skills required - just upload, select the Ghibli style, and watch the magic happen!&lt;/p&gt; &lt;a href=&quot;https://modernphototools.com/tools/ai-filter&quot; class=&quot;cta-button&quot;&gt;Try AI Filter Free โ†’&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ copy.py</div> <div class="content">import os from html import escape EXCLUDED_FILES = {&quot;package-lock.json&quot;, &quot;.gitignore&quot;, &quot;webpack-runtime.js&quot;, &quot;trace&quot;} EXCLUDED_FOLDERS = {&quot;node_modules&quot;, &quot;.git&quot;, &quot;.astro&quot;, &quot;.vscode&quot;, &quot;.DS_Store&quot;, &quot;cache&quot;, &quot;app&quot;, &quot;static&quot;, &quot;server&quot;, &quot;build&quot;, &quot;.next&quot;, &quot;docs&quot;, &quot;dist&quot;, &quot;public&quot;} def generate_file_tree_html(base_dir): html_content = [&quot;&lt;html&gt;&lt;head&gt;&lt;style&gt;&quot;] html_content.append(&quot;&quot;&quot; body { font-family: Arial, sans-serif; margin: 20px; } .folder { font-weight: bold; margin-top: 10px; } .file { margin-left: 20px; color: blue; font-weight: bold; } .content { margin-left: 40px; white-space: pre-wrap; font-family: monospace; color: black; border-left: 2px solid #ddd; padding-left: 10px; } &lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Project Files&lt;/h1&gt; &quot;&quot;&quot;) def process_folder(folder, depth=0): nonlocal html_content for item in sorted(os.listdir(folder)): item_path = os.path.join(folder, item) if item in EXCLUDED_FOLDERS or item in EXCLUDED_FILES or item.endswith(&quot;.zip&quot;): continue if os.path.isdir(item_path): html_content.append(f&#x27;&lt;div class=&quot;folder&quot; style=&quot;margin-left: {depth * 20}px;&quot;&gt;๐Ÿ“ {escape(item)}&lt;/div&gt;&#x27;) process_folder(item_path, depth + 1) else: html_content.append(f&#x27;&lt;div class=&quot;file&quot; style=&quot;margin-left: {depth * 20}px;&quot;&gt;๐Ÿ“„ {escape(item)}&lt;/div&gt;&#x27;) try: with open(item_path, &#x27;r&#x27;, encoding=&#x27;utf-8&#x27;) as f: file_content = f.read() html_content.append(f&#x27;&lt;div class=&quot;content&quot;&gt;{escape(file_content)}&lt;/div&gt;&#x27;) except Exception as e: html_content.append(f&#x27;&lt;div class=&quot;content&quot;&gt;[Error reading file: {e}]&lt;/div&gt;&#x27;) process_folder(base_dir) html_content.append(&quot;&lt;/body&gt;&lt;/html&gt;&quot;) return &quot;\n&quot;.join(html_content) if __name__ == &quot;__main__&quot;: base_dir = os.getcwd() html_output = generate_file_tree_html(base_dir) output_file = os.path.join(base_dir, &quot;project_code.html&quot;) try: with open(output_file, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f: f.write(html_output) print(f&quot;โœ… HTML file generated: {output_file}&quot;) except Exception as e: print(f&quot;โŒ Error writing file: {e}&quot;)</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ dist-ssr</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ .vite</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ manifest.json</div> <div class="content">{ &quot;src/entry-server.tsx&quot;: { &quot;file&quot;: &quot;entry-server.js&quot;, &quot;name&quot;: &quot;entry-server&quot;, &quot;src&quot;: &quot;src/entry-server.tsx&quot;, &quot;isEntry&quot;: true } }</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ entry-server.js</div> <div class="content">import { jsxs, jsx, Fragment } from &quot;react/jsx-runtime&quot;; import ReactDOMServer from &quot;react-dom/server&quot;; import { StaticRouter } from &quot;react-router-dom/server.mjs&quot;; import { Link, useParams, Navigate, Routes, Route } from &quot;react-router-dom&quot;; import { Helmet, HelmetProvider } from &quot;react-helmet-async&quot;; import React, { useState, useCallback, useRef, useEffect } from &quot;react&quot;; import * as LucideIcons from &quot;lucide-react&quot;; import { Image as Image$1, X, Menu, ArrowRight, Upload, XCircle, Brush, HelpCircle, Loader, Download, Mail, Send, Home, Search } from &quot;lucide-react&quot;; const Header = () =&gt; { const [isMenuOpen, setIsMenuOpen] = React.useState(false); const toggleMenu = () =&gt; { setIsMenuOpen(!isMenuOpen); }; return /* @__PURE__ */ jsxs(&quot;header&quot;, { className: &quot;sticky top-0 z-50 bg-white shadow-sm&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-4 flex justify-between items-center&quot;, children: [ /* @__PURE__ */ jsxs(Link, { to: &quot;/&quot;, className: &quot;flex items-center space-x-2&quot;, children: [ /* @__PURE__ */ jsx(Image$1, { className: &quot;w-8 h-8 text-blue-600&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-xl font-bold text-gray-900&quot;, children: &quot;ModernPhotoTools&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;nav&quot;, { className: &quot;hidden md:flex space-x-8&quot;, children: [ /* @__PURE__ */ jsx(Link, { to: &quot;/&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors&quot;, children: &quot;Home&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors&quot;, children: &quot;All Tools&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/blog&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors&quot;, children: &quot;Blog&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/about&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors&quot;, children: &quot;About&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/contact&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors&quot;, children: &quot;Contact&quot; }) ] }), /* @__PURE__ */ jsx( &quot;button&quot;, { className: &quot;md:hidden p-2 rounded-md text-gray-700 hover:bg-gray-100&quot;, onClick: toggleMenu, &quot;aria-label&quot;: isMenuOpen ? &quot;Close menu&quot; : &quot;Open menu&quot;, children: isMenuOpen ? /* @__PURE__ */ jsx(X, { size: 24 }) : /* @__PURE__ */ jsx(Menu, { size: 24 }) } ) ] }), isMenuOpen &amp;&amp; /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;md:hidden bg-white shadow-md&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-4 flex flex-col space-y-4&quot;, children: [ /* @__PURE__ */ jsx( Link, { to: &quot;/&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot;, onClick: () =&gt; setIsMenuOpen(false), children: &quot;Home&quot; } ), /* @__PURE__ */ jsx( Link, { to: &quot;/tools&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot;, onClick: () =&gt; setIsMenuOpen(false), children: &quot;All Tools&quot; } ), /* @__PURE__ */ jsx( Link, { to: &quot;/blog&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot;, onClick: () =&gt; setIsMenuOpen(false), children: &quot;Blog&quot; } ), /* @__PURE__ */ jsx( Link, { to: &quot;/about&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot;, onClick: () =&gt; setIsMenuOpen(false), children: &quot;About&quot; } ), /* @__PURE__ */ jsx( Link, { to: &quot;/contact&quot;, className: &quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot;, onClick: () =&gt; setIsMenuOpen(false), children: &quot;Contact&quot; } ) ] }) }) ] }); }; const Footer = () =&gt; { const currentYear = (/* @__PURE__ */ new Date()).getFullYear(); return /* @__PURE__ */ jsx(&quot;footer&quot;, { className: &quot;bg-gray-100 pt-12 pb-8&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;grid grid-cols-1 md:grid-cols-4 gap-8&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;col-span-1&quot;, children: [ /* @__PURE__ */ jsxs(Link, { to: &quot;/&quot;, className: &quot;flex items-center space-x-2 mb-4&quot;, children: [ /* @__PURE__ */ jsx(Image$1, { className: &quot;w-8 h-8 text-blue-600&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-xl font-bold text-gray-900&quot;, children: &quot;ModernPhotoTools&quot; }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600 mb-4&quot;, children: &quot;Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;col-span-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold text-gray-900 mb-4&quot;, children: &quot;Quick Links&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;space-y-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Home&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;All Tools&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/blog&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Blog&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/about&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;About&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/contact&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Contact&quot; }) }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;col-span-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold text-gray-900 mb-4&quot;, children: &quot;Popular Tools&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;space-y-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools/remove-background&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Remove Background&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools/ai-image-generator&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;AI Image Generator&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools/ai-portrait&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;AI Portrait&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools/ai-image-upscaler&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;AI Image Upscaler&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools/ai-face-swap&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;AI Face Swap&quot; }) }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;col-span-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold text-gray-900 mb-4&quot;, children: &quot;Legal&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;space-y-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/privacy-policy&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Privacy Policy&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/terms-of-use&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Terms of Use&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/dmca&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;DMCA&quot; }) }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: /* @__PURE__ */ jsx(Link, { to: &quot;/cookies-policy&quot;, className: &quot;text-gray-600 hover:text-blue-600 transition-colors&quot;, children: &quot;Cookies Policy&quot; }) }) ] }) ] }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;border-t border-gray-200 mt-8 pt-8 text-center&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: [ &quot;ยฉ &quot;, currentYear, &quot; ModernPhotoTools.com. All rights reserved.&quot; ] }) }) ] }) }); }; const faceSwapStyles = [ // --- Male Faces --- { gender: &quot;male&quot;, name: &quot;Classic Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Handsome Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Young Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Professional Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Mature Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Athletic Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820555898.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Casual Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820557168.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Stylish Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Confident Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg&quot; }, { gender: &quot;male&quot;, name: &quot;Distinguished Male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg&quot; }, // --- Female Faces --- { gender: &quot;female&quot;, name: &quot;Classic Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Beautiful Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Elegant Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Young Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Stylish Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Modern Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Professional Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Sophisticated Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Confident Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg&quot; }, { gender: &quot;female&quot;, name: &quot;Glamorous Female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg&quot; } ]; const SITE_TITLE = &quot;ModernPhotoTools.com&quot;; const SITE_DESCRIPTION = &quot;Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds.&quot;; const MAX_FILE_SIZE = 5 * 1024 * 1024; const ACCEPTED_IMAGE_TYPES = [&quot;image/jpeg&quot;, &quot;image/png&quot;, &quot;image/webp&quot;]; const SEO = ({ title = SITE_TITLE, description = SITE_DESCRIPTION, canonicalUrl }) =&gt; { const formattedTitle = title === SITE_TITLE ? title : `${title} | ${SITE_TITLE}`; return /* @__PURE__ */ jsxs(Helmet, { children: [ /* @__PURE__ */ jsx(&quot;title&quot;, { children: formattedTitle }), /* @__PURE__ */ jsx(&quot;meta&quot;, { name: &quot;description&quot;, content: description }), /* @__PURE__ */ jsx(&quot;meta&quot;, { property: &quot;og:type&quot;, content: &quot;website&quot; }), /* @__PURE__ */ jsx(&quot;meta&quot;, { property: &quot;og:title&quot;, content: formattedTitle }), /* @__PURE__ */ jsx(&quot;meta&quot;, { property: &quot;og:description&quot;, content: description }), /* @__PURE__ */ jsx(&quot;meta&quot;, { property: &quot;og:site_name&quot;, content: SITE_TITLE }), /* @__PURE__ */ jsx(&quot;meta&quot;, { name: &quot;twitter:card&quot;, content: &quot;summary_large_image&quot; }), /* @__PURE__ */ jsx(&quot;meta&quot;, { name: &quot;twitter:title&quot;, content: formattedTitle }), /* @__PURE__ */ jsx(&quot;meta&quot;, { name: &quot;twitter:description&quot;, content: description }), canonicalUrl &amp;&amp; /* @__PURE__ */ jsx(&quot;link&quot;, { rel: &quot;canonical&quot;, href: canonicalUrl }) ] }); }; const ToolCard = ({ tool }) =&gt; { const getIconComponent = (iconName) =&gt; { const pascalCaseName = iconName.split(&quot;-&quot;).map((word) =&gt; word.charAt(0).toUpperCase() + word.slice(1)).join(&quot;&quot;); const IconComponent2 = LucideIcons[pascalCaseName] || LucideIcons[iconName.charAt(0).toUpperCase() + iconName.slice(1)] || LucideIcons.Image; return IconComponent2; }; const IconComponent = getIconComponent(tool.icon); return /* @__PURE__ */ jsx( Link, { to: tool.path, className: &quot;bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;p-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4&quot;, children: /* @__PURE__ */ jsx(IconComponent, { className: &quot;w-6 h-6 text-blue-600&quot; }) }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold text-gray-900 mb-2&quot;, children: tool.name }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: tool.description }) ] }) } ); }; const Button = ({ children, variant = &quot;primary&quot;, size = &quot;md&quot;, fullWidth = false, isLoading = false, leftIcon, rightIcon, className = &quot;&quot;, disabled, ...props }) =&gt; { const baseStyles = &quot;inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2&quot;; const variantStyles = { primary: &quot;bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500&quot;, secondary: &quot;bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500&quot;, outline: &quot;bg-transparent text-gray-900 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500&quot; }; const sizeStyles = { sm: &quot;text-sm px-3 py-1.5&quot;, md: &quot;text-base px-4 py-2&quot;, lg: &quot;text-lg px-6 py-3&quot; }; const widthStyles = fullWidth ? &quot;w-full&quot; : &quot;&quot;; const disabledStyles = disabled || isLoading ? &quot;opacity-60 cursor-not-allowed&quot; : &quot;cursor-pointer&quot;; return /* @__PURE__ */ jsxs( &quot;button&quot;, { className: `${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${widthStyles} ${disabledStyles} ${className}`, disabled: disabled || isLoading, ...props, children: [ isLoading &amp;&amp; /* @__PURE__ */ jsxs(&quot;svg&quot;, { className: &quot;animate-spin -ml-1 mr-2 h-4 w-4 text-current&quot;, xmlns: &quot;http://www.w3.org/2000/svg&quot;, fill: &quot;none&quot;, viewBox: &quot;0 0 24 24&quot;, children: [ /* @__PURE__ */ jsx(&quot;circle&quot;, { className: &quot;opacity-25&quot;, cx: &quot;12&quot;, cy: &quot;12&quot;, r: &quot;10&quot;, stroke: &quot;currentColor&quot;, strokeWidth: &quot;4&quot; }), /* @__PURE__ */ jsx(&quot;path&quot;, { className: &quot;opacity-75&quot;, fill: &quot;currentColor&quot;, d: &quot;M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z&quot; }) ] }), leftIcon &amp;&amp; !isLoading &amp;&amp; /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;mr-2&quot;, children: leftIcon }), children, rightIcon &amp;&amp; /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;ml-2&quot;, children: rightIcon }) ] } ); }; const tools = [ { id: &quot;remove-background&quot;, name: &quot;Remove Background&quot;, description: &quot;Remove the background from any image with AI precision&quot;, icon: &quot;scissors&quot;, path: &quot;/tools/remove-background&quot;, apiEndpoint: &quot;/api/external/api/v2/remove-background&quot; }, { id: &quot;ai-cleanup&quot;, name: &quot;AI Cleanup&quot;, description: &quot;Clean up imperfections and enhance your photos&quot;, icon: &quot;sparkles&quot;, path: &quot;/tools/ai-cleanup&quot;, apiEndpoint: &quot;/api/external/api/v2/cleanup-picture&quot; }, { id: &quot;ai-expand&quot;, name: &quot;AI Expand&quot;, description: &quot;Expand your images beyond their original boundaries&quot;, icon: &quot;maximize&quot;, path: &quot;/tools/ai-expand&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-expand&quot; }, { id: &quot;ai-replace&quot;, name: &quot;AI Replace&quot;, description: &quot;Replace objects or areas in your images with AI&quot;, icon: &quot;replace-all&quot;, path: &quot;/tools/ai-replace&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-replace&quot; }, { id: &quot;ai-cartoon&quot;, name: &quot;AI Cartoon&quot;, description: &quot;Transform photos into cartoon-style artwork&quot;, icon: &quot;palette&quot;, path: &quot;/tools/ai-cartoon&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-cartoon-generator&quot; }, { id: &quot;ai-caricature&quot;, name: &quot;AI Caricature&quot;, description: &quot;Create fun caricatures from portrait photos&quot;, icon: &quot;smile&quot;, path: &quot;/tools/ai-caricature&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-caricature-generator&quot; }, { id: &quot;ai-avatar&quot;, name: &quot;AI Avatar&quot;, description: &quot;Generate personalized avatars from your photos&quot;, icon: &quot;user&quot;, path: &quot;/tools/ai-avatar&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-avatar&quot; }, { id: &quot;ai-product-photoshoot&quot;, name: &quot;AI Product Photoshoot&quot;, description: &quot;Create professional product photos with AI&quot;, icon: &quot;shopping-bag&quot;, path: &quot;/tools/ai-product-photoshoot&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-product-photoshoot&quot; }, { id: &quot;ai-background-generator&quot;, name: &quot;AI Background Generator&quot;, description: &quot;Generate custom backgrounds for your images&quot;, icon: &quot;image&quot;, path: &quot;/tools/ai-background-generator&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-background-generator&quot; }, { id: &quot;ai-image-generator&quot;, name: &quot;AI Image Generator&quot;, description: &quot;Generate unique images from text descriptions&quot;, icon: &quot;bot&quot;, path: &quot;/tools/ai-image-generator&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-image-generator&quot; }, { id: &quot;ai-portrait&quot;, name: &quot;AI Portrait&quot;, description: &quot;Create professional portrait photos with AI enhancement&quot;, icon: &quot;user-check&quot;, path: &quot;/tools/ai-portrait&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-portrait&quot; }, { id: &quot;ai-face-swap&quot;, name: &quot;AI Face Swap&quot;, description: &quot;Swap faces between images with AI precision&quot;, icon: &quot;refresh-cw&quot;, path: &quot;/tools/ai-face-swap&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-face-swap&quot; }, { id: &quot;ai-outfit&quot;, name: &quot;AI Outfit&quot;, description: &quot;Change outfits in photos with AI technology&quot;, icon: &quot;shirt&quot;, path: &quot;/tools/ai-outfit&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-outfit&quot; }, { id: &quot;ai-image-to-image&quot;, name: &quot;AI Image to Image&quot;, description: &quot;Transform images with AI style transfer&quot;, icon: &quot;image-plus&quot;, path: &quot;/tools/ai-image-to-image&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-image-to-image&quot; }, { id: &quot;ai-sketch-to-image&quot;, name: &quot;AI Sketch to Image&quot;, description: &quot;Convert sketches into detailed images&quot;, icon: &quot;pencil&quot;, path: &quot;/tools/ai-sketch-to-image&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-sketch-to-image&quot; }, { id: &quot;ai-hairstyle&quot;, name: &quot;AI Hairstyle&quot;, description: &quot;Try different hairstyles with AI visualization&quot;, icon: &quot;scissors&quot;, path: &quot;/tools/ai-hairstyle&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-hairstyle&quot; }, { id: &quot;ai-image-upscaler&quot;, name: &quot;AI Image Upscaler&quot;, description: &quot;Enhance image resolution without losing quality&quot;, icon: &quot;zoom-in&quot;, path: &quot;/tools/ai-image-upscaler&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-image-upscaler&quot; }, { id: &quot;ai-filter&quot;, name: &quot;AI Filter&quot;, description: &quot;Apply AI-powered filters to enhance your photos&quot;, icon: &quot;sliders&quot;, path: &quot;/tools/ai-filter&quot;, apiEndpoint: &quot;/api/external/api/v2/ai-filter&quot; } ]; const HomePage = () =&gt; { const featuredTools = tools.slice(0, 6); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(SEO, {}), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;, children: [ &quot;Professional Photo Editing Tools, &quot;, /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600&quot;, children: &quot;Powered by AI&quot; }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-700 mb-8&quot;, children: &quot;Transform your photos with our free, powerful AI-powered editing tools. No design skills required.&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex flex-col sm:flex-row justify-center gap-4&quot;, children: [ /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, children: /* @__PURE__ */ jsx(Button, { size: &quot;lg&quot;, rightIcon: /* @__PURE__ */ jsx(ArrowRight, { size: 20 }), children: &quot;Explore All Tools&quot; }) }), /* @__PURE__ */ jsx(Link, { to: &quot;/tools/remove-background&quot;, children: /* @__PURE__ */ jsx(Button, { size: &quot;lg&quot;, variant: &quot;outline&quot;, children: &quot;Remove Background&quot; }) }) ] }) ] }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-white&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center mb-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-3xl font-bold text-gray-900 mb-4&quot;, children: &quot;Our Popular Photo Editing Tools&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Discover our most popular AI-powered tools to enhance your photos in seconds.&quot; }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6&quot;, children: featuredTools.map((tool) =&gt; /* @__PURE__ */ jsx(ToolCard, { tool }, tool.id)) }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-center mt-12&quot;, children: /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, children: /* @__PURE__ */ jsx(Button, { variant: &quot;outline&quot;, rightIcon: /* @__PURE__ */ jsx(ArrowRight, { size: 18 }), children: &quot;View All Tools&quot; }) }) }) ] }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-gray-50&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center mb-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-3xl font-bold text-gray-900 mb-4&quot;, children: &quot;How It Works&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Edit your photos in three simple steps&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;grid grid-cols-1 md:grid-cols-3 gap-8&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-white p-6 rounded-lg shadow-md text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;, children: /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600 font-bold&quot;, children: &quot;1&quot; }) }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-semibold text-gray-900 mb-2&quot;, children: &quot;Upload Your Image&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Select or drag and drop the image you want to edit. We support JPEG, PNG, and WebP formats.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-white p-6 rounded-lg shadow-md text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;, children: /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600 font-bold&quot;, children: &quot;2&quot; }) }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-semibold text-gray-900 mb-2&quot;, children: &quot;Apply AI Magic&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Our AI automatically processes your image with the selected tool. No manual editing required.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-white p-6 rounded-lg shadow-md text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;, children: /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600 font-bold&quot;, children: &quot;3&quot; }) }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-semibold text-gray-900 mb-2&quot;, children: &quot;Download Result&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Download your professionally edited image and use it anywhere you want.&quot; }) ] }) ] }) ] }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-blue-600&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-3xl font-bold text-white mb-6&quot;, children: &quot;Start Editing Your Photos Today&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-blue-100 mb-8&quot;, children: &quot;Join thousands of users who transform their photos with our AI-powered tools every day.&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, children: /* @__PURE__ */ jsx(Button, { size: &quot;lg&quot;, variant: &quot;secondary&quot;, children: &quot;Get Started Now&quot; }) }) ] }) }) }) ] }); }; const ToolsPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;All Photo Editing Tools&quot;, description: &quot;Explore our complete collection of AI-powered photo editing tools. Transform, enhance, and perfect your images with professional results in seconds.&quot; } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center mb-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-3xl md:text-4xl font-bold text-gray-900 mb-4&quot;, children: &quot;All Photo Editing Tools&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600&quot;, children: &quot;Discover our complete collection of AI-powered tools to transform your photos&quot; }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6&quot;, children: tools.map((tool) =&gt; /* @__PURE__ */ jsx(ToolCard, { tool }, tool.id)) }) ] }) ] }); }; const ImageDropzone = ({ onImageSelect, selectedImage }) =&gt; { const [isDragging, setIsDragging] = useState(false); const [error, setError] = useState(null); const handleDragEnter = useCallback((e) =&gt; { e.preventDefault(); e.stopPropagation(); setIsDragging(true); }, []); const handleDragLeave = useCallback((e) =&gt; { e.preventDefault(); e.stopPropagation(); setIsDragging(false); }, []); const handleDragOver = useCallback((e) =&gt; { e.preventDefault(); e.stopPropagation(); }, []); const validateFile = (file) =&gt; { if (!ACCEPTED_IMAGE_TYPES.includes(file.type)) { return &quot;File type not supported. Please upload a JPEG, PNG, or WebP image.&quot;; } if (file.size &gt; MAX_FILE_SIZE) { return &quot;File size exceeds 5MB limit. Please upload a smaller image.&quot;; } return null; }; const handleDrop = useCallback((e) =&gt; { e.preventDefault(); e.stopPropagation(); setIsDragging(false); if (e.dataTransfer.files &amp;&amp; e.dataTransfer.files[0]) { const file = e.dataTransfer.files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () =&gt; { onImageSelect({ file, preview: reader.result }); }; reader.readAsDataURL(file); } }, [onImageSelect]); const handleFileSelect = useCallback((e) =&gt; { if (e.target.files &amp;&amp; e.target.files[0]) { const file = e.target.files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () =&gt; { onImageSelect({ file, preview: reader.result }); }; reader.readAsDataURL(file); } }, [onImageSelect]); const handleRemoveImage = useCallback(() =&gt; { onImageSelect({ file: null, preview: null }); setError(null); }, [onImageSelect]); return /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;w-full&quot;, children: [ !selectedImage.preview ? /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `border-2 border-dashed rounded-lg p-8 flex flex-col items-center justify-center cursor-pointer transition-colors ${isDragging ? &quot;border-blue-500 bg-blue-50&quot; : &quot;border-gray-300 hover:border-gray-400&quot;}`, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, onClick: () =&gt; { var _a; return (_a = document.getElementById(&quot;file-input&quot;)) == null ? void 0 : _a.click(); }, children: [ /* @__PURE__ */ jsx(Upload, { className: &quot;w-10 h-10 text-gray-400 mb-4&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700 font-medium mb-1&quot;, children: &quot;Drag and drop your image here&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-500 text-sm mb-4&quot;, children: &quot;or click to browse&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-400 text-xs&quot;, children: &quot;Supported formats: JPEG, PNG, WebP (max 5MB)&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { id: &quot;file-input&quot;, type: &quot;file&quot;, className: &quot;hidden&quot;, accept: &quot;image/jpeg,image/png,image/webp&quot;, onChange: handleFileSelect } ) ] } ) : /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;relative border rounded-lg overflow-hidden&quot;, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { src: selectedImage.preview, alt: &quot;Selected&quot;, className: &quot;w-full h-auto object-contain&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { className: &quot;absolute top-2 right-2 p-1 bg-white rounded-full shadow-md hover:bg-gray-100 transition-colors&quot;, onClick: handleRemoveImage, &quot;aria-label&quot;: &quot;Remove image&quot;, children: /* @__PURE__ */ jsx(X, { className: &quot;w-5 h-5 text-gray-700&quot; }) } ) ] }), error &amp;&amp; /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;mt-2 text-red-500 text-sm&quot;, children: error }) ] }); }; async function convertUrlToBlob(url) { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch image from URL: ${url}`); } const blob = await response.blob(); return blob; } async function uploadImageAndGetUrl(file) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const uploadUrlResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v2/uploadImageUrl&quot;, body: { uploadType: &quot;imageUrl&quot;, // &lt;--- THIS IS THE CORRECTED LINE size: file.size, contentType: file.type } }) }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; const uploadImageResponse = await fetch(uploadImage, { method: &quot;PUT&quot;, headers: { &quot;Content-Type&quot;: file.type }, body: file }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } const cleanImageUrl = imageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;); console.log(&quot;DEBUG: Original imageUrl from upload:&quot;, JSON.stringify(imageUrl)); console.log(&quot;DEBUG: Original imageUrl length:&quot;, imageUrl.length); console.log(&quot;DEBUG: Cleaned imageUrl from upload:&quot;, JSON.stringify(cleanImageUrl)); console.log(&quot;DEBUG: Cleaned imageUrl length:&quot;, cleanImageUrl.length); return cleanImageUrl; } catch (error) { console.error(&quot;Error uploading image:&quot;, error); throw error; } } async function startCleanupJob({ originalImageUrl, maskedImageUrl }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/cleanup-picture&quot;, // NOTE: Endpoint is v1 for job submission as per some docs, changed from v2 body: { imageUrl: originalImageUrl, maskedImageUrl } }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cleanup job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cleanup job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting cleanup job:&quot;, error); throw error; } } async function pollJobUntilComplete(orderId) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; let resultUrl = &quot;&quot;; let retries = 0; const maxRetries = 20; const basePollInterval = 3e3; while (!resultUrl &amp;&amp; retries &lt; maxRetries) { if (retries &gt; 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15e3); console.log(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) =&gt; setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/order-status&quot;, body: { orderId } }) }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); console.log(&quot;Order status response:&quot;, JSON.stringify(orderStatus)); if (orderStatus.status === &quot;FAIL&quot;) { const errorMessage = orderStatus.message || &quot;Unknown error&quot;; const errorDescription = orderStatus.description || &quot;&quot;; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = &quot;The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.&quot;; } console.error(&quot;LightX API Error:&quot;, { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : &quot;&quot;}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } console.log(&quot;Checking exit condition:&quot;, { status: orderStatus.body.status, output: orderStatus.body.output, statusCheck: orderStatus.body.status === &quot;active&quot;, outputCheck: !!orderStatus.body.output, bothConditions: orderStatus.body.status === &quot;active&quot; &amp;&amp; orderStatus.body.output }); if (orderStatus.body.status === &quot;active&quot; &amp;&amp; orderStatus.body.output) { console.log(&quot;Exit condition met! Setting resultUrl and breaking...&quot;); resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === &quot;failed&quot;) { const errorMessage = orderStatus.body.message || &quot;Unknown error&quot;; const errorDescription = orderStatus.body.description || &quot;&quot;; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &quot;&quot;}`); } retries++; } if (!resultUrl) { throw new Error(&quot;Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.&quot;); } console.log(&quot;Image processing completed successfully:&quot;, resultUrl); return resultUrl; } catch (error) { console.error(&quot;Error polling job status:&quot;, error); throw error; } } async function processImage(toolApiEndpoint, imageFile) { try { const maxFileSize = 10 * 1024 * 1024; const supportedTypes = [&quot;image/jpeg&quot;, &quot;image/jpg&quot;, &quot;image/png&quot;, &quot;image/webp&quot;]; if (imageFile.size &gt; maxFileSize) { throw new Error(&quot;Image file is too large. Please use an image smaller than 10MB.&quot;); } if (!supportedTypes.includes(imageFile.type.toLowerCase())) { throw new Error(&quot;Unsupported image format. Please use JPG, PNG, or WebP.&quot;); } console.log(&quot;Image validation passed:&quot;, { size: `${(imageFile.size / 1024 / 1024).toFixed(2)}MB`, type: imageFile.type, name: imageFile.name }); const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; console.log(&quot;Environment detection:&quot;, { hostname: window.location.hostname, origin: window.location.origin, isProduction, PROXY_BASE_URL }); console.log(&quot;Starting image processing...&quot;); const uploadUrlResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v2/uploadImageUrl&quot;, body: { uploadType: &quot;imageUrl&quot;, size: imageFile.size, contentType: imageFile.type } }) }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; console.log(&quot;Upload successful, imageUrl: &quot;, imageUrl); const uploadImageResponse = await fetch(uploadImage, { method: &quot;PUT&quot;, headers: { &quot;Content-Type&quot;: imageFile.type, &quot;Content-Length&quot;: imageFile.size.toString() }, body: imageFile }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } console.log(&quot;S3 upload successful, waiting for image to be available...&quot;); await new Promise((resolve) =&gt; setTimeout(resolve, 2e3)); let removeBackgroundResponse; let backgroundRemovalData; let bgRetries = 0; const maxBgRetries = 3; while (bgRetries &lt; maxBgRetries) { try { removeBackgroundResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/remove-background&quot;, body: { imageUrl } }) }); if (!removeBackgroundResponse.ok) { const errorText = await removeBackgroundResponse.text(); throw new Error(`Failed to remove background: ${removeBackgroundResponse.status} - ${errorText}`); } backgroundRemovalData = await removeBackgroundResponse.json(); break; } catch (error) { bgRetries++; if (bgRetries &gt;= maxBgRetries) { throw error; } console.log(`Remove background attempt ${bgRetries} failed, retrying in 2 seconds...`); await new Promise((resolve) =&gt; setTimeout(resolve, 2e3)); } } if (!backgroundRemovalData || !backgroundRemovalData.body || !backgroundRemovalData.body.orderId) { throw new Error(`Invalid remove background response: ${JSON.stringify(backgroundRemovalData)}`); } const { orderId } = backgroundRemovalData.body; let resultUrl = &quot;&quot;; let retries = 0; const maxRetries = 20; const basePollInterval = 3e3; while (!resultUrl &amp;&amp; retries &lt; maxRetries) { if (retries &gt; 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15e3); console.log(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) =&gt; setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/order-status&quot;, body: { orderId } }) }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); console.log(&quot;Order status response:&quot;, JSON.stringify(orderStatus)); if (orderStatus.status === &quot;FAIL&quot;) { const errorMessage = orderStatus.message || &quot;Unknown error&quot;; const errorDescription = orderStatus.description || &quot;&quot;; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = &quot;The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.&quot;; } console.error(&quot;LightX API Error:&quot;, { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : &quot;&quot;}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === &quot;active&quot; &amp;&amp; orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === &quot;failed&quot;) { const errorMessage = orderStatus.body.message || &quot;Unknown error&quot;; const errorDescription = orderStatus.body.description || &quot;&quot;; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &quot;&quot;}`); } retries++; } if (!resultUrl) { throw new Error(&quot;Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.&quot;); } console.log(&quot;Image processing completed successfully:&quot;, resultUrl); return resultUrl; } catch (error) { console.error(&quot;Error processing image:&quot;, error); throw error; } } async function startExpandJob({ imageUrl, padding }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/expand-photo&quot;, // The correct endpoint for this tool body: { imageUrl, topPadding: padding.top, leftPadding: padding.left, bottomPadding: padding.bottom, rightPadding: padding.right } }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start expand job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid expand job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting expand job:&quot;, error); throw error; } } async function startReplaceJob({ originalImageUrl, maskedImageUrl, prompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const requestPayload = { endpoint: &quot;v1/replace&quot;, body: { imageUrl: originalImageUrl, maskedImageUrl, textPrompt: prompt } }; console.log(&quot;Final payload being sent to proxy:&quot;, JSON.stringify(requestPayload, null, 2)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, // USE THE VARIABLE HERE body: JSON.stringify(requestPayload) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start replace job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid replace job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting replace job:&quot;, error); throw error; } } async function startProductPhotoshootJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/product-photoshoot&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start product photoshoot job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid product photoshoot job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting product photoshoot job:&quot;, error); throw error; } } async function startCartoonJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl }; if (styleImageUrl &amp;&amp; styleImageUrl.trim() !== &quot;&quot;) { jobBody.styleImageUrl = styleImageUrl; console.log(&quot;Using styleImageUrl, skipping textPrompt due to API constraint&quot;); } if (textPrompt &amp;&amp; textPrompt.trim() !== &quot;&quot;) { jobBody.textPrompt = textPrompt; console.log(&quot;Using textPrompt (no styleImageUrl provided)&quot;); } console.log(&quot;DEBUGGING (Final Attempt): Payload being sent:&quot;, JSON.stringify({ endpoint: &quot;v1/cartoon&quot;, body: jobBody }, null, 2)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/cartoon&quot;, body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cartoon job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cartoon job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting cartoon job:&quot;, error); throw error; } } async function startCaricatureJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl }; if (styleImageUrl &amp;&amp; styleImageUrl.trim() !== &quot;&quot;) { jobBody.styleImageUrl = styleImageUrl; console.log(&quot;Using styleImageUrl, skipping textPrompt due to API constraint&quot;); } if (textPrompt &amp;&amp; textPrompt.trim() !== &quot;&quot;) { jobBody.textPrompt = textPrompt; console.log(&quot;Using textPrompt (no styleImageUrl provided)&quot;); } const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/caricature&quot;, body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start caricature job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid caricature job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting caricature job:&quot;, error); throw error; } } async function startAvatarJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl }; if (styleImageUrl &amp;&amp; styleImageUrl.trim() !== &quot;&quot;) { jobBody.styleImageUrl = styleImageUrl; console.log(&quot;Using styleImageUrl, skipping textPrompt due to API constraint&quot;); } if (textPrompt &amp;&amp; textPrompt.trim() !== &quot;&quot;) { jobBody.textPrompt = textPrompt; console.log(&quot;Using textPrompt (no styleImageUrl provided)&quot;); } const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/avatar&quot;, body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start avatar job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid avatar job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting avatar job:&quot;, error); throw error; } } async function startBackgroundGeneratorJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/background-generator&quot;, body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start background generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid background generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting background generator job:&quot;, error); throw error; } } async function startImageGeneratorJob({ textPrompt, width, height }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { textPrompt }; if (width &amp;&amp; height) { jobBody.width = width; jobBody.height = height; console.log(`Setting image resolution: ${width}x${height}`); } console.log(&quot;Image Generator Job Body:&quot;, jobBody); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/text2image&quot;, body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting image generator job:&quot;, error); throw error; } } async function startPortraitJob({ imageUrl, styleImageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/portrait&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start portrait job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid portrait job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting portrait job:&quot;, error); throw error; } } async function startFaceSwapJob({ imageUrl, styleImageUrl }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, // Target image styleImageUrl // Source face image }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/face-swap&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start face swap job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid face swap job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting face swap job:&quot;, error); throw error; } } async function startOutfitJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/outfit&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start outfit job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid outfit job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting outfit job:&quot;, error); throw error; } } async function startImageToImageJob(params) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;) : void 0; console.log(&quot;DEBUG: Original imageUrl:&quot;, JSON.stringify(params.imageUrl)); console.log(&quot;DEBUG: Original imageUrl length:&quot;, params.imageUrl.length); console.log(&quot;DEBUG: Cleaned imageUrl:&quot;, JSON.stringify(cleanImageUrl)); console.log(&quot;DEBUG: Cleaned imageUrl length:&quot;, cleanImageUrl.length); if (params.styleImageUrl) { console.log(&quot;DEBUG: Original styleImageUrl:&quot;, JSON.stringify(params.styleImageUrl)); console.log(&quot;DEBUG: Original styleImageUrl length:&quot;, params.styleImageUrl.length); console.log(&quot;DEBUG: Cleaned styleImageUrl:&quot;, JSON.stringify(cleanStyleImageUrl)); console.log(&quot;DEBUG: Cleaned styleImageUrl length:&quot;, cleanStyleImageUrl == null ? void 0 : cleanStyleImageUrl.length); } const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; if (params.strength !== void 0) jobBody.strength = params.strength; if (params.styleStrength !== void 0) jobBody.styleStrength = params.styleStrength; console.log(&quot;DEBUG: Final jobBody in startImageToImageJob:&quot;, jobBody); console.log(&quot;DEBUG: JSON.stringify(jobBody):&quot;, JSON.stringify(jobBody)); const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/image2image&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting image-to-image job:&quot;, error); throw error; } } async function startSketchToImageJob(params) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;) : void 0; const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (params.strength !== void 0) jobBody.strength = params.strength; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; if (params.styleStrength !== void 0) jobBody.styleStrength = params.styleStrength; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/sketch2image&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start sketch-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid sketch-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting sketch-to-image job:&quot;, error); throw error; } } async function startHairstyleJob({ imageUrl, textPrompt }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, textPrompt }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v1/hairstyle&quot;, // The correct endpoint for this tool body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start hairstyle job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid hairstyle job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting hairstyle job:&quot;, error); throw error; } } async function startUpscaleJob({ imageUrl, quality }) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const jobBody = { imageUrl, quality }; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v2/upscale&quot;, // IMPORTANT: This is a v2 endpoint body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start upscale job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid upscale job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting upscale job:&quot;, error); throw error; } } async function startAIFilterJob(params) { try { const isProduction = window.location.hostname !== &quot;localhost&quot; &amp;&amp; window.location.hostname !== &quot;127.0.0.1&quot;; const PROXY_BASE_URL = isProduction ? window.location.origin : &quot;http://localhost:3001&quot;; const cleanImageUrl = params.imageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;); const cleanStyleImageUrl = params.styleImageUrl ? params.styleImageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &quot;&quot;) : void 0; const jobBody = { imageUrl: cleanImageUrl, textPrompt: params.textPrompt }; if (cleanStyleImageUrl) jobBody.styleImageUrl = cleanStyleImageUrl; const response = await fetch(`${PROXY_BASE_URL}/api/lightx-proxy`, { method: &quot;POST&quot;, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; }, body: JSON.stringify({ endpoint: &quot;v2/aifilter&quot;, // The correct endpoint for AI Filter body: jobBody }) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start AI filter job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid AI filter job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&quot;Error starting AI filter job:&quot;, error); throw error; } } const maleCartoonStyles = [ // Male Styles { name: &quot;Woody&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg&quot; }, { name: &quot;Tarzaan&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg&quot; }, { name: &quot;Suley&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421731.jpg&quot; }, { name: &quot;Shrekk&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421575.jpg&quot; }, { name: &quot;Russel&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421409.jpg&quot; }, { name: &quot;Moanna&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421257.jpg&quot; }, { name: &quot;Incredibel&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421110.jpg&quot; }, { name: &quot;Herculess&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420963.jpg&quot; }, { name: &quot;Hattre&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420807.jpg&quot; }, { name: &quot;Fro-zone&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420615.jpg&quot; }, { name: &quot;Rider&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420451.jpg&quot; }, { name: &quot;Eric&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420276.jpg&quot; }, { name: &quot;Miguelle&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420124.jpg&quot; }, { name: &quot;Fredrickson&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419880.jpg&quot; }, { name: &quot;Hook&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419739.jpg&quot; }, { name: &quot;Lightyear&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419579.jpg&quot; }, { name: &quot;Alladin&quot;, gender: &quot;male&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419379.jpg&quot; } ]; const femaleCartoonStyles = [ // Female Styles { name: &quot;Snow&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859655.jpg&quot; }, { name: &quot;Sleeping&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859518.jpg&quot; }, { name: &quot;Princess&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859374.jpg&quot; }, { name: &quot;Nordic&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859223.jpg&quot; }, { name: &quot;Mulan&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859046.jpg&quot; }, { name: &quot;Mermaid&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858882.jpg&quot; }, { name: &quot;Iceland&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858702.jpg&quot; }, { name: &quot;Fairy&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858521.jpg&quot; }, { name: &quot;Cinderella&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858381.jpg&quot; }, { name: &quot;Princess&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858207.jpg&quot; }, { name: &quot;Alice&quot;, gender: &quot;female&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858002.jpg&quot; } ]; const caricatureStyles = [ { name: &quot;Diva&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/ff03468d-2a81-4a7b-b1a1-243eab68c3f0.jpg&quot;, prompt: &quot;glamorous diva with exaggerated features, dramatic makeup, and confident pose&quot; }, { name: &quot;Superhero&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dd04d470-fa29-4039-b1e8-8e22dc965d96.jpg&quot;, prompt: &quot;heroic superhero caricature with bold features, strong jawline, and determined expression&quot; }, { name: &quot;Nurse&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fbec18f3-7348-4402-a105-023da24cf27c.jpg&quot;, prompt: &quot;caring nurse caricature with kind eyes, gentle smile, and professional appearance&quot; }, { name: &quot;Rockstar&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/0d756d9c-0d36-41a4-a7b4-d7718f8a8406.jpg&quot;, prompt: &quot;edgy rockstar caricature with wild hair, intense expression, and rebellious attitude&quot; }, { name: &quot;Corporate&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a8ff8c9a-13ec-4fe2-9a06-72c9570872d9.jpg&quot;, prompt: &quot;professional business executive caricature with sharp features, confident smile, and formal attire&quot; }, { name: &quot;Politician&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7a12a146-a906-490b-8801-2cf7f3f565a5.jpg&quot;, prompt: &quot;charismatic politician caricature with persuasive expression, prominent features, and authoritative presence&quot; }, { name: &quot;Wonder Woman&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f984a6af-689d-4cee-a087-139740d1533d.jpg&quot;, prompt: &quot;powerful Wonder Woman caricature with strong features, heroic pose, and Amazonian warrior spirit&quot; }, { name: &quot;Doctor&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bbd0f925-171d-4184-b457-01466c2cb84c.jpg&quot;, prompt: &quot;wise doctor caricature with intelligent eyes, caring expression, and medical professional demeanor&quot; }, { name: &quot;Superwoman&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/70d86058-dbab-451e-a938-d69ff32af14f.jpg&quot;, prompt: &quot;mighty superwoman caricature with bold features, confident stance, and superhero strength&quot; }, { name: &quot;Chef&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/baf9d0fe-cb2a-48ca-a442-8df670142841.jpg&quot;, prompt: &quot;passionate chef caricature with expressive face, culinary expertise, and creative cooking spirit&quot; }, { name: &quot;Engineer&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5bee0616-5f9e-4958-8978-b379a8028717.jpg&quot;, prompt: &quot;innovative engineer caricature with analytical expression, technical precision, and problem-solving mindset&quot; }, { name: &quot;Firefighter&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/44696ea2-49ae-477c-a654-b6647ad52bfc.jpg&quot;, prompt: &quot;brave firefighter caricature with heroic features, determined expression, and life-saving courage&quot; }, { name: &quot;Air hostess&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fc2eb43c-2d66-4461-a79d-d9fe850c0f10.jpg&quot;, prompt: &quot;elegant air hostess caricature with welcoming smile, professional grace, and friendly demeanor&quot; }, { name: &quot;Architect&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d61d8442-4d37-40fa-a416-1d31f76b950d.jpg&quot;, prompt: &quot;creative architect caricature with visionary expression, artistic flair, and design expertise&quot; }, { name: &quot;Ballet&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/3c75bc92-f9d5-48f4-9219-fb980d5ad42e.jpg&quot;, prompt: &quot;graceful ballet dancer caricature with elegant features, artistic expression, and dance sophistication&quot; }, { name: &quot;Athlete&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d03852f6-081d-49af-85da-709add60982d.jpg&quot;, prompt: &quot;athletic champion caricature with strong features, competitive spirit, and peak physical condition&quot; } ]; const avatarStyles = [ // Male Styles { name: &quot;Action Figure&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922035468.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A photorealistic portrait of a male as an Action Figure, dynamic pose, plastic texture, cinematic lighting.&quot; }, { name: &quot;Celebrity&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/7966a18a3de743c3b899e8ef13db2563/8a2d11fcfc2041209dbf40df261096f6&quot;, gender: &quot;male&quot;, prompt: &quot;A high-fashion portrait of a male celebrity, magazine cover style, sharp focus, glamorous.&quot; }, { name: &quot;Superhero&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/superhero.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A cinematic portrait of a male superhero, dramatic lighting, detailed costume, powerful expression.&quot; }, { name: &quot;Warrior&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/warrior.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A gritty portrait of a male warrior, ancient armor, battle-worn, epic fantasy style.&quot; }, { name: &quot;Muscular&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/mascular.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A fitness portrait of a muscular male, strong physique, dramatic shadows, powerful stance.&quot; }, { name: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/anime.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a vibrant Japanese anime style, sharp lines, expressive eyes.&quot; }, { name: &quot;Fantasy&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/fantasy.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a high-fantasy style, elven or magical elements, ethereal lighting.&quot; }, { name: &quot;Vintage&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/vintage.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a vintage, old-fashioned photograph style, sepia tones, classic attire.&quot; }, { name: &quot;Sci-Fi&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sci_fi.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A futuristic portrait of a male in a sci-fi setting, neon lights, advanced technology, space explorer.&quot; }, { name: &quot;Cyberpunk&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyberpunk.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.&quot; }, { name: &quot;Steampunk&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/steampunk.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a steampunk style, victorian clothing with brass gears and clockwork.&quot; }, { name: &quot;Medieval&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/medieval.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male knight in a medieval style, shining armor, castle background.&quot; }, { name: &quot;Celeb&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous.&quot; }, { name: &quot;Doll&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/doll.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a polished, porcelain doll, perfectly crafted features.&quot; }, { name: &quot;Astronaut&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/astronaut.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male astronaut in a spacesuit, reflection of stars in the helmet visor.&quot; }, { name: &quot;Cartoon&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cartoon.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a modern 3D cartoon style, like a character from an animated movie.&quot; }, { name: &quot;Sculpture&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sculpture.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a classical marble sculpture, detailed stone texture, dramatic lighting.&quot; }, { name: &quot;Alien&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/alien.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a friendly or mysterious alien being, otherworldly features.&quot; }, { name: &quot;Cyborg&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyborg.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a cyborg, blending human and machine, glowing circuits.&quot; }, { name: &quot;Zombie&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/zombie.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A stylized portrait of a male as a zombie, post-apocalyptic theme.&quot; }, { name: &quot;Spooky&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/spooky.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A spooky, gothic horror portrait of a male, dark atmosphere, mysterious shadows.&quot; }, { name: &quot;Clown&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Clown.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male as a friendly circus clown, colorful makeup and costume.&quot; }, { name: &quot;Halloween&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/male.png&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male in a fun Halloween costume, jack-o-lanterns and spooky decorations.&quot; }, { name: &quot;Diwali&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/002.png&quot;, gender: &quot;male&quot;, prompt: &quot;A portrait of a male celebrating Diwali, traditional Indian attire, festive lights (diyas).&quot; }, { name: &quot;Christmas&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Christmas_male512.png&quot;, gender: &quot;male&quot;, prompt: &quot;A festive portrait of a male in a Christmas setting, wearing a Santa hat or ugly sweater.&quot; }, { name: &quot;Surprises&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/29.jpg&quot;, gender: &quot;male&quot;, prompt: &quot;A fun, surprising portrait of a male, maybe with confetti or a pop art background.&quot; }, // Female Styles { name: &quot;Action Figure&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922059362.png&quot;, gender: &quot;female&quot;, prompt: &quot;A photorealistic portrait of a female as an Action Figure, dynamic pose, plastic texture, cinematic lighting.&quot; }, { name: &quot;Celebrity&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745233095138.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A high-fashion portrait of a female celebrity, magazine cover style, sharp focus, glamorous.&quot; }, { name: &quot;Doll&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/doll.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a beautiful, polished doll with perfect features, vibrant outfit.&quot; }, { name: &quot;Warrior&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/warrior.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A gritty portrait of a female warrior, ornate armor, determined expression, epic fantasy style.&quot; }, { name: &quot;Muscular&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/mascular.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A fitness portrait of a muscular female, strong and toned physique, dramatic shadows, athletic stance.&quot; }, { name: &quot;Superhero&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/superhero.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A cinematic portrait of a female superhero, dramatic lighting, detailed costume, powerful expression.&quot; }, { name: &quot;Vintage&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/vintage.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a vintage, old-fashioned photograph style, sepia tones, classic 1920s glamour.&quot; }, { name: &quot;Fantasy&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/fantasy.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a high-fantasy style, as an elegant elf or powerful sorceress, ethereal lighting.&quot; }, { name: &quot;Medieval&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/medieval.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female queen or princess in a medieval style, elegant gown, castle background.&quot; }, { name: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/anime.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a vibrant Japanese anime style, sharp lines, large expressive eyes.&quot; }, { name: &quot;Steampunk&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/steampunk.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a steampunk style, victorian dress with brass goggles and clockwork details.&quot; }, { name: &quot;Sci-Fi&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sci_fi.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A futuristic portrait of a female in a sci-fi setting, sleek armor, neon lights, space explorer.&quot; }, { name: &quot;Spooky&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/spooky.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A spooky, gothic horror portrait of a female, ghostly appearance, dark and mysterious atmosphere.&quot; }, { name: &quot;Cyberpunk&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyberpunk.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.&quot; }, { name: &quot;Celeb&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous gown.&quot; }, { name: &quot;Astronaut&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/astronaut.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female astronaut in a spacesuit, reflection of Earth in the helmet visor.&quot; }, { name: &quot;Alien&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/alien.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a beautiful and mysterious alien queen, otherworldly features.&quot; }, { name: &quot;Cartoon&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cartoon.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a modern 3D cartoon style, like a character from a Disney or Pixar movie.&quot; }, { name: &quot;Cyborg&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyborg.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a cyborg, elegant blend of human and machine, glowing circuits.&quot; }, { name: &quot;Zombie&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/zombie.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A stylized portrait of a female as a zombie, post-apocalyptic survivor theme.&quot; }, { name: &quot;Clown&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Clown.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a charming circus clown or pierrot, colorful and friendly makeup.&quot; }, { name: &quot;Sculpture&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sculpture.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female as a graceful classical marble sculpture, detailed stone texture, museum lighting.&quot; }, { name: &quot;Halloween&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/female.png&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female in a fun Halloween costume, like a witch or vampire, with spooky decorations.&quot; }, { name: &quot;Diwali&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/001.png&quot;, gender: &quot;female&quot;, prompt: &quot;A portrait of a female celebrating Diwali, wearing a beautiful traditional saree, festive lights (diyas).&quot; }, { name: &quot;Christmas&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Christmas_female512.png&quot;, gender: &quot;female&quot;, prompt: &quot;A festive portrait of a female in a Christmas setting, warm cozy sweater, by a decorated tree.&quot; }, { name: &quot;Valentine&#x27;s Day&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/36.jpg&quot;, gender: &quot;female&quot;, prompt: &quot;A romantic portrait of a female for Valentine&#x27;s Day, surrounded by hearts and roses, soft lighting.&quot; } ]; const productStyles = [ { name: &quot;Cherry Blossoms&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020929.jpg&quot;, prompt: &quot;A product placed amidst delicate cherry blossoms, soft pink background, professional product photography, cinematic lighting.&quot; }, { name: &quot;Lavenders&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020705.jpg&quot;, prompt: &quot;A product displayed in a field of lavenders, rustic and natural setting, calm and soothing atmosphere, product photoshoot.&quot; }, { name: &quot;Winter&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089570.jpg&quot;, prompt: &quot;Professional apparel photoshoot, winter theme, snowy background, warm clothing, fashion shot.&quot; }, { name: &quot;Wedding&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089011.jpg&quot;, prompt: &quot;Elegant wedding apparel photoshoot, soft lighting, romantic setting, bridal theme, high fashion.&quot; }, { name: &quot;Urban&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604088380.jpg&quot;, prompt: &quot;Urban streetwear apparel photoshoot, city background with a graffiti wall, edgy and modern style.&quot; }, { name: &quot;Summer&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087821.jpg&quot;, prompt: &quot;Summer fashion apparel photoshoot on a bright sunny day, beach or poolside setting, vibrant colors.&quot; }, { name: &quot;Red Carpet&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087214.jpg&quot;, prompt: &quot;Red carpet apparel photoshoot, glamorous evening gown, flashing lights, celebrity style.&quot; }, { name: &quot;Party&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086601.jpg&quot;, prompt: &quot;Festive party apparel photoshoot with confetti and balloons, celebratory mood, dynamic and fun.&quot; }, { name: &quot;Business&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086039.jpg&quot;, prompt: &quot;Professional business apparel photoshoot in a modern office setting, clean and sharp look, corporate attire.&quot; }, { name: &quot;Athleisure&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604085478.jpg&quot;, prompt: &quot;Athleisure apparel photoshoot with a sporty and comfortable look, in an urban park or gym setting.&quot; }, { name: &quot;Adventure&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604084689.jpg&quot;, prompt: &quot;Adventure and outdoor apparel photoshoot, mountain or forest background, rugged and durable clothing.&quot; }, { name: &quot;Rosebed&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a0ca0330-f483-4c55-8a2f-18ce0db0c39e.jpg&quot;, prompt: &quot;A cherished product, like jewelry or perfume, displayed on a bed of fresh red roses, romantic and luxurious.&quot; }, { name: &quot;Ribbons&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bd2b6d55-4709-4a1a-90de-0f48e73f68d7.jpg&quot;, prompt: &quot;A product artfully arranged with flowing silk ribbons, elegant and delicate presentation, studio shot.&quot; }, { name: &quot;River&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119732.jpg&quot;, prompt: &quot;Product photoshoot set by a clear mountain river, on natural stones, in a serene and pristine environment.&quot; }, { name: &quot;Waterfall&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119524.jpg&quot;, prompt: &quot;Product photoshoot with a majestic waterfall in the background, misty and powerful nature scene.&quot; }, { name: &quot;Tree Stump&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244508.jpg&quot;, prompt: &quot;A rustic product displayed on an old tree stump in a forest, natural and earthy mood.&quot; }, { name: &quot;Mountain&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244245.jpg&quot;, prompt: &quot;Product photoshoot on a mountain peak, dramatic sky, expansive and adventurous mood.&quot; }, { name: &quot;Kitchen&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842034380.jpg&quot;, prompt: &quot;Product placement in a modern, clean kitchen setting, lifestyle photoshoot, natural light.&quot; }, { name: &quot;Bathroom&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842033958.jpg&quot;, prompt: &quot;Cosmetic product displayed in a luxurious, spa-like bathroom, clean and fresh aesthetic.&quot; }, { name: &quot;Sneakers&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509574349.jpg&quot;, prompt: &quot;Dynamic photoshoot of sneakers, urban street setting, motion blur, product in action.&quot; }, { name: &quot;Sandals&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/206c0e5fc3f54894a3add602580c195a&quot;, prompt: &quot;Lifestyle photoshoot of sandals on a sunny beach, sand and waves in the background, relaxed summer vibe.&quot; }, { name: &quot;Rose Pink&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982317.jpg&quot;, prompt: &quot;Product placed on a solid rose pink surface, minimalist and clean, top-down studio shot.&quot; }, { name: &quot;Light Coral&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982080.jpg&quot;, prompt: &quot;Product displayed on a light coral colored background, soft and warm aesthetic, studio product shot.&quot; }, { name: &quot;Storage&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509555427.jpg&quot;, prompt: &quot;A piece of storage furniture in a well-decorated room, lifestyle shot showing its use and style.&quot; }, { name: &quot;Sofa&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509554980.jpg&quot;, prompt: &quot;A stylish sofa featured in a modern living room, highlighting its texture and comfort.&quot; }, { name: &quot;Pilea&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995995.jpg&quot;, prompt: &quot;Product photoshoot with a Pilea plant, creating a green and fresh atmosphere in a minimalist interior.&quot; }, { name: &quot;Hoya&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995739.jpg&quot;, prompt: &quot;Product displayed next to a beautiful Hoya plant, biophilic design, natural and calming.&quot; }, { name: &quot;Ring&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988340.jpg&quot;, prompt: &quot;Macro shot of a ring on a luxurious surface, focused on details and sparkle, elegant lighting.&quot; }, { name: &quot;Pendant&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988007.jpg&quot;, prompt: &quot;An elegant pendant necklace display, soft focus background, highlighting the craftsmanship.&quot; }, { name: &quot;Marble Table&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062430.jpg&quot;, prompt: &quot;Product photoshoot on a white marble table, luxurious and clean aesthetic, top-down view.&quot; }, { name: &quot;Liquid Surface&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062164.jpg&quot;, prompt: &quot;Product placed on a surface with realistic liquid ripples, creative and dynamic studio shot.&quot; }, { name: &quot;Graffiti&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006896.jpg&quot;, prompt: &quot;Product photoshoot against a vibrant graffiti wall, urban and edgy style.&quot; }, { name: &quot;Fireworks&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006566.jpg&quot;, prompt: &quot;Product displayed with a background of colorful fireworks, celebratory and exciting mood.&quot; }, { name: &quot;Berries&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696919338904.jpg&quot;, prompt: &quot;A cosmetic or food product surrounded by fresh berries, vibrant and natural.&quot; }, { name: &quot;Coffee Beans&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842044157.jpg&quot;, prompt: &quot;A product surrounded by aromatic roasted coffee beans, warm and rich atmosphere.&quot; } ]; const suggestedPrompts$1 = [ &quot;an object on a marble counter&quot;, &quot;an object on water-rippling water&quot;, &quot;an object surrounded by rose petals&quot;, &quot;an object on a mountain&quot;, &quot;an object on a kitchen counter&quot;, &quot;an object on a rock&quot;, &quot;waterfall in background&quot;, &quot;an object on top of a lotus flower&quot;, &quot;an object on snowy mountain&quot;, &quot;an object with golden light&quot;, &quot;an object in the sky&quot;, &quot;cloudy sky&quot; ]; const imageResolutions = [ { id: &quot;square&quot;, name: &quot;Square&quot;, aspectRatio: &quot;1:1&quot;, dimensions: &quot;1024x1024 px&quot;, width: 1024, height: 1024 }, { id: &quot;portrait-9-16&quot;, name: &quot;Portrait&quot;, aspectRatio: &quot;9:16&quot;, dimensions: &quot;768x1360 px&quot;, width: 768, height: 1360 }, { id: &quot;landscape-16-9&quot;, name: &quot;Landscape&quot;, aspectRatio: &quot;16:9&quot;, dimensions: &quot;1360x768 px&quot;, width: 1360, height: 768 }, { id: &quot;portrait-3-4&quot;, name: &quot;Portrait&quot;, aspectRatio: &quot;3:4&quot;, dimensions: &quot;880x1168 px&quot;, width: 880, height: 1168 }, { id: &quot;landscape-4-3&quot;, name: &quot;Landscape&quot;, aspectRatio: &quot;4:3&quot;, dimensions: &quot;1168x880 px&quot;, width: 1168, height: 880 }, { id: &quot;portrait-2-3&quot;, name: &quot;Portrait&quot;, aspectRatio: &quot;2:3&quot;, dimensions: &quot;832x1248 px&quot;, width: 832, height: 1248 }, { id: &quot;landscape-3-2&quot;, name: &quot;Landscape&quot;, aspectRatio: &quot;3:2&quot;, dimensions: &quot;1248x832 px&quot;, width: 1248, height: 832 } ]; const suggestedPrompts = [ &quot;generate cute fawn cartoon character enjoying springtime flowers in highly detailed&quot;, &quot;create an (old cartoon illustration) of an abandoned boat on the beach surrounded by seagulls and starfish, stormy clouds&quot;, &quot;generate a serpent with a hypnotic gaze in a magical wonderland, best quality, masterpiece, ultra sharp, hyper-realistic&quot;, &quot;generate an 8k ultra-realistic image of a beautiful unicorn in heaven, high quality with rich vibrant vivid colors&quot;, &quot;design a character in the style of Amy Judd blending with Andre Kohn style:1.1), ((neo-figurative fantasy:1.2)), a young woman made of smoke and fog and delicate misty wisps sitting with her side.&quot;, &quot;knight fighting a giant fantasy dragon, a burned village in the background, highly detailed, dark fantasy, (morning dawn epic scene of dense smoke by Kim Keever)&quot;, &quot;generate a (glowing eyes:1. 2) smiling medusa with pale white cracked skin, snakes growing out of her head, dramatic with the best quality&quot;, &quot;generate a realistic (batman:1.3) holding a powerful magical electric thunder ball spellbook with detailed eyes, cinematic&quot;, &quot;create a photo of the artistic stone cup with 3D carvings of a muscular teenage ninja turtle in vibrant colors body, decorated with amber accents in dark mountain&quot;, &quot;generate a feudal ninja fighting bravely against a giant colossus straw puppet boss, hyper-detailed, ultra-detailed&quot;, &quot;create a pixar character of a bull terrier smiling, high resolution, best quality, ((pixar style))&quot;, &quot;a dzungarian hamster in an adventurer&#x27;s hat with slimy tentacles made of blue and white porcelain in wonderland, fantasy art concept, best quality, masterpiece&quot;, &quot;create an ethereal beauty of mystical trees with sparkling blossoms illuminated by a red radiant moon casting its glow upon a tree and large landscape&quot;, &quot;pixar style of transparent king seahorse with a crown (((luminous))) in the ocean covered with bubbles, high detailed, photorealistic, 8k&quot;, &quot;Alice fighting a Oompa Loompa with a large sword, hyper detailed, high quality&quot;, &quot;pixar style of lobster, as a cartoon business man character, tinny cute, ((( luminous))), carring a little suitcase, in the ocean, bubbles, smile, high detailed, photorealistic, 8k , smooth, simple&quot;, &quot;generate a ((leprechaun)) dancing on a big cauldron full of shiny golden coins in front of a dark cave, (evil laugh), ((clover bushes in the foreground)), god rays of rim light from the small cleft, dense dust, dark fantasy art&quot;, &quot;pixar style of a chubby giraffe with a big tummy like a ball doing yoga poses in yoga pants, smiling, highly detailed, photorealistic&quot; ]; const portraitStyles = [ // --- Male Styles --- { gender: &quot;male&quot;, name: &quot;Wizard&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg&quot;, prompt: &quot;A selfie of a male as a powerful Wizard, wearing magical robes, in a fantasy library setting.&quot; }, { gender: &quot;male&quot;, name: &quot;Trench Coat&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg&quot;, prompt: &quot;A cinematic selfie of a male wearing a stylish Trench Coat on a rainy city street at night.&quot; }, { gender: &quot;male&quot;, name: &quot;Sweater&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg&quot;, prompt: &quot;A cozy selfie of a male in a warm, knitted sweater, autumn vibes, soft lighting.&quot; }, { gender: &quot;male&quot;, name: &quot;Grinch&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a7b8a481-8776-4589-b1bb-9c021da759f5.jpg&quot;, prompt: &quot;A selfie of a male transformed into the Grinch, with green fur and a mischievous smile, festive theme.&quot; }, { gender: &quot;male&quot;, name: &quot;Superhero&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg&quot;, prompt: &quot;A dynamic selfie of a male as a powerful Superhero, wearing a modern costume, with a city skyline in the background.&quot; }, { gender: &quot;male&quot;, name: &quot;Post Imp&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg&quot;, prompt: &quot;A selfie of a male in a Post-Impressionist art style, with bold colors and expressive brushstrokes.&quot; }, { gender: &quot;male&quot;, name: &quot;Abstract&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891373055.jpg&quot;, prompt: &quot;A selfie of a male in a vibrant abstract art style, using geometric shapes and non-realistic colors.&quot; }, { gender: &quot;male&quot;, name: &quot;Wooden&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777377.jpg&quot;, prompt: &quot;A selfie of a male reimagined as a detailed Wooden sculpture, showing wood grain and texture.&quot; }, { gender: &quot;male&quot;, name: &quot;Stone&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777195.jpg&quot;, prompt: &quot;A selfie of a male reimagined as a classical Stone sculpture, with a marble or granite texture.&quot; }, { gender: &quot;male&quot;, name: &quot;Thriller&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg&quot;, prompt: &quot;A selfie of a male in a classic thriller movie style, dramatic shadows, intense expression.&quot; }, { gender: &quot;male&quot;, name: &quot;Suave&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg&quot;, prompt: &quot;A selfie of a suave male in a tailored suit, looking confident and charming, like a secret agent.&quot; }, { gender: &quot;male&quot;, name: &quot;Officer&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890916035.jpg&quot;, prompt: &quot;A professional selfie of a male as a respectable military Officer in a formal uniform.&quot; }, { gender: &quot;male&quot;, name: &quot;Cop&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890915894.jpg&quot;, prompt: &quot;A selfie of a male as a police Cop, wearing a uniform, looking serious and dedicated.&quot; }, { gender: &quot;male&quot;, name: &quot;Cyber Warrior&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823784962.jpg&quot;, prompt: &quot;A selfie of a male as a futuristic Cyber Warrior, with high-tech armor and a glowing energy sword.&quot; }, { gender: &quot;male&quot;, name: &quot;Viking&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823787503.jpg&quot;, prompt: &quot;A selfie of a male as a fierce Viking warrior, with braided hair, beard, and traditional armor.&quot; }, { gender: &quot;male&quot;, name: &quot;Legacy&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197112042.jpg&quot;, prompt: &quot;A selfie of a male with Day of the Dead face paint, celebrating a vibrant legacy with flowers and patterns.&quot; }, { gender: &quot;male&quot;, name: &quot;Ancestor&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197109686.jpg&quot;, prompt: &quot;A selfie of a male in the style of a revered Ancestor, with traditional Day of the Dead sugar skull makeup.&quot; }, { gender: &quot;male&quot;, name: &quot;Mohawk&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397418.jpg&quot;, prompt: &quot;A selfie of a male with a cool Mohawk hairstyle, punk rock aesthetic.&quot; }, { gender: &quot;male&quot;, name: &quot;Gray&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg&quot;, prompt: &quot;A selfie of a male with distinguished gray hair, looking handsome and sophisticated.&quot; }, { gender: &quot;male&quot;, name: &quot;Sultan&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654277.jpg&quot;, prompt: &quot;A royal selfie of a male as a powerful Sultan, wearing ornate robes and a majestic turban.&quot; }, { gender: &quot;male&quot;, name: &quot;Ottoman&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654139.jpg&quot;, prompt: &quot;A royal selfie of a male in traditional Ottoman empire attire, rich fabrics and intricate details.&quot; }, { gender: &quot;male&quot;, name: &quot;Mughal&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653999.jpg&quot;, prompt: &quot;A royal selfie of a male as a Mughal emperor, adorned with jewels and fine silks.&quot; }, { gender: &quot;male&quot;, name: &quot;Mayan&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653860.jpg&quot;, prompt: &quot;A royal selfie of a male as a Mayan king, with traditional headdress and intricate carvings.&quot; }, { gender: &quot;male&quot;, name: &quot;Heian&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653726.jpg&quot;, prompt: &quot;A royal selfie of a male in the style of the Japanese Heian period, elegant and artistic.&quot; }, { gender: &quot;male&quot;, name: &quot;European&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653548.jpg&quot;, prompt: &quot;A selfie of a male as classic European royalty, wearing a crown and regal attire.&quot; }, { gender: &quot;male&quot;, name: &quot;Chinese&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653334.jpg&quot;, prompt: &quot;A selfie of a male as a historical Chinese emperor, in traditional silk robes.&quot; }, { gender: &quot;male&quot;, name: &quot;Byzantine&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653170.jpg&quot;, prompt: &quot;A selfie of a male in the opulent style of a Byzantine noble, with rich mosaics and gold.&quot; }, { gender: &quot;male&quot;, name: &quot;African&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887652980.jpg&quot;, prompt: &quot;A selfie of a male as a proud African king, wearing vibrant traditional attire and beads.&quot; }, { gender: &quot;male&quot;, name: &quot;Woody&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg&quot;, prompt: &quot;A selfie of a male transformed into the cartoon character Woody from Toy Story, 3D animated style.&quot; }, { gender: &quot;male&quot;, name: &quot;Tarzaan&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg&quot;, prompt: &quot;A selfie of a male as the cartoon character Tarzan, in a lush jungle, animated style.&quot; }, { gender: &quot;male&quot;, name: &quot;Waist-coat&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890156866.jpg&quot;, prompt: &quot;A selfie of a male celebrating Diwali, wearing a traditional Kurta with a stylish waist-coat.&quot; }, { gender: &quot;male&quot;, name: &quot;Contemporary&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890157076.jpg&quot;, prompt: &quot;A selfie of a male in a contemporary outfit for Diwali, modern and festive.&quot; }, { gender: &quot;male&quot;, name: &quot;Adorable&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443497129.jpg&quot;, prompt: &quot;An adorable selfie of a male for Valentine&#x27;s Day, with a sweet smile and a background of hearts.&quot; }, { gender: &quot;male&quot;, name: &quot;Charming&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443499416.jpg&quot;, prompt: &quot;A charming selfie of a male on Valentine&#x27;s Day, holding a rose, looking romantic.&quot; }, { gender: &quot;male&quot;, name: &quot;Vibrant&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581601035.jpg&quot;, prompt: &quot;A selfie of a male celebrating Holi, face covered in vibrant colored powders.&quot; }, { gender: &quot;male&quot;, name: &quot;Phoolrang&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581602870.jpg&quot;, prompt: &quot;A selfie of a male celebrating Holi with Phoolrang, surrounded by flower petals and colors.&quot; }, { gender: &quot;male&quot;, name: &quot;Santa&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851564.jpg&quot;, prompt: &quot;A festive selfie of a male dressed as Santa Claus, with a white beard and red hat.&quot; }, { gender: &quot;male&quot;, name: &quot;Snow&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851805.jpg&quot;, prompt: &quot;A selfie of a male in a winter wonderland, with snow falling gently around him, Christmas theme.&quot; }, { gender: &quot;male&quot;, name: &quot;Vibrant&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/28ad386a-6665-46f5-8e87-9e6d9fd2a036.jpg&quot;, prompt: &quot;A selfie of a male at a vibrant New Year&#x27;s party, with confetti and bright lights.&quot; }, { gender: &quot;male&quot;, name: &quot;Stylish&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7cd237c1-9274-46e1-bddb-c1953d00f075.jpg&quot;, prompt: &quot;A stylish selfie of a male dressed up for a New Year&#x27;s celebration, looking sharp in a suit.&quot; }, // --- Female Styles --- { gender: &quot;female&quot;, name: &quot;Woolen Coat&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg&quot;, prompt: &quot;A chic selfie of a female in an elegant Woolen Coat, winter fashion in the city.&quot; }, { gender: &quot;female&quot;, name: &quot;Tropical&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg&quot;, prompt: &quot;A selfie of a female in a vibrant Tropical dress, on a sunny beach with palm trees.&quot; }, { gender: &quot;female&quot;, name: &quot;Trench Coat&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg&quot;, prompt: &quot;A selfie of a female wearing a classic Trench Coat, sophisticated and timeless look, autumn setting.&quot; }, { gender: &quot;female&quot;, name: &quot;Sweater&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg&quot;, prompt: &quot;A cozy selfie of a female wearing a soft, warm sweater, holding a cup of coffee.&quot; }, { gender: &quot;female&quot;, name: &quot;Stylish&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg&quot;, prompt: &quot;A selfie of a very stylish female in a high-fashion outfit, looking ready for a magazine cover.&quot; }, { gender: &quot;female&quot;, name: &quot;Street Style&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg&quot;, prompt: &quot;A selfie of a female with an edgy Street Style look, in a cool urban environment.&quot; }, { gender: &quot;female&quot;, name: &quot;Poncho&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg&quot;, prompt: &quot;A selfie of a female wearing a fashionable, patterned Poncho, bohemian and chic.&quot; }, { gender: &quot;female&quot;, name: &quot;Nightdress&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg&quot;, prompt: &quot;A selfie of a female in an elegant silk Nightdress, soft and dreamy bedroom setting.&quot; }, { gender: &quot;female&quot;, name: &quot;Jacket&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg&quot;, prompt: &quot;A selfie of a female in a cool leather Jacket, exuding confidence and style.&quot; }, { gender: &quot;female&quot;, name: &quot;Cocktail&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg&quot;, prompt: &quot;A selfie of a female in a stunning Cocktail dress, ready for an evening event.&quot; }, { gender: &quot;female&quot;, name: &quot;Classic Black&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570192.jpg&quot;, prompt: &quot;A selfie of a female in a timeless, classic black dress, sophisticated and elegant.&quot; }, { gender: &quot;female&quot;, name: &quot;Boho&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570025.jpg&quot;, prompt: &quot;A selfie of a female with a Boho-chic style, flowy dress, and earthy accessories.&quot; }, { gender: &quot;female&quot;, name: &quot;Bodysuit&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569859.jpg&quot;, prompt: &quot;A selfie of a female in a sleek and stylish Bodysuit, modern and fashionable.&quot; }, { gender: &quot;female&quot;, name: &quot;Blazer&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569709.jpg&quot;, prompt: &quot;A selfie of a female looking sharp and professional in a well-fitted Blazer.&quot; }, { gender: &quot;female&quot;, name: &quot;Athleisure&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569494.jpg&quot;, prompt: &quot;A selfie of a female in trendy Athleisure wear, sporty, comfortable, and stylish.&quot; }, { gender: &quot;female&quot;, name: &quot;Aesthetic&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893290344.jpg&quot;, prompt: &quot;A selfie of a female with a soft, dreamy aesthetic, pastel colors, and artistic flair.&quot; }, { gender: &quot;female&quot;, name: &quot;Goddess&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893291279.jpg&quot;, prompt: &quot;A selfie of a female transformed into a divine Goddess, with ethereal light and a powerful aura.&quot; }, { gender: &quot;female&quot;, name: &quot;Romanticism&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822384442.jpg&quot;, prompt: &quot;A selfie of a female in the style of a Romanticism painting, dramatic, emotional, and beautiful.&quot; }, { gender: &quot;female&quot;, name: &quot;Abstract&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822382528.jpg&quot;, prompt: &quot;A selfie of a female rendered in a colorful abstract painting style, bold shapes and lines.&quot; }, { gender: &quot;female&quot;, name: &quot;Goddess&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721893611671.jpg&quot;, prompt: &quot;A fantasy selfie of a female as a celestial Goddess, surrounded by stars and cosmic energy.&quot; }, { gender: &quot;female&quot;, name: &quot;Viking&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733226.jpg&quot;, prompt: &quot;A selfie of a female as a strong Viking warrior, with intricate braids and leather armor.&quot; }, { gender: &quot;female&quot;, name: &quot;Tribal&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733082.jpg&quot;, prompt: &quot;A selfie of a female with beautiful tribal face paint and traditional accessories, proud and powerful.&quot; }, { gender: &quot;female&quot;, name: &quot;Soulful&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197129378.jpg&quot;, prompt: &quot;A soulful selfie of a female with artistic Day of the Dead makeup, celebrating life and memory.&quot; }, { gender: &quot;female&quot;, name: &quot;Sacred&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197131255.jpg&quot;, prompt: &quot;A selfie of a female with sacred Day of the Dead sugar skull art, adorned with marigolds.&quot; }, { gender: &quot;female&quot;, name: &quot;Black Stone&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721880887150.jpg&quot;, prompt: &quot;A selfie of a female reimagined as an elegant Black Stone sculpture, polished and dramatic.&quot; }, { gender: &quot;female&quot;, name: &quot;Stone&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721825362271.jpg&quot;, prompt: &quot;A selfie of a female as a graceful Greco-Roman stone sculpture, timeless beauty.&quot; }, { gender: &quot;female&quot;, name: &quot;Wavy&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770675.jpg&quot;, prompt: &quot;A selfie of a female with beautiful, long wavy hair, looking natural and effortless.&quot; }, { gender: &quot;female&quot;, name: &quot;Victoria Roll&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770509.jpg&quot;, prompt: &quot;A selfie of a female with an elegant Victoria Roll hairstyle, classic and sophisticated.&quot; }, { gender: &quot;female&quot;, name: &quot;Clothes&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882293628.jpg&quot;, prompt: &quot;A selfie of a female in futuristic clothes with glowing neon accents, cyberpunk fashion.&quot; }, { gender: &quot;female&quot;, name: &quot;Space Explorer&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882294348.jpg&quot;, prompt: &quot;A selfie of a female as a neon Space Explorer, with a futuristic suit and helmet.&quot; }, { gender: &quot;female&quot;, name: &quot;Spain&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885286031.jpg&quot;, prompt: &quot;A selfie of a female as Spanish royalty, wearing a traditional, elegant gown.&quot; }, { gender: &quot;female&quot;, name: &quot;Queen&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885285866.jpg&quot;, prompt: &quot;A royal selfie of a female as a powerful Queen, wearing a crown and regal jewelry.&quot; } ]; const suggestedPortraitPrompts = [ &quot;Professional headshot with soft lighting&quot;, &quot;Artistic portrait with dramatic shadows&quot;, &quot;Vintage style with warm tones&quot;, &quot;Modern minimalist portrait&quot;, &quot;Fantasy character transformation&quot;, &quot;Cinematic movie poster style&quot;, &quot;Oil painting classical portrait&quot;, &quot;Digital art cyberpunk style&quot; ]; const presetOutfitStyles = [ // Category: Wedding { category: &quot;Wedding&quot;, name: &quot;2-Piece&quot;, prompt: &quot;A model wearing a modern and elegant 2-piece wedding outfit, professional studio photoshoot.&quot; }, { category: &quot;Wedding&quot;, name: &quot;Jacket&quot;, prompt: &quot;A model in a sophisticated wedding jacket, suitable for a chic and formal ceremony.&quot; }, { category: &quot;Wedding&quot;, name: &quot;A-Line&quot;, prompt: &quot;A model wearing a classic A-Line wedding gown, timeless and graceful, full-length view.&quot; }, { category: &quot;Wedding&quot;, name: &quot;3 Piece Suit&quot;, prompt: &quot;A model looking dapper in a perfectly tailored 3-piece wedding suit, formal and sharp.&quot; }, { category: &quot;Wedding&quot;, name: &quot;Gown&quot;, prompt: &quot;A model in a breathtaking, floor-length wedding gown, romantic and elegant.&quot; }, { category: &quot;Wedding&quot;, name: &quot;Classic Suit&quot;, prompt: &quot;A model wearing a timeless classic suit for a wedding, sophisticated and elegant.&quot; }, // Category: Smart Casual { category: &quot;Smart Casual&quot;, name: &quot;Jacket&quot;, prompt: &quot;A model wearing a stylish jacket, embodying a perfect smart casual look for an urban setting.&quot; }, { category: &quot;Smart Casual&quot;, name: &quot;Jacket&quot;, prompt: &quot;A model in a fashionable smart casual jacket, effortlessly chic for a day out.&quot; }, { category: &quot;Smart Casual&quot;, name: &quot;Cardigan&quot;, prompt: &quot;A model looking cozy and stylish in a layered smart casual cardigan.&quot; }, { category: &quot;Smart Casual&quot;, name: &quot;Cardigan&quot;, prompt: &quot;A model in a comfortable knit cardigan, the essence of smart casual fashion.&quot; }, { category: &quot;Smart Casual&quot;, name: &quot;Blouse shirt&quot;, prompt: &quot;A model in an elegant blouse shirt, perfect for a smart casual office look or evening.&quot; }, { category: &quot;Smart Casual&quot;, name: &quot;Button-up&quot;, prompt: &quot;A model wearing a crisp button-up shirt, a versatile staple of smart casual style.&quot; }, // Category: Athleisure { category: &quot;Athleisure&quot;, name: &quot;Sports Bra&quot;, prompt: &quot;A model in a trendy and supportive sports bra, athleisure style, in a fitness studio.&quot; }, { category: &quot;Athleisure&quot;, name: &quot;Basketball&quot;, prompt: &quot;A model wearing basketball-inspired athleisure wear on an urban court, sporty and cool.&quot; }, { category: &quot;Athleisure&quot;, name: &quot;Hoodie&quot;, prompt: &quot;A model in a comfortable athleisure hoodie, perfect for a casual, sporty look.&quot; }, { category: &quot;Athleisure&quot;, name: &quot;Hoodie&quot;, prompt: &quot;A model showcasing a different style of athleisure hoodie, street style fashion.&quot; }, { category: &quot;Athleisure&quot;, name: &quot;Tank Top&quot;, prompt: &quot;A model in a breathable athleisure tank top, looking ready for a workout.&quot; }, { category: &quot;Athleisure&quot;, name: &quot;Polo&quot;, prompt: &quot;A model in a classic polo shirt, styled for a sophisticated athleisure look.&quot; }, // Category: Jackets (Inferred) { category: &quot;Jackets&quot;, name: &quot;Denim Jacket&quot;, prompt: &quot;A model in a timeless denim jacket, casual street style photoshoot.&quot; }, { category: &quot;Jackets&quot;, name: &quot;Denim Jacket&quot;, prompt: &quot;A model showcasing a fashionable denim jacket against an urban background.&quot; }, // Category: Sweaters (Inferred) { category: &quot;Sweaters&quot;, name: &quot;Sweater&quot;, prompt: &quot;A model wearing a cozy knit sweater, perfect for a warm and stylish autumn look.&quot; }, { category: &quot;Sweaters&quot;, name: &quot;Turtleneck&quot;, prompt: &quot;A model in a chic turtleneck sweater, exuding sophistication and warmth.&quot; }, // Category: Traditional (Inferred) { category: &quot;Traditional&quot;, name: &quot;Kebaya&quot;, prompt: &quot;A model wearing a beautiful, intricate traditional Kebaya blouse, celebrating cultural heritage.&quot; }, { category: &quot;Traditional&quot;, name: &quot;Highland&quot;, prompt: &quot;A model dressed in Scottish Highland attire, featuring traditional tartan patterns.&quot; }, // Category: Bohemian (Inferred) { category: &quot;Bohemian&quot;, name: &quot;Bohemian&quot;, prompt: &quot;A model with a free-spirited bohemian look, featuring flowing fabrics and earthy tones.&quot; }, { category: &quot;Bohemian&quot;, name: &quot;Funky&quot;, prompt: &quot;A model in a funky, eclectic outfit with bold colors and unique patterns, expressing individuality.&quot; } ]; const suggestedOutfitPrompts = [ &quot;Vibrant balloons&quot;, &quot;Urban brick wall&quot;, &quot;Lush garden scene&quot;, &quot;Serene ocean view&quot;, &quot;Abstract painting&quot;, &quot;Graffiti-covered wall&quot;, &quot;Rustic barn&quot;, &quot;City skyline&quot;, &quot;Enchanting forest landscape&quot;, &quot;Majestic mountain range&quot; ]; const suggestedHairstylePrompts = [ &quot;long, wavy blonde hair&quot;, &quot;short spiky blue hair&quot;, &quot;elegant braided updo&quot;, &quot;modern curly pixie cut&quot;, &quot;fiery red bob with bangs&quot;, &quot;sleek high ponytail&quot;, &quot;cool dreadlocks with beads&quot;, &quot;classic silver gentleman cut&quot;, &quot;voluminous afro hairstyle&quot;, &quot;platinum blonde buzz cut&quot;, &quot;pastel pink shoulder-length hair&quot;, &quot;dark hair with subtle highlights&quot; ]; const aiFilterStyles = [ // Ghibli Category { id: &quot;ghibli-1&quot;, name: &quot;Inari&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/97040181-69e1-440d-9c44-45944dd8b8cd.jpg&quot;, prompt: &quot;A character portrait in the whimsical Ghibli art style, reminiscent of Inari shrines, detailed and enchanting.&quot; }, { id: &quot;ghibli-2&quot;, name: &quot;Shade&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5d3e262d-c4f0-45f6-a350-47552640cf03.png&quot;, prompt: &quot;A character portrait in the Ghibli art style, with dramatic shading and a mysterious atmosphere.&quot; }, { id: &quot;ghibli-3&quot;, name: &quot;Zenya&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/962a4918-202c-4a71-a27e-953807d1fd5c.jpg&quot;, prompt: &quot;A serene character portrait in the Ghibli art style, peaceful and elegant, with a Zen-like quality.&quot; }, { id: &quot;ghibli-4&quot;, name: &quot;Storm&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f80b85ab-ea22-40d0-9e91-3793b24d605c.jpg&quot;, prompt: &quot;A dynamic character portrait in the Ghibli art style, set during a dramatic storm, emotional and powerful.&quot; }, { id: &quot;ghibli-5&quot;, name: &quot;Noon&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b7497ed5-0d04-4334-9ca7-ec842cd4cdbb.jpg&quot;, prompt: &quot;A bright, sunlit character portrait in the Ghibli art style, capturing the warmth of noon.&quot; }, { id: &quot;ghibli-6&quot;, name: &quot;Luma&quot;, category: &quot;Ghibli&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dc63ecdf-c3f3-458a-ac3b-64c37a0b5a1e.jpg&quot;, prompt: &quot;A luminous character portrait in the Ghibli art style, with a soft, glowing light.&quot; }, // Accessories Category { id: &quot;accessories-1&quot;, name: &quot;Floral Crown&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294968955.jpg&quot;, prompt: &quot;A portrait of a person wearing a beautiful and delicate Floral Crown, bohemian and ethereal style.&quot; }, { id: &quot;accessories-2&quot;, name: &quot;Scarf&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294969683.jpg&quot;, prompt: &quot;A portrait of a person wearing a stylish Scarf, adding a touch of elegance or coziness.&quot; }, { id: &quot;accessories-3&quot;, name: &quot;Beanie&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967692.jpg&quot;, prompt: &quot;A portrait of a person wearing a cozy Beanie, casual and cool street style.&quot; }, { id: &quot;accessories-4&quot;, name: &quot;Bandana&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294966391.jpg&quot;, prompt: &quot;A portrait of a person wearing a cool Bandana, with a retro or edgy vibe.&quot; }, { id: &quot;accessories-5&quot;, name: &quot;Necklace&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294969331.jpg&quot;, prompt: &quot;A close-up portrait focusing on a person wearing an elegant Necklace.&quot; }, { id: &quot;accessories-6&quot;, name: &quot;Baseball Cap&quot;, category: &quot;Accessories&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967301.jpg&quot;, prompt: &quot;A portrait of a person wearing a sporty Baseball Cap, casual and relaxed.&quot; }, // Anime Category { id: &quot;anime-1&quot;, name: &quot;Gintocki&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531622371.jpg&quot;, prompt: &quot;A person transformed into the anime character Gintoki Sakata, with silver hair and samurai attire.&quot; }, { id: &quot;anime-2&quot;, name: &quot;H X H&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531620868.jpg&quot;, prompt: &quot;A person in the distinct art style of the anime Hunter x Hunter.&quot; }, { id: &quot;anime-3&quot;, name: &quot;Saitaama&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531619290.jpg&quot;, prompt: &quot;A person transformed into the anime character Saitama from One-Punch Man, bald and wearing his hero suit.&quot; }, { id: &quot;anime-4&quot;, name: &quot;Erren&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531617759.jpg&quot;, prompt: &quot;A person transformed into the anime character Eren Yeager from Attack on Titan, with intense eyes.&quot; }, { id: &quot;anime-5&quot;, name: &quot;Leloch&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531616067.jpg&quot;, prompt: &quot;A person transformed into the anime character Lelouch Lamperouge from Code Geass, with his Geass eye.&quot; }, { id: &quot;anime-6&quot;, name: &quot;Light&quot;, category: &quot;Anime&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531614532.jpg&quot;, prompt: &quot;A person transformed into the anime character Light Yagami from Death Note, with a cunning expression.&quot; }, // Vintage Category { id: &quot;vintage-1&quot;, name: &quot;1990s&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0d3d215d0cf645769449223588572076&quot;, prompt: &quot;A portrait in the style of the 1990s, with grunge or pop fashion and a film grain look.&quot; }, { id: &quot;vintage-2&quot;, name: &quot;Victorian&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/1a415a7a51bb436c841068395131c43e&quot;, prompt: &quot;An elegant portrait in the Victorian era style, with elaborate clothing and a formal setting.&quot; }, { id: &quot;vintage-3&quot;, name: &quot;1980s&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/9fe8f49883e548f88cf1364c52036685&quot;, prompt: &quot;A portrait with a vibrant 1980s aesthetic, big hair, neon colors, and retro vibes.&quot; }, { id: &quot;vintage-4&quot;, name: &quot;1950s&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/f99d72dbe94c498fb060d466a66b43f7&quot;, prompt: &quot;A classic portrait in the style of the 1950s, with pin-up or rockabilly fashion.&quot; }, { id: &quot;vintage-5&quot;, name: &quot;1920s&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/ab593ec4339f439195d1a139e7a967ad&quot;, prompt: &quot;A glamorous portrait in the style of the Roaring 1920s, with flapper dresses and art deco elements.&quot; }, { id: &quot;vintage-6&quot;, name: &quot;1990s&quot;, category: &quot;Vintage&quot;, imageUrl: &quot;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d47960ae2f8a4116aaebe364430cfa0d&quot;, prompt: &quot;A portrait with a distinct 1990s vibe, featuring baggy clothes and a cool, casual attitude.&quot; }, // Lights Category { id: &quot;lights-1&quot;, name: &quot;Sunset&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/964ca646-31ad-4e72-9768-5dd1ea831880.jpg&quot;, prompt: &quot;A portrait with beautiful sunset lighting, warm golden hour glow, dramatic colors.&quot; }, { id: &quot;lights-2&quot;, name: &quot;Laser&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f9a577ed-e548-4e61-a66d-352f023b35c1.jpg&quot;, prompt: &quot;A futuristic portrait with dramatic laser light effects, vibrant and energetic.&quot; }, { id: &quot;lights-3&quot;, name: &quot;Fireworks&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f0a43cd7-6541-4f75-bed7-972b9e0820e7.jpg&quot;, prompt: &quot;A celebratory portrait with a background of exploding fireworks, bright and colorful.&quot; }, { id: &quot;lights-4&quot;, name: &quot;Northern&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/4fc40ddf-2df9-4063-bce3-1c675b614a3a.jpg&quot;, prompt: &quot;A magical portrait with the Northern Lights (Aurora Borealis) in the sky.&quot; }, { id: &quot;lights-5&quot;, name: &quot;Bokeh&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/6574b9b8-188d-40c9-9835-6369f42403e5.jpg&quot;, prompt: &quot;A portrait with a beautiful bokeh effect, soft, out-of-focus lights in the background.&quot; }, { id: &quot;lights-6&quot;, name: &quot;Cinematic&quot;, category: &quot;Lights&quot;, imageUrl: &quot;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b08cd6bc-d8cc-4d33-a47f-57eb57dd3b6b.jpg&quot;, prompt: &quot;A portrait with dramatic cinematic lighting, high contrast and moody atmosphere.&quot; } ]; const filterCategories = [&quot;Ghibli&quot;, &quot;Accessories&quot;, &quot;Anime&quot;, &quot;Vintage&quot;, &quot;Lights&quot;]; const ToolPage = () =&gt; { const { toolId } = useParams(); const [selectedImage, setSelectedImage] = useState({ file: null, preview: null }); const [processedImage, setProcessedImage] = useState({ url: null, isLoading: false, error: null }); const imageRef = useRef(null); const visibleCanvasRef = useRef(null); const dataMaskCanvasRef = useRef(null); const [isDrawing, setIsDrawing] = useState(false); const [cleanupBrushSize, setCleanupBrushSize] = useState(20); const [canvasInitialized, setCanvasInitialized] = useState(false); const [isMaskDrawn, setIsMaskDrawn] = useState(false); const [padding, setPadding] = useState({ top: 50, left: 50, bottom: 50, right: 50 }); const replaceImageRef = useRef(null); const replaceVisibleCanvasRef = useRef(null); const replaceDataMaskCanvasRef = useRef(null); const [isReplaceDrawing, setIsReplaceDrawing] = useState(false); const [replaceBrushSize, setReplaceBrushSize] = useState(20); const [replaceCanvasInitialized, setReplaceCanvasInitialized] = useState(false); const [textPrompt, setTextPrompt] = useState(&quot;&quot;); const [cartoonTextPrompt, setCartoonTextPrompt] = useState(&quot;&quot;); const [cartoonStyleImage, setCartoonStyleImage] = useState(null); const [selectedGender, setSelectedGender] = useState(&quot;female&quot;); const [selectedPresetUrl, setSelectedPresetUrl] = useState(null); const [caricatureSelectedStyle, setCaricatureSelectedStyle] = useState(null); const [caricatureCustomStyleImage, setCaricatureCustomStyleImage] = useState(null); const [caricatureTextPrompt, setCaricatureTextPrompt] = useState(&quot;&quot;); const [avatarSelectedGender, setAvatarSelectedGender] = useState(&quot;male&quot;); const [avatarSelectedStyle, setAvatarSelectedStyle] = useState(null); const [avatarCustomStyleImage, setAvatarCustomStyleImage] = useState(null); const [avatarTextPrompt, setAvatarTextPrompt] = useState(&quot;&quot;); const [selectedProductStyle, setSelectedProductStyle] = useState(null); const [productCustomStyleImage, setProductCustomStyleImage] = useState(null); const [productTextPrompt, setProductTextPrompt] = useState(&quot;&quot;); const [backgroundTextPrompt, setBackgroundTextPrompt] = useState(&quot;&quot;); const [imageGeneratorTextPrompt, setImageGeneratorTextPrompt] = useState(&quot;&quot;); const [selectedResolution, setSelectedResolution] = useState(imageResolutions[0]); const [portraitSelectedGender, setPortraitSelectedGender] = useState(&quot;female&quot;); const [portraitSelectedStyle, setPortraitSelectedStyle] = useState(null); const [portraitCustomStyleImage, setPortraitCustomStyleImage] = useState(null); const [portraitTextPrompt, setPortraitTextPrompt] = useState(&quot;&quot;); const [faceSwapTargetImage, setFaceSwapTargetImage] = useState({ file: null, preview: null }); const [faceSwapSourceImage, setFaceSwapSourceImage] = useState({ file: null, preview: null }); const [selectedFaceSwapPreset, setSelectedFaceSwapPreset] = useState(null); const [outfitTextPrompt, setOutfitTextPrompt] = useState(&quot;&quot;); const [i2iMainImage, setI2iMainImage] = useState({ file: null, preview: null }); const [i2iStyleImage, setI2iStyleImage] = useState({ file: null, preview: null }); const [i2iTextPrompt, setI2iTextPrompt] = useState(&quot;&quot;); const [i2iStrength, setI2iStrength] = useState(0.5); const [i2iStyleStrength, setI2iStyleStrength] = useState(0.9); const [s2iInputMode, setS2iInputMode] = useState(&quot;upload&quot;); const [s2iSketchImage, setS2iSketchImage] = useState({ file: null, preview: null }); const [s2iStyleImage, setS2iStyleImage] = useState({ file: null, preview: null }); const [s2iTextPrompt, setS2iTextPrompt] = useState(&quot;&quot;); const [s2iStrength, setS2iStrength] = useState(0.8); const [s2iStyleStrength, setS2iStyleStrength] = useState(0.5); const drawingCanvasRef = useRef(null); const [isDrawingSketch, setIsDrawingSketch] = useState(false); const [s2iBrushSize, setS2iBrushSize] = useState(5); const [s2iBrushColor, setS2iBrushColor] = useState(&quot;#000000&quot;); const [hairstyleTextPrompt, setHairstyleTextPrompt] = useState(&quot;&quot;); const [upscaleFactor, setUpscaleFactor] = useState(2); const [imageDimensions, setImageDimensions] = useState(null); const [availableUpscaleOptions, setAvailableUpscaleOptions] = useState([2, 4]); const [filterSelectedCategory, setFilterSelectedCategory] = useState(&quot;Ghibli&quot;); const [filterSelectedStyle, setFilterSelectedStyle] = useState(null); const [filterCustomStyleImage, setFilterCustomStyleImage] = useState(null); const [filterTextPrompt, setFilterTextPrompt] = useState(&quot;&quot;); const [filterUseCustom, setFilterUseCustom] = useState(false); const tool = tools.find((t) =&gt; t.id === toolId); if (!tool) { return /* @__PURE__ */ jsx(Navigate, { to: &quot;/tools&quot;, replace: true }); } const handleImageSelect = (imageFile) =&gt; { setSelectedImage(imageFile); setProcessedImage({ url: null, isLoading: false, error: null }); setCanvasInitialized(false); setReplaceCanvasInitialized(false); setIsMaskDrawn(false); setImageDimensions(null); if (imageFile.file &amp;&amp; imageFile.preview) { const img = new Image(); img.onload = () =&gt; { const dimensions = { width: img.naturalWidth, height: img.naturalHeight }; console.log(&quot;Image dimensions:&quot;, dimensions); setImageDimensions(dimensions); const longestSide = Math.max(dimensions.width, dimensions.height); if (longestSide &gt; 2048) { setAvailableUpscaleOptions([]); setProcessedImage({ url: null, isLoading: false, error: &quot;Image is too large (max 2048px on longest side) and cannot be upscaled.&quot; }); } else if (longestSide &gt; 1024) { setAvailableUpscaleOptions([2]); setUpscaleFactor(2); } else { setAvailableUpscaleOptions([2, 4]); setUpscaleFactor(2); } }; img.src = imageFile.preview; } }; const handleAIFaceSwapGenerate = async () =&gt; { if (!faceSwapTargetImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload a target image.&quot; }); return; } if (!selectedFaceSwapPreset &amp;&amp; !faceSwapSourceImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a preset face or upload a source face image.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const targetImageUrl = await uploadImageAndGetUrl(faceSwapTargetImage.file); let sourceImageUrl; if (selectedFaceSwapPreset) { const sourceImageBlob = await convertUrlToBlob(selectedFaceSwapPreset.imageUrl); sourceImageUrl = await uploadImageAndGetUrl(new File([sourceImageBlob], &quot;source-face.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else { sourceImageUrl = await uploadImageAndGetUrl(faceSwapSourceImage.file); } const orderId = await startFaceSwapJob({ imageUrl: targetImageUrl, styleImageUrl: sourceImageUrl }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during face swap generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleCleanupImageLoad = (event) =&gt; { const image = event.target; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (dataCtx) { dataCtx.fillStyle = &quot;#000000&quot;; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setCanvasInitialized(true); }; const startDrawing = (e) =&gt; { if ((tool == null ? void 0 : tool.id) !== &quot;ai-cleanup&quot;) return; setIsDrawing(true); draw(e); }; const draw = (e) =&gt; { if (!isDrawing || (tool == null ? void 0 : tool.id) !== &quot;ai-cleanup&quot;) return; const { x, y } = getCoordinatesFromEvent(e.nativeEvent); drawAtPoint(x, y); }; const clearCanvas = () =&gt; { const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (dataCtx) { dataCtx.fillStyle = &quot;#000000&quot;; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } setIsMaskDrawn(false); }; const getCoordinatesFromEvent = (event) =&gt; { const canvas = visibleCanvasRef.current; if (!canvas) return { x: 0, y: 0 }; const rect = canvas.getBoundingClientRect(); return { x: event.clientX - rect.left, y: event.clientY - rect.top }; }; const drawAtPoint = (x, y) =&gt; { if (!visibleCanvasRef.current || !dataMaskCanvasRef.current || (tool == null ? void 0 : tool.id) !== &quot;ai-cleanup&quot;) return; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (!visibleCtx || !dataCtx) return; if (!isMaskDrawn) { setIsMaskDrawn(true); } visibleCtx.globalCompositeOperation = &quot;source-over&quot;; visibleCtx.fillStyle = &quot;rgba(255, 0, 0, 0.5)&quot;; visibleCtx.beginPath(); visibleCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); dataCtx.globalCompositeOperation = &quot;source-over&quot;; dataCtx.fillStyle = &quot;#FFFFFF&quot;; dataCtx.beginPath(); dataCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const handleDrawStart = (event) =&gt; { setIsDrawing(true); event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawMove = (event) =&gt; { if (!isDrawing) return; event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawEnd = () =&gt; { setIsDrawing(false); }; const handleCartoonClearSelection = () =&gt; { setSelectedPresetUrl(null); }; const handleCaricatureClearSelection = () =&gt; { setCaricatureSelectedStyle(null); }; const handleAvatarClearSelection = () =&gt; { setAvatarSelectedStyle(null); }; const handleFilterClearSelection = () =&gt; { setFilterSelectedStyle(null); }; const handleProductClearSelection = () =&gt; { setSelectedProductStyle(null); }; const handleReplaceImageLoad = (event) =&gt; { const image = event.target; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (dataCtx) { dataCtx.fillStyle = &quot;#000000&quot;; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setReplaceCanvasInitialized(true); }; const startReplaceDrawing = (e) =&gt; { if ((tool == null ? void 0 : tool.id) !== &quot;ai-replace&quot;) return; setIsReplaceDrawing(true); drawReplace(e); }; const drawReplace = (e) =&gt; { if (!isReplaceDrawing || !replaceVisibleCanvasRef.current || !replaceDataMaskCanvasRef.current || (tool == null ? void 0 : tool.id) !== &quot;ai-replace&quot;) return; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (!visibleCtx || !dataCtx) return; const rect = visibleCanvas.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; visibleCtx.globalCompositeOperation = &quot;source-over&quot;; visibleCtx.fillStyle = &quot;rgba(255, 0, 0, 0.5)&quot;; visibleCtx.beginPath(); visibleCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); dataCtx.globalCompositeOperation = &quot;source-over&quot;; dataCtx.fillStyle = &quot;#FFFFFF&quot;; dataCtx.beginPath(); dataCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const clearReplaceCanvas = () =&gt; { const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext(&quot;2d&quot;); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext(&quot;2d&quot;); if (dataCtx) { dataCtx.fillStyle = &quot;#000000&quot;; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } }; const replaceCanvasToFile = () =&gt; { return new Promise((resolve, reject) =&gt; { if (!replaceDataMaskCanvasRef.current) { reject(new Error(&quot;Canvas not found&quot;)); return; } replaceDataMaskCanvasRef.current.toBlob((blob) =&gt; { if (!blob) { reject(new Error(&quot;Failed to create blob from canvas&quot;)); return; } const file = new File([blob], &quot;mask.png&quot;, { type: &quot;image/png&quot; }); resolve(file); }, &quot;image/png&quot;); }); }; const canvasToFile = () =&gt; { return new Promise((resolve, reject) =&gt; { if (!dataMaskCanvasRef.current) { reject(new Error(&quot;Canvas not available&quot;)); return; } dataMaskCanvasRef.current.toBlob((blob) =&gt; { if (!blob) { reject(new Error(&quot;Failed to convert canvas to blob&quot;)); return; } const file = new File([blob], &quot;mask.png&quot;, { type: &quot;image/png&quot; }); resolve(file); }, &quot;image/png&quot;); }); }; const handleAICleanupGenerate = async () =&gt; { if (!selectedImage.file) return; if (!isMaskDrawn) { setProcessedImage({ url: null, isLoading: false, error: &quot;Error: Please paint over the area you want to clean up before generating.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalImageFile = selectedImage.file; const maskFile = await canvasToFile(); const originalFinalUrl = await uploadImageAndGetUrl(originalImageFile); const maskFinalUrl = await uploadImageAndGetUrl(maskFile); const orderId = await startCleanupJob({ originalImageUrl: originalFinalUrl, maskedImageUrl: maskFinalUrl }); if (!orderId) { throw new Error(&quot;Failed to start cleanup job&quot;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;AI Cleanup error:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &quot;An unexpected error occurred&quot; }); } }; const handleAIExpandGenerate = async () =&gt; { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startExpandJob({ imageUrl, padding }); if (!orderId) { throw new Error(&quot;Failed to start expand job&quot;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;AI Expand error:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &quot;An unexpected error occurred&quot; }); } }; const handleAIReplaceGenerate = async () =&gt; { if (!selectedImage.file || !textPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please provide both an image and a text prompt&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalImageUrl = await uploadImageAndGetUrl(selectedImage.file); const maskFile = await replaceCanvasToFile(); const maskedImageUrl = await uploadImageAndGetUrl(maskFile); console.log(&quot;Submitting to API with this prompt:&quot;, textPrompt); const orderId = await startReplaceJob({ originalImageUrl, maskedImageUrl, prompt: textPrompt }); if (!orderId) { throw new Error(&quot;Failed to start replace job&quot;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;AI Replace error:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &quot;An unexpected error occurred&quot; }); } }; const handleAICartoonGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ ...processedImage, error: &quot;Please select an image first.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleImageUrl = void 0; let finalPrompt = &quot;&quot;; if (selectedPresetUrl) { finalPrompt = &quot;cartoon style transformation&quot;; console.log(`Processing preset style from URL: ${selectedPresetUrl}`); const styleImageBlob = await convertUrlToBlob(selectedPresetUrl); finalStyleImageUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpg&quot;, { type: &quot;image/jpeg&quot; })); } else if (cartoonStyleImage) { finalPrompt = cartoonTextPrompt; console.log(&quot;Processing CUSTOM uploaded style image.&quot;); finalStyleImageUrl = await uploadImageAndGetUrl(cartoonStyleImage); } else { finalPrompt = cartoonTextPrompt; } console.log(&quot;Main URL:&quot;, mainImageUrl); console.log(&quot;Style URL:&quot;, finalStyleImageUrl); console.log(&quot;Text Prompt:&quot;, finalPrompt); const orderId = await startCartoonJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleImageUrl, textPrompt: finalPrompt || &quot;cartoon style transformation&quot; // ALWAYS send the prompt, never undefined }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAICaricatureGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } if (!caricatureSelectedStyle &amp;&amp; !caricatureCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a style image before generating.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = &quot;&quot;; if (caricatureSelectedStyle) { finalPrompt = caricatureSelectedStyle.prompt; console.log(`Processing PRESET style: ${caricatureSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(caricatureSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else if (caricatureCustomStyleImage) { finalPrompt = caricatureTextPrompt; console.log(&quot;Processing CUSTOM uploaded style image.&quot;); finalStyleUrl = await uploadImageAndGetUrl(caricatureCustomStyleImage); } const orderId = await startCaricatureJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;humorous artistic caricature&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during caricature generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAIAvatarGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } if (!avatarSelectedStyle &amp;&amp; !avatarCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a style before generating.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = &quot;&quot;; if (avatarSelectedStyle) { finalPrompt = avatarSelectedStyle.prompt; console.log(`Processing PRESET style: ${avatarSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(avatarSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else if (avatarCustomStyleImage) { finalPrompt = avatarTextPrompt; console.log(&quot;Processing CUSTOM uploaded style image.&quot;); finalStyleUrl = await uploadImageAndGetUrl(avatarCustomStyleImage); } const orderId = await startAvatarJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;A high-quality avatar&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during avatar generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAIPortraitGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } if (!portraitSelectedStyle &amp;&amp; !portraitCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a style before generating.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = &quot;&quot;; if (portraitSelectedStyle) { finalPrompt = portraitSelectedStyle.prompt; console.log(`Processing PRESET style: ${portraitSelectedStyle.name}`); const styleImageBlob = await convertUrlToBlob(portraitSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else if (portraitCustomStyleImage) { finalPrompt = portraitTextPrompt; console.log(&quot;Processing CUSTOM uploaded style image.&quot;); finalStyleUrl = await uploadImageAndGetUrl(portraitCustomStyleImage); } const orderId = await startPortraitJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;A high-quality portrait&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during portrait generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAIProductPhotoshootGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } if (!selectedProductStyle &amp;&amp; !productCustomStyleImage &amp;&amp; !productTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a style, upload a style image, or enter a text prompt.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = &quot;&quot;; if (selectedProductStyle) { finalPrompt = selectedProductStyle.prompt; console.log(`Processing PRESET style: ${selectedProductStyle.name}`); const styleImageBlob = await convertUrlToBlob(selectedProductStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else if (productCustomStyleImage) { finalPrompt = productTextPrompt; console.log(&quot;Processing CUSTOM uploaded style image.&quot;); finalStyleUrl = await uploadImageAndGetUrl(productCustomStyleImage); } else { finalPrompt = productTextPrompt; } const orderId = await startProductPhotoshootJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during product photo generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAIBackgroundGeneratorGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select an image first.&quot; }); return; } if (!backgroundTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a text prompt describing the background you want.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startBackgroundGeneratorJob({ imageUrl: mainImageUrl, textPrompt: backgroundTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during background generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const resizeImageToResolution = async (imageUrl, targetWidth, targetHeight) =&gt; { return new Promise((resolve) =&gt; { const canvas = document.createElement(&quot;canvas&quot;); const ctx = canvas.getContext(&quot;2d&quot;); const img = new Image(); img.onload = () =&gt; { canvas.width = targetWidth; canvas.height = targetHeight; ctx.drawImage(img, 0, 0, targetWidth, targetHeight); resolve(canvas.toDataURL(&quot;image/png&quot;)); }; img.crossOrigin = &quot;anonymous&quot;; img.src = imageUrl; }); }; const handleAIImageGeneratorGenerate = async () =&gt; { if (!imageGeneratorTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a text prompt describing the image you want to generate.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const orderId = await startImageGeneratorJob({ textPrompt: imageGeneratorTextPrompt, width: selectedResolution.width, height: selectedResolution.height }); const resultUrl = await pollJobUntilComplete(orderId); const resizedUrl = await resizeImageToResolution( resultUrl, selectedResolution.width, selectedResolution.height ); setProcessedImage({ url: resizedUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during image generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message || &quot;An unknown error occurred.&quot; }); } }; const handleAIOutfitGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload an image.&quot; }); return; } if (!outfitTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a text prompt describing the outfit you want.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startOutfitJob({ imageUrl, textPrompt: outfitTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during outfit generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIImageToImageGenerate = async () =&gt; { if (!i2iMainImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload a main image.&quot; }); return; } if (!i2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a text prompt describing the transformation you want.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(i2iMainImage.file); console.log(&quot;DEBUG: mainImageUrl after upload:&quot;, mainImageUrl); let styleImageUrl; if (i2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(i2iStyleImage.file); console.log(&quot;DEBUG: styleImageUrl after upload:&quot;, styleImageUrl); } const jobParams = { imageUrl: mainImageUrl, textPrompt: i2iTextPrompt, styleImageUrl, strength: i2iStrength, styleStrength: i2iStyleImage.file ? i2iStyleStrength : void 0 }; console.log(&quot;DEBUG: jobParams before API call:&quot;, jobParams); const orderId = await startImageToImageJob(jobParams); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during image-to-image generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAISketchToImageGenerate = async () =&gt; { if (s2iInputMode === &quot;upload&quot; &amp;&amp; !s2iSketchImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload a sketch image.&quot; }); return; } if (s2iInputMode === &quot;draw&quot;) { const canvas = drawingCanvasRef.current; if (!canvas) { setProcessedImage({ url: null, isLoading: false, error: &quot;Drawing canvas not available.&quot; }); return; } const ctx = canvas.getContext(&quot;2d&quot;); if (!ctx) { setProcessedImage({ url: null, isLoading: false, error: &quot;Cannot access drawing canvas.&quot; }); return; } const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const data = imageData.data; let hasDrawing = false; for (let i = 0; i &lt; data.length; i += 4) { if (data[i] !== 255 || data[i + 1] !== 255 || data[i + 2] !== 255) { hasDrawing = true; break; } } if (!hasDrawing) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please draw something on the canvas first.&quot; }); return; } } if (!s2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a text prompt describing the final image you want.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { let sketchImageUrl; if (s2iInputMode === &quot;upload&quot;) { sketchImageUrl = await uploadImageAndGetUrl(s2iSketchImage.file); } else { const canvas = drawingCanvasRef.current; const blob = await new Promise((resolve) =&gt; { canvas.toBlob((blob2) =&gt; resolve(blob2), &quot;image/png&quot;); }); sketchImageUrl = await uploadImageAndGetUrl(blob); } console.log(&quot;DEBUG: sketchImageUrl after upload:&quot;, sketchImageUrl); let styleImageUrl; if (s2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(s2iStyleImage.file); console.log(&quot;DEBUG: styleImageUrl after upload:&quot;, styleImageUrl); } const jobParams = { imageUrl: sketchImageUrl, textPrompt: s2iTextPrompt, strength: s2iStrength, styleImageUrl, styleStrength: s2iStyleImage.file ? s2iStyleStrength : void 0 }; console.log(&quot;DEBUG: sketch-to-image jobParams before API call:&quot;, jobParams); const orderId = await startSketchToImageJob(jobParams); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during sketch-to-image generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIHairstyleGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload an image.&quot; }); return; } if (!hairstyleTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please enter a hairstyle description.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const imageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startHairstyleJob({ imageUrl, textPrompt: hairstyleTextPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during hairstyle generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIUpscalerGenerate = async () =&gt; { if (!selectedImage.file) { return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startUpscaleJob({ imageUrl: mainImageUrl, quality: upscaleFactor }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during image upscaling:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleAIFilterGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload an image first.&quot; }); return; } if (!filterSelectedStyle &amp;&amp; !filterCustomStyleImage &amp;&amp; !filterTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a preset style, upload a custom style, or enter a text prompt.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); let finalStyleUrl = void 0; let finalPrompt = &quot;&quot;; if (filterSelectedStyle) { finalPrompt = filterSelectedStyle.name; const styleImageBlob = await convertUrlToBlob(filterSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &quot;image/jpeg&quot; })); } else if (filterCustomStyleImage) { finalPrompt = filterTextPrompt; finalStyleUrl = await uploadImageAndGetUrl(filterCustomStyleImage); } else { finalPrompt = filterTextPrompt; } const orderId = await startAIFilterJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during AI filter generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error.message }); } }; const handleProcessImage = async () =&gt; { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const resultUrl = await processImage(tool.apiEndpoint, selectedImage.file); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;Processing error:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &quot;An unexpected error occurred while processing the image&quot; }); } }; const handleDownload = () =&gt; { if (!processedImage.url) return; const link = document.createElement(&quot;a&quot;); link.href = processedImage.url; link.download = `${tool.id}-result.png`; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; useEffect(() =&gt; { return () =&gt; { if (processedImage.url) { URL.revokeObjectURL(processedImage.url); } }; }, [processedImage.url]); useEffect(() =&gt; { if (tool.id === &quot;ai-sketch-to-image&quot; &amp;&amp; s2iInputMode === &quot;draw&quot; &amp;&amp; drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const ctx = canvas.getContext(&quot;2d&quot;); if (ctx) { canvas.width = 512; canvas.height = 512; ctx.fillStyle = &quot;white&quot;; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.lineCap = &quot;round&quot;; ctx.lineJoin = &quot;round&quot;; } } }, [tool.id, s2iInputMode]); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: tool.name, description: `${tool.description}. Free online tool with instant results.` } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;text-center mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-3xl md:text-4xl font-bold text-gray-900 mb-4&quot;, children: tool.name }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;, children: tool.description }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h2&quot;, { className: &quot;text-xl font-semibold mb-4&quot;, children: [ &quot;How to use &quot;, tool.name ] }), /* @__PURE__ */ jsx(&quot;ol&quot;, { className: &quot;list-decimal list-inside space-y-2 text-gray-700&quot;, children: tool.id === &quot;ai-cleanup&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use the brush tool to paint over areas you want to remove&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust brush size as needed for precision&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI intelligently fill the painted areas&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your enhanced image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-expand&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust the padding values to specify how much to expand each side&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI expand your image with new content&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your expanded image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-replace&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use the brush tool to paint over areas you want to replace&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a text prompt describing what you want in the painted areas&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust brush size as needed for precision&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI replace the painted areas with your prompt&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your enhanced image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-cartoon&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your photo using the tool below (works best with human faces)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose your stylization method: describe a style with text OR upload a style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;If using text: describe the cartoon style you want (e.g., &quot;anime style&quot;, &quot;Disney cartoon&quot;)&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;If using a style image: upload a reference image with the desired artistic style&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to transform your photo into cartoon artwork&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your cartoonized image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-avatar&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a clear photo of a human face using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Select your gender to see appropriate avatar styles&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose from preset professional avatar styles OR upload your own style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Optionally add a text prompt to customize the avatar further&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to create your professional avatar&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your avatar when processing is complete&quot; }) ] }) : tool.id === &quot;ai-portrait&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a clear photo of a person&#x27;s face using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Select your gender to see appropriate portrait styles&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose from preset realistic portrait styles OR upload your own style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use suggested prompts or add your own text prompt to customize the portrait&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to create your realistic portrait&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your portrait when processing is complete&quot; }) ] }) : tool.id === &quot;ai-face-swap&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a target image (the photo you want to modify) using the first dropzone&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Either choose a preset face from the gallery OR upload your own source face image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to swap the faces&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your face-swapped image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-product-photoshoot&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a clear photo of your product using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose from preset professional photoshoot styles OR upload your own style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Optionally add a text prompt to describe the desired scene or background&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to create your professional product photo&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your enhanced product photo when processing is complete&quot; }) ] }) : tool.id === &quot;ai-background-generator&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a text prompt describing the background you want to generate&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Be specific about scenes, settings, colors, textures, and style preferences&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI create a custom background for your image&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your enhanced image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-image-generator&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Select your desired image resolution from the available options&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a detailed text prompt describing the image you want to create&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use suggested prompts for inspiration or create your own custom description&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Be specific about style, colors, composition, and artistic elements&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI create your unique image&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your generated image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-outfit&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a clear photo of a person using the tool below&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose from preset outfit styles organized by category OR use suggested prompts&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a detailed text prompt describing the outfit you want to apply&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Be specific about clothing type, style, colors, and materials&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI change the outfit in your photo&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your transformed image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-image-to-image&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your main image that you want to transform&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Optionally upload a style reference image for visual guidance&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust the Image Strength slider to control how much the result resembles your main image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust the Style Strength slider to control how much the result follows your style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a detailed text prompt describing the transformation you want&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to let AI transform your image based on your prompt and settings&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your transformed image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-sketch-to-image&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Choose to either draw your sketch or upload an existing sketch image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;If drawing: Use the canvas to create your sketch with the drawing tools&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;If uploading: Select your sketch image file&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Enter a detailed text prompt describing the final image you want to create&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Optionally upload a style reference image for visual guidance&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust the Sketch Adherence slider to control how closely AI follows your sketch&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Adjust the Style Strength slider if using a style image&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to transform your sketch into a rendered image&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your transformed image when processing is complete&quot; }) ] }) : tool.id === &quot;ai-hairstyle&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload a clear, front-facing photo of yourself or someone else&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Describe the hairstyle you want to try on in the text box&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Or click on one of the suggested hairstyle prompts for inspiration&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to see the new hairstyle applied to your photo&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your result when processing is complete&quot; }) ] }) : tool.id === &quot;ai-image-upscaler&quot; ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below (max 2048px on longest side)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Select an upscale factor (2x or 4x) based on your image size&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Click &quot;Generate&quot; to enhance your image with AI upscaling&#x27; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your high-resolution result when processing is complete&quot; }) ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload your image using the tool below&quot; }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ &#x27;Click the &quot;&#x27;, tool.name, &#x27;&quot; button to process your image&#x27; ] }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Wait for the AI to work its magic&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Download your result when processing is complete&quot; }) ] }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;grid grid-cols-1 md:grid-cols-2 gap-8&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ tool.id !== &quot;ai-image-generator&quot; &amp;&amp; tool.id !== &quot;ai-face-swap&quot; &amp;&amp; tool.id !== &quot;ai-image-to-image&quot; &amp;&amp; tool.id !== &quot;ai-sketch-to-image&quot; &amp;&amp; /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: handleImageSelect, selectedImage } ), tool.id === &quot;ai-face-swap&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-medium mb-2&quot;, children: &quot;1. Upload Target Image&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;The photo you want to modify&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setFaceSwapTargetImage(imageFile), selectedImage: faceSwapTargetImage } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-medium mb-2&quot;, children: &quot;2. Upload Source Face Image&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;The face you want to use (disabled if preset selected)&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setFaceSwapSourceImage(imageFile), selectedImage: faceSwapSourceImage, disabled: !!selectedFaceSwapPreset } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-medium mb-2&quot;, children: &quot;Or Choose a Preset Source Face&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;, children: faceSwapStyles.map((style) =&gt; { const isSelected = (selectedFaceSwapPreset == null ? void 0 : selectedFaceSwapPreset.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, onClick: () =&gt; { setSelectedFaceSwapPreset(style); setFaceSwapSourceImage({ file: null, preview: null }); }, children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); setSelectedFaceSwapPreset(null); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx(&quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-auto object-cover&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-center text-xs p-1 bg-gray-100&quot;, children: style.name }) ] }, style.imageUrl ); }) }) ] }) ] }), tool.id === &quot;ai-cleanup&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center gap-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;flex items-center gap-2&quot;, children: [ /* @__PURE__ */ jsx(Brush, { className: &quot;w-4 h-4&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm font-medium&quot;, children: &quot;Brush Size:&quot; }) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;5&quot;, max: &quot;50&quot;, value: cleanupBrushSize, onChange: (e) =&gt; setCleanupBrushSize(Number(e.target.value)), className: &quot;flex-1&quot; } ), /* @__PURE__ */ jsxs(&quot;span&quot;, { className: &quot;text-sm text-gray-600 w-8&quot;, children: [ cleanupBrushSize, &quot;px&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden&quot;, style: { display: &quot;inline-block&quot; }, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { ref: imageRef, src: selectedImage.preview, alt: &quot;Selected&quot;, className: &quot;w-full h-auto&quot;, draggable: false, onLoad: handleCleanupImageLoad, style: { maxWidth: &quot;100%&quot;, display: &quot;block&quot; } } ), /* @__PURE__ */ jsx( &quot;canvas&quot;, { ref: visibleCanvasRef, className: &quot;absolute top-0 left-0 cursor-crosshair&quot;, onMouseDown: startDrawing, onMouseMove: draw, onMouseUp: () =&gt; setIsDrawing(false), onMouseLeave: () =&gt; setIsDrawing(false), onTouchStart: handleDrawStart, onTouchMove: handleDrawMove, onTouchEnd: handleDrawEnd, style: { zIndex: 10 } } ), /* @__PURE__ */ jsx( &quot;canvas&quot;, { ref: dataMaskCanvasRef, style: { display: &quot;none&quot; } } ) ] }), /* @__PURE__ */ jsx( Button, { variant: &quot;outline&quot;, onClick: clearCanvas, className: &quot;w-full&quot;, children: &quot;Clear Mask&quot; } ) ] }), tool.id === &quot;ai-expand&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-medium&quot;, children: &quot;Padding Settings&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600&quot;, children: &quot;Specify how many pixels to add to each side of your image.&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;grid grid-cols-2 gap-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-1&quot;, children: &quot;Top Padding&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;number&quot;, min: &quot;0&quot;, max: &quot;500&quot;, value: padding.top, onChange: (e) =&gt; setPadding((prev) =&gt; ({ ...prev, top: Number(e.target.value) })), className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-1&quot;, children: &quot;Bottom Padding&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;number&quot;, min: &quot;0&quot;, max: &quot;500&quot;, value: padding.bottom, onChange: (e) =&gt; setPadding((prev) =&gt; ({ ...prev, bottom: Number(e.target.value) })), className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-1&quot;, children: &quot;Left Padding&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;number&quot;, min: &quot;0&quot;, max: &quot;500&quot;, value: padding.left, onChange: (e) =&gt; setPadding((prev) =&gt; ({ ...prev, left: Number(e.target.value) })), className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-1&quot;, children: &quot;Right Padding&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;number&quot;, min: &quot;0&quot;, max: &quot;500&quot;, value: padding.right, onChange: (e) =&gt; setPadding((prev) =&gt; ({ ...prev, right: Number(e.target.value) })), className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; } ) ] }) ] }) ] }), tool.id === &quot;ai-background-generator&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Background Description&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: backgroundTextPrompt, onChange: (e) =&gt; setBackgroundTextPrompt(e.target.value), placeholder: &quot;Describe the background you want to generate (e.g., &#x27;sunset beach with palm trees&#x27;, &#x27;modern office interior&#x27;, &#x27;mountain landscape with snow&#x27;)...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 4 } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-xs text-blue-700 space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Be specific about the scene or setting you want&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Include details about lighting, colors, and mood&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Mention the style (realistic, artistic, vintage, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;โ€ข Example: &quot;Professional studio with soft lighting and neutral background&quot;&#x27; }) ] }) ] }) ] }), tool.id === &quot;ai-replace&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center gap-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;flex items-center gap-2&quot;, children: [ /* @__PURE__ */ jsx(Brush, { className: &quot;w-4 h-4&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm font-medium&quot;, children: &quot;Brush Size:&quot; }) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;5&quot;, max: &quot;50&quot;, value: replaceBrushSize, onChange: (e) =&gt; setReplaceBrushSize(Number(e.target.value)), className: &quot;flex-1&quot; } ), /* @__PURE__ */ jsxs(&quot;span&quot;, { className: &quot;text-sm text-gray-600 w-8&quot;, children: [ replaceBrushSize, &quot;px&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Text Prompt&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: textPrompt, onChange: (e) =&gt; setTextPrompt(e.target.value), placeholder: &quot;Describe what you want to replace the painted areas with...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 3 } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm text-gray-600 mb-2 block&quot;, children: &quot;Try an example:&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex flex-wrap gap-2&quot;, children: [ /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setTextPrompt(&quot;A beautiful cherry blossom tree&quot;), className: &quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot;, children: &quot;Cherry Blossom Tree&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setTextPrompt(&quot;Sunglasses with a futuristic design, cyberpunk style&quot;), className: &quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot;, children: &quot;Futuristic Sunglasses&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setTextPrompt(&quot;A classic red brick wall&quot;), className: &quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot;, children: &quot;Red Brick Wall&quot; } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden&quot;, style: { display: &quot;inline-block&quot; }, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { ref: replaceImageRef, src: selectedImage.preview, alt: &quot;Selected&quot;, className: &quot;w-full h-auto&quot;, draggable: false, onLoad: handleReplaceImageLoad, style: { maxWidth: &quot;100%&quot;, display: &quot;block&quot; } } ), /* @__PURE__ */ jsx( &quot;canvas&quot;, { ref: replaceVisibleCanvasRef, className: &quot;absolute top-0 left-0 cursor-crosshair&quot;, onMouseDown: startReplaceDrawing, onMouseMove: drawReplace, onMouseUp: () =&gt; setIsReplaceDrawing(false), onMouseLeave: () =&gt; setIsReplaceDrawing(false), style: { zIndex: 10, opacity: 0.5 } } ), /* @__PURE__ */ jsx( &quot;canvas&quot;, { ref: replaceDataMaskCanvasRef, style: { display: &quot;none&quot; } } ) ] }), /* @__PURE__ */ jsx( Button, { variant: &quot;outline&quot;, onClick: clearReplaceCanvas, className: &quot;w-full&quot;, children: &quot;Clear Mask&quot; } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-yellow-50 border border-yellow-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-yellow-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Important Note:&quot; }), &quot; This tool generates a new image from your text. For best results:&quot; ] }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-sm text-yellow-800 mt-2 ml-4 list-disc space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: `Describe what you want to see, don&#x27;t give commands. (e.g., say &quot;a tall sunflower,&quot; not &quot;replace this with a sunflower&quot;).` }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;The AI works best on images containing human faces. Results on objects or landscapes may vary.&quot; }) ] }) ] }) ] }), tool.id === &quot;ai-cartoon&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Select Persona&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex gap-4&quot;, children: [ /* @__PURE__ */ jsx( Button, { variant: selectedGender === &quot;female&quot; ? &quot;primary&quot; : &quot;outline&quot;, onClick: () =&gt; setSelectedGender(&quot;female&quot;), children: &quot;Female&quot; } ), /* @__PURE__ */ jsx( Button, { variant: selectedGender === &quot;male&quot; ? &quot;primary&quot; : &quot;outline&quot;, onClick: () =&gt; setSelectedGender(&quot;male&quot;), children: &quot;Male&quot; } ) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Choose a Preset Style&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;, children: (selectedGender === &quot;female&quot; ? femaleCartoonStyles : maleCartoonStyles).map((style) =&gt; { const isSelected = selectedPresetUrl === style.imageUrl; return /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, onClick: () =&gt; setSelectedPresetUrl(style.imageUrl), children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); handleCartoonClearSelection(); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx(&quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-auto object-cover&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-center text-xs p-1 bg-gray-100&quot;, children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm font-medium text-gray-700 text-center&quot;, children: &quot;Or Use a Custom Style&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Upload a Style Image&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; return setCartoonStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, disabled: !!selectedPresetUrl } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Describe a Style with Text&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: cartoonTextPrompt, onChange: (e) =&gt; setCartoonTextPrompt(e.target.value), placeholder: &quot;e.g., &#x27;anime style&#x27;, &#x27;Disney cartoon&#x27;...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 2, disabled: !!selectedPresetUrl } ) ] }) ] }) ] }), tool.id === &quot;ai-caricature&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-yellow-50 border border-yellow-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-yellow-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; This tool works best with clear photos of human faces. Results on other subjects may vary.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Choose a Preset Style&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;, children: caricatureStyles.map((style) =&gt; { const isSelected = (caricatureSelectedStyle == null ? void 0 : caricatureSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, onClick: () =&gt; setCaricatureSelectedStyle(style), children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); handleCaricatureClearSelection(); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx(&quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-auto object-cover&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-center text-xs p-1 bg-gray-100&quot;, children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm font-medium text-gray-700 text-center&quot;, children: &quot;Or Use a Custom Style&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Upload a Style Image&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; return setCaricatureCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, disabled: !!caricatureSelectedStyle } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Describe a Style with Text&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: caricatureTextPrompt, onChange: (e) =&gt; setCaricatureTextPrompt(e.target.value), placeholder: &quot;Optional: Add descriptive text to modify your chosen style...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 2, disabled: !!caricatureSelectedStyle } ) ] }) ] }) ] }), tool.id === &quot;ai-avatar&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-blue-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; This tool generates the best avatars from a single, clear photo of a human face.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Select Gender&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex space-x-4&quot;, children: [ /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setAvatarSelectedGender(&quot;male&quot;), className: `px-4 py-2 rounded-md border ${avatarSelectedGender === &quot;male&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Male&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setAvatarSelectedGender(&quot;female&quot;), className: `px-4 py-2 rounded-md border ${avatarSelectedGender === &quot;female&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Female&quot; } ) ] }) ] }), avatarSelectedGender &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Choose a Preset Style&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;, children: avatarStyles.filter((style) =&gt; style.gender === avatarSelectedGender).map((style) =&gt; { const isSelected = (avatarSelectedStyle == null ? void 0 : avatarSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, onClick: () =&gt; setAvatarSelectedStyle(style), children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); handleAvatarClearSelection(); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx(&quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-auto object-cover&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-center text-xs p-1 bg-gray-100&quot;, children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm font-medium text-gray-700 text-center&quot;, children: &quot;Or Use a Custom Style&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Upload a Style Image&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; return setAvatarCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, disabled: !!avatarSelectedStyle } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Text Prompt (Optional)&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: avatarTextPrompt, onChange: (e) =&gt; setAvatarTextPrompt(e.target.value), placeholder: &quot;Optional: Describe the avatar style you want...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 2 } ) ] }) ] }) ] }), tool.id === &quot;ai-portrait&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-purple-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; For best results, use a clear photo of a person&#x27;s face.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Select Gender&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex space-x-4&quot;, children: [ /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setPortraitSelectedGender(&quot;female&quot;), className: `px-4 py-2 rounded-md border ${portraitSelectedGender === &quot;female&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Female&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setPortraitSelectedGender(&quot;male&quot;), className: `px-4 py-2 rounded-md border ${portraitSelectedGender === &quot;male&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Male&quot; } ) ] }) ] }), portraitSelectedGender &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Choose a Preset Style&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;, children: portraitStyles.filter((style) =&gt; style.gender === portraitSelectedGender).map((style) =&gt; { const isSelected = (portraitSelectedStyle == null ? void 0 : portraitSelectedStyle.imageUrl) === style.imageUrl; return /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, onClick: () =&gt; setPortraitSelectedStyle(style), children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); setPortraitSelectedStyle(null); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx(&quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-auto object-cover&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-center text-xs p-1 bg-gray-100&quot;, children: style.name }) ] }, style.imageUrl ); }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Suggested Prompts&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex flex-wrap gap-2 mb-4&quot;, children: suggestedPortraitPrompts.map((prompt) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { onClick: () =&gt; setPortraitTextPrompt(prompt), className: &quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot;, children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm font-medium text-gray-700 text-center&quot;, children: &quot;Or Use a Custom Style&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Upload a Style Image&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; return setPortraitCustomStyleImage(((_a = e.target.files) == null ? void 0 : _a[0]) || null); }, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, disabled: !!portraitSelectedStyle } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Text Prompt&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: portraitTextPrompt, onChange: (e) =&gt; setPortraitTextPrompt(e.target.value), placeholder: &quot;Describe the portrait style you want...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 2, disabled: !!portraitSelectedStyle } ) ] }) ] }) ] }), tool.id === &quot;ai-product-photoshoot&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-green-50 border border-green-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-green-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; This tool works best with clear product photos on neutral backgrounds.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-4&quot;, children: &quot;Choose a Style&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 max-h-96 overflow-y-auto&quot;, children: productStyles.map((style) =&gt; { const isSelected = (selectedProductStyle == null ? void 0 : selectedProductStyle.name) === style.name; return /* @__PURE__ */ jsxs( &quot;div&quot;, { onClick: () =&gt; { setSelectedProductStyle(style); setProductCustomStyleImage(null); }, className: `relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${isSelected ? &quot;border-blue-500 shadow-lg&quot; : &quot;border-transparent hover:border-gray-300&quot;}`, children: [ isSelected &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); handleProductClearSelection(); }, className: &quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot;, &quot;aria-label&quot;: &quot;Clear selection&quot;, children: /* @__PURE__ */ jsx(XCircle, { size: 20 }) } ), /* @__PURE__ */ jsx( &quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-24 object-cover&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;p-2 bg-gray-50&quot;, children: /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm font-medium text-center&quot;, children: style.name }) }) ] }, style.name ); }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-4&quot;, children: &quot;Or Upload a Custom Style Image&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; const file = ((_a = e.target.files) == null ? void 0 : _a[0]) || null; setProductCustomStyleImage(file); if (file) { setSelectedProductStyle(null); } }, className: &quot;block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100&quot; } ), productCustomStyleImage &amp;&amp; /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;mt-2 text-sm text-green-600&quot;, children: [ &quot;Custom style image selected: &quot;, productCustomStyleImage.name ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-4&quot;, children: &quot;Don&#x27;t have a style? Try these prompts&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex flex-wrap gap-2 mb-4&quot;, children: suggestedPrompts$1.map((prompt) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { onClick: () =&gt; setProductTextPrompt(prompt), className: &quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot;, children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Text Prompt (Optional)&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: productTextPrompt, onChange: (e) =&gt; setProductTextPrompt(e.target.value), placeholder: &quot;Describe the style or setting you want for your product photo...&quot;, className: &quot;w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent&quot;, rows: 3 } ) ] }) ] }), tool.id === &quot;ai-background-generator&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Background Description&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: backgroundTextPrompt, onChange: (e) =&gt; setBackgroundTextPrompt(e.target.value), placeholder: &quot;Describe the background you want to generate...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 3 } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm text-gray-600 mb-2 block&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-sm text-gray-600 ml-4 list-disc space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Be specific about scenes, settings, colors, and textures&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Mention lighting conditions (bright, soft, dramatic, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Include style preferences (realistic, artistic, vintage, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &#x27;Example: &quot;Professional studio with soft lighting and neutral background&quot;&#x27; }) ] }) ] }) ] }) }), tool.id === &quot;ai-image-generator&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-3&quot;, children: &quot;Image Resolution&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3&quot;, children: imageResolutions.map((resolution) =&gt; /* @__PURE__ */ jsxs( &quot;div&quot;, { className: `cursor-pointer p-3 border-2 rounded-lg transition-colors ${selectedResolution.width === resolution.width &amp;&amp; selectedResolution.height === resolution.height ? &quot;border-blue-500 bg-blue-50&quot; : &quot;border-gray-200 hover:border-gray-300&quot;}`, onClick: () =&gt; setSelectedResolution(resolution), children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-sm font-medium&quot;, children: resolution.name }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-xs text-gray-500&quot;, children: resolution.aspectRatio }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;text-xs text-gray-400&quot;, children: [ resolution.width, &quot;x&quot;, resolution.height, &quot; px&quot; ] }) ] }, `${resolution.width}x${resolution.height}` )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Image Description&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: imageGeneratorTextPrompt, onChange: (e) =&gt; setImageGeneratorTextPrompt(e.target.value), placeholder: &quot;Describe the image you want to generate in detail (e.g., &#x27;a majestic mountain landscape at sunset&#x27;, &#x27;portrait of a cat wearing sunglasses&#x27;, &#x27;abstract digital art with vibrant colors&#x27;)...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 4 } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-xs text-blue-700 space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Be specific about style, colors, composition, and artistic elements&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Include details about lighting, mood, and atmosphere&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Mention art styles (realistic, cartoon, anime, oil painting, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Add quality descriptors (high quality, detailed, masterpiece, etc.)&quot; }) ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-3&quot;, children: &quot;Suggested Prompts&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-1 gap-2 max-h-64 overflow-y-auto&quot;, children: suggestedPrompts.map((prompt, index) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setImageGeneratorTextPrompt(prompt), className: &quot;text-left px-3 py-2 text-sm bg-gray-50 hover:bg-gray-100 rounded-md border transition-colors&quot;, children: prompt }, index )) }) ] }) ] }), tool.id === &quot;ai-outfit&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-purple-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; This tool works best with clear photos of people wearing clothing.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-4&quot;, children: &quot;Choose an Outfit Style&quot; }), Object.entries( presetOutfitStyles.reduce((acc, style) =&gt; { if (!acc[style.category]) acc[style.category] = []; acc[style.category].push(style); return acc; }, {}) ).map(([category, styles]) =&gt; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mb-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-md font-medium text-gray-700 mb-3&quot;, children: category }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3&quot;, children: styles.map((style) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { onClick: () =&gt; setOutfitTextPrompt(style.prompt), className: &quot;p-3 text-left bg-gray-50 hover:bg-gray-100 rounded-lg border transition-colors&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-sm font-medium&quot;, children: style.name }) }, style.name )) }) ] }, category)) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-4&quot;, children: &quot;Suggested Outfit Ideas&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex flex-wrap gap-2 mb-4&quot;, children: suggestedOutfitPrompts.map((prompt) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { onClick: () =&gt; setOutfitTextPrompt(prompt), className: &quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot;, children: prompt }, prompt )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Outfit Description&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: outfitTextPrompt, onChange: (e) =&gt; setOutfitTextPrompt(e.target.value), placeholder: &quot;Describe the outfit you want to apply (e.g., &#x27;elegant black evening dress&#x27;, &#x27;casual denim jacket and jeans&#x27;, &#x27;professional business suit&#x27;)...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 4 } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-xs text-blue-700 space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Be specific about clothing type, style, colors, and materials&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Include details about fit and silhouette (loose, fitted, flowing, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Mention specific garments (dress, shirt, pants, jacket, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Add style descriptors (casual, formal, vintage, modern, etc.)&quot; }) ] }) ] }) ] }) ] }), tool.id === &quot;ai-image-to-image&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-blue-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; Upload a main image to transform and optionally a style reference image for visual guidance.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-2&quot;, children: &quot;1. Main Image&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;The image you want to transform&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setI2iMainImage(imageFile), selectedImage: i2iMainImage } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-2&quot;, children: &quot;2. Style Reference Image (Optional)&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;Upload an image to use as style guidance&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setI2iStyleImage(imageFile), selectedImage: i2iStyleImage } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: [ &quot;Image Strength: &quot;, i2iStrength.toFixed(1) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;0&quot;, max: &quot;1&quot;, step: &quot;0.1&quot;, value: i2iStrength, onChange: (e) =&gt; setI2iStrength(Number(e.target.value)), className: &quot;w-full&quot; } ), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs text-gray-500 mt-1&quot;, children: &quot;Higher strength makes the result look more like your main image&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center gap-2 mb-2&quot;, children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;text-sm font-medium text-gray-700&quot;, children: [ &quot;Style Strength: &quot;, i2iStyleStrength.toFixed(1) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;relative group&quot;, children: [ /* @__PURE__ */ jsx(HelpCircle, { className: &quot;w-4 h-4 text-gray-400 cursor-help&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10&quot;, children: [ &quot;Slider is disabled if no style image has been uploaded&quot;, /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800&quot; }) ] }) ] }) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;0&quot;, max: &quot;1&quot;, step: &quot;0.1&quot;, value: i2iStyleStrength, onChange: (e) =&gt; setI2iStyleStrength(Number(e.target.value)), disabled: !i2iStyleImage.file, className: &quot;w-full disabled:opacity-50 disabled:cursor-not-allowed&quot; } ), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-xs text-gray-500 mt-1&quot;, children: [ &quot;Higher strength makes the result look more like your style image&quot;, !i2iStyleImage.file &amp;&amp; &quot; (disabled - upload a style image first)&quot; ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Enter Prompt *&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: i2iTextPrompt, onChange: (e) =&gt; setI2iTextPrompt(e.target.value), placeholder: &quot;Describe the final image you want to create (e.g., &#x27;turn this into a watercolor painting&#x27;, &#x27;make it look like a vintage photograph&#x27;, &#x27;transform into a cyberpunk scene&#x27;)...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 4, required: true } ), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-3 bg-green-50 border border-green-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-green-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-xs text-green-700 space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Be specific about the style, mood, or transformation you want&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Mention artistic styles (watercolor, oil painting, digital art, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Include lighting and atmosphere details (dramatic, soft, bright, etc.)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Use the Image Strength slider to control how much of the original to keep&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Use the Style Strength slider to control style reference influence&quot; }) ] }) ] }) ] }) ] }), tool.id === &quot;ai-sketch-to-image&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;, children: /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-purple-800&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Note:&quot; }), &quot; Create or upload a sketch, then describe the final image you want to generate.&quot; ] }) }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-3&quot;, children: &quot;1. Choose Input Method&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex space-x-4&quot;, children: [ /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setS2iInputMode(&quot;upload&quot;), className: `px-4 py-2 rounded-md border ${s2iInputMode === &quot;upload&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Upload Sketch&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setS2iInputMode(&quot;draw&quot;), className: `px-4 py-2 rounded-md border ${s2iInputMode === &quot;draw&quot; ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: &quot;Draw Sketch&quot; } ) ] }) ] }), s2iInputMode === &quot;upload&quot; ? /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-2&quot;, children: &quot;2. Upload Your Sketch&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;Upload an existing sketch or drawing&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setS2iSketchImage(imageFile), selectedImage: s2iSketchImage } ) ] }) : /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-2&quot;, children: &quot;2. Draw Your Sketch&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;Use the canvas below to draw your sketch&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center gap-4 mb-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;flex items-center gap-2&quot;, children: /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm font-medium&quot;, children: &quot;Brush Size:&quot; }) }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;1&quot;, max: &quot;20&quot;, value: s2iBrushSize, onChange: (e) =&gt; setS2iBrushSize(Number(e.target.value)), className: &quot;flex-1&quot; } ), /* @__PURE__ */ jsxs(&quot;span&quot;, { className: &quot;text-sm text-gray-600 w-8&quot;, children: [ s2iBrushSize, &quot;px&quot; ] }), /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;flex items-center gap-2&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-sm font-medium&quot;, children: &quot;Color:&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;color&quot;, value: s2iBrushColor, onChange: (e) =&gt; setS2iBrushColor(e.target.value), className: &quot;w-8 h-8 rounded border&quot; } ) ] }), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; { const canvas = drawingCanvasRef.current; if (canvas) { const ctx = canvas.getContext(&quot;2d&quot;); if (ctx) { ctx.fillStyle = &quot;white&quot;; ctx.fillRect(0, 0, canvas.width, canvas.height); } } }, className: &quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded border&quot;, children: &quot;Clear&quot; } ) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;border-2 border-gray-300 rounded-lg overflow-hidden&quot;, children: /* @__PURE__ */ jsx( &quot;canvas&quot;, { ref: drawingCanvasRef, width: 400, height: 400, className: &quot;w-full h-auto cursor-crosshair bg-white&quot;, onMouseDown: (e) =&gt; { setIsDrawingSketch(true); const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&quot;2d&quot;); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }, onMouseMove: (e) =&gt; { if (!isDrawingSketch) return; const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&quot;2d&quot;); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = &quot;round&quot;; ctx.stroke(); } } }, onMouseUp: () =&gt; setIsDrawingSketch(false), onMouseLeave: () =&gt; setIsDrawingSketch(false) } ) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;3. Describe the Final Image *&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: s2iTextPrompt, onChange: (e) =&gt; setS2iTextPrompt(e.target.value), placeholder: &quot;Describe the final image you want to create from your sketch (e.g., &#x27;a realistic portrait of a woman&#x27;, &#x27;a fantasy castle in a magical forest&#x27;, &#x27;a modern car design&#x27;)...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 4, required: true } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-semibold mb-2&quot;, children: &quot;4. Style Reference Image &quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600 mb-3&quot;, children: &quot;Upload an image to use as style guidance&quot; }), /* @__PURE__ */ jsx( ImageDropzone, { onImageSelect: (imageFile) =&gt; setS2iStyleImage(imageFile), selectedImage: s2iStyleImage } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: [ &quot;Sketch Adherence: &quot;, s2iStrength.toFixed(1) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;0&quot;, max: &quot;1&quot;, step: &quot;0.1&quot;, value: s2iStrength, onChange: (e) =&gt; setS2iStrength(Number(e.target.value)), className: &quot;w-full&quot; } ), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs text-gray-500 mt-1&quot;, children: &quot;Higher values make the result follow your sketch more closely&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center gap-2 mb-2&quot;, children: [ /* @__PURE__ */ jsxs(&quot;label&quot;, { className: &quot;text-sm font-medium text-gray-700&quot;, children: [ &quot;Style Strength: &quot;, s2iStyleStrength.toFixed(1) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;relative group&quot;, children: [ /* @__PURE__ */ jsx(HelpCircle, { className: &quot;w-4 h-4 text-gray-400 cursor-help&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10&quot;, children: [ &quot;This slider is disabled if no style image is present&quot;, /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800&quot; }) ] }) ] }) ] }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;range&quot;, min: &quot;0&quot;, max: &quot;1&quot;, step: &quot;0.1&quot;, value: s2iStyleStrength, onChange: (e) =&gt; setS2iStyleStrength(Number(e.target.value)), disabled: !s2iStyleImage.file, className: &quot;w-full disabled:opacity-50 disabled:cursor-not-allowed&quot; } ), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-xs text-gray-500 mt-1&quot;, children: [ &quot;Higher values make the result look more like your style image&quot;, !s2iStyleImage.file &amp;&amp; &quot; (disabled - upload a style image first)&quot; ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-green-50 border border-green-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-green-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tips for better results:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;text-xs text-green-700 space-y-1&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Use clear, simple sketches with defined shapes and lines&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Be specific in your text prompt about style, colors, and details&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Higher sketch adherence preserves your drawing structure&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Style images help guide the artistic direction&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;โ€ข Try different combinations of sketch and style strength&quot; }) ] }) ] }) ] }), tool.id === &quot;ai-hairstyle&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Describe the hairstyle you want to try on&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: hairstyleTextPrompt, onChange: (e) =&gt; setHairstyleTextPrompt(e.target.value), placeholder: &quot;Describe the hairstyle you want to try on...&quot;, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot;, rows: 3 } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-sm font-medium text-gray-700 mb-3&quot;, children: &quot;Or choose from suggested prompts:&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-2 sm:grid-cols-3 gap-2&quot;, children: suggestedHairstylePrompts.map((prompt, index) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setHairstyleTextPrompt(prompt), className: &quot;px-3 py-2 text-xs bg-gray-100 hover:bg-blue-100 border border-gray-300 rounded-md transition-colors duration-200 text-left&quot;, children: prompt }, index )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tip:&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs text-blue-700&quot;, children: &quot;For best results, use a clear, front-facing photo with good lighting.&quot; }) ] }) ] }), tool.id === &quot;ai-image-upscaler&quot; &amp;&amp; selectedImage.preview &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ imageDimensions &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-gray-50 border border-gray-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-gray-800 mb-1&quot;, children: &quot;Current Image Size:&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-gray-600&quot;, children: [ imageDimensions.width, &quot; x &quot;, imageDimensions.height, &quot;px&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-3&quot;, children: &quot;Select Upscale Factor&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex gap-3&quot;, children: [ /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setUpscaleFactor(2), disabled: !availableUpscaleOptions.includes(2), className: `px-4 py-2 rounded-md border transition-colors ${upscaleFactor === 2 ? &quot;bg-blue-500 text-white border-blue-500&quot; : availableUpscaleOptions.includes(2) ? &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot; : &quot;bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed&quot;}`, children: &quot;2X&quot; } ), /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; setUpscaleFactor(4), disabled: !availableUpscaleOptions.includes(4), className: `px-4 py-2 rounded-md border transition-colors ${upscaleFactor === 4 ? &quot;bg-blue-500 text-white border-blue-500&quot; : availableUpscaleOptions.includes(4) ? &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot; : &quot;bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed&quot;}`, children: &quot;4X&quot; } ) ] }), availableUpscaleOptions.length === 0 &amp;&amp; /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-red-600 mt-2&quot;, children: &quot;Image is too large for upscaling. Maximum size is 2048px on the longest side.&quot; }), availableUpscaleOptions.length === 1 &amp;&amp; availableUpscaleOptions[0] === 2 &amp;&amp; /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-amber-600 mt-2&quot;, children: &quot;Only 2X upscaling is available for images larger than 1024px on the longest side.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tip:&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs text-blue-700&quot;, children: &quot;AI upscaling works best on photos and detailed images. The larger the upscale factor, the longer the processing time.&quot; }) ] }) ] }), tool.id === &quot;ai-filter&quot; &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-3&quot;, children: &quot;Filter Category&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex flex-wrap gap-2&quot;, children: filterCategories.map((category) =&gt; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: () =&gt; { setFilterSelectedCategory(category); setFilterSelectedStyle(null); }, className: `px-3 py-2 rounded-md border text-sm transition-colors ${filterSelectedCategory === category ? &quot;bg-blue-500 text-white border-blue-500&quot; : &quot;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&quot;}`, children: category }, category )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center justify-between mb-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700&quot;, children: &quot;Choose Style&quot; }), filterSelectedStyle &amp;&amp; /* @__PURE__ */ jsxs( &quot;button&quot;, { type: &quot;button&quot;, onClick: handleFilterClearSelection, className: &quot;flex items-center space-x-1 text-xs text-gray-500 hover:text-gray-700 transition-colors&quot;, children: [ /* @__PURE__ */ jsx(X, { className: &quot;w-3 h-3&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { children: &quot;Clear Selection&quot; }) ] } ) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-2 md:grid-cols-3 gap-3&quot;, children: aiFilterStyles.filter((style) =&gt; style.category === filterSelectedCategory).map((style) =&gt; /* @__PURE__ */ jsxs( &quot;div&quot;, { onClick: () =&gt; { setFilterSelectedStyle(style); setFilterUseCustom(false); }, className: `cursor-pointer border-2 rounded-lg overflow-hidden transition-all relative group ${(filterSelectedStyle == null ? void 0 : filterSelectedStyle.id) === style.id ? &quot;border-blue-500 ring-2 ring-blue-200&quot; : &quot;border-gray-200 hover:border-gray-300&quot;}`, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { src: style.imageUrl, alt: style.name, className: &quot;w-full h-24 object-cover&quot;, onError: (e) =&gt; { const target = e.target; target.src = &quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2Y3ZjdmNyIvPjx0ZXh0IHg9IjUwIiB5PSI1NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmaWxsPSIjOTk5IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5TdHlsZTwvdGV4dD48L3N2Zz4=&quot;; } } ), (filterSelectedStyle == null ? void 0 : filterSelectedStyle.id) === style.id &amp;&amp; /* @__PURE__ */ jsx( &quot;button&quot;, { type: &quot;button&quot;, onClick: (e) =&gt; { e.stopPropagation(); handleFilterClearSelection(); }, className: &quot;absolute top-1 right-1 p-1 bg-white rounded-full shadow-md hover:bg-gray-50 transition-colors&quot;, title: &quot;Clear Selection&quot;, children: /* @__PURE__ */ jsxs(&quot;svg&quot;, { xmlns: &quot;http://www.w3.org/2000/svg&quot;, width: &quot;16&quot;, height: &quot;16&quot;, viewBox: &quot;0 0 24 24&quot;, fill: &quot;none&quot;, stroke: &quot;currentColor&quot;, strokeWidth: &quot;2&quot;, strokeLinecap: &quot;round&quot;, strokeLinejoin: &quot;round&quot;, className: &quot;lucide lucide-xcircle text-gray-600&quot;, children: [ /* @__PURE__ */ jsx(&quot;circle&quot;, { cx: &quot;12&quot;, cy: &quot;12&quot;, r: &quot;10&quot; }), /* @__PURE__ */ jsx(&quot;path&quot;, { d: &quot;m15 9-6 6&quot; }), /* @__PURE__ */ jsx(&quot;path&quot;, { d: &quot;m9 9 6 6&quot; }) ] }) } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;p-2&quot;, children: /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs font-medium text-gray-800 truncate&quot;, children: style.name }) }) ] }, style.id )) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;border-t pt-4&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center space-x-2 mb-3&quot;, children: [ /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;checkbox&quot;, id: &quot;use-custom-filter&quot;, checked: filterUseCustom, onChange: (e) =&gt; { setFilterUseCustom(e.target.checked); if (e.target.checked) { setFilterSelectedStyle(null); } }, className: &quot;rounded border-gray-300 text-blue-600 focus:ring-blue-500&quot; } ), /* @__PURE__ */ jsx(&quot;label&quot;, { htmlFor: &quot;use-custom-filter&quot;, className: &quot;text-sm font-medium text-gray-700&quot;, children: &quot;Use Custom Style&quot; }) ] }), filterUseCustom &amp;&amp; /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-3&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Upload Style Image (Optional)&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;file&quot;, accept: &quot;image/*&quot;, onChange: (e) =&gt; { var _a; const file = (_a = e.target.files) == null ? void 0 : _a[0]; setFilterCustomStyleImage(file || null); }, className: &quot;block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { className: &quot;block text-sm font-medium text-gray-700 mb-2&quot;, children: &quot;Text Prompt&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { value: filterTextPrompt, onChange: (e) =&gt; setFilterTextPrompt(e.target.value), placeholder: &quot;Describe the style you want to apply...&quot;, rows: 3, className: &quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent&quot; } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;h4&quot;, { className: &quot;text-sm font-medium text-blue-800 mb-2&quot;, children: &quot;๐Ÿ’ก Tip:&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xs text-blue-700&quot;, children: &quot;Choose from preset styles for quick results, or use custom style with text prompts for unique artistic effects.&quot; }) ] }) ] }), /* @__PURE__ */ jsx( Button, { onClick: tool.id === &quot;ai-cleanup&quot; ? handleAICleanupGenerate : tool.id === &quot;ai-expand&quot; ? handleAIExpandGenerate : tool.id === &quot;ai-replace&quot; ? handleAIReplaceGenerate : tool.id === &quot;ai-cartoon&quot; ? handleAICartoonGenerate : tool.id === &quot;ai-caricature&quot; ? handleAICaricatureGenerate : tool.id === &quot;ai-avatar&quot; ? handleAIAvatarGenerate : tool.id === &quot;ai-portrait&quot; ? handleAIPortraitGenerate : tool.id === &quot;ai-face-swap&quot; ? handleAIFaceSwapGenerate : tool.id === &quot;ai-product-photoshoot&quot; ? handleAIProductPhotoshootGenerate : tool.id === &quot;ai-background-generator&quot; ? handleAIBackgroundGeneratorGenerate : tool.id === &quot;ai-image-generator&quot; ? handleAIImageGeneratorGenerate : tool.id === &quot;ai-outfit&quot; ? handleAIOutfitGenerate : tool.id === &quot;ai-image-to-image&quot; ? handleAIImageToImageGenerate : tool.id === &quot;ai-sketch-to-image&quot; ? handleAISketchToImageGenerate : tool.id === &quot;ai-hairstyle&quot; ? handleAIHairstyleGenerate : tool.id === &quot;ai-image-upscaler&quot; ? handleAIUpscalerGenerate : tool.id === &quot;ai-filter&quot; ? handleAIFilterGenerate : handleProcessImage, disabled: processedImage.isLoading || tool.id !== &quot;ai-image-generator&quot; &amp;&amp; tool.id !== &quot;ai-face-swap&quot; &amp;&amp; tool.id !== &quot;ai-image-to-image&quot; &amp;&amp; tool.id !== &quot;ai-sketch-to-image&quot; &amp;&amp; !selectedImage.file || tool.id === &quot;ai-replace&quot; &amp;&amp; !textPrompt.trim() || tool.id === &quot;ai-background-generator&quot; &amp;&amp; !backgroundTextPrompt.trim() || tool.id === &quot;ai-image-generator&quot; &amp;&amp; !imageGeneratorTextPrompt.trim() || tool.id === &quot;ai-cartoon&quot; &amp;&amp; !(selectedPresetUrl || (cartoonStyleImage == null ? void 0 : cartoonStyleImage.name)) || tool.id === &quot;ai-caricature&quot; &amp;&amp; !caricatureSelectedStyle &amp;&amp; !caricatureCustomStyleImage || tool.id === &quot;ai-avatar&quot; &amp;&amp; !avatarSelectedStyle &amp;&amp; !avatarCustomStyleImage || tool.id === &quot;ai-portrait&quot; &amp;&amp; !portraitSelectedStyle &amp;&amp; !portraitCustomStyleImage || tool.id === &quot;ai-face-swap&quot; &amp;&amp; (!faceSwapTargetImage.file || !selectedFaceSwapPreset &amp;&amp; !faceSwapSourceImage.file) || tool.id === &quot;ai-product-photoshoot&quot; &amp;&amp; !selectedProductStyle &amp;&amp; !productCustomStyleImage &amp;&amp; !productTextPrompt || tool.id === &quot;ai-outfit&quot; &amp;&amp; (!selectedImage.file || !outfitTextPrompt.trim()) || tool.id === &quot;ai-image-to-image&quot; &amp;&amp; (!i2iMainImage.file || !i2iTextPrompt.trim()) || tool.id === &quot;ai-sketch-to-image&quot; &amp;&amp; (s2iInputMode === &quot;upload&quot; &amp;&amp; !s2iSketchImage.file || !s2iTextPrompt.trim()) || tool.id === &quot;ai-hairstyle&quot; &amp;&amp; (!selectedImage.file || !hairstyleTextPrompt.trim()) || tool.id === &quot;ai-image-upscaler&quot; &amp;&amp; (!selectedImage.file || availableUpscaleOptions.length === 0) || tool.id === &quot;ai-filter&quot; &amp;&amp; (!selectedImage.file || !filterSelectedStyle &amp;&amp; !filterCustomStyleImage &amp;&amp; !filterTextPrompt.trim()), className: &quot;w-full&quot;, children: processedImage.isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(Loader, { className: &quot;w-4 h-4 mr-2 animate-spin&quot; }), &quot;Generating...&quot; ] }) : `Generate ${tool.name}` } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-xl font-semibold&quot;, children: &quot;Result&quot; }), processedImage.isLoading ? /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center&quot;, children: [ /* @__PURE__ */ jsx(Loader, { className: &quot;w-10 h-10 text-blue-500 animate-spin mb-4&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700&quot;, children: &quot;Processing your image...&quot; }) ] }) : processedImage.url ? /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;space-y-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;border rounded-lg overflow-hidden&quot;, children: /* @__PURE__ */ jsx( &quot;img&quot;, { src: processedImage.url, alt: &quot;Processed result&quot;, className: &quot;w-full h-auto&quot; } ) }), /* @__PURE__ */ jsx( Button, { fullWidth: true, onClick: handleDownload, leftIcon: /* @__PURE__ */ jsx(Download, { size: 18 }), children: &quot;Download Result&quot; } ) ] }) : processedImage.error ? /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;border-2 border-dashed border-red-300 bg-red-50 rounded-lg p-8 flex flex-col items-center justify-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-red-600 mb-2&quot;, children: &quot;Error&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700 text-center&quot;, children: processedImage.error }) ] }) : /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center&quot;, children: /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-500&quot;, children: &quot;Upload and process an image to see the result here&quot; }) }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-12 bg-gray-50 rounded-lg p-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h2&quot;, { className: &quot;text-xl font-semibold mb-4&quot;, children: [ &quot;About &quot;, tool.name ] }), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-gray-700 mb-4&quot;, children: [ &quot;Our &quot;, tool.name.toLowerCase(), &quot; tool uses advanced AI algorithms to &quot;, getToolDescription(tool), &quot;. This tool is perfect for photographers, designers, social media managers, and anyone who wants to enhance their images.&quot; ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700&quot;, children: &quot;Unlike other tools, ModernPhotoTools offers this service completely free with no watermarks. Try it now and see the difference!&quot; }) ] }) ] }) }) ] }); }; function getToolDescription(tool) { switch (tool.id) { case &quot;remove-background&quot;: return &quot;automatically detect and remove backgrounds from any image, leaving you with a clean subject that can be placed on any new background&quot;; case &quot;ai-cleanup&quot;: return &quot;automatically detect and fix imperfections, remove unwanted objects, and enhance the overall quality of your photos. Simply paint over the areas you want to remove and let AI intelligently fill in the space&quot;; case &quot;ai-expand&quot;: return &quot;intelligently expand your images beyond their original boundaries, adding realistic content that matches the original image&quot;; case &quot;ai-replace&quot;: return &quot;replace objects or areas in your images with AI-generated content that seamlessly blends with the rest of the image&quot;; case &quot;ai-cartoon&quot;: return &quot;transform your photos into cartoon-style artwork with various artistic styles&quot;; case &quot;ai-portrait&quot;: return &quot;create realistic portrait transformations with professional styling and artistic effects&quot;; case &quot;ai-face-swap&quot;: return &quot;seamlessly swap faces between two images, allowing you to replace faces in photos with either preset faces or custom source images&quot;; case &quot;ai-product-photoshoot&quot;: return &quot;create professional product photography with AI-generated backgrounds and lighting that make your products look stunning&quot;; case &quot;ai-background-generator&quot;: return &quot;generate stunning new backgrounds for your images using AI, perfect for creating professional-looking photos with custom scenes&quot;; case &quot;ai-outfit&quot;: return &quot;virtually change clothing on people in photos using AI, allowing you to transform outfits with simple text descriptions&quot;; case &quot;ai-image-to-image&quot;: return &quot;transform any image based on text prompts and optional style references, with adjustable strength controls for precise artistic control&quot;; case &quot;ai-hairstyle&quot;: return &quot;virtually try on new hairstyles by uploading a photo and describing the desired look, perfect for experimenting with different hair styles and colors&quot;; case &quot;ai-image-upscaler&quot;: return &quot;enhance image resolution and quality using advanced AI upscaling technology, supporting 2x and 4x enlargement while preserving fine details and sharpness&quot;; default: return &quot;transform and enhance your images with professional-quality results&quot;; } } const AboutPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;About Us&quot;, description: &quot;Learn about ModernPhotoTools.com, our mission, and how we&#x27;re making professional photo editing accessible to everyone with AI-powered tools.&quot; } ), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;, children: [ &quot;About &quot;, /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600&quot;, children: &quot;ModernPhotoTools&quot; }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-700 mb-8&quot;, children: &quot;Making professional photo editing accessible to everyone through the power of AI&quot; }) ] }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-white&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;prose prose-lg max-w-none text-gray-700&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Our Mission&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;At ModernPhotoTools.com, we believe that everyone should have access to professional-quality photo editing tools, regardless of their technical skills or budget. Our mission is to democratize photo editing by leveraging the power of artificial intelligence to make complex editing tasks simple and accessible.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;What We Offer&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We provide a comprehensive suite of AI-powered photo editing tools that can help you transform your images in seconds. From removing backgrounds to generating completely new images with AI, our tools are designed to save you time and effort while delivering professional results.&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;All our tools are:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Free to use&quot; }), &quot; - No hidden fees or subscriptions&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Easy to use&quot; }), &quot; - No technical skills required&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Fast&quot; }), &quot; - Get results in seconds&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;High quality&quot; }), &quot; - Professional-grade output&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Private&quot; }), &quot; - We respect your privacy&quot; ] }) ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Why Choose ModernPhotoTools&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;In a world where visual content is increasingly important, having access to powerful editing tools can make a significant difference. Whether you&#x27;re a professional photographer, a social media manager, a small business owner, or just someone who wants to enhance their personal photos, our tools can help you achieve your goals without the steep learning curve or high cost of traditional photo editing software.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Our Technology&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We use cutting-edge AI technology powered to deliver fast and accurate results. Our tools are constantly being improved to ensure that you always have access to the latest advancements in AI-powered photo editing.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Get Started Today&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;Ready to transform your photos? Explore our tools and see what you can create!&quot; }) ] }) }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-blue-600&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-3xl font-bold text-white mb-6&quot;, children: &quot;Ready to Transform Your Photos?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-blue-100 mb-8&quot;, children: &quot;Join thousands of users who enhance their photos with our AI-powered tools every day.&quot; }), /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, children: /* @__PURE__ */ jsx(Button, { size: &quot;lg&quot;, variant: &quot;secondary&quot;, children: &quot;Explore Our Tools&quot; }) }) ] }) }) }) ] }); }; const ContactPage = () =&gt; { const [formData, setFormData] = useState({ name: &quot;&quot;, email: &quot;&quot;, message: &quot;&quot; }); const [formStatus, setFormStatus] = useState({ success: false, message: &quot;&quot;, submitted: false }); const handleChange = (e) =&gt; { const { name, value } = e.target; setFormData((prev) =&gt; ({ ...prev, [name]: value })); }; const handleSubmit = (e) =&gt; { e.preventDefault(); if (!formData.name || !formData.email || !formData.message) { setFormStatus({ success: false, message: &quot;Please fill out all fields.&quot;, submitted: true }); return; } const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { setFormStatus({ success: false, message: &quot;Please enter a valid email address.&quot;, submitted: true }); return; } setTimeout(() =&gt; { setFormStatus({ success: true, message: &quot;Your message has been sent. We&#x27;ll get back to you soon!&quot;, submitted: true }); setFormData({ name: &quot;&quot;, email: &quot;&quot;, message: &quot;&quot; }); }, 1e3); }; return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Contact Us&quot;, description: &quot;Have questions or feedback? Contact the ModernPhotoTools.com team. We&#x27;re here to help with any inquiries about our AI photo editing tools.&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;text-center mb-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-3xl md:text-4xl font-bold text-gray-900 mb-4&quot;, children: &quot;Contact Us&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-600&quot;, children: &quot;Have questions or feedback? We&#x27;d love to hear from you.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;grid grid-cols-1 md:grid-cols-2 gap-12&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold text-gray-900 mb-4&quot;, children: &quot;Get in Touch&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700 mb-6&quot;, children: &quot;We&#x27;re here to help with any questions or feedback you might have about our tools or services.&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-blue-50 rounded-lg p-6&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-start mb-4&quot;, children: [ /* @__PURE__ */ jsx(Mail, { className: &quot;w-5 h-5 text-blue-600 mr-3 mt-1&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-lg font-medium text-gray-900&quot;, children: &quot;Email Us&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700&quot;, children: &quot;support@modernphototools.com&quot; }) ] }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-sm text-gray-600&quot;, children: &quot;We typically respond within 24-48 hours during business days.&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold text-gray-900 mb-4&quot;, children: &quot;Send a Message&quot; }), formStatus.submitted &amp;&amp; /* @__PURE__ */ jsx(&quot;div&quot;, { className: `mb-6 p-4 rounded-lg ${formStatus.success ? &quot;bg-green-50 text-green-800&quot; : &quot;bg-red-50 text-red-800&quot;}`, children: formStatus.message }), /* @__PURE__ */ jsxs(&quot;form&quot;, { onSubmit: handleSubmit, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mb-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { htmlFor: &quot;name&quot;, className: &quot;block text-gray-700 font-medium mb-1&quot;, children: &quot;Your Name&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;text&quot;, id: &quot;name&quot;, name: &quot;name&quot;, value: formData.name, onChange: handleChange, className: &quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, placeholder: &quot;John Doe&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mb-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { htmlFor: &quot;email&quot;, className: &quot;block text-gray-700 font-medium mb-1&quot;, children: &quot;Your Email&quot; }), /* @__PURE__ */ jsx( &quot;input&quot;, { type: &quot;email&quot;, id: &quot;email&quot;, name: &quot;email&quot;, value: formData.email, onChange: handleChange, className: &quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, placeholder: &quot;john.doe@example.com&quot; } ) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mb-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;label&quot;, { htmlFor: &quot;message&quot;, className: &quot;block text-gray-700 font-medium mb-1&quot;, children: &quot;Your Message&quot; }), /* @__PURE__ */ jsx( &quot;textarea&quot;, { id: &quot;message&quot;, name: &quot;message&quot;, value: formData.message, onChange: handleChange, rows: 5, className: &quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot;, placeholder: &quot;How can we help you?&quot; } ) ] }), /* @__PURE__ */ jsx( Button, { type: &quot;submit&quot;, fullWidth: true, leftIcon: /* @__PURE__ */ jsx(Send, { size: 18 }), children: &quot;Send Message&quot; } ) ] }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;mt-12 p-6 bg-gray-50 rounded-lg&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-xl font-semibold text-gray-900 mb-4&quot;, children: &quot;Privacy Notice&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-gray-700 text-sm&quot;, children: [ &quot;By submitting this form, you agree to our &quot;, /* @__PURE__ */ jsx(Link, { to: &quot;/privacy-policy&quot;, className: &quot;text-blue-600 hover:underline&quot;, children: &quot;Privacy Policy&quot; }), &quot;. We collect and process your personal data only for the purpose of responding to your inquiry. Your information will not be shared with third parties without your consent.&quot; ] }) ] }) ] }) }) ] }); }; const NotFoundPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Page Not Found&quot;, description: &quot;Sorry, the page you are looking for could not be found.&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;min-h-[60vh] flex items-center&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12 text-center&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-6xl font-bold text-gray-900 mb-4&quot;, children: &quot;404&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold text-gray-800 mb-6&quot;, children: &quot;Page Not Found&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600 max-w-md mx-auto mb-8&quot;, children: &quot;Sorry, the page you are looking for doesn&#x27;t exist or has been moved.&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex flex-col sm:flex-row justify-center gap-4&quot;, children: [ /* @__PURE__ */ jsx(Link, { to: &quot;/&quot;, children: /* @__PURE__ */ jsx(Button, { leftIcon: /* @__PURE__ */ jsx(Home, { size: 18 }), children: &quot;Back to Home&quot; }) }), /* @__PURE__ */ jsx(Link, { to: &quot;/tools&quot;, children: /* @__PURE__ */ jsx(Button, { variant: &quot;outline&quot;, leftIcon: /* @__PURE__ */ jsx(Search, { size: 18 }), children: &quot;Explore Tools&quot; }) }) ] }) ] }) }) ] }); }; const blogArticles = [ { id: &quot;ai-image-enhancement-guide&quot;, title: &quot;AI Image Enhancement: Transform Your Photos with Artificial Intelligence&quot;, excerpt: &quot;Discover how AI-powered image enhancement can transform your photos. Learn about the best tools, techniques, and workflows for professional results.&quot;, content: `# AI Image Enhancement: Transform Your Photos with Artificial Intelligence Artificial Intelligence has revolutionized photo editing, making professional-quality image enhancement accessible to everyone. Whether you&#x27;re a photographer, content creator, or someone who simply wants to improve their photos, AI-powered tools can transform ordinary images into stunning visuals with just a few clicks. In this comprehensive guide, we&#x27;ll explore how AI image enhancement works, the best tools available, and practical techniques to get the most out of this technology. ## What is AI Image Enhancement? AI image enhancement uses machine learning algorithms trained on millions of images to automatically improve photo quality. These systems can: - **Upscale resolution** without losing quality - **Reduce noise** and grain - **Enhance colors** and contrast - **Sharpen details** intelligently - **Fix lighting issues** automatically - **Remove unwanted objects** seamlessly - **Restore old or damaged photos** ## How AI Image Enhancement Works ### Machine Learning Fundamentals AI enhancement tools use deep neural networks trained on vast datasets of high-quality images. The process involves: 1. **Training Phase:** AI learns from millions of before/after image pairs 2. **Pattern Recognition:** Identifies common image problems and solutions 3. **Real-time Processing:** Applies learned improvements to new images 4. **Quality Assessment:** Evaluates and refines results automatically ### Types of AI Enhancement **Generative AI:** Creates new pixel data to improve images **Discriminative AI:** Analyzes and corrects existing pixel information **Hybrid Approaches:** Combines multiple AI techniques for optimal results ## Top AI Image Enhancement Tools ### 1. Photo AI Enhancer Our [AI-powered image enhancer](/tools/ai-image-enhancer) offers professional-quality results with ease: **Key Features:** - **One-click enhancement** - **Multiple enhancement modes** - **Batch processing capabilities** - **High-resolution output** - **Free to use** **How to Use:** 1. Upload your image to [Photo AI Enhancer](/tools/ai-image-enhancer) 2. Select enhancement type 3. Let AI process your image 4. Download enhanced result **Best For:** Quick enhancements, batch processing, beginners ### 2. Topaz Gigapixel AI **Specialization:** Image upscaling and resolution enhancement **Strengths:** Exceptional detail preservation, multiple AI models **Pricing:** Paid software with free trial ### 3. Adobe Camera Raw with AI **Integration:** Built into [Photoshop](https://www.adobe.com/products/photoshop.html) and [Lightroom](https://www.adobe.com/products/photoshop-lightroom.html) **Features:** AI-powered masking, sky replacement, noise reduction **Best For:** Professional photographers, Adobe ecosystem users ### 4. Luminar AI **Focus:** Creative AI enhancements **Unique Features:** Sky AI, Portrait AI, Body AI **Approach:** Artistic enhancement with AI assistance ### 5. Upscayl (Open Source) **Advantages:** **Free**, **open-source**, **privacy-focused** **Limitations:** Requires technical setup **Best For:** Privacy-conscious users, developers ## Practical AI Enhancement Techniques ### Portrait Enhancement **Skin Smoothing:** - Use AI to reduce blemishes naturally - Maintain skin texture authenticity - Avoid over-processing **Eye Enhancement:** - Brighten and sharpen eyes - Enhance iris details - Remove red-eye automatically **Hair Detail Recovery:** - Restore fine hair details - Enhance texture and shine - Fix flyaway hairs ### Landscape Photography **Sky Enhancement:** - Boost cloud definition - Enhance sunset/sunrise colors - Balance exposure automatically **Detail Sharpening:** - Enhance distant objects - Improve texture definition - Maintain natural appearance **Color Grading:** - Automatic color correction - Mood-based adjustments - Seasonal color enhancement ### Product Photography **Background Cleanup:** - Remove distracting elements - Enhance product focus - Create consistent backgrounds **Detail Enhancement:** - Sharpen product features - Enhance material textures - Improve color accuracy ### Old Photo Restoration **Damage Repair:** - Fix scratches and tears - Remove stains and spots - Restore faded areas **Quality Improvement:** - Reduce grain and noise - Enhance sharpness - Improve color accuracy ## Advanced AI Enhancement Workflows ### Multi-Stage Processing 1. **Initial Assessment:** Analyze image problems 2. **Primary Enhancement:** Apply main AI improvements 3. **Selective Adjustments:** Target specific areas 4. **Quality Check:** Review and refine results 5. **Final Output:** Export optimized image ### Combining AI Tools **Workflow Example:** 1. Use AI upscaling for resolution 2. Apply AI noise reduction 3. Enhance with AI color grading 4. Fine-tune with traditional editing ### Batch Processing Strategies **Consistent Results:** - Use same AI model for similar images - Create processing templates - Maintain quality standards **Efficiency Tips:** - Process similar images together - Use appropriate AI models - Monitor processing quality ## Best Practices for AI Enhancement ### Do&#x27;s 1. **Start with high-quality originals** when possible 2. **Choose appropriate AI models** for your image type 3. **Review results carefully** before finalizing 4. **Maintain backup copies** of original images 5. **Combine AI with manual adjustments** for best results ### Don&#x27;ts 1. **Don&#x27;t over-enhance** - maintain natural appearance 2. **Don&#x27;t rely solely on AI** - human judgment is important 3. **Don&#x27;t ignore image context** - consider final use 4. **Don&#x27;t skip quality checks** - AI isn&#x27;t perfect 5. **Don&#x27;t forget about file formats** - choose appropriate output ## Understanding AI Enhancement Limitations ### What AI Does Well - **Pattern Recognition:** Identifying common image problems - **Noise Reduction:** Removing grain and digital artifacts - **Upscaling:** Increasing resolution intelligently - **Color Correction:** Automatic color balance - **Detail Enhancement:** Sharpening without artifacts ### Current Limitations - **Creative Decisions:** AI can&#x27;t replace artistic vision - **Context Understanding:** May miss image-specific needs - **Extreme Damage:** Severely corrupted images may not improve - **Style Preferences:** Personal taste varies - **Processing Time:** Complex enhancements take time ## Future of AI Image Enhancement ### Emerging Trends **Real-time Processing:** Instant enhancement during capture **Personalized AI:** Models trained on individual preferences **Multi-modal AI:** Understanding image content and context **Edge Computing:** AI processing on mobile devices ### Expected Improvements - Better understanding of image context - More natural-looking results - Faster processing speeds - Lower computational requirements - Improved accessibility ## Choosing the Right AI Tool ### Consider Your Needs **Casual Users:** Simple, one-click solutions **Professionals:** Advanced controls and batch processing **Specific Tasks:** Specialized tools for particular enhancements **Budget:** Free vs. paid options ### Evaluation Criteria 1. **Quality of Results:** Test with your typical images 2. **Ease of Use:** Interface and workflow efficiency 3. **Processing Speed:** Time requirements for your volume 4. **Cost:** One-time vs. subscription pricing 5. **Support:** Documentation and customer service ## Practical Tips for Better Results ### Image Preparation - **Clean your lens** before shooting - **Use proper exposure** when possible - **Shoot in RAW format** for maximum flexibility - **Consider composition** - AI can&#x27;t fix poor framing ### Enhancement Strategy - **Start subtle** and build up enhancements - **Focus on problem areas** first - **Maintain image authenticity** - **Consider final output size** and format ### Quality Control - **View at 100% zoom** to check details - **Test different AI models** for comparison - **Save multiple versions** for comparison - **Get second opinions** when possible ## Conclusion AI image enhancement has democratized professional-quality photo editing, making it accessible to everyone regardless of technical skill level. While AI tools are incredibly powerful, they work best when combined with human creativity and judgment. The key to successful AI enhancement is understanding what each tool does well and choosing the right approach for your specific needs. Start with simple enhancements and gradually explore more advanced techniques as you become comfortable with the technology. For professional results, try our [AI Image Enhancer](/tools/ai-image-enhancer) or explore our [AI Background Generator](/tools/ai-background-generator) to create stunning backgrounds for your enhanced photos. Remember that AI is a tool to enhance your creative vision, not replace it. The best results come from combining AI capabilities with your artistic eye and understanding of what makes a great image. **Ready to enhance your photos with AI?** Try our [free AI image enhancer](/tools/ai-image-enhancer) and discover how artificial intelligence can transform your photography!`, publishDate: &quot;2025-07-15&quot;, readTime: &quot;16 min read&quot;, category: &quot;tools&quot;, featuredImage: &quot;/images/blog/ai-image-enhancement.svg&quot;, relatedTool: &quot;ai-image-enhancer&quot; }, { id: &quot;studio-ghibli-ai-art-guide&quot;, title: &quot;How to Make Studio Ghibli AI Art: Step-by-Step Guide&quot;, excerpt: &quot;Transform your photos into magical Studio Ghibli-style artwork using AI tools. Complete guide with tips, tricks, and best practices.&quot;, content: `# How to Make Studio Ghibli AI Art: Step-by-Step Guide Studio Ghibli&#x27;s enchanting art style has captivated audiences worldwide with its dreamy landscapes, whimsical characters, and magical atmospheres. Thanks to advances in AI technology, you can now transform your own photos and ideas into beautiful Studio Ghibli-inspired artwork. This comprehensive guide will walk you through everything you need to know about creating Studio Ghibli AI art, from understanding the distinctive style to using the best tools and techniques. ## Understanding Studio Ghibli Art Style ### Key Visual Elements Studio Ghibli films are renowned for their distinctive artistic characteristics: **Color Palette:** - **Soft, muted earth tones** - **Warm greens and blues** - **Golden hour lighting effects** - **Pastel sky gradients** - **Rich, saturated nature colors** **Composition Elements:** - Sweeping landscapes with rolling hills - Detailed architectural elements - Lush vegetation and forests - Floating islands and magical elements - Characters integrated naturally into environments **Artistic Techniques:** - **Hand-painted watercolor textures** - **Soft, organic line work** - **Atmospheric perspective** - **Detailed background elements** - **Whimsical, fantastical elements** ### Iconic Ghibli Themes - **Nature and Environment:** Forests, meadows, and natural landscapes - **Architecture:** Traditional Japanese buildings, castles, and fantastical structures - **Transportation:** Flying machines, trains, and magical vehicles - **Characters:** Expressive faces with large eyes and distinctive clothing - **Magical Elements:** Spirits, floating objects, and otherworldly phenomena ## Best AI Tools for Studio Ghibli Art ### 1. Photo By AI Art Generator Our [AI art generator](/tools/ai-art-generator) excels at creating Studio Ghibli-style artwork: **Features:** - **Dedicated Ghibli art style presets** - **High-resolution output** - **Multiple aspect ratios** - **Batch processing capabilities** - **Free to use** **How to Use:** 1. Visit [AI Filter](/tools/ai-filter) 2. Upload your reference image or start from scratch 3. Select &quot;Studio Ghibli&quot; style preset 4. Adjust settings and parameters 5. Generate and download your artwork ### 2. Midjourney **Strengths:** Exceptional artistic quality and style consistency **Best For:** Detailed landscapes and character art **Pricing:** Subscription-based **Effective Prompts:** - &quot;Studio Ghibli style landscape&quot; - &quot;Miyazaki anime art style&quot; - &quot;Ghibli movie scene&quot; ### 3. Stable Diffusion **Advantages:** **Open-source**, **customizable**, **free** **Best For:** Users comfortable with technical setup **Models:** Specialized Ghibli-trained models available ### 4. DALL-E 3 **Strengths:** **Excellent prompt understanding** **Best For:** Specific scene creation **Access:** Through [ChatGPT Plus](https://openai.com/chatgpt) or API ## Step-by-Step Creation Process ### Method 1: Photo-to-Ghibli Transformation **Step 1: Choose Your Source Image** - Select photos with **interesting landscapes** - Ensure **good composition and lighting** - Avoid cluttered or busy backgrounds - Consider images with **natural elements** **Step 2: Prepare Your Image** - Crop to desired aspect ratio - Adjust basic exposure if needed - Remove distracting elements - Enhance key focal points **Step 3: Apply AI Transformation** 1. Upload to your chosen AI tool 2. Select **Studio Ghibli style preset** 3. Adjust strength/intensity settings 4. Generate multiple variations 5. Select the best result **Step 4: Refine and Enhance** - Fine-tune colors and contrast - Add magical elements if desired - Enhance atmospheric effects - Adjust saturation for Ghibli feel ### Method 2: Text-to-Image Generation **Step 1: Craft Effective Prompts** Successful Ghibli prompts include: - **Style references:** &quot;Studio Ghibli style&quot;, &quot;Miyazaki anime&quot; - **Scene descriptions:** &quot;Rolling green hills&quot;, &quot;ancient forest&quot; - **Atmospheric elements:** &quot;Golden hour lighting&quot;, &quot;misty morning&quot; - **Specific details:** &quot;Traditional Japanese village&quot;, &quot;floating castle&quot; **Example Prompts:** - &quot;Studio Ghibli style landscape with rolling green hills, ancient oak tree, golden hour lighting, soft watercolor style&quot; - &quot;Miyazaki anime style village with traditional houses, flower gardens, blue sky with fluffy clouds&quot; - &quot;Ghibli movie scene of a magical forest with glowing spirits, moss-covered trees, ethereal lighting&quot; **Step 2: Generate and Iterate** 1. Start with basic prompt 2. Generate multiple variations 3. Refine prompt based on results 4. Experiment with different parameters 5. Save promising generations **Step 3: Post-Processing** - Enhance colors to match Ghibli palette - Add soft, dreamy effects - Adjust contrast for painted look - Fine-tune atmospheric elements ## Advanced Techniques ### Prompt Engineering for Better Results **Effective Keywords:** - &quot;Studio Ghibli&quot;, &quot;Miyazaki&quot;, &quot;Ghibli movie&quot; - &quot;Watercolor painting&quot;, &quot;soft brushstrokes&quot; - &quot;Dreamy&quot;, &quot;whimsical&quot;, &quot;magical&quot; - &quot;Pastoral&quot;, &quot;idyllic&quot;, &quot;serene&quot; **Technical Terms:** - &quot;Cel shading&quot;, &quot;anime style&quot; - &quot;Soft lighting&quot;, &quot;atmospheric perspective&quot; - &quot;Hand-painted texture&quot;, &quot;traditional animation&quot; **Composition Guidance:** - &quot;Wide landscape view&quot;, &quot;bird&#x27;s eye perspective&quot; - &quot;Foreground, midground, background&quot; - &quot;Leading lines&quot;, &quot;rule of thirds&quot; ### Color Grading Techniques **Ghibli Color Characteristics:** 1. **Warm Highlights:** Golden, peachy tones 2. **Cool Shadows:** Soft blues and purples 3. **Saturated Greens:** Rich, natural vegetation colors 4. **Soft Contrasts:** Avoid harsh black and white 5. **Atmospheric Haze:** Subtle blue-gray in distance **Post-Processing Steps:** 1. Reduce overall contrast slightly 2. Warm up highlights 3. Cool down shadows 4. Enhance green and blue saturation 5. Add subtle film grain for texture ### Creating Character Art **Character Design Elements:** - **Large, expressive eyes** - **Soft, rounded features** - **Natural hair colors and styles** - **Simple, comfortable clothing** - **Gentle, kind expressions** **Effective Character Prompts:** - &quot;Ghibli style character, young girl with brown hair, kind eyes, simple dress&quot; - &quot;Studio Ghibli boy character, curious expression, adventure clothing&quot; - &quot;Miyazaki style elderly character, wise face, traditional clothing&quot; ## Common Challenges and Solutions ### Challenge 1: Inconsistent Style **Problem:** Generated art doesn&#x27;t match Ghibli aesthetic **Solutions:** - Use more **specific style keywords** - Reference **specific Ghibli films** - Adjust generation parameters - Try different AI models ### Challenge 2: Over-detailed Results **Problem:** AI generates too much detail, losing Ghibli simplicity **Solutions:** - Add &quot;simple&quot;, &quot;clean&quot; to prompts - Reduce detail parameters - Use style strength adjustments - Post-process to simplify ### Challenge 3: Wrong Color Palette **Problem:** Colors don&#x27;t match Ghibli films **Solutions:** - Specify **color preferences** in prompts - Use **color grading** in post-processing - Reference specific Ghibli color schemes - Adjust saturation and warmth ### Challenge 4: Lack of Magical Elements **Problem:** Results look too realistic **Solutions:** - Add **fantasy elements** to prompts - Include &quot;magical&quot;, &quot;whimsical&quot; keywords - Reference specific Ghibli magical elements - Enhance with post-processing effects ## Inspiration from Specific Ghibli Films ### My Neighbor Totoro - **Lush green forests** - **Traditional Japanese countryside** - **Gentle, friendly spirits** - **Warm, family-oriented scenes** ### Spirited Away - **Magical bathhouse architecture** - **Spirit world creatures** - **Rich, detailed environments** - **Mysterious, otherworldly atmosphere** ### Castle in the Sky - **Floating islands and castles** - **Steampunk mechanical elements** - **Vast sky scenes** - **Adventure and exploration themes** ### Princess Mononoke - **Ancient forests and nature spirits** - **Conflict between nature and industry** - **Detailed creature designs** - **Epic, sweeping landscapes** ### Howl&#x27;s Moving Castle - **Fantastical architecture** - **Magical transformations** - **Romantic, dreamy atmosphere** - **Intricate mechanical designs** ## Tips for Better Results ### Photography Tips for Source Images 1. **Golden Hour Shooting:** Capture during sunrise or sunset 2. **Natural Landscapes:** Focus on forests, hills, and meadows 3. **Interesting Architecture:** Traditional or unique buildings 4. **Clear Skies:** Dramatic clouds or clear blue skies work well 5. **Foreground Interest:** Include interesting foreground elements ### Prompt Optimization 1. **Be Specific:** Include detailed scene descriptions 2. **Use Style Keywords:** Always include Ghibli-related terms 3. **Describe Mood:** Include emotional and atmospheric descriptors 4. **Specify Quality:** Add terms like &quot;high quality&quot;, &quot;detailed&quot; 5. **Experiment:** Try variations of successful prompts ### Post-Processing Enhancement 1. **Color Harmony:** Ensure colors work together 2. **Soft Edges:** Reduce harsh lines and edges 3. **Atmospheric Effects:** Add subtle haze or glow 4. **Texture Enhancement:** Add painted or watercolor effects 5. **Final Polish:** Adjust overall brightness and contrast ## Sharing and Using Your Ghibli Art ### Best Practices - **Credit AI Tools:** Mention the AI tool used - **Respect Copyright:** Don&#x27;t claim as original Ghibli work - **Share Process:** Document your creation process - **Engage Community:** Join AI art communities ### Usage Ideas - **Social Media:** Share on [Instagram](https://www.instagram.com/), [Twitter](https://twitter.com/), [Pinterest](https://www.pinterest.com/) - **Personal Projects:** Use for wallpapers, prints - **Creative Inspiration:** Inspire your own artwork - **Storytelling:** Create visual narratives ## Conclusion Creating Studio Ghibli-style AI art is an exciting way to explore the intersection of technology and artistic expression. While AI tools make it easier than ever to achieve this distinctive style, the key to success lies in understanding what makes Ghibli art special and learning to guide AI tools effectively. Remember that the best results come from experimentation and iteration. Don&#x27;t be afraid to try different approaches, adjust your prompts, and refine your techniques. Each generation is an opportunity to learn and improve. For even more creative possibilities, try our [AI Background Generator](/tools/ai-background-generator) to create magical Ghibli-inspired backgrounds for your artwork. Whether you&#x27;re transforming personal photos into magical landscapes or creating entirely new Ghibli-inspired worlds, the most important thing is to have fun and let your creativity flow. **Ready to create your own Studio Ghibli masterpiece?** Try our [AI art generator](/tools/ai-art-generator) and bring the magic of Ghibli to your own images!`, publishDate: &quot;2025-02-28&quot;, readTime: &quot;8 min read&quot;, category: &quot;general&quot;, featuredImage: &quot;/images/blog/studio-ghibli-ai-art.svg&quot; }, { id: &quot;ai-background-generators-2025&quot;, title: &quot;13 Best AI Background Generators in 2025&quot;, excerpt: &quot;Discover the top AI background generators that can transform your photos with stunning, professional backgrounds in seconds.&quot;, content: `# 13 Best AI Background Generators in 2025 **AI background generators** have revolutionized photo editing, making it easier than ever to create stunning visuals with professional backgrounds. Whether you&#x27;re a content creator, marketer, or photography enthusiast, these tools can transform your images in seconds. ## Why Use AI Background Generators? - **Time-saving**: Generate backgrounds instantly - **Cost-effective**: No need for expensive photo shoots - **Versatile**: Create any environment imaginable - **Professional quality**: High-resolution, realistic results - **Easy to use**: No advanced editing skills required ## Top 13 AI Background Generators 1. Photo [AI Background Generator](/tools/ai-background-generator) Our own **AI Background Generator** offers: - **Instant background creation** - **Multiple style options** - **High-quality results** - **User-friendly interface** - **Free to use** **Best for**: Quick background changes, product photography, social media content **Pro Tip**: Combine with our [Background Remover](/tools/background-remover) for complete background control! 2. [Canva](https://www.canva.com) Background Remover **Canva&#x27;s AI-powered background tools** integrate seamlessly with their design platform: - **Integrated with design tools** - **Template library** with thousands of options - **Collaboration features** for team projects - **Magic Eraser** for precise background removal **Best for**: Social media graphics, presentations, marketing materials 3. [Remove.bg](https://www.remove.bg) **Specialized in background removal** with AI precision: - **Automatic background detection** - **API integration** for developers - **Bulk processing** capabilities - **High-quality edge detection** **Best for**: E-commerce product photos, profile pictures 4. [Adobe Firefly](https://www.adobe.com/products/firefly.html) **Adobe&#x27;s generative AI** brings professional capabilities: - **Advanced AI capabilities** - **Creative Cloud integration** - **Professional-grade results** - **Generative fill** technology **Best for**: Professional photographers, creative agencies 5. [Fotor](https://www.fotor.com) Background Generator **One-click background transformation**: - **AI-powered background change** - **Multiple categories** (nature, urban, abstract) - **Mobile app available** - **Batch processing** options **Best for**: Quick edits, mobile photography 6. [Adobe Photoshop](https://www.adobe.com/products/photoshop.html) AI **Industry-standard editing** with AI enhancement: - **Generative fill feature** - **Professional editing tools** - **Industry standard** for professionals - **Neural filters** for advanced effects **Best for**: Professional photo editing, detailed retouching 7. [Luminar Neo](https://skylum.com/luminar) **AI-powered editing suite** with background focus: - **Background replacement AI** - **Portrait enhancement** tools - **Sky replacement** features - **Mask AI** for precise selections **Best for**: Portrait photography, landscape enhancement 8. [Pixlr](https://pixlr.com) **Web-based editor** with AI capabilities: - **AI background tools** - **Free and premium options** - **Cloud-based editing** - **Mobile compatibility** **Best for**: Quick online edits, beginners 9. [GIMP](https://www.gimp.org) with AI Plugins **Open-source solution** with AI extensions: - **Free and open-source** - **Customizable workflows** - **Community support** - **AI plugin compatibility** **Best for**: Budget-conscious users, developers 10. [Kapwing](https://www.kapwing.com) **Video and image editing** platform: - **Background removal** for videos and images - **Online collaboration** tools - **Template library** - **Social media optimization** **Best for**: Content creators, social media managers 11. [Unscreen](https://www.unscreen.com) **Video background removal** specialist: - **Automatic video background removal** - **GIF support** - **Simple drag-and-drop interface** - **No green screen required** **Best for**: Video content, animated GIFs 12. [Clipping Magic](https://clippingmagic.com) **Precision background removal**: - **Smart edge detection** - **Manual refinement tools** - **API available** for integration - **High-quality results** **Best for**: E-commerce, product photography 13. [Background Burner](https://www.bonanza.com/background_burner) **Automatic background processing**: - **Instant background removal** - **Multiple background options** - **Quick processing** times - **Simple interface** **Best for**: Quick background swaps, casual users ## How to Choose the Right Tool Consider these factors when selecting an **AI background generator**: - **Purpose**: Product photos, portraits, creative projects - **Quality requirements**: Resolution and detail needs - **Budget**: Free vs. premium options - **Integration**: Workflow compatibility with tools like [Photoshop](https://www.adobe.com/products/photoshop.html) or [Canva](https://www.canva.com) - **Ease of use**: Learning curve and interface complexity - **Output formats**: Support for various file types and resolutions - **Processing speed**: Batch capabilities and rendering time ## Best Practices for AI Background Generation ### Preparation Tips 1. **Start with high-quality images** - Use well-lit, sharp photos for best results 2. **Clean subject edges** - Remove any existing background artifacts 3. **Consider subject positioning** - Ensure proper framing and composition ### Background Selection 4. **Choose appropriate backgrounds** that complement your subject 5. **Match lighting conditions** between subject and background 6. **Consider color harmony** and overall composition 7. **Maintain realistic proportions** and perspective ### Post-Processing 8. **Refine edges** for seamless integration 9. **Adjust shadows and highlights** to match the new environment 10. **Use our [AI Image Enhancer](/tools/ai-image-enhancer)** to polish final results ## Advanced Techniques ### Combining Tools for Better Results - Start with [Background Remover](/tools/background-remover) for clean subject isolation - Use [AI Background Generator](/tools/ai-background-generator) for new backgrounds - Enhance final image with [AI Image Enhancer](/tools/ai-image-enhancer) - Apply filters using [AI Filter](/tools/ai-filter) for artistic effects ### Professional Workflows **E-commerce Photography:** 1. Remove existing backgrounds 2. Apply consistent white or branded backgrounds 3. Enhance product details 4. Optimize for web display **Social Media Content:** 1. Create eye-catching backgrounds 2. Match brand colors and themes 3. Optimize for platform specifications 4. A/B test different background styles **Portrait Photography:** 1. Select complementary environments 2. Match lighting and mood 3. Enhance subject features 4. Create cohesive series looks ## Future of AI Background Generation The technology continues to evolve rapidly with exciting developments: ### Current Innovations - **Better edge detection** using advanced neural networks - **More realistic lighting adaptation** with 3D understanding - **Improved style consistency** across multiple images - **Real-time processing** for live video applications - **Enhanced mobile capabilities** for on-the-go editing ### Emerging Trends - **3D-aware background generation** for realistic depth - **Style transfer integration** for artistic backgrounds - **Voice-controlled editing** for hands-free operation - **Collaborative AI editing** for team workflows - **Augmented reality preview** for real-time visualization ### Industry Impact **Content Creation**: Democratizing professional-quality visuals **E-commerce**: Reducing product photography costs **Social Media**: Enabling creative expression for everyone **Marketing**: Streamlining campaign asset creation ## Troubleshooting Common Issues ### Edge Quality Problems - **Use higher resolution source images** - **Ensure good contrast** between subject and original background - **Try multiple AI models** for comparison - **Manual refinement** may be needed for complex edges ### Lighting Mismatches - **Adjust background brightness** to match subject - **Use consistent color temperature** - **Add realistic shadows** for believability - **Consider using [AI Image Enhancer](/tools/ai-image-enhancer)** for final adjustments ### Style Inconsistencies - **Choose backgrounds** that match your subject&#x27;s style - **Maintain consistent processing** across image series - **Use reference images** for style guidance - **Apply uniform post-processing** techniques ## Conclusion **AI background generators** have revolutionized photo editing, making professional-quality background replacement accessible to everyone. Whether you&#x27;re creating product photos for an online store, enhancing portraits, or developing creative content for social media, these tools can significantly streamline your workflow. ### Key Takeaways - **Choose the right tool** based on your specific needs and budget - **Combine multiple AI tools** for optimal results - **Follow best practices** for professional-quality outputs - **Stay updated** with emerging AI technologies ### Get Started Today Ready to transform your photos? Try our **free** [AI Background Generator](/tools/ai-background-generator) and experience the power of instant background transformation. For complete photo editing workflows, explore our full suite of AI tools: - [Background Remover](/tools/background-remover) - Clean subject isolation - [AI Image Enhancer](/tools/ai-image-enhancer) - Professional quality enhancement - [AI Filter](/tools/ai-filter) - Creative artistic effects - [AI Art Generator](/tools/ai-art-generator) - Generate unique backgrounds from scratch **Start creating stunning visuals today** and join thousands of creators who trust Photo for their AI-powered photo editing needs!`, publishDate: &quot;2024-11-20&quot;, readTime: &quot;12 min read&quot;, category: &quot;tools&quot;, featuredImage: &quot;/images/blog/ai-background-generators.svg&quot;, relatedTool: &quot;ai-background-generator&quot; }, { id: &quot;easter-card-messages-2025&quot;, title: &quot;100+ Easter Card Message Ideas in 2025&quot;, excerpt: &quot;Find the perfect Easter card messages for family, friends, and loved ones. From religious to playful, discover heartfelt words for every relationship.&quot;, content: `# 100+ Easter Card Message Ideas in 2025 Easter is a time of renewal, joy, and connection. Whether you&#x27;re celebrating the religious significance or simply enjoying the spring festivities, the right message can make your Easter cards truly special. Here&#x27;s a comprehensive collection of Easter card messages for every relationship and occasion. ## Religious Easter Messages ### For Family - &quot;May the miracle of Easter bring you renewed faith, hope, and joy.&quot; - &quot;Celebrating the resurrection and the promise of eternal life with you.&quot; - &quot;May God&#x27;s love shine upon you this Easter and always.&quot; - &quot;Rejoicing in the victory of Christ and the hope He brings.&quot; - &quot;May the blessings of Easter fill your heart with peace and happiness.&quot; ### For Friends - &quot;Wishing you a blessed Easter filled with God&#x27;s grace and love.&quot; - &quot;May the joy of Easter morning be with you today and throughout the year.&quot; - &quot;Celebrating the hope and new life that Easter brings.&quot; - &quot;May your Easter be as bright as your faith.&quot; - &quot;Sending you Easter blessings and warm wishes.&quot; ## Light-hearted Easter Messages ### For Kids - &quot;Hoppy Easter! May your day be filled with chocolate and fun!&quot; - &quot;Some bunny loves you very much! Happy Easter!&quot; - &quot;Wishing you an egg-stra special Easter!&quot; - &quot;May your Easter basket be full of treats and your heart full of joy!&quot; - &quot;Easter hugs and bunny kisses coming your way!&quot; ### For Adults - &quot;Hope your Easter is egg-cellent in every way!&quot; - &quot;Wishing you a spring-time of happiness and renewal.&quot; - &quot;May your Easter be filled with beautiful moments and sweet memories.&quot; - &quot;Sending you warm wishes for a wonderful Easter celebration.&quot; - &quot;Hope your Easter is as sweet as chocolate and as bright as spring flowers.&quot; ## Short Easter Messages - &quot;Happy Easter!&quot; - &quot;Easter blessings to you and yours.&quot; - &quot;Wishing you joy this Easter.&quot; - &quot;May Easter bring you happiness.&quot; - &quot;Celebrating new beginnings with you.&quot; - &quot;Easter joy and spring wishes.&quot; - &quot;Hope, love, and Easter blessings.&quot; - &quot;Springtime happiness to you!&quot; ## Easter Messages for Different Relationships ### For Parents - &quot;Thank you for teaching me the true meaning of Easter. Your love and faith have shaped who I am today.&quot; - &quot;Grateful for the Easter traditions you&#x27;ve shared with our family through the years.&quot; - &quot;May this Easter bring you the same joy you&#x27;ve brought to our family.&quot; ### For Grandparents - &quot;Your wisdom and love make every Easter special. Thank you for being such a blessing in our lives.&quot; - &quot;Remembering all the wonderful Easter memories you&#x27;ve helped create.&quot; - &quot;May your Easter be filled with the love of family and the joy of spring.&quot; ### For Spouse/Partner - &quot;Celebrating new beginnings and endless love with you this Easter.&quot; - &quot;You make every season brighter, especially Easter. I love you.&quot; - &quot;Looking forward to many more Easter celebrations together.&quot; ### For Colleagues - &quot;Wishing you a restful and joyful Easter break.&quot; - &quot;May the spring season bring fresh energy and new opportunities.&quot; - &quot;Hope you have a wonderful Easter with your loved ones.&quot; ## Creative Easter Card Ideas ### Photo Card Messages - &quot;Capturing Easter joy with the people we love most.&quot; - &quot;Our family wishes your family a very Happy Easter!&quot; - &quot;Spring has sprung and so has our excitement for Easter!&quot; ### Handmade Card Messages - &quot;Made with love for someone special this Easter.&quot; - &quot;A little handmade happiness for your Easter celebration.&quot; - &quot;Crafted with care and Easter wishes for you.&quot; ## Easter Messages for Different Ages ### For Teenagers - &quot;Hope your Easter break is amazing and your chocolate stash is epic!&quot; - &quot;Wishing you an Easter that&#x27;s as awesome as you are.&quot; - &quot;May your Easter be filled with good times and great memories.&quot; ### For Young Adults - &quot;As you navigate this exciting time in your life, may Easter remind you of hope and new possibilities.&quot; - &quot;Wishing you an Easter filled with joy, growth, and wonderful discoveries.&quot; - &quot;May the spirit of Easter inspire you in all your endeavors.&quot; ### For Seniors - &quot;May this Easter bring you peace, comfort, and the warmth of cherished memories.&quot; - &quot;Celebrating the wisdom and grace you bring to our lives this Easter.&quot; - &quot;Wishing you a gentle and blessed Easter surrounded by love.&quot; ## Tips for Writing Personal Easter Messages 1. **Consider your relationship** with the recipient 2. **Match the tone** to the occasion and your relationship 3. **Include personal touches** or shared memories 4. **Keep it genuine** and heartfelt 5. **Consider the recipient&#x27;s beliefs** and preferences ## Conclusion The perfect Easter message comes from the heart. Whether you choose a traditional religious message, a playful pun, or something completely personal, the most important thing is that it reflects your genuine care for the recipient. Use these ideas as inspiration to create your own unique Easter greetings that will bring joy and warmth to those you care about. Remember, the best Easter cards are those that spread love, hope, and happiness โ€“ the true spirit of the Easter season.`, publishDate: &quot;2024-12-01&quot;, readTime: &quot;15 min read&quot;, category: &quot;general&quot;, featuredImage: &quot;/images/blog/easter-card-messages.svg&quot; }, { id: &quot;remove-background-free-guide&quot;, title: &quot;How to Remove Background from Photos for Free: A Complete Guide&quot;, excerpt: &quot;Learn how to remove backgrounds from photos for free using various tools and techniques. Perfect for beginners and professionals alike.&quot;, content: `# How to Remove Background from Photos for Free: A Complete Guide Removing backgrounds from photos is one of the most common photo editing tasks, whether you&#x27;re creating product images, social media content, or professional portraits. The good news? You don&#x27;t need expensive software to achieve professional results. This comprehensive guide will show you multiple free methods to remove backgrounds from your photos. ## Why Remove Photo Backgrounds? - **Product photography:** Clean, professional product images - **Social media:** Eye-catching posts and stories - **Professional headshots:** Consistent, clean backgrounds - **Creative projects:** Composite images and artistic designs - **E-commerce:** Standardized product listings ## Method 1: Photo Background Remover (Recommended) Our [free AI-powered background remover](/tools/remove-background) offers the easiest and most accurate solution: ### Step-by-Step Process: 1. **Visit [Photo Background Remover](/tools/remove-background)** 2. **Upload your image** (supports JPG, PNG, WebP) 3. **Wait for AI processing** (usually 2-3 seconds) 4. **Download your result** in high quality 5. **Fine-tune if needed** using our editing tools ### Advantages: - โœ… **Completely free** - โœ… **AI-powered accuracy** - โœ… **No registration required** - โœ… **High-quality results** - โœ… **Instant processing** - โœ… Works on any device ## Method 2: Remove.bg [Remove.bg](https://www.remove.bg/) is a popular online tool for background removal: ### Features: - Automatic AI detection - Good for people and objects - API available for developers - Limited free uses per month ### How to Use: 1. Go to [remove.bg](https://www.remove.bg/) 2. Upload your image 3. Download the result 4. Use their editor for refinements ## Method 3: Canva Background Remover Integrated into [Canva&#x27;s](https://www.canva.com/) design platform: ### Process: 1. Create a [Canva account](https://www.canva.com/) (free) 2. Upload your image 3. Use the &quot;Background Remover&quot; feature 4. Download or use in designs ### Best For: - Users already using [Canva](https://www.canva.com/) - Creating designs with removed backgrounds - Social media content ## Method 4: GIMP (Free Desktop Software) For more control and advanced editing: ### Step-by-Step: 1. **Download and install [GIMP](https://www.gimp.org/)** (free) 2. **Open your image** in GIMP 3. **Use selection tools:** - Fuzzy Select Tool for similar colors - Select by Color Tool - Free Select Tool for manual selection 4. **Refine your selection:** - Use &quot;Select &gt; Border&quot; to soften edges - &quot;Select &gt; Feather&quot; for smooth transitions 5. **Delete the background:** - Press Delete key - Or use &quot;Edit &gt; Clear&quot; 6. **Export as PNG** to preserve transparency ### Advanced GIMP Techniques: - **Layer masks** for non-destructive editing - **Path tool** for precise selections - **Alpha to selection** for existing transparent areas ## Method 5: Photopea (Browser-based Photoshop Alternative) A free, web-based editor similar to Photoshop: ### Process: 1. Go to [Photopea.com](https://www.photopea.com/) 2. Open your image 3. Use selection tools (similar to Photoshop) 4. Delete background 5. Save as PNG ## Method 6: PowerPoint/Google Slides (Surprising but Effective) For simple backgrounds: ### Steps: 1. Insert your image 2. Select the image 3. Use &quot;Remove Background&quot; feature 4. Mark areas to keep/remove 5. Right-click and save as image ## Tips for Better Background Removal ### Before You Start: 1. **Choose the right image:** - High contrast between subject and background - Clear, well-defined edges - Good lighting - Minimal background complexity 2. **Image quality matters:** - Higher resolution = better results - Sharp focus on subject - Avoid motion blur ### During Editing: 1. **Zoom in for precision** when manually selecting 2. **Use feathering** to soften harsh edges 3. **Check edges carefully** at 100% zoom 4. **Save in PNG format** to preserve transparency ### After Removal: 1. **Refine edges** if needed 2. **Add subtle shadows** for realism 3. **Match lighting** when compositing 4. **Consider color correction** ## Common Challenges and Solutions ### Hair and Fur - Use specialized hair selection tools - Try multiple methods and combine results - Consider AI tools for complex hair ### Transparent Objects - Manual selection often works better - Use layer masks for gradual transparency - Consider keeping some background for context ### Complex Backgrounds - Break the task into sections - Use multiple selection tools - Consider AI-powered solutions ### Fine Details - Zoom in for precision work - Use smaller brush sizes - Take breaks to avoid eye strain ## Best Practices for Different Image Types ### Product Photos - Use consistent lighting - Shoot against simple backgrounds - Consider the final use case ### Portraits - Pay special attention to hair - Maintain natural edge softness - Consider the new background context ### Objects with Reflections - Decide whether to keep or remove reflections - Maintain realistic lighting - Consider adding new reflections ## Free vs. Paid Tools: When to Upgrade ### Stick with Free When: - Occasional use - Simple backgrounds - Learning and experimenting - Budget constraints ### Consider Paid When: - High-volume processing - Complex, detailed work - Professional requirements - Time is critical ## Conclusion Removing backgrounds from photos doesn&#x27;t have to be expensive or complicated. With tools like Photo&#x27;s [free AI background remover](/tools/remove-background), you can achieve professional results in seconds. For more complex projects, free software like [GIMP](https://www.gimp.org/) provides advanced capabilities. The key is choosing the right tool for your specific needs and taking time to refine your results. Start with our [free background remover tool](/tools/remove-background) and explore other options as your skills and requirements grow. You can also try our [AI Background Generator](/tools/ai-background-generator) to create stunning new backgrounds for your images after removing the original ones. **Ready to get started?** Try Photo&#x27;s [free background remover](/tools/remove-background) now and see the difference AI-powered editing can make!`, publishDate: &quot;2024-11-05&quot;, readTime: &quot;18 min read&quot;, category: &quot;tools&quot;, featuredImage: &quot;/images/blog/remove-background-guide.svg&quot;, relatedTool: &quot;remove-background&quot; }, { id: &quot;holi-photoshoot-ideas-2025&quot;, title: &quot;10 Unique Holi Photoshoot Ideas for Perfect Festive Clicks&quot;, excerpt: &quot;Capture the vibrant spirit of Holi with these creative photoshoot ideas. From color powder portraits to action shots, make your Holi memories unforgettable.&quot;, content: `# 10 Unique Holi Photoshoot Ideas for Perfect Festive Clicks Holi, the festival of colors, offers incredible opportunities for stunning photography. The vibrant powders, joyful expressions, and festive atmosphere create the perfect backdrop for memorable photos. Whether you&#x27;re a professional photographer or just want to capture beautiful memories, these creative ideas will help you make the most of this colorful celebration. ## Essential Holi Photography Preparation ### Camera Protection - Use **protective covers** or underwater housings - Bring **lens cleaning cloths** - Consider using **older equipment** - Have **backup gear** ready ### Safety First - Use **natural, skin-safe colors** - Protect **eyes and breathing passages** - Stay **hydrated** - Plan **escape routes** from crowded areas ## 10 Creative Holi Photoshoot Ideas ### 1. Color Powder Explosion Portraits **Setup:** Position your subject against a **dark background** **Technique:** - Use **high shutter speed** (1/1000s or faster) - **Continuous shooting mode** - Have someone **throw powder** from different angles - Capture the **moment of impact** **Pro Tips:** - Use **backlighting** to make powder glow - Try **different colored powders** for variety - Shoot from **multiple angles** - Consider **slow-motion video** for dramatic effect ### 2. Pre-Holi Clean Portrait Series **Concept:** Document the transformation from clean to colorful **Process:** - Start with **clean, white clothing** portraits - **Gradually add colors** throughout the shoot - Create a **before/during/after sequence** - Show the **progression** of the celebration **Styling Tips:** - Use **white or light-colored** clothing - **Simple backgrounds** work best - Focus on **facial expressions** - Document the **anticipation and excitement** ### 3. Action-Packed Water Balloon Shots **Equipment Needed:** - **Fast autofocus** camera - **High shutter speed** capability - **Waterproof protection** **Shooting Technique:** - **Anticipate the action** - Use **burst mode** - Focus on **expressions during impact** - Capture **water droplets** in mid-air **Creative Angles:** - **Low angle shots** for dramatic effect - **Close-ups** of facial reactions - **Wide shots** showing the full scene - **Overhead shots** of group activities ### 4. Silhouette Magic with Color Clouds **Best Time:** Golden hour or backlit conditions **Setup:** - Position subjects **between camera and light source** - Have them **throw powder into the air** - Focus on creating **dramatic silhouettes** - Use the **color powder as atmospheric elements** **Technical Settings:** - **Expose for the background light** - Use **manual focus** - Consider **HDR** for detail retention - Experiment with **different color combinations** ### 5. Macro Details of Color and Texture **Focus Areas:** - **Hands covered** in colorful powder - **Color-stained fabrics** and textures - **Powder particles** on skin - **Colorful water droplets** **Equipment:** - **Macro lens** or close-up filters - **Good lighting setup** - **Steady tripod** - **Remote shutter release** **Artistic Elements:** - Play with **depth of field** - Focus on **patterns and textures** - Capture the **fine details** of powder - Show the **interaction between colors** ### 6. Group Celebration Dynamics **Composition Ideas:** - **Circle formations** with powder throw - **Action shots** of group activities - **Candid moments** of laughter and joy - **Wide shots** showing the festival atmosphere **Shooting Strategy:** - Use **wide-angle lenses** - Capture **genuine emotions** - Focus on **interactions between people** - Document the **community spirit** ### 7. Creative Color Mixing Experiments **Concept:** Show the artistic side of color blending **Techniques:** - **Wet powder applications** - **Color gradients** on faces - **Artistic body painting** - **Abstract color patterns** **Artistic Approach:** - Focus on **color theory** - Create **intentional color combinations** - Use **brushes and tools** for application - Document the **artistic process** ### 8. Environmental Context Shots **Include:** - **Traditional Holi preparations** - **Street celebrations** - **Cultural elements** and decorations - **Food and traditional sweets** **Documentary Style:** - Capture the **broader celebration** - Show **cultural significance** - Include **architectural elements** - Document **traditional practices** ### 9. Reflection and Water Photography **Creative Opportunities:** - **Reflections** in water puddles - **Color mixing** in water containers - **Wet surfaces** with color streaks - **Rain or water spray** effects **Technical Considerations:** - **Protect equipment** from water - Use **polarizing filters** - Experiment with **different angles** - Capture both **reflection and subject** ### 10. Night Photography with Artificial Lighting **Setup Requirements:** - **Powerful external lighting** - **Colored gels** for mood lighting - **Smoke machines** for atmosphere - **Controlled environment** **Creative Effects:** - **Dramatic lighting** on colored faces - **Powder clouds** illuminated by colored lights - **Long exposure** with moving subjects - **Light painting** with colored sources ## Post-Processing Tips for Holi Photos ### Color Enhancement - **Boost vibrance** and saturation selectively - **Adjust individual** color channels - Use **masking** for targeted adjustments - **Maintain natural** skin tones ### Cleaning Up - **Remove unwanted elements** - **Enhance powder effects** - **Adjust exposure** for better detail - **Sharpen important areas** ### Creative Editing - Add **motion blur** for dynamic feel - Create **composite images** - **Enhance color contrasts** - Apply **artistic filters** sparingly ## Safety and Etiquette Guidelines ### Respect and Consent - Always **ask permission** before photographing people - **Respect personal boundaries** - Be mindful of **cultural sensitivities** - **Share photos responsibly** ### Equipment Safety - Use **protective gear** - **Clean equipment immediately** after use - Have **backup plans** - Consider **insurance** for expensive gear ### Personal Safety - Stay **aware of surroundings** - Avoid **overcrowded areas** - Keep **emergency contacts** handy - Plan **transportation** in advance ## Sharing Your Holi Photography ### Social Media Tips - Use **relevant hashtags** - **Tag locations and people** (with permission) - **Share the story** behind the photos - **Engage with the community** ### Print Considerations - Choose **high-quality printing services** - Consider **color accuracy** - Select **appropriate paper types** - Create **photo books** or albums ## Conclusion Holi photography offers endless creative possibilities. The key is to balance **technical skill** with **spontaneous creativity** while respecting the cultural significance of the festival. Whether you&#x27;re capturing explosive powder throws or intimate moments of joy, remember that the best Holi photos tell the story of celebration, community, and the triumph of color over monotony. Prepare your equipment, protect your gear, and most importantly, **immerse yourself in the celebration**. The most authentic and powerful Holi photographs come from photographers who participate in the joy while documenting it. For professional-quality results, enhance your Holi photos with our [AI Image Enhancer](/tools/ai-image-enhancer) to bring out those vibrant colors. You can also use our [Background Remover](/tools/remove-background) to isolate subjects and create stunning compositions with our [AI Background Generator](/tools/ai-background-generator). **Ready to capture amazing Holi photos?** Remember to enhance your images with our AI-powered editing tools to make your colorful memories even more vibrant!`, publishDate: &quot;2024-10-28&quot;, readTime: &quot;14 min read&quot;, category: &quot;general&quot;, featuredImage: &quot;/images/blog/holi-photoshoot-ideas.svg&quot; } ]; const getArticleById = (id) =&gt; { return blogArticles.find((article) =&gt; article.id === id); }; const BlogPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Blog&quot;, description: &quot;Stay updated with the latest tips, tutorials, and news about AI photo editing and digital image processing.&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;text-center mb-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4&quot;, children: &quot;Blog&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;, children: &quot;Discover tips, tutorials, and insights about AI photo editing and digital creativity&quot; }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;max-w-6xl mx-auto&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8&quot;, children: blogArticles.map((article) =&gt; /* @__PURE__ */ jsx(Link, { to: `/blog/${article.id}`, className: &quot;block group&quot;, children: /* @__PURE__ */ jsxs(&quot;article&quot;, { className: &quot;bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden h-full&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;h-48 bg-gray-200 relative overflow-hidden&quot;, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { src: article.featuredImage, alt: article.title, className: &quot;w-full h-full object-cover group-hover:scale-105 transition-transform duration-300&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;absolute inset-0 bg-black bg-opacity-20 group-hover:bg-opacity-10 transition-all duration-300&quot; }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;absolute bottom-4 left-4 right-4&quot;, children: /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;inline-block px-3 py-1 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full&quot;, children: article.category === &quot;general&quot; ? &quot;General&quot; : &quot;Tools&quot; }) }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;p-6 flex flex-col&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center text-sm text-gray-500 mb-3&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { children: new Date(article.publishDate).toLocaleDateString(&quot;en-US&quot;, { year: &quot;numeric&quot;, month: &quot;long&quot;, day: &quot;numeric&quot; }) }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;mx-2&quot;, children: &quot;โ€ข&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { children: article.readTime }) ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-xl font-bold text-gray-900 mb-3 group-hover:text-blue-600 transition-colors duration-300&quot;, children: article.title }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600 mb-4 line-clamp-3&quot;, children: article.excerpt }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;mt-auto pt-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;inline-flex items-center text-blue-600 group-hover:text-blue-700 font-medium transition-colors duration-300&quot;, children: [ &quot;Read More&quot;, /* @__PURE__ */ jsx(&quot;svg&quot;, { className: &quot;w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform duration-300&quot;, fill: &quot;none&quot;, stroke: &quot;currentColor&quot;, viewBox: &quot;0 0 24 24&quot;, children: /* @__PURE__ */ jsx(&quot;path&quot;, { strokeLinecap: &quot;round&quot;, strokeLinejoin: &quot;round&quot;, strokeWidth: 2, d: &quot;M9 5l7 7-7 7&quot; }) }) ] }) }) ] }) ] }) }, article.id)) }) }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-center mt-16&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-white rounded-2xl shadow-lg p-8 max-w-2xl mx-auto&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-2xl font-bold text-gray-900 mb-4&quot;, children: &quot;Ready to Transform Your Photos?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600 mb-6&quot;, children: &quot;Explore our powerful AI-powered photo editing tools and bring your creative vision to life.&quot; }), /* @__PURE__ */ jsxs( Link, { to: &quot;/tools&quot;, className: &quot;inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105&quot;, children: [ &quot;Explore Our Tools&quot;, /* @__PURE__ */ jsx(&quot;svg&quot;, { className: &quot;w-5 h-5 ml-2&quot;, fill: &quot;none&quot;, stroke: &quot;currentColor&quot;, viewBox: &quot;0 0 24 24&quot;, children: /* @__PURE__ */ jsx(&quot;path&quot;, { strokeLinecap: &quot;round&quot;, strokeLinejoin: &quot;round&quot;, strokeWidth: 2, d: &quot;M13 7l5 5m0 0l-5 5m5-5H6&quot; }) }) ] } ) ] }) }) ] }) }) ] }); }; const BlogArticlePage = () =&gt; { const { articleId } = useParams(); if (!articleId) { return /* @__PURE__ */ jsx(Navigate, { to: &quot;/blog&quot;, replace: true }); } const article = getArticleById(articleId); if (!article) { return /* @__PURE__ */ jsx(Navigate, { to: &quot;/blog&quot;, replace: true }); } const parseLine = (line) =&gt; { const regex = /(\[\s*(.*?)\s*\]\(\s*(.*?)\s*\))|(\*\*(.*?)\*\*)/g; let lastIndex = 0; const parts = []; let match; let key = 0; while ((match = regex.exec(line)) !== null) { const [fullMatch, linkFull, linkText, linkUrl, boldFull, boldText] = match; if (match.index &gt; lastIndex) { parts.push(line.substring(lastIndex, match.index)); } if (linkFull) { const isInternal = linkUrl.startsWith(&quot;/&quot;); if (isInternal) { parts.push(/* @__PURE__ */ jsx(Link, { to: linkUrl, className: &quot;text-blue-600 hover:underline&quot;, children: linkText }, key++)); } else { parts.push(/* @__PURE__ */ jsx(&quot;a&quot;, { href: linkUrl, target: &quot;_blank&quot;, rel: &quot;noopener noreferrer&quot;, className: &quot;text-blue-600 hover:underline&quot;, children: linkText }, key++)); } } else if (boldFull) { parts.push(/* @__PURE__ */ jsx(&quot;strong&quot;, { children: boldText }, key++)); } lastIndex = regex.lastIndex; } if (lastIndex &lt; line.length) { parts.push(line.substring(lastIndex)); } return parts; }; const renderContent = (content) =&gt; { const lines = content.split(&quot;\n&quot;); const processedLines = /* @__PURE__ */ new Set(); return lines.map((line, index) =&gt; { if (processedLines.has(index)) return null; const trimmedLine = line.trim(); if (trimmedLine.startsWith(&quot;# &quot;)) return /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-3xl md:text-4xl font-bold text-gray-900 mb-6 mt-10&quot;, children: trimmedLine.substring(2) }, index); if (trimmedLine.startsWith(&quot;## &quot;)) return /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-bold text-gray-900 mb-4 mt-8&quot;, children: trimmedLine.substring(3) }, index); if (trimmedLine.startsWith(&quot;### &quot;)) return /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-semibold text-gray-900 mb-3 mt-6&quot;, children: trimmedLine.substring(4) }, index); if (trimmedLine.startsWith(&quot;- &quot;)) { const listItems = []; for (let j = index; j &lt; lines.length &amp;&amp; lines[j].trim().startsWith(&quot;- &quot;); j++) { listItems.push(/* @__PURE__ */ jsx(&quot;li&quot;, { children: parseLine(lines[j].trim().substring(2)) }, j)); processedLines.add(j); } return /* @__PURE__ */ jsx(&quot;ul&quot;, { className: &quot;list-disc list-inside space-y-2 mb-4 text-gray-700&quot;, children: listItems }, index); } const numberedListMatch = trimmedLine.match(/^(\d+)\.\s(.+)/); if (numberedListMatch) { const itemNumber = parseInt(numberedListMatch[1]); const itemText = numberedListMatch[2]; return /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;mb-6&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-start&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;inline-flex items-center justify-center w-8 h-8 bg-blue-600 text-white text-sm font-bold rounded-full mr-4 mt-1 flex-shrink-0&quot;, children: itemNumber }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex-1&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;text-gray-900 font-semibold text-lg mb-2&quot;, children: parseLine(itemText) }) }) ] }) }, index); } if (trimmedLine.length &gt; 0) { return /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-700 mb-4 leading-relaxed&quot;, children: parseLine(trimmedLine) }, index); } return null; }).filter(Boolean); }; return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: article.title, description: article.excerpt } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;container mx-auto px-4 py-12&quot;, children: [ /* @__PURE__ */ jsx(&quot;nav&quot;, { className: &quot;mb-8&quot;, children: /* @__PURE__ */ jsx( Link, { to: &quot;/blog&quot;, className: &quot;text-blue-600 hover:text-blue-700 font-medium transition-colors duration-300&quot;, children: &quot;โ† Back to Blog&quot; } ) }), /* @__PURE__ */ jsxs(&quot;article&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;h-64 md:h-80 bg-gray-200 rounded-xl mb-8 relative overflow-hidden&quot;, children: [ /* @__PURE__ */ jsx( &quot;img&quot;, { src: article.featuredImage, alt: article.title, className: &quot;w-full h-full object-cover&quot; } ), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;absolute inset-0 bg-black bg-opacity-20&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;absolute bottom-6 left-6 right-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;inline-block px-4 py-2 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full mb-4&quot;, children: article.category === &quot;general&quot; ? &quot;General&quot; : &quot;Tools&quot; }), /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-2xl md:text-3xl font-bold text-white&quot;, children: article.title }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-white rounded-xl shadow-lg p-8&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center justify-between mb-8 pb-6 border-b border-gray-200&quot;, children: [ /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex items-center text-sm text-gray-500&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { children: new Date(article.publishDate).toLocaleDateString(&quot;en-US&quot;, { year: &quot;numeric&quot;, month: &quot;long&quot;, day: &quot;numeric&quot; }) }), /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;mx-2&quot;, children: &quot;โ€ข&quot; }), /* @__PURE__ */ jsx(&quot;span&quot;, { children: article.readTime }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;flex items-center space-x-4&quot;, children: /* @__PURE__ */ jsx(&quot;button&quot;, { className: &quot;text-gray-400 hover:text-blue-600 transition-colors duration-300&quot;, children: /* @__PURE__ */ jsx(&quot;svg&quot;, { className: &quot;w-5 h-5&quot;, fill: &quot;currentColor&quot;, viewBox: &quot;0 0 20 20&quot;, children: /* @__PURE__ */ jsx(&quot;path&quot;, { d: &quot;M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z&quot; }) }) }) }) ] }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;prose prose-lg max-w-none&quot;, children: renderContent(article.content) }), /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;mt-12 pt-8 border-t border-gray-200&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl p-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-bold text-gray-900 mb-3&quot;, children: &quot;Ready to Try Our AI Tools?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-gray-600 mb-4&quot;, children: &quot;Transform your photos with our powerful AI-powered editing tools.&quot; }), /* @__PURE__ */ jsxs( Link, { to: &quot;/tools&quot;, className: &quot;inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105&quot;, children: [ &quot;Explore Tools&quot;, /* @__PURE__ */ jsx(&quot;svg&quot;, { className: &quot;w-5 h-5 ml-2&quot;, fill: &quot;none&quot;, stroke: &quot;currentColor&quot;, viewBox: &quot;0 0 24 24&quot;, children: /* @__PURE__ */ jsx(&quot;path&quot;, { strokeLinecap: &quot;round&quot;, strokeLinejoin: &quot;round&quot;, strokeWidth: 2, d: &quot;M13 7l5 5m0 0l-5 5m5-5H6&quot; }) }) ] } ) ] }) }) ] }) ] }) ] }) }) ] }); }; const PrivacyPolicyPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Privacy Policy&quot;, description: &quot;Learn how ModernPhotoTools.com protects your privacy and handles your data when you use our AI photo editing tools.&quot; } ), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;, children: [ &quot;Privacy &quot;, /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600&quot;, children: &quot;Policy&quot; }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-700 mb-8&quot;, children: &quot;Learn how we protect your privacy and handle your data when you use our AI photo editing tools&quot; }) ] }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-white&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;prose prose-lg max-w-none text-gray-700&quot;, children: [ /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-gray-500 mb-8&quot;, children: [ &quot;Last updated: &quot;, (/* @__PURE__ */ new Date()).toLocaleDateString() ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Introduction&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;At &quot;, /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;ModernPhotoTools.com&quot; }), &quot;, your privacy is important to us. This Privacy Policy outlines how we collect, use, and protect your information when using our website and AI-powered photo editing tools.&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Information We Collect&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-medium mt-4 mb-1&quot;, children: &quot;๐Ÿ“ท Images &amp; Files&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;When you use our tools (e.g., background remover, blurring, resizing), your uploaded images are processed securely on our servers. We do &quot;, /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;not store&quot; }), &quot; your images permanently โ€” they are &quot;, /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;deleted automatically&quot; }), &quot; after processing.&quot; ] }), /* @__PURE__ */ jsx(&quot;h3&quot;, { className: &quot;text-xl font-medium mt-4 mb-1&quot;, children: &quot;๐Ÿ“Š Usage Data&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We may collect anonymous usage data such as:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Pages visited and time spent&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Tools used and frequency&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Browser type and device details&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;IP address and general location&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;How We Use Your Information&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;The data we collect helps us to:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Deliver fast and accurate photo editing via AI&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Improve tool performance and user experience&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Analyze anonymous usage patterns&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Maintain website security and stability&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿ” Data Security&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We prioritize the safety of your data through:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Encrypted connections (SSL/TLS)&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Immediate deletion of uploaded images&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;No permanent image storage&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Restricted, monitored server access&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿช Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We may use cookies to enhance your browsing experience. You can manage your cookie preferences in your browser settings.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿ›ก๏ธ Your Rights&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You have the right to:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Know what data we collect&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Request deletion of your data&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Opt-out of certain data collection&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Contact us regarding privacy concerns&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿ“ฌ Contact Us&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;For any privacy-related inquiries, please reach out to us through the &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, className: &quot;text-blue-600 hover:underline&quot;, children: &quot;contact page&quot; }), &quot;.&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿ”„ Updates to This Policy&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;This policy may be updated occasionally. Changes will be reflected on this page along with the latest revision date.&quot; }) ] }) ] }) }) }) }) ] }); }; const TermsOfUsePage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Terms of Use&quot;, description: &quot;Read the terms and conditions for using ModernPhotoTools.com and our AI-powered photo editing services.&quot; } ), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;, children: [ &quot;Terms of &quot;, /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600&quot;, children: &quot;Use&quot; }) ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-700 mb-8&quot;, children: &quot;Read the terms and conditions for using our AI-powered photo editing services.&quot; }) ] }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-white&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;prose prose-lg max-w-none text-gray-700&quot;, children: [ /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-gray-500 mb-8&quot;, children: [ &quot;Last updated: &quot;, (/* @__PURE__ */ new Date()).toLocaleDateString() ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Acceptance of Terms&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;By accessing and using &quot;, /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;ModernPhotoTools.com&quot; }), &quot;, you accept and agree to be bound by the terms and conditions outlined below. If you do not agree, please do not use our services.&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Use License&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You are granted a temporary, non-exclusive license to use ModernPhotoTools.com for personal, non-commercial purposes only. Under this license, you may not:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Modify or copy the materials&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use the materials for commercial purposes or public display&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Attempt to reverse-engineer any software on the site&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Remove copyright or proprietary notations&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Acceptable Use&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You agree to use our platform lawfully. You must not:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { className: &quot;list-disc list-inside ml-4&quot;, children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Upload copyrighted or infringing materials&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Submit offensive, illegal, or harmful content&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use services for deepfakes or deceptive media&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Disrupt our servers or services&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Use bots or automation without permission&quot; }) ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Content Ownership&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You retain full ownership of any images you upload. We do not claim rights over your content. By using our tools, you grant us a temporary license to process your content securely and privately.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Service Availability&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;While we aim for high availability, we do not guarantee uninterrupted access. Downtime may occur due to maintenance or unforeseen technical issues.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Disclaimer&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &#x27;All materials and tools are provided &quot;as is&quot;. We disclaim all warrantiesโ€”express or impliedโ€”including but not limited to merchantability, fitness for a particular purpose, or non-infringement.&#x27; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Limitations&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;In no event shall ModernPhotoTools.com or its affiliates be liable for any indirect or consequential damages, including data loss or business interruption, even if notified of such possibility.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Privacy Policy&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;Your use of our services is also governed by our &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/privacy-policy&quot;, className: &quot;text-blue-600 hover:underline&quot;, children: &quot;Privacy Policy&quot; }), &quot;. Please review it to understand how we handle your data.&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Modifications&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We may update these Terms of Use at any time without notice. Continued use of our website indicates your acceptance of the most recent version.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { className: &quot;mb-8&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;Governing Law&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;These terms shall be governed by and interpreted in accordance with the laws applicable in your jurisdiction. Any legal disputes shall be resolved under these laws.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;section&quot;, { children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { className: &quot;text-2xl font-semibold mb-2&quot;, children: &quot;๐Ÿ“ฌ Contact Us&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;If you have any questions about these Terms of Use, please &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, className: &quot;text-blue-600 hover:underline&quot;, children: &quot;contact us&quot; }), &quot;.&quot; ] }) ] }) ] }) }) }) }) ] }); }; const DMCAPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;DMCA Notice&quot;, description: &quot;Digital Millennium Copyright Act (DMCA) notice and takedown policy for ModernPhotoTools.com.&quot; } ), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-3xl mx-auto text-center&quot;, children: [ /* @__PURE__ */ jsxs(&quot;h1&quot;, { className: &quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;, children: [ /* @__PURE__ */ jsx(&quot;span&quot;, { className: &quot;text-blue-600&quot;, children: &quot;DMCA&quot; }), &quot; Notice&quot; ] }), /* @__PURE__ */ jsx(&quot;p&quot;, { className: &quot;text-xl text-gray-700 mb-8&quot;, children: &quot;Our copyright policy and takedown procedures in accordance with the Digital Millennium Copyright Act (DMCA).&quot; }) ] }) }) }), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;py-16 bg-white&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;container mx-auto px-4&quot;, children: /* @__PURE__ */ jsx(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;prose prose-lg max-w-none text-gray-700&quot;, children: [ /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;DMCA Policy Overview&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;At &quot;, /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;ModernPhotoTools.com&quot; }), &quot;, we respect the intellectual property rights of others and expect our users to do the same. This DMCA Policy outlines how we respond to copyright infringement notifications in compliance with the&quot;, /* @__PURE__ */ jsx(&quot;em&quot;, { children: &quot;Digital Millennium Copyright Act&quot; }), &quot; (DMCA).&quot; ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Submitting a DMCA Takedown Notice&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;If you believe that material on our website infringes your copyright, please submit a written notification including:&quot; }), /* @__PURE__ */ jsxs(&quot;ol&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Identification&quot; }), &quot; of the copyrighted work.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Identification&quot; }), &quot; of the allegedly infringing material with enough detail for us to locate it.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Your contact information&quot; }), &quot;: name, address, phone number, and email.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Statement&quot; }), &quot; that you have a good faith belief the use is unauthorized.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Statement&quot; }), &quot; that the notice is accurate and you are authorized to act on behalf of the copyright owner.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Your physical or electronic signature&quot; }), &quot; (typing your full name suffices).&quot; ] }) ] }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;Send your takedown notice via our &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, className: &quot;text-blue-600 underline&quot;, children: &quot;Contact Page&quot; }), &#x27; and include &quot;DMCA Takedown Notice&quot; in the subject line.&#x27; ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Submitting a Counter-Notification&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;If you believe your content was removed by mistake or misidentification, you may submit a counter-notice containing:&quot; }), /* @__PURE__ */ jsxs(&quot;ol&quot;, { children: [ /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Your physical or electronic signature.&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Identification of the removed material and its location prior to removal.&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;A good faith statement under penalty of perjury that the removal was in error.&quot; }), /* @__PURE__ */ jsx(&quot;li&quot;, { children: &quot;Your name, address, phone number, and consent to the jurisdiction of the relevant U.S. Federal District Court.&quot; }) ] }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;Counter-notices should also be submitted via our &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, className: &quot;text-blue-600 underline&quot;, children: &quot;Contact Page&quot; }), &#x27; with &quot;DMCA Counter Notice&quot; in the subject.&#x27; ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Repeat Infringers&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We may terminate accounts or restrict access for users who repeatedly violate copyright policies.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;False Claims Warning&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;Under Section 512(f) of the DMCA, anyone who knowingly submits false claims may be liable for damages, including costs and attorneyโ€™s fees.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;No Legal Advice&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;This DMCA page is provided for informational purposes only and does not constitute legal advice. Please consult a qualified attorney for legal guidance.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Contact Information&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;For DMCA-related issues, please reach out via our &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, className: &quot;text-blue-600 underline&quot;, children: &quot;Contact Page&quot; }), &#x27; with &quot;DMCA&quot; in the subject line.&#x27; ] }) ] }) }) }) }) ] }); }; const CookiesPolicyPage = () =&gt; { return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( SEO, { title: &quot;Cookies Policy&quot;, description: &quot;Learn about how ModernPhotoTools.com uses cookies to enhance your browsing experience and improve our services.&quot; } ), /* @__PURE__ */ jsx(&quot;section&quot;, { className: &quot;bg-white text-gray-800 py-16 px-4 md:px-6 lg:px-8&quot;, children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;max-w-4xl mx-auto&quot;, children: [ /* @__PURE__ */ jsx(&quot;h1&quot;, { className: &quot;text-3xl md:text-4xl font-extrabold text-gray-900 mb-8&quot;, children: &quot;Cookies Policy&quot; }), /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;prose prose-lg prose-gray max-w-none&quot;, children: [ /* @__PURE__ */ jsx(&quot;p&quot;, { children: &#x27;This Cookies Policy explains how ModernPhotoTools.com (&quot;we&quot;, &quot;us&quot;, or &quot;our&quot;) uses cookies and similar technologies when you visit our website. It explains what these technologies are and why we use them, as well as your rights to control our use of them.&#x27; }), /* @__PURE__ */ jsx(&quot;hr&quot;, { className: &quot;my-10 border-gray-200&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;What Are Cookies?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;Cookies are small data files that are placed on your computer or mobile device when you visit a website. Cookies are widely used by website owners to make their websites work, or to work more efficiently, as well as to provide reporting information.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Why Do We Use Cookies?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &#x27;We use cookies for several reasons. Some cookies are required for technical reasons in order for our website to operate, and we refer to these as &quot;essential&quot; or &quot;strictly necessary&quot; cookies. Other cookies enable us to track and target the interests of our users to enhance the experience on our website.&#x27; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Types of Cookies We Use&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { children: &quot;Essential Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;These cookies are strictly necessary to provide you with services available through our website and to use some of its features, such as access to secure areas. Because these cookies are strictly necessary to deliver the website, you cannot refuse them without impacting how our site functions.&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { children: &quot;Performance and Analytics Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;These cookies collect information about how visitors use our website, for instance which pages visitors go to most often, and if they get error messages from web pages. These cookies don&#x27;t collect information that identifies a visitor. All information these cookies collect is aggregated and therefore anonymous.&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { children: &quot;Functionality Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;These cookies allow our website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features. These cookies can also be used to remember changes you have made to text size, fonts, and other parts of web pages that you can customize.&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { children: &quot;Targeting and Advertising Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;These cookies are used to deliver adverts more relevant to you and your interests. They are also used to limit the number of times you see an advertisement as well as help measure the effectiveness of the advertising campaign.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Third-Party Cookies&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;In addition to our own cookies, we may also use various third-party cookies to report usage statistics of the service, deliver advertisements on and through the service, and so on. These third-party cookies are governed by the respective privacy policies of the third parties providing them.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;How Can You Control Cookies?&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You have the right to decide whether to accept or reject cookies. You can exercise your cookie preferences by clicking on the appropriate opt-out links provided in the cookie banner when you first visit our website.&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;You can also set or amend your web browser controls to accept or refuse cookies. If you choose to reject cookies, you may still use our website though your access to some functionality and areas of our website may be restricted.&quot; }), /* @__PURE__ */ jsx(&quot;h3&quot;, { children: &quot;Browser Controls&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;Most web browsers allow you to control cookies through their settings preferences. However, if you limit the ability of websites to set cookies, you may worsen your overall user experience, since it will no longer be personalized to you.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Cookie Retention&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;Cookies set by us will be retained for different periods depending on their purpose:&quot; }), /* @__PURE__ */ jsxs(&quot;ul&quot;, { children: [ /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Session cookies:&quot; }), &quot; Temporary and deleted when you close your browser.&quot; ] }), /* @__PURE__ */ jsxs(&quot;li&quot;, { children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Persistent cookies:&quot; }), &quot; Remain on your device for a set period or until you delete them.&quot; ] }) ] }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Updates to This Policy&quot; }), /* @__PURE__ */ jsx(&quot;p&quot;, { children: &quot;We may update this Cookies Policy from time to time in order to reflect changes to the cookies we use or for other operational, legal, or regulatory reasons. Please revisit this policy regularly to stay informed about our use of cookies.&quot; }), /* @__PURE__ */ jsx(&quot;h2&quot;, { children: &quot;Contact Us&quot; }), /* @__PURE__ */ jsxs(&quot;p&quot;, { children: [ &quot;If you have any questions about our use of cookies or other technologies, please contact us through our &quot;, /* @__PURE__ */ jsx(&quot;a&quot;, { href: &quot;/contact&quot;, children: &quot;contact page&quot; }), &quot;.&quot; ] }), /* @__PURE__ */ jsxs(&quot;p&quot;, { className: &quot;text-sm text-gray-500 mt-10&quot;, children: [ /* @__PURE__ */ jsx(&quot;strong&quot;, { children: &quot;Last updated:&quot; }), &quot; &quot;, (/* @__PURE__ */ new Date()).toLocaleDateString() ] }) ] }) ] }) }) ] }); }; function App() { return /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsxs(&quot;div&quot;, { className: &quot;flex flex-col min-h-screen&quot;, children: [ /* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx(&quot;main&quot;, { className: &quot;flex-grow&quot;, children: /* @__PURE__ */ jsxs(Routes, { children: [ /* @__PURE__ */ jsx(Route, { path: &quot;/&quot;, element: /* @__PURE__ */ jsx(HomePage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/tools&quot;, element: /* @__PURE__ */ jsx(ToolsPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/tools/:toolId&quot;, element: /* @__PURE__ */ jsx(ToolPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/about&quot;, element: /* @__PURE__ */ jsx(AboutPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/contact&quot;, element: /* @__PURE__ */ jsx(ContactPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/blog&quot;, element: /* @__PURE__ */ jsx(BlogPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/blog/:articleId&quot;, element: /* @__PURE__ */ jsx(BlogArticlePage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/privacy-policy&quot;, element: /* @__PURE__ */ jsx(PrivacyPolicyPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/terms-of-use&quot;, element: /* @__PURE__ */ jsx(TermsOfUsePage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/dmca&quot;, element: /* @__PURE__ */ jsx(DMCAPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;/cookies-policy&quot;, element: /* @__PURE__ */ jsx(CookiesPolicyPage, {}) }), /* @__PURE__ */ jsx(Route, { path: &quot;*&quot;, element: /* @__PURE__ */ jsx(NotFoundPage, {}) }) ] }) }), /* @__PURE__ */ jsx(Footer, {}) ] }) }); } function render(url, context) { return ReactDOMServer.renderToString( /* @__PURE__ */ jsx(StaticRouter, { location: url, children: /* @__PURE__ */ jsx(App, {}) }) ); } export { render }; </div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ favicon.svg</div> <div class="content"></div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ images</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ blog</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ai-background-generators.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#4158D0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#C850C0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFCC70;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;linearGradient id=&quot;frameGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#FFFFFF;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#F0F0F0;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Main Image Frame --&gt; &lt;rect x=&quot;50&quot; y=&quot;50&quot; width=&quot;450&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;url(#frameGradient)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Image Content (Simplified Landscape) --&gt; &lt;rect x=&quot;60&quot; y=&quot;60&quot; width=&quot;430&quot; height=&quot;280&quot; rx=&quot;5&quot; fill=&quot;#87CEEB&quot; /&gt; &lt;polygon points=&quot;60,340 490,340 490,200 400,240 300,180 200,220 100,160 60,200&quot; fill=&quot;#228B22&quot; /&gt; &lt;circle cx=&quot;430&quot; cy=&quot;100&quot; r=&quot;40&quot; fill=&quot;#FFD700&quot; /&gt; &lt;!-- AI Generated Alternatives --&gt; &lt;rect x=&quot;550&quot; y=&quot;50&quot; width=&quot;200&quot; height=&quot;120&quot; rx=&quot;5&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;rect x=&quot;560&quot; y=&quot;60&quot; width=&quot;180&quot; height=&quot;100&quot; rx=&quot;3&quot; fill=&quot;#E6F7FF&quot; /&gt; &lt;circle cx=&quot;650&quot; cy=&quot;110&quot; r=&quot;30&quot; fill=&quot;#87CEFA&quot; /&gt; &lt;polygon points=&quot;560,160 740,160 740,120 700,130 650,110 600,125 560,115&quot; fill=&quot;#90EE90&quot; /&gt; &lt;rect x=&quot;550&quot; y=&quot;190&quot; width=&quot;200&quot; height=&quot;120&quot; rx=&quot;5&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;rect x=&quot;560&quot; y=&quot;200&quot; width=&quot;180&quot; height=&quot;100&quot; rx=&quot;3&quot; fill=&quot;#FFF0F5&quot; /&gt; &lt;polygon points=&quot;560,300 740,300 740,200 650,250 560,220&quot; fill=&quot;#DDA0DD&quot; /&gt; &lt;rect x=&quot;550&quot; y=&quot;330&quot; width=&quot;200&quot; height=&quot;50&quot; rx=&quot;5&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;650&quot; y=&quot;360&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;14&quot; fill=&quot;#333&quot;&gt;More Options&lt;/text&gt; &lt;!-- AI Icon --&gt; &lt;circle cx=&quot;100&quot; cy=&quot;100&quot; r=&quot;25&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;100&quot; y=&quot;105&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#4158D0&quot;&gt;AI&lt;/text&gt; &lt;!-- Title Overlay --&gt; &lt;rect x=&quot;60&quot; y=&quot;320&quot; width=&quot;430&quot; height=&quot;60&quot; fill=&quot;rgba(255,255,255,0.85)&quot; rx=&quot;5&quot; /&gt; &lt;text x=&quot;275&quot; y=&quot;345&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;18&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;AI Background Generators&lt;/text&gt; &lt;text x=&quot;275&quot; y=&quot;365&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;14&quot; fill=&quot;#666&quot;&gt;Transform your photos with stunning backgrounds&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ai-cartoon-effect.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#4158D0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#C850C0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFCC70;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Before/After Comparison --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Original Photo --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Realistic Photo Representation --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Simplified Realistic Portrait --&gt; &lt;g&gt; &lt;!-- Face --&gt; &lt;ellipse cx=&quot;130&quot; cy=&quot;100&quot; rx=&quot;80&quot; ry=&quot;90&quot; fill=&quot;#F5D0A9&quot; /&gt; &lt;!-- Hair --&gt; &lt;path d=&quot;M50,100 C50,40 210,40 210,100 L210,60 C210,20 50,20 50,60 Z&quot; fill=&quot;#8A4B08&quot; /&gt; &lt;!-- Eyes --&gt; &lt;ellipse cx=&quot;100&quot; cy=&quot;90&quot; rx=&quot;12&quot; ry=&quot;8&quot; fill=&quot;white&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;ellipse cx=&quot;160&quot; cy=&quot;90&quot; rx=&quot;12&quot; ry=&quot;8&quot; fill=&quot;white&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;circle cx=&quot;100&quot; cy=&quot;90&quot; r=&quot;5&quot; fill=&quot;#333&quot; /&gt; &lt;circle cx=&quot;160&quot; cy=&quot;90&quot; r=&quot;5&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Eyebrows --&gt; &lt;path d=&quot;M85,75 Q100,65 115,75&quot; fill=&quot;none&quot; stroke=&quot;#8A4B08&quot; stroke-width=&quot;3&quot; /&gt; &lt;path d=&quot;M145,75 Q160,65 175,75&quot; fill=&quot;none&quot; stroke=&quot;#8A4B08&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Nose --&gt; &lt;path d=&quot;M130,95 Q135,115 130,120 Q125,115 130,95&quot; fill=&quot;#F5D0A9&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Mouth --&gt; &lt;path d=&quot;M110,140 Q130,150 150,140&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; /&gt; &lt;!-- Neck --&gt; &lt;path d=&quot;M110,190 L110,260 L150,260 L150,190&quot; fill=&quot;#F5D0A9&quot; /&gt; &lt;!-- Shirt --&gt; &lt;path d=&quot;M50,260 L110,190 L150,190 L210,260&quot; fill=&quot;#5882FA&quot; /&gt; &lt;!-- Realistic Details --&gt; &lt;path d=&quot;M100,85 Q100,83 102,83&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;0.5&quot; /&gt; &lt;path d=&quot;M160,85 Q160,83 162,83&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;0.5&quot; /&gt; &lt;path d=&quot;M125,140 Q130,142 135,140&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;0.5&quot; /&gt; &lt;path d=&quot;M70,100 Q65,110 70,120&quot; fill=&quot;none&quot; stroke=&quot;#8A4B08&quot; stroke-width=&quot;0.5&quot; /&gt; &lt;path d=&quot;M190,100 Q195,110 190,120&quot; fill=&quot;none&quot; stroke=&quot;#8A4B08&quot; stroke-width=&quot;0.5&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Original Photo&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;120&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;70&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Original Photo&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Cartoon Version --&gt; &lt;g transform=&quot;translate(450, 50)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Cartoon Representation --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Cartoon Style Portrait --&gt; &lt;g&gt; &lt;!-- Face --&gt; &lt;ellipse cx=&quot;130&quot; cy=&quot;100&quot; rx=&quot;80&quot; ry=&quot;90&quot; fill=&quot;#FFD59E&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Hair --&gt; &lt;path d=&quot;M50,100 C50,40 210,40 210,100 L210,60 C210,20 50,20 50,60 Z&quot; fill=&quot;#6E2C00&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Eyes (Larger, More Expressive) --&gt; &lt;ellipse cx=&quot;100&quot; cy=&quot;90&quot; rx=&quot;15&quot; ry=&quot;12&quot; fill=&quot;white&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;ellipse cx=&quot;160&quot; cy=&quot;90&quot; rx=&quot;15&quot; ry=&quot;12&quot; fill=&quot;white&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;circle cx=&quot;100&quot; cy=&quot;90&quot; r=&quot;7&quot; fill=&quot;#000&quot; /&gt; &lt;circle cx=&quot;160&quot; cy=&quot;90&quot; r=&quot;7&quot; fill=&quot;#000&quot; /&gt; &lt;circle cx=&quot;103&quot; cy=&quot;87&quot; r=&quot;2&quot; fill=&quot;white&quot; /&gt; &lt;circle cx=&quot;163&quot; cy=&quot;87&quot; r=&quot;2&quot; fill=&quot;white&quot; /&gt; &lt;!-- Eyebrows (Exaggerated) --&gt; &lt;path d=&quot;M85,70 Q100,55 115,70&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;4&quot; /&gt; &lt;path d=&quot;M145,70 Q160,55 175,70&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;4&quot; /&gt; &lt;!-- Nose (Simplified) --&gt; &lt;path d=&quot;M130,95 Q140,115 130,120&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Mouth (More Expressive) --&gt; &lt;path d=&quot;M110,140 Q130,155 150,140&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Neck --&gt; &lt;path d=&quot;M110,190 L110,260 L150,260 L150,190&quot; fill=&quot;#FFD59E&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Shirt --&gt; &lt;path d=&quot;M50,260 L110,190 L150,190 L210,260&quot; fill=&quot;#5DADE2&quot; stroke=&quot;#000&quot; stroke-width=&quot;3&quot; /&gt; &lt;!-- Cartoon Effects --&gt; &lt;circle cx=&quot;70&quot; cy=&quot;70&quot; r=&quot;5&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;1&quot; /&gt; &lt;circle cx=&quot;75&quot; cy=&quot;65&quot; r=&quot;3&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M190,70 L200,60&quot; stroke=&quot;#000&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M195,70 L205,60&quot; stroke=&quot;#000&quot; stroke-width=&quot;1&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Cartoon Effect&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;120&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;70&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Cartoon Effect&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- AI Transformation Arrow --&gt; &lt;g transform=&quot;translate(370, 150)&quot;&gt; &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;30&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;0&quot; y=&quot;5&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#4158D0&quot;&gt;AI&lt;/text&gt; &lt;path d=&quot;M-15,0 L15,0 M5,-10 L15,0 L5,10&quot; stroke=&quot;#4158D0&quot; stroke-width=&quot;3&quot; fill=&quot;none&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;AI Cartoon Effect Transformation&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ai-image-enhancement.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#667eea;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#764ba2;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;linearGradient id=&quot;cardGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#ffffff;stop-opacity:0.95&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#f8fafc;stop-opacity:0.95&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;glow&quot;&gt; &lt;feGaussianBlur stdDeviation=&quot;3&quot; result=&quot;coloredBlur&quot;/&gt; &lt;feMerge&gt; &lt;feMergeNode in=&quot;coloredBlur&quot;/&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot;/&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot;/&gt; &lt;!-- Floating particles --&gt; &lt;circle cx=&quot;100&quot; cy=&quot;80&quot; r=&quot;3&quot; fill=&quot;#ffffff&quot; opacity=&quot;0.6&quot;&gt; &lt;animate attributeName=&quot;cy&quot; values=&quot;80;60;80&quot; dur=&quot;3s&quot; repeatCount=&quot;indefinite&quot;/&gt; &lt;/circle&gt; &lt;circle cx=&quot;700&quot; cy=&quot;120&quot; r=&quot;2&quot; fill=&quot;#ffffff&quot; opacity=&quot;0.4&quot;&gt; &lt;animate attributeName=&quot;cy&quot; values=&quot;120;100;120&quot; dur=&quot;4s&quot; repeatCount=&quot;indefinite&quot;/&gt; &lt;/circle&gt; &lt;circle cx=&quot;650&quot; cy=&quot;300&quot; r=&quot;2.5&quot; fill=&quot;#ffffff&quot; opacity=&quot;0.5&quot;&gt; &lt;animate attributeName=&quot;cy&quot; values=&quot;300;280;300&quot; dur=&quot;3.5s&quot; repeatCount=&quot;indefinite&quot;/&gt; &lt;/circle&gt; &lt;!-- Main content card --&gt; &lt;rect x=&quot;100&quot; y=&quot;60&quot; width=&quot;600&quot; height=&quot;280&quot; rx=&quot;20&quot; fill=&quot;url(#cardGradient)&quot; filter=&quot;url(#glow)&quot;/&gt; &lt;!-- Before/After image representation --&gt; &lt;g transform=&quot;translate(130, 90)&quot;&gt; &lt;!-- Before image (left) --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;120&quot; height=&quot;80&quot; rx=&quot;8&quot; fill=&quot;#e2e8f0&quot; stroke=&quot;#cbd5e1&quot; stroke-width=&quot;2&quot;/&gt; &lt;text x=&quot;60&quot; y=&quot;45&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;#64748b&quot;&gt;Before&lt;/text&gt; &lt;!-- Pixelated/low quality effect --&gt; &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#94a3b8&quot;/&gt; &lt;rect x=&quot;20&quot; y=&quot;10&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#cbd5e1&quot;/&gt; &lt;rect x=&quot;30&quot; y=&quot;10&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#94a3b8&quot;/&gt; &lt;rect x=&quot;10&quot; y=&quot;20&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#cbd5e1&quot;/&gt; &lt;rect x=&quot;20&quot; y=&quot;20&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#94a3b8&quot;/&gt; &lt;rect x=&quot;30&quot; y=&quot;20&quot; width=&quot;8&quot; height=&quot;8&quot; fill=&quot;#cbd5e1&quot;/&gt; &lt;/g&gt; &lt;!-- Arrow --&gt; &lt;g transform=&quot;translate(280, 120)&quot;&gt; &lt;path d=&quot;M0,10 L30,10 M25,5 L30,10 L25,15&quot; stroke=&quot;#667eea&quot; stroke-width=&quot;3&quot; fill=&quot;none&quot; stroke-linecap=&quot;round&quot;/&gt; &lt;text x=&quot;15&quot; y=&quot;35&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#667eea&quot; font-weight=&quot;bold&quot;&gt;AI&lt;/text&gt; &lt;/g&gt; &lt;!-- After image (right) --&gt; &lt;g transform=&quot;translate(340, 90)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;120&quot; height=&quot;80&quot; rx=&quot;8&quot; fill=&quot;#f0f9ff&quot; stroke=&quot;#0ea5e9&quot; stroke-width=&quot;2&quot;/&gt; &lt;text x=&quot;60&quot; y=&quot;45&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;#0369a1&quot;&gt;After&lt;/text&gt; &lt;!-- High quality/enhanced effect --&gt; &lt;circle cx=&quot;30&quot; cy=&quot;25&quot; r=&quot;8&quot; fill=&quot;#38bdf8&quot; opacity=&quot;0.7&quot;/&gt; &lt;circle cx=&quot;50&quot; cy=&quot;35&quot; r=&quot;6&quot; fill=&quot;#0ea5e9&quot; opacity=&quot;0.8&quot;/&gt; &lt;circle cx=&quot;70&quot; cy=&quot;25&quot; r=&quot;7&quot; fill=&quot;#38bdf8&quot; opacity=&quot;0.6&quot;/&gt; &lt;path d=&quot;M20,50 Q40,40 60,50 Q80,60 100,50&quot; stroke=&quot;#0ea5e9&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot;/&gt; &lt;/g&gt; &lt;!-- AI Enhancement Icons --&gt; &lt;g transform=&quot;translate(500, 100)&quot;&gt; &lt;!-- Brightness icon --&gt; &lt;circle cx=&quot;20&quot; cy=&quot;20&quot; r=&quot;8&quot; fill=&quot;#fbbf24&quot; opacity=&quot;0.8&quot;/&gt; &lt;path d=&quot;M20,5 L20,10 M35,20 L30,20 M20,35 L20,30 M5,20 L10,20 M29.14,10.86 L25.86,14.14 M29.14,29.14 L25.86,25.86 M10.86,10.86 L14.14,14.14 M10.86,29.14 L14.14,25.86&quot; stroke=&quot;#f59e0b&quot; stroke-width=&quot;1.5&quot; stroke-linecap=&quot;round&quot;/&gt; &lt;!-- Contrast icon --&gt; &lt;g transform=&quot;translate(0, 50)&quot;&gt; &lt;circle cx=&quot;20&quot; cy=&quot;20&quot; r=&quot;12&quot; fill=&quot;#6b7280&quot;/&gt; &lt;path d=&quot;M20,8 A12,12 0 0,1 20,32 Z&quot; fill=&quot;#ffffff&quot;/&gt; &lt;/g&gt; &lt;!-- Sharpness icon --&gt; &lt;g transform=&quot;translate(50, 20)&quot;&gt; &lt;polygon points=&quot;20,5 30,25 10,25&quot; fill=&quot;#8b5cf6&quot; opacity=&quot;0.8&quot;/&gt; &lt;polygon points=&quot;20,8 27,22 13,22&quot; fill=&quot;#ffffff&quot;/&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;text x=&quot;400&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;24&quot; font-weight=&quot;bold&quot; fill=&quot;#1e293b&quot;&gt;AI Image Enhancement&lt;/text&gt; &lt;text x=&quot;400&quot; y=&quot;275&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;14&quot; fill=&quot;#64748b&quot;&gt;Transform Your Photos with Artificial Intelligence&lt;/text&gt; &lt;!-- Decorative elements --&gt; &lt;g transform=&quot;translate(150, 300)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;40&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#667eea&quot; opacity=&quot;0.6&quot;/&gt; &lt;rect x=&quot;50&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#764ba2&quot; opacity=&quot;0.4&quot;/&gt; &lt;rect x=&quot;120&quot; y=&quot;0&quot; width=&quot;30&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#667eea&quot; opacity=&quot;0.8&quot;/&gt; &lt;/g&gt; &lt;g transform=&quot;translate(450, 300)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;50&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#764ba2&quot; opacity=&quot;0.5&quot;/&gt; &lt;rect x=&quot;60&quot; y=&quot;0&quot; width=&quot;35&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#667eea&quot; opacity=&quot;0.7&quot;/&gt; &lt;rect x=&quot;105&quot; y=&quot;0&quot; width=&quot;45&quot; height=&quot;4&quot; rx=&quot;2&quot; fill=&quot;#764ba2&quot; opacity=&quot;0.6&quot;/&gt; &lt;/g&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ai-photo-upscaling.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#4158D0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#C850C0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFCC70;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Main Comparison Area --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Before Image (Low Resolution) --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Pixelated Image Representation --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;!-- Create a grid of large pixels to represent low resolution --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Pixelated Mountain Scene --&gt; &lt;g&gt; &lt;!-- Sky --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;#87CEEB&quot; /&gt; &lt;!-- Mountains --&gt; &lt;polygon points=&quot;0,130 50,70 100,110 150,50 200,90 260,30 260,130&quot; fill=&quot;#6B8E23&quot; /&gt; &lt;!-- Ground --&gt; &lt;rect x=&quot;0&quot; y=&quot;130&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;#8B4513&quot; /&gt; &lt;!-- Sun --&gt; &lt;circle cx=&quot;220&quot; cy=&quot;40&quot; r=&quot;20&quot; fill=&quot;#FFD700&quot; /&gt; &lt;!-- Visible Pixels Grid --&gt; &lt;g stroke=&quot;#ddd&quot; stroke-width=&quot;1&quot;&gt; &lt;path d=&quot;M0,0 L0,260&quot; /&gt; &lt;path d=&quot;M20,0 L20,260&quot; /&gt; &lt;path d=&quot;M40,0 L40,260&quot; /&gt; &lt;path d=&quot;M60,0 L60,260&quot; /&gt; &lt;path d=&quot;M80,0 L80,260&quot; /&gt; &lt;path d=&quot;M100,0 L100,260&quot; /&gt; &lt;path d=&quot;M120,0 L120,260&quot; /&gt; &lt;path d=&quot;M140,0 L140,260&quot; /&gt; &lt;path d=&quot;M160,0 L160,260&quot; /&gt; &lt;path d=&quot;M180,0 L180,260&quot; /&gt; &lt;path d=&quot;M200,0 L200,260&quot; /&gt; &lt;path d=&quot;M220,0 L220,260&quot; /&gt; &lt;path d=&quot;M240,0 L240,260&quot; /&gt; &lt;path d=&quot;M260,0 L260,260&quot; /&gt; &lt;path d=&quot;M0,0 L260,0&quot; /&gt; &lt;path d=&quot;M0,20 L260,20&quot; /&gt; &lt;path d=&quot;M0,40 L260,40&quot; /&gt; &lt;path d=&quot;M0,60 L260,60&quot; /&gt; &lt;path d=&quot;M0,80 L260,80&quot; /&gt; &lt;path d=&quot;M0,100 L260,100&quot; /&gt; &lt;path d=&quot;M0,120 L260,120&quot; /&gt; &lt;path d=&quot;M0,140 L260,140&quot; /&gt; &lt;path d=&quot;M0,160 L260,160&quot; /&gt; &lt;path d=&quot;M0,180 L260,180&quot; /&gt; &lt;path d=&quot;M0,200 L260,200&quot; /&gt; &lt;path d=&quot;M0,220 L260,220&quot; /&gt; &lt;path d=&quot;M0,240 L260,240&quot; /&gt; &lt;path d=&quot;M0,260 L260,260&quot; /&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- &quot;Low Resolution&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;120&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;70&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Low Resolution&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- After Image (High Resolution) --&gt; &lt;g transform=&quot;translate(450, 50)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Smooth Image Representation --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Smooth Mountain Scene --&gt; &lt;g&gt; &lt;!-- Sky with Gradient --&gt; &lt;linearGradient id=&quot;skyGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;0%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#1E90FF;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#87CEEB;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;url(#skyGradient)&quot; /&gt; &lt;!-- Mountains with Details --&gt; &lt;linearGradient id=&quot;mountainGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;0%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#228B22;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#6B8E23;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;path d=&quot;M0,130 Q25,100 50,70 Q75,90 100,110 Q125,80 150,50 Q175,70 200,90 Q230,60 260,30 L260,130 Z&quot; fill=&quot;url(#mountainGradient)&quot; /&gt; &lt;!-- Mountain Details --&gt; &lt;path d=&quot;M30,100 L40,90 L50,100&quot; stroke=&quot;#228B22&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; /&gt; &lt;path d=&quot;M80,90 L90,80 L100,90&quot; stroke=&quot;#228B22&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; /&gt; &lt;path d=&quot;M130,70 L140,60 L150,70&quot; stroke=&quot;#228B22&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; /&gt; &lt;path d=&quot;M180,80 L190,70 L200,80&quot; stroke=&quot;#228B22&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; /&gt; &lt;!-- Ground with Texture --&gt; &lt;linearGradient id=&quot;groundGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;0%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#8B4513;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#A0522D;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;rect x=&quot;0&quot; y=&quot;130&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;url(#groundGradient)&quot; /&gt; &lt;!-- Ground Details --&gt; &lt;path d=&quot;M20,150 L30,150&quot; stroke=&quot;#A0522D&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M50,170 L70,170&quot; stroke=&quot;#A0522D&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M100,160 L120,160&quot; stroke=&quot;#A0522D&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M150,180 L180,180&quot; stroke=&quot;#A0522D&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M200,150 L220,150&quot; stroke=&quot;#A0522D&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Sun with Glow --&gt; &lt;radialGradient id=&quot;sunGradient&quot; cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;50%&quot; fx=&quot;50%&quot; fy=&quot;50%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#FFFF00;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFD700;stop-opacity:1&quot; /&gt; &lt;/radialGradient&gt; &lt;circle cx=&quot;220&quot; cy=&quot;40&quot; r=&quot;20&quot; fill=&quot;url(#sunGradient)&quot; /&gt; &lt;circle cx=&quot;220&quot; cy=&quot;40&quot; r=&quot;25&quot; fill=&quot;none&quot; stroke=&quot;#FFD700&quot; stroke-width=&quot;1&quot; opacity=&quot;0.5&quot; /&gt; &lt;circle cx=&quot;220&quot; cy=&quot;40&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;#FFD700&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;High Resolution&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;120&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;70&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;High Resolution&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- AI Upscaling Arrow --&gt; &lt;g transform=&quot;translate(370, 150)&quot;&gt; &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;30&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;0&quot; y=&quot;5&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#4158D0&quot;&gt;AI&lt;/text&gt; &lt;path d=&quot;M-15,0 L15,0 M5,-10 L15,0 L5,10&quot; stroke=&quot;#4158D0&quot; stroke-width=&quot;3&quot; fill=&quot;none&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;AI Photo Upscaling Technology&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ai-portrait-enhancement.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#4158D0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#C850C0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFCC70;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;linearGradient id=&quot;portraitGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#F5F5F5;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#E0E0E0;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Before/After Portrait Frames --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Before Portrait --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;280&quot; height=&quot;280&quot; rx=&quot;5&quot; fill=&quot;url(#portraitGradient)&quot; /&gt; &lt;!-- Simplified Portrait Face (Before) --&gt; &lt;circle cx=&quot;150&quot; cy=&quot;100&quot; r=&quot;70&quot; fill=&quot;#F8D0C3&quot; /&gt; &lt;ellipse cx=&quot;120&quot; cy=&quot;90&quot; rx=&quot;10&quot; ry=&quot;8&quot; fill=&quot;#333&quot; /&gt; &lt;ellipse cx=&quot;180&quot; cy=&quot;90&quot; rx=&quot;10&quot; ry=&quot;8&quot; fill=&quot;#333&quot; /&gt; &lt;path d=&quot;M150,120 Q170,140 150,150 Q130,140 150,120&quot; fill=&quot;#E57373&quot; /&gt; &lt;path d=&quot;M100,80 Q150,60 200,80&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; /&gt; &lt;path d=&quot;M90,180 Q150,220 210,180&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; /&gt; &lt;!-- Body (Before) --&gt; &lt;path d=&quot;M90,170 L60,300 L240,300 L210,170&quot; fill=&quot;#A1887F&quot; /&gt; &lt;!-- &quot;Before&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;250&quot; width=&quot;80&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;50&quot; y=&quot;270&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;14&quot; fill=&quot;white&quot;&gt;Before&lt;/text&gt; &lt;/g&gt; &lt;g transform=&quot;translate(450, 50)&quot;&gt; &lt;!-- After Portrait --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;280&quot; height=&quot;280&quot; rx=&quot;5&quot; fill=&quot;url(#portraitGradient)&quot; /&gt; &lt;!-- Simplified Portrait Face (After - Enhanced) --&gt; &lt;circle cx=&quot;150&quot; cy=&quot;100&quot; r=&quot;70&quot; fill=&quot;#FFDDC1&quot; /&gt; &lt;ellipse cx=&quot;120&quot; cy=&quot;90&quot; rx=&quot;10&quot; ry=&quot;8&quot; fill=&quot;#333&quot; /&gt; &lt;ellipse cx=&quot;180&quot; cy=&quot;90&quot; rx=&quot;10&quot; ry=&quot;8&quot; fill=&quot;#333&quot; /&gt; &lt;path d=&quot;M150,120 Q170,140 150,150 Q130,140 150,120&quot; fill=&quot;#FF5252&quot; /&gt; &lt;path d=&quot;M100,80 Q150,60 200,80&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; /&gt; &lt;path d=&quot;M90,180 Q150,220 210,180&quot; fill=&quot;none&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; /&gt; &lt;!-- Body (After) --&gt; &lt;path d=&quot;M90,170 L60,300 L240,300 L210,170&quot; fill=&quot;#8D6E63&quot; /&gt; &lt;!-- Enhancement Effects --&gt; &lt;circle cx=&quot;120&quot; cy=&quot;90&quot; r=&quot;15&quot; fill=&quot;none&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; stroke-dasharray=&quot;2,2&quot; /&gt; &lt;circle cx=&quot;180&quot; cy=&quot;90&quot; r=&quot;15&quot; fill=&quot;none&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; stroke-dasharray=&quot;2,2&quot; /&gt; &lt;path d=&quot;M100,80 Q150,60 200,80&quot; fill=&quot;none&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; stroke-dasharray=&quot;2,2&quot; /&gt; &lt;path d=&quot;M90,180 Q150,220 210,180&quot; fill=&quot;none&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; stroke-dasharray=&quot;2,2&quot; /&gt; &lt;!-- &quot;After&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;250&quot; width=&quot;80&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;50&quot; y=&quot;270&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;14&quot; fill=&quot;white&quot;&gt;After&lt;/text&gt; &lt;/g&gt; &lt;!-- AI Enhancement Icons --&gt; &lt;g transform=&quot;translate(400, 150)&quot;&gt; &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;25&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;0&quot; y=&quot;5&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#4158D0&quot;&gt;AI&lt;/text&gt; &lt;path d=&quot;M-15,-15 L15,15&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; /&gt; &lt;path d=&quot;M15,-15 L-15,15&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;AI Portrait Enhancement Techniques&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ easter-card-messages.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#65C7F7;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#0052D4;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#9CECFB;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;pattern id=&quot;eggPattern&quot; width=&quot;60&quot; height=&quot;60&quot; patternUnits=&quot;userSpaceOnUse&quot;&gt; &lt;circle cx=&quot;30&quot; cy=&quot;30&quot; r=&quot;25&quot; fill=&quot;#FFD700&quot; stroke=&quot;#FFA500&quot; stroke-width=&quot;1&quot; /&gt; &lt;path d=&quot;M20,20 Q30,10 40,20 Q50,30 40,40 Q30,50 20,40 Q10,30 20,20 Z&quot; fill=&quot;none&quot; stroke=&quot;#FF6347&quot; stroke-width=&quot;1&quot; /&gt; &lt;circle cx=&quot;25&quot; cy=&quot;25&quot; r=&quot;3&quot; fill=&quot;#FF6347&quot; /&gt; &lt;circle cx=&quot;35&quot; cy=&quot;25&quot; r=&quot;3&quot; fill=&quot;#FF6347&quot; /&gt; &lt;circle cx=&quot;30&quot; cy=&quot;35&quot; r=&quot;3&quot; fill=&quot;#FF6347&quot; /&gt; &lt;/pattern&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Main Content Area --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Easter Card 1 - Traditional --&gt; &lt;g transform=&quot;translate(0, 0)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;200&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;#FFFAF0&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Card Content --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;!-- Easter Egg Decoration --&gt; &lt;ellipse cx=&quot;80&quot; cy=&quot;60&quot; rx=&quot;50&quot; ry=&quot;60&quot; fill=&quot;#FFB6C1&quot; /&gt; &lt;ellipse cx=&quot;80&quot; cy=&quot;60&quot; rx=&quot;40&quot; ry=&quot;50&quot; fill=&quot;#FFC0CB&quot; /&gt; &lt;!-- Easter Egg Patterns --&gt; &lt;path d=&quot;M60,40 Q80,30 100,40&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; /&gt; &lt;path d=&quot;M60,60 Q80,50 100,60&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; /&gt; &lt;path d=&quot;M60,80 Q80,70 100,80&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; /&gt; &lt;circle cx=&quot;70&quot; cy=&quot;50&quot; r=&quot;5&quot; fill=&quot;#FFF&quot; /&gt; &lt;circle cx=&quot;90&quot; cy=&quot;50&quot; r=&quot;5&quot; fill=&quot;#FFF&quot; /&gt; &lt;circle cx=&quot;70&quot; cy=&quot;70&quot; r=&quot;5&quot; fill=&quot;#FFF&quot; /&gt; &lt;circle cx=&quot;90&quot; cy=&quot;70&quot; r=&quot;5&quot; fill=&quot;#FFF&quot; /&gt; &lt;!-- Card Text --&gt; &lt;text x=&quot;80&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;Happy Easter!&lt;/text&gt; &lt;rect x=&quot;20&quot; y=&quot;170&quot; width=&quot;120&quot; height=&quot;1&quot; fill=&quot;#DDD&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;Wishing you a blessed&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;205&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;and joyful Easter&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;220&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;celebration with&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;235&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;your loved ones!&lt;/text&gt; &lt;!-- Card Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;250&quot; width=&quot;140&quot; height=&quot;20&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.1)&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;265&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;#333&quot;&gt;Traditional&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Easter Card 2 - Funny --&gt; &lt;g transform=&quot;translate(220, 0)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;200&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;#E6F7FF&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Card Content --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;!-- Cartoon Bunny --&gt; &lt;ellipse cx=&quot;80&quot; cy=&quot;70&quot; rx=&quot;50&quot; ry=&quot;60&quot; fill=&quot;#FFF&quot; /&gt; &lt;!-- Bunny Ears --&gt; &lt;path d=&quot;M60,40 Q60,0 80,20 Q100,0 100,40&quot; fill=&quot;#FFF&quot; stroke=&quot;#DDD&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Bunny Face --&gt; &lt;circle cx=&quot;70&quot; cy=&quot;60&quot; r=&quot;5&quot; fill=&quot;#333&quot; /&gt; &lt;circle cx=&quot;90&quot; cy=&quot;60&quot; r=&quot;5&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Bunny Nose --&gt; &lt;ellipse cx=&quot;80&quot; cy=&quot;75&quot; rx=&quot;7&quot; ry=&quot;5&quot; fill=&quot;#FFB6C1&quot; /&gt; &lt;!-- Bunny Mouth --&gt; &lt;path d=&quot;M75,85 Q80,90 85,85&quot; stroke=&quot;#333&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; /&gt; &lt;!-- Bunny Whiskers --&gt; &lt;line x1=&quot;60&quot; y1=&quot;75&quot; x2=&quot;73&quot; y2=&quot;77&quot; stroke=&quot;#999&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;60&quot; y1=&quot;80&quot; x2=&quot;73&quot; y2=&quot;80&quot; stroke=&quot;#999&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;87&quot; y1=&quot;77&quot; x2=&quot;100&quot; y2=&quot;75&quot; stroke=&quot;#999&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;87&quot; y1=&quot;80&quot; x2=&quot;100&quot; y2=&quot;80&quot; stroke=&quot;#999&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Card Text --&gt; &lt;text x=&quot;80&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;Hoppy Easter!&lt;/text&gt; &lt;rect x=&quot;20&quot; y=&quot;170&quot; width=&quot;120&quot; height=&quot;1&quot; fill=&quot;#DDD&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;I&#x27;m not saying you&#x27;re&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;205&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;old, but the Easter&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;220&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;Bunny needs GPS to&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;235&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;find your house!&lt;/text&gt; &lt;!-- Card Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;250&quot; width=&quot;140&quot; height=&quot;20&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.1)&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;265&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;#333&quot;&gt;Funny&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Easter Card 3 - Religious --&gt; &lt;g transform=&quot;translate(440, 0)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;200&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;#F0F8FF&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Card Content --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;!-- Cross Symbol --&gt; &lt;rect x=&quot;70&quot; y=&quot;20&quot; width=&quot;20&quot; height=&quot;80&quot; fill=&quot;#FFD700&quot; /&gt; &lt;rect x=&quot;40&quot; y=&quot;40&quot; width=&quot;80&quot; height=&quot;20&quot; fill=&quot;#FFD700&quot; /&gt; &lt;!-- Light Rays --&gt; &lt;path d=&quot;M80,10 L80,0 M60,20 L50,10 M100,20 L110,10 M40,60 L30,60 M120,60 L130,60 M60,100 L50,110 M100,100 L110,110&quot; stroke=&quot;#FFD700&quot; stroke-width=&quot;2&quot; /&gt; &lt;!-- Card Text --&gt; &lt;text x=&quot;80&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;He Is Risen&lt;/text&gt; &lt;rect x=&quot;20&quot; y=&quot;170&quot; width=&quot;120&quot; height=&quot;1&quot; fill=&quot;#DDD&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;May the miracle of&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;205&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;Easter bring you&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;220&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;renewed hope, faith,&lt;/text&gt; &lt;text x=&quot;80&quot; y=&quot;235&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;10&quot; fill=&quot;#666&quot;&gt;love, and joy.&lt;/text&gt; &lt;!-- Card Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;250&quot; width=&quot;140&quot; height=&quot;20&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.1)&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;265&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;#333&quot;&gt;Religious&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Easter Basket with Message Cards --&gt; &lt;g transform=&quot;translate(650, 200)&quot;&gt; &lt;!-- Basket --&gt; &lt;path d=&quot;M0,50 C0,20 100,20 100,50 L100,100 C100,120 0,120 0,100 Z&quot; fill=&quot;#D2B48C&quot; stroke=&quot;#8B4513&quot; stroke-width=&quot;2&quot; /&gt; &lt;path d=&quot;M0,50 C0,70 100,70 100,50&quot; fill=&quot;none&quot; stroke=&quot;#8B4513&quot; stroke-width=&quot;2&quot; /&gt; &lt;path d=&quot;M40,0 C50,-10 50,-10 60,0&quot; fill=&quot;none&quot; stroke=&quot;#8B4513&quot; stroke-width=&quot;4&quot; /&gt; &lt;!-- Easter Eggs in Basket --&gt; &lt;ellipse cx=&quot;30&quot; cy=&quot;70&quot; rx=&quot;15&quot; ry=&quot;20&quot; fill=&quot;#FF6347&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;1&quot; /&gt; &lt;ellipse cx=&quot;50&quot; cy=&quot;80&quot; rx=&quot;15&quot; ry=&quot;20&quot; fill=&quot;#4169E1&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;1&quot; /&gt; &lt;ellipse cx=&quot;70&quot; cy=&quot;70&quot; rx=&quot;15&quot; ry=&quot;20&quot; fill=&quot;#32CD32&quot; stroke=&quot;#FFF&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Message Cards --&gt; &lt;rect x=&quot;20&quot; y=&quot;40&quot; width=&quot;20&quot; height=&quot;30&quot; rx=&quot;2&quot; fill=&quot;#FFF&quot; transform=&quot;rotate(-15,20,40)&quot; /&gt; &lt;rect x=&quot;60&quot; y=&quot;35&quot; width=&quot;20&quot; height=&quot;30&quot; rx=&quot;2&quot; fill=&quot;#FFF&quot; transform=&quot;rotate(15,60,35)&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;Easter Card Message Ideas&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ holi-photoshoot-ideas.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#FF416C;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#FF4B2B;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#F76B1C;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;radialGradient id=&quot;colorSplash&quot; cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;50%&quot; fx=&quot;50%&quot; fy=&quot;50%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#FF1493;stop-opacity:0.8&quot; /&gt; &lt;stop offset=&quot;25%&quot; style=&quot;stop-color:#9400D3;stop-opacity:0.8&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#0000FF;stop-opacity:0.8&quot; /&gt; &lt;stop offset=&quot;75%&quot; style=&quot;stop-color:#00FF00;stop-opacity:0.8&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFFF00;stop-opacity:0.8&quot; /&gt; &lt;/radialGradient&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Main Content Area --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Photo Frame 1 - Portrait --&gt; &lt;g transform=&quot;translate(0, 0)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;200&quot; height=&quot;250&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Photo Content --&gt; &lt;g transform=&quot;translate(10, 10)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;180&quot; height=&quot;230&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Silhouette of Person with Color Splash --&gt; &lt;g&gt; &lt;!-- Background --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;180&quot; height=&quot;230&quot; fill=&quot;#f8f8f8&quot; /&gt; &lt;!-- Person Silhouette --&gt; &lt;path d=&quot;M90,50 C110,50 120,65 120,80 C120,95 110,105 100,110 L105,160 L115,230 L65,230 L75,160 L80,110 C70,105 60,95 60,80 C60,65 70,50 90,50 Z&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Color Splashes --&gt; &lt;circle cx=&quot;60&quot; cy=&quot;70&quot; r=&quot;20&quot; fill=&quot;#FF1493&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;120&quot; cy=&quot;70&quot; r=&quot;25&quot; fill=&quot;#9400D3&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;90&quot; cy=&quot;120&quot; r=&quot;30&quot; fill=&quot;#0000FF&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;50&quot; cy=&quot;150&quot; r=&quot;25&quot; fill=&quot;#00FF00&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;130&quot; cy=&quot;150&quot; r=&quot;20&quot; fill=&quot;#FFFF00&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;90&quot; cy=&quot;190&quot; r=&quot;35&quot; fill=&quot;#FF4500&quot; opacity=&quot;0.7&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Portrait&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;190&quot; width=&quot;70&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;45&quot; y=&quot;210&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Portrait&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Photo Frame 2 - Group Shot --&gt; &lt;g transform=&quot;translate(220, 0)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;280&quot; height=&quot;180&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Photo Content --&gt; &lt;g transform=&quot;translate(10, 10)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;160&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Group Silhouettes with Color Splash --&gt; &lt;g&gt; &lt;!-- Background --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;160&quot; fill=&quot;#f8f8f8&quot; /&gt; &lt;!-- Group Silhouettes --&gt; &lt;path d=&quot;M50,50 C60,50 65,60 65,70 C65,80 60,85 55,90 L58,120 L62,160 L38,160 L42,120 L45,90 C40,85 35,80 35,70 C35,60 40,50 50,50 Z&quot; fill=&quot;#333&quot; /&gt; &lt;path d=&quot;M100,40 C115,40 125,55 125,70 C125,85 115,95 105,100 L110,130 L115,160 L85,160 L90,130 L95,100 C85,95 75,85 75,70 C75,55 85,40 100,40 Z&quot; fill=&quot;#333&quot; /&gt; &lt;path d=&quot;M150,45 C160,45 165,55 165,65 C165,75 160,80 155,85 L158,120 L162,160 L138,160 L142,120 L145,85 C140,80 135,75 135,65 C135,55 140,45 150,45 Z&quot; fill=&quot;#333&quot; /&gt; &lt;path d=&quot;M200,50 C210,50 215,60 215,70 C215,80 210,85 205,90 L208,120 L212,160 L188,160 L192,120 L195,90 C190,85 185,80 185,70 C185,60 190,50 200,50 Z&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Color Splashes --&gt; &lt;circle cx=&quot;50&quot; cy=&quot;40&quot; r=&quot;25&quot; fill=&quot;#FF1493&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;100&quot; cy=&quot;30&quot; r=&quot;30&quot; fill=&quot;#9400D3&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;150&quot; cy=&quot;35&quot; r=&quot;25&quot; fill=&quot;#0000FF&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;200&quot; cy=&quot;40&quot; r=&quot;30&quot; fill=&quot;#00FF00&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;75&quot; cy=&quot;100&quot; r=&quot;40&quot; fill=&quot;#FFFF00&quot; opacity=&quot;0.7&quot; /&gt; &lt;circle cx=&quot;175&quot; cy=&quot;100&quot; r=&quot;40&quot; fill=&quot;#FF4500&quot; opacity=&quot;0.7&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Group Shot&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;120&quot; width=&quot;90&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;55&quot; y=&quot;140&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Group Shot&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Photo Frame 3 - Action Shot --&gt; &lt;g transform=&quot;translate(220, 200)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;280&quot; height=&quot;150&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Photo Content --&gt; &lt;g transform=&quot;translate(10, 10)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Action Shot with Color Splash --&gt; &lt;g&gt; &lt;!-- Background --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;#f8f8f8&quot; /&gt; &lt;!-- Person Silhouette in Motion --&gt; &lt;path d=&quot;M80,30 C95,30 105,40 105,55 C105,70 95,80 85,85 L75,100 C90,95 110,105 120,115 L130,130 L50,130 L60,100 L65,85 C55,80 45,70 45,55 C45,40 65,30 80,30 Z&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Color Splash Motion Effect --&gt; &lt;path d=&quot;M130,30 C180,50 200,90 220,130 L130,130 Z&quot; fill=&quot;url(#colorSplash)&quot; opacity=&quot;0.6&quot; /&gt; &lt;path d=&quot;M30,30 C10,50 0,90 0,130 L80,130 Z&quot; fill=&quot;url(#colorSplash)&quot; opacity=&quot;0.6&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Action Shot&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;90&quot; width=&quot;90&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;55&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Action Shot&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Photo Frame 4 - Detail Shot --&gt; &lt;g transform=&quot;translate(0, 270)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;200&quot; height=&quot;130&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Photo Content --&gt; &lt;g transform=&quot;translate(10, 10)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;180&quot; height=&quot;110&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Detail Shot with Color Powder --&gt; &lt;g&gt; &lt;!-- Background --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;180&quot; height=&quot;110&quot; fill=&quot;#f8f8f8&quot; /&gt; &lt;!-- Hand Silhouette --&gt; &lt;path d=&quot;M60,30 C70,20 90,15 100,25 C110,15 130,20 140,30 C150,40 150,60 140,80 C130,100 110,110 100,110 C90,110 70,100 60,80 C50,60 50,40 60,30 Z&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Color Powder in Hand --&gt; &lt;circle cx=&quot;100&quot; cy=&quot;60&quot; r=&quot;30&quot; fill=&quot;#FF1493&quot; opacity=&quot;0.8&quot; /&gt; &lt;circle cx=&quot;100&quot; cy=&quot;60&quot; r=&quot;20&quot; fill=&quot;#9400D3&quot; opacity=&quot;0.8&quot; /&gt; &lt;circle cx=&quot;100&quot; cy=&quot;60&quot; r=&quot;10&quot; fill=&quot;#FFFF00&quot; opacity=&quot;0.8&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Detail Shot&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;70&quot; width=&quot;90&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;55&quot; y=&quot;90&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Detail Shot&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Camera Icon --&gt; &lt;g transform=&quot;translate(600, 200)&quot;&gt; &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;50&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Camera Body --&gt; &lt;rect x=&quot;-30&quot; y=&quot;-15&quot; width=&quot;60&quot; height=&quot;40&quot; rx=&quot;5&quot; fill=&quot;#333&quot; /&gt; &lt;!-- Camera Lens --&gt; &lt;circle cx=&quot;0&quot; cy=&quot;5&quot; r=&quot;15&quot; fill=&quot;#666&quot; /&gt; &lt;circle cx=&quot;0&quot; cy=&quot;5&quot; r=&quot;10&quot; fill=&quot;#444&quot; /&gt; &lt;circle cx=&quot;0&quot; cy=&quot;5&quot; r=&quot;5&quot; fill=&quot;#222&quot; /&gt; &lt;!-- Camera Flash --&gt; &lt;rect x=&quot;-20&quot; y=&quot;-25&quot; width=&quot;15&quot; height=&quot;10&quot; rx=&quot;2&quot; fill=&quot;#666&quot; /&gt; &lt;!-- Camera Button --&gt; &lt;circle cx=&quot;25&quot; cy=&quot;-5&quot; r=&quot;5&quot; fill=&quot;#FF4500&quot; /&gt; &lt;!-- Color Splash from Camera --&gt; &lt;circle cx=&quot;0&quot; cy=&quot;5&quot; r=&quot;60&quot; fill=&quot;none&quot; stroke=&quot;url(#colorSplash)&quot; stroke-width=&quot;5&quot; stroke-dasharray=&quot;5,5&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;Holi Photoshoot Ideas&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ remove-background-guide.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;bgGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;100%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#4158D0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;50%&quot; style=&quot;stop-color:#C850C0;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFCC70;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;filter id=&quot;dropShadow&quot; x=&quot;-20%&quot; y=&quot;-20%&quot; width=&quot;140%&quot; height=&quot;140%&quot;&gt; &lt;feGaussianBlur in=&quot;SourceAlpha&quot; stdDeviation=&quot;5&quot; /&gt; &lt;feOffset dx=&quot;2&quot; dy=&quot;2&quot; result=&quot;offsetblur&quot; /&gt; &lt;feComponentTransfer&gt; &lt;feFuncA type=&quot;linear&quot; slope=&quot;0.3&quot; /&gt; &lt;/feComponentTransfer&gt; &lt;feMerge&gt; &lt;feMergeNode /&gt; &lt;feMergeNode in=&quot;SourceGraphic&quot; /&gt; &lt;/feMerge&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;!-- Background --&gt; &lt;rect width=&quot;800&quot; height=&quot;400&quot; fill=&quot;url(#bgGradient)&quot; /&gt; &lt;!-- Main Image Area --&gt; &lt;g transform=&quot;translate(50, 50)&quot;&gt; &lt;!-- Original Image Frame --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Original Image Content --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#f0f0f0&quot; /&gt; &lt;!-- Simple Product Photo with Background --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;#E0E0E0&quot; /&gt; &lt;!-- Background Elements --&gt; &lt;rect x=&quot;0&quot; y=&quot;130&quot; width=&quot;260&quot; height=&quot;130&quot; fill=&quot;#D0D0D0&quot; /&gt; &lt;circle cx=&quot;50&quot; cy=&quot;50&quot; r=&quot;30&quot; fill=&quot;#C0C0C0&quot; /&gt; &lt;rect x=&quot;180&quot; y=&quot;30&quot; width=&quot;50&quot; height=&quot;80&quot; fill=&quot;#C0C0C0&quot; /&gt; &lt;!-- Product (Bottle) --&gt; &lt;g&gt; &lt;!-- Bottle Body --&gt; &lt;rect x=&quot;100&quot; y=&quot;80&quot; width=&quot;60&quot; height=&quot;140&quot; rx=&quot;10&quot; fill=&quot;#FFFFFF&quot; stroke=&quot;#CCCCCC&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Bottle Cap --&gt; &lt;rect x=&quot;110&quot; y=&quot;60&quot; width=&quot;40&quot; height=&quot;20&quot; rx=&quot;5&quot; fill=&quot;#4FC3F7&quot; /&gt; &lt;!-- Bottle Label --&gt; &lt;rect x=&quot;105&quot; y=&quot;120&quot; width=&quot;50&quot; height=&quot;70&quot; rx=&quot;5&quot; fill=&quot;#E1F5FE&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;135&quot; x2=&quot;150&quot; y2=&quot;135&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;145&quot; x2=&quot;150&quot; y2=&quot;145&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;155&quot; x2=&quot;140&quot; y2=&quot;155&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;165&quot; x2=&quot;130&quot; y2=&quot;165&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;/g&gt; &lt;!-- &quot;Original&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;80&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;50&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Original&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- Processed Image Area --&gt; &lt;g transform=&quot;translate(450, 50)&quot;&gt; &lt;!-- Processed Image Frame --&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;300&quot; rx=&quot;10&quot; fill=&quot;white&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;!-- Transparent Background Representation --&gt; &lt;g transform=&quot;translate(20, 20)&quot;&gt; &lt;!-- Checkered Background to Represent Transparency --&gt; &lt;pattern id=&quot;checkerPattern&quot; width=&quot;20&quot; height=&quot;20&quot; patternUnits=&quot;userSpaceOnUse&quot;&gt; &lt;rect width=&quot;10&quot; height=&quot;10&quot; fill=&quot;#F5F5F5&quot; /&gt; &lt;rect x=&quot;10&quot; y=&quot;0&quot; width=&quot;10&quot; height=&quot;10&quot; fill=&quot;#E0E0E0&quot; /&gt; &lt;rect x=&quot;0&quot; y=&quot;10&quot; width=&quot;10&quot; height=&quot;10&quot; fill=&quot;#E0E0E0&quot; /&gt; &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;10&quot; height=&quot;10&quot; fill=&quot;#F5F5F5&quot; /&gt; &lt;/pattern&gt; &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;260&quot; height=&quot;260&quot; fill=&quot;url(#checkerPattern)&quot; /&gt; &lt;!-- Product (Bottle) with No Background --&gt; &lt;g&gt; &lt;!-- Bottle Body --&gt; &lt;rect x=&quot;100&quot; y=&quot;80&quot; width=&quot;60&quot; height=&quot;140&quot; rx=&quot;10&quot; fill=&quot;#FFFFFF&quot; stroke=&quot;#CCCCCC&quot; stroke-width=&quot;1&quot; /&gt; &lt;!-- Bottle Cap --&gt; &lt;rect x=&quot;110&quot; y=&quot;60&quot; width=&quot;40&quot; height=&quot;20&quot; rx=&quot;5&quot; fill=&quot;#4FC3F7&quot; /&gt; &lt;!-- Bottle Label --&gt; &lt;rect x=&quot;105&quot; y=&quot;120&quot; width=&quot;50&quot; height=&quot;70&quot; rx=&quot;5&quot; fill=&quot;#E1F5FE&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;135&quot; x2=&quot;150&quot; y2=&quot;135&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;145&quot; x2=&quot;150&quot; y2=&quot;145&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;155&quot; x2=&quot;140&quot; y2=&quot;155&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;line x1=&quot;110&quot; y1=&quot;165&quot; x2=&quot;130&quot; y2=&quot;165&quot; stroke=&quot;#333&quot; stroke-width=&quot;1&quot; /&gt; &lt;/g&gt; &lt;!-- Selection Outline Effect --&gt; &lt;rect x=&quot;95&quot; y=&quot;55&quot; width=&quot;70&quot; height=&quot;170&quot; rx=&quot;12&quot; fill=&quot;none&quot; stroke=&quot;#4FC3F7&quot; stroke-width=&quot;2&quot; stroke-dasharray=&quot;5,5&quot; /&gt; &lt;!-- &quot;Background Removed&quot; Label --&gt; &lt;rect x=&quot;10&quot; y=&quot;220&quot; width=&quot;140&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(0,0,0,0.5)&quot; /&gt; &lt;text x=&quot;80&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;12&quot; fill=&quot;white&quot;&gt;Background Removed&lt;/text&gt; &lt;/g&gt; &lt;/g&gt; &lt;!-- AI Processing Arrow --&gt; &lt;g transform=&quot;translate(370, 150)&quot;&gt; &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;30&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;0&quot; y=&quot;5&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#4158D0&quot;&gt;AI&lt;/text&gt; &lt;path d=&quot;M-15,0 L15,0 M5,-10 L15,0 L5,10&quot; stroke=&quot;#4158D0&quot; stroke-width=&quot;3&quot; fill=&quot;none&quot; /&gt; &lt;/g&gt; &lt;!-- Title --&gt; &lt;rect x=&quot;200&quot; y=&quot;360&quot; width=&quot;400&quot; height=&quot;30&quot; rx=&quot;5&quot; fill=&quot;rgba(255,255,255,0.9)&quot; filter=&quot;url(#dropShadow)&quot; /&gt; &lt;text x=&quot;400&quot; y=&quot;380&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; font-weight=&quot;bold&quot; fill=&quot;#333&quot;&gt;How to Remove Background from Photos&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ studio-ghibli-ai-art.svg</div> <div class="content">&lt;svg width=&quot;800&quot; height=&quot;400&quot; viewBox=&quot;0 0 800 400&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt; &lt;defs&gt; &lt;linearGradient id=&quot;skyGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;0%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#87CEEB;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#E0F6FF;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;linearGradient id=&quot;grassGradient&quot; x1=&quot;0%&quot; y1=&quot;0%&quot; x2=&quot;0%&quot; y2=&quot;100%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#90EE90;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#228B22;stop-opacity:1&quot; /&gt; &lt;/linearGradient&gt; &lt;radialGradient id=&quot;sunGradient&quot; cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;50%&quot;&gt; &lt;stop offset=&quot;0%&quot; style=&quot;stop-color:#FFD700;stop-opacity:1&quot; /&gt; &lt;stop offset=&quot;100%&quot; style=&quot;stop-color:#FFA500;stop-opacity:0.8&quot; /&gt; &lt;/radialGradient&gt; &lt;/defs&gt; &lt;!-- Sky background --&gt; &lt;rect width=&quot;800&quot; height=&quot;280&quot; fill=&quot;url(#skyGradient)&quot;/&gt; &lt;!-- Clouds --&gt; &lt;ellipse cx=&quot;150&quot; cy=&quot;80&quot; rx=&quot;40&quot; ry=&quot;20&quot; fill=&quot;white&quot; opacity=&quot;0.8&quot;/&gt; &lt;ellipse cx=&quot;170&quot; cy=&quot;75&quot; rx=&quot;35&quot; ry=&quot;18&quot; fill=&quot;white&quot; opacity=&quot;0.8&quot;/&gt; &lt;ellipse cx=&quot;130&quot; cy=&quot;85&quot; rx=&quot;30&quot; ry=&quot;15&quot; fill=&quot;white&quot; opacity=&quot;0.8&quot;/&gt; &lt;ellipse cx=&quot;600&quot; cy=&quot;60&quot; rx=&quot;50&quot; ry=&quot;25&quot; fill=&quot;white&quot; opacity=&quot;0.7&quot;/&gt; &lt;ellipse cx=&quot;625&quot; cy=&quot;55&quot; rx=&quot;40&quot; ry=&quot;20&quot; fill=&quot;white&quot; opacity=&quot;0.7&quot;/&gt; &lt;ellipse cx=&quot;575&quot; cy=&quot;65&quot; rx=&quot;35&quot; ry=&quot;18&quot; fill=&quot;white&quot; opacity=&quot;0.7&quot;/&gt; &lt;!-- Sun --&gt; &lt;circle cx=&quot;700&quot; cy=&quot;100&quot; r=&quot;40&quot; fill=&quot;url(#sunGradient)&quot;/&gt; &lt;!-- Mountains --&gt; &lt;polygon points=&quot;0,280 200,150 400,200 800,120 800,280&quot; fill=&quot;#8FBC8F&quot; opacity=&quot;0.6&quot;/&gt; &lt;polygon points=&quot;100,280 350,180 600,160 800,140 800,280&quot; fill=&quot;#9ACD32&quot; opacity=&quot;0.5&quot;/&gt; &lt;!-- Ground --&gt; &lt;rect y=&quot;280&quot; width=&quot;800&quot; height=&quot;120&quot; fill=&quot;url(#grassGradient)&quot;/&gt; &lt;!-- Trees --&gt; &lt;ellipse cx=&quot;100&quot; cy=&quot;250&quot; rx=&quot;25&quot; ry=&quot;40&quot; fill=&quot;#228B22&quot;/&gt; &lt;rect x=&quot;95&quot; y=&quot;270&quot; width=&quot;10&quot; height=&quot;30&quot; fill=&quot;#8B4513&quot;/&gt; &lt;ellipse cx=&quot;300&quot; cy=&quot;240&quot; rx=&quot;30&quot; ry=&quot;50&quot; fill=&quot;#32CD32&quot;/&gt; &lt;rect x=&quot;295&quot; y=&quot;270&quot; width=&quot;10&quot; height=&quot;35&quot; fill=&quot;#8B4513&quot;/&gt; &lt;ellipse cx=&quot;500&quot; cy=&quot;260&quot; rx=&quot;20&quot; ry=&quot;35&quot; fill=&quot;#228B22&quot;/&gt; &lt;rect x=&quot;495&quot; y=&quot;280&quot; width=&quot;10&quot; height=&quot;25&quot; fill=&quot;#8B4513&quot;/&gt; &lt;!-- Floating elements (Ghibli style) --&gt; &lt;circle cx=&quot;250&quot; cy=&quot;120&quot; r=&quot;3&quot; fill=&quot;white&quot; opacity=&quot;0.8&quot;/&gt; &lt;circle cx=&quot;400&quot; cy=&quot;140&quot; r=&quot;2&quot; fill=&quot;white&quot; opacity=&quot;0.6&quot;/&gt; &lt;circle cx=&quot;550&quot; cy=&quot;110&quot; r=&quot;2.5&quot; fill=&quot;white&quot; opacity=&quot;0.7&quot;/&gt; &lt;circle cx=&quot;320&quot; cy=&quot;90&quot; r=&quot;2&quot; fill=&quot;white&quot; opacity=&quot;0.5&quot;/&gt; &lt;!-- Title overlay --&gt; &lt;rect x=&quot;50&quot; y=&quot;320&quot; width=&quot;700&quot; height=&quot;60&quot; fill=&quot;rgba(255,255,255,0.9)&quot; rx=&quot;10&quot;/&gt; &lt;text x=&quot;400&quot; y=&quot;345&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;24&quot; font-weight=&quot;bold&quot; fill=&quot;#2E8B57&quot;&gt;Studio Ghibli AI Art Guide&lt;/text&gt; &lt;text x=&quot;400&quot; y=&quot;365&quot; text-anchor=&quot;middle&quot; font-family=&quot;Arial, sans-serif&quot; font-size=&quot;16&quot; fill=&quot;#666&quot;&gt;Transform your photos into magical artwork&lt;/text&gt; &lt;/svg&gt;</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ robots.txt</div> <div class="content"></div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ eslint.config.js</div> <div class="content">import js from &#x27;@eslint/js&#x27;; import globals from &#x27;globals&#x27;; import reactHooks from &#x27;eslint-plugin-react-hooks&#x27;; import reactRefresh from &#x27;eslint-plugin-react-refresh&#x27;; import tseslint from &#x27;typescript-eslint&#x27;; export default tseslint.config( { ignores: [&#x27;dist&#x27;] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], files: [&#x27;**/*.{ts,tsx}&#x27;], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { &#x27;react-hooks&#x27;: reactHooks, &#x27;react-refresh&#x27;: reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, &#x27;react-refresh/only-export-components&#x27;: [ &#x27;warn&#x27;, { allowConstantExport: true }, ], }, } ); </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ generate-multimedia-sitemap-simple.js</div> <div class="content">const fs = require(&#x27;fs&#x27;); const path = require(&#x27;path&#x27;); // Configuration const BASE_URL = &#x27;https://modernphototools.com&#x27;; const OUTPUT_FILE = &#x27;public/sitemap-multimedia.xml&#x27;; // Tool mapping for metadata const toolMetadata = { &#x27;AI Avatar&#x27;: { title: &#x27;AI Avatar Generator Tool&#x27;, description: &#x27;Create stunning AI avatars from your photos with advanced artificial intelligence technology&#x27;, duration: &#x27;45&#x27; }, &#x27;AI Background Generator&#x27;: { title: &#x27;AI Background Generator Tool&#x27;, description: &#x27;Generate professional backgrounds for your photos using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Caricature&#x27;: { title: &#x27;AI Caricature Generator Tool&#x27;, description: &#x27;Transform your photos into fun caricatures with AI-powered technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Cartoon&#x27;: { title: &#x27;AI Cartoon Generator Tool&#x27;, description: &#x27;Convert your photos into cartoon style images using advanced AI&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Cleanup&#x27;: { title: &#x27;AI Cleanup Tool&#x27;, description: &#x27;Remove unwanted objects and clean up your photos with AI technology&#x27;, duration: &#x27;40&#x27; }, &#x27;AI Expand&#x27;: { title: &#x27;AI Expand Tool&#x27;, description: &#x27;Expand your images beyond their original boundaries using AI&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Face Swap&#x27;: { title: &#x27;AI Face Swap Tool&#x27;, description: &#x27;Swap faces in photos seamlessly with advanced AI face recognition&#x27;, duration: &#x27;45&#x27; }, &#x27;AI Filter&#x27;: { title: &#x27;AI Filter Tool&#x27;, description: &#x27;Apply artistic filters to your photos using AI-powered technology&#x27;, duration: &#x27;35&#x27; }, &#x27;AI Hairstyle&#x27;: { title: &#x27;AI Hairstyle Tool&#x27;, description: &#x27;Try different hairstyles on your photos with AI technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Image Generator_text-to-image&#x27;: { title: &#x27;AI Image Generator Tool&#x27;, description: &#x27;Generate images from text descriptions using advanced AI technology&#x27;, duration: &#x27;70&#x27; }, &#x27;AI Image Upscaler&#x27;: { title: &#x27;AI Image Upscaler Tool&#x27;, description: &#x27;Enhance and upscale your images with AI-powered technology&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Image to Image&#x27;: { title: &#x27;AI Image to Image Tool&#x27;, description: &#x27;Transform images from one style to another using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Outfit&#x27;: { title: &#x27;AI Outfit Tool&#x27;, description: &#x27;Try different outfits on your photos with AI-powered fashion technology&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Portrait&#x27;: { title: &#x27;AI Portrait Tool&#x27;, description: &#x27;Create professional portraits from your photos using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Product Photoshoot&#x27;: { title: &#x27;AI Product Photoshoot Tool&#x27;, description: &#x27;Create professional product photos with AI-powered background technology&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Replace&#x27;: { title: &#x27;AI Replace Tool&#x27;, description: &#x27;Replace objects in photos seamlessly with AI technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Sketch to Image&#x27;: { title: &#x27;AI Sketch to Image Tool&#x27;, description: &#x27;Convert sketches into realistic images using AI technology&#x27;, duration: &#x27;75&#x27; }, &#x27;Remove Background&#x27;: { title: &#x27;Remove Background Tool&#x27;, description: &#x27;Remove backgrounds from photos instantly with AI technology&#x27;, duration: &#x27;30&#x27; } }; // Video files const videoFiles = [ &#x27;AI Avatar.mp4&#x27;, &#x27;AI Background Generator.mp4&#x27;, &#x27;AI Caricature.mp4&#x27;, &#x27;AI Cartoon.mp4&#x27;, &#x27;AI Cleanup.mp4&#x27;, &#x27;AI Expand.mp4&#x27;, &#x27;AI Face Swap.mp4&#x27;, &#x27;AI Filter.mp4&#x27;, &#x27;AI Hairstyle.mp4&#x27;, &#x27;AI Image Generator_text-to-image.mp4&#x27;, &#x27;AI Image Upscaler.mp4&#x27;, &#x27;AI Image to Image.mp4&#x27;, &#x27;AI Outfit.mp4&#x27;, &#x27;AI Portrait.mp4&#x27;, &#x27;AI Product Photoshoot.mp4&#x27;, &#x27;AI Replace.mp4&#x27;, &#x27;AI Sketch to Image.mp4&#x27;, &#x27;Remove Background.mp4&#x27; ]; // Image files const imageFiles = [ &#x27;AI Avatar Tool.jpg&#x27;, &#x27;AI Background Generator Tool.jpg&#x27;, &#x27;AI Caricature Generator Tool.jpg&#x27;, &#x27;AI Cartoon Tool.jpg&#x27;, &#x27;AI Cleanup Tool.jpg&#x27;, &#x27;Ai Expand tool.jpg&#x27;, &#x27;AI Face Swap Tool.jpg&#x27;, &#x27;AI Filter Tool.jpg&#x27;, &#x27;AI Hairstyle Tool.jpg&#x27;, &#x27;AI Image Generator Tool.jpg&#x27;, &#x27;AI Image Upscaler Tool.jpg&#x27;, &#x27;AI Image to Image Tool.jpg&#x27;, &#x27;AI Outfit Tool.jpg&#x27;, &#x27;AI Portrait Tool.jpg&#x27;, &#x27;AI Product Photoshoot Tool.jpg&#x27;, &#x27;AI Replace tool.jpg&#x27;, &#x27;AI Sketch to Image Tool.jpg&#x27;, &#x27;Remove Background tool.jpg&#x27; ]; function getCurrentDate() { return new Date().toISOString(); } function generateVideoEntry(filename) { const toolKey = filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;); const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool video demonstration&#x27;, duration: &#x27;60&#x27; }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + &#x27; Tool.jpg&#x27;)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getCurrentDate(); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;video:video&gt; &lt;video:thumbnail_loc&gt;${thumbnailUrl}&lt;/video:thumbnail_loc&gt; &lt;video:title&gt;${metadata.title}&lt;/video:title&gt; &lt;video:description&gt;${metadata.description}&lt;/video:description&gt; &lt;video:content_loc&gt;${videoUrl}&lt;/video:content_loc&gt; &lt;video:duration&gt;${metadata.duration}&lt;/video:duration&gt; &lt;video:publication_date&gt;${lastmod}&lt;/video:publication_date&gt; &lt;video:family_friendly&gt;yes&lt;/video:family_friendly&gt; &lt;video:tag&gt;AI tools&lt;/video:tag&gt; &lt;video:tag&gt;photo editing&lt;/video:tag&gt; &lt;video:tag&gt;artificial intelligence&lt;/video:tag&gt; &lt;video:tag&gt;image processing&lt;/video:tag&gt; &lt;/video:video&gt; &lt;/url&gt;`; } function generateImageEntry(filename) { const toolKey = filename.replace(&#x27; Tool.jpg&#x27;, &#x27;&#x27;).replace(&#x27;.jpg&#x27;, &#x27;&#x27;); const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.jpg&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool demonstration image&#x27; }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getCurrentDate(); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;image:image&gt; &lt;image:loc&gt;${imageUrl}&lt;/image:loc&gt; &lt;image:title&gt;${metadata.title}&lt;/image:title&gt; &lt;image:caption&gt;${metadata.description}&lt;/image:caption&gt; &lt;image:license&gt;${BASE_URL}/terms-of-use&lt;/image:license&gt; &lt;image:geo_location&gt;Global&lt;/image:geo_location&gt; &lt;/image:image&gt; &lt;/url&gt;`; } function generateMultimediaSitemap() { console.log(&#x27;Generating multimedia sitemap...&#x27;); let xmlContent = `&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot; xmlns:image=&quot;http://www.google.com/schemas/sitemap-image/1.1&quot; xmlns:video=&quot;http://www.google.com/schemas/sitemap-video/1.1&quot;&gt; `; // Add video entries console.log(`Processing ${videoFiles.length} video files...`); videoFiles.forEach(filename =&gt; { xmlContent += generateVideoEntry(filename) + &#x27;\n&#x27;; }); // Add image entries console.log(`Processing ${imageFiles.length} image files...`); imageFiles.forEach(filename =&gt; { xmlContent += generateImageEntry(filename) + &#x27;\n&#x27;; }); xmlContent += &#x27;&lt;/urlset&gt;&#x27;; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, &#x27;utf8&#x27;); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error(&#x27;Failed to generate multimedia sitemap:&#x27;, error); process.exit(1); }</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ generate-multimedia-sitemap.js</div> <div class="content">const fs = require(&#x27;fs&#x27;); const path = require(&#x27;path&#x27;); // Configuration const BASE_URL = &#x27;https://modernphototools.com&#x27;; const VIDEO_DIR = &#x27;public/tools videos&#x27;; const IMAGE_DIR = &#x27;public/images/tools images&#x27;; const OUTPUT_FILE = &#x27;public/sitemap-multimedia.xml&#x27;; // Tool mapping for metadata const toolMetadata = { &#x27;AI Avatar&#x27;: { title: &#x27;AI Avatar Generator Tool&#x27;, description: &#x27;Create stunning AI avatars from your photos with advanced artificial intelligence technology&#x27;, category: &#x27;avatar-creation&#x27;, duration: &#x27;45&#x27; // seconds }, &#x27;AI Background Generator&#x27;: { title: &#x27;AI Background Generator Tool&#x27;, description: &#x27;Generate professional backgrounds for your photos using AI technology&#x27;, category: &#x27;background-generation&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Caricature&#x27;: { title: &#x27;AI Caricature Generator Tool&#x27;, description: &#x27;Transform your photos into fun caricatures with AI-powered technology&#x27;, category: &#x27;caricature-creation&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Cartoon&#x27;: { title: &#x27;AI Cartoon Generator Tool&#x27;, description: &#x27;Convert your photos into cartoon style images using advanced AI&#x27;, category: &#x27;cartoon-creation&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Cleanup&#x27;: { title: &#x27;AI Cleanup Tool&#x27;, description: &#x27;Remove unwanted objects and clean up your photos with AI technology&#x27;, category: &#x27;photo-cleanup&#x27;, duration: &#x27;40&#x27; }, &#x27;AI Expand&#x27;: { title: &#x27;AI Expand Tool&#x27;, description: &#x27;Expand your images beyond their original boundaries using AI&#x27;, category: &#x27;image-expansion&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Face Swap&#x27;: { title: &#x27;AI Face Swap Tool&#x27;, description: &#x27;Swap faces in photos seamlessly with advanced AI face recognition&#x27;, category: &#x27;face-swap&#x27;, duration: &#x27;45&#x27; }, &#x27;AI Filter&#x27;: { title: &#x27;AI Filter Tool&#x27;, description: &#x27;Apply artistic filters to your photos using AI-powered technology&#x27;, category: &#x27;filter-application&#x27;, duration: &#x27;35&#x27; }, &#x27;AI Hairstyle&#x27;: { title: &#x27;AI Hairstyle Tool&#x27;, description: &#x27;Try different hairstyles on your photos with AI technology&#x27;, category: &#x27;hairstyle-simulation&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Image Generator_text-to-image&#x27;: { title: &#x27;AI Image Generator Tool&#x27;, description: &#x27;Generate images from text descriptions using advanced AI technology&#x27;, category: &#x27;text-to-image&#x27;, duration: &#x27;70&#x27; }, &#x27;AI Image Upscaler&#x27;: { title: &#x27;AI Image Upscaler Tool&#x27;, description: &#x27;Enhance and upscale your images with AI-powered technology&#x27;, category: &#x27;image-upscaling&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Image to Image&#x27;: { title: &#x27;AI Image to Image Tool&#x27;, description: &#x27;Transform images from one style to another using AI technology&#x27;, category: &#x27;image-transformation&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Outfit&#x27;: { title: &#x27;AI Outfit Tool&#x27;, description: &#x27;Try different outfits on your photos with AI-powered fashion technology&#x27;, category: &#x27;outfit-simulation&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Portrait&#x27;: { title: &#x27;AI Portrait Tool&#x27;, description: &#x27;Create professional portraits from your photos using AI technology&#x27;, category: &#x27;portrait-creation&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Product Photoshoot&#x27;: { title: &#x27;AI Product Photoshoot Tool&#x27;, description: &#x27;Create professional product photos with AI-powered background technology&#x27;, category: &#x27;product-photography&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Replace&#x27;: { title: &#x27;AI Replace Tool&#x27;, description: &#x27;Replace objects in photos seamlessly with AI technology&#x27;, category: &#x27;object-replacement&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Sketch to Image&#x27;: { title: &#x27;AI Sketch to Image Tool&#x27;, description: &#x27;Convert sketches into realistic images using AI technology&#x27;, category: &#x27;sketch-to-image&#x27;, duration: &#x27;75&#x27; }, &#x27;Remove Background&#x27;: { title: &#x27;Remove Background Tool&#x27;, description: &#x27;Remove backgrounds from photos instantly with AI technology&#x27;, category: &#x27;background-removal&#x27;, duration: &#x27;30&#x27; } }; function getFileLastModified(filePath) { try { const stats = fs.statSync(filePath); return stats.mtime.toISOString(); } catch (error) { return new Date().toISOString(); } } function generateVideoSitemapEntry(filename, toolKey) { const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool video demonstration&#x27;, category: &#x27;ai-tools&#x27;, duration: &#x27;60&#x27; }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + &#x27; Tool.jpg&#x27;)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getFileLastModified(path.join(VIDEO_DIR, filename)); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;video:video&gt; &lt;video:thumbnail_loc&gt;${thumbnailUrl}&lt;/video:thumbnail_loc&gt; &lt;video:title&gt;${metadata.title}&lt;/video:title&gt; &lt;video:description&gt;${metadata.description}&lt;/video:description&gt; &lt;video:content_loc&gt;${videoUrl}&lt;/video:content_loc&gt; &lt;video:duration&gt;${metadata.duration}&lt;/video:duration&gt; &lt;video:publication_date&gt;${lastmod}&lt;/video:publication_date&gt; &lt;video:family_friendly&gt;yes&lt;/video:family_friendly&gt; &lt;video:category&gt;${metadata.category}&lt;/video:category&gt; &lt;video:tag&gt;AI tools&lt;/video:tag&gt; &lt;video:tag&gt;photo editing&lt;/video:tag&gt; &lt;video:tag&gt;artificial intelligence&lt;/video:tag&gt; &lt;video:tag&gt;image processing&lt;/video:tag&gt; &lt;/video:video&gt; &lt;/url&gt;`; } function generateImageSitemapEntry(filename, toolKey) { const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.jpg&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool demonstration image&#x27;, category: &#x27;ai-tools&#x27; }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getFileLastModified(path.join(IMAGE_DIR, filename)); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;image:image&gt; &lt;image:loc&gt;${imageUrl}&lt;/image:loc&gt; &lt;image:title&gt;${metadata.title}&lt;/image:title&gt; &lt;image:caption&gt;${metadata.description}&lt;/image:caption&gt; &lt;image:license&gt;${BASE_URL}/terms-of-use&lt;/image:license&gt; &lt;image:geo_location&gt;Global&lt;/image:geo_location&gt; &lt;/image:image&gt; &lt;/url&gt;`; } function generateMultimediaSitemap() { console.log(&#x27;Generating multimedia sitemap...&#x27;); // Read video files const videoFiles = fs.readdirSync(VIDEO_DIR).filter(file =&gt; file.endsWith(&#x27;.mp4&#x27;)); console.log(`Found ${videoFiles.length} video files`); // Read image files const imageFiles = fs.readdirSync(IMAGE_DIR).filter(file =&gt; file.endsWith(&#x27;.jpg&#x27;)); console.log(`Found ${imageFiles.length} image files`); // Generate XML content let xmlContent = `&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot; xmlns:image=&quot;http://www.google.com/schemas/sitemap-image/1.1&quot; xmlns:video=&quot;http://www.google.com/schemas/sitemap-video/1.1&quot;&gt; `; // Add video entries console.log(&#x27;Processing video files...&#x27;); videoFiles.forEach(filename =&gt; { const toolKey = filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;); xmlContent += generateVideoSitemapEntry(filename, toolKey) + &#x27;\n&#x27;; }); // Add image entries console.log(&#x27;Processing image files...&#x27;); imageFiles.forEach(filename =&gt; { const toolKey = filename.replace(&#x27; Tool.jpg&#x27;, &#x27;&#x27;).replace(&#x27;.jpg&#x27;, &#x27;&#x27;); xmlContent += generateImageSitemapEntry(filename, toolKey) + &#x27;\n&#x27;; }); xmlContent += &#x27;&lt;/urlset&gt;&#x27;; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, &#x27;utf8&#x27;); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Error handling process.on(&#x27;uncaughtException&#x27;, (error) =&gt; { console.error(&#x27;Error generating sitemap:&#x27;, error); process.exit(1); }); process.on(&#x27;unhandledRejection&#x27;, (error) =&gt; { console.error(&#x27;Unhandled promise rejection:&#x27;, error); process.exit(1); }); // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error(&#x27;Failed to generate multimedia sitemap:&#x27;, error); process.exit(1); }</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ generate-multimedia-sitemap.mjs</div> <div class="content">import fs from &#x27;fs&#x27;; // Configuration const BASE_URL = &#x27;https://modernphototools.com&#x27;; const OUTPUT_FILE = &#x27;public/sitemap-multimedia.xml&#x27;; // Tool mapping for metadata const toolMetadata = { &#x27;AI Avatar&#x27;: { title: &#x27;AI Avatar Generator Tool&#x27;, description: &#x27;Create stunning AI avatars from your photos with advanced artificial intelligence technology&#x27;, duration: &#x27;45&#x27; }, &#x27;AI Background Generator&#x27;: { title: &#x27;AI Background Generator Tool&#x27;, description: &#x27;Generate professional backgrounds for your photos using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Caricature&#x27;: { title: &#x27;AI Caricature Generator Tool&#x27;, description: &#x27;Transform your photos into fun caricatures with AI-powered technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Cartoon&#x27;: { title: &#x27;AI Cartoon Generator Tool&#x27;, description: &#x27;Convert your photos into cartoon style images using advanced AI&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Cleanup&#x27;: { title: &#x27;AI Cleanup Tool&#x27;, description: &#x27;Remove unwanted objects and clean up your photos with AI technology&#x27;, duration: &#x27;40&#x27; }, &#x27;AI Expand&#x27;: { title: &#x27;AI Expand Tool&#x27;, description: &#x27;Expand your images beyond their original boundaries using AI&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Face Swap&#x27;: { title: &#x27;AI Face Swap Tool&#x27;, description: &#x27;Swap faces in photos seamlessly with advanced AI face recognition&#x27;, duration: &#x27;45&#x27; }, &#x27;AI Filter&#x27;: { title: &#x27;AI Filter Tool&#x27;, description: &#x27;Apply artistic filters to your photos using AI-powered technology&#x27;, duration: &#x27;35&#x27; }, &#x27;AI Hairstyle&#x27;: { title: &#x27;AI Hairstyle Tool&#x27;, description: &#x27;Try different hairstyles on your photos with AI technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Image Generator_text-to-image&#x27;: { title: &#x27;AI Image Generator Tool&#x27;, description: &#x27;Generate images from text descriptions using advanced AI technology&#x27;, duration: &#x27;70&#x27; }, &#x27;AI Image Upscaler&#x27;: { title: &#x27;AI Image Upscaler Tool&#x27;, description: &#x27;Enhance and upscale your images with AI-powered technology&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Image to Image&#x27;: { title: &#x27;AI Image to Image Tool&#x27;, description: &#x27;Transform images from one style to another using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Outfit&#x27;: { title: &#x27;AI Outfit Tool&#x27;, description: &#x27;Try different outfits on your photos with AI-powered fashion technology&#x27;, duration: &#x27;55&#x27; }, &#x27;AI Portrait&#x27;: { title: &#x27;AI Portrait Tool&#x27;, description: &#x27;Create professional portraits from your photos using AI technology&#x27;, duration: &#x27;60&#x27; }, &#x27;AI Product Photoshoot&#x27;: { title: &#x27;AI Product Photoshoot Tool&#x27;, description: &#x27;Create professional product photos with AI-powered background technology&#x27;, duration: &#x27;65&#x27; }, &#x27;AI Replace&#x27;: { title: &#x27;AI Replace Tool&#x27;, description: &#x27;Replace objects in photos seamlessly with AI technology&#x27;, duration: &#x27;50&#x27; }, &#x27;AI Sketch to Image&#x27;: { title: &#x27;AI Sketch to Image Tool&#x27;, description: &#x27;Convert sketches into realistic images using AI technology&#x27;, duration: &#x27;75&#x27; }, &#x27;Remove Background&#x27;: { title: &#x27;Remove Background Tool&#x27;, description: &#x27;Remove backgrounds from photos instantly with AI technology&#x27;, duration: &#x27;30&#x27; } }; // Video files const videoFiles = [ &#x27;AI Avatar.mp4&#x27;, &#x27;AI Background Generator.mp4&#x27;, &#x27;AI Caricature.mp4&#x27;, &#x27;AI Cartoon.mp4&#x27;, &#x27;AI Cleanup.mp4&#x27;, &#x27;AI Expand.mp4&#x27;, &#x27;AI Face Swap.mp4&#x27;, &#x27;AI Filter.mp4&#x27;, &#x27;AI Hairstyle.mp4&#x27;, &#x27;AI Image Generator_text-to-image.mp4&#x27;, &#x27;AI Image Upscaler.mp4&#x27;, &#x27;AI Image to Image.mp4&#x27;, &#x27;AI Outfit.mp4&#x27;, &#x27;AI Portrait.mp4&#x27;, &#x27;AI Product Photoshoot.mp4&#x27;, &#x27;AI Replace.mp4&#x27;, &#x27;AI Sketch to Image.mp4&#x27;, &#x27;Remove Background.mp4&#x27; ]; // Image files const imageFiles = [ &#x27;AI Avatar Tool.jpg&#x27;, &#x27;AI Background Generator Tool.jpg&#x27;, &#x27;AI Caricature Generator Tool.jpg&#x27;, &#x27;AI Cartoon Tool.jpg&#x27;, &#x27;AI Cleanup Tool.jpg&#x27;, &#x27;Ai Expand tool.jpg&#x27;, &#x27;AI Face Swap Tool.jpg&#x27;, &#x27;AI Filter Tool.jpg&#x27;, &#x27;AI Hairstyle Tool.jpg&#x27;, &#x27;AI Image Generator Tool.jpg&#x27;, &#x27;AI Image Upscaler Tool.jpg&#x27;, &#x27;AI Image to Image Tool.jpg&#x27;, &#x27;AI Outfit Tool.jpg&#x27;, &#x27;AI Portrait Tool.jpg&#x27;, &#x27;AI Product Photoshoot Tool.jpg&#x27;, &#x27;AI Replace tool.jpg&#x27;, &#x27;AI Sketch to Image Tool.jpg&#x27;, &#x27;Remove Background tool.jpg&#x27; ]; function getCurrentDate() { return new Date().toISOString(); } function generateVideoEntry(filename) { const toolKey = filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;); const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.mp4&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool video demonstration&#x27;, duration: &#x27;60&#x27; }; const videoUrl = `${BASE_URL}/tools%20videos/${encodeURIComponent(filename)}`; const thumbnailUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(toolKey + &#x27; Tool.jpg&#x27;)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getCurrentDate(); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;video:video&gt; &lt;video:thumbnail_loc&gt;${thumbnailUrl}&lt;/video:thumbnail_loc&gt; &lt;video:title&gt;${metadata.title}&lt;/video:title&gt; &lt;video:description&gt;${metadata.description}&lt;/video:description&gt; &lt;video:content_loc&gt;${videoUrl}&lt;/video:content_loc&gt; &lt;video:duration&gt;${metadata.duration}&lt;/video:duration&gt; &lt;video:publication_date&gt;${lastmod}&lt;/video:publication_date&gt; &lt;video:family_friendly&gt;yes&lt;/video:family_friendly&gt; &lt;video:tag&gt;AI tools&lt;/video:tag&gt; &lt;video:tag&gt;photo editing&lt;/video:tag&gt; &lt;video:tag&gt;artificial intelligence&lt;/video:tag&gt; &lt;video:tag&gt;image processing&lt;/video:tag&gt; &lt;/video:video&gt; &lt;/url&gt;`; } function generateImageEntry(filename) { const toolKey = filename.replace(&#x27; Tool.jpg&#x27;, &#x27;&#x27;).replace(&#x27;.jpg&#x27;, &#x27;&#x27;); const metadata = toolMetadata[toolKey] || { title: filename.replace(&#x27;.jpg&#x27;, &#x27;&#x27;), description: &#x27;AI-powered photo editing tool demonstration image&#x27; }; const imageUrl = `${BASE_URL}/images/tools%20images/${encodeURIComponent(filename)}`; const toolPageUrl = `${BASE_URL}/tools/${toolKey.toLowerCase().replace(/_/g, &#x27;-&#x27;).replace(/\s+/g, &#x27;-&#x27;)}`; const lastmod = getCurrentDate(); return ` &lt;url&gt; &lt;loc&gt;${toolPageUrl}&lt;/loc&gt; &lt;lastmod&gt;${lastmod}&lt;/lastmod&gt; &lt;changefreq&gt;monthly&lt;/changefreq&gt; &lt;priority&gt;0.8&lt;/priority&gt; &lt;image:image&gt; &lt;image:loc&gt;${imageUrl}&lt;/image:loc&gt; &lt;image:title&gt;${metadata.title}&lt;/image:title&gt; &lt;image:caption&gt;${metadata.description}&lt;/image:caption&gt; &lt;image:license&gt;${BASE_URL}/terms-of-use&lt;/image:license&gt; &lt;image:geo_location&gt;Global&lt;/image:geo_location&gt; &lt;/image:image&gt; &lt;/url&gt;`; } function generateMultimediaSitemap() { console.log(&#x27;Generating multimedia sitemap...&#x27;); let xmlContent = `&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot; xmlns:image=&quot;http://www.google.com/schemas/sitemap-image/1.1&quot; xmlns:video=&quot;http://www.google.com/schemas/sitemap-video/1.1&quot;&gt; `; // Add video entries console.log(`Processing ${videoFiles.length} video files...`); videoFiles.forEach(filename =&gt; { xmlContent += generateVideoEntry(filename) + &#x27;\n&#x27;; }); // Add image entries console.log(`Processing ${imageFiles.length} image files...`); imageFiles.forEach(filename =&gt; { xmlContent += generateImageEntry(filename) + &#x27;\n&#x27;; }); xmlContent += &#x27;&lt;/urlset&gt;&#x27;; // Write to file fs.writeFileSync(OUTPUT_FILE, xmlContent, &#x27;utf8&#x27;); console.log(`Multimedia sitemap generated successfully: ${OUTPUT_FILE}`); console.log(`Total entries: ${videoFiles.length + imageFiles.length}`); } // Run the generator try { generateMultimediaSitemap(); } catch (error) { console.error(&#x27;Failed to generate multimedia sitemap:&#x27;, error); process.exit(1); }</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ generate-sitemap.cjs</div> <div class="content">const { SitemapStream, streamToPromise } = require(&#x27;sitemap&#x27;); const fs = require(&#x27;node:fs&#x27;); const path = require(&#x27;node:path&#x27;); const matter = require(&#x27;gray-matter&#x27;); class SitemapGenerator { constructor() { this.baseUrl = &#x27;https://modernphototools.com&#x27;; this.contentDir = path.resolve(&#x27;./content/blog&#x27;); this.toolsPath = path.resolve(&#x27;./src/data/tools.ts&#x27;); this.blogArticlesPath = path.resolve(&#x27;./src/data/blogArticles.ts&#x27;); this.sitemapPath = path.resolve(&#x27;./public/sitemap.xml&#x27;); this.lastGeneratedPath = path.resolve(&#x27;./public/.sitemap-lastgen&#x27;); } // Parse TypeScript data files parseDataFile(filePath) { try { const content = fs.readFileSync(filePath, &#x27;utf-8&#x27;); const exportMatch = content.match(/export const (\w+):\s*\w+\[\]\s*=\s*(\[[\s\S]*?\]);/); if (exportMatch) { const [, varName, arrayContent] = exportMatch; let jsonContent = arrayContent .replace(/&#x27;/g, &#x27;&quot;&#x27;) .replace(/(\w+):/g, &#x27;&quot;$1&quot;:&#x27;) .replace(/,\s*}/g, &#x27;}&#x27;) .replace(/,\s*]/g, &#x27;]&#x27;); return JSON.parse(jsonContent); } return []; } catch (error) { console.warn(`Could not parse ${filePath}:`, error.message); return []; } } // Scan blog directory for markdown files async scanBlogArticles() { const articles = []; try { if (!fs.existsSync(this.contentDir)) { console.warn(`Blog content directory not found: ${this.contentDir}`); return articles; } const files = fs.readdirSync(this.contentDir); const markdownFiles = files.filter(file =&gt; file.endsWith(&#x27;.md&#x27;)); for (const file of markdownFiles) { try { const filePath = path.join(this.contentDir, file); const fileContent = fs.readFileSync(filePath, &#x27;utf-8&#x27;); const { data: frontmatter } = matter(fileContent); // Get file stats for lastmod const stats = fs.statSync(filePath); // Validate required frontmatter fields if (!frontmatter.id || !frontmatter.title) { console.warn(`Skipping ${file}: Missing required frontmatter (id or title)`); continue; } // Check if article is published (not draft) if (frontmatter.draft === true) { console.log(`Skipping draft article: ${file}`); continue; } articles.push({ id: frontmatter.id, title: frontmatter.title, category: frontmatter.category || &#x27;general&#x27;, featuredImage: frontmatter.featuredImage || &#x27;&#x27;, keywords: frontmatter.keywords || [], publishDate: frontmatter.publishDate || stats.birthtime.toISOString().split(&#x27;T&#x27;)[0], lastModified: stats.mtime, filePath: filePath }); } catch (error) { console.warn(`Error processing ${file}:`, error.message); } } console.log(`โœ… Scanned ${articles.length} published articles from ${markdownFiles.length} markdown files`); return articles; } catch (error) { console.error(&#x27;Error scanning blog articles:&#x27;, error); return articles; } } // Extract tools data extractToolsData() { try { const toolsContent = fs.readFileSync(this.toolsPath, &#x27;utf-8&#x27;); const toolMatches = toolsContent.matchAll(/{\s*id:\s*&#x27;([^&#x27;]+)&#x27;,[\s\S]*?path:\s*&#x27;([^&#x27;]+)&#x27;[\s\S]*?}/g); return Array.from(toolMatches).map(match =&gt; ({ id: match[1], path: match[2] })); } catch (error) { console.warn(&#x27;Error extracting tools data:&#x27;, error.message); return []; } } // Generate sitemap URLs generateUrls(tools, articles) { const urls = []; // Static pages with priorities and change frequencies const staticPages = [ { url: &#x27;/&#x27;, changefreq: &#x27;daily&#x27;, priority: 1.0 }, { url: &#x27;/tools&#x27;, changefreq: &#x27;daily&#x27;, priority: 0.9 }, { url: &#x27;/blog&#x27;, changefreq: &#x27;daily&#x27;, priority: 0.9 }, { url: &#x27;/about&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.7 }, { url: &#x27;/contact&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.7 }, { url: &#x27;/privacy-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.5 }, { url: &#x27;/terms-of-use&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.5 }, { url: &#x27;/dmca&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.5 }, { url: &#x27;/cookies-policy&#x27;, changefreq: &#x27;yearly&#x27;, priority: 0.5 }, ]; urls.push(...staticPages); // Tool pages const toolPages = tools.map(tool =&gt; ({ url: tool.path, changefreq: &#x27;monthly&#x27;, priority: 0.8, lastmod: new Date().toISOString() })); urls.push(...toolPages); // Blog article pages with proper lastmod dates const blogPages = articles.map(article =&gt; { const blogUrl = { url: `/blog/${article.id}`, changefreq: &#x27;monthly&#x27;, priority: 0.7, lastmod: article.lastModified.toISOString() }; // Add image if featured image exists if (article.featuredImage) { blogUrl.img = [{ url: article.featuredImage.startsWith(&#x27;http&#x27;) ? article.featuredImage : `${this.baseUrl}${article.featuredImage}`, title: article.title, caption: `Featured image for: ${article.title}` }]; } return blogUrl; }); urls.push(...blogPages); // Intentionally excluding blog category and tag pages from sitemap return { urls, counts: { static: staticPages.length, tools: toolPages.length, articles: blogPages.length, total: urls.length } }; } // Validate sitemap XML validateSitemap(xmlContent) { try { // Basic XML validation if (!xmlContent.includes(&#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x27;)) { throw new Error(&#x27;Missing XML declaration&#x27;); } // Check for sitemap namespace (more flexible) if (!xmlContent.includes(&#x27;xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&#x27;)) { throw new Error(&#x27;Missing sitemap namespace&#x27;); } // Count URLs const urlCount = (xmlContent.match(/&lt;url&gt;/g) || []).length; if (urlCount === 0) { throw new Error(&#x27;No URLs found in sitemap&#x27;); } // Check for duplicate URLs const urlMatches = xmlContent.match(/&lt;loc&gt;(.*?)&lt;\/loc&gt;/g) || []; const urls = urlMatches.map(match =&gt; match.replace(/&lt;\/?loc&gt;/g, &#x27;&#x27;)); const uniqueUrls = new Set(urls); if (urls.length !== uniqueUrls.size) { throw new Error(`Found ${urls.length - uniqueUrls.size} duplicate URLs`); } console.log(`โœ… Sitemap validation passed: ${urlCount} URLs, no duplicates`); return true; } catch (error) { console.error(&#x27;โŒ Sitemap validation failed:&#x27;, error.message); return false; } } // Check if regeneration is needed shouldRegenerate() { try { if (!fs.existsSync(this.sitemapPath)) { console.log(&#x27;๐Ÿ”„ Sitemap not found, generating new one&#x27;); return true; } if (!fs.existsSync(this.lastGeneratedPath)) { console.log(&#x27;๐Ÿ”„ Last generation timestamp not found, regenerating&#x27;); return true; } const lastGenerated = new Date(fs.readFileSync(this.lastGeneratedPath, &#x27;utf-8&#x27;)); const sitemapStats = fs.statSync(this.sitemapPath); // Check if any blog files are newer than the sitemap if (fs.existsSync(this.contentDir)) { const blogFiles = fs.readdirSync(this.contentDir) .filter(file =&gt; file.endsWith(&#x27;.md&#x27;)) .map(file =&gt; path.join(this.contentDir, file)); for (const file of blogFiles) { const fileStats = fs.statSync(file); if (fileStats.mtime &gt; sitemapStats.mtime) { console.log(`๐Ÿ”„ Blog file ${path.basename(file)} is newer than sitemap, regenerating`); return true; } } } // Check if data files are newer const dataFiles = [this.toolsPath, this.blogArticlesPath]; for (const file of dataFiles) { if (fs.existsSync(file)) { const fileStats = fs.statSync(file); if (fileStats.mtime &gt; sitemapStats.mtime) { console.log(`๐Ÿ”„ Data file ${path.basename(file)} is newer than sitemap, regenerating`); return true; } } } console.log(&#x27;โœ… Sitemap is up to date&#x27;); return false; } catch (error) { console.warn(&#x27;Error checking if regeneration needed:&#x27;, error.message); return true; } } // Main generation method async generate(force = false) { try { console.log(&#x27;๐Ÿš€ Starting sitemap generation...&#x27;); // Check if regeneration is needed (unless forced) if (!force &amp;&amp; !this.shouldRegenerate()) { return { success: true, message: &#x27;Sitemap is up to date&#x27; }; } // Scan for articles and extract tools const [articles, tools] = await Promise.all([ this.scanBlogArticles(), Promise.resolve(this.extractToolsData()) ]); console.log(`๐Ÿ“Š Found ${tools.length} tools and ${articles.length} articles`); // Generate URLs const { urls, counts } = this.generateUrls(tools, articles); // Create sitemap const sitemapStream = new SitemapStream({ hostname: this.baseUrl }); urls.forEach(url =&gt; { sitemapStream.write(url); }); sitemapStream.end(); const sitemapXML = await streamToPromise(sitemapStream).then(data =&gt; data.toString()); // Validate sitemap if (!this.validateSitemap(sitemapXML)) { throw new Error(&#x27;Sitemap validation failed&#x27;); } // Ensure public directory exists const publicDir = path.dirname(this.sitemapPath); if (!fs.existsSync(publicDir)) { fs.mkdirSync(publicDir, { recursive: true }); } // Write sitemap fs.writeFileSync(this.sitemapPath, sitemapXML); // Update last generated timestamp fs.writeFileSync(this.lastGeneratedPath, new Date().toISOString()); console.log(`โœ… Sitemap generated successfully at ${this.sitemapPath}`); console.log(`๐Ÿ“Š Breakdown:`); console.log(` - Static pages: ${counts.static}`); console.log(` - Tool pages: ${counts.tools}`); console.log(` - Blog articles: ${counts.articles}`); console.log(` - Total URLs: ${counts.total}`); return { success: true, message: &#x27;Sitemap generated successfully&#x27;, counts, path: this.sitemapPath }; } catch (error) { console.error(&#x27;โŒ Sitemap generation failed:&#x27;, error); return { success: false, message: error.message, error: error }; } } } // CLI execution async function main() { const generator = new SitemapGenerator(); const force = process.argv.includes(&#x27;--force&#x27;) || process.argv.includes(&#x27;-f&#x27;); const result = await generator.generate(force); if (!result.success) { process.exit(1); } } // Export for programmatic use module.exports = { SitemapGenerator }; // Run if called directly if (require.main === module) { main().catch(console.error); }</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ index.html</div> <div class="content">&lt;!doctype html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot; /&gt; &lt;link rel=&quot;icon&quot; type=&quot;image/svg+xml&quot; href=&quot;/favicon.svg&quot; /&gt; &lt;link rel=&quot;icon&quot; type=&quot;image/x-icon&quot; href=&quot;/favicon.ico&quot; /&gt; &lt;link rel=&quot;manifest&quot; href=&quot;/manifest.json&quot; /&gt; &lt;meta name=&quot;theme-color&quot; content=&quot;#3b82f6&quot; /&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt; &lt;title&gt;ModernPhotoTools.com Website&lt;/title&gt; &lt;script type=&quot;text/javascript&quot;&gt; (function (c, l, a, r, i, t, y) { c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) }; t = l.createElement(r); t.async = 1; t.src = &quot;https://www.clarity.ms/tag/&quot; + i; y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y); })(window, document, &quot;clarity&quot;, &quot;script&quot;, &quot;tt1ibc0orv&quot;); &lt;/script&gt; &lt;!-- Pinterest Tag --&gt; &lt;script&gt; !function (e) { if (!window.pintrk) { window.pintrk = function () { window.pintrk.queue.push(Array.prototype.slice.call(arguments)) }; var n = window.pintrk; n.queue = [], n.version = &quot;3.0&quot;; var t = document.createElement(&quot;script&quot;); t.async = !0, t.src = e; var r = document.getElementsByTagName(&quot;script&quot;)[0]; r.parentNode.insertBefore(t, r) } }(&quot;https://s.pinimg.com/ct/core.js&quot;); pintrk(&#x27;load&#x27;, &#x27;2613220059684&#x27;, { em: &#x27;&lt;user_email_address&gt;&#x27; }); pintrk(&#x27;page&#x27;); &lt;/script&gt; &lt;!-- end Pinterest Tag --&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- Pinterest Tag --&gt; &lt;noscript&gt; &lt;img height=&quot;1&quot; width=&quot;1&quot; style=&quot;display:none;&quot; alt=&quot;&quot; src=&quot;https://ct.pinterest.com/v3/?event=init&amp;tid=2613220059684&amp;pd[em]=&lt;hashed_email_address&gt;&amp;noscript=1&quot; /&gt; &lt;/noscript&gt; &lt;!-- end Pinterest Tag --&gt; &lt;div id=&quot;root&quot;&gt;&lt;!--app-html--&gt;&lt;/div&gt; &lt;script type=&quot;module&quot; src=&quot;/src/main.tsx&quot;&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ lightx-proxy-server</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ .env</div> <div class="content"># LightX API Configuration # Get your API key from: https://api.lightxeditor.com/ # Replace &#x27;your_lightx_api_key_here&#x27; with your actual API key LIGHTX_API_KEY=2a48173eb8a643aebcd753c5fbee17d3_4a3ac5ce4a874483ba63f3b458fb5c6c_andoraitools # Server Configuration PORT=3001</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ package.json</div> <div class="content">{ &quot;name&quot;: &quot;lightx-proxy-server&quot;, &quot;version&quot;: &quot;1.0.0&quot;, &quot;main&quot;: &quot;server.js&quot;, &quot;scripts&quot;: { &quot;start&quot;: &quot;node server.js&quot;, &quot;dev&quot;: &quot;nodemon server.js&quot; }, &quot;keywords&quot;: [], &quot;author&quot;: &quot;&quot;, &quot;license&quot;: &quot;ISC&quot;, &quot;description&quot;: &quot;&quot;, &quot;dependencies&quot;: { &quot;cors&quot;: &quot;^2.8.5&quot;, &quot;dotenv&quot;: &quot;^16.5.0&quot;, &quot;express&quot;: &quot;^4.18.2&quot;, &quot;node-fetch&quot;: &quot;^3.3.2&quot; }, &quot;devDependencies&quot;: { &quot;nodemon&quot;: &quot;^3.1.10&quot; } } </div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ server.js</div> <div class="content">// server.js const express = require(&#x27;express&#x27;); const cors = require(&#x27;cors&#x27;); // Use node-fetch v2 syntax for CommonJS const fetch = (...args) =&gt; import(&#x27;node-fetch&#x27;).then(({default: fetch}) =&gt; fetch(...args)); require(&#x27;dotenv&#x27;).config(); const app = express(); const PORT = process.env.PORT || 3001; // Middleware app.use(cors({ origin: [&#x27;https://modernphototools.netlify.app&#x27;, &#x27;http://localhost:5173&#x27;, &#x27;http://localhost:5174&#x27;], // Your Vite dev server credentials: true, methods: [&#x27;GET&#x27;, &#x27;POST&#x27;, &#x27;PUT&#x27;, &#x27;OPTIONS&#x27;], allowedHeaders: [&#x27;Content-Type&#x27;, &#x27;x-api-key&#x27;, &#x27;Authorization&#x27;], preflightContinue: false, })); app.use(express.json()); function detectOutput(base) { const s = String(base || &#x27;&#x27;).toLowerCase(); if (/\bdescription\b/.test(s)) return &#x27;Product description&#x27;; if (/\bscript\b/.test(s)) return &#x27;YouTube script&#x27;; if (s.includes(&#x27;blog&#x27;) || s.includes(&#x27;article&#x27;) || s.includes(&#x27;post&#x27;)) return &#x27;Blog post&#x27;; if (s.includes(&#x27;email&#x27;)) return &#x27;Marketing email&#x27;; if (s.includes(&#x27;caption&#x27;)) return &#x27;Social caption&#x27;; return &#x27;Structured prompt&#x27;; } function detectContext(base) { const s = String(base || &#x27;&#x27;).toLowerCase(); if (s.includes(&#x27;product&#x27;)) return &#x27;E-commerce product page&#x27;; if (s.includes(&#x27;marketing&#x27;) || s.includes(&#x27;sell&#x27;) || s.includes(&#x27;campaign&#x27;)) return &#x27;Marketing content review&#x27;; if (s.includes(&#x27;youtube&#x27;) || s.includes(&#x27;video&#x27;)) return &#x27;YouTube audience&#x27;; if (s.includes(&#x27;portfolio&#x27;)) return &#x27;Portfolio website&#x27;; return &#x27;General audience with practical goals&#x27;; } function detectRhythm(base) { const s = String(base || &#x27;&#x27;).toLowerCase(); if (s.includes(&#x27;professional&#x27;)) return &#x27;Professional and concise&#x27;; if (s.includes(&#x27;fun&#x27;) || s.includes(&#x27;friendly&#x27;)) return &#x27;Friendly and engaging&#x27;; if (s.includes(&#x27;premium&#x27;) || s.includes(&#x27;luxury&#x27;)) return &#x27;Elegant and premium&#x27;; return &#x27;Concise, confident, and helpful&#x27;; } function extractSubject(base) { const m = String(base || &#x27;&#x27;).match(/for ([^.,;]+)/i); if (m) return m[1].trim(); const words = String(base || &#x27;&#x27;).split(/[^a-zA-Z0-9]+/).filter(Boolean); return words.slice(0, 6).join(&#x27; &#x27;).trim(); } function guessKeyFeatures(base) { const lower = String(base || &#x27;&#x27;).toLowerCase(); if (lower.includes(&#x27;earbuds&#x27;) || lower.includes(&#x27;headphones&#x27;)) return &#x27;Noise cancellation, 30hr battery, Bluetooth 5.3&#x27;; if (lower.includes(&#x27;camera&#x27;)) return &#x27;4K video, 24MP sensor, fast autofocus&#x27;; if (lower.includes(&#x27;laptop&#x27;)) return &#x27;OLED display, 16GB RAM, lightweight&#x27;; return &#x27;Key benefit 1, Key benefit 2, Key specification 3&#x27;; } function composeMicro(basePrompt) { const subject = extractSubject(basePrompt); const Output = detectOutput(basePrompt); const Context = detectContext(basePrompt); const Rhythm = detectRhythm(basePrompt); const KeyFeatures = guessKeyFeatures(basePrompt); const Message = `Create ${Output.toLowerCase()} for ${subject}`.trim(); const Intention = &#x27;Inform and persuade the audience to take action&#x27;; return { Message, Intention, Context, Rhythm, Output, KeyFeatures }; } app.post(&#x27;/api/ai-suggest&#x27;, async (req, res) =&gt; { try { const { basePrompt, provider } = req.body; if (!basePrompt) return res.status(400).json({ error: &#x27;Missing basePrompt&#x27; }); const useOpenAI = provider === &#x27;openai&#x27; &amp;&amp; process.env.OPENAI_API_KEY; const useGemini = provider === &#x27;gemini&#x27; &amp;&amp; process.env.GEMINI_API_KEY; if (useOpenAI) { const payload = { model: &#x27;gpt-4o-mini&#x27;, messages: [ { role: &#x27;system&#x27;, content: &#x27;Return JSON with keys Message, Intention, Context, Rhythm, Output, KeyFeatures only.&#x27; }, { role: &#x27;user&#x27;, content: basePrompt } ] }; const r = await fetch(&#x27;https://api.openai.com/v1/chat/completions&#x27;, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;Authorization&#x27;: `Bearer ${process.env.OPENAI_API_KEY}` }, body: JSON.stringify(payload) }); const d = await r.json(); const c = d &amp;&amp; d.choices &amp;&amp; d.choices[0] &amp;&amp; d.choices[0].message &amp;&amp; d.choices[0].message.content; if (typeof c === &#x27;string&#x27;) { try { const fields = JSON.parse(c); return res.json({ fields }); } catch {} } } if (useGemini) { const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${process.env.GEMINI_API_KEY}`; const payload = { contents: [ { role: &#x27;user&#x27;, parts: [{ text: &#x27;Return JSON with keys Message, Intention, Context, Rhythm, Output, KeyFeatures only.&#x27; }] }, { role: &#x27;user&#x27;, parts: [{ text: basePrompt }] } ] }; const r = await fetch(url, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify(payload) }); const d = await r.json(); const text = d &amp;&amp; d.candidates &amp;&amp; d.candidates[0] &amp;&amp; d.candidates[0].content &amp;&amp; d.candidates[0].content.parts &amp;&amp; d.candidates[0].content.parts[0] &amp;&amp; d.candidates[0].content.parts[0].text; if (typeof text === &#x27;string&#x27;) { try { const fields = JSON.parse(text); return res.json({ fields }); } catch {} } } const fields = composeMicro(basePrompt); return res.json({ fields }); } catch (e) { return res.status(500).json({ error: &#x27;ai suggest error&#x27; }); } }); // Generic LightX API proxy endpoint (similar to serverless function approach) app.post(&#x27;/api/lightx-proxy&#x27;, async (req, res) =&gt; { try { const { endpoint, body } = req.body; console.log(&#x27;Proxy request received: &#x27;, { endpoint, body }); if (!endpoint) { return res.status(400).json({ error: &#x27;Missing endpoint parameter&#x27; }); } const lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(body, null, 2)); // Use the full API key const apiKey = process.env.LIGHTX_API_KEY.trim(); if (!apiKey) { console.error(&#x27;LIGHTX_API_KEY not found in environment variables&#x27;); return res.status(500).json({ error: &#x27;API key not configured&#x27; }); } console.log(`Using API key (masked): ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); const headers = { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;x-api-key&#x27;: apiKey, &#x27;User-Agent&#x27;: &#x27;PhotoNow-Proxy/1.0&#x27; }; console.log(&#x27;Request headers:&#x27;, { ...headers, &#x27;x-api-key&#x27;: &#x27;[MASKED]&#x27; }); const response = await fetch(lightxUrl, { method: &#x27;POST&#x27;, headers: headers, body: JSON.stringify(body), }); console.log(&#x27;Response status:&#x27;, response.status); console.log(&#x27;Response headers:&#x27;, Object.fromEntries(response.headers.entries())); const responseText = await response.text(); console.log(&#x27;Raw response:&#x27;, responseText); let data; try { data = JSON.parse(responseText); } catch (parseError) { console.error(&#x27;Failed to parse JSON response:&#x27;, parseError); return res.status(500).json({ error: &#x27;Invalid JSON response from LightX API&#x27;, details: responseText.substring(0, 500) }); } console.log(&#x27;Parsed response data:&#x27;, JSON.stringify(data, null, 2)); if (!response.ok) { console.error(&#x27;LightX API Error:&#x27;, { status: response.status, statusText: response.statusText, data }); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error(&#x27;Proxy Error:&#x27;, error); res.status(500).json({ error: &#x27;Proxy server error&#x27;, details: error.message }); } }); // Keep the original endpoints for backward compatibility app.post(&#x27;/api/lightx/v1/*&#x27;, async (req, res) =&gt; { try { const endpoint = req.params[0]; const lightxUrl = `https://api.lightxeditor.com/external/api/v1/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(req.body)); // Use the full API key without splitting it const apiKey = process.env.LIGHTX_API_KEY.trim(); console.log(`Using full API key (masked): ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); console.log(`Request URL: ${lightxUrl}`); console.log(`Request body: ${JSON.stringify(req.body)}`); console.log(`Request method: POST`); console.log(`Content-Type: application/json`); // Try with different header combinations const headers = { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;x-api-key&#x27;: apiKey, }; console.log(&#x27;Request headers:&#x27;, headers); const response = await fetch(lightxUrl, { method: &#x27;POST&#x27;, headers: headers, body: JSON.stringify(req.body), }); console.log(&#x27;Response status:&#x27;, response.status); const data = await response.json(); console.log(&#x27;Response data:&#x27;, JSON.stringify(data)); if (!response.ok) { console.error(&#x27;LightX API Error:&#x27;, data); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error(&#x27;Proxy Error:&#x27;, error); res.status(500).json({ error: &#x27;Proxy server error&#x27;, details: error.message }); } }); app.post(&#x27;/api/lightx/v2/*&#x27;, async (req, res) =&gt; { try { const endpoint = req.params[0]; const lightxUrl = `https://api.lightxeditor.com/external/api/v2/${endpoint}`; console.log(`Proxying to: ${lightxUrl}`); console.log(`Request body:`, JSON.stringify(req.body)); // Log the API key (without revealing the full key for security) const apiKey = process.env.LIGHTX_API_KEY; console.log(`Using API key: ${apiKey.substring(0, 5)}...${apiKey.substring(apiKey.length - 5)}`); // Try with different header combinations const headers = { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;x-api-key&#x27;: apiKey.trim(), }; console.log(&#x27;Request headers:&#x27;, headers); const response = await fetch(lightxUrl, { method: &#x27;POST&#x27;, headers: headers, body: JSON.stringify(req.body), }); console.log(&#x27;Response status:&#x27;, response.status); const data = await response.json(); console.log(&#x27;Response data:&#x27;, JSON.stringify(data)); if (!response.ok) { console.error(&#x27;LightX API Error:&#x27;, data); return res.status(response.status).json(data); } res.json(data); } catch (error) { console.error(&#x27;Proxy Error:&#x27;, error); res.status(500).json({ error: &#x27;Proxy server error&#x27;, details: error.message }); } }); // Special handler for image uploads (PUT requests to S3) app.put(&#x27;/api/upload-proxy&#x27;, async (req, res) =&gt; { try { const { uploadUrl } = req.query; if (!uploadUrl) { return res.status(400).json({ error: &#x27;Upload URL is required&#x27; }); } // Forward the request to S3 const response = await fetch(uploadUrl, { method: &#x27;PUT&#x27;, headers: { &#x27;Content-Type&#x27;: req.headers[&#x27;content-type&#x27;], &#x27;Content-Length&#x27;: req.headers[&#x27;content-length&#x27;], }, body: req.body, }); if (!response.ok) { const errorText = await response.text(); console.error(&#x27;S3 Upload Error:&#x27;, errorText); return res.status(response.status).json({ error: &#x27;Upload failed&#x27;, details: errorText }); } res.status(200).json({ message: &#x27;Upload successful&#x27; }); } catch (error) { console.error(&#x27;Upload Proxy Error:&#x27;, error); res.status(500).json({ error: &#x27;Upload proxy error&#x27;, details: error.message }); } }); app.listen(PORT, () =&gt; { console.log(`Proxy server running on http://localhost:${PORT}`); }); </div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ netlify</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ functions</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ lightx-proxy.js</div> <div class="content">// netlify/functions/lightx-proxy.js /** * Securely retrieves and validates environment variables at runtime * @param {string} key - Environment variable key * @param {boolean} required - Whether the variable is required * @returns {string|null} - The environment variable value or null if not found */ function getSecureEnvVar(key, required = true) { const value = process.env[key]; if (!value || value.trim() === &#x27;&#x27;) { if (required) { console.error(`Required environment variable ${key} is missing or empty`); return null; } console.warn(`Optional environment variable ${key} is not set`); return null; } // Basic validation for API key format (should be non-empty string) if (key.includes(&#x27;API_KEY&#x27;) &amp;&amp; value.length &lt; 10) { console.error(`Environment variable ${key} appears to be invalid (too short)`); return null; } return value.trim(); } /** * Creates standardized error response * @param {number} statusCode - HTTP status code * @param {string} message - Error message * @param {string} details - Optional error details * @returns {Object} - Netlify function response object */ function createErrorResponse(statusCode, message, details = null) { const response = { statusCode, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;, &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;, &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27; }, body: JSON.stringify({ error: message, ...(details &amp;&amp; { details }) }) }; // Log error for debugging (without sensitive info) console.error(`Error ${statusCode}: ${message}${details ? ` - ${details}` : &#x27;&#x27;}`); return response; } exports.handler = async function(event, context) { // Dynamic import for node-fetch ES module const { default: fetch } = await import(&#x27;node-fetch&#x27;); // Handle preflight OPTIONS request if (event.httpMethod === &#x27;OPTIONS&#x27;) { return { statusCode: 200, headers: { &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;, &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;, &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27; }, body: &#x27;&#x27; }; } // Only allow POST requests if (event.httpMethod !== &#x27;POST&#x27;) { return createErrorResponse(405, &#x27;Method Not Allowed&#x27;); } try { // Parse the request body let requestBody; try { requestBody = JSON.parse(event.body); } catch (parseError) { return createErrorResponse(400, &#x27;Invalid JSON in request body&#x27;, parseError.message); } const { endpoint, body } = requestBody; if (!endpoint) { return createErrorResponse(400, &#x27;Missing endpoint parameter&#x27;); } // Validate endpoint format if (typeof endpoint !== &#x27;string&#x27; || endpoint.trim() === &#x27;&#x27;) { return createErrorResponse(400, &#x27;Invalid endpoint parameter&#x27;); } // Construct the LightX API URL based on version // For v1 endpoints, the URL structure is different than v2 let lightxUrl; if (endpoint.startsWith(&#x27;v1/&#x27;)) { // v1 endpoints use a different URL structure lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } else { // v2 and other endpoints use the external/api path lightxUrl = `https://api.lightxeditor.com/external/api/${endpoint}`; } // Securely retrieve API key at runtime const apiKey = getSecureEnvVar(&#x27;LIGHTX_API_KEY&#x27;, true); if (!apiKey) { return createErrorResponse(500, &#x27;API key not configured or invalid&#x27;); } // Log request details (excluding sensitive info) - only in development const isDevelopment = getSecureEnvVar(&#x27;NODE_ENV&#x27;, false) !== &#x27;production&#x27;; if (isDevelopment) { console.log(`Making request to: ${lightxUrl}`); console.log(`Request body keys: ${Object.keys(body || {}).join(&#x27;, &#x27;)}`); console.log(`API key present: Yes`); } // Validate request body if present if (body &amp;&amp; typeof body !== &#x27;object&#x27;) { return createErrorResponse(400, &#x27;Request body must be an object&#x27;); } // Make the request to the LightX API with timeout const controller = new AbortController(); const timeoutId = setTimeout(() =&gt; controller.abort(), 30000); // 30 second timeout let response; try { response = await fetch(lightxUrl, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;x-api-key&#x27;: apiKey, &#x27;User-Agent&#x27;: &#x27;ModernPhotoTools/1.0&#x27; }, body: JSON.stringify(body || {}), signal: controller.signal }); } catch (fetchError) { clearTimeout(timeoutId); if (fetchError.name === &#x27;AbortError&#x27;) { return createErrorResponse(408, &#x27;Request timeout&#x27;); } return createErrorResponse(502, &#x27;Failed to connect to LightX API&#x27;, fetchError.message); } finally { clearTimeout(timeoutId); } if (isDevelopment) { console.log(`Response status: ${response.status}`); console.log(`Response status text: ${response.statusText}`); } // Get the response data let data; try { data = await response.json(); } catch (jsonError) { return createErrorResponse(502, &#x27;Invalid JSON response from LightX API&#x27;, jsonError.message); } // Return the response with proper headers return { statusCode: response.status, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, &#x27;Access-Control-Allow-Origin&#x27;: &#x27;*&#x27;, &#x27;Access-Control-Allow-Headers&#x27;: &#x27;Content-Type&#x27;, &#x27;Access-Control-Allow-Methods&#x27;: &#x27;POST, OPTIONS&#x27;, &#x27;Cache-Control&#x27;: &#x27;no-cache, no-store, must-revalidate&#x27; }, body: JSON.stringify(data) }; } catch (error) { // Log full error details for debugging console.error(&#x27;Function error:&#x27;, { message: error.message, stack: error.stack, name: error.name }); return createErrorResponse(500, &#x27;Internal server error&#x27;, error.message); } };</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ package.json</div> <div class="content">{ &quot;name&quot;: &quot;netlify-functions&quot;, &quot;version&quot;: &quot;1.0.0&quot;, &quot;description&quot;: &quot;Netlify Functions for LightX API proxy&quot;, &quot;main&quot;: &quot;lightx-proxy.js&quot;, &quot;dependencies&quot;: { &quot;node-fetch&quot;: &quot;^2.6.7&quot; } }</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ netlify.toml</div> <div class="content"># netlify.toml [build] # Directory to change to before starting a build base = &quot;/&quot; # Directory that contains the deploy-ready HTML files and assets publish = &quot;dist&quot; # Default build command command = &quot;npm run build&quot; # Redirects and rewrites [[redirects]] from = &quot;/api/lightx-proxy&quot; to = &quot;/.netlify/functions/lightx-proxy&quot; status = 200 force = true # For SPA routing [[redirects]] from = &quot;/*&quot; to = &quot;/index.html&quot; status = 200</div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ package.json</div> <div class="content">{ &quot;name&quot;: &quot;modern-photo-tools&quot;, &quot;private&quot;: true, &quot;version&quot;: &quot;1.0.0&quot;, &quot;type&quot;: &quot;module&quot;, &quot;scripts&quot;: { &quot;dev&quot;: &quot;vite&quot;, &quot;build:client&quot;: &quot;vite build&quot;, &quot;build:server&quot;: &quot;vite build --ssr src/entry-server.tsx --outDir dist/server&quot;, &quot;build:prerender&quot;: &quot;node prerender.js&quot;, &quot;build:sitemap&quot;: &quot;node generate-sitemap.cjs&quot;, &quot;build&quot;: &quot;npm run build:client &amp;&amp; npm run build:server &amp;&amp; npm run build:prerender&quot;, &quot;sitemap:watch&quot;: &quot;node scripts/sitemap-watcher.cjs&quot;, &quot;sitemap:schedule&quot;: &quot;node scripts/sitemap-scheduler.cjs&quot;, &quot;sitemap:schedule:hourly&quot;: &quot;node scripts/sitemap-scheduler.cjs --interval=60&quot;, &quot;sitemap:schedule:daily&quot;: &quot;node scripts/sitemap-scheduler.cjs --interval=1440&quot;, &quot;sitemap:validate&quot;: &quot;node scripts/sitemap-validator.cjs&quot;, &quot;sitemap:validate:regenerate&quot;: &quot;node scripts/sitemap-validator.cjs --regenerate&quot;, &quot;lint&quot;: &quot;eslint .&quot;, &quot;preview&quot;: &quot;vite preview&quot;, &quot;test&quot;: &quot;vitest run&quot; }, &quot;dependencies&quot;: { &quot;@supabase/supabase-js&quot;: &quot;^2.49.8&quot;, &quot;gray-matter&quot;: &quot;^4.0.3&quot;, &quot;lucide-react&quot;: &quot;^0.344.0&quot;, &quot;node-fetch&quot;: &quot;^3.3.2&quot;, &quot;react&quot;: &quot;^18.3.1&quot;, &quot;react-dom&quot;: &quot;^18.3.1&quot;, &quot;react-helmet-async&quot;: &quot;^2.0.4&quot;, &quot;react-markdown&quot;: &quot;^10.1.0&quot;, &quot;react-router-dom&quot;: &quot;^6.22.3&quot;, &quot;sitemap&quot;: &quot;^8.0.2&quot;, &quot;uuid&quot;: &quot;^11.1.0&quot; }, &quot;devDependencies&quot;: { &quot;@eslint/js&quot;: &quot;^9.9.1&quot;, &quot;@types/react&quot;: &quot;^18.3.5&quot;, &quot;@types/react-dom&quot;: &quot;^18.3.0&quot;, &quot;@vitejs/plugin-react&quot;: &quot;^4.3.1&quot;, &quot;autoprefixer&quot;: &quot;^10.4.18&quot;, &quot;eslint&quot;: &quot;^9.9.1&quot;, &quot;eslint-plugin-react-hooks&quot;: &quot;^5.1.0-rc.0&quot;, &quot;eslint-plugin-react-refresh&quot;: &quot;^0.4.11&quot;, &quot;globals&quot;: &quot;^15.9.0&quot;, &quot;postcss&quot;: &quot;^8.4.35&quot;, &quot;tailwindcss&quot;: &quot;^3.4.1&quot;, &quot;typescript&quot;: &quot;^5.5.3&quot;, &quot;typescript-eslint&quot;: &quot;^8.3.0&quot;, &quot;vite&quot;: &quot;^5.4.2&quot;, &quot;vitest&quot;: &quot;^2.1.3&quot; } } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ postcss.config.js</div> <div class="content">export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }; </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ prerender.js</div> <div class="content">import fs from &#x27;node:fs&#x27;; import path from &#x27;node:path&#x27;; import url from &#x27;node:url&#x27;; // --- START: Static Route Generation --- // Base static pages const basePages = [&#x27;/&#x27;, &#x27;/tools&#x27;, &#x27;/blog&#x27;, &#x27;/about&#x27;, &#x27;/contact&#x27;, &#x27;/privacy-policy&#x27;, &#x27;/terms-of-use&#x27;, &#x27;/dmca&#x27;, &#x27;/cookies-policy&#x27;]; // Tool pages (based on tools data) const toolPages = [ &#x27;/tools/remove-background&#x27;, &#x27;/tools/ai-cleanup&#x27;, &#x27;/tools/ai-expand&#x27;, &#x27;/tools/ai-replace&#x27;, &#x27;/tools/ai-cartoon&#x27;, &#x27;/tools/ai-caricature&#x27;, &#x27;/tools/ai-avatar&#x27;, &#x27;/tools/ai-product-photoshoot&#x27;, &#x27;/tools/ai-background-generator&#x27;, &#x27;/tools/ai-image-generator&#x27;, &#x27;/tools/ai-portrait&#x27;, &#x27;/tools/ai-face-swap&#x27;, &#x27;/tools/ai-outfit&#x27;, &#x27;/tools/ai-image-to-image&#x27;, &#x27;/tools/ai-sketch-to-image&#x27;, &#x27;/tools/ai-hairstyle&#x27;, &#x27;/tools/ai-image-upscaler&#x27;, &#x27;/tools/ai-filter&#x27; ]; // Blog pages (based on blogArticles data) const blogPages = [ &#x27;/blog/ai-image-enhancement-guide&#x27;, &#x27;/blog/ai-background-generators-2025&#x27;, &#x27;/blog/best-ai-headshot-generators&#x27;, &#x27;/blog/ai-avatar-creation-guide&#x27;, &#x27;/blog/professional-headshots-ai&#x27;, &#x27;/blog/ai-cartoon-photo-effects&#x27; ]; // --- END: Static Route Generation --- const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); const toAbsolute = (p) =&gt; path.resolve(__dirname, p); const template = fs.readFileSync(toAbsolute(&#x27;dist/index.html&#x27;), &#x27;utf-8&#x27;); const { render } = await import(&#x27;./dist/server/entry-server.js&#x27;); // Pre-render all routes const allRoutes = [...basePages, ...toolPages, ...blogPages]; console.log(&#x27;Discovered routes to prerender:&#x27;, allRoutes); (async () =&gt; { for (const routeUrl of allRoutes) { const appHtml = render(routeUrl, {}); const html = template.replace(`&lt;!--app-html--&gt;`, appHtml); let filePath = `dist${routeUrl}`; if (routeUrl.endsWith(&#x27;/&#x27;)) { filePath += &#x27;index.html&#x27;; } else { // Handle routes like /tools/ai-avatar filePath += &#x27;.html&#x27;; } const dir = path.dirname(filePath); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } fs.writeFileSync(toAbsolute(filePath), html); console.log(`Pre-rendered: ${filePath}`); } })();</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ scripts</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ sitemap-scheduler.cjs</div> <div class="content">const { SitemapGenerator } = require(&#x27;../generate-sitemap.cjs&#x27;); const fs = require(&#x27;node:fs&#x27;); const path = require(&#x27;node:path&#x27;); class SitemapScheduler { constructor(options = {}) { this.generator = new SitemapGenerator(); this.interval = options.interval || 24 * 60 * 60 * 1000; // Default: 24 hours this.intervalId = null; this.logPath = path.resolve(&#x27;./public/.sitemap-scheduler.log&#x27;); this.isRunning = false; } // Log scheduler activities log(message, level = &#x27;info&#x27;) { const timestamp = new Date().toISOString(); const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`; console.log(logEntry.trim()); try { fs.appendFileSync(this.logPath, logEntry); } catch (error) { console.warn(&#x27;Failed to write to log file:&#x27;, error.message); } } // Generate sitemap with logging async generateWithLogging() { this.log(&#x27;Starting scheduled sitemap generation&#x27;); try { const result = await this.generator.generate(); if (result.success) { this.log(`Sitemap generation completed: ${result.counts?.total || &#x27;unknown&#x27;} URLs`); return result; } else { this.log(`Sitemap generation failed: ${result.message}`, &#x27;error&#x27;); return result; } } catch (error) { this.log(`Sitemap generation error: ${error.message}`, &#x27;error&#x27;); return { success: false, error }; } } // Start scheduled generation start() { if (this.isRunning) { this.log(&#x27;Scheduler is already running&#x27;, &#x27;warn&#x27;); return; } this.log(`Starting sitemap scheduler with ${this.interval / 1000 / 60} minute intervals`); // Generate immediately on start this.generateWithLogging(); // Schedule regular generations this.intervalId = setInterval(() =&gt; { this.generateWithLogging(); }, this.interval); this.isRunning = true; this.log(&#x27;Sitemap scheduler started successfully&#x27;); } // Stop scheduled generation stop() { if (!this.isRunning) { this.log(&#x27;Scheduler is not running&#x27;, &#x27;warn&#x27;); return; } if (this.intervalId) { clearInterval(this.intervalId); this.intervalId = null; } this.isRunning = false; this.log(&#x27;Sitemap scheduler stopped&#x27;); } // Get scheduler status getStatus() { return { isRunning: this.isRunning, interval: this.interval, intervalMinutes: this.interval / 1000 / 60, logPath: this.logPath }; } // Setup graceful shutdown setupGracefulShutdown() { const shutdown = () =&gt; { console.log(&#x27;\n๐Ÿ”„ Shutting down sitemap scheduler...&#x27;); this.stop(); process.exit(0); }; process.on(&#x27;SIGINT&#x27;, shutdown); process.on(&#x27;SIGTERM&#x27;, shutdown); process.on(&#x27;SIGQUIT&#x27;, shutdown); } } // CLI execution async function main() { const args = process.argv.slice(2); const intervalMinutes = parseInt(args.find(arg =&gt; arg.startsWith(&#x27;--interval=&#x27;))?.split(&#x27;=&#x27;)[1]) || 1440; // Default 24 hours const scheduler = new SitemapScheduler({ interval: intervalMinutes * 60 * 1000 }); console.log(&#x27;๐Ÿš€ Starting sitemap scheduler...&#x27;); console.log(`โฐ Interval: ${intervalMinutes} minutes`); console.log(`๐Ÿ“ Log file: ${scheduler.logPath}`); scheduler.start(); scheduler.setupGracefulShutdown(); console.log(&#x27;๐ŸŽฏ Sitemap scheduler is running. Press Ctrl+C to stop.&#x27;); // Keep the process alive process.stdin.resume(); } // Export for programmatic use module.exports = { SitemapScheduler }; // Run if called directly if (require.main === module) { main().catch(console.error); }</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ sitemap-validator.cjs</div> <div class="content">const fs = require(&#x27;node:fs&#x27;); const path = require(&#x27;node:path&#x27;); const { SitemapGenerator } = require(&#x27;../generate-sitemap.cjs&#x27;); class SitemapValidator { constructor() { this.generator = new SitemapGenerator(); this.sitemapPath = path.resolve(&#x27;./public/sitemap.xml&#x27;); this.errors = []; this.warnings = []; } // Add error addError(message) { this.errors.push(message); console.error(`โŒ ERROR: ${message}`); } // Add warning addWarning(message) { this.warnings.push(message); console.warn(`โš ๏ธ WARNING: ${message}`); } // Check if sitemap file exists checkSitemapExists() { if (!fs.existsSync(this.sitemapPath)) { this.addError(&#x27;Sitemap file does not exist at public/sitemap.xml&#x27;); return false; } console.log(&#x27;โœ… Sitemap file exists&#x27;); return true; } // Validate XML structure validateXMLStructure() { try { const content = fs.readFileSync(this.sitemapPath, &#x27;utf8&#x27;); // Basic XML validation if (!content.includes(&#x27;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x27;)) { this.addError(&#x27;Missing XML declaration&#x27;); } if (!content.includes(&#x27;&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&#x27;)) { this.addError(&#x27;Missing or incorrect urlset declaration&#x27;); } if (!content.includes(&#x27;&lt;/urlset&gt;&#x27;)) { this.addError(&#x27;Missing closing urlset tag&#x27;); } // Count URL entries const urlMatches = content.match(/&lt;url&gt;/g); const urlCount = urlMatches ? urlMatches.length : 0; if (urlCount === 0) { this.addError(&#x27;No URLs found in sitemap&#x27;); } else { console.log(`โœ… Found ${urlCount} URLs in sitemap`); } return { valid: this.errors.length === 0, urlCount }; } catch (error) { this.addError(`Failed to read sitemap: ${error.message}`); return { valid: false, urlCount: 0 }; } } // Extract URLs from sitemap extractURLs() { try { const content = fs.readFileSync(this.sitemapPath, &#x27;utf8&#x27;); const urlRegex = /&lt;loc&gt;(.*?)&lt;\/loc&gt;/g; const urls = []; let match; while ((match = urlRegex.exec(content)) !== null) { urls.push(match[1]); } return urls; } catch (error) { this.addError(`Failed to extract URLs: ${error.message}`); return []; } } // Check for duplicate URLs checkDuplicates(urls) { const seen = new Set(); const duplicates = []; urls.forEach(url =&gt; { if (seen.has(url)) { duplicates.push(url); } else { seen.add(url); } }); if (duplicates.length &gt; 0) { this.addError(`Found ${duplicates.length} duplicate URLs:`); duplicates.forEach(url =&gt; console.error(` - ${url}`)); } else { console.log(&#x27;โœ… No duplicate URLs found&#x27;); } return duplicates.length === 0; } // Validate URL format validateURLFormat(urls) { const invalidUrls = []; const baseUrl = &#x27;https://modernphototools.com&#x27;; urls.forEach(url =&gt; { try { new URL(url); if (!url.startsWith(baseUrl)) { this.addWarning(`URL doesn&#x27;t start with base URL: ${url}`); } } catch (error) { invalidUrls.push(url); } }); if (invalidUrls.length &gt; 0) { this.addError(`Found ${invalidUrls.length} invalid URLs:`); invalidUrls.forEach(url =&gt; console.error(` - ${url}`)); } else { console.log(&#x27;โœ… All URLs have valid format&#x27;); } return invalidUrls.length === 0; } // Check if new articles are included async checkNewArticlesIncluded() { try { const blogDir = path.resolve(&#x27;./content/blog&#x27;); const files = fs.readdirSync(blogDir).filter(file =&gt; file.endsWith(&#x27;.md&#x27;)); const urls = this.extractURLs(); const missingArticles = []; for (const file of files) { const articleId = file.replace(&#x27;.md&#x27;, &#x27;&#x27;); const expectedUrl = `https://modernphototools.com/blog/${articleId}`; if (!urls.includes(expectedUrl)) { missingArticles.push(articleId); } } if (missingArticles.length &gt; 0) { this.addError(`Found ${missingArticles.length} articles missing from sitemap:`); missingArticles.forEach(article =&gt; console.error(` - ${article}`)); } else { console.log(&#x27;โœ… All blog articles are included in sitemap&#x27;); } return missingArticles.length === 0; } catch (error) { this.addError(`Failed to check articles: ${error.message}`); return false; } } // Check lastmod dates validateLastModDates() { try { const content = fs.readFileSync(this.sitemapPath, &#x27;utf8&#x27;); const lastmodRegex = /&lt;lastmod&gt;(.*?)&lt;\/lastmod&gt;/g; const invalidDates = []; let match; while ((match = lastmodRegex.exec(content)) !== null) { const dateStr = match[1]; const date = new Date(dateStr); if (isNaN(date.getTime())) { invalidDates.push(dateStr); } } if (invalidDates.length &gt; 0) { this.addError(`Found ${invalidDates.length} invalid lastmod dates:`); invalidDates.forEach(date =&gt; console.error(` - ${date}`)); } else { console.log(&#x27;โœ… All lastmod dates are valid&#x27;); } return invalidDates.length === 0; } catch (error) { this.addError(`Failed to validate lastmod dates: ${error.message}`); return false; } } // Generate validation report generateReport() { const report = { timestamp: new Date().toISOString(), valid: this.errors.length === 0, errors: this.errors, warnings: this.warnings, summary: { totalErrors: this.errors.length, totalWarnings: this.warnings.length } }; // Save report const reportPath = path.resolve(&#x27;./public/.sitemap-validation-report.json&#x27;); fs.writeFileSync(reportPath, JSON.stringify(report, null, 2)); console.log(`\n๐Ÿ“Š Validation Report:`); console.log(` Errors: ${report.summary.totalErrors}`); console.log(` Warnings: ${report.summary.totalWarnings}`); console.log(` Status: ${report.valid ? &#x27;โœ… VALID&#x27; : &#x27;โŒ INVALID&#x27;}`); console.log(` Report saved: ${reportPath}`); return report; } // Run complete validation async validate() { console.log(&#x27;๐Ÿ” Starting sitemap validation...\n&#x27;); // Check if sitemap exists if (!this.checkSitemapExists()) { return this.generateReport(); } // Validate XML structure const xmlResult = this.validateXMLStructure(); if (!xmlResult.valid) { return this.generateReport(); } // Extract URLs const urls = this.extractURLs(); if (urls.length === 0) { return this.generateReport(); } // Run all validations this.checkDuplicates(urls); this.validateURLFormat(urls); await this.checkNewArticlesIncluded(); this.validateLastModDates(); return this.generateReport(); } } // CLI execution async function main() { const validator = new SitemapValidator(); // Check if we should regenerate first const args = process.argv.slice(2); const shouldRegenerate = args.includes(&#x27;--regenerate&#x27;) || args.includes(&#x27;-r&#x27;); if (shouldRegenerate) { console.log(&#x27;๐Ÿ”„ Regenerating sitemap before validation...&#x27;); const result = await validator.generator.generate(true); if (!result.success) { console.error(&#x27;โŒ Failed to regenerate sitemap:&#x27;, result.message); process.exit(1); } console.log(&#x27;โœ… Sitemap regenerated\n&#x27;); } // Run validation const report = await validator.validate(); // Exit with appropriate code process.exit(report.valid ? 0 : 1); } // Export for programmatic use module.exports = { SitemapValidator }; // Run if called directly if (require.main === module) { main().catch(console.error); }</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ sitemap-watcher.cjs</div> <div class="content">const fs = require(&#x27;node:fs&#x27;); const path = require(&#x27;node:path&#x27;); const { SitemapGenerator } = require(&#x27;../generate-sitemap.cjs&#x27;); class SitemapWatcher { constructor() { this.generator = new SitemapGenerator(); this.watchers = []; this.debounceTimeout = null; this.debounceDelay = 2000; // 2 seconds debounce // Paths to watch this.watchPaths = [ path.resolve(&#x27;./content/blog&#x27;), path.resolve(&#x27;./src/data/tools.ts&#x27;), path.resolve(&#x27;./src/data/blogArticles.ts&#x27;) ]; } // Debounced sitemap generation debouncedGenerate() { if (this.debounceTimeout) { clearTimeout(this.debounceTimeout); } this.debounceTimeout = setTimeout(async () =&gt; { console.log(&#x27;๐Ÿ”„ File changes detected, regenerating sitemap...&#x27;); try { const result = await this.generator.generate(true); // Force regeneration if (result.success) { console.log(&#x27;โœ… Sitemap updated successfully&#x27;); } else { console.error(&#x27;โŒ Sitemap update failed:&#x27;, result.message); } } catch (error) { console.error(&#x27;โŒ Error during sitemap generation:&#x27;, error); } }, this.debounceDelay); } // Start watching files startWatching() { console.log(&#x27;๐Ÿš€ Starting sitemap file watcher...&#x27;); this.watchPaths.forEach(watchPath =&gt; { if (fs.existsSync(watchPath)) { const stats = fs.statSync(watchPath); if (stats.isDirectory()) { // Watch directory for file changes const watcher = fs.watch(watchPath, { recursive: true }, (eventType, filename) =&gt; { if (filename &amp;&amp; filename.endsWith(&#x27;.md&#x27;)) { console.log(`๐Ÿ“ Blog article ${eventType}: ${filename}`); this.debouncedGenerate(); } }); this.watchers.push(watcher); console.log(`๐Ÿ‘€ Watching directory: ${watchPath}`); } else { // Watch individual file const watcher = fs.watch(watchPath, (eventType) =&gt; { console.log(`๐Ÿ“„ Data file ${eventType}: ${path.basename(watchPath)}`); this.debouncedGenerate(); }); this.watchers.push(watcher); console.log(`๐Ÿ‘€ Watching file: ${watchPath}`); } } else { console.warn(`โš ๏ธ Path not found: ${watchPath}`); } }); console.log(`โœ… File watcher started, monitoring ${this.watchers.length} paths`); } // Stop watching files stopWatching() { console.log(&#x27;๐Ÿ›‘ Stopping file watcher...&#x27;); this.watchers.forEach(watcher =&gt; { watcher.close(); }); this.watchers = []; if (this.debounceTimeout) { clearTimeout(this.debounceTimeout); this.debounceTimeout = null; } console.log(&#x27;โœ… File watcher stopped&#x27;); } // Handle graceful shutdown setupGracefulShutdown() { const shutdown = () =&gt; { console.log(&#x27;\n๐Ÿ”„ Shutting down sitemap watcher...&#x27;); this.stopWatching(); process.exit(0); }; process.on(&#x27;SIGINT&#x27;, shutdown); process.on(&#x27;SIGTERM&#x27;, shutdown); process.on(&#x27;SIGQUIT&#x27;, shutdown); } } // CLI execution async function main() { const watcher = new SitemapWatcher(); // Generate initial sitemap console.log(&#x27;๐Ÿš€ Generating initial sitemap...&#x27;); const result = await watcher.generator.generate(); if (result.success) { console.log(&#x27;โœ… Initial sitemap generated&#x27;); } else { console.error(&#x27;โŒ Initial sitemap generation failed:&#x27;, result.message); process.exit(1); } // Start watching for changes watcher.startWatching(); watcher.setupGracefulShutdown(); console.log(&#x27;๐ŸŽฏ Sitemap watcher is running. Press Ctrl+C to stop.&#x27;); } // Export for programmatic use module.exports = { SitemapWatcher }; // Run if called directly if (require.main === module) { main().catch(console.error); }</div> <div class="folder" style="margin-left: 0px;">๐Ÿ“ src</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ App.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Routes, Route } from &#x27;react-router-dom&#x27;; import Header from &#x27;./components/layout/Header&#x27;; import Footer from &#x27;./components/layout/Footer&#x27;; import ShareButtons from &#x27;./components/ui/ShareButtons&#x27;; import { Breadcrumbs } from &#x27;./components/Breadcrumbs&#x27;; import HomePage from &#x27;./pages/HomePage&#x27;; import ToolsPage from &#x27;./pages/ToolsPage&#x27;; import ToolPage from &#x27;./pages/ToolPage&#x27;; import AboutPage from &#x27;./pages/AboutPage&#x27;; import ContactPage from &#x27;./pages/ContactPage&#x27;; import NotFoundPage from &#x27;./pages/NotFoundPage&#x27;; import BlogPage from &#x27;./pages/BlogPage&#x27;; import BlogArticlePage from &#x27;./pages/BlogArticlePage&#x27;; import PrivacyPolicyPage from &#x27;./pages/PrivacyPolicyPage&#x27;; import TermsOfUsePage from &#x27;./pages/TermsOfUsePage&#x27;; import DMCAPage from &#x27;./pages/DMCAPage&#x27;; import CookiesPolicyPage from &#x27;./pages/CookiesPolicyPage&#x27;; import PromptGeneratorPage from &#x27;./pages/PromptGeneratorPage&#x27;; function App() { return ( &lt;div className=&quot;flex flex-col min-h-screen&quot;&gt; &lt;Header /&gt; &lt;Breadcrumbs /&gt; &lt;main className=&quot;flex-grow&quot;&gt; &lt;Routes&gt; &lt;Route path=&quot;/&quot; element={&lt;HomePage /&gt;} /&gt; &lt;Route path=&quot;/tools&quot; element={&lt;ToolsPage /&gt;} /&gt; &lt;Route path=&quot;/tools/:toolId&quot; element={&lt;ToolPage /&gt;} /&gt; &lt;Route path=&quot;/prompt-generator&quot; element={&lt;PromptGeneratorPage /&gt;} /&gt; &lt;Route path=&quot;/about&quot; element={&lt;AboutPage /&gt;} /&gt; &lt;Route path=&quot;/contact&quot; element={&lt;ContactPage /&gt;} /&gt; &lt;Route path=&quot;/blog&quot; element={&lt;BlogPage /&gt;} /&gt; &lt;Route path=&quot;/blog/:articleId&quot; element={&lt;BlogArticlePage /&gt;} /&gt; &lt;Route path=&quot;/privacy-policy&quot; element={&lt;PrivacyPolicyPage /&gt;} /&gt; &lt;Route path=&quot;/terms-of-use&quot; element={&lt;TermsOfUsePage /&gt;} /&gt; &lt;Route path=&quot;/dmca&quot; element={&lt;DMCAPage /&gt;} /&gt; &lt;Route path=&quot;/cookies-policy&quot; element={&lt;CookiesPolicyPage /&gt;} /&gt; &lt;Route path=&quot;*&quot; element={&lt;NotFoundPage /&gt;} /&gt; &lt;/Routes&gt; &lt;/main&gt; &lt;Footer /&gt; &lt;ShareButtons /&gt; &lt;/div&gt; ); } export default App;</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ __tests__</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ microComposer.test.ts</div> <div class="content">import { describe, it, expect } from &#x27;vitest&#x27; import { composeMicroFromBase } from &#x27;../utils/microComposer&#x27; describe(&#x27;composeMicroFromBase&#x27;, () =&gt; { it(&#x27;creates MICRO fields from a base prompt&#x27;, () =&gt; { const fields = composeMicroFromBase(&#x27;Write a product description for wireless earbuds&#x27;) expect(fields.Output).toBe(&#x27;Product description&#x27;) expect(fields.Context.length).toBeGreaterThan(0) expect(fields.Message.length).toBeGreaterThan(0) }) })</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ promptEngine.test.ts</div> <div class="content">import { describe, it, expect } from &#x27;vitest&#x27; import { analyzePrompt, generateStructuredPrompt } from &#x27;../utils/promptEngine&#x27; describe(&#x27;analyzePrompt&#x27;, () =&gt; { it(&#x27;detects MICRO for content creation prompts&#x27;, () =&gt; { const res = analyzePrompt(&#x27;Write a product description for wireless earbuds&#x27;) expect(res.scores.MICRO).toBeGreaterThanOrEqual(1) }) it(&#x27;detects COSTAR for marketing prompts&#x27;, () =&gt; { const res = analyzePrompt(&#x27;Write a marketing email to sell my new presets with 25% discount&#x27;) expect(res.scores.COSTAR).toBeGreaterThan(0) }) }) describe(&#x27;generateStructuredPrompt&#x27;, () =&gt; { it(&#x27;builds ICDF sections&#x27;, () =&gt; { const out = generateStructuredPrompt(&#x27;ICDF&#x27;, { Instruction: &#x27;Analyze the dataset&#x27;, Context: &#x27;Quarterly review&#x27;, Data: &#x27;Sales figures for Q3&#x27;, Format: &#x27;Bulleted summary&#x27; }) expect(out.text).toContain(&#x27;## Instruction&#x27;) expect(out.text).toContain(&#x27;## Context&#x27;) expect(out.text).toContain(&#x27;## Data&#x27;) expect(out.text).toContain(&#x27;## Format&#x27;) }) it(&#x27;builds COSTAR sections&#x27;, () =&gt; { const out = generateStructuredPrompt(&#x27;COSTAR&#x27;, { Context: &#x27;Marketing email&#x27;, Offer: &#x27;25% off for 72 hours&#x27;, Style: &#x27;Simple and warm&#x27;, Target: &#x27;Busy homeowners 25-45&#x27;, Action: &#x27;Click Buy&#x27;, Result: &#x27;Boost sales&#x27; }) expect(out.text).toContain(&#x27;## Context&#x27;) expect(out.text).toContain(&#x27;## Offer&#x27;) expect(out.text).toContain(&#x27;## Style&#x27;) expect(out.text).toContain(&#x27;## Target&#x27;) expect(out.text).toContain(&#x27;## Action&#x27;) expect(out.text).toContain(&#x27;## Result&#x27;) }) })</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ quality.test.ts</div> <div class="content">import { describe, it, expect } from &#x27;vitest&#x27; import { validateMicro, optimizeMicro } from &#x27;../utils/quality&#x27; describe(&#x27;quality&#x27;, () =&gt; { it(&#x27;validates micro fields and detects missing features&#x27;, () =&gt; { const report = validateMicro({ Message: &#x27;Create product description&#x27;, Intention: &#x27;Inform and persuade&#x27;, Context: &#x27;E-commerce product page&#x27;, Rhythm: &#x27;Concise&#x27;, Output: &#x27;Product description&#x27;, KeyFeatures: &#x27;Only one&#x27; }) expect(report.issues.some(i =&gt; i.field === &#x27;KeyFeatures&#x27;)).toBe(true) }) it(&#x27;optimizes whitespace&#x27;, () =&gt; { const out = optimizeMicro({ Message: &#x27; Create product description &#x27;, Intention: &#x27; Inform &#x27;, Context: &#x27; E-commerce &#x27;, Rhythm: &#x27; Concise &#x27;, Output: &#x27; Product description &#x27;, KeyFeatures: &#x27; Feature A , Feature B &#x27; }) expect(out.Message).toBe(&#x27;Create product description&#x27;) expect(out.KeyFeatures).toBe(&#x27;Feature A , Feature B&#x27;) }) })</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ components</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ArticleNavigation.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { getAdjacentArticles } from &#x27;../data/blogArticles&#x27;; interface ArticleNavigationProps { currentArticleId: string; } const ArticleNavigation: React.FC&lt;ArticleNavigationProps&gt; = ({ currentArticleId }) =&gt; { const { previousArticle, nextArticle } = getAdjacentArticles(currentArticleId); if (!previousArticle &amp;&amp; !nextArticle) { return null; } return ( &lt;div className=&quot;mt-12 pt-8 border-t border-gray-200&quot;&gt; &lt;div className=&quot;flex flex-col sm:flex-row justify-between gap-4&quot;&gt; {/* Previous Article */} &lt;div className=&quot;flex-1&quot;&gt; {previousArticle ? ( &lt;Link to={`/blog/${previousArticle.id}`} className=&quot;group flex items-center p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors duration-200&quot; &gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-gray-400 group-hover:text-gray-600 mr-3&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; &lt;div&gt; &lt;div className=&quot;text-sm text-gray-500 mb-1&quot;&gt;Next Article&lt;/div&gt; &lt;div className=&quot;text-gray-900 font-medium group-hover:text-blue-600 transition-colors&quot;&gt; {previousArticle.title} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/Link&gt; ) : ( &lt;div className=&quot;p-4 bg-gray-50 rounded-lg opacity-50&quot;&gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-gray-300 mr-3&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; &lt;div&gt; &lt;div className=&quot;text-sm text-gray-400 mb-1&quot;&gt;Next Article&lt;/div&gt; &lt;div className=&quot;text-gray-400&quot;&gt;No Next Article&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; {/* Next Article */} &lt;div className=&quot;flex-1&quot;&gt; {nextArticle ? ( &lt;Link to={`/blog/${nextArticle.id}`} className=&quot;group flex items-center justify-end p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors duration-200&quot; &gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;div className=&quot;text-right&quot;&gt; &lt;div className=&quot;text-sm text-gray-500 mb-1&quot;&gt;Previous Article&lt;/div&gt; &lt;div className=&quot;text-gray-900 font-medium group-hover:text-blue-600 transition-colors&quot;&gt; {nextArticle.title} &lt;/div&gt; &lt;/div&gt; &lt;svg className=&quot;w-5 h-5 text-gray-400 group-hover:text-gray-600 ml-3&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/Link&gt; ) : ( &lt;div className=&quot;p-4 bg-gray-50 rounded-lg opacity-50&quot;&gt; &lt;div className=&quot;flex items-center justify-end&quot;&gt; &lt;div className=&quot;text-right&quot;&gt; &lt;div className=&quot;text-sm text-gray-400 mb-1&quot;&gt;Previous Article&lt;/div&gt; &lt;div className=&quot;text-gray-400&quot;&gt;No previous article&lt;/div&gt; &lt;/div&gt; &lt;svg className=&quot;w-5 h-5 text-gray-300 ml-3&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ); }; export default ArticleNavigation;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ Breadcrumbs.tsx</div> <div class="content">import { Link, useLocation } from &#x27;react-router-dom&#x27;; import { Helmet } from &#x27;react-helmet-async&#x27;; // Import our data to find names from IDs import { tools } from &#x27;../data/tools&#x27;; import { blogArticles } from &#x27;../data/blogArticles&#x27;; // Helper function to capitalize const capitalize = (s: string) =&gt; s.charAt(0).toUpperCase() + s.slice(1); // Helper to find article/tool names const getNameFromId = (id: string, type: &#x27;blog&#x27; | &#x27;tool&#x27; | &#x27;blogCat&#x27; | &#x27;toolCat&#x27;) =&gt; { if (type === &#x27;blog&#x27;) { return blogArticles.find(a =&gt; a.id === id)?.title || capitalize(id.replace(/-/g, &#x27; &#x27;)); } if (type === &#x27;tool&#x27;) { return tools.find(t =&gt; t.id === id)?.name || capitalize(id.replace(/-/g, &#x27; &#x27;)); } if (type === &#x27;blogCat&#x27;) { // Map blog categories based on the categories used in blogArticles const categoryMap: Record&lt;string, string&gt; = { &#x27;general&#x27;: &#x27;General&#x27;, &#x27;tools&#x27;: &#x27;Tools&#x27; }; return categoryMap[id] || capitalize(id.replace(/-/g, &#x27; &#x27;)); } if (type === &#x27;toolCat&#x27;) { // For now, just capitalize the category name since toolCategories is not defined return capitalize(id.replace(/-/g, &#x27; &#x27;)); } return capitalize(id.replace(/-/g, &#x27; &#x27;)); }; export function Breadcrumbs() { const location = useLocation(); const pathnames = location.pathname.split(&#x27;/&#x27;).filter(x =&gt; x); const breadcrumbBaseUrl = &#x27;https://modernphototools.com&#x27;; const breadcrumbs = [ { name: &#x27;Home&#x27;, path: &#x27;/&#x27;, isLast: false } ]; let currentPath = &#x27;&#x27;; pathnames.forEach((part, index) =&gt; { currentPath += `/${part}`; const isLast = index === pathnames.length - 1; let name = capitalize(part.replace(/-/g, &#x27; &#x27;)); // This logic translates path IDs into human-readable names try { if (part === &#x27;blog&#x27;) name = &#x27;Blog&#x27;; if (part === &#x27;tools&#x27;) name = &#x27;Tools&#x27;; if (part === &#x27;about&#x27;) name = &#x27;About&#x27;; if (part === &#x27;contact&#x27;) name = &#x27;Contact&#x27;; if (part === &#x27;privacy-policy&#x27;) name = &#x27;Privacy Policy&#x27;; if (part === &#x27;terms-of-use&#x27;) name = &#x27;Terms of Use&#x27;; if (part === &#x27;dmca&#x27;) name = &#x27;DMCA&#x27;; if (part === &#x27;cookies-policy&#x27;) name = &#x27;Cookies Policy&#x27;; const prevPart = pathnames[index - 1]; // Handle blog articles if (prevPart === &#x27;blog&#x27; &amp;&amp; part !== &#x27;category&#x27;) { name = getNameFromId(part, &#x27;blog&#x27;); } // Handle tool pages if (prevPart === &#x27;tools&#x27; &amp;&amp; part !== &#x27;category&#x27;) { name = getNameFromId(part, &#x27;tool&#x27;); } // Handle category pages if (prevPart === &#x27;category&#x27;) { // Check if we are in /blog/category/ or /tools/category/ const grandPrevPart = pathnames[index - 2]; if (grandPrevPart === &#x27;blog&#x27;) { name = getNameFromId(part, &#x27;blogCat&#x27;); } else if (grandPrevPart === &#x27;tools&#x27;) { name = getNameFromId(part, &#x27;toolCat&#x27;); } } // Handle tag pages if (prevPart === &#x27;tag&#x27;) { name = `Tag: ${capitalize(part.replace(/-/g, &#x27; &#x27;))}`; } } catch (e) { console.error(&quot;Error building breadcrumb:&quot;, e); name = capitalize(part.replace(/-/g, &#x27; &#x27;)); // Fallback } breadcrumbs.push({ name, path: currentPath, isLast }); }); // Don&#x27;t show breadcrumbs for the home page if (location.pathname === &#x27;/&#x27;) { return null; } // Generate JSON-LD Schema for SEO const schema = { &#x27;@context&#x27;: &#x27;https://schema.org&#x27;, &#x27;@type&#x27;: &#x27;BreadcrumbList&#x27;, &#x27;itemListElement&#x27;: breadcrumbs.map((crumb, index) =&gt; ({ &#x27;@type&#x27;: &#x27;ListItem&#x27;, &#x27;position&#x27;: index + 1, &#x27;name&#x27;: crumb.name, &#x27;item&#x27;: `${breadcrumbBaseUrl}${crumb.path}` })) }; return ( &lt;&gt; &lt;Helmet&gt; &lt;script type=&quot;application/ld+json&quot;&gt; {JSON.stringify(schema)} &lt;/script&gt; &lt;/Helmet&gt; &lt;div className=&quot;custom-left-col yoast-breadcrumb&quot;&gt; &lt;p id=&quot;breadcrumbs&quot;&gt; {breadcrumbs.map((crumb, index) =&gt; { const isLast = index === breadcrumbs.length - 1; return ( &lt;span key={crumb.path}&gt; {isLast ? ( &lt;span className=&quot;breadcrumb_last&quot; aria-current=&quot;page&quot;&gt; {crumb.name} &lt;/span&gt; ) : ( &lt;span&gt;&lt;Link to={crumb.path}&gt;{crumb.name}&lt;/Link&gt;&lt;/span&gt; )} {!isLast &amp;&amp; &lt;b&gt;&lt;/b&gt;} {/* Separator element */} &lt;/span&gt; ); })} &lt;/p&gt; &lt;/div&gt; &lt;/&gt; ); }</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ SEO</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ layout</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ Footer.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { Image } from &#x27;lucide-react&#x27;; const Footer: React.FC = () =&gt; { const currentYear = new Date().getFullYear(); return ( &lt;footer className=&quot;bg-gray-100 pt-12 pb-8&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-4 gap-8&quot;&gt; &lt;div className=&quot;col-span-1&quot;&gt; &lt;Link to=&quot;/&quot; className=&quot;flex items-center space-x-2 mb-4&quot;&gt; &lt;Image className=&quot;w-8 h-8 text-blue-600&quot; /&gt; &lt;span className=&quot;text-xl font-bold text-gray-900&quot;&gt;ModernPhotoTools&lt;/span&gt; &lt;/Link&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt; Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;col-span-1&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 mb-4&quot;&gt;Quick Links&lt;/h3&gt; &lt;ul className=&quot;space-y-2&quot;&gt; &lt;li&gt; &lt;Link to=&quot;/&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Home &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/tools&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; All Tools &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/blog&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Blog &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/about&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; About &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/contact&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Contact &lt;/Link&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div className=&quot;col-span-1&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 mb-4&quot;&gt;Popular Tools&lt;/h3&gt; &lt;ul className=&quot;space-y-2&quot;&gt; &lt;li&gt; &lt;Link to=&quot;/tools/remove-background&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Remove Background &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/tools/ai-image-generator&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; AI Image Generator &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/tools/ai-portrait&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; AI Portrait &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/tools/ai-image-upscaler&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; AI Image Upscaler &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/tools/ai-face-swap&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; AI Face Swap &lt;/Link&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div className=&quot;col-span-1&quot;&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 mb-4&quot;&gt;Legal&lt;/h3&gt; &lt;ul className=&quot;space-y-2&quot;&gt; &lt;li&gt; &lt;Link to=&quot;/privacy-policy&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Privacy Policy &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/terms-of-use&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Terms of Use &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/dmca&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; DMCA &lt;/Link&gt; &lt;/li&gt; &lt;li&gt; &lt;Link to=&quot;/cookies-policy&quot; className=&quot;text-gray-600 hover:text-blue-600 transition-colors&quot;&gt; Cookies Policy &lt;/Link&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;border-t border-gray-200 mt-8 pt-8 text-center&quot;&gt; &lt;p className=&quot;text-gray-600&quot;&gt; ยฉ {currentYear} ModernPhotoTools.com. All rights reserved. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/footer&gt; ); }; export default Footer;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ Header.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { Menu, X, Image } from &#x27;lucide-react&#x27;; const Header: React.FC = () =&gt; { const [isMenuOpen, setIsMenuOpen] = React.useState(false); const toggleMenu = () =&gt; { setIsMenuOpen(!isMenuOpen); }; return ( &lt;header className=&quot;sticky top-0 z-50 bg-white shadow-sm&quot;&gt; &lt;div className=&quot;container mx-auto px-4 py-4 flex justify-between items-center&quot;&gt; &lt;Link to=&quot;/&quot; className=&quot;flex items-center space-x-2&quot;&gt; &lt;Image className=&quot;w-8 h-8 text-blue-600&quot; /&gt; &lt;span className=&quot;text-xl font-bold text-gray-900&quot;&gt;ModernPhotoTools&lt;/span&gt; &lt;/Link&gt; {/* Desktop Navigation */} &lt;nav className=&quot;hidden md:flex space-x-8&quot;&gt; &lt;Link to=&quot;/&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors&quot;&gt; Home &lt;/Link&gt; &lt;Link to=&quot;/tools&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors&quot;&gt; All Tools &lt;/Link&gt; &lt;Link to=&quot;/blog&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors&quot;&gt; Blog &lt;/Link&gt; &lt;Link to=&quot;/about&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors&quot;&gt; About &lt;/Link&gt; &lt;Link to=&quot;/contact&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors&quot;&gt; Contact &lt;/Link&gt; &lt;/nav&gt; {/* Mobile Menu Button */} &lt;button className=&quot;md:hidden p-2 rounded-md text-gray-700 hover:bg-gray-100&quot; onClick={toggleMenu} aria-label={isMenuOpen ? &quot;Close menu&quot; : &quot;Open menu&quot;} &gt; {isMenuOpen ? &lt;X size={24} /&gt; : &lt;Menu size={24} /&gt;} &lt;/button&gt; &lt;/div&gt; {/* Mobile Navigation */} {isMenuOpen &amp;&amp; ( &lt;div className=&quot;md:hidden bg-white shadow-md&quot;&gt; &lt;div className=&quot;container mx-auto px-4 py-4 flex flex-col space-y-4&quot;&gt; &lt;Link to=&quot;/&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot; onClick={() =&gt; setIsMenuOpen(false)} &gt; Home &lt;/Link&gt; &lt;Link to=&quot;/tools&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot; onClick={() =&gt; setIsMenuOpen(false)} &gt; All Tools &lt;/Link&gt; &lt;Link to=&quot;/blog&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot; onClick={() =&gt; setIsMenuOpen(false)} &gt; Blog &lt;/Link&gt; &lt;Link to=&quot;/about&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot; onClick={() =&gt; setIsMenuOpen(false)} &gt; About &lt;/Link&gt; &lt;Link to=&quot;/contact&quot; className=&quot;text-gray-700 hover:text-blue-600 transition-colors py-2&quot; onClick={() =&gt; setIsMenuOpen(false)} &gt; Contact &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/header&gt; ); }; export default Header;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ScrollToTop.tsx</div> <div class="content">import { useEffect } from &#x27;react&#x27;; import { useLocation } from &#x27;react-router-dom&#x27;; // This component will have no visible UI. Its only job is to run an effect. const ScrollToTop = (): null =&gt; { const { pathname } = useLocation(); useEffect(() =&gt; { // This effect runs every time the `pathname` changes (i.e., on every route navigation). window.scrollTo(0, 0); }, [pathname]); return null; // Render nothing }; export default ScrollToTop;</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ tools</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIAvatar</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIBackgroundGenerator</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AICaricature</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AICartoon</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AICleanup</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIExpand</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIImageGenerator</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIProductPhotoshoot</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ AIReplace</div> <div class="folder" style="margin-left: 60px;">๐Ÿ“ RemoveBackground</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ ui</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ArticleNavigation.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; interface NavigationArticle { id: string; title: string; } interface ArticleNavigationProps { previousArticle?: NavigationArticle; nextArticle?: NavigationArticle; } const ArticleNavigation: React.FC&lt;ArticleNavigationProps&gt; = ({ previousArticle, nextArticle }) =&gt; { if (!previousArticle &amp;&amp; !nextArticle) { return null; } return ( &lt;div className=&quot;mt-12 pt-8 border-t border-gray-200&quot;&gt; &lt;div className=&quot;flex flex-col md:flex-row justify-between items-stretch gap-4&quot;&gt; {/* Previous Article */} &lt;div className=&quot;flex-1&quot;&gt; {previousArticle ? ( &lt;Link to={`/blog/${previousArticle.id}`} className=&quot;group flex items-center p-6 bg-white border border-gray-200 rounded-xl hover:border-blue-300 hover:shadow-lg transition-all duration-300 h-full&quot; &gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;div className=&quot;flex-shrink-0 mr-4&quot;&gt; &lt;div className=&quot;w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center group-hover:bg-blue-200 transition-colors duration-300&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-blue-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;min-w-0 flex-1&quot;&gt; &lt;p className=&quot;text-sm text-gray-500 mb-1&quot;&gt;Previous Article&lt;/p&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors duration-300 line-clamp-2&quot;&gt; {previousArticle.title} &lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; &lt;/Link&gt; ) : ( &lt;div className=&quot;p-6 bg-gray-50 border border-gray-200 rounded-xl h-full opacity-50&quot;&gt; &lt;div className=&quot;flex items-center&quot;&gt; &lt;div className=&quot;flex-shrink-0 mr-4&quot;&gt; &lt;div className=&quot;w-10 h-10 bg-gray-200 rounded-full flex items-center justify-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-gray-400&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M15 19l-7-7 7-7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;min-w-0 flex-1&quot;&gt; &lt;p className=&quot;text-sm text-gray-400 mb-1&quot;&gt;Previous Article&lt;/p&gt; &lt;h3 className=&quot;text-lg font-medium text-gray-400&quot;&gt; No previous article &lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; {/* Next Article */} &lt;div className=&quot;flex-1&quot;&gt; {nextArticle ? ( &lt;Link to={`/blog/${nextArticle.id}`} className=&quot;group flex items-center p-6 bg-white border border-gray-200 rounded-xl hover:border-blue-300 hover:shadow-lg transition-all duration-300 h-full&quot; &gt; &lt;div className=&quot;flex items-center w-full&quot;&gt; &lt;div className=&quot;min-w-0 flex-1 text-right&quot;&gt; &lt;p className=&quot;text-sm text-gray-500 mb-1&quot;&gt;Next Article&lt;/p&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors duration-300 line-clamp-2&quot;&gt; {nextArticle.title} &lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;flex-shrink-0 ml-4&quot;&gt; &lt;div className=&quot;w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center group-hover:bg-blue-200 transition-colors duration-300&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-blue-600&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/Link&gt; ) : ( &lt;div className=&quot;p-6 bg-gray-50 border border-gray-200 rounded-xl h-full opacity-50&quot;&gt; &lt;div className=&quot;flex items-center w-full&quot;&gt; &lt;div className=&quot;min-w-0 flex-1 text-right&quot;&gt; &lt;p className=&quot;text-sm text-gray-400 mb-1&quot;&gt;Next Article&lt;/p&gt; &lt;h3 className=&quot;text-lg font-medium text-gray-400&quot;&gt; No next article &lt;/h3&gt; &lt;/div&gt; &lt;div className=&quot;flex-shrink-0 ml-4&quot;&gt; &lt;div className=&quot;w-10 h-10 bg-gray-200 rounded-full flex items-center justify-center&quot;&gt; &lt;svg className=&quot;w-5 h-5 text-gray-400&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ); }; export default ArticleNavigation;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ Button.tsx</div> <div class="content">import React from &#x27;react&#x27;; interface ButtonProps extends React.ButtonHTMLAttributes&lt;HTMLButtonElement&gt; { variant?: &#x27;primary&#x27; | &#x27;secondary&#x27; | &#x27;outline&#x27;; size?: &#x27;sm&#x27; | &#x27;md&#x27; | &#x27;lg&#x27;; fullWidth?: boolean; isLoading?: boolean; leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; } const Button: React.FC&lt;ButtonProps&gt; = ({ children, variant = &#x27;primary&#x27;, size = &#x27;md&#x27;, fullWidth = false, isLoading = false, leftIcon, rightIcon, className = &#x27;&#x27;, disabled, ...props }) =&gt; { const baseStyles = &quot;inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2&quot;; const variantStyles = { primary: &quot;bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500&quot;, secondary: &quot;bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500&quot;, outline: &quot;bg-transparent text-gray-900 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500&quot; }; const sizeStyles = { sm: &quot;text-sm px-3 py-1.5&quot;, md: &quot;text-base px-4 py-2&quot;, lg: &quot;text-lg px-6 py-3&quot; }; const widthStyles = fullWidth ? &quot;w-full&quot; : &quot;&quot;; const disabledStyles = (disabled || isLoading) ? &quot;opacity-60 cursor-not-allowed&quot; : &quot;cursor-pointer&quot;; return ( &lt;button className={`${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${widthStyles} ${disabledStyles} ${className}`} disabled={disabled || isLoading} {...props} &gt; {isLoading &amp;&amp; ( &lt;svg className=&quot;animate-spin -ml-1 mr-2 h-4 w-4 text-current&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; fill=&quot;none&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;circle className=&quot;opacity-25&quot; cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;10&quot; stroke=&quot;currentColor&quot; strokeWidth=&quot;4&quot;&gt;&lt;/circle&gt; &lt;path className=&quot;opacity-75&quot; fill=&quot;currentColor&quot; d=&quot;M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z&quot;&gt;&lt;/path&gt; &lt;/svg&gt; )} {leftIcon &amp;&amp; !isLoading &amp;&amp; &lt;span className=&quot;mr-2&quot;&gt;{leftIcon}&lt;/span&gt;} {children} {rightIcon &amp;&amp; &lt;span className=&quot;ml-2&quot;&gt;{rightIcon}&lt;/span&gt;} &lt;/button&gt; ); }; export default Button;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ImageDropzone.tsx</div> <div class="content">import React, { useCallback, useState } from &#x27;react&#x27;; import { Upload, X } from &#x27;lucide-react&#x27;; import { ACCEPTED_IMAGE_TYPES, MAX_FILE_SIZE } from &#x27;../../constants&#x27;; import type { ImageFile } from &#x27;../../types&#x27;; interface ImageDropzoneProps { onImageSelect: (imageFile: ImageFile) =&gt; void; selectedImage: ImageFile; disabled?: boolean; } const ImageDropzone: React.FC&lt;ImageDropzoneProps&gt; = ({ onImageSelect, selectedImage, disabled = false }) =&gt; { const [isDragging, setIsDragging] = useState(false); const [error, setError] = useState&lt;string | null&gt;(null); const handleDragEnter = useCallback((e: React.DragEvent&lt;HTMLDivElement&gt;) =&gt; { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(true); }, [disabled]); const handleDragLeave = useCallback((e: React.DragEvent&lt;HTMLDivElement&gt;) =&gt; { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(false); }, [disabled]); const handleDragOver = useCallback((e: React.DragEvent&lt;HTMLDivElement&gt;) =&gt; { if (disabled) return; e.preventDefault(); e.stopPropagation(); }, [disabled]); const validateFile = (file: File): string | null =&gt; { if (!ACCEPTED_IMAGE_TYPES.includes(file.type)) { return &#x27;File type not supported. Please upload a JPEG or PNG image.&#x27;; } if (file.size &gt; MAX_FILE_SIZE) { return &#x27;File size exceeds 5MB limit. Please upload a smaller image.&#x27;; } return null; }; const handleDrop = useCallback((e: React.DragEvent&lt;HTMLDivElement&gt;) =&gt; { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(false); const files = e.dataTransfer.files; if (files.length &gt; 0) { const file = files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () =&gt; { onImageSelect({ file, preview: reader.result as string }); }; reader.readAsDataURL(file); } }, [onImageSelect, disabled]); const handleFileSelect = useCallback((e: React.ChangeEvent&lt;HTMLInputElement&gt;) =&gt; { if (disabled) return; const files = e.target.files; if (files &amp;&amp; files.length &gt; 0) { const file = files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () =&gt; { onImageSelect({ file, preview: reader.result as string }); }; reader.readAsDataURL(file); } }, [onImageSelect, disabled]); const handleRemoveImage = useCallback(() =&gt; { onImageSelect({ file: null, preview: null }); setError(null); }, [onImageSelect]); return ( &lt;div className=&quot;w-full&quot;&gt; {!selectedImage.preview ? ( &lt;div className={`border-2 border-dashed rounded-lg p-8 flex flex-col items-center justify-center transition-colors ${ disabled ? &#x27;border-gray-200 bg-gray-50 cursor-not-allowed opacity-50&#x27; : isDragging ? &#x27;border-blue-500 bg-blue-50 cursor-pointer&#x27; : &#x27;border-gray-300 hover:border-gray-400 cursor-pointer&#x27; }`} onDragEnter={handleDragEnter} onDragLeave={handleDragLeave} onDragOver={handleDragOver} onDrop={handleDrop} onClick={disabled ? undefined : () =&gt; document.getElementById(&#x27;file-input&#x27;)?.click()} &gt; &lt;Upload className=&quot;w-10 h-10 text-gray-400 mb-4&quot; /&gt; &lt;p className=&quot;text-gray-700 font-medium mb-1&quot;&gt;Drag and drop your image here&lt;/p&gt; &lt;p className=&quot;text-gray-500 text-sm mb-4&quot;&gt;or click to browse&lt;/p&gt; &lt;p className=&quot;text-gray-400 text-xs&quot;&gt; Supported formats: JPEG, PNG (max 5MB) &lt;/p&gt; &lt;input id=&quot;file-input&quot; type=&quot;file&quot; className=&quot;hidden&quot; accept=&quot;image/jpeg,image/png&quot; onChange={handleFileSelect} disabled={disabled} /&gt; &lt;/div&gt; ) : ( &lt;div className=&quot;relative border rounded-lg overflow-hidden&quot;&gt; &lt;img src={selectedImage.preview} alt=&quot;Selected&quot; className=&quot;w-full h-auto object-contain&quot; /&gt; &lt;button className=&quot;absolute top-2 right-2 p-1 bg-white rounded-full shadow-md hover:bg-gray-100 transition-colors&quot; onClick={handleRemoveImage} aria-label=&quot;Remove image&quot; &gt; &lt;X className=&quot;w-5 h-5 text-gray-700&quot; /&gt; &lt;/button&gt; &lt;/div&gt; )} {error &amp;&amp; ( &lt;div className=&quot;mt-2 text-red-500 text-sm&quot;&gt;{error}&lt;/div&gt; )} &lt;/div&gt; ); }; export default ImageDropzone;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ PromptsGuide.tsx</div> <div class="content">import React from &#x27;react&#x27;; const PromptsGuide: React.FC = () =&gt; { return ( &lt;section className=&quot;py-16 bg-gray-50&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center mb-12&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold text-gray-900 mb-4&quot;&gt; How to create effective prompts &lt;/h2&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-3 gap-8&quot;&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;1&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Ideal prompt structure&lt;/h3&gt; &lt;p className=&quot;text-gray-600 text-left&quot;&gt; &lt;strong&gt;[Main subject]&lt;/strong&gt; + &lt;strong&gt;[Environment / Setting]&lt;/strong&gt; + &lt;strong&gt;[Style]&lt;/strong&gt; + &lt;strong&gt;[Lighting / Mood]&lt;/strong&gt; + &lt;strong&gt;[Details / Adjectives]&lt;/strong&gt; + (optional) &lt;strong&gt;[Camera / Perspective / Composition info]&lt;/strong&gt; &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;2&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Role of negative prompts&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Remove unwanted elements that the AI might generate based on its interpretation of your positive prompt, such as poor quality, extra fingers, or distorted features. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;3&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Use seeds for consistency&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt; AI image generators can produce a variety of images from the same prompt. Enable the &#x27;seed&#x27; option, and change the prompt with the same seed number to see consistent images. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; ); }; export default PromptsGuide;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ SEO.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Helmet } from &#x27;react-helmet-async&#x27;; import { SITE_TITLE, SITE_DESCRIPTION } from &#x27;../../constants&#x27;; import { getSiteOrigin } from &#x27;../../utils/siteConfig&#x27;; interface SEOProps { title?: string; description?: string; canonicalUrl?: string; ogImage?: string; } // Helper function to safely determine environment and base URL for SSR compatibility function getEnvironmentConfig() { const baseUrl = getSiteOrigin(); const isProduction = typeof window !== &#x27;undefined&#x27; ? (window.location.hostname !== &#x27;localhost&#x27; &amp;&amp; window.location.hostname !== &#x27;127.0.0.1&#x27;) : (import.meta.env.PROD || process.env.NODE_ENV === &#x27;production&#x27;); return { isProduction, baseUrl }; } const SEO: React.FC&lt;SEOProps&gt; = ({ title = SITE_TITLE, description = SITE_DESCRIPTION, canonicalUrl, ogImage }) =&gt; { const formattedTitle = title === SITE_TITLE ? title : `${title} | ${SITE_TITLE}`; // Get environment config for proper URL handling const { baseUrl } = getEnvironmentConfig(); // Default Open Graph image (favicon) with proper error handling const defaultOgImage = `${baseUrl}/favicon.svg`; // Validate and sanitize the ogImage URL const getValidatedOgImage = (): string =&gt; { if (!ogImage) return defaultOgImage; try { // If ogImage is already a full URL, use it if (ogImage.startsWith(&#x27;http://&#x27;) || ogImage.startsWith(&#x27;https://&#x27;)) { return ogImage; } // If ogImage is a relative path, make it absolute if (ogImage.startsWith(&#x27;/&#x27;)) { return `${baseUrl}${ogImage}`; } // If ogImage is just a filename, assume it&#x27;s in the root return `${baseUrl}/${ogImage}`; } catch (error) { console.warn(&#x27;Invalid ogImage provided, falling back to default:&#x27;, error); return defaultOgImage; } }; const finalOgImage = getValidatedOgImage(); // Generate the current page URL for og:url meta tag const currentUrl = canonicalUrl || (typeof window !== &#x27;undefined&#x27; ? window.location.href : &#x27;&#x27;); return ( &lt;Helmet&gt; &lt;title&gt;{formattedTitle}&lt;/title&gt; &lt;meta name=&quot;description&quot; content={description} /&gt; {/* Open Graph / Facebook */} &lt;meta property=&quot;og:type&quot; content=&quot;website&quot; /&gt; &lt;meta property=&quot;og:url&quot; content={currentUrl} /&gt; &lt;meta property=&quot;og:title&quot; content={formattedTitle} /&gt; &lt;meta property=&quot;og:description&quot; content={description} /&gt; &lt;meta property=&quot;og:image&quot; content={finalOgImage} /&gt; &lt;meta property=&quot;og:site_name&quot; content={SITE_TITLE} /&gt; {/* Twitter */} &lt;meta name=&quot;twitter:card&quot; content=&quot;summary_large_image&quot; /&gt; &lt;meta name=&quot;twitter:title&quot; content={formattedTitle} /&gt; &lt;meta name=&quot;twitter:description&quot; content={description} /&gt; &lt;meta name=&quot;twitter:image&quot; content={finalOgImage} /&gt; {/* Canonical URL */} {canonicalUrl &amp;&amp; &lt;link rel=&quot;canonical&quot; href={canonicalUrl} /&gt;} &lt;/Helmet&gt; ); }; export default SEO;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ShareButtons.tsx</div> <div class="content">import React, { useState, useEffect } from &#x27;react&#x27;; import { Share2, Copy, Check } from &#x27;lucide-react&#x27;; interface ShareButtonsProps { url?: string; title?: string; description?: string; } const ShareButtons: React.FC&lt;ShareButtonsProps&gt; = ({ url, title, description = &#x27;&#x27; }) =&gt; { const [isVisible, setIsVisible] = useState(false); const [isMobile, setIsMobile] = useState(false); const [showMobileMenu, setShowMobileMenu] = useState(false); const [copySuccess, setCopySuccess] = useState(false); const [currentUrl, setCurrentUrl] = useState(&#x27;&#x27;); const [currentTitle, setCurrentTitle] = useState(&#x27;&#x27;); useEffect(() =&gt; { // Set default values on client side only if (typeof window !== &#x27;undefined&#x27;) { setCurrentUrl(url || window.location.href); setCurrentTitle(title || document.title); } }, [url, title]); useEffect(() =&gt; { const checkMobile = () =&gt; { setIsMobile(window.innerWidth &lt; 768); }; const handleScroll = () =&gt; { const scrolled = window.scrollY; const threshold = 200; // Show after scrolling 200px setIsVisible(scrolled &gt; threshold); }; checkMobile(); window.addEventListener(&#x27;resize&#x27;, checkMobile); window.addEventListener(&#x27;scroll&#x27;, handleScroll); return () =&gt; { window.removeEventListener(&#x27;resize&#x27;, checkMobile); window.removeEventListener(&#x27;scroll&#x27;, handleScroll); }; }, []); const shareData = [ { name: &#x27;Twitter&#x27;, url: `https://twitter.com/intent/tweet?url=${encodeURIComponent(currentUrl)}&amp;text=${encodeURIComponent(currentTitle)}`, icon: ( &lt;svg viewBox=&quot;0 0 24 24&quot; className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot;&gt; &lt;path d=&quot;M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z&quot;/&gt; &lt;/svg&gt; ), color: &#x27;hover:bg-black hover:text-white&#x27; }, { name: &#x27;LinkedIn&#x27;, url: `https://www.linkedin.com/shareArticle?mini=true&amp;url=${encodeURIComponent(currentUrl)}&amp;title=${encodeURIComponent(currentTitle)}&amp;summary=${encodeURIComponent(description)}`, icon: ( &lt;svg viewBox=&quot;0 0 24 24&quot; className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot;&gt; &lt;path d=&quot;M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z&quot;/&gt; &lt;/svg&gt; ), color: &#x27;hover:bg-blue-600 hover:text-white&#x27; }, { name: &#x27;Reddit&#x27;, url: `https://reddit.com/submit?url=${encodeURIComponent(currentUrl)}&amp;title=${encodeURIComponent(currentTitle)}`, icon: ( &lt;svg viewBox=&quot;0 0 24 24&quot; className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot;&gt; &lt;path d=&quot;M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z&quot;/&gt; &lt;/svg&gt; ), color: &#x27;hover:bg-orange-500 hover:text-white&#x27; }, { name: &#x27;Quora&#x27;, url: `https://www.quora.com/share?url=${encodeURIComponent(currentUrl)}&amp;title=${encodeURIComponent(currentTitle)}`, icon: ( &lt;svg viewBox=&quot;0 0 24 24&quot; className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot;&gt; &lt;path d=&quot;M12.738 18.701a4.441 4.441 0 0 0 1.362-.235 2.136 2.136 0 0 1-1.362.235zm11.262-6.701c0 6.627-5.373 12-12 12s-12-5.373-12-12 5.373-12 12-12 12 5.373 12 12zm-2.5 0c0-5.238-4.262-9.5-9.5-9.5s-9.5 4.262-9.5 9.5 4.262 9.5 9.5 9.5 9.5-4.262 9.5-9.5zm-4.5 0c0 2.485-2.015 4.5-4.5 4.5s-4.5-2.015-4.5-4.5 2.015-4.5 4.5-4.5 4.5 2.015 4.5 4.5z&quot;/&gt; &lt;/svg&gt; ), color: &#x27;hover:bg-red-600 hover:text-white&#x27; }, { name: &#x27;Pinterest&#x27;, url: `https://pinterest.com/pin/create/button/?url=${encodeURIComponent(currentUrl)}&amp;description=${encodeURIComponent(currentTitle)}&amp;media=${encodeURIComponent(currentUrl)}`, icon: ( &lt;svg viewBox=&quot;0 0 24 24&quot; className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot;&gt; &lt;path d=&quot;M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.174-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.097.118.112.221.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.402.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.357-.629-2.746-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24.009 12.017 24c6.624 0 11.99-5.367 11.99-12C24.007 5.367 18.641.001.012.001z&quot;/&gt; &lt;/svg&gt; ), color: &#x27;hover:bg-red-600 hover:text-white&#x27; } ]; const handleCopyLink = async () =&gt; { try { await navigator.clipboard.writeText(currentUrl); setCopySuccess(true); setTimeout(() =&gt; setCopySuccess(false), 2000); } catch (err) { console.error(&#x27;Failed to copy: &#x27;, err); } }; const handleShare = (shareUrl: string) =&gt; { window.open(shareUrl, &#x27;_blank&#x27;, &#x27;noopener,noreferrer&#x27;); }; const handleKeyDown = (event: React.KeyboardEvent, action: () =&gt; void) =&gt; { if (event.key === &#x27;Enter&#x27; || event.key === &#x27; &#x27;) { event.preventDefault(); action(); } }; if (!isVisible) return null; return ( &lt;&gt; {/* Desktop - Floating Vertical Bar */} {!isMobile &amp;&amp; ( &lt;div className=&quot;fixed left-4 top-1/2 transform -translate-y-1/2 z-50 flex flex-col space-y-3&quot;&gt; {shareData.map((platform) =&gt; ( &lt;button key={platform.name} onClick={() =&gt; handleShare(platform.url)} onKeyDown={(e) =&gt; handleKeyDown(e, () =&gt; handleShare(platform.url))} aria-label={`Share on ${platform.name}`} className={`p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 ${platform.color} focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`} &gt; {platform.icon} &lt;/button&gt; ))} &lt;button onClick={handleCopyLink} onKeyDown={(e) =&gt; handleKeyDown(e, handleCopyLink)} aria-label=&quot;Copy link to clipboard&quot; className=&quot;p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2&quot; &gt; {copySuccess ? ( &lt;Check className=&quot;w-5 h-5 text-green-600&quot; /&gt; ) : ( &lt;Copy className=&quot;w-5 h-5&quot; /&gt; )} &lt;/button&gt; &lt;/div&gt; )} {/* Mobile - Floating Action Button */} {isMobile &amp;&amp; ( &lt;div className=&quot;fixed bottom-6 right-6 z-50&quot;&gt; {/* Expanded Menu */} {showMobileMenu &amp;&amp; ( &lt;div className=&quot;absolute bottom-16 right-0 flex flex-col space-y-3 mb-2&quot;&gt; {shareData.map((platform) =&gt; ( &lt;button key={platform.name} onClick={() =&gt; { handleShare(platform.url); setShowMobileMenu(false); }} onKeyDown={(e) =&gt; handleKeyDown(e, () =&gt; { handleShare(platform.url); setShowMobileMenu(false); })} aria-label={`Share on ${platform.name}`} className={`p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 ${platform.color} focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`} &gt; {platform.icon} &lt;/button&gt; ))} &lt;button onClick={() =&gt; { handleCopyLink(); setShowMobileMenu(false); }} onKeyDown={(e) =&gt; handleKeyDown(e, () =&gt; { handleCopyLink(); setShowMobileMenu(false); })} aria-label=&quot;Copy link to clipboard&quot; className=&quot;p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2&quot; &gt; {copySuccess ? ( &lt;Check className=&quot;w-5 h-5 text-green-600&quot; /&gt; ) : ( &lt;Copy className=&quot;w-5 h-5&quot; /&gt; )} &lt;/button&gt; &lt;/div&gt; )} {/* Main FAB Button */} &lt;button onClick={() =&gt; setShowMobileMenu(!showMobileMenu)} onKeyDown={(e) =&gt; handleKeyDown(e, () =&gt; setShowMobileMenu(!showMobileMenu))} aria-label=&quot;Share options&quot; aria-expanded={showMobileMenu} className={`p-4 bg-blue-600 text-white rounded-full shadow-lg transition-all duration-200 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${ showMobileMenu ? &#x27;rotate-45&#x27; : &#x27;&#x27; }`} &gt; &lt;Share2 className=&quot;w-6 h-6&quot; /&gt; &lt;/button&gt; &lt;/div&gt; )} &lt;/&gt; ); }; export default ShareButtons;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ToolCard.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import * as LucideIcons from &#x27;lucide-react&#x27;; import type { Tool } from &#x27;../../types&#x27;; interface ToolCardProps { tool: Tool; } const ToolCard: React.FC&lt;ToolCardProps&gt; = ({ tool }) =&gt; { // Dynamically get the icon component with better error handling const getIconComponent = (iconName: string) =&gt; { // Convert kebab-case to PascalCase (e.g., &#x27;refresh-cw&#x27; -&gt; &#x27;RefreshCw&#x27;) const pascalCaseName = iconName .split(&#x27;-&#x27;) .map(word =&gt; word.charAt(0).toUpperCase() + word.slice(1)) .join(&#x27;&#x27;); // Try the converted name first, then the original with first letter capitalized const IconComponent = (LucideIcons as unknown as Record&lt;string, React.FC&lt;{ className?: string }&gt;&gt;)[pascalCaseName] || (LucideIcons as unknown as Record&lt;string, React.FC&lt;{ className?: string }&gt;&gt;)[iconName.charAt(0).toUpperCase() + iconName.slice(1)] || LucideIcons.Image; return IconComponent; }; const IconComponent = getIconComponent(tool.icon); return ( &lt;Link to={tool.path} className=&quot;bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300&quot; &gt; &lt;div className=&quot;p-6&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4&quot;&gt; &lt;IconComponent className=&quot;w-6 h-6 text-blue-600&quot; /&gt; &lt;/div&gt; &lt;h3 className=&quot;text-lg font-semibold text-gray-900 mb-2&quot;&gt;{tool.name}&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt;{tool.description}&lt;/p&gt; &lt;/div&gt; &lt;/Link&gt; ); }; export default ToolCard;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ToolFeatureImage.tsx</div> <div class="content">import React, { useState } from &#x27;react&#x27;; interface ToolFeatureImageProps { toolId: string; toolName: string; imagePath: string; altText: string; className?: string; } const ToolFeatureImage: React.FC&lt;ToolFeatureImageProps&gt; = ({ toolId, toolName, imagePath, altText, className = &#x27;&#x27; }) =&gt; { const [imageError, setImageError] = useState(false); const [imageLoaded, setImageLoaded] = useState(false); const handleImageError = () =&gt; { console.error(`Failed to load tool image for ${toolName}:`, imagePath); setImageError(true); }; const handleImageLoad = () =&gt; { setImageLoaded(true); }; // Don&#x27;t render anything if image failed to load if (imageError) { return null; } return ( &lt;div className={`tool-feature-image mb-8 mt-6 ${className}`}&gt; &lt;div className=&quot;relative&quot;&gt; {/* Loading placeholder */} {!imageLoaded &amp;&amp; ( &lt;div className=&quot;w-full max-w-2xl mx-auto h-64 bg-gray-100 rounded-lg animate-pulse flex items-center justify-center&quot;&gt; &lt;div className=&quot;text-gray-400 text-sm&quot;&gt;Loading image...&lt;/div&gt; &lt;/div&gt; )} {/* Actual image */} {imagePath &amp;&amp; ( &lt;img src={imagePath} alt={altText} className={`w-full max-w-2xl mx-auto rounded-lg shadow-lg object-contain transition-opacity duration-300 ${ imageLoaded ? &#x27;opacity-100&#x27; : &#x27;opacity-0 absolute top-0 left-0&#x27; }`} style={{ maxHeight: &#x27;400px&#x27;, objectFit: &#x27;contain&#x27; }} loading=&quot;lazy&quot; onError={handleImageError} onLoad={handleImageLoad} /&gt; )} &lt;/div&gt; {/* Optional caption */} &lt;div className=&quot;text-center mt-3&quot;&gt; &lt;p className=&quot;text-sm text-gray-500&quot;&gt; {toolName} - Professional AI-powered photo editing &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); }; export default ToolFeatureImage;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ ToolRecommendations.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { ArrowRight, ExternalLink } from &#x27;lucide-react&#x27;; import { tools } from &#x27;../../data/tools&#x27;; import type { Tool } from &#x27;../../types&#x27;; interface ToolRecommendationsProps { currentToolId: string; hasResult?: boolean; } const ToolRecommendations: React.FC&lt;ToolRecommendationsProps&gt; = ({ currentToolId, hasResult = false }) =&gt; { // Only show recommendations if user has generated a result if (!hasResult) return null; const getRecommendations = (toolId: string): Tool[] =&gt; { const recommendationMap: Record&lt;string, string[]&gt; = { &#x27;remove-background&#x27;: [&#x27;ai-background-generator&#x27;, &#x27;ai-product-photoshoot&#x27;, &#x27;ai-expand&#x27;], &#x27;ai-cleanup&#x27;: [&#x27;ai-image-upscaler&#x27;, &#x27;ai-filter&#x27;, &#x27;ai-expand&#x27;], &#x27;watermark-remover&#x27;: [&#x27;ai-cleanup&#x27;, &#x27;ai-image-upscaler&#x27;, &#x27;ai-filter&#x27;], &#x27;ai-expand&#x27;: [&#x27;ai-background-generator&#x27;, &#x27;ai-cleanup&#x27;, &#x27;ai-filter&#x27;], &#x27;ai-replace&#x27;: [&#x27;ai-cleanup&#x27;, &#x27;ai-background-generator&#x27;, &#x27;ai-expand&#x27;], &#x27;ai-cartoon&#x27;: [&#x27;ai-caricature&#x27;, &#x27;ai-avatar&#x27;, &#x27;ai-portrait&#x27;], &#x27;ai-caricature&#x27;: [&#x27;ai-cartoon&#x27;, &#x27;ai-avatar&#x27;, &#x27;ai-face-swap&#x27;], &#x27;ai-avatar&#x27;: [&#x27;ai-portrait&#x27;, &#x27;ai-cartoon&#x27;, &#x27;ai-caricature&#x27;], &#x27;ai-product-photoshoot&#x27;: [&#x27;remove-background&#x27;, &#x27;ai-background-generator&#x27;, &#x27;ai-cleanup&#x27;], &#x27;ai-background-generator&#x27;: [&#x27;remove-background&#x27;, &#x27;ai-product-photoshoot&#x27;, &#x27;ai-expand&#x27;], &#x27;ai-image-generator&#x27;: [&#x27;ai-image-to-image&#x27;, &#x27;ai-filter&#x27;, &#x27;ai-background-generator&#x27;], &#x27;ai-portrait&#x27;: [&#x27;ai-avatar&#x27;, &#x27;ai-hairstyle&#x27;, &#x27;ai-face-swap&#x27;], &#x27;ai-face-swap&#x27;: [&#x27;ai-portrait&#x27;, &#x27;ai-avatar&#x27;, &#x27;ai-caricature&#x27;], &#x27;ai-outfit&#x27;: [&#x27;ai-hairstyle&#x27;, &#x27;ai-portrait&#x27;, &#x27;ai-background-generator&#x27;], &#x27;ai-image-to-image&#x27;: [&#x27;ai-filter&#x27;, &#x27;ai-image-generator&#x27;, &#x27;ai-sketch-to-image&#x27;], &#x27;ai-sketch-to-image&#x27;: [&#x27;ai-image-to-image&#x27;, &#x27;ai-image-generator&#x27;, &#x27;ai-cartoon&#x27;], &#x27;ai-hairstyle&#x27;: [&#x27;ai-outfit&#x27;, &#x27;ai-portrait&#x27;, &#x27;ai-face-swap&#x27;], &#x27;ai-image-upscaler&#x27;: [&#x27;ai-cleanup&#x27;, &#x27;ai-filter&#x27;, &#x27;ai-expand&#x27;], &#x27;ai-filter&#x27;: [&#x27;ai-image-upscaler&#x27;, &#x27;ai-cleanup&#x27;, &#x27;ai-image-to-image&#x27;] }; const recommendedIds = recommendationMap[toolId] || []; return tools.filter(tool =&gt; recommendedIds.includes(tool.id)).slice(0, 3); }; const recommendations = getRecommendations(currentToolId); if (recommendations.length === 0) return null; return ( &lt;div className=&quot;mt-8 bg-white border border-gray-200 rounded-lg p-6&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-6&quot;&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900&quot;&gt;You Might Also Like&lt;/h3&gt; &lt;Link to=&quot;/tools&quot; className=&quot;flex items-center text-blue-600 hover:text-blue-700 text-sm font-medium transition-colors&quot; &gt; View All Tools &lt;ExternalLink className=&quot;w-4 h-4 ml-1&quot; /&gt; &lt;/Link&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-3 gap-4&quot;&gt; {recommendations.map((tool) =&gt; ( &lt;Link key={tool.id} to={tool.path} className=&quot;group bg-gray-50 hover:bg-blue-50 border border-gray-200 hover:border-blue-200 rounded-lg p-4 transition-all duration-200 hover:shadow-md&quot; &gt; &lt;div className=&quot;flex items-start justify-between mb-3&quot;&gt; &lt;h4 className=&quot;font-medium text-gray-900 group-hover:text-blue-700 transition-colors&quot;&gt; {tool.name} &lt;/h4&gt; &lt;ArrowRight className=&quot;w-4 h-4 text-gray-400 group-hover:text-blue-600 transition-colors flex-shrink-0 ml-2&quot; /&gt; &lt;/div&gt; &lt;p className=&quot;text-sm text-gray-600 group-hover:text-gray-700 transition-colors line-clamp-2&quot;&gt; {tool.description} &lt;/p&gt; &lt;/Link&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-4 pt-4 border-t border-gray-100&quot;&gt; &lt;p className=&quot;text-xs text-gray-500 text-center&quot;&gt; Discover more tools to enhance your creative workflow &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); }; export default ToolRecommendations;</div> <div class="file" style="margin-left: 60px;">๐Ÿ“„ VideoToolCard.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import type { Tool } from &#x27;../../types&#x27;; interface VideoToolCardProps { tool: Tool; videoUrl?: string; } const VideoToolCard: React.FC&lt;VideoToolCardProps&gt; = ({ tool, videoUrl }) =&gt; { return ( &lt;div className=&quot;col mt-3 apiSectionBox&quot;&gt; &lt;Link to={tool.path}&gt; &lt;div className=&quot;bg-white rounded-20&quot;&gt; {videoUrl &amp;&amp; ( &lt;video autoPlay loop playsInline muted className=&quot;responsive rounded-20&quot; &gt; &lt;source type=&quot;video/mp4&quot; src={videoUrl} /&gt; &lt;/video&gt; )} &lt;div className=&quot;card-body p-3&quot;&gt; &lt;h3 className=&quot;text-xxl text-semi text-black pb-2 mb-0 text-center&quot;&gt; {tool.name} &lt;/h3&gt; &lt;p className=&quot;text-lg text-black text-center&quot;&gt; {tool.description} &lt;/p&gt; &lt;div className=&quot;d-flex justify-content-between align-items-center&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/Link&gt; &lt;/div&gt; ); }; export default VideoToolCard;</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ constants</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ avatarStyles.ts</div> <div class="content">// src/constants/avatarStyles.ts export interface AvatarStyle { name: string; imageUrl: string; gender: &#x27;male&#x27; | &#x27;female&#x27;; prompt: string; } export const avatarStyles: AvatarStyle[] = [ // Male Styles { name: &#x27;Action Figure&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922035468.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A photorealistic portrait of a male as an Action Figure, dynamic pose, plastic texture, cinematic lighting.&#x27; }, { name: &#x27;Celebrity&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/7966a18a3de743c3b899e8ef13db2563/8a2d11fcfc2041209dbf40df261096f6&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A high-fashion portrait of a male celebrity, magazine cover style, sharp focus, glamorous.&#x27; }, { name: &#x27;Superhero&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/superhero.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A cinematic portrait of a male superhero, dramatic lighting, detailed costume, powerful expression.&#x27; }, { name: &#x27;Warrior&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/warrior.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A gritty portrait of a male warrior, ancient armor, battle-worn, epic fantasy style.&#x27; }, { name: &#x27;Muscular&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/mascular.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A fitness portrait of a muscular male, strong physique, dramatic shadows, powerful stance.&#x27; }, { name: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/anime.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a vibrant Japanese anime style, sharp lines, expressive eyes.&#x27; }, { name: &#x27;Fantasy&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/fantasy.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a high-fantasy style, elven or magical elements, ethereal lighting.&#x27; }, { name: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/vintage.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a vintage, old-fashioned photograph style, sepia tones, classic attire.&#x27; }, { name: &#x27;Sci-Fi&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sci_fi.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A futuristic portrait of a male in a sci-fi setting, neon lights, advanced technology, space explorer.&#x27; }, { name: &#x27;Cyberpunk&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyberpunk.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.&#x27; }, { name: &#x27;Steampunk&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/steampunk.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a steampunk style, victorian clothing with brass gears and clockwork.&#x27; }, { name: &#x27;Medieval&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/medieval.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male knight in a medieval style, shining armor, castle background.&#x27; }, { name: &#x27;Celeb&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous.&#x27; }, { name: &#x27;Doll&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/doll.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a polished, porcelain doll, perfectly crafted features.&#x27; }, { name: &#x27;Astronaut&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/astronaut.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male astronaut in a spacesuit, reflection of stars in the helmet visor.&#x27; }, { name: &#x27;Cartoon&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cartoon.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a modern 3D cartoon style, like a character from an animated movie.&#x27; }, { name: &#x27;Sculpture&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sculpture.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a classical marble sculpture, detailed stone texture, dramatic lighting.&#x27; }, { name: &#x27;Alien&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/alien.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a friendly or mysterious alien being, otherworldly features.&#x27; }, { name: &#x27;Cyborg&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyborg.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a cyborg, blending human and machine, glowing circuits.&#x27; }, { name: &#x27;Zombie&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/zombie.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A stylized portrait of a male as a zombie, post-apocalyptic theme.&#x27; }, { name: &#x27;Spooky&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/spooky.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A spooky, gothic horror portrait of a male, dark atmosphere, mysterious shadows.&#x27; }, { name: &#x27;Clown&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Clown.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male as a friendly circus clown, colorful makeup and costume.&#x27; }, { name: &#x27;Halloween&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/male.png&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male in a fun Halloween costume, jack-o-lanterns and spooky decorations.&#x27; }, { name: &#x27;Diwali&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/002.png&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A portrait of a male celebrating Diwali, traditional Indian attire, festive lights (diyas).&#x27; }, { name: &#x27;Christmas&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Christmas_male512.png&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A festive portrait of a male in a Christmas setting, wearing a Santa hat or ugly sweater.&#x27; }, { name: &#x27;Surprises&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/29.jpg&#x27;, gender: &#x27;male&#x27;, prompt: &#x27;A fun, surprising portrait of a male, maybe with confetti or a pop art background.&#x27; }, // Female Styles { name: &#x27;Action Figure&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922059362.png&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A photorealistic portrait of a female as an Action Figure, dynamic pose, plastic texture, cinematic lighting.&#x27; }, { name: &#x27;Celebrity&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745233095138.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A high-fashion portrait of a female celebrity, magazine cover style, sharp focus, glamorous.&#x27; }, { name: &#x27;Doll&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/doll.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a beautiful, polished doll with perfect features, vibrant outfit.&#x27; }, { name: &#x27;Warrior&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/warrior.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A gritty portrait of a female warrior, ornate armor, determined expression, epic fantasy style.&#x27; }, { name: &#x27;Muscular&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/mascular.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A fitness portrait of a muscular female, strong and toned physique, dramatic shadows, athletic stance.&#x27; }, { name: &#x27;Superhero&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/superhero.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A cinematic portrait of a female superhero, dramatic lighting, detailed costume, powerful expression.&#x27; }, { name: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/vintage.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a vintage, old-fashioned photograph style, sepia tones, classic 1920s glamour.&#x27; }, { name: &#x27;Fantasy&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/fantasy.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a high-fantasy style, as an elegant elf or powerful sorceress, ethereal lighting.&#x27; }, { name: &#x27;Medieval&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/medieval.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female queen or princess in a medieval style, elegant gown, castle background.&#x27; }, { name: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/anime.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a vibrant Japanese anime style, sharp lines, large expressive eyes.&#x27; }, { name: &#x27;Steampunk&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/steampunk.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a steampunk style, victorian dress with brass goggles and clockwork details.&#x27; }, { name: &#x27;Sci-Fi&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sci_fi.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A futuristic portrait of a female in a sci-fi setting, sleek armor, neon lights, space explorer.&#x27; }, { name: &#x27;Spooky&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/spooky.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A spooky, gothic horror portrait of a female, ghostly appearance, dark and mysterious atmosphere.&#x27; }, { name: &#x27;Cyberpunk&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyberpunk.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.&#x27; }, { name: &#x27;Celeb&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous gown.&#x27; }, { name: &#x27;Astronaut&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/astronaut.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female astronaut in a spacesuit, reflection of Earth in the helmet visor.&#x27; }, { name: &#x27;Alien&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/alien.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a beautiful and mysterious alien queen, otherworldly features.&#x27; }, { name: &#x27;Cartoon&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cartoon.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a modern 3D cartoon style, like a character from a Disney or Pixar movie.&#x27; }, { name: &#x27;Cyborg&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyborg.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a cyborg, elegant blend of human and machine, glowing circuits.&#x27; }, { name: &#x27;Zombie&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/zombie.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A stylized portrait of a female as a zombie, post-apocalyptic survivor theme.&#x27; }, { name: &#x27;Clown&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Clown.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a charming circus clown or pierrot, colorful and friendly makeup.&#x27; }, { name: &#x27;Sculpture&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sculpture.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female as a graceful classical marble sculpture, detailed stone texture, museum lighting.&#x27; }, { name: &#x27;Halloween&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/female.png&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female in a fun Halloween costume, like a witch or vampire, with spooky decorations.&#x27; }, { name: &#x27;Diwali&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/001.png&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A portrait of a female celebrating Diwali, wearing a beautiful traditional saree, festive lights (diyas).&#x27; }, { name: &#x27;Christmas&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Christmas_female512.png&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A festive portrait of a female in a Christmas setting, warm cozy sweater, by a decorated tree.&#x27; }, { name: &#x27;Valentine\&#x27;s Day&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/36.jpg&#x27;, gender: &#x27;female&#x27;, prompt: &#x27;A romantic portrait of a female for Valentine\&#x27;s Day, surrounded by hearts and roses, soft lighting.&#x27; }, ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ caricatureStyles.ts</div> <div class="content">// src/constants/caricatureStyles.ts export interface Style { name: string; imageUrl: string; prompt: string; } export const caricatureStyles: Style[] = [ { name: &#x27;Diva&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/ff03468d-2a81-4a7b-b1a1-243eab68c3f0.jpg&#x27;, prompt: &#x27;glamorous diva with exaggerated features, dramatic makeup, and confident pose&#x27; }, { name: &#x27;Superhero&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dd04d470-fa29-4039-b1e8-8e22dc965d96.jpg&#x27;, prompt: &#x27;heroic superhero caricature with bold features, strong jawline, and determined expression&#x27; }, { name: &#x27;Nurse&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fbec18f3-7348-4402-a105-023da24cf27c.jpg&#x27;, prompt: &#x27;caring nurse caricature with kind eyes, gentle smile, and professional appearance&#x27; }, { name: &#x27;Rockstar&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/0d756d9c-0d36-41a4-a7b4-d7718f8a8406.jpg&#x27;, prompt: &#x27;edgy rockstar caricature with wild hair, intense expression, and rebellious attitude&#x27; }, { name: &#x27;Corporate&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a8ff8c9a-13ec-4fe2-9a06-72c9570872d9.jpg&#x27;, prompt: &#x27;professional business executive caricature with sharp features, confident smile, and formal attire&#x27; }, { name: &#x27;Politician&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7a12a146-a906-490b-8801-2cf7f3f565a5.jpg&#x27;, prompt: &#x27;charismatic politician caricature with persuasive expression, prominent features, and authoritative presence&#x27; }, { name: &#x27;Wonder Woman&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f984a6af-689d-4cee-a087-139740d1533d.jpg&#x27;, prompt: &#x27;powerful Wonder Woman caricature with strong features, heroic pose, and Amazonian warrior spirit&#x27; }, { name: &#x27;Doctor&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bbd0f925-171d-4184-b457-01466c2cb84c.jpg&#x27;, prompt: &#x27;wise doctor caricature with intelligent eyes, caring expression, and medical professional demeanor&#x27; }, { name: &#x27;Superwoman&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/70d86058-dbab-451e-a938-d69ff32af14f.jpg&#x27;, prompt: &#x27;mighty superwoman caricature with bold features, confident stance, and superhero strength&#x27; }, { name: &#x27;Chef&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/baf9d0fe-cb2a-48ca-a442-8df670142841.jpg&#x27;, prompt: &#x27;passionate chef caricature with expressive face, culinary expertise, and creative cooking spirit&#x27; }, { name: &#x27;Engineer&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5bee0616-5f9e-4958-8978-b379a8028717.jpg&#x27;, prompt: &#x27;innovative engineer caricature with analytical expression, technical precision, and problem-solving mindset&#x27; }, { name: &#x27;Firefighter&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/44696ea2-49ae-477c-a654-b6647ad52bfc.jpg&#x27;, prompt: &#x27;brave firefighter caricature with heroic features, determined expression, and life-saving courage&#x27; }, { name: &#x27;Air hostess&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fc2eb43c-2d66-4461-a79d-d9fe850c0f10.jpg&#x27;, prompt: &#x27;elegant air hostess caricature with welcoming smile, professional grace, and friendly demeanor&#x27; }, { name: &#x27;Architect&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d61d8442-4d37-40fa-a416-1d31f76b950d.jpg&#x27;, prompt: &#x27;creative architect caricature with visionary expression, artistic flair, and design expertise&#x27; }, { name: &#x27;Ballet&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/3c75bc92-f9d5-48f4-9219-fb980d5ad42e.jpg&#x27;, prompt: &#x27;graceful ballet dancer caricature with elegant features, artistic expression, and dance sophistication&#x27; }, { name: &#x27;Athlete&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d03852f6-081d-49af-85da-709add60982d.jpg&#x27;, prompt: &#x27;athletic champion caricature with strong features, competitive spirit, and peak physical condition&#x27; } ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ cartoonStyles.ts</div> <div class="content">// src/constants/cartoonStyles.ts export interface CartoonStyle { name: string; imageUrl: string; gender: &#x27;male&#x27; | &#x27;female&#x27;; } export const maleCartoonStyles: CartoonStyle[] = [ // Male Styles { name: &#x27;Woody&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg&#x27; }, { name: &#x27;Tarzaan&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg&#x27; }, { name: &#x27;Suley&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421731.jpg&#x27; }, { name: &#x27;Shrekk&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421575.jpg&#x27; }, { name: &#x27;Russel&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421409.jpg&#x27; }, { name: &#x27;Moanna&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421257.jpg&#x27; }, { name: &#x27;Incredibel&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421110.jpg&#x27; }, { name: &#x27;Herculess&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420963.jpg&#x27; }, { name: &#x27;Hattre&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420807.jpg&#x27; }, { name: &#x27;Fro-zone&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420615.jpg&#x27; }, { name: &#x27;Rider&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420451.jpg&#x27; }, { name: &#x27;Eric&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420276.jpg&#x27; }, { name: &#x27;Miguelle&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420124.jpg&#x27; }, { name: &#x27;Fredrickson&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419880.jpg&#x27; }, { name: &#x27;Hook&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419739.jpg&#x27; }, { name: &#x27;Lightyear&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419579.jpg&#x27; }, { name: &#x27;Alladin&#x27;, gender: &#x27;male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419379.jpg&#x27; }, ]; export const femaleCartoonStyles: CartoonStyle[] = [ // Female Styles { name: &#x27;Snow&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859655.jpg&#x27; }, { name: &#x27;Sleeping&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859518.jpg&#x27; }, { name: &#x27;Princess&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859374.jpg&#x27; }, { name: &#x27;Nordic&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859223.jpg&#x27; }, { name: &#x27;Mulan&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859046.jpg&#x27; }, { name: &#x27;Mermaid&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858882.jpg&#x27; }, { name: &#x27;Iceland&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858702.jpg&#x27; }, { name: &#x27;Fairy&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858521.jpg&#x27; }, { name: &#x27;Cinderella&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858381.jpg&#x27; }, { name: &#x27;Princess&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858207.jpg&#x27; }, { name: &#x27;Alice&#x27;, gender: &#x27;female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858002.jpg&#x27; }, ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ faceSwapStyles.ts</div> <div class="content">// src/constants/faceSwapStyles.ts export interface FaceSwapStyle { name: string; imageUrl: string; gender: &#x27;male&#x27; | &#x27;female&#x27; | &#x27;any&#x27;; } export const faceSwapStyles: FaceSwapStyle[] = [ // --- Male Faces --- { gender: &#x27;male&#x27;, name: &#x27;Classic Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Handsome Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Young Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Professional Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Mature Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Athletic Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820555898.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Casual Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820557168.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Stylish Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Confident Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Distinguished Male&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg&#x27; }, // --- Female Faces --- { gender: &#x27;female&#x27;, name: &#x27;Classic Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Beautiful Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Elegant Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Young Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Stylish Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Modern Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Professional Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Sophisticated Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Confident Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Glamorous Female&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg&#x27; } ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ filterStyles.ts</div> <div class="content">export interface AIFilterStyle { id: string; name: string; category: string; imageUrl: string; } export const aiFilterStyles: AIFilterStyle[] = [ // Ghibli Category { id: &#x27;ghibli-1&#x27;, name: &#x27;Inari&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/97040181-69e1-440d-9c44-45944dd8b8cd.jpg&#x27;, prompt: &#x27;A character portrait in the whimsical Ghibli art style, reminiscent of Inari shrines, detailed and enchanting.&#x27; }, { id: &#x27;ghibli-2&#x27;, name: &#x27;Shade&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5d3e262d-c4f0-45f6-a350-47552640cf03.png&#x27;, prompt: &#x27;A character portrait in the Ghibli art style, with dramatic shading and a mysterious atmosphere.&#x27; }, { id: &#x27;ghibli-3&#x27;, name: &#x27;Zenya&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/962a4918-202c-4a71-a27e-953807d1fd5c.jpg&#x27;, prompt: &#x27;A serene character portrait in the Ghibli art style, peaceful and elegant, with a Zen-like quality.&#x27; }, { id: &#x27;ghibli-4&#x27;, name: &#x27;Storm&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f80b85ab-ea22-40d0-9e91-3793b24d605c.jpg&#x27;, prompt: &#x27;A dynamic character portrait in the Ghibli art style, set during a dramatic storm, emotional and powerful.&#x27; }, { id: &#x27;ghibli-5&#x27;, name: &#x27;Noon&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b7497ed5-0d04-4334-9ca7-ec842cd4cdbb.jpg&#x27;, prompt: &#x27;A bright, sunlit character portrait in the Ghibli art style, capturing the warmth of noon.&#x27; }, { id: &#x27;ghibli-6&#x27;, name: &#x27;Luma&#x27;, category: &#x27;Ghibli&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dc63ecdf-c3f3-458a-ac3b-64c37a0b5a1e.jpg&#x27;, prompt: &#x27;A luminous character portrait in the Ghibli art style, with a soft, glowing light.&#x27; }, // Accessories Category { id: &#x27;accessories-1&#x27;, name: &#x27;Floral Crown&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294968955.jpg&#x27;, prompt: &#x27;A portrait of a person wearing a beautiful and delicate Floral Crown, bohemian and ethereal style.&#x27; }, { id: &#x27;accessories-2&#x27;, name: &#x27;Scarf&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294969683.jpg&#x27;, prompt: &#x27;A portrait of a person wearing a stylish Scarf, adding a touch of elegance or coziness.&#x27; }, { id: &#x27;accessories-3&#x27;, name: &#x27;Beanie&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967692.jpg&#x27;, prompt: &#x27;A portrait of a person wearing a cozy Beanie, casual and cool street style.&#x27; }, { id: &#x27;accessories-4&#x27;, name: &#x27;Bandana&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294966391.jpg&#x27;, prompt: &#x27;A portrait of a person wearing a cool Bandana, with a retro or edgy vibe.&#x27; }, { id: &#x27;accessories-5&#x27;, name: &#x27;Necklace&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294969331.jpg&#x27;, prompt: &#x27;A close-up portrait focusing on a person wearing an elegant Necklace.&#x27; }, { id: &#x27;accessories-6&#x27;, name: &#x27;Baseball Cap&#x27;, category: &#x27;Accessories&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967301.jpg&#x27;, prompt: &#x27;A portrait of a person wearing a sporty Baseball Cap, casual and relaxed.&#x27; }, // Anime Category { id: &#x27;anime-1&#x27;, name: &#x27;Gintocki&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531622371.jpg&#x27;, prompt: &#x27;A person transformed into the anime character Gintoki Sakata, with silver hair and samurai attire.&#x27; }, { id: &#x27;anime-2&#x27;, name: &#x27;H X H&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531620868.jpg&#x27;, prompt: &#x27;A person in the distinct art style of the anime Hunter x Hunter.&#x27; }, { id: &#x27;anime-3&#x27;, name: &#x27;Saitaama&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531619290.jpg&#x27;, prompt: &#x27;A person transformed into the anime character Saitama from One-Punch Man, bald and wearing his hero suit.&#x27; }, { id: &#x27;anime-4&#x27;, name: &#x27;Erren&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531617759.jpg&#x27;, prompt: &#x27;A person transformed into the anime character Eren Yeager from Attack on Titan, with intense eyes.&#x27; }, { id: &#x27;anime-5&#x27;, name: &#x27;Leloch&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531616067.jpg&#x27;, prompt: &#x27;A person transformed into the anime character Lelouch Lamperouge from Code Geass, with his Geass eye.&#x27; }, { id: &#x27;anime-6&#x27;, name: &#x27;Light&#x27;, category: &#x27;Anime&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531614532.jpg&#x27;, prompt: &#x27;A person transformed into the anime character Light Yagami from Death Note, with a cunning expression.&#x27; }, // Vintage Category { id: &#x27;vintage-1&#x27;, name: &#x27;1990s&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0d3d215d0cf645769449223588572076&#x27;, prompt: &#x27;A portrait in the style of the 1990s, with grunge or pop fashion and a film grain look.&#x27; }, { id: &#x27;vintage-2&#x27;, name: &#x27;Victorian&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/1a415a7a51bb436c841068395131c43e&#x27;, prompt: &#x27;An elegant portrait in the Victorian era style, with elaborate clothing and a formal setting.&#x27; }, { id: &#x27;vintage-3&#x27;, name: &#x27;1980s&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/9fe8f49883e548f88cf1364c52036685&#x27;, prompt: &#x27;A portrait with a vibrant 1980s aesthetic, big hair, neon colors, and retro vibes.&#x27; }, { id: &#x27;vintage-4&#x27;, name: &#x27;1950s&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/f99d72dbe94c498fb060d466a66b43f7&#x27;, prompt: &#x27;A classic portrait in the style of the 1950s, with pin-up or rockabilly fashion.&#x27; }, { id: &#x27;vintage-5&#x27;, name: &#x27;1920s&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/ab593ec4339f439195d1a139e7a967ad&#x27;, prompt: &#x27;A glamorous portrait in the style of the Roaring 1920s, with flapper dresses and art deco elements.&#x27; }, { id: &#x27;vintage-6&#x27;, name: &#x27;1990s&#x27;, category: &#x27;Vintage&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d47960ae2f8a4116aaebe364430cfa0d&#x27;, prompt: &#x27;A portrait with a distinct 1990s vibe, featuring baggy clothes and a cool, casual attitude.&#x27; }, // Lights Category { id: &#x27;lights-1&#x27;, name: &#x27;Sunset&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/964ca646-31ad-4e72-9768-5dd1ea831880.jpg&#x27;, prompt: &#x27;A portrait with beautiful sunset lighting, warm golden hour glow, dramatic colors.&#x27; }, { id: &#x27;lights-2&#x27;, name: &#x27;Laser&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f9a577ed-e548-4e61-a66d-352f023b35c1.jpg&#x27;, prompt: &#x27;A futuristic portrait with dramatic laser light effects, vibrant and energetic.&#x27; }, { id: &#x27;lights-3&#x27;, name: &#x27;Fireworks&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f0a43cd7-6541-4f75-bed7-972b9e0820e7.jpg&#x27;, prompt: &#x27;A celebratory portrait with a background of exploding fireworks, bright and colorful.&#x27; }, { id: &#x27;lights-4&#x27;, name: &#x27;Northern&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/4fc40ddf-2df9-4063-bce3-1c675b614a3a.jpg&#x27;, prompt: &#x27;A magical portrait with the Northern Lights (Aurora Borealis) in the sky.&#x27; }, { id: &#x27;lights-5&#x27;, name: &#x27;Bokeh&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/6574b9b8-188d-40c9-9835-6369f42403e5.jpg&#x27;, prompt: &#x27;A portrait with a beautiful bokeh effect, soft, out-of-focus lights in the background.&#x27; }, { id: &#x27;lights-6&#x27;, name: &#x27;Cinematic&#x27;, category: &#x27;Lights&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b08cd6bc-d8cc-4d33-a47f-57eb57dd3b6b.jpg&#x27;, prompt: &#x27;A portrait with dramatic cinematic lighting, high contrast and moody atmosphere.&#x27; }, ]; export const filterCategories = [&#x27;Ghibli&#x27;, &#x27;Accessories&#x27;, &#x27;Anime&#x27;, &#x27;Vintage&#x27;, &#x27;Lights&#x27;];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ hairstylePrompts.ts</div> <div class="content">// src/constants/hairstylePrompts.ts export interface Hairstyle { name: string; imageUrl: string; prompt: string; } export const hairstylePresets: Hairstyle[] = [ { name: &#x27;Long Wavy&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272761.jpg&#x27;, prompt: &#x27;A portrait with long, wavy, flowing hair&#x27; }, { name: &#x27;Long Hair&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599470399.jpg&#x27;, prompt: &#x27;A portrait with very long, straight hair&#x27; }, { name: &#x27;Mullet&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599470887.jpg&#x27;, prompt: &#x27;A person with a modern mullet hairstyle&#x27; }, { name: &#x27;Bangs&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599471255.jpg&#x27;, prompt: &#x27;A portrait of a person with stylish, full bangs&#x27; }, { name: &#x27;Braids&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599471688.jpg&#x27;, prompt: &#x27;A portrait featuring intricate and beautiful braids&#x27; }, { name: &#x27;Bald&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d59b665d0a17403c9da49e7891a1cb99&#x27;, prompt: &#x27;A completely bald head, smooth and clean&#x27; }, { name: &#x27;Wavy&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/37261d6f1dd84b1c9b7b710dd3b19736&#x27;, prompt: &#x27;A portrait with short, naturally wavy hair&#x27; }, { name: &#x27;Buzz Cut&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/349d4a89249f41d59dac7efb4803da0d&#x27;, prompt: &#x27;A person with a clean and sharp buzz cut&#x27; }, { name: &#x27;Blunt&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/bb1bbe6e68254173b654eb5b07710242&#x27;, prompt: &#x27;A portrait featuring a stylish blunt cut hairstyle&#x27; }, { name: &#x27;Layered&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/e29a7406d2ed4858a8959249b74598a7&#x27;, prompt: &#x27;A person with a modern, layered hairstyle for volume and texture&#x27; }, { name: &#x27;Undercut&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d8484fb1c9f145ce8f718d1f5dbeb3ac&#x27;, prompt: &#x27;A stylish undercut hairstyle&#x27; }, { name: &#x27;Taper Fade&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/777f33ab9f574686b3ec80aae28cbf15&#x27;, prompt: &#x27;A portrait with a clean taper fade haircut&#x27; }, { name: &#x27;Dreadlocks&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/bd4e0546000e40aea0af6076f281fbca&#x27;, prompt: &#x27;A person with cool and stylish dreadlocks&#x27; }, { name: &#x27;Ballerina Bun&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/32bdfca6ef9c4bfa9659ce4ca7ebf2db&#x27;, prompt: &#x27;An elegant and tight ballerina bun hairstyle&#x27; }, { name: &#x27;Ponytail&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/b68a115ea2ca4a4ea9e8d0c1305a085e&#x27;, prompt: &#x27;A person with a classic, sleek ponytail&#x27; }, { name: &#x27;Messy Bun&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0cf7c98bbec84282ba05ab093d469c74&#x27;, prompt: &#x27;A casual and stylish messy bun hairstyle&#x27; }, { name: &#x27;Crew Cut&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/4e4477a804174b3faa013f4b5ba190bf&#x27;, prompt: &#x27;A classic and clean crew cut hairstyle&#x27; }, { name: &#x27;Shaggy&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/268c6b15f80744fb8321e902eb1940ce&#x27;, prompt: &#x27;A person with a trendy, shaggy, layered haircut&#x27; }, { name: &#x27;Pixie Cut&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/c8bf0bd53d8043b199a57435012d8773&#x27;, prompt: &#x27;A stylish and modern pixie cut&#x27; }, { name: &#x27;Bob Cut&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179271643.jpg&#x27;, prompt: &#x27;A classic bob cut hairstyle&#x27; }, { name: &#x27;Afro&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179270863.jpg&#x27;, prompt: &#x27;A person with a voluminous and beautiful afro hairstyle&#x27; }, { name: &#x27;Bowl Cut&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272046.jpg&#x27;, prompt: &#x27;A retro bowl cut hairstyle&#x27; }, { name: &#x27;Curly&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272394.jpg&#x27;, prompt: &#x27;A portrait with natural, bouncy curly hair&#x27; }, { name: &#x27;Space Bun&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179273109.jpg&#x27;, prompt: &#x27;A fun and trendy space bun hairstyle&#x27; }, ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ imageGeneratorOptions.ts</div> <div class="content">// Image resolution options for AI Image Generator export interface ImageResolution { id: string; name: string; aspectRatio: string; dimensions: string; width: number; height: number; } export const imageResolutions: ImageResolution[] = [ { id: &#x27;square&#x27;, name: &#x27;Square&#x27;, aspectRatio: &#x27;1:1&#x27;, dimensions: &#x27;1024x1024 px&#x27;, width: 1024, height: 1024 }, { id: &#x27;portrait-9-16&#x27;, name: &#x27;Portrait&#x27;, aspectRatio: &#x27;9:16&#x27;, dimensions: &#x27;768x1360 px&#x27;, width: 768, height: 1360 }, { id: &#x27;landscape-16-9&#x27;, name: &#x27;Landscape&#x27;, aspectRatio: &#x27;16:9&#x27;, dimensions: &#x27;1360x768 px&#x27;, width: 1360, height: 768 }, { id: &#x27;portrait-3-4&#x27;, name: &#x27;Portrait&#x27;, aspectRatio: &#x27;3:4&#x27;, dimensions: &#x27;880x1168 px&#x27;, width: 880, height: 1168 }, { id: &#x27;landscape-4-3&#x27;, name: &#x27;Landscape&#x27;, aspectRatio: &#x27;4:3&#x27;, dimensions: &#x27;1168x880 px&#x27;, width: 1168, height: 880 }, { id: &#x27;portrait-2-3&#x27;, name: &#x27;Portrait&#x27;, aspectRatio: &#x27;2:3&#x27;, dimensions: &#x27;832x1248 px&#x27;, width: 832, height: 1248 }, { id: &#x27;landscape-3-2&#x27;, name: &#x27;Landscape&#x27;, aspectRatio: &#x27;3:2&#x27;, dimensions: &#x27;1248x832 px&#x27;, width: 1248, height: 832 } ]; // Suggested prompts for AI Image Generator export const suggestedPrompts: string[] = [ &#x27;generate cute fawn cartoon character enjoying springtime flowers in highly detailed&#x27;, &#x27;create an (old cartoon illustration) of an abandoned boat on the beach surrounded by seagulls and starfish, stormy clouds&#x27;, &#x27;generate a serpent with a hypnotic gaze in a magical wonderland, best quality, masterpiece, ultra sharp, hyper-realistic&#x27;, &#x27;generate an 8k ultra-realistic image of a beautiful unicorn in heaven, high quality with rich vibrant vivid colors&#x27;, &#x27;design a character in the style of Amy Judd blending with Andre Kohn style:1.1), ((neo-figurative fantasy:1.2)), a young woman made of smoke and fog and delicate misty wisps sitting with her side.&#x27;, &#x27;knight fighting a giant fantasy dragon, a burned village in the background, highly detailed, dark fantasy, (morning dawn epic scene of dense smoke by Kim Keever)&#x27;, &#x27;generate a (glowing eyes:1. 2) smiling medusa with pale white cracked skin, snakes growing out of her head, dramatic with the best quality&#x27;, &#x27;generate a realistic (batman:1.3) holding a powerful magical electric thunder ball spellbook with detailed eyes, cinematic&#x27;, &#x27;create a photo of the artistic stone cup with 3D carvings of a muscular teenage ninja turtle in vibrant colors body, decorated with amber accents in dark mountain&#x27;, &#x27;generate a feudal ninja fighting bravely against a giant colossus straw puppet boss, hyper-detailed, ultra-detailed&#x27;, &#x27;create a pixar character of a bull terrier smiling, high resolution, best quality, ((pixar style))&#x27;, &#x27;a dzungarian hamster in an adventurer\&#x27;s hat with slimy tentacles made of blue and white porcelain in wonderland, fantasy art concept, best quality, masterpiece&#x27;, &#x27;create an ethereal beauty of mystical trees with sparkling blossoms illuminated by a red radiant moon casting its glow upon a tree and large landscape&#x27;, &#x27;pixar style of transparent king seahorse with a crown (((luminous))) in the ocean covered with bubbles, high detailed, photorealistic, 8k&#x27;, &#x27;Alice fighting a Oompa Loompa with a large sword, hyper detailed, high quality&#x27;, &#x27;pixar style of lobster, as a cartoon business man character, tinny cute, ((( luminous))), carring a little suitcase, in the ocean, bubbles, smile, high detailed, photorealistic, 8k , smooth, simple&#x27;, &#x27;generate a ((leprechaun)) dancing on a big cauldron full of shiny golden coins in front of a dark cave, (evil laugh), ((clover bushes in the foreground)), god rays of rim light from the small cleft, dense dust, dark fantasy art&#x27;, &#x27;pixar style of a chubby giraffe with a big tummy like a ball doing yoga poses in yoga pants, smiling, highly detailed, photorealistic&#x27; ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ index.ts</div> <div class="content">export const SITE_TITLE = &#x27;ModernPhotoTools.com&#x27;; export const SITE_DESCRIPTION = &#x27;Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds.&#x27;; export const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB export const ACCEPTED_IMAGE_TYPES = [&#x27;image/jpeg&#x27;, &#x27;image/png&#x27;]; export { faceSwapStyles } from &#x27;./faceSwapStyles&#x27;;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ outfitStyles.ts</div> <div class="content">// src/constants/outfitStyles.ts export interface OutfitStyle { category: string; name: string; prompt: string; } export const presetOutfitStyles: OutfitStyle[] = [ // Category: Wedding { category: &#x27;Wedding&#x27;, name: &#x27;2-Piece&#x27;, prompt: &#x27;A model wearing a modern and elegant 2-piece wedding outfit, professional studio photoshoot.&#x27; }, { category: &#x27;Wedding&#x27;, name: &#x27;Wedding Jacket&#x27;, prompt: &#x27;A model in a sophisticated wedding jacket, suitable for a chic and formal ceremony.&#x27; }, { category: &#x27;Wedding&#x27;, name: &#x27;A-Line&#x27;, prompt: &#x27;A model wearing a classic A-Line wedding gown, timeless and graceful, full-length view.&#x27; }, { category: &#x27;Wedding&#x27;, name: &#x27;3 Piece Suit&#x27;, prompt: &#x27;A model looking dapper in a perfectly tailored 3-piece wedding suit, formal and sharp.&#x27; }, { category: &#x27;Wedding&#x27;, name: &#x27;Gown&#x27;, prompt: &#x27;A model in a breathtaking, floor-length wedding gown, romantic and elegant.&#x27; }, { category: &#x27;Wedding&#x27;, name: &#x27;Classic Suit&#x27;, prompt: &#x27;A model wearing a timeless classic suit for a wedding, sophisticated and elegant.&#x27; }, // Category: Smart Casual { category: &#x27;Smart Casual&#x27;, name: &#x27;Blazer&#x27;, prompt: &#x27;A model wearing a stylish jacket, embodying a perfect smart casual look for an urban setting.&#x27; }, { category: &#x27;Smart Casual&#x27;, name: &#x27;Casual Jacket&#x27;, prompt: &#x27;A model in a fashionable smart casual jacket, effortlessly chic for a day out.&#x27; }, { category: &#x27;Smart Casual&#x27;, name: &#x27;Knit Cardigan&#x27;, prompt: &#x27;A model looking cozy and stylish in a layered smart casual cardigan.&#x27; }, { category: &#x27;Smart Casual&#x27;, name: &#x27;Open Cardigan&#x27;, prompt: &#x27;A model in a comfortable knit cardigan, the essence of smart casual fashion.&#x27; }, { category: &#x27;Smart Casual&#x27;, name: &#x27;Blouse shirt&#x27;, prompt: &#x27;A model in an elegant blouse shirt, perfect for a smart casual office look or evening.&#x27; }, { category: &#x27;Smart Casual&#x27;, name: &#x27;Button-up&#x27;, prompt: &#x27;A model wearing a crisp button-up shirt, a versatile staple of smart casual style.&#x27; }, // Category: Athleisure { category: &#x27;Athleisure&#x27;, name: &#x27;Sports Bra&#x27;, prompt: &#x27;A model in a trendy and supportive sports bra, athleisure style, in a fitness studio.&#x27; }, { category: &#x27;Athleisure&#x27;, name: &#x27;Basketball&#x27;, prompt: &#x27;A model wearing basketball-inspired athleisure wear on an urban court, sporty and cool.&#x27; }, { category: &#x27;Athleisure&#x27;, name: &#x27;Pullover Hoodie&#x27;, prompt: &#x27;A model in a comfortable athleisure hoodie, perfect for a casual, sporty look.&#x27; }, { category: &#x27;Athleisure&#x27;, name: &#x27;Zip-up Hoodie&#x27;, prompt: &#x27;A model showcasing a different style of athleisure hoodie, street style fashion.&#x27; }, { category: &#x27;Athleisure&#x27;, name: &#x27;Tank Top&#x27;, prompt: &#x27;A model in a breathable athleisure tank top, looking ready for a workout.&#x27; }, { category: &#x27;Athleisure&#x27;, name: &#x27;Polo&#x27;, prompt: &#x27;A model in a classic polo shirt, styled for a sophisticated athleisure look.&#x27; }, // Category: Jackets (Inferred) { category: &#x27;Jackets&#x27;, name: &#x27;Classic Denim Jacket&#x27;, prompt: &#x27;A model in a timeless denim jacket, casual street style photoshoot.&#x27; }, { category: &#x27;Jackets&#x27;, name: &#x27;Vintage Denim Jacket&#x27;, prompt: &#x27;A model showcasing a fashionable denim jacket against an urban background.&#x27; }, // Category: Sweaters (Inferred) { category: &#x27;Sweaters&#x27;, name: &#x27;Sweater&#x27;, prompt: &#x27;A model wearing a cozy knit sweater, perfect for a warm and stylish autumn look.&#x27; }, { category: &#x27;Sweaters&#x27;, name: &#x27;Turtleneck&#x27;, prompt: &#x27;A model in a chic turtleneck sweater, exuding sophistication and warmth.&#x27; }, // Category: Traditional (Inferred) { category: &#x27;Traditional&#x27;, name: &#x27;Kebaya&#x27;, prompt: &#x27;A model wearing a beautiful, intricate traditional Kebaya blouse, celebrating cultural heritage.&#x27; }, { category: &#x27;Traditional&#x27;, name: &#x27;Highland&#x27;, prompt: &#x27;A model dressed in Scottish Highland attire, featuring traditional tartan patterns.&#x27; }, // Category: Bohemian (Inferred) { category: &#x27;Bohemian&#x27;, name: &#x27;Bohemian&#x27;, prompt: &#x27;A model with a free-spirited bohemian look, featuring flowing fabrics and earthy tones.&#x27; }, { category: &#x27;Bohemian&#x27;, name: &#x27;Funky&#x27;, prompt: &#x27;A model in a funky, eclectic outfit with bold colors and unique patterns, expressing individuality.&#x27; }, ]; export const suggestedOutfitPrompts: string[] = [ &quot;Vibrant balloons&quot;, &quot;Urban brick wall&quot;, &quot;Lush garden scene&quot;, &quot;Serene ocean view&quot;, &quot;Abstract painting&quot;, &quot;Graffiti-covered wall&quot;, &quot;Rustic barn&quot;, &quot;City skyline&quot;, &quot;Enchanting forest landscape&quot;, &quot;Majestic mountain range&quot; ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ portraitStyles.ts</div> <div class="content">// src/constants/portraitStyles.ts export interface PortraitStyle { name: string; imageUrl: string; gender: &#x27;male&#x27; | &#x27;female&#x27; | &#x27;any&#x27;; prompt: string; } export const portraitStyles: PortraitStyle[] = [ // --- Male Styles --- { gender: &#x27;male&#x27;, name: &#x27;Wizard&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg&#x27;, prompt: &#x27;A selfie of a male as a powerful Wizard, wearing magical robes, in a fantasy library setting.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Trench Coat&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg&#x27;, prompt: &#x27;A cinematic selfie of a male wearing a stylish Trench Coat on a rainy city street at night.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Sweater&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg&#x27;, prompt: &#x27;A cozy selfie of a male in a warm, knitted sweater, autumn vibes, soft lighting.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Grinch&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a7b8a481-8776-4589-b1bb-9c021da759f5.jpg&#x27;, prompt: &#x27;A selfie of a male transformed into the Grinch, with green fur and a mischievous smile, festive theme.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Superhero&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg&#x27;, prompt: &#x27;A dynamic selfie of a male as a powerful Superhero, wearing a modern costume, with a city skyline in the background.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Post Imp&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg&#x27;, prompt: &#x27;A selfie of a male in a Post-Impressionist art style, with bold colors and expressive brushstrokes.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Abstract&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891373055.jpg&#x27;, prompt: &#x27;A selfie of a male in a vibrant abstract art style, using geometric shapes and non-realistic colors.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Wooden&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777377.jpg&#x27;, prompt: &#x27;A selfie of a male reimagined as a detailed Wooden sculpture, showing wood grain and texture.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Stone&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777195.jpg&#x27;, prompt: &#x27;A selfie of a male reimagined as a classical Stone sculpture, with a marble or granite texture.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Thriller&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg&#x27;, prompt: &#x27;A selfie of a male in a classic thriller movie style, dramatic shadows, intense expression.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Suave&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg&#x27;, prompt: &#x27;A selfie of a suave male in a tailored suit, looking confident and charming, like a secret agent.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Officer&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890916035.jpg&#x27;, prompt: &#x27;A professional selfie of a male as a respectable military Officer in a formal uniform.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Cop&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890915894.jpg&#x27;, prompt: &#x27;A selfie of a male as a police Cop, wearing a uniform, looking serious and dedicated.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Cyber Warrior&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823784962.jpg&#x27;, prompt: &#x27;A selfie of a male as a futuristic Cyber Warrior, with high-tech armor and a glowing energy sword.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Viking&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823787503.jpg&#x27;, prompt: &#x27;A selfie of a male as a fierce Viking warrior, with braided hair, beard, and traditional armor.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Legacy&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197112042.jpg&#x27;, prompt: &#x27;A selfie of a male with Day of the Dead face paint, celebrating a vibrant legacy with flowers and patterns.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Ancestor&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197109686.jpg&#x27;, prompt: &#x27;A selfie of a male in the style of a revered Ancestor, with traditional Day of the Dead sugar skull makeup.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Mohawk&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397418.jpg&#x27;, prompt: &#x27;A selfie of a male with a cool Mohawk hairstyle, punk rock aesthetic.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Gray&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg&#x27;, prompt: &#x27;A selfie of a male with distinguished gray hair, looking handsome and sophisticated.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Sultan&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654277.jpg&#x27;, prompt: &#x27;A royal selfie of a male as a powerful Sultan, wearing ornate robes and a majestic turban.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Ottoman&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654139.jpg&#x27;, prompt: &#x27;A royal selfie of a male in traditional Ottoman empire attire, rich fabrics and intricate details.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Mughal&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653999.jpg&#x27;, prompt: &#x27;A royal selfie of a male as a Mughal emperor, adorned with jewels and fine silks.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Mayan&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653860.jpg&#x27;, prompt: &#x27;A royal selfie of a male as a Mayan king, with traditional headdress and intricate carvings.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Heian&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653726.jpg&#x27;, prompt: &#x27;A royal selfie of a male in the style of the Japanese Heian period, elegant and artistic.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;European&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653548.jpg&#x27;, prompt: &#x27;A selfie of a male as classic European royalty, wearing a crown and regal attire.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Chinese&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653334.jpg&#x27;, prompt: &#x27;A selfie of a male as a historical Chinese emperor, in traditional silk robes.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Byzantine&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653170.jpg&#x27;, prompt: &#x27;A selfie of a male in the opulent style of a Byzantine noble, with rich mosaics and gold.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;African&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887652980.jpg&#x27;, prompt: &#x27;A selfie of a male as a proud African king, wearing vibrant traditional attire and beads.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Woody&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg&#x27;, prompt: &#x27;A selfie of a male transformed into the cartoon character Woody from Toy Story, 3D animated style.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Tarzaan&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg&#x27;, prompt: &#x27;A selfie of a male as the cartoon character Tarzan, in a lush jungle, animated style.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Waist-coat&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890156866.jpg&#x27;, prompt: &#x27;A selfie of a male celebrating Diwali, wearing a traditional Kurta with a stylish waist-coat.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Contemporary&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890157076.jpg&#x27;, prompt: &#x27;A selfie of a male in a contemporary outfit for Diwali, modern and festive.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Adorable&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443497129.jpg&#x27;, prompt: &#x27;An adorable selfie of a male for Valentine\&#x27;s Day, with a sweet smile and a background of hearts.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Charming&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443499416.jpg&#x27;, prompt: &#x27;A charming selfie of a male on Valentine\&#x27;s Day, holding a rose, looking romantic.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Vibrant&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581601035.jpg&#x27;, prompt: &#x27;A selfie of a male celebrating Holi, face covered in vibrant colored powders.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Phoolrang&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581602870.jpg&#x27;, prompt: &#x27;A selfie of a male celebrating Holi with Phoolrang, surrounded by flower petals and colors.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Santa&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851564.jpg&#x27;, prompt: &#x27;A festive selfie of a male dressed as Santa Claus, with a white beard and red hat.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Snow&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851805.jpg&#x27;, prompt: &#x27;A selfie of a male in a winter wonderland, with snow falling gently around him, Christmas theme.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Vibrant&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/28ad386a-6665-46f5-8e87-9e6d9fd2a036.jpg&#x27;, prompt: &#x27;A selfie of a male at a vibrant New Year\&#x27;s party, with confetti and bright lights.&#x27; }, { gender: &#x27;male&#x27;, name: &#x27;Stylish&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7cd237c1-9274-46e1-bddb-c1953d00f075.jpg&#x27;, prompt: &#x27;A stylish selfie of a male dressed up for a New Year\&#x27;s celebration, looking sharp in a suit.&#x27; }, // --- Female Styles --- { gender: &#x27;female&#x27;, name: &#x27;Woolen Coat&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg&#x27;, prompt: &#x27;A chic selfie of a female in an elegant Woolen Coat, winter fashion in the city.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Tropical&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg&#x27;, prompt: &#x27;A selfie of a female in a vibrant Tropical dress, on a sunny beach with palm trees.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Trench Coat&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg&#x27;, prompt: &#x27;A selfie of a female wearing a classic Trench Coat, sophisticated and timeless look, autumn setting.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Sweater&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg&#x27;, prompt: &#x27;A cozy selfie of a female wearing a soft, warm sweater, holding a cup of coffee.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Stylish&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg&#x27;, prompt: &#x27;A selfie of a very stylish female in a high-fashion outfit, looking ready for a magazine cover.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Street Style&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg&#x27;, prompt: &#x27;A selfie of a female with an edgy Street Style look, in a cool urban environment.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Poncho&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg&#x27;, prompt: &#x27;A selfie of a female wearing a fashionable, patterned Poncho, bohemian and chic.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Nightdress&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg&#x27;, prompt: &#x27;A selfie of a female in an elegant silk Nightdress, soft and dreamy bedroom setting.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Jacket&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg&#x27;, prompt: &#x27;A selfie of a female in a cool leather Jacket, exuding confidence and style.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Cocktail&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg&#x27;, prompt: &#x27;A selfie of a female in a stunning Cocktail dress, ready for an evening event.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Classic Black&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570192.jpg&#x27;, prompt: &#x27;A selfie of a female in a timeless, classic black dress, sophisticated and elegant.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Boho&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570025.jpg&#x27;, prompt: &#x27;A selfie of a female with a Boho-chic style, flowy dress, and earthy accessories.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Bodysuit&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569859.jpg&#x27;, prompt: &#x27;A selfie of a female in a sleek and stylish Bodysuit, modern and fashionable.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Blazer&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569709.jpg&#x27;, prompt: &#x27;A selfie of a female looking sharp and professional in a well-fitted Blazer.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Athleisure&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569494.jpg&#x27;, prompt: &#x27;A selfie of a female in trendy Athleisure wear, sporty, comfortable, and stylish.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Aesthetic&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893290344.jpg&#x27;, prompt: &#x27;A selfie of a female with a soft, dreamy aesthetic, pastel colors, and artistic flair.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Goddess&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893291279.jpg&#x27;, prompt: &#x27;A selfie of a female transformed into a divine Goddess, with ethereal light and a powerful aura.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Romanticism&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822384442.jpg&#x27;, prompt: &#x27;A selfie of a female in the style of a Romanticism painting, dramatic, emotional, and beautiful.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Abstract&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822382528.jpg&#x27;, prompt: &#x27;A selfie of a female rendered in a colorful abstract painting style, bold shapes and lines.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Goddess&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721893611671.jpg&#x27;, prompt: &#x27;A fantasy selfie of a female as a celestial Goddess, surrounded by stars and cosmic energy.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Viking&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733226.jpg&#x27;, prompt: &#x27;A selfie of a female as a strong Viking warrior, with intricate braids and leather armor.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Tribal&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733082.jpg&#x27;, prompt: &#x27;A selfie of a female with beautiful tribal face paint and traditional accessories, proud and powerful.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Soulful&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197129378.jpg&#x27;, prompt: &#x27;A soulful selfie of a female with artistic Day of the Dead makeup, celebrating life and memory.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Sacred&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197131255.jpg&#x27;, prompt: &#x27;A selfie of a female with sacred Day of the Dead sugar skull art, adorned with marigolds.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Black Stone&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721880887150.jpg&#x27;, prompt: &#x27;A selfie of a female reimagined as an elegant Black Stone sculpture, polished and dramatic.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Stone&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721825362271.jpg&#x27;, prompt: &#x27;A selfie of a female as a graceful Greco-Roman stone sculpture, timeless beauty.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Wavy&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770675.jpg&#x27;, prompt: &#x27;A selfie of a female with beautiful, long wavy hair, looking natural and effortless.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Victoria Roll&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770509.jpg&#x27;, prompt: &#x27;A selfie of a female with an elegant Victoria Roll hairstyle, classic and sophisticated.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Clothes&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882293628.jpg&#x27;, prompt: &#x27;A selfie of a female in futuristic clothes with glowing neon accents, cyberpunk fashion.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Space Explorer&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882294348.jpg&#x27;, prompt: &#x27;A selfie of a female as a neon Space Explorer, with a futuristic suit and helmet.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Spain&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885286031.jpg&#x27;, prompt: &#x27;A selfie of a female as Spanish royalty, wearing a traditional, elegant gown.&#x27; }, { gender: &#x27;female&#x27;, name: &#x27;Queen&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885285866.jpg&#x27;, prompt: &#x27;A royal selfie of a female as a powerful Queen, wearing a crown and regal jewelry.&#x27; }, ]; export const suggestedPortraitPrompts = [ &#x27;Professional headshot with soft lighting&#x27;, &#x27;Artistic portrait with dramatic shadows&#x27;, &#x27;Vintage style with warm tones&#x27;, &#x27;Modern minimalist portrait&#x27;, &#x27;Fantasy character transformation&#x27;, &#x27;Cinematic movie poster style&#x27;, &#x27;Oil painting classical portrait&#x27;, &#x27;Digital art cyberpunk style&#x27; ];</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ productStyles.ts</div> <div class="content">export interface ProductStyle { name: string; imageUrl: string; prompt: string; } export const productStyles: ProductStyle[] = [ { name: &#x27;Cherry Blossoms&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020929.jpg&#x27;, prompt: &#x27;A product placed amidst delicate cherry blossoms, soft pink background, professional product photography, cinematic lighting.&#x27; }, { name: &#x27;Lavenders&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020705.jpg&#x27;, prompt: &#x27;A product displayed in a field of lavenders, rustic and natural setting, calm and soothing atmosphere, product photoshoot.&#x27; }, { name: &#x27;Winter&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089570.jpg&#x27;, prompt: &#x27;Professional apparel photoshoot, winter theme, snowy background, warm clothing, fashion shot.&#x27; }, { name: &#x27;Wedding&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089011.jpg&#x27;, prompt: &#x27;Elegant wedding apparel photoshoot, soft lighting, romantic setting, bridal theme, high fashion.&#x27; }, { name: &#x27;Urban&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604088380.jpg&#x27;, prompt: &#x27;Urban streetwear apparel photoshoot, city background with a graffiti wall, edgy and modern style.&#x27; }, { name: &#x27;Summer&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087821.jpg&#x27;, prompt: &#x27;Summer fashion apparel photoshoot on a bright sunny day, beach or poolside setting, vibrant colors.&#x27; }, { name: &#x27;Red Carpet&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087214.jpg&#x27;, prompt: &#x27;Red carpet apparel photoshoot, glamorous evening gown, flashing lights, celebrity style.&#x27; }, { name: &#x27;Party&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086601.jpg&#x27;, prompt: &#x27;Festive party apparel photoshoot with confetti and balloons, celebratory mood, dynamic and fun.&#x27; }, { name: &#x27;Business&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086039.jpg&#x27;, prompt: &#x27;Professional business apparel photoshoot in a modern office setting, clean and sharp look, corporate attire.&#x27; }, { name: &#x27;Athleisure&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604085478.jpg&#x27;, prompt: &#x27;Athleisure apparel photoshoot with a sporty and comfortable look, in an urban park or gym setting.&#x27; }, { name: &#x27;Adventure&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604084689.jpg&#x27;, prompt: &#x27;Adventure and outdoor apparel photoshoot, mountain or forest background, rugged and durable clothing.&#x27; }, { name: &#x27;Rosebed&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a0ca0330-f483-4c55-8a2f-18ce0db0c39e.jpg&#x27;, prompt: &#x27;A cherished product, like jewelry or perfume, displayed on a bed of fresh red roses, romantic and luxurious.&#x27; }, { name: &#x27;Ribbons&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bd2b6d55-4709-4a1a-90de-0f48e73f68d7.jpg&#x27;, prompt: &#x27;A product artfully arranged with flowing silk ribbons, elegant and delicate presentation, studio shot.&#x27; }, { name: &#x27;River&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119732.jpg&#x27;, prompt: &#x27;Product photoshoot set by a clear mountain river, on natural stones, in a serene and pristine environment.&#x27; }, { name: &#x27;Waterfall&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119524.jpg&#x27;, prompt: &#x27;Product photoshoot with a majestic waterfall in the background, misty and powerful nature scene.&#x27; }, { name: &#x27;Tree Stump&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244508.jpg&#x27;, prompt: &#x27;A rustic product displayed on an old tree stump in a forest, natural and earthy mood.&#x27; }, { name: &#x27;Mountain&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244245.jpg&#x27;, prompt: &#x27;Product photoshoot on a mountain peak, dramatic sky, expansive and adventurous mood.&#x27; }, { name: &#x27;Kitchen&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842034380.jpg&#x27;, prompt: &#x27;Product placement in a modern, clean kitchen setting, lifestyle photoshoot, natural light.&#x27; }, { name: &#x27;Bathroom&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842033958.jpg&#x27;, prompt: &#x27;Cosmetic product displayed in a luxurious, spa-like bathroom, clean and fresh aesthetic.&#x27; }, { name: &#x27;Sneakers&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509574349.jpg&#x27;, prompt: &#x27;Dynamic photoshoot of sneakers, urban street setting, motion blur, product in action.&#x27; }, { name: &#x27;Sandals&#x27;, imageUrl: &#x27;https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/206c0e5fc3f54894a3add602580c195a&#x27;, prompt: &#x27;Lifestyle photoshoot of sandals on a sunny beach, sand and waves in the background, relaxed summer vibe.&#x27; }, { name: &#x27;Rose Pink&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982317.jpg&#x27;, prompt: &#x27;Product placed on a solid rose pink surface, minimalist and clean, top-down studio shot.&#x27; }, { name: &#x27;Light Coral&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982080.jpg&#x27;, prompt: &#x27;Product displayed on a light coral colored background, soft and warm aesthetic, studio product shot.&#x27; }, { name: &#x27;Storage&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509555427.jpg&#x27;, prompt: &#x27;A piece of storage furniture in a well-decorated room, lifestyle shot showing its use and style.&#x27; }, { name: &#x27;Sofa&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509554980.jpg&#x27;, prompt: &#x27;A stylish sofa featured in a modern living room, highlighting its texture and comfort.&#x27; }, { name: &#x27;Pilea&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995995.jpg&#x27;, prompt: &#x27;Product photoshoot with a Pilea plant, creating a green and fresh atmosphere in a minimalist interior.&#x27; }, { name: &#x27;Hoya&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995739.jpg&#x27;, prompt: &#x27;Product displayed next to a beautiful Hoya plant, biophilic design, natural and calming.&#x27; }, { name: &#x27;Ring&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988340.jpg&#x27;, prompt: &#x27;Macro shot of a ring on a luxurious surface, focused on details and sparkle, elegant lighting.&#x27; }, { name: &#x27;Pendant&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988007.jpg&#x27;, prompt: &#x27;An elegant pendant necklace display, soft focus background, highlighting the craftsmanship.&#x27; }, { name: &#x27;Marble Table&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062430.jpg&#x27;, prompt: &#x27;Product photoshoot on a white marble table, luxurious and clean aesthetic, top-down view.&#x27; }, { name: &#x27;Liquid Surface&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062164.jpg&#x27;, prompt: &#x27;Product placed on a surface with realistic liquid ripples, creative and dynamic studio shot.&#x27; }, { name: &#x27;Graffiti&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006896.jpg&#x27;, prompt: &#x27;Product photoshoot against a vibrant graffiti wall, urban and edgy style.&#x27; }, { name: &#x27;Fireworks&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006566.jpg&#x27;, prompt: &#x27;Product displayed with a background of colorful fireworks, celebratory and exciting mood.&#x27; }, { name: &#x27;Berries&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696919338904.jpg&#x27;, prompt: &#x27;A cosmetic or food product surrounded by fresh berries, vibrant and natural.&#x27; }, { name: &#x27;Coffee Beans&#x27;, imageUrl: &#x27;https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842044157.jpg&#x27;, prompt: &#x27;A product surrounded by aromatic roasted coffee beans, warm and rich atmosphere.&#x27; } ]; export const suggestedPrompts = [ &#x27;an object on a marble counter&#x27;, &#x27;an object on water-rippling water&#x27;, &#x27;an object surrounded by rose petals&#x27;, &#x27;an object on a mountain&#x27;, &#x27;an object on a kitchen counter&#x27;, &#x27;an object on a rock&#x27;, &#x27;waterfall in background&#x27;, &#x27;an object on top of a lotus flower&#x27;, &#x27;an object on snowy mountain&#x27;, &#x27;an object with golden light&#x27;, &#x27;an object in the sky&#x27;, &#x27;cloudy sky&#x27; ];</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ content</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ blog</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ data</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ blogArticles.ts</div> <div class="content">export interface BlogArticle { id: string; title: string; excerpt: string; content: string; publishDate: string; readTime: string; category: &#x27;general&#x27; | &#x27;tools&#x27;; featuredImage: string; relatedTool?: string; keywords?: string[]; } // Blog article metadata index - content is now loaded from individual Markdown files export const blogArticleIndex = [ { id: &#x27;free-watermark-remover-easy-ai-tool-for-perfect-results&#x27;, title: &#x27;Free Watermark Remover: Easy AI Tool for Perfect Results&#x27;, excerpt: &#x27;Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds.&#x27;, publishDate: &#x27;2025-11-15&#x27;, readTime: &#x27;12 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;/images/tools images/AI Watermark Remover Tool.jpg&#x27;, relatedTool: &#x27;watermark-remover&#x27;, keywords: [&#x27;watermark remover&#x27;, &#x27;remove watermark&#x27;, &#x27;TikTok watermark&#x27;] }, { id: &#x27;how-to-create-professional-product-photos-with-ai&#x27;, title: &#x27;How to Create Professional Product Photos with AI | Modern Photo Tools&#x27;, excerpt: &#x27;Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills.&#x27;, publishDate: &#x27;2025-10-27&#x27;, readTime: &#x27;14 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg&#x27;, keywords: [&#x27;AI product photography&#x27;, &#x27;product photos&#x27;, &#x27;e-commerce images&#x27;] }, { id: &#x27;remove-people-from-photos-without-photoshop&#x27;, title: &#x27;How to Remove People from Photos Without Photoshop | Modern Tools&#x27;, excerpt: &#x27;Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.&#x27;, publishDate: &#x27;2025-10-14&#x27;, readTime: &#x27;12 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/cc414ba0-93ff-4984-8f71-08d0ce36a003.jpg&#x27;, relatedTool: &#x27;ai-cleanup&#x27; }, { id: &#x27;best-photo-background-editors-2025&#x27;, title: &#x27;10 Best Photo Background Editors for Perfect Images in 2025&#x27;, excerpt: &#x27;Discover the top 10 best photo background editors in 2025. Compare features, pricing, and capabilities of leading tools for perfect image editing results.&#x27;, publishDate: &#x27;2025-10-01&#x27;, readTime: &#x27;18 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg&#x27;, relatedTool: &#x27;remove-background&#x27; }, { id: &#x27;ai-image-enhancement-guide&#x27;, title: &#x27;AI Image Enhancement: Transform Your Photos with AI Technology&#x27;, excerpt: &#x27;Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools\&#x27; AI Image Upscaler for professional-quality results.&#x27;, publishDate: &#x27;2025-03-14&#x27;, readTime: &#x27;16 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg&#x27;, relatedTool: &#x27;ai-image-enhancer&#x27; }, { id: &#x27;studio-ghibli-ai-art-guide&#x27;, title: &#x27;How to Make Studio Ghibli AI Art: Step-by-Step Guide&#x27;, excerpt: &#x27;Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!&#x27;, publishDate: &#x27;2025-04-27&#x27;, readTime: &#x27;8 min read&#x27;, category: &#x27;general&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg&#x27;, relatedTool: &#x27;ai-filter&#x27; }, { id: &#x27;ai-background-generators-2025&#x27;, title: &#x27;Best AI Background Generators in 2025: Top Tools Compared&#x27;, excerpt: &#x27;Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly.&#x27;, publishDate: &#x27;2025-02-19&#x27;, readTime: &#x27;12 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;\images\tools images\AI Background Generator Tool.jpg&#x27;, relatedTool: &#x27;ai-background-generator&#x27; }, { id: &#x27;easter-card-messages-2025&#x27;, title: &#x27;100+ Easter Card Message Ideas in 2025 | Modern PhotoTools&#x27;, excerpt: &#x27;Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs.&#x27;, publishDate: &#x27;2025-05-30&#x27;, readTime: &#x27;18 min read&#x27;, category: &#x27;general&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/43b3a8d0-02da-49a5-91b1-4a27d9f12e48.jpg&#x27; }, { id: &#x27;holi-photoshoot-ideas-2025&#x27;, title: &#x27;15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks&#x27;, excerpt: &#x27;Discover creative Holi photoshoot ideas to capture the festival\&#x27;s vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools.&#x27;, publishDate: &#x27;2025-08-07&#x27;, readTime: &#x27;14 min read&#x27;, category: &#x27;general&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg&#x27; }, { id: &#x27;master-ai-photo-editing-prompts&#x27;, title: &#x27;Master AI Photo Editing Prompts: Create Stunning Images&#x27;, excerpt: &#x27;Learn how to craft perfect AI prompts for photo editing. Discover advanced techniques, tool-specific prompts, and practical examples to transform your images with AI.&#x27;, publishDate: &#x27;2025-10-04&#x27;, readTime: &#x27;15 min read&#x27;, category: &#x27;general&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/eb9f05ad-ab2d-4927-b3f9-b3bc116a084d.jpg&#x27;, relatedTool: &#x27;ai-image-generator&#x27; }, { id: &#x27;nano-banana-ai-image-generator-with-modern-phototools&#x27;, title: &#x27;Nano Banana - AI Image Generator with Modern Phototools&#x27;, excerpt: &#x27;Unleash your creativity with Nano Banana - my AI image generator tool on ModernPhotoTools.com. Easily create stunning visuals with just a few clicks.&#x27;, publishDate: &#x27;2025-10-09&#x27;, readTime: &#x27;8 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg&#x27;, relatedTool: &#x27;ai-image-generator&#x27; }, { id: &#x27;how-to-restore-old-family-photos&#x27;, title: &#x27;How to Restore Old Family Photos: A Step-by-Step AI Guide&#x27;, excerpt: &#x27;Learn how to restore old family photos using AI technology. Step-by-step guide to bring damaged photos back to life with Modern Photo Tools.&#x27;, publishDate: &#x27;2025-10-18&#x27;, readTime: &#x27;12 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg&#x27;, relatedTool: &#x27;ai-image-upscaler&#x27;, keywords: [&#x27;AI photo restoration&#x27;, &#x27;family photos&#x27;, &#x27;photo repair&#x27;, &#x27;digital preservation&#x27;, &#x27;old photos&#x27;] } , { id: &#x27;how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator&#x27;, title: &#x27;How to Test a New Hairstyle with an AI Hairstyle Generator&#x27;, excerpt: &#x27;Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!&#x27;, publishDate: &#x27;nov 5, 2025&#x27;, readTime: &#x27;12 min read&#x27;, category: &#x27;tools&#x27; as const, featuredImage: &#x27;https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp&#x27;, relatedTool: &#x27;ai-hairstyle&#x27;, keywords: [&#x27;ai hairstyle generator&#x27;, &#x27;virtual hairstyle try-on&#x27;, &#x27;test a new hairstyle&#x27;, &#x27;try hairstyles online&#x27;, &#x27;hair color preview&#x27;] } ]; // For backward compatibility, export as blogArticles // Content will be loaded dynamically from Markdown files export const blogArticles = blogArticleIndex; // Helper function to get articles by category export const getArticlesByCategory = (category: &#x27;general&#x27; | &#x27;tools&#x27;) =&gt; { return blogArticleIndex.filter(article =&gt; article.category === category); }; // Helper function to get recent articles export const getRecentArticles = (count: number = 5) =&gt; { return blogArticleIndex .sort((a, b) =&gt; new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()) .slice(0, count); }; // Helper function to get article by ID export const getArticleById = (id: string) =&gt; { return blogArticleIndex.find(article =&gt; article.id === id); }; // Helper function to get previous and next articles for navigation export const getAdjacentArticles = (currentId: string) =&gt; { // Sort articles by publish date (newest first) const sortedArticles = blogArticleIndex .sort((a, b) =&gt; new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()); const currentIndex = sortedArticles.findIndex(article =&gt; article.id === currentId); if (currentIndex === -1) { return { previousArticle: null, nextArticle: null }; } const previousArticle = currentIndex &gt; 0 ? sortedArticles[currentIndex - 1] : null; const nextArticle = currentIndex &lt; sortedArticles.length - 1 ? sortedArticles[currentIndex + 1] : null; return { previousArticle: previousArticle ? { id: previousArticle.id, title: previousArticle.title } : null, nextArticle: nextArticle ? { id: nextArticle.id, title: nextArticle.title } : null }; };</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ tools.ts</div> <div class="content">import type { Tool } from &#x27;../types&#x27;; export const tools: Tool[] = [ { id: &#x27;remove-background&#x27;, name: &#x27;Remove Background&#x27;, description: &#x27;Remove the background from any image with AI precision&#x27;, icon: &#x27;scissors&#x27;, path: &#x27;/tools/remove-background&#x27;, apiEndpoint: &#x27;/api/external/api/v2/remove-background&#x27; }, { id: &#x27;ai-cleanup&#x27;, name: &#x27;AI Cleanup&#x27;, description: &#x27;Clean up imperfections and enhance your photos&#x27;, icon: &#x27;sparkles&#x27;, path: &#x27;/tools/ai-cleanup&#x27;, apiEndpoint: &#x27;/api/external/api/v2/cleanup-picture&#x27; }, { id: &#x27;ai-expand&#x27;, name: &#x27;AI Expand&#x27;, description: &#x27;Expand your images beyond their original boundaries&#x27;, icon: &#x27;maximize&#x27;, path: &#x27;/tools/ai-expand&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-expand&#x27; }, { id: &#x27;ai-replace&#x27;, name: &#x27;AI Replace&#x27;, description: &#x27;Replace objects or areas in your images with AI&#x27;, icon: &#x27;replace-all&#x27;, path: &#x27;/tools/ai-replace&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-replace&#x27; }, { id: &#x27;ai-cartoon&#x27;, name: &#x27;AI Cartoon&#x27;, description: &#x27;Transform photos into cartoon-style artwork&#x27;, icon: &#x27;palette&#x27;, path: &#x27;/tools/ai-cartoon&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-cartoon-generator&#x27; }, { id: &#x27;ai-caricature&#x27;, name: &#x27;AI Caricature&#x27;, description: &#x27;Create fun caricatures from portrait photos&#x27;, icon: &#x27;smile&#x27;, path: &#x27;/tools/ai-caricature&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-caricature-generator&#x27; }, { id: &#x27;ai-avatar&#x27;, name: &#x27;AI Avatar&#x27;, description: &#x27;Generate personalized avatars from your photos&#x27;, icon: &#x27;user&#x27;, path: &#x27;/tools/ai-avatar&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-avatar&#x27; }, { id: &#x27;ai-product-photoshoot&#x27;, name: &#x27;AI Product Photoshoot&#x27;, description: &#x27;Create professional product photos with AI&#x27;, icon: &#x27;shopping-bag&#x27;, path: &#x27;/tools/ai-product-photoshoot&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-product-photoshoot&#x27; }, { id: &#x27;ai-background-generator&#x27;, name: &#x27;AI Background Generator&#x27;, description: &#x27;Generate custom backgrounds for your images&#x27;, icon: &#x27;image&#x27;, path: &#x27;/tools/ai-background-generator&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-background-generator&#x27; }, { id: &#x27;ai-image-generator&#x27;, name: &#x27;AI Image Generator&#x27;, description: &#x27;Generate unique images from text descriptions&#x27;, icon: &#x27;bot&#x27;, path: &#x27;/tools/ai-image-generator&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-image-generator&#x27; }, { id: &#x27;ai-portrait&#x27;, name: &#x27;AI Portrait&#x27;, description: &#x27;Create professional portrait photos with AI enhancement&#x27;, icon: &#x27;user-check&#x27;, path: &#x27;/tools/ai-portrait&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-portrait&#x27; }, { id: &#x27;ai-face-swap&#x27;, name: &#x27;AI Face Swap&#x27;, description: &#x27;Swap faces between images with AI precision&#x27;, icon: &#x27;refresh-cw&#x27;, path: &#x27;/tools/ai-face-swap&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-face-swap&#x27; }, { id: &#x27;ai-outfit&#x27;, name: &#x27;AI Outfit&#x27;, description: &#x27;Change outfits in photos with AI technology&#x27;, icon: &#x27;shirt&#x27;, path: &#x27;/tools/ai-outfit&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-outfit&#x27; }, { id: &#x27;ai-image-to-image&#x27;, name: &#x27;AI Image to Image&#x27;, description: &#x27;Transform images with AI style transfer&#x27;, icon: &#x27;image-plus&#x27;, path: &#x27;/tools/ai-image-to-image&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-image-to-image&#x27; }, { id: &#x27;ai-sketch-to-image&#x27;, name: &#x27;AI Sketch to Image&#x27;, description: &#x27;Convert sketches into detailed images&#x27;, icon: &#x27;pencil&#x27;, path: &#x27;/tools/ai-sketch-to-image&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-sketch-to-image&#x27; }, { id: &#x27;ai-hairstyle&#x27;, name: &#x27;AI Hairstyle&#x27;, description: &#x27;Try different hairstyles with AI visualization&#x27;, icon: &#x27;scissors&#x27;, path: &#x27;/tools/ai-hairstyle&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-hairstyle&#x27; }, { id: &#x27;ai-image-upscaler&#x27;, name: &#x27;AI Image Upscaler&#x27;, description: &#x27;Enhance image resolution without losing quality&#x27;, icon: &#x27;zoom-in&#x27;, path: &#x27;/tools/ai-image-upscaler&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-image-upscaler&#x27; }, { id: &#x27;ai-filter&#x27;, name: &#x27;AI Filter&#x27;, description: &#x27;Apply AI-powered filters to enhance your photos&#x27;, icon: &#x27;sliders&#x27;, path: &#x27;/tools/ai-filter&#x27;, apiEndpoint: &#x27;/api/external/api/v2/ai-filter&#x27; }, { id: &#x27;watermark-remover&#x27;, name: &#x27;Watermark Remover&#x27;, description: &#x27;Automatically detect and remove watermarks, logos, and text overlays&#x27;, icon: &#x27;erase&#x27;, path: &#x27;/tools/watermark-remover&#x27;, apiEndpoint: &#x27;/api/external/api/v2/watermark-remover&#x27; }, ];</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ entry-server.tsx</div> <div class="content">import ReactDOMServer from &#x27;react-dom/server&#x27; import { StaticRouter } from &#x27;react-router-dom/server&#x27; import { HelmetProvider } from &#x27;react-helmet-async&#x27; import App from &#x27;./App&#x27; export function render(url: string, context?: any) { const helmetContext = {} return ReactDOMServer.renderToString( &lt;HelmetProvider context={helmetContext}&gt; &lt;StaticRouter location={url}&gt; &lt;App /&gt; &lt;/StaticRouter&gt; &lt;/HelmetProvider&gt; ) }</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ hooks</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ index.css</div> <div class="content">@tailwind base; @tailwind components; @tailwind utilities; /* Custom styles for article content */ .article-content { max-width: none; } /* Styled container for articles */ .article-content .styled-container { max-width: 1200px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6; color: #333; } .article-content .article-header { text-align: center; margin-bottom: 40px; padding: 40px 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 12px; } .article-content .article-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); } .article-content .article-intro { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; } .article-content .table-of-contents { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin: 30px 0; } .article-content .table-of-contents h2 { color: #495057; font-size: 1.5rem; margin-bottom: 20px; border-bottom: 2px solid #3498db; padding-bottom: 10px; } .article-content .toc-list { list-style: none; padding: 0; margin: 0; } .article-content .toc-list li { margin-bottom: 8px; padding-left: 20px; position: relative; } .article-content .toc-list li:before { content: &quot;โ†’&quot;; position: absolute; left: 0; color: #3498db; font-weight: bold; } .article-content .toc-list a { color: #495057; text-decoration: none; font-weight: 500; transition: color 0.3s ease; } .article-content .toc-list a:hover { color: #3498db; text-decoration: underline; } .article-content .two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px 0; } @media (max-width: 768px) { .article-content .two-columns { grid-template-columns: 1fr; gap: 20px; } } .article-content .custom-list { list-style: none; padding: 0; } .article-content .custom-list li { position: relative; padding-left: 25px; margin-bottom: 10px; } .article-content .custom-list li:before { content: &quot;โœ“&quot;; position: absolute; left: 0; color: #28a745; font-weight: bold; } .article-content .cta-block { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 30px; border-radius: 12px; text-align: center; margin: 40px 0; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); } .article-content .cta-block-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; } .article-content .cta-block-text { font-size: 1.1rem; margin-bottom: 25px; opacity: 0.95; } .article-content .cta-btn { display: inline-block; background: white; color: #28a745; padding: 15px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .article-content .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); color: #1e7e34; } .article-content .table-container { overflow-x: auto; margin: 30px 0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .article-content .responsive-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; } .article-content .responsive-table thead tr { background-color: #3498db; color: #fff; text-align: left; } .article-content .responsive-table th, .article-content .responsive-table td { padding: 12px 15px; border-bottom: 1px solid #dddddd; overflow-wrap: break-word; text-align: left; vertical-align: top; } .article-content .responsive-table tbody tr { border-bottom: 1px solid #dddddd; background-color: #fff; transition: background-color .3s ease; } .article-content .responsive-table tbody tr:nth-of-type(2n) { background-color: #f8f9fa; } .article-content .responsive-table tbody tr:hover { background-color: #e3f2fd; } .article-content .img-container { margin: 30px 0; text-align: center; } .article-content .responsive-image { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } .article-content .rating-container { display: flex; align-items: center; gap: 15px; margin: 20px 0; } .article-content .rating-stars { position: relative; display: inline-block; font-size: 20px; color: #ddd; } .article-content .rating-stars:before { content: &quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;; position: absolute; top: 0; left: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: #ffc107; } .article-content .rating-stars:after { content: &quot;โ˜…โ˜…โ˜…โ˜…โ˜…&quot;; } .article-content .rating-text { font-weight: 600; color: #495057; } .article-content .pros-cons h3 { font-size: 1.2rem; margin-bottom: 15px; } .article-content .pros, .article-content .cons { list-style: none; padding: 0; } .article-content .pros li, .article-content .cons li { position: relative; padding-left: 25px; margin-bottom: 8px; line-height: 1.5; } .article-content .pros li:before { content: &quot;โœ“&quot;; position: absolute; left: 0; color: #28a745; font-weight: bold; } .article-content .cons li:before { content: &quot;โœ—&quot;; position: absolute; left: 0; color: #dc3545; font-weight: bold; } .article-content .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 30px 0; } .article-content .feature-card { background: white; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; } .article-content .feature-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); } .article-content .feature-card h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: #495057; } .article-content .pricing-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin: 20px 0; } .article-content .pricing-card h4 { font-size: 1.2rem; font-weight: 600; margin-bottom: 15px; color: #495057; } .article-content .pricing-card ul { list-style: none; padding: 0; margin: 0; } .article-content .pricing-card li { padding: 5px 0; border-bottom: 1px solid #dee2e6; } .article-content .pricing-card li:last-child { border-bottom: none; } .article-content .faq-container { margin: 30px 0; } .article-content .faq-item { background: white; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 15px; overflow: hidden; } .article-content .faq-question { background: #f8f9fa; padding: 20px; margin: 0; font-size: 1.1rem; font-weight: 600; color: #495057; border-bottom: 1px solid #e9ecef; } .article-content .faq-answer { padding: 20px; } .article-content .faq-answer p { margin: 0; line-height: 1.6; color: #6c757d; } /* Section styling */ .article-content section { margin: 40px 0; } .article-content section h2 { font-size: 2rem; font-weight: 700; color: #2c3e50; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 3px solid #3498db; } .article-content section h3 { font-size: 1.5rem; font-weight: 600; color: #34495e; margin: 25px 0 15px 0; } .article-content section p { margin-bottom: 15px; line-height: 1.7; color: #555; } /* Rating stars with data attribute */ .article-content .rating-stars[data-rating=&quot;4.9&quot;] { --rating: 4.9; } .article-content .rating-stars[data-rating=&quot;4.8&quot;] { --rating: 4.8; } .article-content .rating-stars[data-rating=&quot;4.7&quot;] { --rating: 4.7; } .article-content .rating-stars[data-rating=&quot;4.6&quot;] { --rating: 4.6; } /* Responsive table mobile styles */ @media (max-width: 768px) { .article-content .responsive-table, .article-content .responsive-table thead, .article-content .responsive-table tbody, .article-content .responsive-table th, .article-content .responsive-table td, .article-content .responsive-table tr { display: block; } .article-content .responsive-table thead tr { position: absolute; top: -9999px; left: -9999px; } .article-content .responsive-table tr { border: 1px solid #ccc; margin-bottom: 10px; padding: 10px; border-radius: 8px; background: white; } .article-content .responsive-table td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50% !important; padding-top: 10px; padding-bottom: 10px; } .article-content .responsive-table td:before { content: attr(data-label) &quot;: &quot;; position: absolute; left: 6px; width: 45%; padding-right: 10px; white-space: nowrap; font-weight: bold; color: #3498db; } } .article-content .rating-stars[data-rating=&quot;4.5&quot;] { --rating: 4.5; } /* Ensure table visibility and proper styling */ .article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; } .article-content table th, .article-content table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; } .article-content table th { background-color: #3498db; color: white; font-weight: 600; } .article-content table tbody tr:nth-child(even) { background-color: #f8f9fa; } .article-content table tbody tr:hover { background-color: #e3f2fd; } /* * BREADCRUMBS * Styles the breadcrumbs to match the example */ .yoast-breadcrumb { padding: 10px 0; font-size: 14px; color: #555; width: 100%; max-width: 1200px; padding-left: 2rem; padding-right: 1rem; } p#breadcrumbs { margin: 0; padding: 0; } p#breadcrumbs span { display: inline-block; } p#breadcrumbs a { color: #007bff; /* Or your site&#x27;s link color */ text-decoration: none; } p#breadcrumbs a:hover { text-decoration: underline; } /* This is the key: style the &lt;b&gt; tag as a separator */ p#breadcrumbs b { margin: 0 8px; color: #777; font-weight: normal; } p#breadcrumbs b::after { content: &#x27;&gt;&#x27;; /* You can change this to &#x27;/&#x27; or &#x27;ยป&#x27; */ } .breadcrumb_last { color: #333; font-weight: 600; } </div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ lib</div> <div class="folder" style="margin-left: 40px;">๐Ÿ“ prompt-frameworks</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ main.tsx</div> <div class="content">import React from &#x27;react&#x27; import ReactDOM from &#x27;react-dom/client&#x27; import { BrowserRouter } from &#x27;react-router-dom&#x27; import { HelmetProvider } from &#x27;react-helmet-async&#x27; import App from &#x27;./App.tsx&#x27; import ScrollToTop from &#x27;./components/layout/ScrollToTop.tsx&#x27; import &#x27;./index.css&#x27; const rootElement = document.getElementById(&#x27;root&#x27;)! // Check if the root element has actual SSG content (not just the placeholder comment) const hasSSGContent = rootElement.innerHTML.trim() &amp;&amp; !rootElement.innerHTML.includes(&#x27;&lt;!--app-html--&gt;&#x27;) &amp;&amp; rootElement.innerHTML !== &#x27;&lt;!--app-html--&gt;&#x27; if (hasSSGContent) { // Hydrate the pre-rendered content ReactDOM.hydrateRoot( rootElement, &lt;React.StrictMode&gt; &lt;HelmetProvider&gt; &lt;BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} &gt; &lt;ScrollToTop /&gt; &lt;App /&gt; &lt;/BrowserRouter&gt; &lt;/HelmetProvider&gt; &lt;/React.StrictMode&gt; ) } else { // Render normally for SPA mode (development or no SSG content) ReactDOM.createRoot(rootElement).render( &lt;React.StrictMode&gt; &lt;HelmetProvider&gt; &lt;BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} &gt; &lt;ScrollToTop /&gt; &lt;App /&gt; &lt;/BrowserRouter&gt; &lt;/HelmetProvider&gt; &lt;/React.StrictMode&gt; ) } </div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ pages</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ AboutPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import Button from &#x27;../components/ui/Button&#x27;; const AboutPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;About Us&quot; description=&quot;Learn about ModernPhotoTools.com, our mission, and how we&#x27;re making professional photo editing accessible to everyone with AI-powered tools.&quot; /&gt; {/* Hero Section */} &lt;section className=&quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;&gt; About &lt;span className=&quot;text-blue-600&quot;&gt;ModernPhotoTools&lt;/span&gt; &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-700 mb-8&quot;&gt; Making professional photo editing accessible to everyone through the power of AI &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Main Content */} &lt;section className=&quot;py-16 bg-white&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;div className=&quot;prose prose-lg max-w-none text-gray-700&quot;&gt; &lt;h2&gt;Our Mission&lt;/h2&gt; &lt;p&gt; At ModernPhotoTools.com, we believe that everyone should have access to professional-quality photo editing tools, regardless of their technical skills or budget. Our mission is to democratize photo editing by leveraging the power of artificial intelligence to make complex editing tasks simple and accessible. &lt;/p&gt; &lt;h2&gt;What We Offer&lt;/h2&gt; &lt;p&gt; We provide a comprehensive suite of AI-powered photo editing tools that can help you transform your images in seconds. From removing backgrounds to generating completely new images with AI, our tools are designed to save you time and effort while delivering professional results. &lt;/p&gt; &lt;p&gt; All our tools are: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Free to use&lt;/strong&gt; - No hidden fees or subscriptions&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Easy to use&lt;/strong&gt; - No technical skills required&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Fast&lt;/strong&gt; - Get results in seconds&lt;/li&gt; &lt;li&gt;&lt;strong&gt;High quality&lt;/strong&gt; - Professional-grade output&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Private&lt;/strong&gt; - We respect your privacy&lt;/li&gt; &lt;/ul&gt; &lt;h2&gt;Why Choose ModernPhotoTools&lt;/h2&gt; &lt;p&gt; In a world where visual content is increasingly important, having access to powerful editing tools can make a significant difference. Whether you&#x27;re a professional photographer, a social media manager, a small business owner, or just someone who wants to enhance their personal photos, our tools can help you achieve your goals without the steep learning curve or high cost of traditional photo editing software. &lt;/p&gt; &lt;h2&gt;Our Technology&lt;/h2&gt; &lt;p&gt; We use cutting-edge AI technology powered to deliver fast and accurate results. Our tools are constantly being improved to ensure that you always have access to the latest advancements in AI-powered photo editing. &lt;/p&gt; &lt;h2&gt;Get Started Today&lt;/h2&gt; &lt;p&gt; Ready to transform your photos? Explore our tools and see what you can create! &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* CTA Section */} &lt;section className=&quot;py-16 bg-blue-600&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold text-white mb-6&quot;&gt; Ready to Transform Your Photos? &lt;/h2&gt; &lt;p className=&quot;text-blue-100 mb-8&quot;&gt; Join thousands of users who enhance their photos with our AI-powered tools every day. &lt;/p&gt; &lt;Link to=&quot;/tools&quot;&gt; &lt;Button size=&quot;lg&quot; variant=&quot;secondary&quot;&gt; Explore Our Tools &lt;/Button&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default AboutPage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ BlogArticlePage.tsx</div> <div class="content">import React, { useState, useEffect } from &#x27;react&#x27;; import { useParams, Link, Navigate } from &#x27;react-router-dom&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import { getBlogArticleById, BlogArticleWithContent } from &#x27;../utils/blogLoader&#x27;; import { getAdjacentArticles } from &#x27;../data/blogArticles&#x27;; import ArticleNavigation from &#x27;../components/ArticleNavigation&#x27;; const BlogArticlePage: React.FC = () =&gt; { const { articleId } = useParams&lt;{ articleId: string }&gt;(); const [article, setArticle] = useState&lt;BlogArticleWithContent | null&gt;(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [redirectTo, setRedirectTo] = useState&lt;string | null&gt;(null); useEffect(() =&gt; { const loadArticle = async () =&gt; { if (!articleId) { setNotFound(true); setLoading(false); return; } // Handle redirect for removed article if (articleId === &#x27;remove-background-free-guide&#x27;) { setRedirectTo(&#x27;/blog/best-photo-background-editors-2025&#x27;); return; } try { const loadedArticle = await getBlogArticleById(articleId); if (loadedArticle) { setArticle(loadedArticle); } else { setNotFound(true); } } catch (error) { console.error(&#x27;Failed to load blog article:&#x27;, error); setNotFound(true); } finally { setLoading(false); } }; loadArticle(); }, [articleId]); if (redirectTo) { return &lt;Navigate to={redirectTo} replace /&gt;; } if (!articleId || notFound) { return &lt;Navigate to=&quot;/blog&quot; replace /&gt;; } if (loading) { return ( &lt;div className=&quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex items-center justify-center&quot;&gt; &lt;div className=&quot;text-center&quot;&gt; &lt;div className=&quot;animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4&quot;&gt;&lt;/div&gt; &lt;p className=&quot;text-gray-600&quot;&gt;Loading article...&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } if (!article) { return &lt;Navigate to=&quot;/blog&quot; replace /&gt;; } // Render HTML content with proper styling const renderContent = (content: string) =&gt; { // Check if content contains HTML tags const hasHtmlTags = /&lt;[^&gt;]+&gt;/.test(content); if (hasHtmlTags) { // Content contains HTML, render it directly with dangerouslySetInnerHTML // but add custom CSS classes for styling return ( &lt;div className=&quot;article-content&quot; dangerouslySetInnerHTML={{ __html: content }} /&gt; ); } // Fallback to markdown-like parsing for plain text content const lines = content.split(&#x27;\n&#x27;); const processedLines = new Set&lt;number&gt;(); return lines.map((line, index) =&gt; { if (processedLines.has(index)) return null; const trimmedLine = line.trim(); // Handle headings if (trimmedLine.startsWith(&#x27;# &#x27;)) return &lt;h1 key={index} className=&quot;text-3xl md:text-4xl font-bold text-gray-900 mb-6 mt-10&quot;&gt;{trimmedLine.substring(2)}&lt;/h1&gt;; if (trimmedLine.startsWith(&#x27;## &#x27;)) return &lt;h2 key={index} className=&quot;text-2xl font-bold text-gray-900 mb-4 mt-8&quot;&gt;{trimmedLine.substring(3)}&lt;/h2&gt;; if (trimmedLine.startsWith(&#x27;### &#x27;)) return &lt;h3 key={index} className=&quot;text-xl font-semibold text-gray-900 mb-3 mt-6&quot;&gt;{trimmedLine.substring(4)}&lt;/h3&gt;; // Handle unordered list items if (trimmedLine.startsWith(&#x27;- &#x27;)) { const listItems = []; for (let j = index; j &lt; lines.length &amp;&amp; lines[j].trim().startsWith(&#x27;- &#x27;); j++) { listItems.push(&lt;li key={j}&gt;{trimmedLine.substring(2)}&lt;/li&gt;); processedLines.add(j); } return &lt;ul key={index} className=&quot;list-disc list-inside space-y-2 mb-4 text-gray-700&quot;&gt;{listItems}&lt;/ul&gt;; } // Handle paragraphs if (trimmedLine.length &gt; 0) { return &lt;p key={index} className=&quot;text-gray-700 mb-4 leading-relaxed&quot;&gt;{trimmedLine}&lt;/p&gt;; } return null; }).filter(Boolean); }; return ( &lt;&gt; &lt;SEO title={article.title} description={article.excerpt} canonicalUrl={`https://modernphototools.com/blog/${articleId}`} ogImage={article.featuredImage} /&gt; &lt;div className=&quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50&quot;&gt; &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; {/* Breadcrumb */} &lt;nav className=&quot;mb-8&quot; aria-label=&quot;Breadcrumb&quot;&gt; &lt;Link to=&quot;/blog&quot; className=&quot;text-blue-600 hover:text-blue-700 font-medium transition-colors duration-300&quot; aria-label=&quot;Go back to blog page&quot; &gt; โ† Back to Blog &lt;/Link&gt; &lt;/nav&gt; {/* Article Header */} &lt;article className=&quot;max-w-4xl mx-auto&quot;&gt; {/* Featured Image */} &lt;div className=&quot;h-64 md:h-80 bg-gray-200 rounded-xl mb-8 relative overflow-hidden&quot;&gt; &lt;img src={article.featuredImage} alt={`Featured image for ${article.title}`} className=&quot;w-full h-full object-cover&quot; /&gt; &lt;div className=&quot;absolute inset-0 bg-black bg-opacity-20&quot;&gt;&lt;/div&gt; &lt;div className=&quot;absolute bottom-6 left-6 right-6&quot;&gt; &lt;span className=&quot;inline-block px-4 py-2 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full mb-4&quot;&gt; {article.category === &#x27;general&#x27; ? &#x27;General&#x27; : &#x27;Tools&#x27;} &lt;/span&gt; &lt;h1 className=&quot;text-2xl md:text-3xl font-bold text-white&quot;&gt; {article.title} &lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; {/* Article Meta */} &lt;div className=&quot;bg-white rounded-xl shadow-lg p-8&quot;&gt; &lt;div className=&quot;flex items-center justify-between mb-8 pb-6 border-b border-gray-200&quot;&gt; &lt;div className=&quot;flex items-center text-sm text-gray-500&quot;&gt; &lt;span&gt;{new Date(article.publishDate).toLocaleDateString(&#x27;en-US&#x27;, { year: &#x27;numeric&#x27;, month: &#x27;long&#x27;, day: &#x27;numeric&#x27; })}&lt;/span&gt; &lt;span className=&quot;mx-2&quot;&gt;โ€ข&lt;/span&gt; &lt;span&gt;{article.readTime}&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;flex items-center space-x-4&quot;&gt; &lt;button className=&quot;text-gray-400 hover:text-blue-600 transition-colors duration-300&quot;&gt; &lt;svg className=&quot;w-5 h-5&quot; fill=&quot;currentColor&quot; viewBox=&quot;0 0 20 20&quot;&gt; &lt;path d=&quot;M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z&quot; /&gt; &lt;/svg&gt; &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Article Content */} &lt;div className=&quot;prose prose-lg max-w-none&quot;&gt; {renderContent(article.content)} &lt;/div&gt; {/* Call to Action */} &lt;div className=&quot;mt-12 pt-8 border-t border-gray-200&quot;&gt; &lt;div className=&quot;bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl p-6&quot;&gt; &lt;h3 className=&quot;text-xl font-bold text-gray-900 mb-3&quot;&gt; Ready to Try Our AI Tools? &lt;/h3&gt; &lt;p className=&quot;text-gray-600 mb-4&quot;&gt; Transform your photos with our powerful AI-powered editing tools. &lt;/p&gt; &lt;Link to=&quot;/tools&quot; className=&quot;inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105&quot; &gt; Explore Tools &lt;svg className=&quot;w-5 h-5 ml-2&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 7l5 5m0 0l-5 5m5-5H6&quot; /&gt; &lt;/svg&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; {/* Article Navigation */} &lt;ArticleNavigation currentArticleId={articleId!} /&gt; &lt;/div&gt; &lt;/article&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; export default BlogArticlePage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ BlogPage.tsx</div> <div class="content">import React, { useState, useEffect } from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import { loadBlogArticles, BlogArticleWithContent } from &#x27;../utils/blogLoader&#x27;; const BlogPage: React.FC = () =&gt; { const [articles, setArticles] = useState&lt;BlogArticleWithContent[]&gt;([]); const [loading, setLoading] = useState(true); useEffect(() =&gt; { const loadArticles = async () =&gt; { try { const loadedArticles = await loadBlogArticles(); setArticles(loadedArticles); } catch (error) { console.error(&#x27;Failed to load blog articles:&#x27;, error); } finally { setLoading(false); } }; loadArticles(); }, []); if (loading) { return ( &lt;div className=&quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex items-center justify-center&quot;&gt; &lt;div className=&quot;text-center&quot;&gt; &lt;div className=&quot;animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4&quot;&gt;&lt;/div&gt; &lt;p className=&quot;text-gray-600&quot;&gt;Loading articles...&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); } return ( &lt;&gt; &lt;SEO title=&quot;Blog&quot; description=&quot;Stay updated with the latest tips, tutorials, and news about AI photo editing and digital image processing.&quot; /&gt; &lt;div className=&quot;min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50&quot;&gt; &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; {/* Hero Section */} &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4&quot;&gt; Blog &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; Discover tips, tutorials, and insights about AI photo editing and digital creativity &lt;/p&gt; &lt;/div&gt; {/* Blog Articles Grid */} &lt;div className=&quot;max-w-6xl mx-auto&quot;&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8&quot;&gt; {articles.map((article) =&gt; ( &lt;Link to={`/blog/${article.id}`} key={article.id} className=&quot;block group&quot; aria-label={`Read article: ${article.title}`} &gt; &lt;article className=&quot;bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden h-full&quot;&gt; {/* Featured Image */} &lt;div className=&quot;h-48 bg-gray-200 relative overflow-hidden&quot;&gt; &lt;img src={article.featuredImage} alt={`Featured image for ${article.title}`} className=&quot;w-full h-full object-cover group-hover:scale-105 transition-transform duration-300&quot; /&gt; &lt;div className=&quot;absolute inset-0 bg-black bg-opacity-20 group-hover:bg-opacity-10 transition-all duration-300&quot;&gt;&lt;/div&gt; &lt;div className=&quot;absolute bottom-4 left-4 right-4&quot;&gt; &lt;span className=&quot;inline-block px-3 py-1 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full&quot;&gt; {article.category === &#x27;general&#x27; ? &#x27;General&#x27; : &#x27;Tools&#x27;} &lt;/span&gt; &lt;/div&gt; &lt;/div&gt; {/* Article Content */} &lt;div className=&quot;p-6 flex flex-col&quot;&gt; &lt;div className=&quot;flex items-center text-sm text-gray-500 mb-3&quot;&gt; &lt;span&gt;{new Date(article.publishDate).toLocaleDateString(&#x27;en-US&#x27;, { year: &#x27;numeric&#x27;, month: &#x27;long&#x27;, day: &#x27;numeric&#x27; })}&lt;/span&gt; &lt;span className=&quot;mx-2&quot;&gt;โ€ข&lt;/span&gt; &lt;span&gt;{article.readTime}&lt;/span&gt; &lt;/div&gt; &lt;h2 className=&quot;text-xl font-bold text-gray-900 mb-3 group-hover:text-blue-600 transition-colors duration-300&quot;&gt; {article.title} &lt;/h2&gt; &lt;p className=&quot;text-gray-600 mb-4 line-clamp-3&quot;&gt; {article.excerpt} &lt;/p&gt; {/* Article Tags */} {article.keywords &amp;&amp; article.keywords.length &gt; 0 &amp;&amp; ( &lt;div className=&quot;mb-4&quot;&gt; &lt;div className=&quot;flex flex-wrap gap-2&quot;&gt; {article.keywords.slice(0, 3).map((keyword, index) =&gt; ( &lt;span key={index} className=&quot;px-2 py-1 bg-blue-50 text-blue-600 text-xs font-medium rounded-md&quot; &gt; {keyword} &lt;/span&gt; ))} &lt;/div&gt; &lt;/div&gt; )} &lt;div className=&quot;mt-auto pt-4&quot;&gt; &lt;div className=&quot;inline-flex items-center text-blue-600 group-hover:text-blue-700 font-medium transition-colors duration-300&quot;&gt; Read More &lt;svg className=&quot;w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform duration-300&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot; &gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M9 5l7 7-7 7&quot; /&gt; &lt;/svg&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/article&gt; &lt;/Link&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Call to Action */} &lt;div className=&quot;text-center mt-16&quot;&gt; &lt;div className=&quot;bg-white rounded-2xl shadow-lg p-8 max-w-2xl mx-auto&quot;&gt; &lt;h3 className=&quot;text-2xl font-bold text-gray-900 mb-4&quot;&gt; Ready to Transform Your Photos? &lt;/h3&gt; &lt;p className=&quot;text-gray-600 mb-6&quot;&gt; Explore our powerful AI-powered photo editing tools and bring your creative vision to life. &lt;/p&gt; &lt;Link to=&quot;/tools&quot; className=&quot;inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105&quot; &gt; Explore Our Tools &lt;svg className=&quot;w-5 h-5 ml-2&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; viewBox=&quot;0 0 24 24&quot;&gt; &lt;path strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; strokeWidth={2} d=&quot;M13 7l5 5m0 0l-5 5m5-5H6&quot; /&gt; &lt;/svg&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; export default BlogPage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ContactPage.tsx</div> <div class="content">import React, { useState } from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { Mail, Send } from &#x27;lucide-react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import Button from &#x27;../components/ui/Button&#x27;; const ContactPage: React.FC = () =&gt; { const [formData, setFormData] = useState({ name: &#x27;&#x27;, email: &#x27;&#x27;, message: &#x27;&#x27; }); const [formStatus, setFormStatus] = useState&lt;{ success: boolean; message: string; submitted: boolean; }&gt;({ success: false, message: &#x27;&#x27;, submitted: false }); const handleChange = (e: React.ChangeEvent&lt;HTMLInputElement | HTMLTextAreaElement&gt;) =&gt; { const { name, value } = e.target; setFormData(prev =&gt; ({ ...prev, [name]: value })); }; const handleSubmit = (e: React.FormEvent) =&gt; { e.preventDefault(); // Validate form if (!formData.name || !formData.email || !formData.message) { setFormStatus({ success: false, message: &#x27;Please fill out all fields.&#x27;, submitted: true }); return; } // Email validation const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { setFormStatus({ success: false, message: &#x27;Please enter a valid email address.&#x27;, submitted: true }); return; } // In a real implementation, you would send the form data to your backend // For now, we&#x27;ll just simulate a successful submission // Simulate API call setTimeout(() =&gt; { setFormStatus({ success: true, message: &#x27;Your message has been sent. We\&#x27;ll get back to you soon!&#x27;, submitted: true }); // Reset form setFormData({ name: &#x27;&#x27;, email: &#x27;&#x27;, message: &#x27;&#x27; }); }, 1000); }; return ( &lt;&gt; &lt;SEO title=&quot;Contact Us&quot; description=&quot;Have questions or feedback? Contact the ModernPhotoTools.com team. We&#x27;re here to help with any inquiries about our AI photo editing tools.&quot; /&gt; &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto&quot;&gt; &lt;div className=&quot;text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-3xl md:text-4xl font-bold text-gray-900 mb-4&quot;&gt; Contact Us &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-600&quot;&gt; Have questions or feedback? We&#x27;d love to hear from you. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-12&quot;&gt; &lt;div&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-900 mb-4&quot;&gt;Get in Touch&lt;/h2&gt; &lt;p className=&quot;text-gray-700 mb-6&quot;&gt; We&#x27;re here to help with any questions or feedback you might have about our tools or services. &lt;/p&gt; &lt;div className=&quot;bg-blue-50 rounded-lg p-6&quot;&gt; &lt;div className=&quot;flex items-start mb-4&quot;&gt; &lt;Mail className=&quot;w-5 h-5 text-blue-600 mr-3 mt-1&quot; /&gt; &lt;div&gt; &lt;h3 className=&quot;text-lg font-medium text-gray-900&quot;&gt;Email Us&lt;/h3&gt; &lt;p className=&quot;text-gray-700&quot;&gt; support@modernphototools.com &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;p className=&quot;text-sm text-gray-600&quot;&gt; We typically respond within 24-48 hours during business days. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-900 mb-4&quot;&gt;Send a Message&lt;/h2&gt; {formStatus.submitted &amp;&amp; ( &lt;div className={`mb-6 p-4 rounded-lg ${formStatus.success ? &#x27;bg-green-50 text-green-800&#x27; : &#x27;bg-red-50 text-red-800&#x27;}`}&gt; {formStatus.message} &lt;/div&gt; )} &lt;form onSubmit={handleSubmit}&gt; &lt;div className=&quot;mb-4&quot;&gt; &lt;label htmlFor=&quot;name&quot; className=&quot;block text-gray-700 font-medium mb-1&quot;&gt; Your Name &lt;/label&gt; &lt;input type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot; value={formData.name} onChange={handleChange} className=&quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; placeholder=&quot;John Doe&quot; /&gt; &lt;/div&gt; &lt;div className=&quot;mb-4&quot;&gt; &lt;label htmlFor=&quot;email&quot; className=&quot;block text-gray-700 font-medium mb-1&quot;&gt; Your Email &lt;/label&gt; &lt;input type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; value={formData.email} onChange={handleChange} className=&quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; placeholder=&quot;john.doe@example.com&quot; /&gt; &lt;/div&gt; &lt;div className=&quot;mb-6&quot;&gt; &lt;label htmlFor=&quot;message&quot; className=&quot;block text-gray-700 font-medium mb-1&quot;&gt; Your Message &lt;/label&gt; &lt;textarea id=&quot;message&quot; name=&quot;message&quot; value={formData.message} onChange={handleChange} rows={5} className=&quot;w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; placeholder=&quot;How can we help you?&quot; /&gt; &lt;/div&gt; &lt;Button type=&quot;submit&quot; fullWidth leftIcon={&lt;Send size={18} /&gt;} &gt; Send Message &lt;/Button&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;mt-12 p-6 bg-gray-50 rounded-lg&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold text-gray-900 mb-4&quot;&gt;Privacy Notice&lt;/h2&gt; &lt;p className=&quot;text-gray-700 text-sm&quot;&gt; By submitting this form, you agree to our &lt;Link to=&quot;/privacy-policy&quot; className=&quot;text-blue-600 hover:underline&quot;&gt;Privacy Policy&lt;/Link&gt;. We collect and process your personal data only for the purpose of responding to your inquiry. Your information will not be shared with third parties without your consent. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; export default ContactPage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ CookiesPolicyPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; const CookiesPolicyPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;Cookies Policy&quot; description=&quot;Learn about how ModernPhotoTools.com uses cookies to enhance your browsing experience and improve our services.&quot; /&gt; &lt;section className=&quot;bg-white text-gray-800 py-16 px-4 md:px-6 lg:px-8&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;h1 className=&quot;text-3xl md:text-4xl font-extrabold text-gray-900 mb-8&quot;&gt; Cookies Policy &lt;/h1&gt; &lt;div className=&quot;prose prose-lg prose-gray max-w-none&quot;&gt; &lt;p&gt; This Cookies Policy explains how ModernPhotoTools.com (&quot;we&quot;, &quot;us&quot;, or &quot;our&quot;) uses cookies and similar technologies when you visit our website. It explains what these technologies are and why we use them, as well as your rights to control our use of them. &lt;/p&gt; &lt;hr className=&quot;my-10 border-gray-200&quot; /&gt; &lt;h2&gt;What Are Cookies?&lt;/h2&gt; &lt;p&gt; Cookies are small data files that are placed on your computer or mobile device when you visit a website. Cookies are widely used by website owners to make their websites work, or to work more efficiently, as well as to provide reporting information. &lt;/p&gt; &lt;h2&gt;Why Do We Use Cookies?&lt;/h2&gt; &lt;p&gt; We use cookies for several reasons. Some cookies are required for technical reasons in order for our website to operate, and we refer to these as &quot;essential&quot; or &quot;strictly necessary&quot; cookies. Other cookies enable us to track and target the interests of our users to enhance the experience on our website. &lt;/p&gt; &lt;h2&gt;Types of Cookies We Use&lt;/h2&gt; &lt;h3&gt;Essential Cookies&lt;/h3&gt; &lt;p&gt; These cookies are strictly necessary to provide you with services available through our website and to use some of its features, such as access to secure areas. Because these cookies are strictly necessary to deliver the website, you cannot refuse them without impacting how our site functions. &lt;/p&gt; &lt;h3&gt;Performance and Analytics Cookies&lt;/h3&gt; &lt;p&gt; These cookies collect information about how visitors use our website, for instance which pages visitors go to most often, and if they get error messages from web pages. These cookies don&#x27;t collect information that identifies a visitor. All information these cookies collect is aggregated and therefore anonymous. &lt;/p&gt; &lt;h3&gt;Functionality Cookies&lt;/h3&gt; &lt;p&gt; These cookies allow our website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features. These cookies can also be used to remember changes you have made to text size, fonts, and other parts of web pages that you can customize. &lt;/p&gt; &lt;h3&gt;Targeting and Advertising Cookies&lt;/h3&gt; &lt;p&gt; These cookies are used to deliver adverts more relevant to you and your interests. They are also used to limit the number of times you see an advertisement as well as help measure the effectiveness of the advertising campaign. &lt;/p&gt; &lt;h2&gt;Third-Party Cookies&lt;/h2&gt; &lt;p&gt; In addition to our own cookies, we may also use various third-party cookies to report usage statistics of the service, deliver advertisements on and through the service, and so on. These third-party cookies are governed by the respective privacy policies of the third parties providing them. &lt;/p&gt; &lt;h2&gt;How Can You Control Cookies?&lt;/h2&gt; &lt;p&gt; You have the right to decide whether to accept or reject cookies. You can exercise your cookie preferences by clicking on the appropriate opt-out links provided in the cookie banner when you first visit our website. &lt;/p&gt; &lt;p&gt; You can also set or amend your web browser controls to accept or refuse cookies. If you choose to reject cookies, you may still use our website though your access to some functionality and areas of our website may be restricted. &lt;/p&gt; &lt;h3&gt;Browser Controls&lt;/h3&gt; &lt;p&gt; Most web browsers allow you to control cookies through their settings preferences. However, if you limit the ability of websites to set cookies, you may worsen your overall user experience, since it will no longer be personalized to you. &lt;/p&gt; &lt;h2&gt;Cookie Retention&lt;/h2&gt; &lt;p&gt;Cookies set by us will be retained for different periods depending on their purpose:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Session cookies:&lt;/strong&gt; Temporary and deleted when you close your browser.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Persistent cookies:&lt;/strong&gt; Remain on your device for a set period or until you delete them.&lt;/li&gt; &lt;/ul&gt; &lt;h2&gt;Updates to This Policy&lt;/h2&gt; &lt;p&gt; We may update this Cookies Policy from time to time in order to reflect changes to the cookies we use or for other operational, legal, or regulatory reasons. Please revisit this policy regularly to stay informed about our use of cookies. &lt;/p&gt; &lt;h2&gt;Contact Us&lt;/h2&gt; &lt;p&gt; If you have any questions about our use of cookies or other technologies, please contact us through our &lt;a href=&quot;/contact&quot;&gt;contact page&lt;/a&gt;. &lt;/p&gt; &lt;p className=&quot;text-sm text-gray-500 mt-10&quot;&gt; &lt;strong&gt;Last updated:&lt;/strong&gt; {new Date().toLocaleDateString()} &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default CookiesPolicyPage; </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ DMCAPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; const DMCAPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;DMCA Notice&quot; description=&quot;Digital Millennium Copyright Act (DMCA) notice and takedown policy for ModernPhotoTools.com.&quot; /&gt; {/* Hero Section */} &lt;section className=&quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;&gt; &lt;span className=&quot;text-blue-600&quot;&gt;DMCA&lt;/span&gt; Notice &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-700 mb-8&quot;&gt; Our copyright policy and takedown procedures in accordance with the Digital Millennium Copyright Act (DMCA). &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Main Content */} &lt;section className=&quot;py-16 bg-white&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;div className=&quot;prose prose-lg max-w-none text-gray-700&quot;&gt; &lt;h2&gt;DMCA Policy Overview&lt;/h2&gt; &lt;p&gt; At &lt;strong&gt;ModernPhotoTools.com&lt;/strong&gt;, we respect the intellectual property rights of others and expect our users to do the same. This DMCA Policy outlines how we respond to copyright infringement notifications in compliance with the &lt;em&gt;Digital Millennium Copyright Act&lt;/em&gt; (DMCA). &lt;/p&gt; &lt;h2&gt;Submitting a DMCA Takedown Notice&lt;/h2&gt; &lt;p&gt; If you believe that material on our website infringes your copyright, please submit a written notification including: &lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Identification&lt;/strong&gt; of the copyrighted work.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Identification&lt;/strong&gt; of the allegedly infringing material with enough detail for us to locate it.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Your contact information&lt;/strong&gt;: name, address, phone number, and email.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Statement&lt;/strong&gt; that you have a good faith belief the use is unauthorized.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Statement&lt;/strong&gt; that the notice is accurate and you are authorized to act on behalf of the copyright owner.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Your physical or electronic signature&lt;/strong&gt; (typing your full name suffices).&lt;/li&gt; &lt;/ol&gt; &lt;p&gt; Send your takedown notice via our &lt;a href=&quot;/contact&quot; className=&quot;text-blue-600 underline&quot;&gt;Contact Page&lt;/a&gt; and include &quot;DMCA Takedown Notice&quot; in the subject line. &lt;/p&gt; &lt;h2&gt;Submitting a Counter-Notification&lt;/h2&gt; &lt;p&gt; If you believe your content was removed by mistake or misidentification, you may submit a counter-notice containing: &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Your physical or electronic signature.&lt;/li&gt; &lt;li&gt;Identification of the removed material and its location prior to removal.&lt;/li&gt; &lt;li&gt;A good faith statement under penalty of perjury that the removal was in error.&lt;/li&gt; &lt;li&gt;Your name, address, phone number, and consent to the jurisdiction of the relevant U.S. Federal District Court.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt; Counter-notices should also be submitted via our &lt;a href=&quot;/contact&quot; className=&quot;text-blue-600 underline&quot;&gt;Contact Page&lt;/a&gt; with &quot;DMCA Counter Notice&quot; in the subject. &lt;/p&gt; &lt;h2&gt;Repeat Infringers&lt;/h2&gt; &lt;p&gt; We may terminate accounts or restrict access for users who repeatedly violate copyright policies. &lt;/p&gt; &lt;h2&gt;False Claims Warning&lt;/h2&gt; &lt;p&gt; Under Section 512(f) of the DMCA, anyone who knowingly submits false claims may be liable for damages, including costs and attorneyโ€™s fees. &lt;/p&gt; &lt;h2&gt;No Legal Advice&lt;/h2&gt; &lt;p&gt; This DMCA page is provided for informational purposes only and does not constitute legal advice. Please consult a qualified attorney for legal guidance. &lt;/p&gt; &lt;h2&gt;Contact Information&lt;/h2&gt; &lt;p&gt; For DMCA-related issues, please reach out via our &lt;a href=&quot;/contact&quot; className=&quot;text-blue-600 underline&quot;&gt;Contact Page&lt;/a&gt; with &quot;DMCA&quot; in the subject line. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default DMCAPage; </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ HomePage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { ArrowRight } from &#x27;lucide-react&#x27;; import Button from &#x27;../components/ui/Button&#x27;; import VideoToolCard from &#x27;../components/ui/VideoToolCard&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import PromptsGuide from &#x27;../components/ui/PromptsGuide&#x27;; import { tools } from &#x27;../data/tools&#x27;; import { getVideoUrl } from &#x27;../utils/videoMapping&#x27;; import &#x27;../styles/video-tool-card.css&#x27;; const HomePage: React.FC = () =&gt; { // Define the 6 specific popular tools as requested const popularToolNames = [ &#x27;Remove Background&#x27;, &#x27;AI Cleanup&#x27;, &#x27;Watermark Remover&#x27;, &#x27;AI Replace&#x27;, &#x27;AI Portrait&#x27;, &#x27;AI Image Upscaler&#x27; ]; // Filter tools to get only the specified popular tools const featuredTools = tools.filter(tool =&gt; popularToolNames.includes(tool.name) ).slice(0, 6); return ( &lt;&gt; &lt;SEO /&gt; {/* Hero Section */} &lt;section className=&quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;&gt; Professional Photo Editing Tools, &lt;span className=&quot;text-blue-600&quot;&gt;Powered by AI&lt;/span&gt; &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-700 mb-8&quot;&gt; Transform your photos with our free, powerful AI-powered editing tools. No design skills required. &lt;/p&gt; &lt;div className=&quot;flex flex-col sm:flex-row justify-center gap-4&quot;&gt; &lt;Link to=&quot;/tools&quot;&gt; &lt;Button size=&quot;lg&quot; rightIcon={&lt;ArrowRight size={20} /&gt;}&gt; Explore All Tools &lt;/Button&gt; &lt;/Link&gt; &lt;Link to=&quot;/tools/ai-image-generator&quot;&gt; &lt;Button size=&quot;lg&quot; variant=&quot;outline&quot;&gt; AI Image Generator &lt;/Button&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Featured Tools Section */} &lt;section className=&quot;py-16 bg-white px-[10%]&quot;&gt; &lt;div className=&quot;w-full mx-auto&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center mb-12&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold text-gray-900 mb-4&quot;&gt; Our Popular Photo Editing Tools &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Discover our most popular AI-powered tools to enhance your photos in seconds. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;row row-cols-1 row-cols-sm-2 row-cols-md-3&quot;&gt; {featuredTools.map((tool) =&gt; ( &lt;div key={tool.id} className=&quot;col mt-10 px-3 apiSectionBox&quot;&gt; &lt;VideoToolCard tool={tool} videoUrl={getVideoUrl(tool.name)} /&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;div className=&quot;text-center mt-12&quot;&gt; &lt;Link to=&quot;/tools&quot;&gt; &lt;Button variant=&quot;outline&quot; rightIcon={&lt;ArrowRight size={18} /&gt;}&gt; View All Tools &lt;/Button&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* How It Works Section */} &lt;section className=&quot;py-16 bg-gray-50&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center mb-12&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold text-gray-900 mb-4&quot;&gt; How It Works &lt;/h2&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Edit your photos in three simple steps &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-3 gap-8&quot;&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;1&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Upload Your Image&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Select or drag and drop the image you want to edit. We support JPEG, PNG, and WebP formats. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;2&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Apply AI Magic&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Our AI automatically processes your image with the selected tool. No manual editing required. &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;bg-white p-6 rounded-lg shadow-md text-center&quot;&gt; &lt;div className=&quot;w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4&quot;&gt; &lt;span className=&quot;text-blue-600 font-bold&quot;&gt;3&lt;/span&gt; &lt;/div&gt; &lt;h3 className=&quot;text-xl font-semibold text-gray-900 mb-2&quot;&gt;Download Result&lt;/h3&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Download your professionally edited image and use it anywhere you want. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Prompts Guide Section */} &lt;PromptsGuide /&gt; {/* CTA Section */} &lt;section className=&quot;py-16 bg-blue-600&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h2 className=&quot;text-3xl font-bold text-white mb-6&quot;&gt; Start Editing Your Photos Today &lt;/h2&gt; &lt;p className=&quot;text-blue-100 mb-8&quot;&gt; Join thousands of users who transform their photos with our AI-powered tools every day. &lt;/p&gt; &lt;Link to=&quot;/tools&quot;&gt; &lt;Button size=&quot;lg&quot; variant=&quot;secondary&quot;&gt; Get Started Now &lt;/Button&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default HomePage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ NotFoundPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import { Link } from &#x27;react-router-dom&#x27;; import { Home, Search } from &#x27;lucide-react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import Button from &#x27;../components/ui/Button&#x27;; const NotFoundPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;Page Not Found&quot; description=&quot;Sorry, the page you are looking for could not be found.&quot; /&gt; &lt;div className=&quot;min-h-[60vh] flex items-center&quot;&gt; &lt;div className=&quot;container mx-auto px-4 py-12 text-center&quot;&gt; &lt;h1 className=&quot;text-6xl font-bold text-gray-900 mb-4&quot;&gt;404&lt;/h1&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-800 mb-6&quot;&gt;Page Not Found&lt;/h2&gt; &lt;p className=&quot;text-gray-600 max-w-md mx-auto mb-8&quot;&gt; Sorry, the page you are looking for doesn&#x27;t exist or has been moved. &lt;/p&gt; &lt;div className=&quot;flex flex-col sm:flex-row justify-center gap-4&quot;&gt; &lt;Link to=&quot;/&quot;&gt; &lt;Button leftIcon={&lt;Home size={18} /&gt;}&gt; Back to Home &lt;/Button&gt; &lt;/Link&gt; &lt;Link to=&quot;/tools&quot;&gt; &lt;Button variant=&quot;outline&quot; leftIcon={&lt;Search size={18} /&gt;}&gt; Explore Tools &lt;/Button&gt; &lt;/Link&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; export default NotFoundPage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ PrivacyPolicyPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; const PrivacyPolicyPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;Privacy Policy&quot; description=&quot;Learn how ModernPhotoTools.com protects your privacy and handles your data when you use our AI photo editing tools.&quot; /&gt; {/* Hero Section */} &lt;section className=&quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;&gt; Privacy &lt;span className=&quot;text-blue-600&quot;&gt;Policy&lt;/span&gt; &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-700 mb-8&quot;&gt; Learn how we protect your privacy and handle your data when you use our AI photo editing tools &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Main Content */} &lt;section className=&quot;py-16 bg-white&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;div className=&quot;prose prose-lg max-w-none text-gray-700&quot;&gt; &lt;p className=&quot;text-sm text-gray-500 mb-8&quot;&gt; Last updated: {new Date().toLocaleDateString()} &lt;/p&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Introduction&lt;/h2&gt; &lt;p&gt; At &lt;strong&gt;ModernPhotoTools.com&lt;/strong&gt;, your privacy is important to us. This Privacy Policy outlines how we collect, use, and protect your information when using our website and AI-powered photo editing tools. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Information We Collect&lt;/h2&gt; &lt;h3 className=&quot;text-xl font-medium mt-4 mb-1&quot;&gt;๐Ÿ“ท Images &amp; Files&lt;/h3&gt; &lt;p&gt; When you use our tools (e.g., background remover, blurring, resizing), your uploaded images are processed securely on our servers. We do &lt;strong&gt;not store&lt;/strong&gt; your images permanently โ€” they are &lt;strong&gt;deleted automatically&lt;/strong&gt; after processing. &lt;/p&gt; &lt;h3 className=&quot;text-xl font-medium mt-4 mb-1&quot;&gt;๐Ÿ“Š Usage Data&lt;/h3&gt; &lt;p&gt;We may collect anonymous usage data such as:&lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Pages visited and time spent&lt;/li&gt; &lt;li&gt;Tools used and frequency&lt;/li&gt; &lt;li&gt;Browser type and device details&lt;/li&gt; &lt;li&gt;IP address and general location&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;How We Use Your Information&lt;/h2&gt; &lt;p&gt;The data we collect helps us to:&lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Deliver fast and accurate photo editing via AI&lt;/li&gt; &lt;li&gt;Improve tool performance and user experience&lt;/li&gt; &lt;li&gt;Analyze anonymous usage patterns&lt;/li&gt; &lt;li&gt;Maintain website security and stability&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿ” Data Security&lt;/h2&gt; &lt;p&gt;We prioritize the safety of your data through:&lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Encrypted connections (SSL/TLS)&lt;/li&gt; &lt;li&gt;Immediate deletion of uploaded images&lt;/li&gt; &lt;li&gt;No permanent image storage&lt;/li&gt; &lt;li&gt;Restricted, monitored server access&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿช Cookies&lt;/h2&gt; &lt;p&gt; We may use cookies to enhance your browsing experience. You can manage your cookie preferences in your browser settings. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿ›ก๏ธ Your Rights&lt;/h2&gt; &lt;p&gt;You have the right to:&lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Know what data we collect&lt;/li&gt; &lt;li&gt;Request deletion of your data&lt;/li&gt; &lt;li&gt;Opt-out of certain data collection&lt;/li&gt; &lt;li&gt;Contact us regarding privacy concerns&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿ“ฌ Contact Us&lt;/h2&gt; &lt;p&gt; For any privacy-related inquiries, please reach out to us through the &lt;a href=&quot;/contact&quot; className=&quot;text-blue-600 hover:underline&quot;&gt;contact page&lt;/a&gt;. &lt;/p&gt; &lt;/section&gt; &lt;section&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿ”„ Updates to This Policy&lt;/h2&gt; &lt;p&gt; This policy may be updated occasionally. Changes will be reflected on this page along with the latest revision date. &lt;/p&gt; &lt;/section&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default PrivacyPolicyPage; </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ PromptGeneratorPage.tsx</div> <div class="content">import React, { useEffect, useMemo, useState } from &#x27;react&#x27; import { Info, Clipboard, Check, RefreshCw } from &#x27;lucide-react&#x27; import SEO from &#x27;../components/ui/SEO&#x27; import Button from &#x27;../components/ui/Button&#x27; import { analyzePrompt, TOOLTIPS, generateStructuredPrompt, getRecentPrompts, saveRecentPrompt, type Framework } from &#x27;../utils/promptEngine&#x27; import { getAIProvider } from &#x27;../utils/aiProviders&#x27; import { composeMicroFromBase, type MicroFields } from &#x27;../utils/microComposer&#x27; import { validateMicro, optimizeMicro } from &#x27;../utils/quality&#x27; type FieldDef = { id: string; label: string; type: &#x27;text&#x27; | &#x27;select&#x27; | &#x27;checkbox&#x27;; options?: string[] } const ICDF_FIELDS: FieldDef[] = [ { id: &#x27;Instruction&#x27;, label: &#x27;Instruction&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Context&#x27;, label: &#x27;Context&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Data&#x27;, label: &#x27;Data&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Format&#x27;, label: &#x27;Format&#x27;, type: &#x27;text&#x27; } ] const RCREOC_FIELDS: FieldDef[] = [ { id: &#x27;Role&#x27;, label: &#x27;Role&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Context&#x27;, label: &#x27;Context&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Request&#x27;, label: &#x27;Request&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Examples&#x27;, label: &#x27;Examples&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Output&#x27;, label: &#x27;Output&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Constraints&#x27;, label: &#x27;Constraints&#x27;, type: &#x27;text&#x27; } ] const MICRO_FIELDS: FieldDef[] = [ { id: &#x27;Message&#x27;, label: &#x27;Message&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Intention&#x27;, label: &#x27;Intention&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Context&#x27;, label: &#x27;Context&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Rhythm&#x27;, label: &#x27;Rhythm&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Output&#x27;, label: &#x27;Output&#x27;, type: &#x27;text&#x27; }, { id: &#x27;KeyFeatures&#x27;, label: &#x27;Key Features&#x27;, type: &#x27;text&#x27; } ] const COSTAR_FIELDS: FieldDef[] = [ { id: &#x27;Context&#x27;, label: &#x27;Context&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Offer&#x27;, label: &#x27;Offer&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Style&#x27;, label: &#x27;Style&#x27;, type: &#x27;select&#x27;, options: [&#x27;Simple and warm&#x27;,&#x27;Elegant and minimalist&#x27;,&#x27;Urgent and direct&#x27;,&#x27;Friendly and helpful&#x27;] }, { id: &#x27;Target&#x27;, label: &#x27;Target&#x27;, type: &#x27;text&#x27; }, { id: &#x27;Action&#x27;, label: &#x27;Action&#x27;, type: &#x27;select&#x27;, options: [&#x27;Click Buy&#x27;,&#x27;Sign Up&#x27;,&#x27;Request Demo&#x27;,&#x27;Contact Sales&#x27;] }, { id: &#x27;Result&#x27;, label: &#x27;Result&#x27;, type: &#x27;select&#x27;, options: [&#x27;Boost sales&#x27;,&#x27;Drive signups&#x27;,&#x27;Generate leads&#x27;,&#x27;Increase engagement&#x27;] } ] const EXTRA_FIELDS: FieldDef[] = [ { id: &#x27;KeyFeatures&#x27;, label: &#x27;Key Features&#x27;, type: &#x27;text&#x27; }, { id: &#x27;TechnicalLevel&#x27;, label: &#x27;Technical Level&#x27;, type: &#x27;select&#x27;, options: [&#x27;Basic&#x27;,&#x27;Intermediate&#x27;,&#x27;Advanced&#x27;] }, { id: &#x27;EmotionalAppeal&#x27;, label: &#x27;Emotional Appeal&#x27;, type: &#x27;checkbox&#x27;, options: [&#x27;Innovative&#x27;,&#x27;Reliable&#x27;,&#x27;Premium&#x27;,&#x27;Affordable&#x27;,&#x27;Sustainable&#x27;] } ] function getFields(framework: Framework): FieldDef[] { if (framework === &#x27;ICDF&#x27;) return [...ICDF_FIELDS, ...EXTRA_FIELDS] if (framework === &#x27;RCREOC&#x27;) return [...RCREOC_FIELDS, ...EXTRA_FIELDS] if (framework === &#x27;MICRO&#x27;) return [...MICRO_FIELDS, ...EXTRA_FIELDS] return [...COSTAR_FIELDS, ...EXTRA_FIELDS] } const PromptGeneratorPage: React.FC = () =&gt; { const [basePrompt, setBasePrompt] = useState(&#x27;&#x27;) const [analysisDone, setAnalysisDone] = useState(false) const [selectedFramework, setSelectedFramework] = useState&lt;Framework&gt;(&#x27;MICRO&#x27;) const [frameworkScores, setFrameworkScores] = useState&lt;Record&lt;Framework, number&gt;&gt;({ ICDF: 0, RCREOC: 0, MICRO: 0, COSTAR: 0 }) const [fieldValues, setFieldValues] = useState&lt;Record&lt;string, string | string[]&gt;&gt;({}) const [finalText, setFinalText] = useState(&#x27;&#x27;) const [copied, setCopied] = useState(false) const [recent, setRecent] = useState(getRecentPrompts()) const [aiLoading, setAiLoading] = useState(false) const [aiSuggestions, setAiSuggestions] = useState&lt;MicroFields | null&gt;(null) const [qualityIssues, setQualityIssues] = useState&lt;{ field: string; message: string }[]&gt;([]) const recommendedFrameworks = useMemo(() =&gt; { const maxScore = Math.max(...Object.values(frameworkScores)) if (maxScore === 0) return [&#x27;MICRO&#x27;] return Object.entries(frameworkScores).filter(([, v]) =&gt; v === maxScore).map(([k]) =&gt; k as Framework) }, [frameworkScores]) useEffect(() =&gt; { setRecent(getRecentPrompts()) }, []) const handleAnalyze = () =&gt; { const res = analyzePrompt(basePrompt) setFrameworkScores(res.scores) setSelectedFramework(res.topFrameworks[0]) setAnalysisDone(true) setFinalText(&#x27;&#x27;) if (res.topFrameworks[0] === &#x27;MICRO&#x27;) { const initial = composeMicroFromBase(basePrompt) setAiSuggestions(initial) setFieldValues(initial) } } const handleReset = () =&gt; { setBasePrompt(&#x27;&#x27;) setAnalysisDone(false) setFrameworkScores({ ICDF: 0, RCREOC: 0, MICRO: 0, COSTAR: 0 }) setSelectedFramework(&#x27;MICRO&#x27;) setFieldValues({}) setFinalText(&#x27;&#x27;) setCopied(false) } const fields = useMemo(() =&gt; getFields(selectedFramework), [selectedFramework]) const handleFieldChange = (id: string, value: string | string[]) =&gt; { setFieldValues(prev =&gt; ({ ...prev, [id]: value })) } const handleGenerateFinal = () =&gt; { let fields = fieldValues if (selectedFramework === &#x27;MICRO&#x27;) { const micro: MicroFields = { Message: String(fieldValues[&#x27;Message&#x27;] || &#x27;&#x27;), Intention: String(fieldValues[&#x27;Intention&#x27;] || &#x27;&#x27;), Context: String(fieldValues[&#x27;Context&#x27;] || &#x27;&#x27;), Rhythm: String(fieldValues[&#x27;Rhythm&#x27;] || &#x27;&#x27;), Output: String(fieldValues[&#x27;Output&#x27;] || &#x27;&#x27;), KeyFeatures: String(fieldValues[&#x27;KeyFeatures&#x27;] || &#x27;&#x27;) } const report = validateMicro(micro) setQualityIssues(report.issues.map(i =&gt; ({ field: i.field, message: i.message }))) const optimized = optimizeMicro(micro) fields = optimized as unknown as Record&lt;string, string | string[]&gt; } const result = generateStructuredPrompt(selectedFramework, fields) setFinalText(result.text + &#x27;\n\n&#x27; + `Rationale: ${result.rationale}`) const entry = { id: crypto.randomUUID(), basePrompt, framework: selectedFramework, finalText: result.text, createdAt: Date.now() } saveRecentPrompt(entry) setRecent(getRecentPrompts()) } const handleCopy = async () =&gt; { try { await navigator.clipboard.writeText(finalText) setCopied(true) setTimeout(() =&gt; setCopied(false), 2000) } catch { setCopied(false) } } const handleSuggestAI = async () =&gt; { setAiLoading(true) try { const provider = getAIProvider() const res = await provider.suggest(basePrompt) setAiSuggestions(res.fields) setFieldValues(res.fields as unknown as Record&lt;string, string&gt;) } finally { setAiLoading(false) } } return ( &lt;&gt; &lt;SEO title=&quot;AI Prompt Generator&quot; description=&quot;Turn basic inputs into professional-grade AI prompts using ICDF, RCREOC, MICRO, and COSTAR frameworks.&quot; /&gt; &lt;div className=&quot;min-h-screen bg-gray-50 py-12 px-[10%]&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold text-gray-900 mb-6&quot;&gt;AI Prompt Generator&lt;/h1&gt; &lt;p className=&quot;text-gray-700 mb-8&quot;&gt;Provide a basic idea and generate a structured, professional prompt with targeted questions and best-practice guidance.&lt;/p&gt; &lt;div className=&quot;bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-8&quot; role=&quot;form&quot; aria-labelledby=&quot;base-prompt-label&quot;&gt; &lt;label id=&quot;base-prompt-label&quot; htmlFor=&quot;base-prompt&quot; className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Enter your basic prompt&lt;/label&gt; &lt;textarea id=&quot;base-prompt&quot; value={basePrompt} onChange={e =&gt; setBasePrompt(e.target.value)} className=&quot;w-full h-28 p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; aria-describedby=&quot;base-prompt-help&quot; placeholder=&quot;e.g., Write a product description for wireless earbuds&quot; /&gt; &lt;p id=&quot;base-prompt-help&quot; className=&quot;mt-2 text-sm text-gray-500&quot;&gt;Keep it simple. The tool will ask smart follow-up questions.&lt;/p&gt; &lt;div className=&quot;mt-4 flex flex-wrap gap-3&quot;&gt; &lt;Button onClick={handleAnalyze} aria-label=&quot;Generate your Prompt&quot;&gt;Generate your Prompt&lt;/Button&gt; &lt;Button variant=&quot;outline&quot; onClick={handleReset} aria-label=&quot;Reset inputs&quot;&gt;&lt;RefreshCw className=&quot;w-4 h-4 mr-2&quot; /&gt;Reset&lt;/Button&gt; &lt;Button variant=&quot;outline&quot; onClick={handleSuggestAI} aria-label=&quot;Suggest with AI&quot; disabled={!basePrompt || aiLoading}&gt;{aiLoading ? &#x27;Suggestingโ€ฆ&#x27; : &#x27;Suggest with AI&#x27;}&lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; {analysisDone &amp;&amp; ( &lt;div className=&quot;bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-8&quot; aria-live=&quot;polite&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-900 mb-4&quot;&gt;Recommended Framework&lt;/h2&gt; &lt;div className=&quot;flex flex-wrap gap-2 mb-4&quot;&gt; {([&#x27;ICDF&#x27;,&#x27;RCREOC&#x27;,&#x27;MICRO&#x27;,&#x27;COSTAR&#x27;] as Framework[]).map(fw =&gt; ( &lt;button key={fw} onClick={() =&gt; setSelectedFramework(fw)} className={`px-4 py-2 rounded-md border ${selectedFramework===fw?&#x27;bg-blue-600 text-white border-blue-600&#x27;:&#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27;}`} aria-pressed={selectedFramework===fw} &gt; {fw}{recommendedFrameworks.includes(fw) ? &#x27; โ€ข recommended&#x27; : &#x27;&#x27;} &lt;/button&gt; ))} &lt;/div&gt; &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-6&quot;&gt; {fields.map(field =&gt; ( &lt;div key={field.id}&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-1&quot; htmlFor={`field-${field.id}`}&gt; {field.label} &lt;span className=&quot;inline-flex items-center ml-2 text-gray-500&quot; aria-label=&quot;Tooltip&quot;&gt; &lt;Info className=&quot;w-4 h-4&quot; /&gt; &lt;/span&gt; &lt;/label&gt; {field.type === &#x27;text&#x27; &amp;&amp; ( &lt;input id={`field-${field.id}`} type=&quot;text&quot; className=&quot;w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; value={String(fieldValues[field.id] || &#x27;&#x27;)} onChange={e =&gt; handleFieldChange(field.id, e.target.value)} aria-describedby={`tip-${field.id}`} /&gt; )} {field.type === &#x27;select&#x27; &amp;&amp; ( &lt;select id={`field-${field.id}`} className=&quot;w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; value={String(fieldValues[field.id] || &#x27;&#x27;)} onChange={e =&gt; handleFieldChange(field.id, e.target.value)} aria-describedby={`tip-${field.id}`} &gt; &lt;option value=&quot;&quot;&gt;Select&lt;/option&gt; {(field.options||[]).map(opt =&gt; ( &lt;option key={opt} value={opt}&gt;{opt}&lt;/option&gt; ))} &lt;/select&gt; )} {field.type === &#x27;checkbox&#x27; &amp;&amp; ( &lt;div id={`field-${field.id}`} className=&quot;flex flex-wrap gap-2&quot; aria-describedby={`tip-${field.id}`}&gt; {(field.options||[]).map(opt =&gt; { const current = Array.isArray(fieldValues[field.id]) ? (fieldValues[field.id] as string[]) : [] const checked = current.includes(opt) return ( &lt;label key={opt} className={`inline-flex items-center px-3 py-2 rounded-md border cursor-pointer ${checked?&#x27;bg-blue-50 border-blue-300&#x27;:&#x27;bg-white border-gray-300&#x27;}`}&gt; &lt;input type=&quot;checkbox&quot; className=&quot;mr-2&quot; checked={checked} onChange={e =&gt; { const next = new Set(current) if (e.target.checked) next.add(opt) else next.delete(opt) handleFieldChange(field.id, Array.from(next)) }} aria-label={opt} /&gt; &lt;span&gt;{opt}&lt;/span&gt; &lt;/label&gt; ) })} &lt;/div&gt; )} &lt;p id={`tip-${field.id}`} className=&quot;mt-2 text-xs text-gray-500&quot;&gt;{TOOLTIPS[selectedFramework][field.id as keyof typeof TOOLTIPS[Framework]] || &#x27;&#x27;}&lt;/p&gt; {selectedFramework === &#x27;MICRO&#x27; &amp;&amp; aiSuggestions &amp;&amp; ( &lt;p className=&quot;mt-1 text-xs text-blue-600&quot;&gt;AI suggestion: {String((aiSuggestions as any)[field.id] || &#x27;&#x27;)}&lt;/p&gt; )} {selectedFramework === &#x27;MICRO&#x27; &amp;&amp; qualityIssues.filter(q =&gt; q.field === field.id).length &gt; 0 &amp;&amp; ( &lt;p className=&quot;mt-1 text-xs text-red-600&quot;&gt;{qualityIssues.filter(q =&gt; q.field === field.id).map(q =&gt; q.message).join(&#x27;; &#x27;)}&lt;/p&gt; )} &lt;/div&gt; ))} &lt;/div&gt; &lt;div className=&quot;mt-6&quot;&gt; &lt;Button onClick={handleGenerateFinal}&gt;Build Final Prompt&lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; )} {finalText &amp;&amp; ( &lt;div className=&quot;bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-900 mb-4&quot;&gt;Your Structured Prompt&lt;/h2&gt; &lt;pre className=&quot;whitespace-pre-wrap break-words bg-gray-50 border border-gray-200 rounded-md p-4 text-sm&quot;&gt;{finalText}&lt;/pre&gt; &lt;div className=&quot;mt-4 flex items-center gap-3&quot;&gt; &lt;Button onClick={handleCopy} aria-label=&quot;Copy to Clipboard&quot;&gt;&lt;Clipboard className=&quot;w-4 h-4 mr-2&quot; /&gt;Copy to Clipboard&lt;/Button&gt; {copied &amp;&amp; (&lt;span className=&quot;inline-flex items-center text-green-600&quot;&gt;&lt;Check className=&quot;w-4 h-4 mr-1&quot; /&gt;Copied&lt;/span&gt;)} &lt;/div&gt; &lt;/div&gt; )} &lt;div className=&quot;bg-white rounded-xl shadow-sm border border-gray-200 p-6&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold text-gray-900 mb-4&quot;&gt;Recent Prompts&lt;/h2&gt; {recent.length === 0 ? ( &lt;p className=&quot;text-gray-600&quot;&gt;No recent prompts yet.&lt;/p&gt; ) : ( &lt;ul className=&quot;space-y-3&quot;&gt; {recent.map(item =&gt; ( &lt;li key={item.id} className=&quot;p-3 border border-gray-200 rounded-md&quot;&gt; &lt;div className=&quot;flex flex-col md:flex-row md:items-center md:justify-between gap-2&quot;&gt; &lt;div&gt; &lt;p className=&quot;text-sm text-gray-500&quot;&gt;{new Date(item.createdAt).toLocaleString()} โ€ข {item.framework}&lt;/p&gt; &lt;p className=&quot;text-gray-800&quot;&gt;{item.basePrompt}&lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;flex gap-2&quot;&gt; &lt;Button variant=&quot;outline&quot; onClick={() =&gt; setBasePrompt(item.basePrompt)}&gt;Use as Base&lt;/Button&gt; &lt;Button variant=&quot;outline&quot; onClick={() =&gt; { setFinalText(item.finalText); setAnalysisDone(true); setSelectedFramework(item.framework) }}&gt;Load Output&lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; ))} &lt;/ul&gt; )} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ) } export default PromptGeneratorPage</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ TermsOfUsePage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; const TermsOfUsePage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;Terms of Use&quot; description=&quot;Read the terms and conditions for using ModernPhotoTools.com and our AI-powered photo editing services.&quot; /&gt; {/* Hero Section */} &lt;section className=&quot;bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center&quot;&gt; &lt;h1 className=&quot;text-4xl md:text-5xl font-bold text-gray-900 mb-6&quot;&gt; Terms of &lt;span className=&quot;text-blue-600&quot;&gt;Use&lt;/span&gt; &lt;/h1&gt; &lt;p className=&quot;text-xl text-gray-700 mb-8&quot;&gt; Read the terms and conditions for using our AI-powered photo editing services. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; {/* Main Content */} &lt;section className=&quot;py-16 bg-white&quot;&gt; &lt;div className=&quot;container mx-auto px-4&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;div className=&quot;prose prose-lg max-w-none text-gray-700&quot;&gt; &lt;p className=&quot;text-sm text-gray-500 mb-8&quot;&gt; Last updated: {new Date().toLocaleDateString()} &lt;/p&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Acceptance of Terms&lt;/h2&gt; &lt;p&gt; By accessing and using &lt;strong&gt;ModernPhotoTools.com&lt;/strong&gt;, you accept and agree to be bound by the terms and conditions outlined below. If you do not agree, please do not use our services. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Use License&lt;/h2&gt; &lt;p&gt; You are granted a temporary, non-exclusive license to use ModernPhotoTools.com for personal, non-commercial purposes only. Under this license, you may not: &lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Modify or copy the materials&lt;/li&gt; &lt;li&gt;Use the materials for commercial purposes or public display&lt;/li&gt; &lt;li&gt;Attempt to reverse-engineer any software on the site&lt;/li&gt; &lt;li&gt;Remove copyright or proprietary notations&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Acceptable Use&lt;/h2&gt; &lt;p&gt;You agree to use our platform lawfully. You must not:&lt;/p&gt; &lt;ul className=&quot;list-disc list-inside ml-4&quot;&gt; &lt;li&gt;Upload copyrighted or infringing materials&lt;/li&gt; &lt;li&gt;Submit offensive, illegal, or harmful content&lt;/li&gt; &lt;li&gt;Use services for deepfakes or deceptive media&lt;/li&gt; &lt;li&gt;Disrupt our servers or services&lt;/li&gt; &lt;li&gt;Use bots or automation without permission&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Content Ownership&lt;/h2&gt; &lt;p&gt; You retain full ownership of any images you upload. We do not claim rights over your content. By using our tools, you grant us a temporary license to process your content securely and privately. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Service Availability&lt;/h2&gt; &lt;p&gt; While we aim for high availability, we do not guarantee uninterrupted access. Downtime may occur due to maintenance or unforeseen technical issues. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Disclaimer&lt;/h2&gt; &lt;p&gt; All materials and tools are provided &quot;as is&quot;. We disclaim all warrantiesโ€”express or impliedโ€”including but not limited to merchantability, fitness for a particular purpose, or non-infringement. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Limitations&lt;/h2&gt; &lt;p&gt; In no event shall ModernPhotoTools.com or its affiliates be liable for any indirect or consequential damages, including data loss or business interruption, even if notified of such possibility. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Privacy Policy&lt;/h2&gt; &lt;p&gt; Your use of our services is also governed by our &lt;a href=&quot;/privacy-policy&quot; className=&quot;text-blue-600 hover:underline&quot;&gt;Privacy Policy&lt;/a&gt;. Please review it to understand how we handle your data. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Modifications&lt;/h2&gt; &lt;p&gt; We may update these Terms of Use at any time without notice. Continued use of our website indicates your acceptance of the most recent version. &lt;/p&gt; &lt;/section&gt; &lt;section className=&quot;mb-8&quot;&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;Governing Law&lt;/h2&gt; &lt;p&gt; These terms shall be governed by and interpreted in accordance with the laws applicable in your jurisdiction. Any legal disputes shall be resolved under these laws. &lt;/p&gt; &lt;/section&gt; &lt;section&gt; &lt;h2 className=&quot;text-2xl font-semibold mb-2&quot;&gt;๐Ÿ“ฌ Contact Us&lt;/h2&gt; &lt;p&gt; If you have any questions about these Terms of Use, please &lt;a href=&quot;/contact&quot; className=&quot;text-blue-600 hover:underline&quot;&gt;contact us&lt;/a&gt;. &lt;/p&gt; &lt;/section&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/&gt; ); }; export default TermsOfUsePage; </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ToolPage.tsx</div> <div class="content">import React, { useState, useEffect, useRef } from &#x27;react&#x27;; import { useParams, Navigate } from &#x27;react-router-dom&#x27;; import { Download, Loader, Brush, XCircle, HelpCircle, X } from &#x27;lucide-react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import Button from &#x27;../components/ui/Button&#x27;; import ImageDropzone from &#x27;../components/ui/ImageDropzone&#x27;; import PromptsGuide from &#x27;../components/ui/PromptsGuide&#x27;; import ToolRecommendations from &#x27;../components/ui/ToolRecommendations&#x27;; import ToolFeatureImage from &#x27;../components/ui/ToolFeatureImage&#x27;; import { tools } from &#x27;../data/tools&#x27;; import { findToolImage, generateAltText } from &#x27;../utils/imageMapper&#x27;; import { processImage, uploadImageAndGetUrl, startCleanupJob, startWatermarkRemoverJob, startExpandJob, startReplaceJob, startCartoonJob, startCaricatureJob, startAvatarJob, startProductPhotoshootJob, startBackgroundGeneratorJob, startImageGeneratorJob, startPortraitJob, startFaceSwapJob, startOutfitJob, startImageToImageJob, startSketchToImageJob, startHairstyleJob, startUpscaleJob, startAIFilterJob, checkOrderStatus, convertUrlToBlob, pollJobUntilComplete, pollWatermarkJobUntilComplete } from &#x27;../utils/api&#x27;; import type { ImageFile, ProcessedImage, Tool, FaceSwapStyle } from &#x27;../types&#x27;; import { maleCartoonStyles, femaleCartoonStyles } from &#x27;../constants/cartoonStyles&#x27;; import { caricatureStyles, Style } from &#x27;../constants/caricatureStyles&#x27;; import { avatarStyles, AvatarStyle } from &#x27;../constants/avatarStyles&#x27;; import { productStyles, suggestedPrompts, type ProductStyle } from &#x27;../constants/productStyles&#x27;; import { imageResolutions, suggestedPrompts as imageGeneratorPrompts, type ImageResolution } from &#x27;../constants/imageGeneratorOptions&#x27;; import { portraitStyles, suggestedPortraitPrompts, type PortraitStyle } from &#x27;../constants/portraitStyles&#x27;; import { faceSwapStyles } from &#x27;../constants/faceSwapStyles&#x27;; import { presetOutfitStyles, suggestedOutfitPrompts, type OutfitStyle } from &#x27;../constants/outfitStyles&#x27;; import { hairstylePresets } from &#x27;../constants/hairstylePrompts&#x27;; import { aiFilterStyles, filterCategories, type AIFilterStyle } from &#x27;../constants/filterStyles&#x27;; import { generateCanonicalUrl, generateOgImageUrl } from &#x27;../utils/siteConfig&#x27;; import { scrollToResultContainer, scrollToGenerateButton, debounce } from &#x27;../utils/scrollUtils&#x27;; const ToolPage: React.FC = () =&gt; { const { toolId } = useParams&lt;{ toolId: string }&gt;(); const [selectedImage, setSelectedImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [processedImage, setProcessedImage] = useState&lt;ProcessedImage&gt;({ url: null, isLoading: false, error: null }); // Tool feature image state const [toolFeatureImage, setToolFeatureImage] = useState&lt;{ imagePath: string | null; altText: string; isLoading: boolean; }&gt;({ imagePath: null, altText: &#x27;&#x27;, isLoading: true }); // AI Cleanup specific state const imageRef = useRef&lt;HTMLImageElement&gt;(null); const visibleCanvasRef = useRef&lt;HTMLCanvasElement&gt;(null); const dataMaskCanvasRef = useRef&lt;HTMLCanvasElement&gt;(null); const [isDrawing, setIsDrawing] = useState(false); const [cleanupBrushSize, setCleanupBrushSize] = useState(20); const [canvasInitialized, setCanvasInitialized] = useState(false); const [isMaskDrawn, setIsMaskDrawn] = useState(false); // AI Expand specific state const [padding, setPadding] = useState({ top: 50, left: 50, bottom: 50, right: 50 }); // AI Replace specific state const replaceImageRef = useRef&lt;HTMLImageElement&gt;(null); const replaceVisibleCanvasRef = useRef&lt;HTMLCanvasElement&gt;(null); const replaceDataMaskCanvasRef = useRef&lt;HTMLCanvasElement&gt;(null); const [isReplaceDrawing, setIsReplaceDrawing] = useState(false); const [replaceBrushSize, setReplaceBrushSize] = useState(20); const [replaceCanvasInitialized, setReplaceCanvasInitialized] = useState(false); const [textPrompt, setTextPrompt] = useState(&#x27;&#x27;); // AI Cartoon specific state const [cartoonTextPrompt, setCartoonTextPrompt] = useState(&#x27;&#x27;); const [cartoonStyleImage, setCartoonStyleImage] = useState&lt;File | null&gt;(null); const [selectedGender, setSelectedGender] = useState&lt;&#x27;male&#x27; | &#x27;female&#x27;&gt;(&#x27;female&#x27;); const [selectedPresetUrl, setSelectedPresetUrl] = useState&lt;string | null&gt;(null); // AI Caricature specific state const [caricatureSelectedStyle, setCaricatureSelectedStyle] = useState&lt;Style | null&gt;(null); const [caricatureCustomStyleImage, setCaricatureCustomStyleImage] = useState&lt;File | null&gt;(null); const [caricatureTextPrompt, setCaricatureTextPrompt] = useState(&#x27;&#x27;); // AI Avatar specific state const [avatarSelectedGender, setAvatarSelectedGender] = useState&lt;&#x27;male&#x27; | &#x27;female&#x27;&gt;(&#x27;male&#x27;); const [avatarSelectedStyle, setAvatarSelectedStyle] = useState&lt;AvatarStyle | null&gt;(null); const [avatarCustomStyleImage, setAvatarCustomStyleImage] = useState&lt;File | null&gt;(null); const [avatarTextPrompt, setAvatarTextPrompt] = useState(&#x27;&#x27;); // AI Product Photoshoot specific state const [selectedProductStyle, setSelectedProductStyle] = useState&lt;ProductStyle | null&gt;(null); const [productCustomStyleImage, setProductCustomStyleImage] = useState&lt;File | null&gt;(null); const [productTextPrompt, setProductTextPrompt] = useState(&#x27;&#x27;); // AI Background Generator specific state const [backgroundTextPrompt, setBackgroundTextPrompt] = useState(&#x27;&#x27;); // AI Image Generator specific state const [imageGeneratorTextPrompt, setImageGeneratorTextPrompt] = useState(&#x27;&#x27;); const [selectedResolution, setSelectedResolution] = useState&lt;ImageResolution&gt;(imageResolutions[0]); // Default to square // AI Portrait specific state const [portraitSelectedGender, setPortraitSelectedGender] = useState&lt;&#x27;male&#x27; | &#x27;female&#x27;&gt;(&#x27;female&#x27;); const [portraitSelectedStyle, setPortraitSelectedStyle] = useState&lt;PortraitStyle | null&gt;(null); const [portraitCustomStyleImage, setPortraitCustomStyleImage] = useState&lt;File | null&gt;(null); const [portraitTextPrompt, setPortraitTextPrompt] = useState(&#x27;&#x27;); // AI Face Swap specific state const [faceSwapTargetImage, setFaceSwapTargetImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [faceSwapSourceImage, setFaceSwapSourceImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [selectedFaceSwapPreset, setSelectedFaceSwapPreset] = useState&lt;FaceSwapStyle | null&gt;(null); // AI Outfit specific state const [outfitTextPrompt, setOutfitTextPrompt] = useState(&#x27;&#x27;); // AI Image to Image specific state const [i2iMainImage, setI2iMainImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [i2iStyleImage, setI2iStyleImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [i2iTextPrompt, setI2iTextPrompt] = useState(&#x27;&#x27;); // AI Hairstyle preset selection state const [selectedHairstylePrompt, setSelectedHairstylePrompt] = useState&lt;string&gt;(&#x27;&#x27;); const [i2iStrength, setI2iStrength] = useState(0.5); // Default value from 0.0 to 1.0 const [i2iStyleStrength, setI2iStyleStrength] = useState(0.9); // Default value from 0.0 to 1.0 // AI Sketch to Image specific state const [s2iInputMode, setS2iInputMode] = useState&lt;&#x27;draw&#x27; | &#x27;upload&#x27;&gt;(&#x27;upload&#x27;); // To switch between drawing and uploading const [s2iSketchImage, setS2iSketchImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [s2iStyleImage, setS2iStyleImage] = useState&lt;ImageFile&gt;({ file: null, preview: null }); const [s2iTextPrompt, setS2iTextPrompt] = useState(&#x27;&#x27;); const [s2iStrength, setS2iStrength] = useState(0.8); // Higher default to respect sketch more const [s2iStyleStrength, setS2iStyleStrength] = useState(0.5); // Lower default const drawingCanvasRef = useRef&lt;HTMLCanvasElement&gt;(null); // For the drawing canvas const [isDrawingSketch, setIsDrawingSketch] = useState(false); const [s2iBrushSize, setS2iBrushSize] = useState(5); const [s2iBrushColor, setS2iBrushColor] = useState(&#x27;#000000&#x27;); // AI Hairstyle state const [hairstyleTextPrompt, setHairstyleTextPrompt] = useState(&#x27;&#x27;); // AI Image Upscaler state const [upscaleFactor, setUpscaleFactor] = useState&lt;2 | 4&gt;(2); const [imageDimensions, setImageDimensions] = useState&lt;{ width: number; height: number } | null&gt;(null); const [availableUpscaleOptions, setAvailableUpscaleOptions] = useState&lt;(2 | 4)[]&gt;([2, 4]); // AI Filter state const [filterSelectedCategory, setFilterSelectedCategory] = useState&lt;string&gt;(&#x27;Ghibli&#x27;); const [filterSelectedStyle, setFilterSelectedStyle] = useState&lt;AIFilterStyle | null&gt;(null); const [filterCustomStyleImage, setFilterCustomStyleImage] = useState&lt;File | null&gt;(null); const [filterTextPrompt, setFilterTextPrompt] = useState(&#x27;&#x27;); const [filterUseCustom, setFilterUseCustom] = useState(false); // Find the tool based on the toolId param const tool = tools.find(t =&gt; t.id === toolId); // If tool not found, redirect to tools page if (!tool) { return &lt;Navigate to=&quot;/tools&quot; replace /&gt;; } // Debounced scroll function for outfit style selection const debouncedScrollToGenerate = debounce(() =&gt; { scrollToGenerateButton(); }, 300); const handleImageSelect = (imageFile: ImageFile) =&gt; { setSelectedImage(imageFile); // Reset processed image when a new image is selected setProcessedImage({ url: null, isLoading: false, error: null }); setCanvasInitialized(false); setReplaceCanvasInitialized(false); setIsMaskDrawn(false); setImageDimensions(null); // Reset dimensions on new image select if (imageFile.file &amp;&amp; imageFile.preview) { const img = new Image(); img.onload = () =&gt; { // We have the dimensions! Store them in state. const dimensions = { width: img.naturalWidth, height: img.naturalHeight }; console.log(&quot;Image dimensions:&quot;, dimensions); setImageDimensions(dimensions); // --- THE VALIDATION LOGIC --- const longestSide = Math.max(dimensions.width, dimensions.height); if (longestSide &gt; 2048) { setAvailableUpscaleOptions([]); // No options available setProcessedImage({ url: null, isLoading: false, error: &quot;Image is too large (max 2048px on longest side) and cannot be upscaled.&quot; }); } else if (longestSide &gt; 1024) { setAvailableUpscaleOptions([2]); // Only 2x is available setUpscaleFactor(2); // Automatically select 2x } else { setAvailableUpscaleOptions([2, 4]); // Both 2x and 4x are available setUpscaleFactor(2); // Default to 2x } }; img.src = imageFile.preview; } }; const handleAIFaceSwapGenerate = async () =&gt; { // Validate that we have a target image if (!faceSwapTargetImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please upload a target image.&#x27; }); return; } // Validate that we have a source face (either preset or uploaded) if (!selectedFaceSwapPreset &amp;&amp; !faceSwapSourceImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select a preset face or upload a source face image.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload target image const targetImageUrl = await uploadImageAndGetUrl(faceSwapTargetImage.file); // 2. Get source face image URL let sourceImageUrl: string; if (selectedFaceSwapPreset) { // Use preset face - convert URL to blob and upload const sourceImageBlob = await convertUrlToBlob(selectedFaceSwapPreset.imageUrl); sourceImageUrl = await uploadImageAndGetUrl(new File([sourceImageBlob], &quot;source-face.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else { // Use uploaded source image sourceImageUrl = await uploadImageAndGetUrl(faceSwapSourceImage.file!); } // 3. Start face swap job const orderId = await startFaceSwapJob({ imageUrl: targetImageUrl, styleImageUrl: sourceImageUrl, }); // 4. Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // 5. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during face swap generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; // Handle image load for AI Cleanup - synchronizes canvas with displayed image const handleCleanupImageLoad = (event: React.SyntheticEvent&lt;HTMLImageElement&gt;) =&gt; { const image = event.target as HTMLImageElement; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; // Set canvas dimensions to match the displayed image size const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; // Set both canvases to match displayed image dimensions visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; // Initialize data canvas with black background (unmask area) const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (dataCtx) { dataCtx.fillStyle = &#x27;#000000&#x27;; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } // Clear visible canvas (transparent background) const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setCanvasInitialized(true); }; // Canvas drawing functions for AI Cleanup const startDrawing = (e: React.MouseEvent&lt;HTMLCanvasElement&gt;) =&gt; { if (tool?.id !== &#x27;ai-cleanup&#x27;) return; setIsDrawing(true); draw(e); }; const stopDrawing = () =&gt; { setIsDrawing(false); }; const draw = (e: React.MouseEvent&lt;HTMLCanvasElement&gt;) =&gt; { if (!isDrawing || tool?.id !== &#x27;ai-cleanup&#x27;) return; const { x, y } = getCoordinatesFromEvent(e.nativeEvent); drawAtPoint(x, y); }; const clearCanvas = () =&gt; { const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (dataCtx) { dataCtx.fillStyle = &#x27;#000000&#x27;; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } setIsMaskDrawn(false); }; // Helper function to get coordinates from mouse or touch events const getCoordinatesFromEvent = (event: MouseEvent | Touch): { x: number; y: number } =&gt; { const canvas = visibleCanvasRef.current; if (!canvas) return { x: 0, y: 0 }; const rect = canvas.getBoundingClientRect(); return { x: event.clientX - rect.left, y: event.clientY - rect.top }; }; // Function to draw at a specific point (used by both mouse and touch) const drawAtPoint = (x: number, y: number) =&gt; { if (!visibleCanvasRef.current || !dataMaskCanvasRef.current || tool?.id !== &#x27;ai-cleanup&#x27;) return; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (!visibleCtx || !dataCtx) return; // Set mask drawn flag on first draw if (!isMaskDrawn) { setIsMaskDrawn(true); } // Draw semi-transparent red on visible canvas for user feedback visibleCtx.globalCompositeOperation = &#x27;source-over&#x27;; visibleCtx.fillStyle = &#x27;rgba(255, 0, 0, 0.5)&#x27;; visibleCtx.beginPath(); visibleCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); // Draw white on data canvas for API mask dataCtx.globalCompositeOperation = &#x27;source-over&#x27;; dataCtx.fillStyle = &#x27;#FFFFFF&#x27;; dataCtx.beginPath(); dataCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; // Touch event handlers for AI Cleanup const handleDrawStart = (event: React.TouchEvent&lt;HTMLCanvasElement&gt;) =&gt; { setIsDrawing(true); event.preventDefault(); // Prevent page scrolling const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawMove = (event: React.TouchEvent&lt;HTMLCanvasElement&gt;) =&gt; { if (!isDrawing) return; event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawEnd = () =&gt; { setIsDrawing(false); }; // Clear selection handler functions const handleCartoonClearSelection = () =&gt; { setSelectedPresetUrl(null); }; const handleCaricatureClearSelection = () =&gt; { setCaricatureSelectedStyle(null); }; const handleAvatarClearSelection = () =&gt; { setAvatarSelectedStyle(null); }; const handleFilterClearSelection = () =&gt; { setFilterSelectedStyle(null); }; const handleProductClearSelection = () =&gt; { setSelectedProductStyle(null); }; // Handle image load for AI Replace - synchronizes canvas with displayed image const handleReplaceImageLoad = (event: React.SyntheticEvent&lt;HTMLImageElement&gt;) =&gt; { const image = event.target as HTMLImageElement; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; // Set canvas dimensions to match the displayed image size const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; // Set both canvases to match displayed image dimensions visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; // Initialize data canvas with black background (unmask area) const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (dataCtx) { dataCtx.fillStyle = &#x27;#000000&#x27;; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } // Clear visible canvas (transparent background) const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setReplaceCanvasInitialized(true); }; // Canvas drawing functions for AI Replace const startReplaceDrawing = (e: React.MouseEvent&lt;HTMLCanvasElement&gt;) =&gt; { if (tool?.id !== &#x27;ai-replace&#x27;) return; setIsReplaceDrawing(true); drawReplace(e); }; const stopReplaceDrawing = () =&gt; { setIsReplaceDrawing(false); }; const drawReplace = (e: React.MouseEvent&lt;HTMLCanvasElement&gt;) =&gt; { if (!isReplaceDrawing || !replaceVisibleCanvasRef.current || !replaceDataMaskCanvasRef.current || tool?.id !== &#x27;ai-replace&#x27;) return; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (!visibleCtx || !dataCtx) return; const rect = visibleCanvas.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; // Draw semi-transparent red on visible canvas for user feedback visibleCtx.globalCompositeOperation = &#x27;source-over&#x27;; visibleCtx.fillStyle = &#x27;rgba(255, 0, 0, 0.5)&#x27;; visibleCtx.beginPath(); visibleCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); // Draw white on data canvas for API mask dataCtx.globalCompositeOperation = &#x27;source-over&#x27;; dataCtx.fillStyle = &#x27;#FFFFFF&#x27;; dataCtx.beginPath(); dataCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const clearReplaceCanvas = () =&gt; { const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext(&#x27;2d&#x27;); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext(&#x27;2d&#x27;); if (dataCtx) { dataCtx.fillStyle = &#x27;#000000&#x27;; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } }; // Convert canvas to file for AI Replace const replaceCanvasToFile = (): Promise&lt;File&gt; =&gt; { return new Promise((resolve, reject) =&gt; { if (!replaceDataMaskCanvasRef.current) { reject(new Error(&#x27;Canvas not found&#x27;)); return; } replaceDataMaskCanvasRef.current.toBlob((blob) =&gt; { if (!blob) { reject(new Error(&#x27;Failed to create blob from canvas&#x27;)); return; } const file = new File([blob], &#x27;mask.png&#x27;, { type: &#x27;image/png&#x27; }); resolve(file); }, &#x27;image/png&#x27;); }); }; // Convert canvas to File for AI Cleanup const canvasToFile = (): Promise&lt;File&gt; =&gt; { return new Promise((resolve, reject) =&gt; { if (!dataMaskCanvasRef.current) { reject(new Error(&#x27;Canvas not available&#x27;)); return; } dataMaskCanvasRef.current.toBlob((blob) =&gt; { if (!blob) { reject(new Error(&#x27;Failed to convert canvas to blob&#x27;)); return; } const file = new File([blob], &#x27;mask.png&#x27;, { type: &#x27;image/png&#x27; }); resolve(file); }, &#x27;image/png&#x27;); }); }; // AI Cleanup specific generate function const handleAICleanupGenerate = async () =&gt; { if (!selectedImage.file) return; // --- VALIDATION: Check if mask is drawn --- if (!isMaskDrawn) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Error: Please paint over the area you want to clean up before generating.&#x27; }); return; } // --- END OF VALIDATION --- setProcessedImage({ url: null, isLoading: true, error: null }); try { // Prepare images const originalImageFile = selectedImage.file; const maskFile = await canvasToFile(); // Upload both images const originalFinalUrl = await uploadImageAndGetUrl(originalImageFile); const maskFinalUrl = await uploadImageAndGetUrl(maskFile); // Start the cleanup job const orderId = await startCleanupJob({ originalImageUrl: originalFinalUrl, maskedImageUrl: maskFinalUrl }); if (!orderId) { throw new Error(&#x27;Failed to start cleanup job&#x27;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;AI Cleanup error:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &#x27;An unexpected error occurred&#x27; }); } }; // Watermark Remover specific generate function const handleAIWatermarkRemoverGenerate = async () =&gt; { if (!selectedImage.file) return; // v2 Watermark Remover DOC compliance: image file must be &lt;= 5MB const maxSizeBytes = 5 * 1024 * 1024; if (selectedImage.file.size &gt; maxSizeBytes) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Image exceeds 5MB limit. Please upload a smaller image.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalFinalUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startWatermarkRemoverJob({ imageUrl: originalFinalUrl }); if (!orderId) { throw new Error(&#x27;Failed to start watermark remover job&#x27;); } const resultUrl = await pollWatermarkJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;Watermark Remover error:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &#x27;An unexpected error occurred&#x27; }); } }; const handleAIExpandGenerate = async () =&gt; { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the image and get the URL const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the expand job const orderId = await startExpandJob({ imageUrl, padding }); if (!orderId) { throw new Error(&#x27;Failed to start expand job&#x27;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;AI Expand error:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &#x27;An unexpected error occurred&#x27; }); } }; const handleAIReplaceGenerate = async () =&gt; { if (!selectedImage.file || !textPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please provide both an image and a text prompt&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the original image const originalImageUrl = await uploadImageAndGetUrl(selectedImage.file); // Get the mask from canvas and upload it const maskFile = await replaceCanvasToFile(); const maskedImageUrl = await uploadImageAndGetUrl(maskFile); console.log(&#x27;Submitting to API with this prompt:&#x27;, textPrompt); // Start the replace job const orderId = await startReplaceJob({ originalImageUrl, maskedImageUrl, prompt: textPrompt }); if (!orderId) { throw new Error(&#x27;Failed to start replace job&#x27;); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;AI Replace error:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &#x27;An unexpected error occurred&#x27; }); } }; const handleAICartoonGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ ...processedImage, error: &#x27;Please select an image first.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleImageUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 3. Handle the two different style sources correctly if (selectedPresetUrl) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = &quot;cartoon style transformation&quot;; // Default for preset console.log(`Processing preset style from URL: ${selectedPresetUrl}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(selectedPresetUrl); finalStyleImageUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (cartoonStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = cartoonTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log(&quot;Processing CUSTOM uploaded style image.&quot;); // CRITICAL: Upload the user&#x27;s local file directly finalStyleImageUrl = await uploadImageAndGetUrl(cartoonStyleImage); } else { // Path C: User is using TEXT-PROMPT ONLY finalPrompt = cartoonTextPrompt; } // 4. Clean debug logging (FIXED: removed problematic template literal) console.log(&#x27;Main URL:&#x27;, mainImageUrl); console.log(&#x27;Style URL:&#x27;, finalStyleImageUrl); console.log(&#x27;Text Prompt:&#x27;, finalPrompt); // 5. Start the cartoon job with corrected logic const orderId = await startCartoonJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleImageUrl, textPrompt: finalPrompt || &quot;cartoon style transformation&quot; // ALWAYS send the prompt, never undefined }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() =&gt; { scrollToResultContainer().catch(console.error); }, 100); // Scroll to result container with device-adaptive behavior setTimeout(() =&gt; { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAICaricatureGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!caricatureSelectedStyle &amp;&amp; !caricatureCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select a style image before generating.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 3. Handle the two different style sources correctly if (caricatureSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = caricatureSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${caricatureSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(caricatureSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (caricatureCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = caricatureTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log(&quot;Processing CUSTOM uploaded style image.&quot;); // CRITICAL: Upload the user&#x27;s local file directly finalStyleUrl = await uploadImageAndGetUrl(caricatureCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startCaricatureJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;humorous artistic caricature&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during caricature generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAIAvatarGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!avatarSelectedStyle &amp;&amp; !avatarCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select a style before generating.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 3. Handle the two different style sources correctly if (avatarSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = avatarSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${avatarSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(avatarSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (avatarCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = avatarTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log(&quot;Processing CUSTOM uploaded style image.&quot;); // CRITICAL: Upload the user&#x27;s local file directly finalStyleUrl = await uploadImageAndGetUrl(avatarCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startAvatarJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;A high-quality avatar&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during avatar generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAIPortraitGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!portraitSelectedStyle &amp;&amp; !portraitCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select a style before generating.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 3. Handle the two different style sources correctly if (portraitSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = portraitSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${portraitSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(portraitSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (portraitCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE === finalPrompt = portraitTextPrompt; // Get the prompt from the TEXTAREA state console.log(&quot;Processing CUSTOM uploaded style image.&quot;); // Upload the user&#x27;s local file directly finalStyleUrl = await uploadImageAndGetUrl(portraitCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startPortraitJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || &quot;A high-quality portrait&quot; }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during portrait generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAIProductPhotoshootGenerate = async () =&gt; { if (!selectedImage.file) { console.error(&quot;No user image provided.&quot;); return; } // A style source (preset, custom image, or text) is needed if (!selectedProductStyle &amp;&amp; !productCustomStyleImage &amp;&amp; !productTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select a style, upload a style image, or enter a text prompt.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main product image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 3. Correctly determine the style source and prepare parameters if (selectedProductStyle) { // Path A: User chose a PRESET style finalPrompt = selectedProductStyle.prompt; console.log(`Processing PRESET style: ${selectedProductStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(selectedProductStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (productCustomStyleImage) { // Path B: User uploaded a CUSTOM style image finalPrompt = productTextPrompt; // Use the text from the textarea console.log(&quot;Processing CUSTOM uploaded style image.&quot;); // Upload the user&#x27;s local file directly finalStyleUrl = await uploadImageAndGetUrl(productCustomStyleImage); } else { // Path C: User is using ONLY a text prompt finalPrompt = productTextPrompt; } // 4. Call the API job function with all parameters const orderId = await startProductPhotoshootJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt, }); // 5. Use our robust, unified poller to get the result const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during product photo generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAIBackgroundGeneratorGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please select an image first.&#x27; }); return; } if (!backgroundTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a text prompt describing the background you want.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the main image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the background generator job const orderId = await startBackgroundGeneratorJob({ imageUrl: mainImageUrl, textPrompt: backgroundTextPrompt }); // Poll for completion const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;An error occurred during background generation:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; // Add this function to resize images client-side if needed const resizeImageToResolution = async (imageUrl: string, targetWidth: number, targetHeight: number): Promise&lt;string&gt; =&gt; { return new Promise((resolve) =&gt; { const canvas = document.createElement(&#x27;canvas&#x27;); const ctx = canvas.getContext(&#x27;2d&#x27;)!; const img = new Image(); img.onload = () =&gt; { canvas.width = targetWidth; canvas.height = targetHeight; ctx.drawImage(img, 0, 0, targetWidth, targetHeight); resolve(canvas.toDataURL(&#x27;image/png&#x27;)); }; img.crossOrigin = &#x27;anonymous&#x27;; img.src = imageUrl; }); }; const handleAIImageGeneratorGenerate = async () =&gt; { if (!imageGeneratorTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a text prompt describing the image you want to generate.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Start the image generator job const orderId = await startImageGeneratorJob({ textPrompt: imageGeneratorTextPrompt, width: selectedResolution.width, height: selectedResolution.height }); // Poll for completion const resultUrl = await pollJobUntilComplete(orderId); // Optionally resize to match selected resolution const resizedUrl = await resizeImageToResolution( resultUrl, selectedResolution.width, selectedResolution.height ); setProcessedImage({ url: resizedUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() =&gt; { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error(&#x27;An error occurred during image generation:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || &#x27;An unknown error occurred.&#x27; }); } }; const handleAIOutfitGenerate = async () =&gt; { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please upload an image.&#x27; }); return; } if (!outfitTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a text prompt describing the outfit you want.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the image const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Start the outfit job const orderId = await startOutfitJob({ imageUrl: imageUrl, textPrompt: outfitTextPrompt, }); // 3. Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // 4. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // 5. Scroll to result container with device-adaptive behavior setTimeout(() =&gt; { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error(&quot;An error occurred during outfit generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIImageToImageGenerate = async () =&gt; { if (!i2iMainImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please upload a main image.&#x27; }); return; } if (!i2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a text prompt describing the transformation you want.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main image const mainImageUrl = await uploadImageAndGetUrl(i2iMainImage.file); console.log(&#x27;DEBUG: mainImageUrl after upload:&#x27;, mainImageUrl); // 2. Upload style image if provided let styleImageUrl: string | undefined; if (i2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(i2iStyleImage.file); console.log(&#x27;DEBUG: styleImageUrl after upload:&#x27;, styleImageUrl); } // 3. Start the image-to-image job const jobParams = { imageUrl: mainImageUrl, textPrompt: i2iTextPrompt, styleImageUrl: styleImageUrl, strength: i2iStrength, styleStrength: i2iStyleImage.file ? i2iStyleStrength : undefined, }; console.log(&#x27;DEBUG: jobParams before API call:&#x27;, jobParams); const orderId = await startImageToImageJob(jobParams); // 4. Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // 5. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during image-to-image generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAISketchToImageGenerate = async () =&gt; { // Validation if (s2iInputMode === &#x27;upload&#x27; &amp;&amp; !s2iSketchImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please upload a sketch image.&#x27; }); return; } if (s2iInputMode === &#x27;draw&#x27;) { const canvas = drawingCanvasRef.current; if (!canvas) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Drawing canvas not available.&#x27; }); return; } // Check if canvas has any drawing (not just white) const ctx = canvas.getContext(&#x27;2d&#x27;); if (!ctx) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Cannot access drawing canvas.&#x27; }); return; } const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const data = imageData.data; let hasDrawing = false; // Check if any pixel is not white (255, 255, 255) for (let i = 0; i &lt; data.length; i += 4) { if (data[i] !== 255 || data[i + 1] !== 255 || data[i + 2] !== 255) { hasDrawing = true; break; } } if (!hasDrawing) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please draw something on the canvas first.&#x27; }); return; } } if (!s2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a text prompt describing the final image you want.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { let sketchImageUrl: string; if (s2iInputMode === &#x27;upload&#x27;) { // Upload the sketch file sketchImageUrl = await uploadImageAndGetUrl(s2iSketchImage.file!); } else { // Convert canvas to blob and upload const canvas = drawingCanvasRef.current!; const blob = await new Promise&lt;Blob&gt;((resolve) =&gt; { canvas.toBlob((blob) =&gt; resolve(blob!), &#x27;image/png&#x27;); }); // Convert Blob to File for uploadImageAndGetUrl const file = new File([blob], &#x27;sketch.png&#x27;, { type: &#x27;image/png&#x27; }); sketchImageUrl = await uploadImageAndGetUrl(file); } console.log(&#x27;DEBUG: sketchImageUrl after upload:&#x27;, sketchImageUrl); // Upload style image if provided let styleImageUrl: string | undefined; if (s2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(s2iStyleImage.file); console.log(&#x27;DEBUG: styleImageUrl after upload:&#x27;, styleImageUrl); } // Start the sketch-to-image job const jobParams = { imageUrl: sketchImageUrl, textPrompt: s2iTextPrompt, strength: s2iStrength, styleImageUrl: styleImageUrl, styleStrength: s2iStyleImage.file ? s2iStyleStrength : undefined, }; console.log(&#x27;DEBUG: sketch-to-image jobParams before API call:&#x27;, jobParams); const orderId = await startSketchToImageJob(jobParams); // Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during sketch-to-image generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIHairstyleGenerate = async () =&gt; { // Validate that we have an image if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please upload an image.&#x27; }); return; } // Validate that we have a text prompt if (!hairstyleTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: &#x27;Please enter a hairstyle description.&#x27; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the image const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the hairstyle job const orderId = await startHairstyleJob({ imageUrl: imageUrl, textPrompt: hairstyleTextPrompt, }); // Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during hairstyle generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIUpscalerGenerate = async () =&gt; { if (!selectedImage.file) { return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main image. const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Call the API job function with the user&#x27;s selected (and validated) factor. const orderId = await startUpscaleJob({ imageUrl: mainImageUrl, quality: upscaleFactor, }); // 3. Use our unified poller to get the result. const resultUrl = await pollJobUntilComplete(orderId); // 4. Display the upscaled image. setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() =&gt; { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error(&quot;An error occurred during image upscaling:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIFilterGenerate = async () =&gt; { // 1. Validate inputs and set loading state if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please upload an image first.&quot; }); return; } if (!filterSelectedStyle &amp;&amp; !filterCustomStyleImage &amp;&amp; !filterTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: &quot;Please select a preset style, upload a custom style, or enter a text prompt.&quot; }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 2. Upload the main image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 3. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = &quot;&quot;; // 4. Correctly determine the style source if (filterSelectedStyle) { finalPrompt = filterSelectedStyle.name; const styleImageBlob = await convertUrlToBlob(filterSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], &quot;style.jpeg&quot;, { type: &#x27;image/jpeg&#x27; })); } else if (filterCustomStyleImage) { finalPrompt = filterTextPrompt; finalStyleUrl = await uploadImageAndGetUrl(filterCustomStyleImage); } else { finalPrompt = filterTextPrompt; } // 5. Call the API job function with all parameters const orderId = await startAIFilterJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt, }); // 6. Use our robust, unified poller const resultUrl = await pollJobUntilComplete(orderId); // 7. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&quot;An error occurred during AI filter generation:&quot;, error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; // Canvas initialization is now handled by onLoad events on the image elements const handleProcessImage = async () =&gt; { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const resultUrl = await processImage(tool.apiEndpoint, selectedImage.file); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error(&#x27;Processing error:&#x27;, error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : &#x27;An unexpected error occurred while processing the image&#x27; }); } }; const handleDownload = () =&gt; { if (!processedImage.url) return; const link = document.createElement(&#x27;a&#x27;); link.href = processedImage.url; link.download = `${tool.id}-result.png`; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; // Clean up object URLs when component unmounts or when a new image is processed useEffect(() =&gt; { return () =&gt; { if (processedImage.url) { URL.revokeObjectURL(processedImage.url); } }; }, [processedImage.url]); // Load tool feature image when tool changes useEffect(() =&gt; { const loadToolImage = async () =&gt; { if (!tool) return; setToolFeatureImage(prev =&gt; ({ ...prev, isLoading: true })); try { const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { setToolFeatureImage({ imagePath: `/images/tools images/${imageFilename}`, altText: generateAltText(tool.name), isLoading: false }); console.log(`โœ… Loaded feature image for ${tool.name}: ${imageFilename}`); } else { setToolFeatureImage({ imagePath: null, altText: &#x27;&#x27;, isLoading: false }); console.log(`โŒ No feature image found for ${tool.name}`); } } catch (error) { console.error(`๐Ÿ’ฅ Error loading feature image for ${tool.name}:`, error); setToolFeatureImage({ imagePath: null, altText: &#x27;&#x27;, isLoading: false }); } }; loadToolImage(); }, [tool]); // Initialize canvas with white background when drawing mode is selected useEffect(() =&gt; { if (tool.id === &#x27;ai-sketch-to-image&#x27; &amp;&amp; s2iInputMode === &#x27;draw&#x27; &amp;&amp; drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { // Set canvas size canvas.width = 512; canvas.height = 512; // Fill with white background ctx.fillStyle = &#x27;white&#x27;; ctx.fillRect(0, 0, canvas.width, canvas.height); // Set drawing properties ctx.lineCap = &#x27;round&#x27;; ctx.lineJoin = &#x27;round&#x27;; } } }, [tool.id, s2iInputMode]); // Add touch event listeners with passive: false to prevent console errors useEffect(() =&gt; { if (tool.id === &#x27;ai-sketch-to-image&#x27; &amp;&amp; s2iInputMode === &#x27;draw&#x27; &amp;&amp; drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const handleTouchStart = (e: TouchEvent) =&gt; { e.preventDefault(); // Prevent page scrolling setIsDrawingSketch(true); if (canvas &amp;&amp; e.touches[0]) { const touch = e.touches[0]; const rect = canvas.getBoundingClientRect(); const x = (touch.clientX - rect.left) * (canvas.width / rect.width); const y = (touch.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }; const handleTouchMove = (e: TouchEvent) =&gt; { if (!isDrawingSketch) return; e.preventDefault(); // Prevent page scrolling if (canvas &amp;&amp; e.touches[0]) { const touch = e.touches[0]; const rect = canvas.getBoundingClientRect(); const x = (touch.clientX - rect.left) * (canvas.width / rect.width); const y = (touch.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = &#x27;round&#x27;; ctx.stroke(); } } }; const handleTouchEnd = (e: TouchEvent) =&gt; { e.preventDefault(); // Prevent page scrolling setIsDrawingSketch(false); }; // Add event listeners with passive: false canvas.addEventListener(&#x27;touchstart&#x27;, handleTouchStart, { passive: false }); canvas.addEventListener(&#x27;touchmove&#x27;, handleTouchMove, { passive: false }); canvas.addEventListener(&#x27;touchend&#x27;, handleTouchEnd, { passive: false }); // Cleanup function return () =&gt; { canvas.removeEventListener(&#x27;touchstart&#x27;, handleTouchStart); canvas.removeEventListener(&#x27;touchmove&#x27;, handleTouchMove); canvas.removeEventListener(&#x27;touchend&#x27;, handleTouchEnd); }; } }, [tool.id, s2iInputMode, isDrawingSketch, s2iBrushColor, s2iBrushSize]); return ( &lt;&gt; &lt;SEO title={tool.name} description={`${tool.description}. Free online tool with instant results.`} ogImage={toolFeatureImage.imagePath ? generateOgImageUrl(toolFeatureImage.imagePath) : undefined} canonicalUrl={generateCanonicalUrl(`/tools/${tool.id}`)} /&gt; &lt;div className=&quot;container mx-auto px-4 py-12&quot;&gt; &lt;div className=&quot;max-w-4xl mx-auto&quot;&gt; &lt;div className=&quot;text-center mb-8&quot;&gt; &lt;h1 className=&quot;text-3xl md:text-4xl font-bold text-gray-900 mb-4&quot;&gt; {tool.name} &lt;/h1&gt; {/* Tool Feature Image */} &lt;ToolFeatureImage toolId={tool.id} toolName={tool.name} imagePath={toolFeatureImage.imagePath ?? &#x27;&#x27;} altText={toolFeatureImage.altText} /&gt; &lt;p className=&quot;text-xl text-gray-600 max-w-2xl mx-auto&quot;&gt; {tool.description} &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold mb-4&quot;&gt;How to use {tool.name}&lt;/h2&gt; &lt;ol className=&quot;list-decimal list-inside space-y-2 text-gray-700&quot;&gt; {tool.id === &#x27;ai-cleanup&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below&lt;/li&gt; &lt;li&gt;Use the brush tool to paint over areas you want to remove&lt;/li&gt; &lt;li&gt;Adjust brush size as needed for precision&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI intelligently fill the painted areas&lt;/li&gt; &lt;li&gt;Download your enhanced image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;watermark-remover&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below (max 5MB)&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; โ€” the tool automatically detects and removes watermarks&lt;/li&gt; &lt;li&gt;No mask painting is required; results depend on watermark visibility and contrast&lt;/li&gt; &lt;li&gt;Review the result and re-try with a clearer image if needed&lt;/li&gt; &lt;li&gt;Download your clean image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-expand&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below&lt;/li&gt; &lt;li&gt;Adjust the padding values to specify how much to expand each side&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI expand your image with new content&lt;/li&gt; &lt;li&gt;Download your expanded image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-replace&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below&lt;/li&gt; &lt;li&gt;Use the brush tool to paint over areas you want to replace&lt;/li&gt; &lt;li&gt;Enter a text prompt describing what you want in the painted areas&lt;/li&gt; &lt;li&gt;Adjust brush size as needed for precision&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI replace the painted areas with your prompt&lt;/li&gt; &lt;li&gt;Download your enhanced image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-cartoon&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your photo using the tool below (works best with human faces)&lt;/li&gt; &lt;li&gt;Choose your stylization method: describe a style with text OR upload a style image&lt;/li&gt; &lt;li&gt;If using text: describe the cartoon style you want (e.g., &quot;anime style&quot;, &quot;Disney cartoon&quot;)&lt;/li&gt; &lt;li&gt;If using a style image: upload a reference image with the desired artistic style&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to transform your photo into cartoon artwork&lt;/li&gt; &lt;li&gt;Download your cartoonized image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-avatar&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a clear photo of a human face using the tool below&lt;/li&gt; &lt;li&gt;Select your gender to see appropriate avatar styles&lt;/li&gt; &lt;li&gt;Choose from preset professional avatar styles OR upload your own style image&lt;/li&gt; &lt;li&gt;Optionally add a text prompt to customize the avatar further&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to create your professional avatar&lt;/li&gt; &lt;li&gt;Download your avatar when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-portrait&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a clear photo of a person&#x27;s face using the tool below&lt;/li&gt; &lt;li&gt;Select your gender to see appropriate portrait styles&lt;/li&gt; &lt;li&gt;Choose from preset realistic portrait styles OR upload your own style image&lt;/li&gt; &lt;li&gt;Use suggested prompts or add your own text prompt to customize the portrait&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to create your realistic portrait&lt;/li&gt; &lt;li&gt;Download your portrait when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-face-swap&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a target image (the photo you want to modify) using the first dropzone&lt;/li&gt; &lt;li&gt;Either choose a preset face from the gallery OR upload your own source face image&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to swap the faces&lt;/li&gt; &lt;li&gt;Download your face-swapped image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-product-photoshoot&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a clear photo of your product using the tool below&lt;/li&gt; &lt;li&gt;Choose from preset professional photoshoot styles OR upload your own style image&lt;/li&gt; &lt;li&gt;Optionally add a text prompt to describe the desired scene or background&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to create your professional product photo&lt;/li&gt; &lt;li&gt;Download your enhanced product photo when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-background-generator&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below&lt;/li&gt; &lt;li&gt;Enter a text prompt describing the background you want to generate&lt;/li&gt; &lt;li&gt;Be specific about scenes, settings, colors, textures, and style preferences&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI create a custom background for your image&lt;/li&gt; &lt;li&gt;Download your enhanced image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-image-generator&#x27; ? ( &lt;&gt; &lt;li&gt;Select your desired image resolution from the available options&lt;/li&gt; &lt;li&gt;Enter a detailed text prompt describing the image you want to create&lt;/li&gt; &lt;li&gt;Use suggested prompts for inspiration or create your own custom description&lt;/li&gt; &lt;li&gt;Be specific about style, colors, composition, and artistic elements&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI create your unique image&lt;/li&gt; &lt;li&gt;Download your generated image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-outfit&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a clear photo of a person using the tool below&lt;/li&gt; &lt;li&gt;Choose from preset outfit styles organized by category OR use suggested prompts&lt;/li&gt; &lt;li&gt;Enter a detailed text prompt describing the outfit you want to apply&lt;/li&gt; &lt;li&gt;Be specific about clothing type, style, colors, and materials&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI change the outfit in your photo&lt;/li&gt; &lt;li&gt;Download your transformed image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-image-to-image&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your main image that you want to transform&lt;/li&gt; &lt;li&gt;Optionally upload a style reference image for visual guidance&lt;/li&gt; &lt;li&gt;Adjust the Image Strength slider to control how much the result resembles your main image&lt;/li&gt; &lt;li&gt;Adjust the Style Strength slider to control how much the result follows your style image&lt;/li&gt; &lt;li&gt;Enter a detailed text prompt describing the transformation you want&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to let AI transform your image based on your prompt and settings&lt;/li&gt; &lt;li&gt;Download your transformed image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-sketch-to-image&#x27; ? ( &lt;&gt; &lt;li&gt;Choose to either draw your sketch or upload an existing sketch image&lt;/li&gt; &lt;li&gt;If drawing: Use the canvas to create your sketch with the drawing tools&lt;/li&gt; &lt;li&gt;If uploading: Select your sketch image file&lt;/li&gt; &lt;li&gt;Enter a detailed text prompt describing the final image you want to create&lt;/li&gt; &lt;li&gt;Optionally upload a style reference image for visual guidance&lt;/li&gt; &lt;li&gt;Adjust the Sketch Adherence slider to control how closely AI follows your sketch&lt;/li&gt; &lt;li&gt;Adjust the Style Strength slider if using a style image&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to transform your sketch into a rendered image&lt;/li&gt; &lt;li&gt;Download your transformed image when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-hairstyle&#x27; ? ( &lt;&gt; &lt;li&gt;Upload a clear, front-facing photo of yourself or someone else&lt;/li&gt; &lt;li&gt;Describe the hairstyle you want to try on in the text box&lt;/li&gt; &lt;li&gt;Or click on one of the suggested hairstyle prompts for inspiration&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to see the new hairstyle applied to your photo&lt;/li&gt; &lt;li&gt;Download your result when processing is complete&lt;/li&gt; &lt;/&gt; ) : tool.id === &#x27;ai-image-upscaler&#x27; ? ( &lt;&gt; &lt;li&gt;Upload your image using the tool below (max 2048px on longest side)&lt;/li&gt; &lt;li&gt;Select an upscale factor (2x or 4x) based on your image size&lt;/li&gt; &lt;li&gt;Click &quot;Generate&quot; to enhance your image with AI upscaling&lt;/li&gt; &lt;li&gt;Download your high-resolution result when processing is complete&lt;/li&gt; &lt;/&gt; ) : ( &lt;&gt; &lt;li&gt;Upload your image using the tool below&lt;/li&gt; &lt;li&gt;Click the &quot;{tool.name}&quot; button to process your image&lt;/li&gt; &lt;li&gt;Wait for the AI to work its magic&lt;/li&gt; &lt;li&gt;Download your result when processing is complete&lt;/li&gt; &lt;/&gt; )} &lt;/ol&gt; &lt;/div&gt; {/* Add PromptsGuide for tools that use text prompts */} {(tool.id === &#x27;ai-replace&#x27; || tool.id === &#x27;ai-cartoon&#x27; || tool.id === &#x27;ai-caricature&#x27; || tool.id === &#x27;ai-avatar&#x27; || tool.id === &#x27;ai-product-photoshoot&#x27; || tool.id === &#x27;ai-background-generator&#x27; || tool.id === &#x27;ai-image-generator&#x27; || tool.id === &#x27;ai-portrait&#x27; || tool.id === &#x27;ai-outfit&#x27; || tool.id === &#x27;ai-image-to-image&#x27; || tool.id === &#x27;ai-sketch-to-image&#x27; || tool.id === &#x27;ai-hairstyle&#x27; || tool.id === &#x27;ai-filter&#x27;) &amp;&amp; ( &lt;div className=&quot;mb-8&quot;&gt; &lt;PromptsGuide /&gt; &lt;/div&gt; )} &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 gap-8&quot;&gt; &lt;div className=&quot;space-y-6&quot;&gt; {/* Show ImageDropzone for all tools except AI Image Generator, AI Face Swap, AI Image to Image, and AI Sketch to Image */} {tool.id !== &#x27;ai-image-generator&#x27; &amp;&amp; tool.id !== &#x27;ai-face-swap&#x27; &amp;&amp; tool.id !== &#x27;ai-image-to-image&#x27; &amp;&amp; tool.id !== &#x27;ai-sketch-to-image&#x27; &amp;&amp; ( &lt;ImageDropzone onImageSelect={handleImageSelect} selectedImage={selectedImage} /&gt; )} {/* AI Face Swap specific image inputs */} {tool.id === &#x27;ai-face-swap&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div&gt; &lt;h3 className=&quot;text-lg font-medium mb-2&quot;&gt;1. Upload Target Image&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;The photo you want to modify&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setFaceSwapTargetImage(imageFile)} selectedImage={faceSwapTargetImage} /&gt; &lt;/div&gt; &lt;div&gt; &lt;h3 className=&quot;text-lg font-medium mb-2&quot;&gt;2. Upload Source Face Image&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;The face you want to use (disabled if preset selected)&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setFaceSwapSourceImage(imageFile)} selectedImage={faceSwapSourceImage} disabled={!!selectedFaceSwapPreset} /&gt; &lt;/div&gt; &lt;div&gt; &lt;h3 className=&quot;text-lg font-medium mb-2&quot;&gt;Or Choose a Preset Source Face&lt;/h3&gt; &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;&gt; {faceSwapStyles.map((style) =&gt; { const isSelected = selectedFaceSwapPreset?.imageUrl === style.imageUrl; return ( &lt;div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} onClick={() =&gt; { setSelectedFaceSwapPreset(style); setFaceSwapSourceImage({ file: null, preview: null }); }} &gt; {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); setSelectedFaceSwapPreset(null); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-auto object-cover&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); })} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Cleanup specific controls */} {tool.id === &#x27;ai-cleanup&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div className=&quot;flex items-center gap-4&quot;&gt; &lt;label className=&quot;flex items-center gap-2&quot;&gt; &lt;Brush className=&quot;w-4 h-4&quot; /&gt; &lt;span className=&quot;text-sm font-medium&quot;&gt;Brush Size:&lt;/span&gt; &lt;/label&gt; &lt;input type=&quot;range&quot; min=&quot;5&quot; max=&quot;50&quot; value={cleanupBrushSize} onChange={(e) =&gt; setCleanupBrushSize(Number(e.target.value))} className=&quot;flex-1&quot; /&gt; &lt;span className=&quot;text-sm text-gray-600 w-8&quot;&gt;{cleanupBrushSize}px&lt;/span&gt; &lt;/div&gt; &lt;div className=&quot;relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden&quot; style={{ display: &#x27;inline-block&#x27; }}&gt; &lt;img ref={imageRef} src={selectedImage.preview} alt=&quot;Selected&quot; className=&quot;w-full h-auto&quot; draggable={false} onLoad={handleCleanupImageLoad} style={{ maxWidth: &#x27;100%&#x27;, display: &#x27;block&#x27; }} /&gt; &lt;canvas ref={visibleCanvasRef} className=&quot;absolute top-0 left-0 cursor-crosshair&quot; onMouseDown={startDrawing} onMouseMove={draw} onMouseUp={() =&gt; setIsDrawing(false)} onMouseLeave={() =&gt; setIsDrawing(false)} onTouchStart={handleDrawStart} onTouchMove={handleDrawMove} onTouchEnd={handleDrawEnd} style={{ zIndex: 10 }} /&gt; &lt;canvas ref={dataMaskCanvasRef} style={{ display: &#x27;none&#x27; }} /&gt; &lt;/div&gt; &lt;Button variant=&quot;outline&quot; onClick={clearCanvas} className=&quot;w-full&quot; &gt; Clear Mask &lt;/Button&gt; &lt;/div&gt; )} {/* Watermark Remover specific note (no painting required) */} {tool.id === &#x27;watermark-remover&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tip:&lt;/h4&gt; &lt;p className=&quot;text-xs text-blue-700&quot;&gt; Upload a watermarked image. The tool automatically detects and removes watermarks โ€” no painting needed. &lt;/p&gt; &lt;p className=&quot;text-xs text-blue-700 mt-1&quot;&gt; Maximum file size: 5MB. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Expand specific controls */} {tool.id === &#x27;ai-expand&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;h3 className=&quot;text-lg font-medium&quot;&gt;Padding Settings&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600&quot;&gt;Specify how many pixels to add to each side of your image.&lt;/p&gt; &lt;div className=&quot;grid grid-cols-2 gap-4&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-1&quot;&gt; Top Padding &lt;/label&gt; &lt;input type=&quot;number&quot; min=&quot;0&quot; max=&quot;500&quot; value={padding.top} onChange={(e) =&gt; setPadding(prev =&gt; ({ ...prev, top: Number(e.target.value) }))} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-1&quot;&gt; Bottom Padding &lt;/label&gt; &lt;input type=&quot;number&quot; min=&quot;0&quot; max=&quot;500&quot; value={padding.bottom} onChange={(e) =&gt; setPadding(prev =&gt; ({ ...prev, bottom: Number(e.target.value) }))} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-1&quot;&gt; Left Padding &lt;/label&gt; &lt;input type=&quot;number&quot; min=&quot;0&quot; max=&quot;500&quot; value={padding.left} onChange={(e) =&gt; setPadding(prev =&gt; ({ ...prev, left: Number(e.target.value) }))} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-1&quot;&gt; Right Padding &lt;/label&gt; &lt;input type=&quot;number&quot; min=&quot;0&quot; max=&quot;500&quot; value={padding.right} onChange={(e) =&gt; setPadding(prev =&gt; ({ ...prev, right: Number(e.target.value) }))} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Background Generator specific controls */} {tool.id === &#x27;ai-background-generator&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Background Description &lt;/label&gt; &lt;textarea value={backgroundTextPrompt} onChange={(e) =&gt; setBackgroundTextPrompt(e.target.value)} placeholder=&quot;Describe the background you want to generate (e.g., &#x27;sunset beach with palm trees&#x27;, &#x27;modern office interior&#x27;, &#x27;mountain landscape with snow&#x27;)...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={4} /&gt; &lt;/div&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tips for better results:&lt;/h4&gt; &lt;ul className=&quot;text-xs text-blue-700 space-y-1&quot;&gt; &lt;li&gt;โ€ข Be specific about the scene or setting you want&lt;/li&gt; &lt;li&gt;โ€ข Include details about lighting, colors, and mood&lt;/li&gt; &lt;li&gt;โ€ข Mention the style (realistic, artistic, vintage, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Example: &quot;Professional studio with soft lighting and neutral background&quot;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Replace specific controls */} {tool.id === &#x27;ai-replace&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div className=&quot;flex items-center gap-4&quot;&gt; &lt;label className=&quot;flex items-center gap-2&quot;&gt; &lt;Brush className=&quot;w-4 h-4&quot; /&gt; &lt;span className=&quot;text-sm font-medium&quot;&gt;Brush Size:&lt;/span&gt; &lt;/label&gt; &lt;input type=&quot;range&quot; min=&quot;5&quot; max=&quot;50&quot; value={replaceBrushSize} onChange={(e) =&gt; setReplaceBrushSize(Number(e.target.value))} className=&quot;flex-1&quot; /&gt; &lt;span className=&quot;text-sm text-gray-600 w-8&quot;&gt;{replaceBrushSize}px&lt;/span&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Text Prompt &lt;/label&gt; &lt;textarea value={textPrompt} onChange={(e) =&gt; setTextPrompt(e.target.value)} placeholder=&quot;Describe what you want to replace the painted areas with...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={3} /&gt; &lt;div className=&quot;mt-2&quot;&gt; &lt;span className=&quot;text-sm text-gray-600 mb-2 block&quot;&gt;Try an example:&lt;/span&gt; &lt;div className=&quot;flex flex-wrap gap-2&quot;&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setTextPrompt(&#x27;A beautiful cherry blossom tree&#x27;)} className=&quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot; &gt; Cherry Blossom Tree &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setTextPrompt(&#x27;Sunglasses with a futuristic design, cyberpunk style&#x27;)} className=&quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot; &gt; Futuristic Sunglasses &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setTextPrompt(&#x27;A classic red brick wall&#x27;)} className=&quot;px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors&quot; &gt; Red Brick Wall &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden&quot; style={{ display: &#x27;inline-block&#x27; }}&gt; &lt;img ref={replaceImageRef} src={selectedImage.preview} alt=&quot;Selected&quot; className=&quot;w-full h-auto&quot; draggable={false} onLoad={handleReplaceImageLoad} style={{ maxWidth: &#x27;100%&#x27;, display: &#x27;block&#x27; }} /&gt; &lt;canvas ref={replaceVisibleCanvasRef} className=&quot;absolute top-0 left-0 cursor-crosshair&quot; onMouseDown={startReplaceDrawing} onMouseMove={drawReplace} onMouseUp={() =&gt; setIsReplaceDrawing(false)} onMouseLeave={() =&gt; setIsReplaceDrawing(false)} style={{ zIndex: 10, opacity: 0.5 }} /&gt; &lt;canvas ref={replaceDataMaskCanvasRef} style={{ display: &#x27;none&#x27; }} /&gt; &lt;/div&gt; &lt;Button variant=&quot;outline&quot; onClick={clearReplaceCanvas} className=&quot;w-full&quot; &gt; Clear Mask &lt;/Button&gt; &lt;div className=&quot;bg-yellow-50 border border-yellow-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-yellow-800&quot;&gt; &lt;strong&gt;Important Note:&lt;/strong&gt; This tool generates a new image from your text. For best results: &lt;/p&gt; &lt;ul className=&quot;text-sm text-yellow-800 mt-2 ml-4 list-disc space-y-1&quot;&gt; &lt;li&gt;Describe what you want to see, don&#x27;t give commands. (e.g., say &quot;a tall sunflower,&quot; not &quot;replace this with a sunflower&quot;).&lt;/li&gt; &lt;li&gt;The AI works best on images containing human faces. Results on objects or landscapes may vary.&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Cartoon specific controls */} {tool.id === &#x27;ai-cartoon&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Select Persona&lt;/label&gt; &lt;div className=&quot;flex gap-4&quot;&gt; &lt;Button variant={selectedGender === &#x27;female&#x27; ? &#x27;primary&#x27; : &#x27;outline&#x27;} onClick={() =&gt; setSelectedGender(&#x27;female&#x27;)} &gt; Female &lt;/Button&gt; &lt;Button variant={selectedGender === &#x27;male&#x27; ? &#x27;primary&#x27; : &#x27;outline&#x27;} onClick={() =&gt; setSelectedGender(&#x27;male&#x27;)} &gt; Male &lt;/Button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Choose a Preset Style&lt;/label&gt; &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;&gt; {(selectedGender === &#x27;female&#x27; ? femaleCartoonStyles : maleCartoonStyles).map((style) =&gt; { const isSelected = selectedPresetUrl === style.imageUrl; return ( &lt;div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} onClick={() =&gt; setSelectedPresetUrl(style.imageUrl)} &gt; {/* The &quot;Clear Selection&quot; button - shows ONLY on the selected item */} {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); handleCartoonClearSelection(); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-auto object-cover&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); })} &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;space-y-4&quot;&gt; &lt;p className=&quot;text-sm font-medium text-gray-700 text-center&quot;&gt;Or Use a Custom Style&lt;/p&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Upload a Style Image&lt;/label&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; setCartoonStyleImage(e.target.files?.[0] || null)} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; disabled={!!selectedPresetUrl} /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Describe a Style with Text&lt;/label&gt; &lt;textarea value={cartoonTextPrompt} onChange={(e) =&gt; setCartoonTextPrompt(e.target.value)} placeholder=&quot;e.g., &#x27;anime style&#x27;, &#x27;Disney cartoon&#x27;...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={2} disabled={!!selectedPresetUrl} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Caricature specific controls */} {tool.id === &#x27;ai-caricature&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-yellow-50 border border-yellow-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-yellow-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; This tool works best with clear photos of human faces. Results on other subjects may vary. &lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Choose a Preset Style&lt;/label&gt; &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;&gt; {caricatureStyles.map((style) =&gt; { const isSelected = caricatureSelectedStyle?.imageUrl === style.imageUrl; return ( &lt;div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} onClick={() =&gt; setCaricatureSelectedStyle(style)} &gt; {/* The &quot;Clear Selection&quot; button - shows ONLY on the selected item */} {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); handleCaricatureClearSelection(); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-auto object-cover&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); })} &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;space-y-4&quot;&gt; &lt;p className=&quot;text-sm font-medium text-gray-700 text-center&quot;&gt;Or Use a Custom Style&lt;/p&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Upload a Style Image&lt;/label&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; setCaricatureCustomStyleImage(e.target.files?.[0] || null)} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; disabled={!!caricatureSelectedStyle} /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Describe a Style with Text&lt;/label&gt; &lt;textarea value={caricatureTextPrompt} onChange={(e) =&gt; setCaricatureTextPrompt(e.target.value)} placeholder=&quot;Optional: Add descriptive text to modify your chosen style...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={2} disabled={!!caricatureSelectedStyle} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Avatar specific controls */} {tool.id === &#x27;ai-avatar&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-blue-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; This tool generates the best avatars from a single, clear photo of a human face. &lt;/p&gt; &lt;/div&gt; {/* Gender Selection */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Select Gender&lt;/label&gt; &lt;div className=&quot;flex space-x-4&quot;&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setAvatarSelectedGender(&#x27;male&#x27;)} className={`px-4 py-2 rounded-md border ${ avatarSelectedGender === &#x27;male&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Male &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setAvatarSelectedGender(&#x27;female&#x27;)} className={`px-4 py-2 rounded-md border ${ avatarSelectedGender === &#x27;female&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Female &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Preset Style Gallery */} {avatarSelectedGender &amp;&amp; ( &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Choose a Preset Style&lt;/label&gt; &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;&gt; {avatarStyles .filter(style =&gt; style.gender === avatarSelectedGender) .map((style) =&gt; { const isSelected = avatarSelectedStyle?.imageUrl === style.imageUrl; return ( &lt;div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} onClick={() =&gt; setAvatarSelectedStyle(style)} &gt; {/* The &quot;Clear Selection&quot; button - shows ONLY on the selected item */} {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); handleAvatarClearSelection(); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-auto object-cover&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); }) } &lt;/div&gt; &lt;/div&gt; )} {/* Custom Style Section */} &lt;div className=&quot;space-y-4&quot;&gt; &lt;p className=&quot;text-sm font-medium text-gray-700 text-center&quot;&gt;Or Use a Custom Style&lt;/p&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Upload a Style Image&lt;/label&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; setAvatarCustomStyleImage(e.target.files?.[0] || null)} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; disabled={!!avatarSelectedStyle} /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Text Prompt (Optional)&lt;/label&gt; &lt;textarea value={avatarTextPrompt} onChange={(e) =&gt; setAvatarTextPrompt(e.target.value)} placeholder=&quot;Optional: Describe the avatar style you want...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={2} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Portrait specific controls */} {tool.id === &#x27;ai-portrait&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-purple-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; For best results, use a clear photo of a person&#x27;s face. &lt;/p&gt; &lt;/div&gt; {/* Gender Selection */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Select Gender&lt;/label&gt; &lt;div className=&quot;flex space-x-4&quot;&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setPortraitSelectedGender(&#x27;female&#x27;)} className={`px-4 py-2 rounded-md border ${ portraitSelectedGender === &#x27;female&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Female &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setPortraitSelectedGender(&#x27;male&#x27;)} className={`px-4 py-2 rounded-md border ${ portraitSelectedGender === &#x27;male&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Male &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Preset Style Gallery */} {portraitSelectedGender &amp;&amp; ( &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Choose a Preset Style&lt;/label&gt; &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4&quot;&gt; {portraitStyles .filter(style =&gt; style.gender === portraitSelectedGender) .map((style) =&gt; { const isSelected = portraitSelectedStyle?.imageUrl === style.imageUrl; return ( &lt;div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} onClick={() =&gt; setPortraitSelectedStyle(style)} &gt; {/* The &quot;Clear Selection&quot; button - shows ONLY on the selected item */} {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); setPortraitSelectedStyle(null); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-auto object-cover&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); }) } &lt;/div&gt; &lt;/div&gt; )} {/* Suggested Prompts */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Suggested Prompts&lt;/label&gt; &lt;div className=&quot;flex flex-wrap gap-2 mb-4&quot;&gt; {suggestedPortraitPrompts.map((prompt) =&gt; ( &lt;button key={prompt} onClick={() =&gt; setPortraitTextPrompt(prompt)} className=&quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot; &gt; {prompt} &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Custom Style Section */} &lt;div className=&quot;space-y-4&quot;&gt; &lt;p className=&quot;text-sm font-medium text-gray-700 text-center&quot;&gt;Or Use a Custom Style&lt;/p&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Upload a Style Image&lt;/label&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; setPortraitCustomStyleImage(e.target.files?.[0] || null)} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500&quot; disabled={!!portraitSelectedStyle} /&gt; &lt;/div&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt;Text Prompt&lt;/label&gt; &lt;textarea value={portraitTextPrompt} onChange={(e) =&gt; setPortraitTextPrompt(e.target.value)} placeholder=&quot;Describe the portrait style you want...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={2} disabled={!!portraitSelectedStyle} /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Product Photoshoot specific controls */} {tool.id === &#x27;ai-product-photoshoot&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-green-50 border border-green-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-green-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; This tool works best with clear product photos on neutral backgrounds. &lt;/p&gt; &lt;/div&gt; {/* Preset Style Gallery */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Choose a Style&lt;/h3&gt; &lt;div className=&quot;grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 max-h-96 overflow-y-auto&quot;&gt; {productStyles.map((style) =&gt; { const isSelected = selectedProductStyle?.name === style.name; return ( &lt;div key={style.name} onClick={() =&gt; { setSelectedProductStyle(style); setProductCustomStyleImage(null); // Clear custom image when preset is selected }} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-lg&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} &gt; {/* The &quot;Clear Selection&quot; button - shows ONLY on the selected item */} {isSelected &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); handleProductClearSelection(); }} className=&quot;absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform&quot; aria-label=&quot;Clear selection&quot; &gt; &lt;XCircle size={20} /&gt; &lt;/button&gt; )} &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-24 object-cover&quot; /&gt; &lt;div className=&quot;p-2 bg-gray-50&quot;&gt; &lt;p className=&quot;text-sm font-medium text-center&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; ); })} &lt;/div&gt; &lt;/div&gt; {/* Custom Style Image Upload */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Or Upload a Custom Style Image&lt;/h3&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; { const file = e.target.files?.[0] || null; setProductCustomStyleImage(file); if (file) { setSelectedProductStyle(null); // Clear preset when custom image is uploaded } }} className=&quot;block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100&quot; /&gt; {productCustomStyleImage &amp;&amp; ( &lt;p className=&quot;mt-2 text-sm text-green-600&quot;&gt;Custom style image selected: {productCustomStyleImage.name}&lt;/p&gt; )} &lt;/div&gt; {/* Suggested Prompts */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Don&#x27;t have a style? Try these prompts&lt;/h3&gt; &lt;div className=&quot;flex flex-wrap gap-2 mb-4&quot;&gt; {suggestedPrompts.map((prompt) =&gt; ( &lt;button key={prompt} onClick={() =&gt; setProductTextPrompt(prompt)} className=&quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot; &gt; {prompt} &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Text Prompt Input */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Text Prompt (Optional) &lt;/label&gt; &lt;textarea value={productTextPrompt} onChange={(e) =&gt; setProductTextPrompt(e.target.value)} placeholder=&quot;Describe the style or setting you want for your product photo...&quot; className=&quot;w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent&quot; rows={3} /&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Image Generator specific controls */} {tool.id === &#x27;ai-image-generator&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; {/* Resolution Selector */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-3&quot;&gt; Image Resolution &lt;/label&gt; &lt;div className=&quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3&quot;&gt; {imageResolutions.map((resolution) =&gt; ( &lt;div key={`${resolution.width}x${resolution.height}`} className={`cursor-pointer p-3 border-2 rounded-lg transition-colors ${ selectedResolution.width === resolution.width &amp;&amp; selectedResolution.height === resolution.height ? &#x27;border-blue-500 bg-blue-50&#x27; : &#x27;border-gray-200 hover:border-gray-300&#x27; }`} onClick={() =&gt; setSelectedResolution(resolution)} &gt; &lt;div className=&quot;text-sm font-medium&quot;&gt;{resolution.name}&lt;/div&gt; &lt;div className=&quot;text-xs text-gray-500&quot;&gt;{resolution.aspectRatio}&lt;/div&gt; &lt;div className=&quot;text-xs text-gray-400&quot;&gt;{resolution.width}x{resolution.height} px&lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Text Prompt Input */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Image Description &lt;/label&gt; &lt;textarea value={imageGeneratorTextPrompt} onChange={(e) =&gt; setImageGeneratorTextPrompt(e.target.value)} placeholder=&quot;Describe the image you want to generate in detail (e.g., &#x27;a majestic mountain landscape at sunset&#x27;, &#x27;portrait of a cat wearing sunglasses&#x27;, &#x27;abstract digital art with vibrant colors&#x27;)...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={4} /&gt; {/* Updated Tips Section to match AI Background Generator */} &lt;div className=&quot;mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tips for better results:&lt;/h4&gt; &lt;ul className=&quot;text-xs text-blue-700 space-y-1&quot;&gt; &lt;li&gt;โ€ข Be specific about style, colors, composition, and artistic elements&lt;/li&gt; &lt;li&gt;โ€ข Include details about lighting, mood, and atmosphere&lt;/li&gt; &lt;li&gt;โ€ข Mention art styles (realistic, cartoon, anime, oil painting, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Add quality descriptors (high quality, detailed, masterpiece, etc.)&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; {/* Suggested Prompts */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-3&quot;&gt; Suggested Prompts &lt;/label&gt; &lt;div className=&quot;grid grid-cols-1 gap-2 max-h-64 overflow-y-auto&quot;&gt; {imageGeneratorPrompts.map((prompt, index) =&gt; ( &lt;button key={index} type=&quot;button&quot; onClick={() =&gt; setImageGeneratorTextPrompt(prompt)} className=&quot;text-left px-3 py-2 text-sm bg-gray-50 hover:bg-gray-100 rounded-md border transition-colors&quot; &gt; {prompt} &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Outfit specific controls */} {tool.id === &#x27;ai-outfit&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-purple-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; This tool works best with clear photos of people wearing clothing. &lt;/p&gt; &lt;/div&gt; {/* Preset Outfit Styles */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Choose an Outfit Style&lt;/h3&gt; {Object.entries( presetOutfitStyles.reduce((acc, style) =&gt; { if (!acc[style.category]) acc[style.category] = []; acc[style.category].push(style); return acc; }, {} as Record&lt;string, typeof presetOutfitStyles&gt;) ).map(([category, styles]) =&gt; ( &lt;div key={category} className=&quot;mb-6&quot;&gt; &lt;h4 className=&quot;text-md font-medium text-gray-700 mb-3&quot;&gt;{category}&lt;/h4&gt; &lt;div className=&quot;grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3&quot;&gt; {styles.map((style) =&gt; ( &lt;button key={style.name} onClick={() =&gt; { setOutfitTextPrompt(style.prompt); debouncedScrollToGenerate(); }} className=&quot;p-3 text-left bg-gray-50 hover:bg-gray-100 rounded-lg border transition-colors&quot; &gt; &lt;div className=&quot;text-sm font-medium&quot;&gt;{style.name}&lt;/div&gt; &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; ))} &lt;/div&gt; {/* Suggested Prompts */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-4&quot;&gt;Suggested Outfit Ideas&lt;/h3&gt; &lt;div className=&quot;flex flex-wrap gap-2 mb-4&quot;&gt; {suggestedOutfitPrompts.map((prompt) =&gt; ( &lt;button key={prompt} onClick={() =&gt; setOutfitTextPrompt(prompt)} className=&quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors&quot; &gt; {prompt} &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Text Prompt Input */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Outfit Description &lt;/label&gt; &lt;textarea value={outfitTextPrompt} onChange={(e) =&gt; setOutfitTextPrompt(e.target.value)} placeholder=&quot;Describe the outfit you want to apply (e.g., &#x27;elegant black evening dress&#x27;, &#x27;casual denim jacket and jeans&#x27;, &#x27;professional business suit&#x27;)...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={4} /&gt; &lt;div className=&quot;mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tips for better results:&lt;/h4&gt; &lt;ul className=&quot;text-xs text-blue-700 space-y-1&quot;&gt; &lt;li&gt;โ€ข Be specific about clothing type, style, colors, and materials&lt;/li&gt; &lt;li&gt;โ€ข Include details about fit and silhouette (loose, fitted, flowing, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Mention specific garments (dress, shirt, pants, jacket, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Add style descriptors (casual, formal, vintage, modern, etc.)&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Image to Image specific controls */} {tool.id === &#x27;ai-image-to-image&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-blue-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; Upload a main image to transform and optionally a style reference image for visual guidance. &lt;/p&gt; &lt;/div&gt; {/* Main Image Upload */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-2&quot;&gt;1. Main Image&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;The image you want to transform&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setI2iMainImage(imageFile)} selectedImage={i2iMainImage} /&gt; &lt;/div&gt; {/* Style Image Upload */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-2&quot;&gt;2. Style Reference Image (Optional)&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;Upload an image to use as style guidance&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setI2iStyleImage(imageFile)} selectedImage={i2iStyleImage} /&gt; &lt;/div&gt; {/* Strength Sliders */} &lt;div className=&quot;space-y-4&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Image Strength: {i2iStrength.toFixed(1)} &lt;/label&gt; &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;1&quot; step=&quot;0.1&quot; value={i2iStrength} onChange={(e) =&gt; setI2iStrength(Number(e.target.value))} className=&quot;w-full&quot; /&gt; &lt;p className=&quot;text-xs text-gray-500 mt-1&quot;&gt; Higher strength makes the result look more like your main image &lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;div className=&quot;flex items-center gap-2 mb-2&quot;&gt; &lt;label className=&quot;text-sm font-medium text-gray-700&quot;&gt; Style Strength: {i2iStyleStrength.toFixed(1)} &lt;/label&gt; &lt;div className=&quot;relative group&quot;&gt; &lt;HelpCircle className=&quot;w-4 h-4 text-gray-400 cursor-help&quot; /&gt; &lt;div className=&quot;absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10&quot;&gt; Slider is disabled if no style image has been uploaded &lt;div className=&quot;absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;1&quot; step=&quot;0.1&quot; value={i2iStyleStrength} onChange={(e) =&gt; setI2iStyleStrength(Number(e.target.value))} disabled={!i2iStyleImage.file} className=&quot;w-full disabled:opacity-50 disabled:cursor-not-allowed&quot; /&gt; &lt;p className=&quot;text-xs text-gray-500 mt-1&quot;&gt; Higher strength makes the result look more like your style image {!i2iStyleImage.file &amp;&amp; &quot; (disabled - upload a style image first)&quot;} &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; {/* Text Prompt Input */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Enter Prompt * &lt;/label&gt; &lt;textarea value={i2iTextPrompt} onChange={(e) =&gt; setI2iTextPrompt(e.target.value)} placeholder=&quot;Describe the final image you want to create (e.g., &#x27;turn this into a watercolor painting&#x27;, &#x27;make it look like a vintage photograph&#x27;, &#x27;transform into a cyberpunk scene&#x27;)...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={4} required /&gt; &lt;div className=&quot;mt-3 bg-green-50 border border-green-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-green-800 mb-2&quot;&gt;๐Ÿ’ก Tips for better results:&lt;/h4&gt; &lt;ul className=&quot;text-xs text-green-700 space-y-1&quot;&gt; &lt;li&gt;โ€ข Be specific about the style, mood, or transformation you want&lt;/li&gt; &lt;li&gt;โ€ข Mention artistic styles (watercolor, oil painting, digital art, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Include lighting and atmosphere details (dramatic, soft, bright, etc.)&lt;/li&gt; &lt;li&gt;โ€ข Use the Image Strength slider to control how much of the original to keep&lt;/li&gt; &lt;li&gt;โ€ข Use the Style Strength slider to control style reference influence&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Sketch to Image specific controls */} {tool.id === &#x27;ai-sketch-to-image&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-6&quot;&gt; &lt;div className=&quot;bg-purple-50 border border-purple-200 rounded-lg p-3&quot;&gt; &lt;p className=&quot;text-sm text-purple-800&quot;&gt; &lt;strong&gt;Note:&lt;/strong&gt; Create or upload a sketch, then describe the final image you want to generate. &lt;/p&gt; &lt;/div&gt; {/* Input Mode Switcher */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-3&quot;&gt;1. Choose Input Method&lt;/h3&gt; &lt;div className=&quot;flex space-x-4&quot;&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setS2iInputMode(&#x27;upload&#x27;)} className={`px-4 py-2 rounded-md border ${ s2iInputMode === &#x27;upload&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Upload Sketch &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setS2iInputMode(&#x27;draw&#x27;)} className={`px-4 py-2 rounded-md border ${ s2iInputMode === &#x27;draw&#x27; ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; Draw Sketch &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; {/* Conditional Input */} {s2iInputMode === &#x27;upload&#x27; ? ( &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-2&quot;&gt;2. Upload Your Sketch&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;Upload an existing sketch or drawing&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setS2iSketchImage(imageFile)} selectedImage={s2iSketchImage} /&gt; &lt;/div&gt; ) : ( &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-2&quot;&gt;2. Draw Your Sketch&lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;Use the canvas below to draw your sketch&lt;/p&gt; {/* Drawing Controls */} &lt;div className=&quot;flex items-center gap-4 mb-3&quot;&gt; &lt;label className=&quot;flex items-center gap-2&quot;&gt; &lt;span className=&quot;text-sm font-medium&quot;&gt;Brush Size:&lt;/span&gt; &lt;/label&gt; &lt;input type=&quot;range&quot; min=&quot;1&quot; max=&quot;20&quot; value={s2iBrushSize} onChange={(e) =&gt; setS2iBrushSize(Number(e.target.value))} className=&quot;flex-1&quot; /&gt; &lt;span className=&quot;text-sm text-gray-600 w-8&quot;&gt;{s2iBrushSize}px&lt;/span&gt; &lt;label className=&quot;flex items-center gap-2&quot;&gt; &lt;span className=&quot;text-sm font-medium&quot;&gt;Color:&lt;/span&gt; &lt;input type=&quot;color&quot; value={s2iBrushColor} onChange={(e) =&gt; setS2iBrushColor(e.target.value)} className=&quot;w-8 h-8 rounded border&quot; /&gt; &lt;/label&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; { const canvas = drawingCanvasRef.current; if (canvas) { const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { ctx.fillStyle = &#x27;white&#x27;; ctx.fillRect(0, 0, canvas.width, canvas.height); } } }} className=&quot;px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded border&quot; &gt; Clear &lt;/button&gt; &lt;/div&gt; {/* Drawing Canvas */} &lt;div className=&quot;border-2 border-gray-300 rounded-lg overflow-hidden&quot;&gt; &lt;canvas ref={drawingCanvasRef} width={400} height={400} className=&quot;w-full h-auto cursor-crosshair bg-white&quot; onMouseDown={(e) =&gt; { setIsDrawingSketch(true); const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }} onMouseMove={(e) =&gt; { if (!isDrawingSketch) return; const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext(&#x27;2d&#x27;); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = &#x27;round&#x27;; ctx.stroke(); } } }} onMouseUp={() =&gt; setIsDrawingSketch(false)} onMouseLeave={() =&gt; setIsDrawingSketch(false)} /&gt; &lt;/div&gt; &lt;/div&gt; )} {/* Text Prompt Input */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; 3. Describe the Final Image * &lt;/label&gt; &lt;textarea value={s2iTextPrompt} onChange={(e) =&gt; setS2iTextPrompt(e.target.value)} placeholder=&quot;Describe the final image you want to create from your sketch (e.g., &#x27;a realistic portrait of a woman&#x27;, &#x27;a fantasy castle in a magical forest&#x27;, &#x27;a modern car design&#x27;)...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={4} required /&gt; &lt;/div&gt; {/* Style Image Upload */} &lt;div&gt; &lt;h3 className=&quot;text-lg font-semibold mb-2&quot;&gt;4. Style Reference Image &lt;/h3&gt; &lt;p className=&quot;text-sm text-gray-600 mb-3&quot;&gt;Upload an image to use as style guidance&lt;/p&gt; &lt;ImageDropzone onImageSelect={(imageFile) =&gt; setS2iStyleImage(imageFile)} selectedImage={s2iStyleImage} /&gt; &lt;/div&gt; {/* Strength Sliders */} &lt;div className=&quot;space-y-4&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Sketch Adherence: {s2iStrength.toFixed(1)} &lt;/label&gt; &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;1&quot; step=&quot;0.1&quot; value={s2iStrength} onChange={(e) =&gt; setS2iStrength(Number(e.target.value))} className=&quot;w-full&quot; /&gt; &lt;p className=&quot;text-xs text-gray-500 mt-1&quot;&gt; Higher values make the result follow your sketch more closely &lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;div className=&quot;flex items-center gap-2 mb-2&quot;&gt; &lt;label className=&quot;text-sm font-medium text-gray-700&quot;&gt; Style Strength: {s2iStyleStrength.toFixed(1)} &lt;/label&gt; &lt;div className=&quot;relative group&quot;&gt; &lt;HelpCircle className=&quot;w-4 h-4 text-gray-400 cursor-help&quot; /&gt; &lt;div className=&quot;absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10&quot;&gt; This slider is disabled if no style image is present &lt;div className=&quot;absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;1&quot; step=&quot;0.1&quot; value={s2iStyleStrength} onChange={(e) =&gt; setS2iStyleStrength(Number(e.target.value))} disabled={!s2iStyleImage.file} className=&quot;w-full disabled:opacity-50 disabled:cursor-not-allowed&quot; /&gt; &lt;p className=&quot;text-xs text-gray-500 mt-1&quot;&gt; Higher values make the result look more like your style image {!s2iStyleImage.file &amp;&amp; &quot; (disabled - upload a style image first)&quot;} &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;bg-green-50 border border-green-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-green-800 mb-2&quot;&gt;๐Ÿ’ก Tips for better results:&lt;/h4&gt; &lt;ul className=&quot;text-xs text-green-700 space-y-1&quot;&gt; &lt;li&gt;โ€ข Use clear, simple sketches with defined shapes and lines&lt;/li&gt; &lt;li&gt;โ€ข Be specific in your text prompt about style, colors, and details&lt;/li&gt; &lt;li&gt;โ€ข Higher sketch adherence preserves your drawing structure&lt;/li&gt; &lt;li&gt;โ€ข Style images help guide the artistic direction&lt;/li&gt; &lt;li&gt;โ€ข Try different combinations of sketch and style strength&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Hairstyle specific controls */} {tool.id === &#x27;ai-hairstyle&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Describe the hairstyle you want to try on &lt;/label&gt; &lt;textarea value={hairstyleTextPrompt} onChange={(e) =&gt; setHairstyleTextPrompt(e.target.value)} placeholder=&quot;Describe the hairstyle you want to try on...&quot; className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none&quot; rows={3} /&gt; &lt;/div&gt; &lt;div&gt; &lt;h3 className=&quot;text-sm font-medium text-gray-700 mb-3&quot;&gt;Or choose a preset style:&lt;/h3&gt; {/* This is the new JSX for the Hairstyle preset gallery */} &lt;div className=&quot;grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4 mt-4&quot;&gt; {hairstylePresets.map((style) =&gt; { const isSelected = selectedHairstylePrompt === style.prompt; return ( &lt;div key={style.name} className={`cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? &#x27;border-blue-500 shadow-md&#x27; : &#x27;border-transparent hover:border-gray-300&#x27; }`} // This is the core logic: click sets the prompt in both state variables onClick={() =&gt; { setHairstyleTextPrompt(style.prompt); setSelectedHairstylePrompt(style.prompt); }} &gt; &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-20 object-cover group-hover:opacity-90&quot; /&gt; &lt;p className=&quot;text-center text-xs p-1 bg-gray-100 truncate&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; ); })} &lt;/div&gt; &lt;/div&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tip:&lt;/h4&gt; &lt;p className=&quot;text-xs text-blue-700&quot;&gt; For best results, use a clear, front-facing photo with good lighting. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Image Upscaler specific controls */} {tool.id === &#x27;ai-image-upscaler&#x27; &amp;&amp; selectedImage.preview &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; {/* Display Image Dimensions */} {imageDimensions &amp;&amp; ( &lt;div className=&quot;bg-gray-50 border border-gray-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-gray-800 mb-1&quot;&gt;Current Image Size:&lt;/h4&gt; &lt;p className=&quot;text-sm text-gray-600&quot;&gt;{imageDimensions.width} x {imageDimensions.height}px&lt;/p&gt; &lt;/div&gt; )} {/* Upscale Factor Selection */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-3&quot;&gt; Select Upscale Factor &lt;/label&gt; &lt;div className=&quot;flex gap-3&quot;&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setUpscaleFactor(2)} disabled={!availableUpscaleOptions.includes(2)} className={`px-4 py-2 rounded-md border transition-colors ${ upscaleFactor === 2 ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : availableUpscaleOptions.includes(2) ? &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; : &#x27;bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed&#x27; }`} &gt; 2X &lt;/button&gt; &lt;button type=&quot;button&quot; onClick={() =&gt; setUpscaleFactor(4)} disabled={!availableUpscaleOptions.includes(4)} className={`px-4 py-2 rounded-md border transition-colors ${ upscaleFactor === 4 ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : availableUpscaleOptions.includes(4) ? &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; : &#x27;bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed&#x27; }`} &gt; 4X &lt;/button&gt; &lt;/div&gt; {availableUpscaleOptions.length === 0 &amp;&amp; ( &lt;p className=&quot;text-sm text-red-600 mt-2&quot;&gt; Image is too large for upscaling. Maximum size is 2048px on the longest side. &lt;/p&gt; )} {availableUpscaleOptions.length === 1 &amp;&amp; availableUpscaleOptions[0] === 2 &amp;&amp; ( &lt;p className=&quot;text-sm text-amber-600 mt-2&quot;&gt; Only 2X upscaling is available for images larger than 1024px on the longest side. &lt;/p&gt; )} &lt;/div&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tip:&lt;/h4&gt; &lt;p className=&quot;text-xs text-blue-700&quot;&gt; AI upscaling works best on photos and detailed images. The larger the upscale factor, the longer the processing time. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} {/* AI Filter specific controls */} {tool.id === &#x27;ai-filter&#x27; &amp;&amp; ( &lt;div className=&quot;space-y-4&quot;&gt; {/* Category Selection */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-3&quot;&gt; Filter Category &lt;/label&gt; &lt;div className=&quot;flex flex-wrap gap-2&quot;&gt; {filterCategories.map((category) =&gt; ( &lt;button key={category} type=&quot;button&quot; onClick={() =&gt; { setFilterSelectedCategory(category); setFilterSelectedStyle(null); // Reset selected style when category changes }} className={`px-3 py-2 rounded-md border text-sm transition-colors ${ filterSelectedCategory === category ? &#x27;bg-blue-500 text-white border-blue-500&#x27; : &#x27;bg-white text-gray-700 border-gray-300 hover:bg-gray-50&#x27; }`} &gt; {category} &lt;/button&gt; ))} &lt;/div&gt; &lt;/div&gt; {/* Style Selection */} &lt;div&gt; &lt;div className=&quot;flex items-center justify-between mb-3&quot;&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700&quot;&gt; Choose Style &lt;/label&gt; {filterSelectedStyle &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={handleFilterClearSelection} className=&quot;flex items-center space-x-1 text-xs text-gray-500 hover:text-gray-700 transition-colors&quot; &gt; &lt;X className=&quot;w-3 h-3&quot; /&gt; &lt;span&gt;Clear Selection&lt;/span&gt; &lt;/button&gt; )} &lt;/div&gt; &lt;div className=&quot;grid grid-cols-2 md:grid-cols-3 gap-3&quot;&gt; {aiFilterStyles .filter(style =&gt; style.category === filterSelectedCategory) .map((style) =&gt; ( &lt;div key={style.id} onClick={() =&gt; { setFilterSelectedStyle(style); setFilterUseCustom(false); }} className={`cursor-pointer border-2 rounded-lg overflow-hidden transition-all relative group ${ filterSelectedStyle?.id === style.id ? &#x27;border-blue-500 ring-2 ring-blue-200&#x27; : &#x27;border-gray-200 hover:border-gray-300&#x27; }`} &gt; &lt;img src={style.imageUrl} alt={style.name} className=&quot;w-full h-24 object-cover&quot; onError={(e) =&gt; { // Fallback for broken images const target = e.target as HTMLImageElement; target.src = &#x27;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2Y3ZjdmNyIvPjx0ZXh0IHg9IjUwIiB5PSI1NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmaWxsPSIjOTk5IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5TdHlsZTwvdGV4dD48L3N2Zz4=&#x27;; }} /&gt; {filterSelectedStyle?.id === style.id &amp;&amp; ( &lt;button type=&quot;button&quot; onClick={(e) =&gt; { e.stopPropagation(); handleFilterClearSelection(); }} className=&quot;absolute top-1 right-1 p-1 bg-white rounded-full shadow-md hover:bg-gray-50 transition-colors&quot; title=&quot;Clear Selection&quot; &gt; &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; strokeWidth=&quot;2&quot; strokeLinecap=&quot;round&quot; strokeLinejoin=&quot;round&quot; className=&quot;lucide lucide-xcircle text-gray-600&quot;&gt; &lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;10&quot;&gt;&lt;/circle&gt; &lt;path d=&quot;m15 9-6 6&quot;&gt;&lt;/path&gt; &lt;path d=&quot;m9 9 6 6&quot;&gt;&lt;/path&gt; &lt;/svg&gt; &lt;/button&gt; )} &lt;div className=&quot;p-2&quot;&gt; &lt;p className=&quot;text-xs font-medium text-gray-800 truncate&quot;&gt;{style.name}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )) } &lt;/div&gt; &lt;/div&gt; {/* Custom Style Option */} &lt;div className=&quot;border-t pt-4&quot;&gt; &lt;div className=&quot;flex items-center space-x-2 mb-3&quot;&gt; &lt;input type=&quot;checkbox&quot; id=&quot;use-custom-filter&quot; checked={filterUseCustom} onChange={(e) =&gt; { setFilterUseCustom(e.target.checked); if (e.target.checked) { setFilterSelectedStyle(null); } }} className=&quot;rounded border-gray-300 text-blue-600 focus:ring-blue-500&quot; /&gt; &lt;label htmlFor=&quot;use-custom-filter&quot; className=&quot;text-sm font-medium text-gray-700&quot;&gt; Use Custom Style &lt;/label&gt; &lt;/div&gt; {filterUseCustom &amp;&amp; ( &lt;div className=&quot;space-y-3&quot;&gt; {/* Custom Style Image Upload */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Upload Style Image (Optional) &lt;/label&gt; &lt;input type=&quot;file&quot; accept=&quot;image/jpeg,image/png&quot; onChange={(e) =&gt; { const file = e.target.files?.[0]; setFilterCustomStyleImage(file || null); }} className=&quot;block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100&quot; /&gt; &lt;/div&gt; {/* Text Prompt */} &lt;div&gt; &lt;label className=&quot;block text-sm font-medium text-gray-700 mb-2&quot;&gt; Text Prompt &lt;/label&gt; &lt;textarea value={filterTextPrompt} onChange={(e) =&gt; setFilterTextPrompt(e.target.value)} placeholder=&quot;Describe the style you want to apply...&quot; rows={3} className=&quot;w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent&quot; /&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;/div&gt; &lt;div className=&quot;bg-blue-50 border border-blue-200 rounded-lg p-3&quot;&gt; &lt;h4 className=&quot;text-sm font-medium text-blue-800 mb-2&quot;&gt;๐Ÿ’ก Tip:&lt;/h4&gt; &lt;p className=&quot;text-xs text-blue-700&quot;&gt; Choose from preset styles for quick results, or use custom style with text prompts for unique artistic effects. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; )} &lt;Button data-scroll-target=&quot;generate-button&quot; onClick={ tool.id === &#x27;ai-cleanup&#x27; ? handleAICleanupGenerate : tool.id === &#x27;watermark-remover&#x27; ? handleAIWatermarkRemoverGenerate : tool.id === &#x27;ai-expand&#x27; ? handleAIExpandGenerate : tool.id === &#x27;ai-replace&#x27; ? handleAIReplaceGenerate : tool.id === &#x27;ai-cartoon&#x27; ? handleAICartoonGenerate : tool.id === &#x27;ai-caricature&#x27; ? handleAICaricatureGenerate : tool.id === &#x27;ai-avatar&#x27; ? handleAIAvatarGenerate : tool.id === &#x27;ai-portrait&#x27; ? handleAIPortraitGenerate : tool.id === &#x27;ai-face-swap&#x27; ? handleAIFaceSwapGenerate : tool.id === &#x27;ai-product-photoshoot&#x27; ? handleAIProductPhotoshootGenerate : tool.id === &#x27;ai-background-generator&#x27; ? handleAIBackgroundGeneratorGenerate : tool.id === &#x27;ai-image-generator&#x27; ? handleAIImageGeneratorGenerate : tool.id === &#x27;ai-outfit&#x27; ? handleAIOutfitGenerate : tool.id === &#x27;ai-image-to-image&#x27; ? handleAIImageToImageGenerate : tool.id === &#x27;ai-sketch-to-image&#x27; ? handleAISketchToImageGenerate : tool.id === &#x27;ai-hairstyle&#x27; ? handleAIHairstyleGenerate : tool.id === &#x27;ai-image-upscaler&#x27; ? handleAIUpscalerGenerate : tool.id === &#x27;ai-filter&#x27; ? handleAIFilterGenerate : handleProcessImage } disabled={ processedImage.isLoading || (tool.id !== &#x27;ai-image-generator&#x27; &amp;&amp; tool.id !== &#x27;ai-face-swap&#x27; &amp;&amp; tool.id !== &#x27;ai-image-to-image&#x27; &amp;&amp; tool.id !== &#x27;ai-sketch-to-image&#x27; &amp;&amp; !selectedImage.file) || (tool.id === &#x27;ai-replace&#x27; &amp;&amp; !textPrompt.trim()) || (tool.id === &#x27;ai-background-generator&#x27; &amp;&amp; !backgroundTextPrompt.trim()) || (tool.id === &#x27;ai-image-generator&#x27; &amp;&amp; !imageGeneratorTextPrompt.trim()) || (tool.id === &#x27;ai-cartoon&#x27; &amp;&amp; !(selectedPresetUrl || cartoonStyleImage?.name)) || (tool.id === &#x27;ai-caricature&#x27; &amp;&amp; !caricatureSelectedStyle &amp;&amp; !caricatureCustomStyleImage) || (tool.id === &#x27;ai-avatar&#x27; &amp;&amp; !avatarSelectedStyle &amp;&amp; !avatarCustomStyleImage) || (tool.id === &#x27;ai-portrait&#x27; &amp;&amp; !portraitSelectedStyle &amp;&amp; !portraitCustomStyleImage) || (tool.id === &#x27;ai-face-swap&#x27; &amp;&amp; (!faceSwapTargetImage.file || (!selectedFaceSwapPreset &amp;&amp; !faceSwapSourceImage.file))) || (tool.id === &#x27;ai-product-photoshoot&#x27; &amp;&amp; !selectedProductStyle &amp;&amp; !productCustomStyleImage &amp;&amp; !productTextPrompt) || (tool.id === &#x27;ai-outfit&#x27; &amp;&amp; (!selectedImage.file || !outfitTextPrompt.trim())) || (tool.id === &#x27;ai-image-to-image&#x27; &amp;&amp; (!i2iMainImage.file || !i2iTextPrompt.trim())) || (tool.id === &#x27;ai-sketch-to-image&#x27; &amp;&amp; ( (s2iInputMode === &#x27;upload&#x27; &amp;&amp; !s2iSketchImage.file) || !s2iTextPrompt.trim() )) || (tool.id === &#x27;ai-hairstyle&#x27; &amp;&amp; (!selectedImage.file || !hairstyleTextPrompt.trim())) || (tool.id === &#x27;ai-image-upscaler&#x27; &amp;&amp; (!selectedImage.file || availableUpscaleOptions.length === 0)) || (tool.id === &#x27;ai-filter&#x27; &amp;&amp; (!selectedImage.file || (!filterSelectedStyle &amp;&amp; !filterCustomStyleImage &amp;&amp; !filterTextPrompt.trim()))) } className=&quot;w-full&quot; &gt; {processedImage.isLoading ? ( &lt;&gt; &lt;Loader className=&quot;w-4 h-4 mr-2 animate-spin&quot; /&gt; Generating... &lt;/&gt; ) : ( `Generate ${tool.name}` )} &lt;/Button&gt; &lt;/div&gt; &lt;div className=&quot;space-y-4&quot; data-scroll-target=&quot;result-container&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold&quot;&gt;Result&lt;/h2&gt; {processedImage.isLoading ? ( &lt;div className=&quot;border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center&quot;&gt; &lt;Loader className=&quot;w-10 h-10 text-blue-500 animate-spin mb-4&quot; /&gt; &lt;p className=&quot;text-gray-700&quot;&gt;Processing your image...&lt;/p&gt; &lt;/div&gt; ) : processedImage.url ? ( &lt;div className=&quot;space-y-4&quot;&gt; &lt;div className=&quot;border rounded-lg overflow-hidden&quot;&gt; &lt;img src={processedImage.url} alt=&quot;Processed result&quot; className=&quot;w-full h-auto&quot; /&gt; &lt;/div&gt; &lt;Button fullWidth onClick={handleDownload} leftIcon={&lt;Download size={18} /&gt;} &gt; Download Result &lt;/Button&gt; &lt;/div&gt; ) : processedImage.error ? ( &lt;div className=&quot;border-2 border-dashed border-red-300 bg-red-50 rounded-lg p-8 flex flex-col items-center justify-center&quot;&gt; &lt;p className=&quot;text-red-600 mb-2&quot;&gt;Error&lt;/p&gt; &lt;p className=&quot;text-gray-700 text-center&quot;&gt;{processedImage.error}&lt;/p&gt; &lt;/div&gt; ) : ( &lt;div className=&quot;border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center&quot;&gt; &lt;p className=&quot;text-gray-500&quot;&gt;Upload and process an image to see the result here&lt;/p&gt; &lt;/div&gt; )} &lt;/div&gt; &lt;/div&gt; {/* Tool Recommendations Section */} &lt;ToolRecommendations currentToolId={tool.id} hasResult={!!processedImage.url} /&gt; &lt;div className=&quot;mt-12 bg-gray-50 rounded-lg p-6&quot;&gt; &lt;h2 className=&quot;text-xl font-semibold mb-4&quot;&gt;About {tool.name}&lt;/h2&gt; &lt;p className=&quot;text-gray-700 mb-4&quot;&gt; Our {tool.name.toLowerCase()} tool uses advanced AI algorithms to {getToolDescription(tool)}. This tool is perfect for photographers, designers, social media managers, and anyone who wants to enhance their images. &lt;/p&gt; &lt;p className=&quot;text-gray-700&quot;&gt; Unlike other tools, ModernPhotoTools offers this service completely free with no watermarks. Try it now and see the difference! &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; // Helper function to generate more detailed descriptions for each tool function getToolDescription(tool: Tool): string { switch (tool.id) { case &#x27;remove-background&#x27;: return &#x27;automatically detect and remove backgrounds from any image, leaving you with a clean subject that can be placed on any new background&#x27;; case &#x27;ai-cleanup&#x27;: return &#x27;automatically detect and fix imperfections, remove unwanted objects, and enhance the overall quality of your photos. Simply paint over the areas you want to remove and let AI intelligently fill in the space&#x27;; case &#x27;watermark-remover&#x27;: return &#x27;automatically detect and remove watermarks, logos, and text overlays from uploaded images โ€” no manual selection needed&#x27;; case &#x27;ai-expand&#x27;: return &#x27;intelligently expand your images beyond their original boundaries, adding realistic content that matches the original image&#x27;; case &#x27;ai-replace&#x27;: return &#x27;replace objects or areas in your images with AI-generated content that seamlessly blends with the rest of the image&#x27;; case &#x27;ai-cartoon&#x27;: return &#x27;transform your photos into cartoon-style artwork with various artistic styles&#x27;; case &#x27;ai-portrait&#x27;: return &#x27;create realistic portrait transformations with professional styling and artistic effects&#x27;; case &#x27;ai-face-swap&#x27;: return &#x27;seamlessly swap faces between two images, allowing you to replace faces in photos with either preset faces or custom source images&#x27;; case &#x27;ai-product-photoshoot&#x27;: return &#x27;create professional product photography with AI-generated backgrounds and lighting that make your products look stunning&#x27;; case &#x27;ai-background-generator&#x27;: return &#x27;generate stunning new backgrounds for your images using AI, perfect for creating professional-looking photos with custom scenes&#x27;; case &#x27;ai-outfit&#x27;: return &#x27;virtually change clothing on people in photos using AI, allowing you to transform outfits with simple text descriptions&#x27;; case &#x27;ai-image-to-image&#x27;: return &#x27;transform any image based on text prompts and optional style references, with adjustable strength controls for precise artistic control&#x27;; case &#x27;ai-hairstyle&#x27;: return &#x27;virtually try on new hairstyles by uploading a photo and describing the desired look, perfect for experimenting with different hair styles and colors&#x27;; case &#x27;ai-image-upscaler&#x27;: return &#x27;enhance image resolution and quality using advanced AI upscaling technology, supporting 2x and 4x enlargement while preserving fine details and sharpness&#x27;; default: return &#x27;transform and enhance your images with professional-quality results&#x27;; } } export default ToolPage;</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ ToolsPage.tsx</div> <div class="content">import React from &#x27;react&#x27;; import SEO from &#x27;../components/ui/SEO&#x27;; import VideoToolCard from &#x27;../components/ui/VideoToolCard&#x27;; import { tools } from &#x27;../data/tools&#x27;; import { getVideoUrl } from &#x27;../utils/videoMapping&#x27;; import &#x27;../styles/video-tool-card.css&#x27;; const ToolsPage: React.FC = () =&gt; { return ( &lt;&gt; &lt;SEO title=&quot;All Photo Editing Tools&quot; description=&quot;Explore our complete collection of AI-powered photo editing tools. Transform, enhance, and perfect your images with professional results in seconds.&quot; /&gt; &lt;div className=&quot;min-h-screen bg-gray-50 py-12 px-[10%]&quot;&gt; &lt;div className=&quot;w-full mx-auto&quot;&gt; &lt;div className=&quot;max-w-3xl mx-auto text-center mb-12&quot;&gt; &lt;h1 className=&quot;text-4xl font-bold text-gray-900 mb-4&quot;&gt; All Photo Editing Tools &lt;/h1&gt; &lt;p className=&quot;text-gray-600&quot;&gt; Discover our complete collection of AI-powered tools to transform your photos &lt;/p&gt; &lt;/div&gt; &lt;div className=&quot;row row-cols-1 row-cols-sm-2 row-cols-md-3&quot;&gt; {tools.map((tool) =&gt; ( &lt;div key={tool.id} className=&quot;col mt-10 px-3 apiSectionBox&quot;&gt; &lt;VideoToolCard tool={tool} videoUrl={getVideoUrl(tool.name)} /&gt; &lt;/div&gt; ))} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/&gt; ); }; export default ToolsPage;</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ routes</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ scripts</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ runImageMappingTest.ts</div> <div class="content">#!/usr/bin/env node /** * Standalone script to run image mapping tests * Usage: npm run test:image-mapping */ import { runAllTests } from &#x27;../utils/testImageMapping&#x27;; async function main() { try { console.log(&#x27;๐ŸŽฏ Image Mapping Test Suite&#x27;); console.log(&#x27;============================\n&#x27;); await runAllTests(); console.log(&#x27;\n๐ŸŽ‰ Test suite completed successfully!&#x27;); process.exit(0); } catch (error) { console.error(&#x27;\n๐Ÿ’ฅ Test suite failed:&#x27;, error); process.exit(1); } } // Run the script main(); export default main;</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ services</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ styles</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ video-tool-card.css</div> <div class="content">@import url(&#x27;https://fonts.googleapis.com/css?family=Inter:100,200,300,400,500,600,700,800,900&amp;display=swap&#x27;); @font-face { font-family: Inter semibold; src: url(https://static.lightxeditor.com/assets/font/Inter/static/Inter-SemiBold.ttf) format(&quot;truetype&quot;); font-display: swap; } /* CSS Variables */ :root { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; --bs-link-hover-color-rgb: 41, 52, 203; --bs-link-color-rgb: var(--bs-link-hover-color-rgb); --bs-bg-opacity: 1; --bs-text-opacity: 1; --bs-white-rgb: 255, 255, 255; --bs-black-rgb: 0, 0, 0; --bs-body-font-family: Inter; --bs-body-font-size: .8125rem; --bs-body-font-weight: 400; --bs-body-line-height: 1.5; --bs-body-color: #272B34; --bs-body-bg: #fff; --bs-heading-color: inherit; --bs-border-radius-xxl: 2rem; --bs-border-radius-2xl: var(--bs-border-radius-xxl); } * { box-sizing: border-box; } *,:before,:after { box-sizing: border-box; } /* Container and responsive breakpoints */ @media all { .container { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; padding-right: calc(var(--bs-gutter-x) * .5); padding-left: calc(var(--bs-gutter-x) * .5); margin-right: auto; margin-left: auto; } } @media (min-width: 576px) { .container { max-width: 540px; } } @media (min-width: 768px) { .container { max-width: 720px; } } @media (min-width: 992px) { .container { max-width: 960px; } } @media (min-width: 1200px) { .container { max-width: 1140px; } } /* Width and margin utilities */ @media all { .w-100 { width: 100%!important; } .mx-auto { margin-right: auto!important; margin-left: auto!important; } } @media (min-width: 576px) { .col-sm-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 768px) { .col-md-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 992px) { .col-lg-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 1200px) { .col-xl-12 { flex: 0 0 auto; width: 100%; } } /* Row and grid system */ @media all { .row { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; display: flex; flex-wrap: wrap; margin-top: calc(-1 * var(--bs-gutter-y)); margin-right: calc(-.5 * var(--bs-gutter-x)); margin-left: calc(-.5 * var(--bs-gutter-x)); } .row &gt; * { flex-shrink: 0; width: 100%; max-width: 100%; padding-right: calc(var(--bs-gutter-x) * .5); padding-left: calc(var(--bs-gutter-x) * .5); margin-top: var(--bs-gutter-y); } .col { flex: 1 0 0; } .row-cols-1 &gt; * { flex: 0 0 auto; width: 100%; } } @media (min-width: 576px) { .row-cols-sm-2 &gt; * { flex: 0 0 auto; width: 50%; } } @media (min-width: 768px) { .row-cols-md-3 &gt; * { flex: 0 0 auto; width: 33.33333333%; } } /* Tailwind utility classes for new spacing */ .mt-10 { margin-top: 2.5rem; /* 40px */ } .px-3 { padding-left: 0.75rem; /* 12px */ padding-right: 0.75rem; /* 12px */ } /* API Section Box with hover effect - optimized for compact layout */ @media (min-width: 577px) { .apiSectionBox:hover { transform: translateY(-6px); /* Reduced from -8px for subtler effect */ transition: all .3s ease; } } /* Links */ a { color: rgba(var(--bs-link-color-rgb),var(--bs-link-opacity, 1)); text-decoration: none; } a:hover { --bs-link-color-rgb: var(--bs-link-hover-color-rgb); text-decoration: none; } /* Background and border radius */ .bg-white { --bs-bg-opacity: 1; background-color: rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important; } .rounded-20 { border-radius: 20px!important; } /* Video styling - letterboxed display with 3.5x scale down */ .responsive { width: 100%; height: auto; aspect-ratio: 9/16; object-fit: contain; /* Changed from cover to contain for letterboxing */ max-height: 259.1px; /* Scaled down by 3.5x from 200px */ max-width: 137.1px; /* Scaled down proportionally for 9:16 aspect ratio */ margin: 0 auto; /* Center the video */ background-color: #000; /* Black background for letterboxing effect */ } /* Card body - optimized padding */ .card-body { flex: 1 1 auto; padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x); color: var(--bs-card-color); } .p-3 { padding: 0.75rem!important; /* Reduced from 1rem for more compact layout */ } .card-body { padding: 0; } /* Typography - optimized for compact layout */ h3 { margin-top: 0; margin-bottom: .25rem; /* Reduced from .5rem */ font-weight: 500; line-height: 1.1; /* Reduced from 1.2 for tighter spacing */ color: var(--bs-heading-color); font-size: calc(1.1rem + .15vw); /* Slightly smaller than original */ } @media (min-width: 1200px) { h3 { font-size: 1.25rem; /* Reduced from 1.421875rem */ } } h3 { font-size: 20px; /* Reduced from 24px */ line-height: 24px; /* Reduced from 29.96px */ } .mb-0 { margin-bottom: 0!important; } .pb-2 { padding-bottom: .25rem!important; /* Reduced from .5rem */ } .text-black { --bs-text-opacity: 1; color: rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important; } .text-xxl { font-size: 1.1rem!important; /* Reduced from 1.25rem */ } .text-semi { font-family: Inter semibold!important; } .text-black { color: #000!important; } p { margin-top: 0; margin-bottom: 0.5rem; /* Reduced from 1rem */ } p { font-family: Inter; } p { margin-bottom: 0; } p { font-size: 14px; /* Reduced from 16px */ line-height: 20px; /* Reduced from 25.6px */ font-weight: 400; } .text-lg { font-size: 0.875rem!important; /* Reduced from 1rem */ } /* Flexbox utilities */ .d-flex { display: flex!important; } .justify-content-between { justify-content: space-between!important; } .align-items-center { align-items: center!important; } /* New item badge */ .new_item { position: relative; padding-right: 13px; } .new_item:after,.new_badge:after { content: url(https://static.lightxeditor.com/assets/icons/newbadge.svg); position: relative; top: 3px; padding-left: 4px; }</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ supabaseClient.ts</div> <div class="content">import { createClient } from &#x27;@supabase/supabase-js&#x27;; const supabaseUrl = &#x27;https://waktyxmmvkzmzkagekcq.supabase.co&#x27;; const supabaseAnonKey = &#x27;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Indha3R5eG1tdmt6bXprYWdla2NxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDg3ODI0NTAsImV4cCI6MjA2NDM1ODQ1MH0._FBlnWAP4wZHZhHlL4Fxufx1n3WFDAFv7hxlMH0ZPrs&#x27;; export const supabase = createClient(supabaseUrl, supabaseAnonKey);</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ types</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ index.ts</div> <div class="content">export interface Tool { id: string; name: string; description: string; icon: string; path: string; apiEndpoint: string; } export interface ImageFile { file: File | null; preview: string | null; } export interface ProcessedImage { url: string | null; isLoading: boolean; error: string | null; } export interface FaceSwapStyle { name: string; imageUrl: string; gender: &#x27;male&#x27; | &#x27;female&#x27; | &#x27;any&#x27;; }</div> <div class="folder" style="margin-left: 20px;">๐Ÿ“ utils</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ aiProviders.ts</div> <div class="content">import { composeMicroFromBase, type MicroFields } from &#x27;./microComposer&#x27; export interface AISuggestion { fields: MicroFields } export interface AIProvider { suggest(basePrompt: string): Promise&lt;AISuggestion&gt; } class RemoteProvider implements AIProvider { async suggest(basePrompt: string): Promise&lt;AISuggestion&gt; { try { const res = await fetch(&#x27;/api/ai-suggest&#x27;, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ basePrompt, provider: &#x27;openai&#x27; }) }) if (!res.ok) throw new Error(&#x27;remote failed&#x27;) const data = await res.json() if (data &amp;&amp; data.fields) return { fields: data.fields as MicroFields } throw new Error(&#x27;invalid response&#x27;) } catch { const fields = composeMicroFromBase(basePrompt) return { fields } } } } export function getAIProvider(): AIProvider { return new RemoteProvider() }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ api.ts</div> <div class="content">// src/utils/api.ts import { getSiteOrigin } from &#x27;./siteConfig&#x27;; // Debug utility to control console output const DEBUG_MODE = import.meta.env.DEV || ( typeof window !== &quot;undefined&quot; &amp;&amp; typeof window.localStorage !== &quot;undefined&quot; &amp;&amp; window.localStorage.getItem(&#x27;debug&#x27;) === &#x27;true&#x27; ); const debugLog = (...args: any[]) =&gt; { if (DEBUG_MODE) { console.log(...args); } }; // Helper function to safely determine environment and base URL for SSR compatibility function getEnvironmentConfig() { const baseUrl = getSiteOrigin(); const isProduction = typeof window !== &#x27;undefined&#x27; ? (window.location.hostname !== &#x27;localhost&#x27; &amp;&amp; window.location.hostname !== &#x27;127.0.0.1&#x27;) : (import.meta.env.PROD || process.env.NODE_ENV === &#x27;production&#x27;); return { isProduction, baseUrl }; } // Add this helper function inside src/utils/api.ts export async function convertUrlToBlob(url: string): Promise&lt;Blob&gt; { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch image from URL: ${url}`); } const blob = await response.blob(); return blob; } // AI Cleanup V2 API Functions export async function uploadImageAndGetUrl(file: File): Promise&lt;string&gt; { try { // Use the Netlify function URL in production, fallback to local proxy for development const { baseUrl } = getEnvironmentConfig(); // Step 1: Get upload URL const uploadUrlResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v2/uploadImageUrl&#x27;, body: { uploadType: &#x27;imageUrl&#x27;, // &lt;--- THIS IS THE CORRECTED LINE size: file.size, contentType: file.type, } }), }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; // Step 2: Upload image to the presigned URL const uploadImageResponse = await fetch(uploadImage, { method: &#x27;PUT&#x27;, headers: { &#x27;Content-Type&#x27;: file.type, }, body: file, }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } // Clean the returned URL by removing any potential backticks, spaces, and other unwanted characters const cleanImageUrl = imageUrl.trim().replace(/[\`\s&#x27;&quot;]/g, &#x27;&#x27;); return cleanImageUrl; } catch (error) { debugLog(&#x27;Error uploading image:&#x27;, error); throw error; } } export async function startCleanupJob({ originalImageUrl, maskedImageUrl }: { originalImageUrl: string; maskedImageUrl: string }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/cleanup-picture&#x27;, // NOTE: Endpoint is v1 for job submission as per some docs, changed from v2 body: { imageUrl: originalImageUrl, maskedImageUrl: maskedImageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cleanup job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cleanup job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting cleanup job:&#x27;, error); throw error; } } // Watermark Remover job โ€“ implemented via the same cleanup endpoint // This keeps the API surface explicit while leveraging existing backend behavior. export async function startWatermarkRemoverJob({ imageUrl }: { imageUrl: string }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v2/watermark-remover&#x27;, body: { imageUrl: imageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start watermark remover job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid watermark remover job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting watermark remover job:&#x27;, error); throw error; } } // Dedicated status poller for Watermark Remover (API v2) per tool documentation export async function pollWatermarkJobUntilComplete(orderId: string): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); let resultUrl = &#x27;&#x27;; let retries = 0; const maxRetries = 5; // per DOC: maxRetriesAllowed = 5 const pollIntervalMs = 3000; // per DOC: poll every 3 seconds while (!resultUrl &amp;&amp; retries &lt; maxRetries) { if (retries &gt; 0) { await new Promise((resolve) =&gt; setTimeout(resolve, pollIntervalMs)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v2/order-status&#x27;, body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === &#x27;FAIL&#x27;) { const errorMessage = orderStatus.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.description || &#x27;&#x27;; const statusCode = orderStatus.statusCode; console.error(&#x27;LightX API Error:&#x27;, { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === &#x27;active&#x27; &amp;&amp; orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === &#x27;failed&#x27;) { const errorMessage = orderStatus.body.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.body.description || &#x27;&#x27;; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } else { // status could be &#x27;init&#x27; per DOC; continue polling } retries++; } if (!resultUrl) { throw new Error(&#x27;Processing timeout: The image is taking longer than expected to process. Please try again later.&#x27;); } debugLog(&#x27;Watermark removal completed successfully:&#x27;, resultUrl); return resultUrl; } catch (error) { console.error(&#x27;Error polling watermark job status:&#x27;, error); throw error; } } export async function checkOrderStatus(orderId: string): Promise&lt;any&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/order-status&#x27;, // NOTE: Using v1 for status check, consistent with remove-bg body: { orderId: orderId, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to check order status: ${response.status} - ${errorText}`); } const data = await response.json(); return data; } catch (error) { console.error(&#x27;Error checking order status:&#x27;, error); throw error; } } export async function pollJobUntilComplete(orderId: string): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); let resultUrl = &#x27;&#x27;; let retries = 0; const maxRetries = 20; const basePollInterval = 3000; while (!resultUrl &amp;&amp; retries &lt; maxRetries) { if (retries &gt; 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15000); debugLog(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) =&gt; setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/order-status&#x27;, body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === &#x27;FAIL&#x27;) { const errorMessage = orderStatus.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.description || &#x27;&#x27;; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = &#x27;The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.&#x27;; } console.error(&#x27;LightX API Error:&#x27;, { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === &#x27;active&#x27; &amp;&amp; orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === &#x27;failed&#x27;) { const errorMessage = orderStatus.body.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.body.description || &#x27;&#x27;; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } retries++; } if (!resultUrl) { throw new Error(&#x27;Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.&#x27;); } debugLog(&#x27;Image processing completed successfully:&#x27;, resultUrl); return resultUrl; } catch (error) { console.error(&#x27;Error polling job status:&#x27;, error); throw error; } } // NOTE: Keeping the processImage function for other tools as-is export async function processImage(toolApiEndpoint: string, imageFile: File): Promise&lt;string&gt; { try { // Validate image before processing const maxFileSize = 10 * 1024 * 1024; // 10MB const supportedTypes = [&#x27;image/jpeg&#x27;, &#x27;image/jpg&#x27;, &#x27;image/png&#x27;, &#x27;image/webp&#x27;]; if (imageFile.size &gt; maxFileSize) { throw new Error(&#x27;Image file is too large. Please use an image smaller than 10MB.&#x27;); } if (!supportedTypes.includes(imageFile.type.toLowerCase())) { throw new Error(&#x27;Unsupported image format. Please use JPG, PNG, or WebP.&#x27;); } debugLog(&#x27;Image validation passed:&#x27;, { size: `${(imageFile.size / 1024 / 1024).toFixed(2)}MB`, type: imageFile.type, name: imageFile.name }); // Use the Netlify function URL in production, fallback to local proxy for development const { isProduction, baseUrl } = getEnvironmentConfig(); debugLog(&#x27;Environment detection:&#x27;, { isProduction, baseUrl }); debugLog(&#x27;Starting image processing...&#x27;); // Step 1: Get upload URL from LightXEditor via proxy const uploadUrlResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v2/uploadImageUrl&#x27;, body: { uploadType: &#x27;imageUrl&#x27;, size: imageFile.size, contentType: imageFile.type, } }), }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; debugLog(&#x27;Upload successful, imageUrl: &#x27;, imageUrl); // Step 2: Upload image directly to S3 using the pre-signed URL const uploadImageResponse = await fetch(uploadImage, { method: &#x27;PUT&#x27;, headers: { &#x27;Content-Type&#x27;: imageFile.type, &#x27;Content-Length&#x27;: imageFile.size.toString(), }, body: imageFile, }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } debugLog(&#x27;S3 upload successful, waiting for image to be available...&#x27;); await new Promise(resolve =&gt; setTimeout(resolve, 2000)); // Wait 2 seconds // Step 3: Call remove-background API with retry logic let removeBackgroundResponse; let backgroundRemovalData; let bgRetries = 0; const maxBgRetries = 3; while (bgRetries &lt; maxBgRetries) { try { removeBackgroundResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/remove-background&#x27;, body: { imageUrl: imageUrl, } }), }); if (!removeBackgroundResponse.ok) { const errorText = await removeBackgroundResponse.text(); throw new Error(`Failed to remove background: ${removeBackgroundResponse.status} - ${errorText}`); } backgroundRemovalData = await removeBackgroundResponse.json(); break; } catch (error) { bgRetries++; if (bgRetries &gt;= maxBgRetries) { throw error; } debugLog(`Remove background attempt ${bgRetries} failed, retrying in 2 seconds...`); await new Promise(resolve =&gt; setTimeout(resolve, 2000)); } } if (!backgroundRemovalData || !backgroundRemovalData.body || !backgroundRemovalData.body.orderId) { throw new Error(`Invalid remove background response: ${JSON.stringify(backgroundRemovalData)}`); } const { orderId } = backgroundRemovalData.body; // Step 4: Poll for order status using V2 endpoint with exponential backoff let resultUrl = &#x27;&#x27;; let retries = 0; const maxRetries = 20; const basePollInterval = 3000; while (!resultUrl &amp;&amp; retries &lt; maxRetries) { if (retries &gt; 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15000); debugLog(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) =&gt; setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/order-status&#x27;, body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === &#x27;FAIL&#x27;) { const errorMessage = orderStatus.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.description || &#x27;&#x27;; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = &#x27;The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.&#x27;; } console.error(&#x27;LightX API Error:&#x27;, { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === &#x27;active&#x27; &amp;&amp; orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === &#x27;failed&#x27;) { const errorMessage = orderStatus.body.message || &#x27;Unknown error&#x27;; const errorDescription = orderStatus.body.description || &#x27;&#x27;; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : &#x27;&#x27;}`); } retries++; } if (!resultUrl) { throw new Error(&#x27;Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.&#x27;); } debugLog(&#x27;Image processing completed successfully:&#x27;, resultUrl); return resultUrl; } catch (error) { console.error(&#x27;Error processing image:&#x27;, error); throw error; } } // AI Expand Photo function export async function startExpandJob({ imageUrl, padding }: { imageUrl: string; padding: { top: number; left: number; bottom: number; right: number; } }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/expand-photo&#x27;, // The correct endpoint for this tool body: { imageUrl: imageUrl, topPadding: padding.top, leftPadding: padding.left, bottomPadding: padding.bottom, rightPadding: padding.right, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start expand job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid expand job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting expand job:&#x27;, error); throw error; } } // AI Replace function export async function startReplaceJob({ originalImageUrl, maskedImageUrl, prompt }: { originalImageUrl: string; maskedImageUrl: string; prompt: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); // DEFINE THE REQUEST BODY SEPARATELY const requestPayload = { endpoint: &#x27;v1/replace&#x27;, body: { imageUrl: originalImageUrl, maskedImageUrl: maskedImageUrl, textPrompt: prompt, } }; const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, // USE THE VARIABLE HERE body: JSON.stringify(requestPayload) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start replace job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid replace job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting replace job:&#x27;, error); throw error; } } export async function startProductPhotoshootJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/product-photoshoot&#x27;, // The correct endpoint for this tool body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start product photoshoot job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid product photoshoot job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting product photoshoot job:&#x27;, error); throw error; } } export async function startCartoonJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/cartoon&#x27;, body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cartoon job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cartoon job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting cartoon job:&#x27;, error); throw error; } } export async function startCaricatureJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/caricature&#x27;, body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start caricature job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid caricature job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting caricature job:&#x27;, error); throw error; } } export async function startAvatarJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/avatar&#x27;, body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start avatar job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid avatar job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting avatar job:&#x27;, error); throw error; } } export async function startBackgroundGeneratorJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/background-generator&#x27;, body: { imageUrl: imageUrl, textPrompt: textPrompt } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start background generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid background generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting background generator job:&#x27;, error); throw error; } } export async function startImageGeneratorJob({ textPrompt, width, height }: { textPrompt: string; width?: number; height?: number; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/text2image&#x27;, body: { textPrompt: textPrompt, width: width, height: height } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting image generator job:&#x27;, error); throw error; } } export async function startPortraitJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/portrait&#x27;, body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || &quot;&quot;, textPrompt: textPrompt || &quot;&quot; } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start portrait job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid portrait job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting portrait job:&#x27;, error); throw error; } } export async function startFaceSwapJob({ imageUrl, styleImageUrl }: { imageUrl: string; styleImageUrl: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/face-swap&#x27;, body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start face swap job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid face swap job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting face swap job:&#x27;, error); throw error; } } export async function startOutfitJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27;, }, body: JSON.stringify({ endpoint: &#x27;v1/outfit&#x27;, body: { imageUrl: imageUrl, textPrompt: textPrompt, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start outfit job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid outfit job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting outfit job:&#x27;, error); throw error; } } interface ImageToImageParams { imageUrl: string; textPrompt: string; styleImageUrl?: string; strength?: number; styleStrength?: number; } export async function startImageToImageJob(params: ImageToImageParams): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ endpoint: &#x27;v1/image2image&#x27;, // The correct endpoint for this tool body: jobBody }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting image-to-image job:&#x27;, error); throw error; } } interface SketchToImageParams { imageUrl: string; // The user&#x27;s sketch, either drawn or uploaded textPrompt: string; strength?: number; styleImageUrl?: string; styleStrength?: number; } export async function startSketchToImageJob(params: SketchToImageParams): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ endpoint: &#x27;v1/sketch2image&#x27;, // The correct endpoint for this tool body: jobBody }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start sketch-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid sketch-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting sketch-to-image job:&#x27;, error); throw error; } } export async function startHairstyleJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ endpoint: &#x27;v1/hairstyle&#x27;, // The correct endpoint for this tool body: { imageUrl: imageUrl, textPrompt: textPrompt, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start hairstyle job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid hairstyle job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting hairstyle job:&#x27;, error); throw error; } } export async function startUpscaleJob({ imageUrl, quality }: { imageUrl: string; quality: 2 | 4; }): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ endpoint: &#x27;v2/upscale&#x27;, // IMPORTANT: This is a v2 endpoint body: { imageUrl: imageUrl, quality: quality, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start upscale job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid upscale job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting upscale job:&#x27;, error); throw error; } } interface AIFilterParams { imageUrl: string; styleImageUrl?: string; textPrompt: string; } export async function startAIFilterJob(params: AIFilterParams): Promise&lt;string&gt; { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: &#x27;POST&#x27;, headers: { &#x27;Content-Type&#x27;: &#x27;application/json&#x27; }, body: JSON.stringify({ endpoint: &#x27;v2/aifilter&#x27;, // The correct endpoint for AI Filter body: jobBody }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start AI filter job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid AI filter job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error(&#x27;Error starting AI filter job:&#x27;, error); throw error; } } </div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ blogLoader.ts</div> <div class="content">import { BlogArticle } from &#x27;../data/blogArticles&#x27;; // Use Vite&#x27;s glob import to get all markdown files const blogModules = import.meta.glob(&#x27;/content/blog/*.md&#x27;, { as: &#x27;raw&#x27;, eager: true }); export interface BlogArticleWithContent extends BlogArticle { rawContent: string; } // Cache for parsed articles let articlesCache: BlogArticleWithContent[] | null = null; /** * Browser-compatible frontmatter parser */ function parseFrontmatter(content: string): { data: any; content: string } { const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/; const match = content.match(frontmatterRegex); if (!match) { return { data: {}, content }; } const [, yamlContent, markdownContent] = match; const data: any = {}; // Simple YAML parser for frontmatter const lines = yamlContent.split(&#x27;\n&#x27;); let currentKey = &#x27;&#x27;; let inArray = false; let arrayItems: string[] = []; for (const line of lines) { const trimmed = line.trim(); if (trimmed &amp;&amp; !trimmed.startsWith(&#x27;#&#x27;)) { // Handle array items if (trimmed.startsWith(&#x27;- &#x27;)) { if (inArray) { arrayItems.push(trimmed.substring(2).trim().replace(/^[&quot;&#x27;]|[&quot;&#x27;]$/g, &#x27;&#x27;)); } continue; } // If we were in an array, save it if (inArray &amp;&amp; currentKey) { data[currentKey] = arrayItems; inArray = false; arrayItems = []; currentKey = &#x27;&#x27;; } const colonIndex = trimmed.indexOf(&#x27;:&#x27;); if (colonIndex &gt; 0) { const key = trimmed.substring(0, colonIndex).trim(); let value = trimmed.substring(colonIndex + 1).trim(); // Check if this is the start of an array if (value === &#x27;&#x27; || value === &#x27;[&#x27;) { currentKey = key; inArray = true; arrayItems = []; continue; } // Handle inline arrays if (value.startsWith(&#x27;[&#x27;) &amp;&amp; value.endsWith(&#x27;]&#x27;)) { const arrayContent = value.slice(1, -1); data[key] = arrayContent.split(&#x27;,&#x27;).map(item =&gt; item.trim().replace(/^[&quot;&#x27;]|[&quot;&#x27;]$/g, &#x27;&#x27;)); continue; } // Remove quotes if present if ((value.startsWith(&#x27;&quot;&#x27;) &amp;&amp; value.endsWith(&#x27;&quot;&#x27;)) || (value.startsWith(&quot;&#x27;&quot;) &amp;&amp; value.endsWith(&quot;&#x27;&quot;))) { value = value.slice(1, -1); } data[key] = value; } } } // Handle final array if we ended in one if (inArray &amp;&amp; currentKey) { data[currentKey] = arrayItems; } return { data, content: markdownContent }; } /** * Load and parse all blog articles from markdown files */ export async function loadBlogArticles(): Promise&lt;BlogArticleWithContent[]&gt; { if (articlesCache) { return articlesCache; } const articles: BlogArticleWithContent[] = []; for (const [path, content] of Object.entries(blogModules)) { try { // Parse frontmatter and content const { data, content: markdownContent } = parseFrontmatter(content as string); // Extract filename without extension for ID validation const filename = path.split(&#x27;/&#x27;).pop()?.replace(&#x27;.md&#x27;, &#x27;&#x27;) || &#x27;&#x27;; // Create article object const article: BlogArticleWithContent = { id: data.id || filename, title: data.title || &#x27;Untitled&#x27;, excerpt: data.excerpt || &#x27;&#x27;, content: markdownContent, rawContent: content as string, publishDate: data.publishDate || new Date().toISOString().split(&#x27;T&#x27;)[0], readTime: data.readTime || &#x27;5 min read&#x27;, category: data.category || &#x27;general&#x27;, featuredImage: data.featuredImage || &#x27;/images/blog/default.svg&#x27;, relatedTool: data.relatedTool, keywords: data.keywords ? (Array.isArray(data.keywords) ? data.keywords : [data.keywords]) : [] }; articles.push(article); } catch (error) { console.error(`Error parsing blog article at ${path}:`, error); } } // Sort articles by publish date (newest first) articles.sort((a, b) =&gt; new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()); articlesCache = articles; return articles; } /** * Get a single article by ID */ export async function getBlogArticleById(id: string): Promise&lt;BlogArticleWithContent | undefined&gt; { const articles = await loadBlogArticles(); return articles.find(article =&gt; article.id === id); } /** * Get articles by category */ export async function getBlogArticlesByCategory(category: &#x27;general&#x27; | &#x27;tools&#x27;): Promise&lt;BlogArticleWithContent[]&gt; { const articles = await loadBlogArticles(); return articles.filter(article =&gt; article.category === category); } /** * Get recent articles */ export async function getRecentBlogArticles(limit: number = 3): Promise&lt;BlogArticleWithContent[]&gt; { const articles = await loadBlogArticles(); return articles.slice(0, limit); } /** * Clear the articles cache (useful for development) */ export function clearBlogCache(): void { articlesCache = null; } /** * Get all article IDs for routing */ export async function getAllBlogArticleIds(): Promise&lt;string[]&gt; { const articles = await loadBlogArticles(); return articles.map(article =&gt; article.id); }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ fileUtils.ts</div> <div class="content">// Convert file to base64 data URL export function fileToDataURL(file: File): Promise&lt;string&gt; { return new Promise((resolve, reject) =&gt; { const reader = new FileReader(); reader.onload = () =&gt; resolve(reader.result as string); reader.onerror = reject; reader.readAsDataURL(file); }); }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ imageMapper.ts</div> <div class="content">import { tools } from &#x27;../data/tools&#x27;; export interface ImageMapping { toolId: string; toolName: string; imagePath: string; imageExists: boolean; altText: string; } export interface MappingResult { successful: ImageMapping[]; failed: { toolId: string; toolName: string; reason: string; }[]; summary: { totalTools: number; successfulMappings: number; failedMappings: number; }; } /** * Normalizes tool names to match potential image filenames * Handles various naming conventions and formats */ export function normalizeToolName(toolName: string): string[] { const normalized = toolName.toLowerCase() .replace(/[^a-z0-9\s-]/g, &#x27;&#x27;) // Remove special characters except spaces and hyphens .replace(/\s+/g, &#x27;-&#x27;) // Replace spaces with hyphens .replace(/-+/g, &#x27;-&#x27;) // Replace multiple hyphens with single hyphen .replace(/^-|-$/g, &#x27;&#x27;); // Remove leading/trailing hyphens // Generate multiple possible variations const variations = [ normalized, normalized.replace(/-/g, &#x27;&#x27;), // Remove all hyphens normalized.replace(/-/g, &#x27;_&#x27;), // Replace hyphens with underscores toolName.toLowerCase().replace(/\s+/g, &#x27;&#x27;), // Remove all spaces, keep original case pattern toolName.toLowerCase().replace(/\s+/g, &#x27;_&#x27;), // Replace spaces with underscores ]; // Remove duplicates return [...new Set(variations)]; } /** * Special mapping for tools where the filename doesn&#x27;t match the tool name exactly */ const SPECIAL_FILENAME_MAPPINGS: Record&lt;string, string&gt; = { &#x27;AI Caricature&#x27;: &#x27;AI Caricature Generator Tool.jpg&#x27;, &#x27;AI Expand&#x27;: &#x27;Ai Expand tool.jpg&#x27;, &#x27;AI Replace&#x27;: &#x27;AI Replace tool.jpg&#x27;, &#x27;Remove Background&#x27;: &#x27;Remove Background tool.jpg&#x27; }; /** * Generates possible image filenames based on tool ID and name */ export function generateImageFilenames(toolId: string, toolName: string): string[] { // Check for special mappings first if (SPECIAL_FILENAME_MAPPINGS[toolName]) { return [SPECIAL_FILENAME_MAPPINGS[toolName]]; } const filenames: string[] = []; // Use the tool name as-is for most cases const cleanName = toolName.replace(/^AI\s+/, &#x27;&#x27;); // Remove &quot;AI &quot; prefix if present // Most common pattern: &quot;AI [Tool Name] Tool.jpg&quot; (capital T) filenames.push(`AI ${cleanName} Tool.jpg`); // Alternative pattern: &quot;AI [Tool Name] tool.jpg&quot; (lowercase t) filenames.push(`AI ${cleanName} tool.jpg`); // Pattern with lowercase &quot;Ai&quot;: &quot;Ai [Tool Name] tool.jpg&quot; filenames.push(`Ai ${cleanName} tool.jpg`); // Special case for Remove Background: &quot;[Tool Name] tool.jpg&quot; (no AI prefix) filenames.push(`${cleanName} tool.jpg`); // Fallback patterns filenames.push(`AI ${cleanName}.jpg`); filenames.push(`${cleanName}.jpg`); // Also try with the full tool name filenames.push(`${toolName} Tool.jpg`); filenames.push(`${toolName} tool.jpg`); filenames.push(`${toolName}.jpg`); return [...new Set(filenames)]; // Remove duplicates } /** * Checks if an image file exists in the tools images directory */ export async function checkImageExists(filename: string): Promise&lt;boolean&gt; { // In Node.js environment (for testing) if (typeof window === &#x27;undefined&#x27;) { const fs = await import(&#x27;fs&#x27;); const path = await import(&#x27;path&#x27;); try { const imagePath = path.join(process.cwd(), &#x27;public&#x27;, &#x27;images&#x27;, &#x27;tools images&#x27;, filename); return fs.existsSync(imagePath); } catch { return false; } } // In browser environment try { const response = await fetch(`/images/tools images/${filename}`, { method: &#x27;HEAD&#x27; }); return response.ok; } catch { return false; } } /** * Finds the correct image file for a tool */ export async function findToolImage(toolId: string, toolName: string): Promise&lt;string | null&gt; { const possibleFilenames = generateImageFilenames(toolId, toolName); for (const filename of possibleFilenames) { if (await checkImageExists(filename)) { return filename; } } return null; } /** * Generates appropriate alt text for tool images */ export function generateAltText(toolName: string): string { return `${toolName} - AI-powered photo editing tool interface and features`; } /** * Creates a comprehensive mapping of all tools to their images */ export async function createToolImageMapping(): Promise&lt;MappingResult&gt; { const successful: ImageMapping[] = []; const failed: { toolId: string; toolName: string; reason: string; }[] = []; console.log(&#x27;๐Ÿ” Starting tool image mapping process...&#x27;); console.log(`๐Ÿ“Š Total tools to process: ${tools.length}`); for (const tool of tools) { try { console.log(`๐Ÿ”„ Processing tool: ${tool.name} (ID: ${tool.id})`); const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { const mapping: ImageMapping = { toolId: tool.id, toolName: tool.name, imagePath: `/images/tools images/${imageFilename}`, imageExists: true, altText: generateAltText(tool.name) }; successful.push(mapping); console.log(`โœ… Successfully mapped: ${tool.name} โ†’ ${imageFilename}`); } else { failed.push({ toolId: tool.id, toolName: tool.name, reason: &#x27;No matching image file found&#x27; }); console.log(`โŒ Failed to find image for: ${tool.name}`); } } catch (error) { failed.push({ toolId: tool.id, toolName: tool.name, reason: `Error during processing: ${error instanceof Error ? error.message : &#x27;Unknown error&#x27;}` }); console.log(`๐Ÿ’ฅ Error processing ${tool.name}: ${error}`); } } const result: MappingResult = { successful, failed, summary: { totalTools: tools.length, successfulMappings: successful.length, failedMappings: failed.length } }; console.log(&#x27;\n๐Ÿ“ˆ Mapping Summary:&#x27;); console.log(`โœ… Successful mappings: ${result.summary.successfulMappings}`); console.log(`โŒ Failed mappings: ${result.summary.failedMappings}`); console.log(`๐Ÿ“Š Success rate: ${((result.summary.successfulMappings / result.summary.totalTools) * 100).toFixed(1)}%`); if (failed.length &gt; 0) { console.log(&#x27;\nโŒ Failed mappings details:&#x27;); failed.forEach(failure =&gt; { console.log(` โ€ข ${failure.toolName} (${failure.toolId}): ${failure.reason}`); }); } return result; } /** * Validates image file format */ export function isValidImageFormat(filename: string): boolean { const validExtensions = [&#x27;.jpg&#x27;, &#x27;.jpeg&#x27;, &#x27;.png&#x27;, &#x27;.webp&#x27;, &#x27;.svg&#x27;]; const extension = filename.toLowerCase().substring(filename.lastIndexOf(&#x27;.&#x27;)); return validExtensions.includes(extension); } /** * Generates responsive image HTML with proper styling */ export function generateImageHTML(mapping: ImageMapping): string { return ` &lt;div className=&quot;tool-feature-image mb-8 mt-6&quot;&gt; &lt;img src=&quot;${mapping.imagePath}&quot; alt=&quot;${mapping.altText}&quot; className=&quot;w-full max-w-2xl mx-auto rounded-lg shadow-lg object-cover&quot; style={{ maxHeight: &#x27;400px&#x27;, objectFit: &#x27;cover&#x27; }} loading=&quot;lazy&quot; onError={(e) =&gt; { console.error(&#x27;Failed to load tool image:&#x27;, &#x27;${mapping.imagePath}&#x27;); e.currentTarget.style.display = &#x27;none&#x27;; }} /&gt; &lt;/div&gt; `; }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ microComposer.ts</div> <div class="content">export interface MicroFields { Message: string Intention: string Context: string Rhythm: string Output: string KeyFeatures: string } function clean(s: string): string { return s.replace(/\s+/g, &#x27; &#x27;).trim() } function detectOutput(base: string): string { const s = base.toLowerCase() if (/\bdescription\b/.test(s)) return &#x27;Product description&#x27; if (/\bscript\b/.test(s)) return &#x27;YouTube script&#x27; if (s.includes(&#x27;blog&#x27;) || s.includes(&#x27;article&#x27;) || s.includes(&#x27;post&#x27;)) return &#x27;Blog post&#x27; if (s.includes(&#x27;email&#x27;)) return &#x27;Marketing email&#x27; if (s.includes(&#x27;caption&#x27;)) return &#x27;Social caption&#x27; return &#x27;Structured prompt&#x27; } function detectContext(base: string): string { const s = base.toLowerCase() if (s.includes(&#x27;product&#x27;)) return &#x27;E-commerce product page&#x27; if (s.includes(&#x27;marketing&#x27;) || s.includes(&#x27;sell&#x27;) || s.includes(&#x27;campaign&#x27;)) return &#x27;Marketing content review&#x27; if (s.includes(&#x27;youtube&#x27;) || s.includes(&#x27;video&#x27;)) return &#x27;YouTube audience&#x27; if (s.includes(&#x27;portfolio&#x27;)) return &#x27;Portfolio website&#x27; return &#x27;General audience with practical goals&#x27; } function detectRhythm(base: string): string { const s = base.toLowerCase() if (s.includes(&#x27;professional&#x27;)) return &#x27;Professional and concise&#x27; if (s.includes(&#x27;fun&#x27;) || s.includes(&#x27;friendly&#x27;)) return &#x27;Friendly and engaging&#x27; if (s.includes(&#x27;premium&#x27;) || s.includes(&#x27;luxury&#x27;)) return &#x27;Elegant and premium&#x27; return &#x27;Concise, confident, and helpful&#x27; } function extractSubject(base: string): string { const m = base.match(/for ([^.,;]+)/i) if (m) return clean(m[1]) const words = base.split(/[^a-zA-Z0-9]+/).filter(Boolean) return clean(words.slice(0, 6).join(&#x27; &#x27;)) } function guessKeyFeatures(base: string): string { const lower = base.toLowerCase() if (lower.includes(&#x27;earbuds&#x27;) || lower.includes(&#x27;headphones&#x27;)) return &#x27;Noise cancellation, 30hr battery, Bluetooth 5.3&#x27; if (lower.includes(&#x27;camera&#x27;)) return &#x27;4K video, 24MP sensor, fast autofocus&#x27; if (lower.includes(&#x27;laptop&#x27;)) return &#x27;OLED display, 16GB RAM, lightweight&#x27; return &#x27;Key benefit 1, Key benefit 2, Key specification 3&#x27; } export function composeMicroFromBase(basePrompt: string): MicroFields { const subject = extractSubject(basePrompt) const Output = detectOutput(basePrompt) const Context = detectContext(basePrompt) const Rhythm = detectRhythm(basePrompt) const KeyFeatures = guessKeyFeatures(basePrompt) const Message = clean(`Create ${Output.toLowerCase()} for ${subject}`) const Intention = clean(&#x27;Inform and persuade the audience to take action&#x27;) return { Message, Intention, Context, Rhythm, Output, KeyFeatures } }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ promptEngine.ts</div> <div class="content">export type Framework = &#x27;ICDF&#x27; | &#x27;RCREOC&#x27; | &#x27;MICRO&#x27; | &#x27;COSTAR&#x27; export interface KeywordMap { framework: Framework keywords: string[] weight: number } export const DETECTION_RULES: KeywordMap[] = [ { framework: &#x27;ICDF&#x27;, keywords: [&#x27;analyze&#x27;,&#x27;review&#x27;,&#x27;evaluate&#x27;,&#x27;assess&#x27;,&#x27;data&#x27;,&#x27;metrics&#x27;,&#x27;performance&#x27;,&#x27;statistics&#x27;,&#x27;report&#x27;,&#x27;insights&#x27;], weight: 1 }, { framework: &#x27;RCREOC&#x27;, keywords: [&#x27;expert&#x27;,&#x27;professional&#x27;,&#x27;advice&#x27;,&#x27;consult&#x27;,&#x27;opinion&#x27;,&#x27;feedback&#x27;,&#x27;critique&#x27;,&#x27;recommend&#x27;,&#x27;specialist&#x27;], weight: 1 }, { framework: &#x27;MICRO&#x27;, keywords: [&#x27;write&#x27;,&#x27;create&#x27;,&#x27;content&#x27;,&#x27;blog&#x27;,&#x27;script&#x27;,&#x27;post&#x27;,&#x27;article&#x27;,&#x27;story&#x27;,&#x27;caption&#x27;,&#x27;image&#x27;,&#x27;photo&#x27;,&#x27;picture&#x27;,&#x27;generate&#x27;], weight: 1 }, { framework: &#x27;COSTAR&#x27;, keywords: [&#x27;sell&#x27;,&#x27;marketing&#x27;,&#x27;email&#x27;,&#x27;ad&#x27;,&#x27;promotion&#x27;,&#x27;sales&#x27;,&#x27;campaign&#x27;,&#x27;offer&#x27;,&#x27;discount&#x27;,&#x27;buy&#x27;,&#x27;customer&#x27;], weight: 1 } ] export interface AnalysisResult { scores: Record&lt;Framework, number&gt; topFrameworks: Framework[] } function tokenize(input: string): string[] { return input.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean) } export function analyzePrompt(input: string): AnalysisResult { const tokens = tokenize(input) const baseScores: Record&lt;Framework, number&gt; = { ICDF: 0, RCREOC: 0, MICRO: 0, COSTAR: 0 } for (const rule of DETECTION_RULES) { let score = 0 for (const k of rule.keywords) { const occurrences = tokens.reduce((acc, t) =&gt; acc + (t === k ? 1 : 0), 0) if (occurrences &gt; 0) score += occurrences * rule.weight } baseScores[rule.framework] += score } const maxScore = Math.max(...Object.values(baseScores)) const topFrameworks = (maxScore === 0) ? [&#x27;MICRO&#x27;] : (Object.entries(baseScores) .filter(([, v]) =&gt; v === maxScore) .map(([k]) =&gt; k as Framework)) return { scores: baseScores, topFrameworks } } export const TOOLTIPS: Record&lt;Framework, Record&lt;string, string&gt;&gt; = { ICDF: { Instruction: &#x27;The specific task you want the AI to perform.&#x27;, Context: &#x27;The background, purpose, or why behind the instruction.&#x27;, Data: &#x27;The specific information or inputs the AI should work with.&#x27;, Format: &#x27;The shape and structure of the desired output.&#x27; }, RCREOC: { Role: &#x27;Assign the AI a job title to operate as an expert.&#x27;, Context: &#x27;Describe the situation and environment the Role works in.&#x27;, Request: &#x27;The specific task for the Role to complete.&#x27;, Examples: &#x27;Provide samples of the thinking or output you want.&#x27;, Output: &#x27;Define the structure of the final deliverable.&#x27;, Constraints: &#x27;Set rules like tone, length, and style.&#x27; }, MICRO: { Message: &#x27;The core idea or thesis you want to communicate.&#x27;, Intention: &#x27;The purpose of the content and desired effect.&#x27;, Context: &#x27;Who the audience is and where they see this.&#x27;, Rhythm: &#x27;The tone, style, and pace of the content.&#x27;, Output: &#x27;The final format such as script, post, or article.&#x27; }, COSTAR: { Context: &#x27;What is this for, such as a marketing email or ad.&#x27;, Offer: &#x27;The promotion details or product being highlighted.&#x27;, Style: &#x27;The tone and voice, aligned with brand and goal.&#x27;, Target: &#x27;The audience demographics and psychographics.&#x27;, Action: &#x27;The single desired user action to take.&#x27;, Result: &#x27;The business objective this prompt should drive.&#x27; } } export interface StructuredSection { header: string body: string } export interface GenerationResult { text: string sections: StructuredSection[] rationale: string } function formatHeader(h: string): string { return `## ${h}` } export function generateStructuredPrompt(framework: Framework, fields: Record&lt;string, string | string[]&gt;): GenerationResult { const sections: StructuredSection[] = [] if (framework === &#x27;ICDF&#x27;) { sections.push({ header: &#x27;Instruction&#x27;, body: String(fields[&#x27;Instruction&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Context&#x27;, body: String(fields[&#x27;Context&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Data&#x27;, body: String(fields[&#x27;Data&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Format&#x27;, body: String(fields[&#x27;Format&#x27;] || &#x27;&#x27;).trim() }) } if (framework === &#x27;RCREOC&#x27;) { sections.push({ header: &#x27;Role&#x27;, body: String(fields[&#x27;Role&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Context&#x27;, body: String(fields[&#x27;Context&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Request&#x27;, body: String(fields[&#x27;Request&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Examples&#x27;, body: String(fields[&#x27;Examples&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Output&#x27;, body: String(fields[&#x27;Output&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Constraints&#x27;, body: String(fields[&#x27;Constraints&#x27;] || &#x27;&#x27;).trim() }) } if (framework === &#x27;MICRO&#x27;) { sections.push({ header: &#x27;Message&#x27;, body: String(fields[&#x27;Message&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Intention&#x27;, body: String(fields[&#x27;Intention&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Context&#x27;, body: String(fields[&#x27;Context&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Rhythm&#x27;, body: String(fields[&#x27;Rhythm&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Output&#x27;, body: String(fields[&#x27;Output&#x27;] || &#x27;&#x27;).trim() }) } if (framework === &#x27;COSTAR&#x27;) { sections.push({ header: &#x27;Context&#x27;, body: String(fields[&#x27;Context&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Offer&#x27;, body: String(fields[&#x27;Offer&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Style&#x27;, body: String(fields[&#x27;Style&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Target&#x27;, body: String(fields[&#x27;Target&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Action&#x27;, body: String(fields[&#x27;Action&#x27;] || &#x27;&#x27;).trim() }) sections.push({ header: &#x27;Result&#x27;, body: String(fields[&#x27;Result&#x27;] || &#x27;&#x27;).trim() }) } const text = sections.map(s =&gt; `${formatHeader(s.header)}\n${s.body}`).join(&#x27;\n\n&#x27;) const rationale = buildRationale(framework) return { text, sections, rationale } } function buildRationale(framework: Framework): string { const intro = ( framework === &#x27;ICDF&#x27; ? &#x27;ICDF ensures clarity by defining the task, purpose, exact inputs, and the required output structure so the AI delivers precise, analytical results.&#x27; : framework === &#x27;RCREOC&#x27; ? &#x27;RCREOC turns the AI into a role-driven expert with complete context, explicit tasks, examples, structured output, and constraints for targeted results.&#x27; : framework === &#x27;MICRO&#x27; ? &#x27;MICRO balances message, intention, audience context, tone, and format to maintain creative direction and produce high-impact content.&#x27; : &#x27;COSTAR frames persuasive prompts with situation, offer, style, audience, single action, and the business goal to drive conversions.&#x27; ) const tips = TOOLTIPS[framework] const lines = Object.entries(tips).map(([k, v]) =&gt; `- ${k}: ${v}`) return `${intro}\n${lines.join(&#x27;\n&#x27;)}` } export interface RecentPromptEntry { id: string basePrompt: string framework: Framework finalText: string createdAt: number } const LOCAL_KEY = &#x27;prompt_generator_recent_v1&#x27; export function saveRecentPrompt(entry: RecentPromptEntry): void { if (typeof window === &#x27;undefined&#x27;) return const raw = window.localStorage.getItem(LOCAL_KEY) const list: RecentPromptEntry[] = raw ? JSON.parse(raw) : [] const updated = [entry, ...list].slice(0, 10) window.localStorage.setItem(LOCAL_KEY, JSON.stringify(updated)) } export function getRecentPrompts(): RecentPromptEntry[] { if (typeof window === &#x27;undefined&#x27;) return [] const raw = window.localStorage.getItem(LOCAL_KEY) try { return raw ? JSON.parse(raw) : [] } catch { return [] } } export function isLikelyMarketing(input: string): boolean { const { scores } = analyzePrompt(input) return scores[&#x27;COSTAR&#x27;] &gt; 0 } export function normalizeWhitespace(s: string): string { return s.replace(/\s+/g, &#x27; &#x27;).trim() }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ quality.ts</div> <div class="content">import type { MicroFields } from &#x27;./microComposer&#x27; export interface FieldIssue { field: keyof MicroFields message: string } export interface QualityReport { issues: FieldIssue[] } function notEmpty(s: string): boolean { return s.trim().length &gt; 0 } function maxLen(s: string, n: number): boolean { return s.length &lt;= n } function hasAtLeastTwoFeatures(s: string): boolean { const parts = s.split(/[,\n]+/).map(x =&gt; x.trim()).filter(Boolean) return parts.length &gt;= 2 } export function validateMicro(fields: MicroFields): QualityReport { const issues: FieldIssue[] = [] if (!notEmpty(fields.Message)) issues.push({ field: &#x27;Message&#x27;, message: &#x27;Message is required&#x27; }) if (!notEmpty(fields.Intention)) issues.push({ field: &#x27;Intention&#x27;, message: &#x27;Intention is required&#x27; }) if (!notEmpty(fields.Context)) issues.push({ field: &#x27;Context&#x27;, message: &#x27;Context is required&#x27; }) if (!notEmpty(fields.Rhythm)) issues.push({ field: &#x27;Rhythm&#x27;, message: &#x27;Rhythm is required&#x27; }) if (!notEmpty(fields.Output)) issues.push({ field: &#x27;Output&#x27;, message: &#x27;Output is required&#x27; }) if (!notEmpty(fields.KeyFeatures)) issues.push({ field: &#x27;KeyFeatures&#x27;, message: &#x27;Key Features are required&#x27; }) if (!hasAtLeastTwoFeatures(fields.KeyFeatures)) issues.push({ field: &#x27;KeyFeatures&#x27;, message: &#x27;Provide at least two key features&#x27; }) if (!maxLen(fields.Message, 160)) issues.push({ field: &#x27;Message&#x27;, message: &#x27;Message should be concise&#x27; }) if (!maxLen(fields.Intention, 160)) issues.push({ field: &#x27;Intention&#x27;, message: &#x27;Intention should be concise&#x27; }) if (!maxLen(fields.Context, 160)) issues.push({ field: &#x27;Context&#x27;, message: &#x27;Context should be concise&#x27; }) if (!maxLen(fields.Rhythm, 80)) issues.push({ field: &#x27;Rhythm&#x27;, message: &#x27;Rhythm should be short&#x27; }) if (!maxLen(fields.Output, 80)) issues.push({ field: &#x27;Output&#x27;, message: &#x27;Output should be short&#x27; }) return { issues } } export function optimizeMicro(fields: MicroFields): MicroFields { const trim = (s: string) =&gt; s.replace(/\s+/g, &#x27; &#x27;).trim() return { Message: trim(fields.Message), Intention: trim(fields.Intention), Context: trim(fields.Context), Rhythm: trim(fields.Rhythm), Output: trim(fields.Output), KeyFeatures: trim(fields.KeyFeatures) } }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ scrollUtils.ts</div> <div class="content">/** * Scroll utility functions for enhanced user experience * Provides device-adaptive scrolling with smooth animations */ /** * Device detection utility */ export const getDeviceType = (): &#x27;mobile&#x27; | &#x27;tablet&#x27; | &#x27;desktop&#x27; =&gt; { const width = window.innerWidth; if (width &lt; 768) { return &#x27;mobile&#x27;; } else if (width &lt; 1024) { return &#x27;tablet&#x27;; } else { return &#x27;desktop&#x27;; } }; /** * Check if device supports smooth scrolling */ export const supportsSmoothScrolling = (): boolean =&gt; { return &#x27;scrollBehavior&#x27; in document.documentElement.style; }; /** * Scroll to element with device-adaptive behavior */ export interface ScrollToElementOptions { element: HTMLElement | null; behavior?: &#x27;smooth&#x27; | &#x27;auto&#x27;; block?: &#x27;start&#x27; | &#x27;center&#x27; | &#x27;end&#x27; | &#x27;nearest&#x27;; inline?: &#x27;start&#x27; | &#x27;center&#x27; | &#x27;end&#x27; | &#x27;nearest&#x27;; offset?: number; duration?: number; } export const scrollToElement = (options: ScrollToElementOptions): Promise&lt;void&gt; =&gt; { return new Promise((resolve) =&gt; { const { element, behavior = &#x27;smooth&#x27;, block = &#x27;start&#x27;, inline = &#x27;nearest&#x27;, offset = 0, duration = 400 } = options; if (!element) { resolve(); return; } const deviceType = getDeviceType(); const supportsSmooth = supportsSmoothScrolling(); // Calculate target position const elementRect = element.getBoundingClientRect(); const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; let targetScrollTop = currentScrollTop + elementRect.top + offset; // Device-specific adjustments if (deviceType === &#x27;mobile&#x27;) { // On mobile, add some padding to account for virtual keyboards and mobile UI targetScrollTop -= 20; } else if (deviceType === &#x27;desktop&#x27;) { // On desktop, center the element better in viewport targetScrollTop -= window.innerHeight * 0.1; } // Ensure we don&#x27;t scroll past the document bounds const maxScroll = document.documentElement.scrollHeight - window.innerHeight; targetScrollTop = Math.max(0, Math.min(targetScrollTop, maxScroll)); if (supportsSmooth &amp;&amp; behavior === &#x27;smooth&#x27;) { // Use native smooth scrolling if supported element.scrollIntoView({ behavior: &#x27;smooth&#x27;, block, inline }); // Estimate completion time for native smooth scrolling setTimeout(() =&gt; resolve(), duration); } else { // Fallback: manual smooth scrolling animation const startTime = performance.now(); const startScrollTop = currentScrollTop; const distance = targetScrollTop - startScrollTop; const animateScroll = (currentTime: number) =&gt; { const elapsed = currentTime - startTime; const progress = Math.min(elapsed / duration, 1); // Easing function (ease-out) const easeOut = 1 - Math.pow(1 - progress, 3); const currentScrollTop = startScrollTop + (distance * easeOut); window.scrollTo(0, currentScrollTop); if (progress &lt; 1) { requestAnimationFrame(animateScroll); } else { resolve(); } }; requestAnimationFrame(animateScroll); } }); }; /** * Scroll to result container with device-adaptive behavior */ export const scrollToResultContainer = async (): Promise&lt;void&gt; =&gt; { const resultContainer = document.querySelector(&#x27;[data-scroll-target=&quot;result-container&quot;]&#x27;) as HTMLElement; if (!resultContainer) { // Fallback: look for result section by class or text content const fallbackContainer = document.querySelector(&#x27;.space-y-4 h2&#x27;)?.parentElement as HTMLElement; if (fallbackContainer) { await scrollToElement({ element: fallbackContainer, behavior: &#x27;smooth&#x27;, block: &#x27;start&#x27;, offset: -20, duration: 400 }); } return; } const deviceType = getDeviceType(); await scrollToElement({ element: resultContainer, behavior: &#x27;smooth&#x27;, block: deviceType === &#x27;mobile&#x27; ? &#x27;start&#x27; : &#x27;center&#x27;, offset: deviceType === &#x27;mobile&#x27; ? -10 : -50, duration: 400 }); }; /** * Scroll to Generate button with consistent behavior */ export const scrollToGenerateButton = async (): Promise&lt;void&gt; =&gt; { const generateButton = document.querySelector(&#x27;[data-scroll-target=&quot;generate-button&quot;]&#x27;) as HTMLElement; if (!generateButton) { // Fallback: look for button with &quot;Generate&quot; text const buttons = Array.from(document.querySelectorAll(&#x27;button&#x27;)); const fallbackButton = buttons.find(btn =&gt; btn.textContent?.includes(&#x27;Generate&#x27;) || btn.textContent?.includes(&#x27;Generating&#x27;) ) as HTMLElement; if (fallbackButton) { await scrollToElement({ element: fallbackButton, behavior: &#x27;smooth&#x27;, block: &#x27;center&#x27;, offset: -30, duration: 300 }); } return; } await scrollToElement({ element: generateButton, behavior: &#x27;smooth&#x27;, block: &#x27;center&#x27;, offset: -30, duration: 300 }); }; /** * Debounce function to prevent excessive scroll calls */ export const debounce = &lt;T extends (...args: any[]) =&gt; any&gt;( func: T, wait: number ): ((...args: Parameters&lt;T&gt;) =&gt; void) =&gt; { let timeout: NodeJS.Timeout; return (...args: Parameters&lt;T&gt;) =&gt; { clearTimeout(timeout); timeout = setTimeout(() =&gt; func(...args), wait); }; }; /** * Check if element is in viewport */ export const isElementInViewport = (element: HTMLElement): boolean =&gt; { const rect = element.getBoundingClientRect(); return ( rect.top &gt;= 0 &amp;&amp; rect.left &gt;= 0 &amp;&amp; rect.bottom &lt;= (window.innerHeight || document.documentElement.clientHeight) &amp;&amp; rect.right &lt;= (window.innerWidth || document.documentElement.clientWidth) ); }; /** * Get optimal scroll position for element visibility */ export const getOptimalScrollPosition = (element: HTMLElement): number =&gt; { const elementRect = element.getBoundingClientRect(); const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; const viewportHeight = window.innerHeight; const deviceType = getDeviceType(); // Calculate position to center element in viewport with device-specific adjustments let targetPosition = currentScrollTop + elementRect.top - (viewportHeight / 2) + (elementRect.height / 2); if (deviceType === &#x27;mobile&#x27;) { // On mobile, position slightly higher to account for virtual keyboard targetPosition -= viewportHeight * 0.1; } // Ensure we don&#x27;t scroll past document bounds const maxScroll = document.documentElement.scrollHeight - viewportHeight; return Math.max(0, Math.min(targetPosition, maxScroll)); };</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ siteConfig.ts</div> <div class="content">/** * Site configuration utilities for SSR-safe URL generation */ // Get the site origin in an SSR-safe way export const getSiteOrigin = (): string =&gt; { // During SSR or build time, use the production URL if (typeof window === &#x27;undefined&#x27;) { return process.env.SITE_URL || &#x27;https://modernphototools.com&#x27;; } // In the browser, use the current origin return window.location.origin; }; // Generate canonical URLs for different page types export const generateCanonicalUrl = (path: string): string =&gt; { const origin = getSiteOrigin(); return `${origin}${path.startsWith(&#x27;/&#x27;) ? path : `/${path}`}`; }; // Generate OG image URLs export const generateOgImageUrl = (imagePath: string): string =&gt; { if (!imagePath) return &#x27;&#x27;; const origin = getSiteOrigin(); return imagePath.startsWith(&#x27;http&#x27;) ? imagePath : `${origin}${imagePath}`; };</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ testImageMapping.ts</div> <div class="content">/** * Test script to verify the image mapping system * This script validates image-to-tool mappings and reports any issues */ import { tools } from &#x27;../data/tools&#x27;; import { findToolImage, generateAltText, createToolImageMapping } from &#x27;./imageMapper&#x27;; interface TestResult { toolId: string; toolName: string; imageFound: boolean; imagePath?: string; altText?: string; error?: string; } interface TestSummary { totalTools: number; successfulMappings: number; failedMappings: number; results: TestResult[]; errors: string[]; } /** * Test the image mapping system for all tools */ export async function testImageMapping(): Promise&lt;TestSummary&gt; { console.log(&#x27;๐Ÿงช Starting image mapping test...&#x27;); const results: TestResult[] = []; const errors: string[] = []; let successfulMappings = 0; let failedMappings = 0; for (const tool of tools) { try { console.log(`\n๐Ÿ” Testing tool: ${tool.name} (ID: ${tool.id})`); const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { const altText = generateAltText(tool.name); results.push({ toolId: tool.id, toolName: tool.name, imageFound: true, imagePath: `/images/tools images/${imageFilename}`, altText }); successfulMappings++; console.log(` โœ… Found image: ${imageFilename}`); console.log(` ๐Ÿ“ Alt text: ${altText}`); } else { results.push({ toolId: tool.id, toolName: tool.name, imageFound: false }); failedMappings++; console.log(` โŒ No image found`); } } catch (error) { const errorMessage = `Error testing ${tool.name}: ${error instanceof Error ? error.message : String(error)}`; errors.push(errorMessage); results.push({ toolId: tool.id, toolName: tool.name, imageFound: false, error: errorMessage }); failedMappings++; console.error(` ๐Ÿ’ฅ ${errorMessage}`); } } const summary: TestSummary = { totalTools: tools.length, successfulMappings, failedMappings, results, errors }; console.log(&#x27;\n๐Ÿ“Š Test Summary:&#x27;); console.log(` Total tools: ${summary.totalTools}`); console.log(` Successful mappings: ${summary.successfulMappings}`); console.log(` Failed mappings: ${summary.failedMappings}`); console.log(` Success rate: ${((summary.successfulMappings / summary.totalTools) * 100).toFixed(1)}%`); if (summary.errors.length &gt; 0) { console.log(&#x27;\nโŒ Errors encountered:&#x27;); summary.errors.forEach(error =&gt; console.log(` - ${error}`)); } return summary; } /** * Test image accessibility and format validation */ export async function testImageAccessibility(): Promise&lt;void&gt; { console.log(&#x27;\n๐Ÿ” Testing image accessibility...&#x27;); const mappingResult = await createToolImageMapping(); for (const mapping of mappingResult.successful) { const imagePath = `/images/tools images/${mapping.imagePath}`; // Test if image can be loaded (in a real browser environment) try { // This would be more comprehensive in a browser environment console.log(` โœ… Image accessible: ${imagePath}`); console.log(` Alt text: ${mapping.altText}`); console.log(` Format: ${mapping.imagePath.split(&#x27;.&#x27;).pop()?.toUpperCase()}`); } catch (error) { console.error(` โŒ Image not accessible: ${imagePath}`); } } } /** * Generate a detailed report of the mapping results */ export function generateMappingReport(summary: TestSummary): string { let report = &#x27;# Image Mapping Test Report\n\n&#x27;; report += `## Summary\n`; report += `- **Total Tools**: ${summary.totalTools}\n`; report += `- **Successful Mappings**: ${summary.successfulMappings}\n`; report += `- **Failed Mappings**: ${summary.failedMappings}\n`; report += `- **Success Rate**: ${((summary.successfulMappings / summary.totalTools) * 100).toFixed(1)}%\n\n`; report += `## Successful Mappings\n\n`; const successfulResults = summary.results.filter(r =&gt; r.imageFound); successfulResults.forEach(result =&gt; { report += `### ${result.toolName}\n`; report += `- **Tool ID**: ${result.toolId}\n`; report += `- **Image Path**: ${result.imagePath}\n`; report += `- **Alt Text**: ${result.altText}\n\n`; }); report += `## Failed Mappings\n\n`; const failedResults = summary.results.filter(r =&gt; !r.imageFound); failedResults.forEach(result =&gt; { report += `### ${result.toolName}\n`; report += `- **Tool ID**: ${result.toolId}\n`; report += `- **Status**: No matching image found\n`; if (result.error) { report += `- **Error**: ${result.error}\n`; } report += &#x27;\n&#x27;; }); if (summary.errors.length &gt; 0) { report += `## Errors\n\n`; summary.errors.forEach(error =&gt; { report += `- ${error}\n`; }); } return report; } /** * Run all tests and log results */ export async function runAllTests(): Promise&lt;void&gt; { console.log(&#x27;๐Ÿš€ Running comprehensive image mapping tests...\n&#x27;); try { // Test basic mapping const summary = await testImageMapping(); // Test accessibility await testImageAccessibility(); // Generate report const report = generateMappingReport(summary); console.log(&#x27;\n๐Ÿ“„ Generated mapping report&#x27;); console.log(&#x27;\nโœ… All tests completed successfully!&#x27;); return summary; } catch (error) { console.error(&#x27;๐Ÿ’ฅ Test execution failed:&#x27;, error); throw error; } }</div> <div class="file" style="margin-left: 40px;">๐Ÿ“„ videoMapping.ts</div> <div class="content">// Video URL mapping for tools export const videoUrlMapping: Record&lt;string, string&gt; = { &#x27;Remove Background&#x27;: &#x27;/tools videos/Remove Background.mp4&#x27;, &#x27;AI Cleanup&#x27;: &#x27;/tools videos/AI Cleanup.mp4&#x27;, &#x27;AI Expand&#x27;: &#x27;/tools videos/AI Expand.mp4&#x27;, &#x27;AI Replace&#x27;: &#x27;/tools videos/AI Replace.mp4&#x27;, &#x27;AI Cartoon&#x27;: &#x27;/tools videos/AI Cartoon.mp4&#x27;, &#x27;AI Caricature&#x27;: &#x27;/tools videos/AI Caricature.mp4&#x27;, &#x27;AI Avatar&#x27;: &#x27;/tools videos/AI Avatar.mp4&#x27;, &#x27;AI Product Photoshoot&#x27;: &#x27;/tools videos/AI Product Photoshoot.mp4&#x27;, &#x27;AI Background Generator&#x27;: &#x27;/tools videos/AI Background Generator.mp4&#x27;, &#x27;AI Image Generator&#x27;: &#x27;/tools videos/AI Image Generator_text-to-image.mp4&#x27;, &#x27;AI Portrait&#x27;: &#x27;/tools videos/AI Portrait.mp4&#x27;, &#x27;AI Face Swap&#x27;: &#x27;/tools videos/AI Face Swap.mp4&#x27;, &#x27;AI Outfit&#x27;: &#x27;/tools videos/AI Outfit.mp4&#x27;, &#x27;AI Image to Image&#x27;: &#x27;/tools videos/AI Image to Image.mp4&#x27;, &#x27;AI Sketch to Image&#x27;: &#x27;/tools videos/AI Sketch to Image.mp4&#x27;, &#x27;AI Hairstyle&#x27;: &#x27;/tools videos/AI Hairstyle.mp4&#x27;, &#x27;AI Image Upscaler&#x27;: &#x27;/tools videos/AI Image Upscaler.mp4&#x27;, &#x27;AI Filter&#x27;: &#x27;/tools videos/AI Filter.mp4&#x27;, &#x27;Watermark Remover&#x27;: &#x27;/tools videos/Watermark Remover.mp4&#x27; }; // Function to get video URL for a tool export const getVideoUrl = (toolName: string): string | undefined =&gt; { return videoUrlMapping[toolName]; };</div> <div class="file" style="margin-left: 20px;">๐Ÿ“„ vite-env.d.ts</div> <div class="content">/// &lt;reference types=&quot;vite/client&quot; /&gt; </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ tailwind.config.js</div> <div class="content">/** @type {import(&#x27;tailwindcss&#x27;).Config} */ export default { content: [&#x27;./index.html&#x27;, &#x27;./src/**/*.{js,ts,jsx,tsx}&#x27;], theme: { extend: {}, }, plugins: [], }; </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ tsconfig.app.json</div> <div class="content">{ &quot;compilerOptions&quot;: { &quot;target&quot;: &quot;ES2020&quot;, &quot;useDefineForClassFields&quot;: true, &quot;lib&quot;: [&quot;ES2020&quot;, &quot;DOM&quot;, &quot;DOM.Iterable&quot;], &quot;module&quot;: &quot;ESNext&quot;, &quot;skipLibCheck&quot;: true, /* Bundler mode */ &quot;moduleResolution&quot;: &quot;bundler&quot;, &quot;allowImportingTsExtensions&quot;: true, &quot;isolatedModules&quot;: true, &quot;moduleDetection&quot;: &quot;force&quot;, &quot;noEmit&quot;: true, &quot;jsx&quot;: &quot;react-jsx&quot;, /* Linting */ &quot;strict&quot;: true, &quot;noUnusedLocals&quot;: true, &quot;noUnusedParameters&quot;: true, &quot;noFallthroughCasesInSwitch&quot;: true }, &quot;include&quot;: [&quot;src&quot;] } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ tsconfig.json</div> <div class="content">{ &quot;files&quot;: [], &quot;references&quot;: [ { &quot;path&quot;: &quot;./tsconfig.app.json&quot; }, { &quot;path&quot;: &quot;./tsconfig.node.json&quot; } ] } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ tsconfig.node.json</div> <div class="content">{ &quot;compilerOptions&quot;: { &quot;target&quot;: &quot;ES2022&quot;, &quot;lib&quot;: [&quot;ES2023&quot;], &quot;module&quot;: &quot;ESNext&quot;, &quot;skipLibCheck&quot;: true, /* Bundler mode */ &quot;moduleResolution&quot;: &quot;bundler&quot;, &quot;allowImportingTsExtensions&quot;: true, &quot;isolatedModules&quot;: true, &quot;moduleDetection&quot;: &quot;force&quot;, &quot;noEmit&quot;: true, /* Linting */ &quot;strict&quot;: true, &quot;noUnusedLocals&quot;: true, &quot;noUnusedParameters&quot;: true, &quot;noFallthroughCasesInSwitch&quot;: true }, &quot;include&quot;: [&quot;vite.config.ts&quot;] } </div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ update-multimedia-sitemap.mjs</div> <div class="content"></div> <div class="file" style="margin-left: 0px;">๐Ÿ“„ vite.config.ts</div> <div class="content">import { defineConfig } from &#x27;vite&#x27; import react from &#x27;@vitejs/plugin-react&#x27; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], // This build object is new. build: { // Keep client-side build in &#x27;dist&#x27; outDir: &#x27;dist&#x27;, // This generates a manifest file needed for SSG manifest: true, }, ssr: { // Handle CommonJS modules in SSR noExternal: [&#x27;react-helmet-async&#x27;] }, server: { proxy: { &#x27;/api/external&#x27;: { target: &#x27;https://api.lightxeditor.com&#x27;, changeOrigin: true, rewrite: (path) =&gt; path.replace(/^\/api\/external/, &#x27;/external&#x27;) }, &#x27;/api/lightx-proxy&#x27;: { target: &#x27;http://localhost:3001&#x27;, changeOrigin: true }, &#x27;/api/ai-suggest&#x27;: { target: &#x27;http://localhost:3001&#x27;, changeOrigin: true } }, open: true, } }) </div> </body></html>
๐Ÿ“ scripts
๐Ÿ“„ sitemap-scheduler.cjs
const { SitemapGenerator } = require('../generate-sitemap.cjs'); const fs = require('node:fs'); const path = require('node:path'); class SitemapScheduler { constructor(options = {}) { this.generator = new SitemapGenerator(); this.interval = options.interval || 24 * 60 * 60 * 1000; // Default: 24 hours this.intervalId = null; this.logPath = path.resolve('./public/.sitemap-scheduler.log'); this.isRunning = false; } // Log scheduler activities log(message, level = 'info') { const timestamp = new Date().toISOString(); const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`; console.log(logEntry.trim()); try { fs.appendFileSync(this.logPath, logEntry); } catch (error) { console.warn('Failed to write to log file:', error.message); } } // Generate sitemap with logging async generateWithLogging() { this.log('Starting scheduled sitemap generation'); try { const result = await this.generator.generate(); if (result.success) { this.log(`Sitemap generation completed: ${result.counts?.total || 'unknown'} URLs`); return result; } else { this.log(`Sitemap generation failed: ${result.message}`, 'error'); return result; } } catch (error) { this.log(`Sitemap generation error: ${error.message}`, 'error'); return { success: false, error }; } } // Start scheduled generation start() { if (this.isRunning) { this.log('Scheduler is already running', 'warn'); return; } this.log(`Starting sitemap scheduler with ${this.interval / 1000 / 60} minute intervals`); // Generate immediately on start this.generateWithLogging(); // Schedule regular generations this.intervalId = setInterval(() => { this.generateWithLogging(); }, this.interval); this.isRunning = true; this.log('Sitemap scheduler started successfully'); } // Stop scheduled generation stop() { if (!this.isRunning) { this.log('Scheduler is not running', 'warn'); return; } if (this.intervalId) { clearInterval(this.intervalId); this.intervalId = null; } this.isRunning = false; this.log('Sitemap scheduler stopped'); } // Get scheduler status getStatus() { return { isRunning: this.isRunning, interval: this.interval, intervalMinutes: this.interval / 1000 / 60, logPath: this.logPath }; } // Setup graceful shutdown setupGracefulShutdown() { const shutdown = () => { console.log('\n๐Ÿ”„ Shutting down sitemap scheduler...'); this.stop(); process.exit(0); }; process.on('SIGINT', shutdown); process.on('SIGTERM', shutdown); process.on('SIGQUIT', shutdown); } } // CLI execution async function main() { const args = process.argv.slice(2); const intervalMinutes = parseInt(args.find(arg => arg.startsWith('--interval='))?.split('=')[1]) || 1440; // Default 24 hours const scheduler = new SitemapScheduler({ interval: intervalMinutes * 60 * 1000 }); console.log('๐Ÿš€ Starting sitemap scheduler...'); console.log(`โฐ Interval: ${intervalMinutes} minutes`); console.log(`๐Ÿ“ Log file: ${scheduler.logPath}`); scheduler.start(); scheduler.setupGracefulShutdown(); console.log('๐ŸŽฏ Sitemap scheduler is running. Press Ctrl+C to stop.'); // Keep the process alive process.stdin.resume(); } // Export for programmatic use module.exports = { SitemapScheduler }; // Run if called directly if (require.main === module) { main().catch(console.error); }
๐Ÿ“„ sitemap-validator.cjs
const fs = require('node:fs'); const path = require('node:path'); const { SitemapGenerator } = require('../generate-sitemap.cjs'); class SitemapValidator { constructor() { this.generator = new SitemapGenerator(); this.sitemapPath = path.resolve('./public/sitemap.xml'); this.errors = []; this.warnings = []; } // Add error addError(message) { this.errors.push(message); console.error(`โŒ ERROR: ${message}`); } // Add warning addWarning(message) { this.warnings.push(message); console.warn(`โš ๏ธ WARNING: ${message}`); } // Check if sitemap file exists checkSitemapExists() { if (!fs.existsSync(this.sitemapPath)) { this.addError('Sitemap file does not exist at public/sitemap.xml'); return false; } console.log('โœ… Sitemap file exists'); return true; } // Validate XML structure validateXMLStructure() { try { const content = fs.readFileSync(this.sitemapPath, 'utf8'); // Basic XML validation if (!content.includes('<?xml version="1.0" encoding="UTF-8"?>')) { this.addError('Missing XML declaration'); } if (!content.includes('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"')) { this.addError('Missing or incorrect urlset declaration'); } if (!content.includes('</urlset>')) { this.addError('Missing closing urlset tag'); } // Count URL entries const urlMatches = content.match(/<url>/g); const urlCount = urlMatches ? urlMatches.length : 0; if (urlCount === 0) { this.addError('No URLs found in sitemap'); } else { console.log(`โœ… Found ${urlCount} URLs in sitemap`); } return { valid: this.errors.length === 0, urlCount }; } catch (error) { this.addError(`Failed to read sitemap: ${error.message}`); return { valid: false, urlCount: 0 }; } } // Extract URLs from sitemap extractURLs() { try { const content = fs.readFileSync(this.sitemapPath, 'utf8'); const urlRegex = /<loc>(.*?)<\/loc>/g; const urls = []; let match; while ((match = urlRegex.exec(content)) !== null) { urls.push(match[1]); } return urls; } catch (error) { this.addError(`Failed to extract URLs: ${error.message}`); return []; } } // Check for duplicate URLs checkDuplicates(urls) { const seen = new Set(); const duplicates = []; urls.forEach(url => { if (seen.has(url)) { duplicates.push(url); } else { seen.add(url); } }); if (duplicates.length > 0) { this.addError(`Found ${duplicates.length} duplicate URLs:`); duplicates.forEach(url => console.error(` - ${url}`)); } else { console.log('โœ… No duplicate URLs found'); } return duplicates.length === 0; } // Validate URL format validateURLFormat(urls) { const invalidUrls = []; const baseUrl = 'https://modernphototools.com'; urls.forEach(url => { try { new URL(url); if (!url.startsWith(baseUrl)) { this.addWarning(`URL doesn't start with base URL: ${url}`); } } catch (error) { invalidUrls.push(url); } }); if (invalidUrls.length > 0) { this.addError(`Found ${invalidUrls.length} invalid URLs:`); invalidUrls.forEach(url => console.error(` - ${url}`)); } else { console.log('โœ… All URLs have valid format'); } return invalidUrls.length === 0; } // Check if new articles are included async checkNewArticlesIncluded() { try { const blogDir = path.resolve('./content/blog'); const files = fs.readdirSync(blogDir).filter(file => file.endsWith('.md')); const urls = this.extractURLs(); const missingArticles = []; for (const file of files) { const articleId = file.replace('.md', ''); const expectedUrl = `https://modernphototools.com/blog/${articleId}`; if (!urls.includes(expectedUrl)) { missingArticles.push(articleId); } } if (missingArticles.length > 0) { this.addError(`Found ${missingArticles.length} articles missing from sitemap:`); missingArticles.forEach(article => console.error(` - ${article}`)); } else { console.log('โœ… All blog articles are included in sitemap'); } return missingArticles.length === 0; } catch (error) { this.addError(`Failed to check articles: ${error.message}`); return false; } } // Check lastmod dates validateLastModDates() { try { const content = fs.readFileSync(this.sitemapPath, 'utf8'); const lastmodRegex = /<lastmod>(.*?)<\/lastmod>/g; const invalidDates = []; let match; while ((match = lastmodRegex.exec(content)) !== null) { const dateStr = match[1]; const date = new Date(dateStr); if (isNaN(date.getTime())) { invalidDates.push(dateStr); } } if (invalidDates.length > 0) { this.addError(`Found ${invalidDates.length} invalid lastmod dates:`); invalidDates.forEach(date => console.error(` - ${date}`)); } else { console.log('โœ… All lastmod dates are valid'); } return invalidDates.length === 0; } catch (error) { this.addError(`Failed to validate lastmod dates: ${error.message}`); return false; } } // Generate validation report generateReport() { const report = { timestamp: new Date().toISOString(), valid: this.errors.length === 0, errors: this.errors, warnings: this.warnings, summary: { totalErrors: this.errors.length, totalWarnings: this.warnings.length } }; // Save report const reportPath = path.resolve('./public/.sitemap-validation-report.json'); fs.writeFileSync(reportPath, JSON.stringify(report, null, 2)); console.log(`\n๐Ÿ“Š Validation Report:`); console.log(` Errors: ${report.summary.totalErrors}`); console.log(` Warnings: ${report.summary.totalWarnings}`); console.log(` Status: ${report.valid ? 'โœ… VALID' : 'โŒ INVALID'}`); console.log(` Report saved: ${reportPath}`); return report; } // Run complete validation async validate() { console.log('๐Ÿ” Starting sitemap validation...\n'); // Check if sitemap exists if (!this.checkSitemapExists()) { return this.generateReport(); } // Validate XML structure const xmlResult = this.validateXMLStructure(); if (!xmlResult.valid) { return this.generateReport(); } // Extract URLs const urls = this.extractURLs(); if (urls.length === 0) { return this.generateReport(); } // Run all validations this.checkDuplicates(urls); this.validateURLFormat(urls); await this.checkNewArticlesIncluded(); this.validateLastModDates(); return this.generateReport(); } } // CLI execution async function main() { const validator = new SitemapValidator(); // Check if we should regenerate first const args = process.argv.slice(2); const shouldRegenerate = args.includes('--regenerate') || args.includes('-r'); if (shouldRegenerate) { console.log('๐Ÿ”„ Regenerating sitemap before validation...'); const result = await validator.generator.generate(true); if (!result.success) { console.error('โŒ Failed to regenerate sitemap:', result.message); process.exit(1); } console.log('โœ… Sitemap regenerated\n'); } // Run validation const report = await validator.validate(); // Exit with appropriate code process.exit(report.valid ? 0 : 1); } // Export for programmatic use module.exports = { SitemapValidator }; // Run if called directly if (require.main === module) { main().catch(console.error); }
๐Ÿ“„ sitemap-watcher.cjs
const fs = require('node:fs'); const path = require('node:path'); const { SitemapGenerator } = require('../generate-sitemap.cjs'); class SitemapWatcher { constructor() { this.generator = new SitemapGenerator(); this.watchers = []; this.debounceTimeout = null; this.debounceDelay = 2000; // 2 seconds debounce // Paths to watch this.watchPaths = [ path.resolve('./content/blog'), path.resolve('./src/data/tools.ts'), path.resolve('./src/data/blogArticles.ts') ]; } // Debounced sitemap generation debouncedGenerate() { if (this.debounceTimeout) { clearTimeout(this.debounceTimeout); } this.debounceTimeout = setTimeout(async () => { console.log('๐Ÿ”„ File changes detected, regenerating sitemap...'); try { const result = await this.generator.generate(true); // Force regeneration if (result.success) { console.log('โœ… Sitemap updated successfully'); } else { console.error('โŒ Sitemap update failed:', result.message); } } catch (error) { console.error('โŒ Error during sitemap generation:', error); } }, this.debounceDelay); } // Start watching files startWatching() { console.log('๐Ÿš€ Starting sitemap file watcher...'); this.watchPaths.forEach(watchPath => { if (fs.existsSync(watchPath)) { const stats = fs.statSync(watchPath); if (stats.isDirectory()) { // Watch directory for file changes const watcher = fs.watch(watchPath, { recursive: true }, (eventType, filename) => { if (filename && filename.endsWith('.md')) { console.log(`๐Ÿ“ Blog article ${eventType}: ${filename}`); this.debouncedGenerate(); } }); this.watchers.push(watcher); console.log(`๐Ÿ‘€ Watching directory: ${watchPath}`); } else { // Watch individual file const watcher = fs.watch(watchPath, (eventType) => { console.log(`๐Ÿ“„ Data file ${eventType}: ${path.basename(watchPath)}`); this.debouncedGenerate(); }); this.watchers.push(watcher); console.log(`๐Ÿ‘€ Watching file: ${watchPath}`); } } else { console.warn(`โš ๏ธ Path not found: ${watchPath}`); } }); console.log(`โœ… File watcher started, monitoring ${this.watchers.length} paths`); } // Stop watching files stopWatching() { console.log('๐Ÿ›‘ Stopping file watcher...'); this.watchers.forEach(watcher => { watcher.close(); }); this.watchers = []; if (this.debounceTimeout) { clearTimeout(this.debounceTimeout); this.debounceTimeout = null; } console.log('โœ… File watcher stopped'); } // Handle graceful shutdown setupGracefulShutdown() { const shutdown = () => { console.log('\n๐Ÿ”„ Shutting down sitemap watcher...'); this.stopWatching(); process.exit(0); }; process.on('SIGINT', shutdown); process.on('SIGTERM', shutdown); process.on('SIGQUIT', shutdown); } } // CLI execution async function main() { const watcher = new SitemapWatcher(); // Generate initial sitemap console.log('๐Ÿš€ Generating initial sitemap...'); const result = await watcher.generator.generate(); if (result.success) { console.log('โœ… Initial sitemap generated'); } else { console.error('โŒ Initial sitemap generation failed:', result.message); process.exit(1); } // Start watching for changes watcher.startWatching(); watcher.setupGracefulShutdown(); console.log('๐ŸŽฏ Sitemap watcher is running. Press Ctrl+C to stop.'); } // Export for programmatic use module.exports = { SitemapWatcher }; // Run if called directly if (require.main === module) { main().catch(console.error); }
๐Ÿ“ src
๐Ÿ“„ App.tsx
import React from 'react'; import { Routes, Route } from 'react-router-dom'; import Header from './components/layout/Header'; import Footer from './components/layout/Footer'; import ShareButtons from './components/ui/ShareButtons'; import { Breadcrumbs } from './components/Breadcrumbs'; import HomePage from './pages/HomePage'; import ToolsPage from './pages/ToolsPage'; import ToolPage from './pages/ToolPage'; import AboutPage from './pages/AboutPage'; import ContactPage from './pages/ContactPage'; import NotFoundPage from './pages/NotFoundPage'; import BlogPage from './pages/BlogPage'; import BlogArticlePage from './pages/BlogArticlePage'; import PromptGeneratorPage from './pages/PromptGeneratorPage'; import PrivacyPolicyPage from './pages/PrivacyPolicyPage'; import TermsOfUsePage from './pages/TermsOfUsePage'; import DMCAPage from './pages/DMCAPage'; import CookiesPolicyPage from './pages/CookiesPolicyPage'; function App() { return ( <div className="flex flex-col min-h-screen"> <Header /> <Breadcrumbs /> <main className="flex-grow"> <Routes> <Route path="/" element={<HomePage />} /> <Route path="/tools" element={<ToolsPage />} /> <Route path="/tools/:toolId" element={<ToolPage />} /> <Route path="/about" element={<AboutPage />} /> <Route path="/contact" element={<ContactPage />} /> <Route path="/blog" element={<BlogPage />} /> <Route path="/blog/:articleId" element={<BlogArticlePage />} /> <Route path="/tools/prompt-generator" element={<PromptGeneratorPage />} /> <Route path="/privacy-policy" element={<PrivacyPolicyPage />} /> <Route path="/terms-of-use" element={<TermsOfUsePage />} /> <Route path="/dmca" element={<DMCAPage />} /> <Route path="/cookies-policy" element={<CookiesPolicyPage />} /> <Route path="*" element={<NotFoundPage />} /> </Routes> </main> <Footer /> <ShareButtons /> </div> ); } export default App;
๐Ÿ“ __tests__
๐Ÿ“ components
๐Ÿ“„ ArticleNavigation.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { getAdjacentArticles } from '../data/blogArticles'; interface ArticleNavigationProps { currentArticleId: string; } const ArticleNavigation: React.FC<ArticleNavigationProps> = ({ currentArticleId }) => { const { previousArticle, nextArticle } = getAdjacentArticles(currentArticleId); if (!previousArticle && !nextArticle) { return null; } return ( <div className="mt-12 pt-8 border-t border-gray-200"> <div className="flex flex-col sm:flex-row justify-between gap-4"> {/* Previous Article */} <div className="flex-1"> {previousArticle ? ( <Link to={`/blog/${previousArticle.id}`} className="group flex items-center p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors duration-200" > <div className="flex items-center"> <svg className="w-5 h-5 text-gray-400 group-hover:text-gray-600 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> <div> <div className="text-sm text-gray-500 mb-1">Next Article</div> <div className="text-gray-900 font-medium group-hover:text-blue-600 transition-colors"> {previousArticle.title} </div> </div> </div> </Link> ) : ( <div className="p-4 bg-gray-50 rounded-lg opacity-50"> <div className="flex items-center"> <svg className="w-5 h-5 text-gray-300 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> <div> <div className="text-sm text-gray-400 mb-1">Next Article</div> <div className="text-gray-400">No Next Article</div> </div> </div> </div> )} </div> {/* Next Article */} <div className="flex-1"> {nextArticle ? ( <Link to={`/blog/${nextArticle.id}`} className="group flex items-center justify-end p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors duration-200" > <div className="flex items-center"> <div className="text-right"> <div className="text-sm text-gray-500 mb-1">Previous Article</div> <div className="text-gray-900 font-medium group-hover:text-blue-600 transition-colors"> {nextArticle.title} </div> </div> <svg className="w-5 h-5 text-gray-400 group-hover:text-gray-600 ml-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </Link> ) : ( <div className="p-4 bg-gray-50 rounded-lg opacity-50"> <div className="flex items-center justify-end"> <div className="text-right"> <div className="text-sm text-gray-400 mb-1">Previous Article</div> <div className="text-gray-400">No previous article</div> </div> <svg className="w-5 h-5 text-gray-300 ml-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </div> )} </div> </div> </div> ); }; export default ArticleNavigation;
๐Ÿ“„ Breadcrumbs.tsx
import { Link, useLocation } from 'react-router-dom'; import { Helmet } from 'react-helmet-async'; // Import our data to find names from IDs import { tools } from '../data/tools'; import { blogArticles } from '../data/blogArticles'; // Helper function to capitalize const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1); // Helper to find article/tool names const getNameFromId = (id: string, type: 'blog' | 'tool' | 'blogCat' | 'toolCat') => { if (type === 'blog') { return blogArticles.find(a => a.id === id)?.title || capitalize(id.replace(/-/g, ' ')); } if (type === 'tool') { return tools.find(t => t.id === id)?.name || capitalize(id.replace(/-/g, ' ')); } if (type === 'blogCat') { // Map blog categories based on the categories used in blogArticles const categoryMap: Record<string, string> = { 'general': 'General', 'tools': 'Tools' }; return categoryMap[id] || capitalize(id.replace(/-/g, ' ')); } if (type === 'toolCat') { // For now, just capitalize the category name since toolCategories is not defined return capitalize(id.replace(/-/g, ' ')); } return capitalize(id.replace(/-/g, ' ')); }; export function Breadcrumbs() { const location = useLocation(); const pathnames = location.pathname.split('/').filter(x => x); const breadcrumbBaseUrl = 'https://modernphototools.com'; const breadcrumbs = [ { name: 'Home', path: '/', isLast: false } ]; let currentPath = ''; pathnames.forEach((part, index) => { currentPath += `/${part}`; const isLast = index === pathnames.length - 1; let name = capitalize(part.replace(/-/g, ' ')); // This logic translates path IDs into human-readable names try { if (part === 'blog') name = 'Blog'; if (part === 'tools') name = 'Tools'; if (part === 'about') name = 'About'; if (part === 'contact') name = 'Contact'; if (part === 'privacy-policy') name = 'Privacy Policy'; if (part === 'terms-of-use') name = 'Terms of Use'; if (part === 'dmca') name = 'DMCA'; if (part === 'cookies-policy') name = 'Cookies Policy'; const prevPart = pathnames[index - 1]; // Handle blog articles if (prevPart === 'blog' && part !== 'category') { name = getNameFromId(part, 'blog'); } // Handle tool pages if (prevPart === 'tools' && part !== 'category') { name = getNameFromId(part, 'tool'); } // Handle category pages if (prevPart === 'category') { // Check if we are in /blog/category/ or /tools/category/ const grandPrevPart = pathnames[index - 2]; if (grandPrevPart === 'blog') { name = getNameFromId(part, 'blogCat'); } else if (grandPrevPart === 'tools') { name = getNameFromId(part, 'toolCat'); } } // Handle tag pages if (prevPart === 'tag') { name = `Tag: ${capitalize(part.replace(/-/g, ' '))}`; } } catch (e) { console.error("Error building breadcrumb:", e); name = capitalize(part.replace(/-/g, ' ')); // Fallback } breadcrumbs.push({ name, path: currentPath, isLast }); }); // Don't show breadcrumbs for the home page if (location.pathname === '/') { return null; } // Generate JSON-LD Schema for SEO const schema = { '@context': 'https://schema.org', '@type': 'BreadcrumbList', 'itemListElement': breadcrumbs.map((crumb, index) => ({ '@type': 'ListItem', 'position': index + 1, 'name': crumb.name, 'item': `${breadcrumbBaseUrl}${crumb.path}` })) }; return ( <> <Helmet> <script type="application/ld+json"> {JSON.stringify(schema)} </script> </Helmet> <div className="custom-left-col yoast-breadcrumb"> <p id="breadcrumbs"> {breadcrumbs.map((crumb, index) => { const isLast = index === breadcrumbs.length - 1; return ( <span key={crumb.path}> {isLast ? ( <span className="breadcrumb_last" aria-current="page"> {crumb.name} </span> ) : ( <span><Link to={crumb.path}>{crumb.name}</Link></span> )} {!isLast && <b></b>} {/* Separator element */} </span> ); })} </p> </div> </> ); }
๐Ÿ“„ PromptGuideSection.tsx
import React from 'react'; import { Zap, Brain, Target, HelpCircle } from 'lucide-react'; const PromptGuideSection: React.FC = () => { return ( <section className="mt-16"> {/* Branding Header */} <header className="text-center py-16 px-4 bg-[#003F5C] text-white rounded-lg"> <h1 className="text-4xl md:text-5xl font-extrabold mb-4">4 Secrets to Writing AI Prompts Like a Pro</h1> <p className="text-xl md:text-2xl max-w-3xl mx-auto opacity-90">The problem isn't the AI. It's how you're talking to it.</p> </header> <div className="container mx-auto max-w-7xl p-4 md:p-8"> {/* Why Your Prompts Fail */} <section className="mb-12"> <h2 className="text-center text-2xl md:text-3xl font-bold mb-8">Why Your Prompts Fail</h2> <p className="text-lg max-w-3xl mx-auto text-center mb-8"> An AI can't read your mind. It understands what you write, not what you think. A vague question gets a vague answer. A specific, detailed prompt gets a specific, detailed result. This is the entire secret to "prompt engineering." </p> <div className="grid grid-cols-1 md:grid-cols-2 gap-8"> <div className="bg-white rounded-lg shadow p-6"> <h3 className="text-2xl font-bold text-center mb-4 text-[#BC5090]">The Vague Prompt</h3> <p className="text-center mb-4">You ask a coworker, "How's it going?"</p> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4"> <strong>Prompt:</strong> "Analyze this sales data." </div> <div className="mt-4 p-4 bg-red-50 border border-red-200 rounded-lg"> <strong className="text-red-700">Result:</strong> A generic, unhelpful summary. You get a list of numbers, but no insights and no direction. </div> </div> <div className="bg-white rounded-lg shadow p-6"> <h3 className="text-2xl font-bold text-center mb-4 text-[#7A5195]">The Pro Prompt</h3> <p className="text-center mb-4">You ask, "Where are we on the Q3 report for the exec meeting tomorrow?"</p> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4"> <strong>Prompt:</strong> "Analyze the attached Q3 sales data for our marketing meeting. I need to identify the top-performing product and the product with the sharpest decline. Format the analysis as a 3-section email..." </div> <div className="mt-4 p-4 bg-green-50 border border-green-200 rounded-lg"> <strong className="text-green-700">Result:</strong> A detailed, actionable report in the exact format you need. </div> </div> </div> </section> {/* Use a Framework */} <section className="text-center py-12 mb-12 bg-white rounded-lg shadow-inner"> <h2 className="text-2xl md:text-3xl font-bold mb-4">Use a Framework, Not a Guess</h2> <p className="text-lg max-w-3xl mx-auto"> Professionals don't guess. They use frameworksโ€”structured templatesโ€”to ensure every prompt contains all the information an AI needs. Here are the four frameworks you can use to get expert results, every time. </p> </section> {/* Four Secrets Grid */} <section className="grid grid-cols-1 md:grid-cols-2 gap-8 mb-12"> {/* Secret 1: ICDF */} <div className="bg-white rounded-lg shadow p-6"> <h2 className="text-3xl mb-4">Secret 1: The ICDF Framework</h2> <p className="text-lg mb-6">This is the perfect framework for daily tasks and data analysis. It ensures you provide a complete request.</p> <div className="mb-6"> <img src="/images/blog/ICDF framework.png" alt="ICDF framework visualization" className="mx-auto max-h-80" /> </div> <p className="text-center font-semibold mb-6">Most users only provide the "Instruction," leading to incomplete results.</p> <ul className="space-y-4 mb-6"> <li><span className="font-semibold">I - Instruction:</span> What is the core task? (e.g., "Analyze...")</li> <li><span className="font-semibold">C - Context:</span> Why do you need this? Who is it for? (e.g., "For a marketing meeting...")</li> <li><span className="font-semibold">D - Data:</span> What data should it use? (e.g., "Use the attached file...")</li> <li><span className="font-semibold">F - Format:</span> How should it be presented? (e.g., "As a 3-section email...")</li> </ul> <h3 className="text-xl font-bold mb-2">Example: Analyzing Sales Data</h3> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4 text-sm"> <p><span className="font-bold">[Instruction]</span> Analyze the attached sales data.</p> <p><span className="font-bold">[Context]</span> I need to present a monthly summary to my manager for our marketing team meeting. The goal is to identify our top-performing product and the product with the most significant drop.</p> <p><span className="font-bold">[Data]</span> The data includes product names, units sold, and revenue for July, August, and September.</p> <p><span className="font-bold">[Format]</span> Present the analysis as a clean, bulleted list with three clear sections: 1. Top Performing Products, 2. Underperforming Products, and 3. Short Recommendations.</p> </div> </div> {/* Secret 2: RCREOC */} <div className="bg-white rounded-lg shadow p-6"> <h2 className="text-3xl mb-4">Secret 2: The RCREOC Framework</h2> <p className="text-lg mb-6">Use this to turn the AI from a simple tool into an expert "AI Agent" that works for you by giving it a specific job.</p> <div className="py-8"> <h3 className="text-xl font-bold text-center mb-4">The "AI Agent" Workflow</h3> <div className="flex flex-wrap items-center justify-center gap-2 text-sm text-gray-700"> <span className="px-3 py-1 rounded-full bg-gray-100">Role</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Context</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Request</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Examples</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Output</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Constraints</span> </div> </div> <ul className="space-y-2 mb-6"> <li><span className="font-semibold">R - Role:</span> Who is the AI? (e.g., "You are an expert Assistant Project Manager...")</li> <li><span className="font-semibold">C - Context:</span> What is the situation? (e.g., "You review weekly reports...")</li> <li><span className="font-semibold">R - Request:</span> What is the specific task? (e.g., "Extract recurring problems...")</li> <li><span className="font-semibold">E - Examples:</span> Show it what a good answer looks like.</li> <li><span className="font-semibold">O - Output:</span> What is the final format? (e.g., "A table with 3 columns...")</li> <li><span className="font-semibold">C - Constraints:</span> What are the rules? (e.g., "Each entry must be less than 3 lines...")</li> </ul> <h3 className="text-xl font-bold mb-2">Example: Analyzing Team Reports</h3> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4 text-sm"> <p><span className="font-bold">[Role]</span> You are an Assistant Project Manager on a tech team.</p> <p><span className="font-bold">[Context]</span> Your job is to review weekly reports to find problems and solutions.</p> <p><span className="font-bold">[Request]</span> Review this report and extract: 1. Recurring issues, 2. Team suggestions, 3. Your recommendations.</p> <p><span className="font-bold">[Output]</span> Format as a 3-column table: 'Issue', 'Proposed Solution', 'Recommendation'.</p> <p><span className="font-bold">[Constraints]</span> Each entry must be under 3 lines.</p> </div> </div> {/* Secret 3: MICRO */} <div className="bg-white rounded-lg shadow p-6"> <h2 className="text-3xl mb-4">Secret 3: The MICRO Framework</h2> <p className="text-lg mb-6">This is the ultimate framework for all content creation, from blog posts to video scripts.</p> <div className="mb-6"> <img src="/images/blog/MICRO framework.png" alt="MICRO framework visualization" className="mx-auto max-h-80" /> </div> <p className="text-center font-semibold mb-6">A great piece of content balances all axes.</p> <ul className="space-y-4 mb-6"> <li><span className="font-semibold">M - Message:</span> What is the core takeaway?</li> <li><span className="font-semibold">I - Intention:</span> What is the goal? (Persuade, inform, motivate...)</li> <li><span className="font-semibold">C - Context (Audience):</span> Who is this for?</li> <li><span className="font-semibold">R - Rhythm (Tone):</span> What is the style? (Formal, funny, motivational...)</li> <li><span className="font-semibold">O - Output:</span> What is the final format? (Blog post, 5-min video script...)</li> </ul> <h3 className="text-xl font-bold mb-2">Example: Writing a YouTube Script</h3> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4 text-sm"> <p><span className="font-bold">[Output]</span> Write a 5-minute YouTube script with an intro, body, and conclusion.</p> <p><span className="font-bold">[Message]</span> Help college students organize their study time effectively.</p> <p><span className="font-bold">[Intention]</span> Persuade students that AI is a tool for success, not for cutting corners.</p> <p><span className="font-bold">[Context/Audience]</span> US college students who are stressed and want realistic solutions.</p> <p><span className="font-bold">[Rhythm/Tone]</span> Fast-paced, encouraging, and motivational.</p> </div> </div> {/* Secret 4: COSTAR */} <div className="bg-white rounded-lg shadow p-6"> <h2 className="text-3xl mb-4">Secret 4: The COSTAR Framework</h2> <p className="text-lg mb-6">This framework makes the AI think like a professional marketer. Perfect for emails, ads, and landing pages.</p> <div className="py-8"> <h3 className="text-xl font-bold text-center mb-4">The Marketing Funnel Workflow</h3> <div className="flex flex-wrap items-center justify-center gap-2 text-sm text-gray-700"> <span className="px-3 py-1 rounded-full bg-gray-100">Context</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Offer</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Style</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Target</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Action</span> <span>โ†’</span> <span className="px-3 py-1 rounded-full bg-gray-100">Result</span> </div> </div> <ul className="space-y-2 mb-6"> <li><span className="font-semibold">C - Context:</span> What is this for? (e.g., "A marketing email...")</li> <li><span className="font-semibold">O - Offer:</span> What is the promotion? (e.g., "25% off for 72 hours...")</li> <li><span className="font-semibold">S - Style:</span> What is the tone? (e.g., "Simple, warm, and helpful...")</li> <li><span className="font-semibold">T - Target:</span> Who is the audience? (e.g., "Busy homeowners 25-45...")</li> <li><span className="font-semibold">A - Action:</span> What should they do? (e.g., "Click the 'Shop Now' link...")</li> <li><span className="font-semibold">R - Result:</span> What is the business goal? (e.g., "Boost sales...")</li> </ul> <h3 className="text-xl font-bold mb-2">Example: Writing a Promo Email</h3> <div className="bg-gray-50 border border-gray-200 rounded-lg p-4 text-sm"> <p><span className="font-bold">[Context]</span> Write a marketing email for a new promotion on smart home cleaning products.</p> <p><span className="font-bold">[Offer]</span> 25% off all smart cleaning tools, online only for 72 hours.</p> <p><span className="font-bold">[Style]</span> Simple, warm, and helpful. Like a friendly tip, not a sales pitch.</p> <p><span className="font-bold">[Target]</span> Busy homeowners (25-45) who value their free time.</p> <p><span className="font-bold">[Action]</span> Click the 'Shop Now' link before the sale ends.</p> <p><span className="font-bold">[Result]</span> Boost sales and attract new customers.</p> </div> </div> </section> {/* Closing Banner */} <footer className="text-center py-16 px-4 mt-12 bg-[#003F5C] text-white rounded-lg"> <h2 className="text-3xl md:text-4xl font-extrabold mb-4">Stop Guessing. Start Directing.</h2> <p className="text-xl max-w-3xl mx-auto opacity-90"> The difference between an amateur and a pro is structure. Use these frameworks to provide the clarity, context, and constraints the AI needs to deliver exceptional results. </p> </footer> <section className="container mx-auto max-w-7xl p-4 md:p-8"> <h2 className="text-2xl md:text-3xl font-bold text-center mb-8">Why Choose Generate Prompt AI?</h2> <div className="grid grid-cols-1 md:grid-cols-3 gap-6"> <div className="bg-white rounded-lg shadow p-6 text-center"> <div className="w-12 h-12 mx-auto mb-4 rounded-full bg-blue-100 flex items-center justify-center"> <Zap className="w-6 h-6 text-blue-600" /> </div> <h3 className="text-lg font-semibold mb-2">Instant Enhancement</h3> <p className="text-gray-700">Get immediate improvements to your Prompts using advanced AI techniques.</p> </div> <div className="bg-white rounded-lg shadow p-6 text-center"> <div className="w-12 h-12 mx-auto mb-4 rounded-full bg-purple-100 flex items-center justify-center"> <Brain className="w-6 h-6 text-purple-600" /> </div> <h3 className="text-lg font-semibold mb-2">Smart Analysis</h3> <p className="text-gray-700">Our system uses sophisticated analysis techniques to understand your Prompt context and provide optimal suggestions.</p> </div> <div className="bg-white rounded-lg shadow p-6 text-center"> <div className="w-12 h-12 mx-auto mb-4 rounded-full bg-green-100 flex items-center justify-center"> <Target className="w-6 h-6 text-green-600" /> </div> <h3 className="text-lg font-semibold mb-2">Precision Results</h3> <p className="text-gray-700">Get accurate and relevant responses from AI with our enhanced Prompts.</p> </div> </div> </section> <section className="container mx-auto max-w-7xl p-4 md:p-8"> <h2 className="text-2xl md:text-3xl font-bold text-center mb-8">Frequently Asked Questions</h2> <div className="grid grid-cols-1 md:grid-cols-2 gap-6"> <div className="bg-white rounded-lg shadow p-6"> <div className="flex items-start gap-3 mb-3"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">What is the AI Prompt Generator?</h3> </div> <p className="text-gray-700">A free web tool that transforms a simple idea into a professional prompt using frameworks like COSTAR, MICRO, ICDF, and RCREOC. It analyzes intent, suggests structured fields, and assembles a polished prompt ready for ChatGPT, Claude, or Gemini.</p> <div className="flex items-start gap-3 mb-3"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">How does the AI Prompt Generator work?</h3> </div> <p className="text-gray-700">You enter a short idea; the analyzer detects the best framework; the backend uses Bytez with GPTโ€‘4o to generate structured suggestions; the UI lets you refine each field and outputs a final prompt you can copy.</p> <div className="flex items-start gap-3 mb-3"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">Can I use the tool for free?</h3> </div> <p className="text-gray-700">Yes. It is completely free and requires no registration.</p> </div> <div className="bg-white rounded-lg shadow p-6"> <div className="flex items-start gap-3 mb-3"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">What use cases does the tool support?</h3> </div> <p className="text-gray-700">Marketing emails and ads (COSTAR), content scripts and posts (MICRO), data analysis and reporting (ICDF), expert reviews and critiques (RCREOC), plus general prompt polishing for chat models.</p> <div className="flex items-start gap-3 mb-3"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">How can I ensure high-quality Prompts?</h3> </div> <p className="text-gray-700">Provide clear context and goals, include relevant data or constraints, select the right framework, and refine the suggested fields for accuracy before copying the final prompt.</p> <div> <div className="flex items-start gap-3 mb-1"> <HelpCircle className="w-5 h-5 text-blue-600 mt-0.5" /> <h3 className="text-base font-semibold">Do the generated Prompts support all AI models?</h3> </div> <p className="text-gray-700">The tool is designed to support popular AI models like ChatGPT, Claude, and Gemini, but it is also adaptable to most other models. You may need slight adjustments to fit the specific requirements of the model you are using.</p> </div> </div> </div> </section> </div> </section> ); }; export default PromptGuideSection;
๐Ÿ“ SEO
๐Ÿ“ layout
๐Ÿ“„ Footer.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { Image } from 'lucide-react'; const Footer: React.FC = () => { const currentYear = new Date().getFullYear(); return ( <footer className="bg-gray-100 pt-12 pb-8"> <div className="container mx-auto px-4"> <div className="grid grid-cols-1 md:grid-cols-4 gap-8"> <div className="col-span-1"> <Link to="/" className="flex items-center space-x-2 mb-4"> <Image className="w-8 h-8 text-blue-600" /> <span className="text-xl font-bold text-gray-900">ModernPhotoTools</span> </Link> <p className="text-gray-600 mb-4"> Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds. </p> </div> <div className="col-span-1"> <h3 className="text-lg font-semibold text-gray-900 mb-4">Quick Links</h3> <ul className="space-y-2"> <li> <Link to="/" className="text-gray-600 hover:text-blue-600 transition-colors"> Home </Link> </li> <li> <Link to="/tools" className="text-gray-600 hover:text-blue-600 transition-colors"> All Tools </Link> </li> <li> <Link to="/blog" className="text-gray-600 hover:text-blue-600 transition-colors"> Blog </Link> </li> <li> <Link to="/about" className="text-gray-600 hover:text-blue-600 transition-colors"> About </Link> </li> <li> <Link to="/contact" className="text-gray-600 hover:text-blue-600 transition-colors"> Contact </Link> </li> </ul> </div> <div className="col-span-1"> <h3 className="text-lg font-semibold text-gray-900 mb-4">Popular Tools</h3> <ul className="space-y-2"> <li> <Link to="/tools/remove-background" className="text-gray-600 hover:text-blue-600 transition-colors"> Remove Background </Link> </li> <li> <Link to="/tools/ai-image-generator" className="text-gray-600 hover:text-blue-600 transition-colors"> AI Image Generator </Link> </li> <li> <Link to="/tools/prompt-generator" className="text-gray-600 hover:text-blue-600 transition-colors"> AI Prompt Generator </Link> </li> <li> <Link to="/tools/ai-portrait" className="text-gray-600 hover:text-blue-600 transition-colors"> AI Portrait </Link> </li> <li> <Link to="/tools/ai-image-upscaler" className="text-gray-600 hover:text-blue-600 transition-colors"> AI Image Upscaler </Link> </li> </ul> </div> <div className="col-span-1"> <h3 className="text-lg font-semibold text-gray-900 mb-4">Legal</h3> <ul className="space-y-2"> <li> <Link to="/privacy-policy" className="text-gray-600 hover:text-blue-600 transition-colors"> Privacy Policy </Link> </li> <li> <Link to="/terms-of-use" className="text-gray-600 hover:text-blue-600 transition-colors"> Terms of Use </Link> </li> <li> <Link to="/dmca" className="text-gray-600 hover:text-blue-600 transition-colors"> DMCA </Link> </li> <li> <Link to="/cookies-policy" className="text-gray-600 hover:text-blue-600 transition-colors"> Cookies Policy </Link> </li> </ul> </div> </div> <div className="border-t border-gray-200 mt-8 pt-8 text-center"> <p className="text-gray-600"> ยฉ {currentYear} ModernPhotoTools.com. All rights reserved. </p> </div> </div> </footer> ); }; export default Footer;
๐Ÿ“„ Header.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { Menu, X, Image } from 'lucide-react'; const Header: React.FC = () => { const [isMenuOpen, setIsMenuOpen] = React.useState(false); const toggleMenu = () => { setIsMenuOpen(!isMenuOpen); }; return ( <header className="sticky top-0 z-50 bg-white shadow-sm"> <div className="container mx-auto px-4 py-4 flex justify-between items-center"> <Link to="/" className="flex items-center space-x-2"> <Image className="w-8 h-8 text-blue-600" /> <span className="text-xl font-bold text-gray-900">ModernPhotoTools</span> </Link> {/* Desktop Navigation */} <nav className="hidden md:flex space-x-8"> <Link to="/" className="text-gray-700 hover:text-blue-600 transition-colors"> Home </Link> <Link to="/tools" className="text-gray-700 hover:text-blue-600 transition-colors"> All Tools </Link> <Link to="/blog" className="text-gray-700 hover:text-blue-600 transition-colors"> Blog </Link> <Link to="/about" className="text-gray-700 hover:text-blue-600 transition-colors"> About </Link> <Link to="/contact" className="text-gray-700 hover:text-blue-600 transition-colors"> Contact </Link> </nav> {/* Mobile Menu Button */} <button className="md:hidden p-2 rounded-md text-gray-700 hover:bg-gray-100" onClick={toggleMenu} aria-label={isMenuOpen ? "Close menu" : "Open menu"} > {isMenuOpen ? <X size={24} /> : <Menu size={24} />} </button> </div> {/* Mobile Navigation */} {isMenuOpen && ( <div className="md:hidden bg-white shadow-md"> <div className="container mx-auto px-4 py-4 flex flex-col space-y-4"> <Link to="/" className="text-gray-700 hover:text-blue-600 transition-colors py-2" onClick={() => setIsMenuOpen(false)} > Home </Link> <Link to="/tools" className="text-gray-700 hover:text-blue-600 transition-colors py-2" onClick={() => setIsMenuOpen(false)} > All Tools </Link> <Link to="/blog" className="text-gray-700 hover:text-blue-600 transition-colors py-2" onClick={() => setIsMenuOpen(false)} > Blog </Link> <Link to="/about" className="text-gray-700 hover:text-blue-600 transition-colors py-2" onClick={() => setIsMenuOpen(false)} > About </Link> <Link to="/contact" className="text-gray-700 hover:text-blue-600 transition-colors py-2" onClick={() => setIsMenuOpen(false)} > Contact </Link> </div> </div> )} </header> ); }; export default Header;
๐Ÿ“„ ScrollToTop.tsx
import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; // This component will have no visible UI. Its only job is to run an effect. const ScrollToTop = (): null => { const { pathname } = useLocation(); useEffect(() => { // This effect runs every time the `pathname` changes (i.e., on every route navigation). window.scrollTo(0, 0); }, [pathname]); return null; // Render nothing }; export default ScrollToTop;
๐Ÿ“ tools
๐Ÿ“ AIAvatar
๐Ÿ“ AIBackgroundGenerator
๐Ÿ“ AICaricature
๐Ÿ“ AICartoon
๐Ÿ“ AICleanup
๐Ÿ“ AIExpand
๐Ÿ“ AIImageGenerator
๐Ÿ“ AIProductPhotoshoot
๐Ÿ“ AIReplace
๐Ÿ“ RemoveBackground
๐Ÿ“ ui
๐Ÿ“„ ArticleNavigation.tsx
import React from 'react'; import { Link } from 'react-router-dom'; interface NavigationArticle { id: string; title: string; } interface ArticleNavigationProps { previousArticle?: NavigationArticle; nextArticle?: NavigationArticle; } const ArticleNavigation: React.FC<ArticleNavigationProps> = ({ previousArticle, nextArticle }) => { if (!previousArticle && !nextArticle) { return null; } return ( <div className="mt-12 pt-8 border-t border-gray-200"> <div className="flex flex-col md:flex-row justify-between items-stretch gap-4"> {/* Previous Article */} <div className="flex-1"> {previousArticle ? ( <Link to={`/blog/${previousArticle.id}`} className="group flex items-center p-6 bg-white border border-gray-200 rounded-xl hover:border-blue-300 hover:shadow-lg transition-all duration-300 h-full" > <div className="flex items-center"> <div className="flex-shrink-0 mr-4"> <div className="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center group-hover:bg-blue-200 transition-colors duration-300"> <svg className="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> </div> </div> <div className="min-w-0 flex-1"> <p className="text-sm text-gray-500 mb-1">Previous Article</p> <h3 className="text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors duration-300 line-clamp-2"> {previousArticle.title} </h3> </div> </div> </Link> ) : ( <div className="p-6 bg-gray-50 border border-gray-200 rounded-xl h-full opacity-50"> <div className="flex items-center"> <div className="flex-shrink-0 mr-4"> <div className="w-10 h-10 bg-gray-200 rounded-full flex items-center justify-center"> <svg className="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> </svg> </div> </div> <div className="min-w-0 flex-1"> <p className="text-sm text-gray-400 mb-1">Previous Article</p> <h3 className="text-lg font-medium text-gray-400"> No previous article </h3> </div> </div> </div> )} </div> {/* Next Article */} <div className="flex-1"> {nextArticle ? ( <Link to={`/blog/${nextArticle.id}`} className="group flex items-center p-6 bg-white border border-gray-200 rounded-xl hover:border-blue-300 hover:shadow-lg transition-all duration-300 h-full" > <div className="flex items-center w-full"> <div className="min-w-0 flex-1 text-right"> <p className="text-sm text-gray-500 mb-1">Next Article</p> <h3 className="text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors duration-300 line-clamp-2"> {nextArticle.title} </h3> </div> <div className="flex-shrink-0 ml-4"> <div className="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center group-hover:bg-blue-200 transition-colors duration-300"> <svg className="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </div> </div> </Link> ) : ( <div className="p-6 bg-gray-50 border border-gray-200 rounded-xl h-full opacity-50"> <div className="flex items-center w-full"> <div className="min-w-0 flex-1 text-right"> <p className="text-sm text-gray-400 mb-1">Next Article</p> <h3 className="text-lg font-medium text-gray-400"> No next article </h3> </div> <div className="flex-shrink-0 ml-4"> <div className="w-10 h-10 bg-gray-200 rounded-full flex items-center justify-center"> <svg className="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </div> </div> </div> )} </div> </div> </div> ); }; export default ArticleNavigation;
๐Ÿ“„ Button.tsx
import React from 'react'; interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { variant?: 'primary' | 'secondary' | 'outline'; size?: 'sm' | 'md' | 'lg'; fullWidth?: boolean; isLoading?: boolean; leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; } const Button: React.FC<ButtonProps> = ({ children, variant = 'primary', size = 'md', fullWidth = false, isLoading = false, leftIcon, rightIcon, className = '', disabled, ...props }) => { const baseStyles = "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2"; const variantStyles = { primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500", secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500", outline: "bg-transparent text-gray-900 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500" }; const sizeStyles = { sm: "text-sm px-3 py-1.5", md: "text-base px-4 py-2", lg: "text-lg px-6 py-3" }; const widthStyles = fullWidth ? "w-full" : ""; const disabledStyles = (disabled || isLoading) ? "opacity-60 cursor-not-allowed" : "cursor-pointer"; return ( <button className={`${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${widthStyles} ${disabledStyles} ${className}`} disabled={disabled || isLoading} {...props} > {isLoading && ( <svg className="animate-spin -ml-1 mr-2 h-4 w-4 text-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"> <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle> <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> )} {leftIcon && !isLoading && <span className="mr-2">{leftIcon}</span>} {children} {rightIcon && <span className="ml-2">{rightIcon}</span>} </button> ); }; export default Button;
๐Ÿ“„ ImageDropzone.tsx
import React, { useCallback, useState } from 'react'; import { Upload, X } from 'lucide-react'; import { ACCEPTED_IMAGE_TYPES, MAX_FILE_SIZE } from '../../constants'; import type { ImageFile } from '../../types'; interface ImageDropzoneProps { onImageSelect: (imageFile: ImageFile) => void; selectedImage: ImageFile; disabled?: boolean; } const ImageDropzone: React.FC<ImageDropzoneProps> = ({ onImageSelect, selectedImage, disabled = false }) => { const [isDragging, setIsDragging] = useState(false); const [error, setError] = useState<string | null>(null); const handleDragEnter = useCallback((e: React.DragEvent<HTMLDivElement>) => { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(true); }, [disabled]); const handleDragLeave = useCallback((e: React.DragEvent<HTMLDivElement>) => { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(false); }, [disabled]); const handleDragOver = useCallback((e: React.DragEvent<HTMLDivElement>) => { if (disabled) return; e.preventDefault(); e.stopPropagation(); }, [disabled]); const validateFile = (file: File): string | null => { if (!ACCEPTED_IMAGE_TYPES.includes(file.type)) { return 'File type not supported. Please upload a JPEG or PNG image.'; } if (file.size > MAX_FILE_SIZE) { return 'File size exceeds 5MB limit. Please upload a smaller image.'; } return null; }; const handleDrop = useCallback((e: React.DragEvent<HTMLDivElement>) => { if (disabled) return; e.preventDefault(); e.stopPropagation(); setIsDragging(false); const files = e.dataTransfer.files; if (files.length > 0) { const file = files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () => { onImageSelect({ file, preview: reader.result as string }); }; reader.readAsDataURL(file); } }, [onImageSelect, disabled]); const handleFileSelect = useCallback((e: React.ChangeEvent<HTMLInputElement>) => { if (disabled) return; const files = e.target.files; if (files && files.length > 0) { const file = files[0]; const validationError = validateFile(file); if (validationError) { setError(validationError); return; } setError(null); const reader = new FileReader(); reader.onload = () => { onImageSelect({ file, preview: reader.result as string }); }; reader.readAsDataURL(file); } }, [onImageSelect, disabled]); const handleRemoveImage = useCallback(() => { onImageSelect({ file: null, preview: null }); setError(null); }, [onImageSelect]); return ( <div className="w-full"> {!selectedImage.preview ? ( <div className={`border-2 border-dashed rounded-lg p-8 flex flex-col items-center justify-center transition-colors ${ disabled ? 'border-gray-200 bg-gray-50 cursor-not-allowed opacity-50' : isDragging ? 'border-blue-500 bg-blue-50 cursor-pointer' : 'border-gray-300 hover:border-gray-400 cursor-pointer' }`} onDragEnter={handleDragEnter} onDragLeave={handleDragLeave} onDragOver={handleDragOver} onDrop={handleDrop} onClick={disabled ? undefined : () => document.getElementById('file-input')?.click()} > <Upload className="w-10 h-10 text-gray-400 mb-4" /> <p className="text-gray-700 font-medium mb-1">Drag and drop your image here</p> <p className="text-gray-500 text-sm mb-4">or click to browse</p> <p className="text-gray-400 text-xs"> Supported formats: JPEG, PNG (max 5MB) </p> <input id="file-input" type="file" className="hidden" accept="image/jpeg,image/png" onChange={handleFileSelect} disabled={disabled} /> </div> ) : ( <div className="relative border rounded-lg overflow-hidden"> <img src={selectedImage.preview} alt="Selected" className="w-full h-auto object-contain" /> <button className="absolute top-2 right-2 p-1 bg-white rounded-full shadow-md hover:bg-gray-100 transition-colors" onClick={handleRemoveImage} aria-label="Remove image" > <X className="w-5 h-5 text-gray-700" /> </button> </div> )} {error && ( <div className="mt-2 text-red-500 text-sm">{error}</div> )} </div> ); }; export default ImageDropzone;
๐Ÿ“„ PromptsGuide.tsx
import React from 'react'; const PromptsGuide: React.FC = () => { return ( <section className="py-16 bg-gray-50"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center mb-12"> <h2 className="text-3xl font-bold text-gray-900 mb-4"> How to create effective prompts </h2> </div> <div className="grid grid-cols-1 md:grid-cols-3 gap-8"> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">1</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Ideal prompt structure</h3> <p className="text-gray-600 text-left"> <strong>[Main subject]</strong> + <strong>[Environment / Setting]</strong> + <strong>[Style]</strong> + <strong>[Lighting / Mood]</strong> + <strong>[Details / Adjectives]</strong> + (optional) <strong>[Camera / Perspective / Composition info]</strong> </p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">2</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Role of negative prompts</h3> <p className="text-gray-600"> Remove unwanted elements that the AI might generate based on its interpretation of your positive prompt, such as poor quality, extra fingers, or distorted features. </p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">3</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Use seeds for consistency</h3> <p className="text-gray-600"> AI image generators can produce a variety of images from the same prompt. Enable the 'seed' option, and change the prompt with the same seed number to see consistent images. </p> </div> </div> </div> </section> ); }; export default PromptsGuide;
๐Ÿ“„ SEO.tsx
import React from 'react'; import { Helmet } from 'react-helmet-async'; import { SITE_TITLE, SITE_DESCRIPTION } from '../../constants'; import { getSiteOrigin } from '../../utils/siteConfig'; interface SEOProps { title?: string; description?: string; canonicalUrl?: string; ogImage?: string; } // Helper function to safely determine environment and base URL for SSR compatibility function getEnvironmentConfig() { const baseUrl = getSiteOrigin(); const isProduction = typeof window !== 'undefined' ? (window.location.hostname !== 'localhost' && window.location.hostname !== '127.0.0.1') : (import.meta.env.PROD || process.env.NODE_ENV === 'production'); return { isProduction, baseUrl }; } const SEO: React.FC<SEOProps> = ({ title = SITE_TITLE, description = SITE_DESCRIPTION, canonicalUrl, ogImage }) => { const formattedTitle = title === SITE_TITLE ? title : `${title} | ${SITE_TITLE}`; // Get environment config for proper URL handling const { baseUrl } = getEnvironmentConfig(); // Default Open Graph image (favicon) with proper error handling const defaultOgImage = `${baseUrl}/favicon.svg`; // Validate and sanitize the ogImage URL const getValidatedOgImage = (): string => { if (!ogImage) return defaultOgImage; try { // If ogImage is already a full URL, use it if (ogImage.startsWith('http://') || ogImage.startsWith('https://')) { return ogImage; } // If ogImage is a relative path, make it absolute if (ogImage.startsWith('/')) { return `${baseUrl}${ogImage}`; } // If ogImage is just a filename, assume it's in the root return `${baseUrl}/${ogImage}`; } catch (error) { console.warn('Invalid ogImage provided, falling back to default:', error); return defaultOgImage; } }; const finalOgImage = getValidatedOgImage(); // Generate the current page URL for og:url meta tag const currentUrl = canonicalUrl || (typeof window !== 'undefined' ? window.location.href : ''); return ( <Helmet> <title>{formattedTitle}</title> <meta name="description" content={description} /> {/* Open Graph / Facebook */} <meta property="og:type" content="website" /> <meta property="og:url" content={currentUrl} /> <meta property="og:title" content={formattedTitle} /> <meta property="og:description" content={description} /> <meta property="og:image" content={finalOgImage} /> <meta property="og:site_name" content={SITE_TITLE} /> {/* Twitter */} <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content={formattedTitle} /> <meta name="twitter:description" content={description} /> <meta name="twitter:image" content={finalOgImage} /> {/* Canonical URL */} {canonicalUrl && <link rel="canonical" href={canonicalUrl} />} </Helmet> ); }; export default SEO;
๐Ÿ“„ ShareButtons.tsx
import React, { useState, useEffect } from 'react'; import { Share2, Copy, Check } from 'lucide-react'; interface ShareButtonsProps { url?: string; title?: string; description?: string; } const ShareButtons: React.FC<ShareButtonsProps> = ({ url, title, description = '' }) => { const [isVisible, setIsVisible] = useState(false); const [isMobile, setIsMobile] = useState(false); const [showMobileMenu, setShowMobileMenu] = useState(false); const [copySuccess, setCopySuccess] = useState(false); const [currentUrl, setCurrentUrl] = useState(''); const [currentTitle, setCurrentTitle] = useState(''); useEffect(() => { // Set default values on client side only if (typeof window !== 'undefined') { setCurrentUrl(url || window.location.href); setCurrentTitle(title || document.title); } }, [url, title]); useEffect(() => { const checkMobile = () => { setIsMobile(window.innerWidth < 768); }; const handleScroll = () => { const scrolled = window.scrollY; const threshold = 200; // Show after scrolling 200px setIsVisible(scrolled > threshold); }; checkMobile(); window.addEventListener('resize', checkMobile); window.addEventListener('scroll', handleScroll); return () => { window.removeEventListener('resize', checkMobile); window.removeEventListener('scroll', handleScroll); }; }, []); const shareData = [ { name: 'Twitter', url: `https://twitter.com/intent/tweet?url=${encodeURIComponent(currentUrl)}&text=${encodeURIComponent(currentTitle)}`, icon: ( <svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor"> <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/> </svg> ), color: 'hover:bg-black hover:text-white' }, { name: 'LinkedIn', url: `https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(currentUrl)}&title=${encodeURIComponent(currentTitle)}&summary=${encodeURIComponent(description)}`, icon: ( <svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor"> <path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/> </svg> ), color: 'hover:bg-blue-600 hover:text-white' }, { name: 'Reddit', url: `https://reddit.com/submit?url=${encodeURIComponent(currentUrl)}&title=${encodeURIComponent(currentTitle)}`, icon: ( <svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor"> <path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"/> </svg> ), color: 'hover:bg-orange-500 hover:text-white' }, { name: 'Quora', url: `https://www.quora.com/share?url=${encodeURIComponent(currentUrl)}&title=${encodeURIComponent(currentTitle)}`, icon: ( <svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor"> <path d="M12.738 18.701a4.441 4.441 0 0 0 1.362-.235 2.136 2.136 0 0 1-1.362.235zm11.262-6.701c0 6.627-5.373 12-12 12s-12-5.373-12-12 5.373-12 12-12 12 5.373 12 12zm-2.5 0c0-5.238-4.262-9.5-9.5-9.5s-9.5 4.262-9.5 9.5 4.262 9.5 9.5 9.5 9.5-4.262 9.5-9.5zm-4.5 0c0 2.485-2.015 4.5-4.5 4.5s-4.5-2.015-4.5-4.5 2.015-4.5 4.5-4.5 4.5 2.015 4.5 4.5z"/> </svg> ), color: 'hover:bg-red-600 hover:text-white' }, { name: 'Pinterest', url: `https://pinterest.com/pin/create/button/?url=${encodeURIComponent(currentUrl)}&description=${encodeURIComponent(currentTitle)}&media=${encodeURIComponent(currentUrl)}`, icon: ( <svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor"> <path d="M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.174-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.097.118.112.221.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.402.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.357-.629-2.746-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24.009 12.017 24c6.624 0 11.99-5.367 11.99-12C24.007 5.367 18.641.001.012.001z"/> </svg> ), color: 'hover:bg-red-600 hover:text-white' } ]; const handleCopyLink = async () => { try { await navigator.clipboard.writeText(currentUrl); setCopySuccess(true); setTimeout(() => setCopySuccess(false), 2000); } catch (err) { console.error('Failed to copy: ', err); } }; const handleShare = (shareUrl: string) => { window.open(shareUrl, '_blank', 'noopener,noreferrer'); }; const handleKeyDown = (event: React.KeyboardEvent, action: () => void) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); action(); } }; if (!isVisible) return null; return ( <> {/* Desktop - Floating Vertical Bar */} {!isMobile && ( <div className="fixed left-4 top-1/2 transform -translate-y-1/2 z-50 flex flex-col space-y-3"> {shareData.map((platform) => ( <button key={platform.name} onClick={() => handleShare(platform.url)} onKeyDown={(e) => handleKeyDown(e, () => handleShare(platform.url))} aria-label={`Share on ${platform.name}`} className={`p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 ${platform.color} focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`} > {platform.icon} </button> ))} <button onClick={handleCopyLink} onKeyDown={(e) => handleKeyDown(e, handleCopyLink)} aria-label="Copy link to clipboard" className="p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2" > {copySuccess ? ( <Check className="w-5 h-5 text-green-600" /> ) : ( <Copy className="w-5 h-5" /> )} </button> </div> )} {/* Mobile - Floating Action Button */} {isMobile && ( <div className="fixed bottom-6 right-6 z-50"> {/* Expanded Menu */} {showMobileMenu && ( <div className="absolute bottom-16 right-0 flex flex-col space-y-3 mb-2"> {shareData.map((platform) => ( <button key={platform.name} onClick={() => { handleShare(platform.url); setShowMobileMenu(false); }} onKeyDown={(e) => handleKeyDown(e, () => { handleShare(platform.url); setShowMobileMenu(false); })} aria-label={`Share on ${platform.name}`} className={`p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 ${platform.color} focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`} > {platform.icon} </button> ))} <button onClick={() => { handleCopyLink(); setShowMobileMenu(false); }} onKeyDown={(e) => handleKeyDown(e, () => { handleCopyLink(); setShowMobileMenu(false); })} aria-label="Copy link to clipboard" className="p-3 bg-white border border-gray-200 rounded-full shadow-lg transition-all duration-200 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2" > {copySuccess ? ( <Check className="w-5 h-5 text-green-600" /> ) : ( <Copy className="w-5 h-5" /> )} </button> </div> )} {/* Main FAB Button */} <button onClick={() => setShowMobileMenu(!showMobileMenu)} onKeyDown={(e) => handleKeyDown(e, () => setShowMobileMenu(!showMobileMenu))} aria-label="Share options" aria-expanded={showMobileMenu} className={`p-4 bg-blue-600 text-white rounded-full shadow-lg transition-all duration-200 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${ showMobileMenu ? 'rotate-45' : '' }`} > <Share2 className="w-6 h-6" /> </button> </div> )} </> ); }; export default ShareButtons;
๐Ÿ“„ ToolCard.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import * as LucideIcons from 'lucide-react'; import type { Tool } from '../../types'; interface ToolCardProps { tool: Tool; } const ToolCard: React.FC<ToolCardProps> = ({ tool }) => { // Dynamically get the icon component with better error handling const getIconComponent = (iconName: string) => { // Convert kebab-case to PascalCase (e.g., 'refresh-cw' -> 'RefreshCw') const pascalCaseName = iconName .split('-') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join(''); // Try the converted name first, then the original with first letter capitalized const IconComponent = (LucideIcons as unknown as Record<string, React.FC<{ className?: string }>>)[pascalCaseName] || (LucideIcons as unknown as Record<string, React.FC<{ className?: string }>>)[iconName.charAt(0).toUpperCase() + iconName.slice(1)] || LucideIcons.Image; return IconComponent; }; const IconComponent = getIconComponent(tool.icon); return ( <Link to={tool.path} className="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300" > <div className="p-6"> <div className="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4"> <IconComponent className="w-6 h-6 text-blue-600" /> </div> <h3 className="text-lg font-semibold text-gray-900 mb-2">{tool.name}</h3> <p className="text-gray-600">{tool.description}</p> </div> </Link> ); }; export default ToolCard;
๐Ÿ“„ ToolFeatureImage.tsx
import React, { useState } from 'react'; interface ToolFeatureImageProps { toolId: string; toolName: string; imagePath: string; altText: string; className?: string; } const ToolFeatureImage: React.FC<ToolFeatureImageProps> = ({ toolId, toolName, imagePath, altText, className = '' }) => { const [imageError, setImageError] = useState(false); const [imageLoaded, setImageLoaded] = useState(false); const handleImageError = () => { console.error(`Failed to load tool image for ${toolName}:`, imagePath); setImageError(true); }; const handleImageLoad = () => { setImageLoaded(true); }; // Don't render anything if image failed to load if (imageError) { return null; } return ( <div className={`tool-feature-image mb-8 mt-6 ${className}`}> <div className="relative"> {/* Loading placeholder */} {!imageLoaded && ( <div className="w-full max-w-2xl mx-auto h-64 bg-gray-100 rounded-lg animate-pulse flex items-center justify-center"> <div className="text-gray-400 text-sm">Loading image...</div> </div> )} {/* Actual image */} {imagePath && ( <img src={imagePath} alt={altText} className={`w-full max-w-2xl mx-auto rounded-lg shadow-lg object-contain transition-opacity duration-300 ${ imageLoaded ? 'opacity-100' : 'opacity-0 absolute top-0 left-0' }`} style={{ maxHeight: '400px', objectFit: 'contain' }} loading="lazy" onError={handleImageError} onLoad={handleImageLoad} /> )} </div> {/* Optional caption */} <div className="text-center mt-3"> <p className="text-sm text-gray-500"> {toolName} - Professional AI-powered photo editing </p> </div> </div> ); }; export default ToolFeatureImage;
๐Ÿ“„ ToolRecommendations.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { ArrowRight, ExternalLink } from 'lucide-react'; import { tools } from '../../data/tools'; import type { Tool } from '../../types'; interface ToolRecommendationsProps { currentToolId: string; hasResult?: boolean; } const ToolRecommendations: React.FC<ToolRecommendationsProps> = ({ currentToolId, hasResult = false }) => { // Only show recommendations if user has generated a result if (!hasResult) return null; const getRecommendations = (toolId: string): Tool[] => { const recommendationMap: Record<string, string[]> = { 'remove-background': ['ai-background-generator', 'ai-product-photoshoot', 'ai-expand'], 'ai-cleanup': ['ai-image-upscaler', 'ai-filter', 'ai-expand'], 'watermark-remover': ['ai-cleanup', 'ai-image-upscaler', 'ai-filter'], 'ai-expand': ['ai-background-generator', 'ai-cleanup', 'ai-filter'], 'ai-replace': ['ai-cleanup', 'ai-background-generator', 'ai-expand'], 'ai-cartoon': ['ai-caricature', 'ai-avatar', 'ai-portrait'], 'ai-caricature': ['ai-cartoon', 'ai-avatar', 'ai-face-swap'], 'ai-avatar': ['ai-portrait', 'ai-cartoon', 'ai-caricature'], 'ai-product-photoshoot': ['remove-background', 'ai-background-generator', 'ai-cleanup'], 'ai-background-generator': ['remove-background', 'ai-product-photoshoot', 'ai-expand'], 'ai-image-generator': ['ai-image-to-image', 'ai-filter', 'ai-background-generator'], 'ai-portrait': ['ai-avatar', 'ai-hairstyle', 'ai-face-swap'], 'ai-face-swap': ['ai-portrait', 'ai-avatar', 'ai-caricature'], 'ai-outfit': ['ai-hairstyle', 'ai-portrait', 'ai-background-generator'], 'ai-image-to-image': ['ai-filter', 'ai-image-generator', 'ai-sketch-to-image'], 'ai-sketch-to-image': ['ai-image-to-image', 'ai-image-generator', 'ai-cartoon'], 'ai-hairstyle': ['ai-outfit', 'ai-portrait', 'ai-face-swap'], 'ai-image-upscaler': ['ai-cleanup', 'ai-filter', 'ai-expand'], 'ai-filter': ['ai-image-upscaler', 'ai-cleanup', 'ai-image-to-image'] }; const recommendedIds = recommendationMap[toolId] || []; return tools.filter(tool => recommendedIds.includes(tool.id)).slice(0, 3); }; const recommendations = getRecommendations(currentToolId); if (recommendations.length === 0) return null; return ( <div className="mt-8 bg-white border border-gray-200 rounded-lg p-6"> <div className="flex items-center justify-between mb-6"> <h3 className="text-xl font-semibold text-gray-900">You Might Also Like</h3> <Link to="/tools" className="flex items-center text-blue-600 hover:text-blue-700 text-sm font-medium transition-colors" > View All Tools <ExternalLink className="w-4 h-4 ml-1" /> </Link> </div> <div className="grid grid-cols-1 md:grid-cols-3 gap-4"> {recommendations.map((tool) => ( <Link key={tool.id} to={tool.path} className="group bg-gray-50 hover:bg-blue-50 border border-gray-200 hover:border-blue-200 rounded-lg p-4 transition-all duration-200 hover:shadow-md" > <div className="flex items-start justify-between mb-3"> <h4 className="font-medium text-gray-900 group-hover:text-blue-700 transition-colors"> {tool.name} </h4> <ArrowRight className="w-4 h-4 text-gray-400 group-hover:text-blue-600 transition-colors flex-shrink-0 ml-2" /> </div> <p className="text-sm text-gray-600 group-hover:text-gray-700 transition-colors line-clamp-2"> {tool.description} </p> </Link> ))} </div> <div className="mt-4 pt-4 border-t border-gray-100"> <p className="text-xs text-gray-500 text-center"> Discover more tools to enhance your creative workflow </p> </div> </div> ); }; export default ToolRecommendations;
๐Ÿ“„ VideoToolCard.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import type { Tool } from '../../types'; interface VideoToolCardProps { tool: Tool; videoUrl?: string; } const VideoToolCard: React.FC<VideoToolCardProps> = ({ tool, videoUrl }) => { return ( <div className="col mt-3 apiSectionBox"> <Link to={tool.path}> <div className="bg-white rounded-20"> {videoUrl && ( <video autoPlay loop playsInline muted className="responsive rounded-20" > <source type="video/mp4" src={videoUrl} /> </video> )} <div className="card-body p-3"> <h3 className="text-xxl text-semi text-black pb-2 mb-0 text-center"> {tool.name} </h3> <p className="text-lg text-black text-center"> {tool.description} </p> <div className="d-flex justify-content-between align-items-center"></div> </div> </div> </Link> </div> ); }; export default VideoToolCard;
๐Ÿ“ constants
๐Ÿ“„ avatarStyles.ts
// src/constants/avatarStyles.ts export interface AvatarStyle { name: string; imageUrl: string; gender: 'male' | 'female'; prompt: string; } export const avatarStyles: AvatarStyle[] = [ // Male Styles { name: 'Action Figure', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922035468.jpg', gender: 'male', prompt: 'A photorealistic portrait of a male as an Action Figure, dynamic pose, plastic texture, cinematic lighting.' }, { name: 'Celebrity', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/7966a18a3de743c3b899e8ef13db2563/8a2d11fcfc2041209dbf40df261096f6', gender: 'male', prompt: 'A high-fashion portrait of a male celebrity, magazine cover style, sharp focus, glamorous.' }, { name: 'Superhero', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/superhero.jpg', gender: 'male', prompt: 'A cinematic portrait of a male superhero, dramatic lighting, detailed costume, powerful expression.' }, { name: 'Warrior', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/warrior.jpg', gender: 'male', prompt: 'A gritty portrait of a male warrior, ancient armor, battle-worn, epic fantasy style.' }, { name: 'Muscular', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/mascular.jpg', gender: 'male', prompt: 'A fitness portrait of a muscular male, strong physique, dramatic shadows, powerful stance.' }, { name: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/anime.jpg', gender: 'male', prompt: 'A portrait of a male in a vibrant Japanese anime style, sharp lines, expressive eyes.' }, { name: 'Fantasy', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/fantasy.jpg', gender: 'male', prompt: 'A portrait of a male in a high-fantasy style, elven or magical elements, ethereal lighting.' }, { name: 'Vintage', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/vintage.jpg', gender: 'male', prompt: 'A portrait of a male in a vintage, old-fashioned photograph style, sepia tones, classic attire.' }, { name: 'Sci-Fi', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sci_fi.jpg', gender: 'male', prompt: 'A futuristic portrait of a male in a sci-fi setting, neon lights, advanced technology, space explorer.' }, { name: 'Cyberpunk', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyberpunk.jpg', gender: 'male', prompt: 'A portrait of a male in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.' }, { name: 'Steampunk', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/steampunk.jpg', gender: 'male', prompt: 'A portrait of a male in a steampunk style, victorian clothing with brass gears and clockwork.' }, { name: 'Medieval', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/medieval.jpg', gender: 'male', prompt: 'A portrait of a male knight in a medieval style, shining armor, castle background.' }, { name: 'Celeb', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg', gender: 'male', prompt: 'A portrait of a male as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous.' }, { name: 'Doll', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/doll.jpg', gender: 'male', prompt: 'A portrait of a male as a polished, porcelain doll, perfectly crafted features.' }, { name: 'Astronaut', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/astronaut.jpg', gender: 'male', prompt: 'A portrait of a male astronaut in a spacesuit, reflection of stars in the helmet visor.' }, { name: 'Cartoon', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cartoon.jpg', gender: 'male', prompt: 'A portrait of a male in a modern 3D cartoon style, like a character from an animated movie.' }, { name: 'Sculpture', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/sculpture.jpg', gender: 'male', prompt: 'A portrait of a male as a classical marble sculpture, detailed stone texture, dramatic lighting.' }, { name: 'Alien', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/alien.jpg', gender: 'male', prompt: 'A portrait of a male as a friendly or mysterious alien being, otherworldly features.' }, { name: 'Cyborg', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/cyborg.jpg', gender: 'male', prompt: 'A portrait of a male as a cyborg, blending human and machine, glowing circuits.' }, { name: 'Zombie', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/zombie.jpg', gender: 'male', prompt: 'A stylized portrait of a male as a zombie, post-apocalyptic theme.' }, { name: 'Spooky', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/spooky.jpg', gender: 'male', prompt: 'A spooky, gothic horror portrait of a male, dark atmosphere, mysterious shadows.' }, { name: 'Clown', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Clown.jpg', gender: 'male', prompt: 'A portrait of a male as a friendly circus clown, colorful makeup and costume.' }, { name: 'Halloween', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/male.png', gender: 'male', prompt: 'A portrait of a male in a fun Halloween costume, jack-o-lanterns and spooky decorations.' }, { name: 'Diwali', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/002.png', gender: 'male', prompt: 'A portrait of a male celebrating Diwali, traditional Indian attire, festive lights (diyas).' }, { name: 'Christmas', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/male/Christmas_male512.png', gender: 'male', prompt: 'A festive portrait of a male in a Christmas setting, wearing a Santa hat or ugly sweater.' }, { name: 'Surprises', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/29.jpg', gender: 'male', prompt: 'A fun, surprising portrait of a male, maybe with confetti or a pop art background.' }, // Female Styles { name: 'Action Figure', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745922059362.png', gender: 'female', prompt: 'A photorealistic portrait of a female as an Action Figure, dynamic pose, plastic texture, cinematic lighting.' }, { name: 'Celebrity', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_avatar/1745233095138.jpg', gender: 'female', prompt: 'A high-fashion portrait of a female celebrity, magazine cover style, sharp focus, glamorous.' }, { name: 'Doll', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/doll.jpg', gender: 'female', prompt: 'A portrait of a female as a beautiful, polished doll with perfect features, vibrant outfit.' }, { name: 'Warrior', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/warrior.jpg', gender: 'female', prompt: 'A gritty portrait of a female warrior, ornate armor, determined expression, epic fantasy style.' }, { name: 'Muscular', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/mascular.jpg', gender: 'female', prompt: 'A fitness portrait of a muscular female, strong and toned physique, dramatic shadows, athletic stance.' }, { name: 'Superhero', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/superhero.jpg', gender: 'female', prompt: 'A cinematic portrait of a female superhero, dramatic lighting, detailed costume, powerful expression.' }, { name: 'Vintage', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/vintage.jpg', gender: 'female', prompt: 'A portrait of a female in a vintage, old-fashioned photograph style, sepia tones, classic 1920s glamour.' }, { name: 'Fantasy', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/fantasy.jpg', gender: 'female', prompt: 'A portrait of a female in a high-fantasy style, as an elegant elf or powerful sorceress, ethereal lighting.' }, { name: 'Medieval', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/medieval.jpg', gender: 'female', prompt: 'A portrait of a female queen or princess in a medieval style, elegant gown, castle background.' }, { name: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/anime.jpg', gender: 'female', prompt: 'A portrait of a female in a vibrant Japanese anime style, sharp lines, large expressive eyes.' }, { name: 'Steampunk', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/steampunk.jpg', gender: 'female', prompt: 'A portrait of a female in a steampunk style, victorian dress with brass goggles and clockwork details.' }, { name: 'Sci-Fi', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sci_fi.jpg', gender: 'female', prompt: 'A futuristic portrait of a female in a sci-fi setting, sleek armor, neon lights, space explorer.' }, { name: 'Spooky', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/spooky.jpg', gender: 'female', prompt: 'A spooky, gothic horror portrait of a female, ghostly appearance, dark and mysterious atmosphere.' }, { name: 'Cyberpunk', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyberpunk.jpg', gender: 'female', prompt: 'A portrait of a female in a cyberpunk style, neon-drenched city, cybernetic enhancements, dystopian future.' }, { name: 'Celeb', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/hollywood.jpg', gender: 'female', prompt: 'A portrait of a female as a Hollywood celebrity on the red carpet, paparazzi flashes, glamorous gown.' }, { name: 'Astronaut', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/astronaut.jpg', gender: 'female', prompt: 'A portrait of a female astronaut in a spacesuit, reflection of Earth in the helmet visor.' }, { name: 'Alien', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/alien.jpg', gender: 'female', prompt: 'A portrait of a female as a beautiful and mysterious alien queen, otherworldly features.' }, { name: 'Cartoon', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cartoon.jpg', gender: 'female', prompt: 'A portrait of a female in a modern 3D cartoon style, like a character from a Disney or Pixar movie.' }, { name: 'Cyborg', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/cyborg.jpg', gender: 'female', prompt: 'A portrait of a female as a cyborg, elegant blend of human and machine, glowing circuits.' }, { name: 'Zombie', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/zombie.jpg', gender: 'female', prompt: 'A stylized portrait of a female as a zombie, post-apocalyptic survivor theme.' }, { name: 'Clown', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Clown.jpg', gender: 'female', prompt: 'A portrait of a female as a charming circus clown or pierrot, colorful and friendly makeup.' }, { name: 'Sculpture', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/sculpture.jpg', gender: 'female', prompt: 'A portrait of a female as a graceful classical marble sculpture, detailed stone texture, museum lighting.' }, { name: 'Halloween', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/female.png', gender: 'female', prompt: 'A portrait of a female in a fun Halloween costume, like a witch or vampire, with spooky decorations.' }, { name: 'Diwali', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/Diwali/001.png', gender: 'female', prompt: 'A portrait of a female celebrating Diwali, wearing a beautiful traditional saree, festive lights (diyas).' }, { name: 'Christmas', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/female/Christmas_female512.png', gender: 'female', prompt: 'A festive portrait of a female in a Christmas setting, warm cozy sweater, by a decorated tree.' }, { name: 'Valentine\'s Day', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_avatar_styles_thumbs/36.jpg', gender: 'female', prompt: 'A romantic portrait of a female for Valentine\'s Day, surrounded by hearts and roses, soft lighting.' }, ];
๐Ÿ“„ caricatureStyles.ts
// src/constants/caricatureStyles.ts export interface Style { name: string; imageUrl: string; prompt: string; } export const caricatureStyles: Style[] = [ { name: 'Diva', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/ff03468d-2a81-4a7b-b1a1-243eab68c3f0.jpg', prompt: 'glamorous diva with exaggerated features, dramatic makeup, and confident pose' }, { name: 'Superhero', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dd04d470-fa29-4039-b1e8-8e22dc965d96.jpg', prompt: 'heroic superhero caricature with bold features, strong jawline, and determined expression' }, { name: 'Nurse', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fbec18f3-7348-4402-a105-023da24cf27c.jpg', prompt: 'caring nurse caricature with kind eyes, gentle smile, and professional appearance' }, { name: 'Rockstar', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/0d756d9c-0d36-41a4-a7b4-d7718f8a8406.jpg', prompt: 'edgy rockstar caricature with wild hair, intense expression, and rebellious attitude' }, { name: 'Corporate', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a8ff8c9a-13ec-4fe2-9a06-72c9570872d9.jpg', prompt: 'professional business executive caricature with sharp features, confident smile, and formal attire' }, { name: 'Politician', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7a12a146-a906-490b-8801-2cf7f3f565a5.jpg', prompt: 'charismatic politician caricature with persuasive expression, prominent features, and authoritative presence' }, { name: 'Wonder Woman', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f984a6af-689d-4cee-a087-139740d1533d.jpg', prompt: 'powerful Wonder Woman caricature with strong features, heroic pose, and Amazonian warrior spirit' }, { name: 'Doctor', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bbd0f925-171d-4184-b457-01466c2cb84c.jpg', prompt: 'wise doctor caricature with intelligent eyes, caring expression, and medical professional demeanor' }, { name: 'Superwoman', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/70d86058-dbab-451e-a938-d69ff32af14f.jpg', prompt: 'mighty superwoman caricature with bold features, confident stance, and superhero strength' }, { name: 'Chef', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/baf9d0fe-cb2a-48ca-a442-8df670142841.jpg', prompt: 'passionate chef caricature with expressive face, culinary expertise, and creative cooking spirit' }, { name: 'Engineer', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5bee0616-5f9e-4958-8978-b379a8028717.jpg', prompt: 'innovative engineer caricature with analytical expression, technical precision, and problem-solving mindset' }, { name: 'Firefighter', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/44696ea2-49ae-477c-a654-b6647ad52bfc.jpg', prompt: 'brave firefighter caricature with heroic features, determined expression, and life-saving courage' }, { name: 'Air hostess', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/fc2eb43c-2d66-4461-a79d-d9fe850c0f10.jpg', prompt: 'elegant air hostess caricature with welcoming smile, professional grace, and friendly demeanor' }, { name: 'Architect', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d61d8442-4d37-40fa-a416-1d31f76b950d.jpg', prompt: 'creative architect caricature with visionary expression, artistic flair, and design expertise' }, { name: 'Ballet', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/3c75bc92-f9d5-48f4-9219-fb980d5ad42e.jpg', prompt: 'graceful ballet dancer caricature with elegant features, artistic expression, and dance sophistication' }, { name: 'Athlete', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/d03852f6-081d-49af-85da-709add60982d.jpg', prompt: 'athletic champion caricature with strong features, competitive spirit, and peak physical condition' } ];
๐Ÿ“„ cartoonStyles.ts
// src/constants/cartoonStyles.ts export interface CartoonStyle { name: string; imageUrl: string; gender: 'male' | 'female'; } export const maleCartoonStyles: CartoonStyle[] = [ // Male Styles { name: 'Woody', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg' }, { name: 'Tarzaan', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg' }, { name: 'Suley', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421731.jpg' }, { name: 'Shrekk', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421575.jpg' }, { name: 'Russel', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421409.jpg' }, { name: 'Moanna', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421257.jpg' }, { name: 'Incredibel', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421110.jpg' }, { name: 'Herculess', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420963.jpg' }, { name: 'Hattre', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420807.jpg' }, { name: 'Fro-zone', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420615.jpg' }, { name: 'Rider', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420451.jpg' }, { name: 'Eric', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420276.jpg' }, { name: 'Miguelle', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889420124.jpg' }, { name: 'Fredrickson', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419880.jpg' }, { name: 'Hook', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419739.jpg' }, { name: 'Lightyear', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419579.jpg' }, { name: 'Alladin', gender: 'male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889419379.jpg' }, ]; export const femaleCartoonStyles: CartoonStyle[] = [ // Female Styles { name: 'Snow', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859655.jpg' }, { name: 'Sleeping', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859518.jpg' }, { name: 'Princess', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859374.jpg' }, { name: 'Nordic', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859223.jpg' }, { name: 'Mulan', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894859046.jpg' }, { name: 'Mermaid', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858882.jpg' }, { name: 'Iceland', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858702.jpg' }, { name: 'Fairy', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858521.jpg' }, { name: 'Cinderella', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858381.jpg' }, { name: 'Princess', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858207.jpg' }, { name: 'Alice', gender: 'female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721894858002.jpg' }, ];
๐Ÿ“„ faceSwapStyles.ts
// src/constants/faceSwapStyles.ts export interface FaceSwapStyle { name: string; imageUrl: string; gender: 'male' | 'female' | 'any'; } export const faceSwapStyles: FaceSwapStyle[] = [ // --- Male Faces --- { gender: 'male', name: 'Classic Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg' }, { gender: 'male', name: 'Handsome Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg' }, { gender: 'male', name: 'Young Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg' }, { gender: 'male', name: 'Professional Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg' }, { gender: 'male', name: 'Mature Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg' }, { gender: 'male', name: 'Athletic Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820555898.jpg' }, { gender: 'male', name: 'Casual Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820557168.jpg' }, { gender: 'male', name: 'Stylish Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg' }, { gender: 'male', name: 'Confident Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg' }, { gender: 'male', name: 'Distinguished Male', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg' }, // --- Female Faces --- { gender: 'female', name: 'Classic Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg' }, { gender: 'female', name: 'Beautiful Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg' }, { gender: 'female', name: 'Elegant Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg' }, { gender: 'female', name: 'Young Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg' }, { gender: 'female', name: 'Stylish Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg' }, { gender: 'female', name: 'Modern Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg' }, { gender: 'female', name: 'Professional Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg' }, { gender: 'female', name: 'Sophisticated Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg' }, { gender: 'female', name: 'Confident Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg' }, { gender: 'female', name: 'Glamorous Female', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg' } ];
๐Ÿ“„ filterStyles.ts
export interface AIFilterStyle { id: string; name: string; category: string; imageUrl: string; } export const aiFilterStyles: AIFilterStyle[] = [ // Ghibli Category { id: 'ghibli-1', name: 'Inari', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/97040181-69e1-440d-9c44-45944dd8b8cd.jpg', prompt: 'A character portrait in the whimsical Ghibli art style, reminiscent of Inari shrines, detailed and enchanting.' }, { id: 'ghibli-2', name: 'Shade', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/5d3e262d-c4f0-45f6-a350-47552640cf03.png', prompt: 'A character portrait in the Ghibli art style, with dramatic shading and a mysterious atmosphere.' }, { id: 'ghibli-3', name: 'Zenya', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/962a4918-202c-4a71-a27e-953807d1fd5c.jpg', prompt: 'A serene character portrait in the Ghibli art style, peaceful and elegant, with a Zen-like quality.' }, { id: 'ghibli-4', name: 'Storm', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f80b85ab-ea22-40d0-9e91-3793b24d605c.jpg', prompt: 'A dynamic character portrait in the Ghibli art style, set during a dramatic storm, emotional and powerful.' }, { id: 'ghibli-5', name: 'Noon', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b7497ed5-0d04-4334-9ca7-ec842cd4cdbb.jpg', prompt: 'A bright, sunlit character portrait in the Ghibli art style, capturing the warmth of noon.' }, { id: 'ghibli-6', name: 'Luma', category: 'Ghibli', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/dc63ecdf-c3f3-458a-ac3b-64c37a0b5a1e.jpg', prompt: 'A luminous character portrait in the Ghibli art style, with a soft, glowing light.' }, // Accessories Category { id: 'accessories-1', name: 'Floral Crown', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294968955.jpg', prompt: 'A portrait of a person wearing a beautiful and delicate Floral Crown, bohemian and ethereal style.' }, { id: 'accessories-2', name: 'Scarf', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294969683.jpg', prompt: 'A portrait of a person wearing a stylish Scarf, adding a touch of elegance or coziness.' }, { id: 'accessories-3', name: 'Beanie', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967692.jpg', prompt: 'A portrait of a person wearing a cozy Beanie, casual and cool street style.' }, { id: 'accessories-4', name: 'Bandana', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294966391.jpg', prompt: 'A portrait of a person wearing a cool Bandana, with a retro or edgy vibe.' }, { id: 'accessories-5', name: 'Necklace', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1735294969331.jpg', prompt: 'A close-up portrait focusing on a person wearing an elegant Necklace.' }, { id: 'accessories-6', name: 'Baseball Cap', category: 'Accessories', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1735294967301.jpg', prompt: 'A portrait of a person wearing a sporty Baseball Cap, casual and relaxed.' }, // Anime Category { id: 'anime-1', name: 'Gintocki', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531622371.jpg', prompt: 'A person transformed into the anime character Gintoki Sakata, with silver hair and samurai attire.' }, { id: 'anime-2', name: 'H X H', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531620868.jpg', prompt: 'A person in the distinct art style of the anime Hunter x Hunter.' }, { id: 'anime-3', name: 'Saitaama', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531619290.jpg', prompt: 'A person transformed into the anime character Saitama from One-Punch Man, bald and wearing his hero suit.' }, { id: 'anime-4', name: 'Erren', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531617759.jpg', prompt: 'A person transformed into the anime character Eren Yeager from Attack on Titan, with intense eyes.' }, { id: 'anime-5', name: 'Leloch', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531616067.jpg', prompt: 'A person transformed into the anime character Lelouch Lamperouge from Code Geass, with his Geass eye.' }, { id: 'anime-6', name: 'Light', category: 'Anime', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_filter/thumb/1716531614532.jpg', prompt: 'A person transformed into the anime character Light Yagami from Death Note, with a cunning expression.' }, // Vintage Category { id: 'vintage-1', name: '1990s', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0d3d215d0cf645769449223588572076', prompt: 'A portrait in the style of the 1990s, with grunge or pop fashion and a film grain look.' }, { id: 'vintage-2', name: 'Victorian', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/1a415a7a51bb436c841068395131c43e', prompt: 'An elegant portrait in the Victorian era style, with elaborate clothing and a formal setting.' }, { id: 'vintage-3', name: '1980s', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/9fe8f49883e548f88cf1364c52036685', prompt: 'A portrait with a vibrant 1980s aesthetic, big hair, neon colors, and retro vibes.' }, { id: 'vintage-4', name: '1950s', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/f99d72dbe94c498fb060d466a66b43f7', prompt: 'A classic portrait in the style of the 1950s, with pin-up or rockabilly fashion.' }, { id: 'vintage-5', name: '1920s', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/ab593ec4339f439195d1a139e7a967ad', prompt: 'A glamorous portrait in the style of the Roaring 1920s, with flapper dresses and art deco elements.' }, { id: 'vintage-6', name: '1990s', category: 'Vintage', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d47960ae2f8a4116aaebe364430cfa0d', prompt: 'A portrait with a distinct 1990s vibe, featuring baggy clothes and a cool, casual attitude.' }, // Lights Category { id: 'lights-1', name: 'Sunset', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/964ca646-31ad-4e72-9768-5dd1ea831880.jpg', prompt: 'A portrait with beautiful sunset lighting, warm golden hour glow, dramatic colors.' }, { id: 'lights-2', name: 'Laser', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f9a577ed-e548-4e61-a66d-352f023b35c1.jpg', prompt: 'A futuristic portrait with dramatic laser light effects, vibrant and energetic.' }, { id: 'lights-3', name: 'Fireworks', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/f0a43cd7-6541-4f75-bed7-972b9e0820e7.jpg', prompt: 'A celebratory portrait with a background of exploding fireworks, bright and colorful.' }, { id: 'lights-4', name: 'Northern', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/4fc40ddf-2df9-4063-bce3-1c675b614a3a.jpg', prompt: 'A magical portrait with the Northern Lights (Aurora Borealis) in the sky.' }, { id: 'lights-5', name: 'Bokeh', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/6574b9b8-188d-40c9-9835-6369f42403e5.jpg', prompt: 'A portrait with a beautiful bokeh effect, soft, out-of-focus lights in the background.' }, { id: 'lights-6', name: 'Cinematic', category: 'Lights', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/b08cd6bc-d8cc-4d33-a47f-57eb57dd3b6b.jpg', prompt: 'A portrait with dramatic cinematic lighting, high contrast and moody atmosphere.' }, ]; export const filterCategories = ['Ghibli', 'Accessories', 'Anime', 'Vintage', 'Lights'];
๐Ÿ“„ hairstylePrompts.ts
// src/constants/hairstylePrompts.ts export interface Hairstyle { name: string; imageUrl: string; prompt: string; } export const hairstylePresets: Hairstyle[] = [ { name: 'Long Wavy', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272761.jpg', prompt: 'A portrait with long, wavy, flowing hair' }, { name: 'Long Hair', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599470399.jpg', prompt: 'A portrait with very long, straight hair' }, { name: 'Mullet', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599470887.jpg', prompt: 'A person with a modern mullet hairstyle' }, { name: 'Bangs', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599471255.jpg', prompt: 'A portrait of a person with stylish, full bangs' }, { name: 'Braids', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1729599471688.jpg', prompt: 'A portrait featuring intricate and beautiful braids' }, { name: 'Bald', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d59b665d0a17403c9da49e7891a1cb99', prompt: 'A completely bald head, smooth and clean' }, { name: 'Wavy', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/37261d6f1dd84b1c9b7b710dd3b19736', prompt: 'A portrait with short, naturally wavy hair' }, { name: 'Buzz Cut', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/349d4a89249f41d59dac7efb4803da0d', prompt: 'A person with a clean and sharp buzz cut' }, { name: 'Blunt', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/bb1bbe6e68254173b654eb5b07710242', prompt: 'A portrait featuring a stylish blunt cut hairstyle' }, { name: 'Layered', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/e29a7406d2ed4858a8959249b74598a7', prompt: 'A person with a modern, layered hairstyle for volume and texture' }, { name: 'Undercut', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/d8484fb1c9f145ce8f718d1f5dbeb3ac', prompt: 'A stylish undercut hairstyle' }, { name: 'Taper Fade', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/777f33ab9f574686b3ec80aae28cbf15', prompt: 'A portrait with a clean taper fade haircut' }, { name: 'Dreadlocks', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/bd4e0546000e40aea0af6076f281fbca', prompt: 'A person with cool and stylish dreadlocks' }, { name: 'Ballerina Bun', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/32bdfca6ef9c4bfa9659ce4ca7ebf2db', prompt: 'An elegant and tight ballerina bun hairstyle' }, { name: 'Ponytail', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/b68a115ea2ca4a4ea9e8d0c1305a085e', prompt: 'A person with a classic, sleek ponytail' }, { name: 'Messy Bun', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/0cf7c98bbec84282ba05ab093d469c74', prompt: 'A casual and stylish messy bun hairstyle' }, { name: 'Crew Cut', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/4e4477a804174b3faa013f4b5ba190bf', prompt: 'A classic and clean crew cut hairstyle' }, { name: 'Shaggy', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/268c6b15f80744fb8321e902eb1940ce', prompt: 'A person with a trendy, shaggy, layered haircut' }, { name: 'Pixie Cut', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/c8bf0bd53d8043b199a57435012d8773', prompt: 'A stylish and modern pixie cut' }, { name: 'Bob Cut', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179271643.jpg', prompt: 'A classic bob cut hairstyle' }, { name: 'Afro', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179270863.jpg', prompt: 'A person with a voluminous and beautiful afro hairstyle' }, { name: 'Bowl Cut', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272046.jpg', prompt: 'A retro bowl cut hairstyle' }, { name: 'Curly', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179272394.jpg', prompt: 'A portrait with natural, bouncy curly hair' }, { name: 'Space Bun', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_filter/1727179273109.jpg', prompt: 'A fun and trendy space bun hairstyle' }, ];
๐Ÿ“„ imageGeneratorOptions.ts
// Image resolution options for AI Image Generator export interface ImageResolution { id: string; name: string; aspectRatio: string; dimensions: string; width: number; height: number; } export const imageResolutions: ImageResolution[] = [ { id: 'square', name: 'Square', aspectRatio: '1:1', dimensions: '1024x1024 px', width: 1024, height: 1024 }, { id: 'portrait-9-16', name: 'Portrait', aspectRatio: '9:16', dimensions: '768x1360 px', width: 768, height: 1360 }, { id: 'landscape-16-9', name: 'Landscape', aspectRatio: '16:9', dimensions: '1360x768 px', width: 1360, height: 768 }, { id: 'portrait-3-4', name: 'Portrait', aspectRatio: '3:4', dimensions: '880x1168 px', width: 880, height: 1168 }, { id: 'landscape-4-3', name: 'Landscape', aspectRatio: '4:3', dimensions: '1168x880 px', width: 1168, height: 880 }, { id: 'portrait-2-3', name: 'Portrait', aspectRatio: '2:3', dimensions: '832x1248 px', width: 832, height: 1248 }, { id: 'landscape-3-2', name: 'Landscape', aspectRatio: '3:2', dimensions: '1248x832 px', width: 1248, height: 832 } ]; // Suggested prompts for AI Image Generator export const suggestedPrompts: string[] = [ 'generate cute fawn cartoon character enjoying springtime flowers in highly detailed', 'create an (old cartoon illustration) of an abandoned boat on the beach surrounded by seagulls and starfish, stormy clouds', 'generate a serpent with a hypnotic gaze in a magical wonderland, best quality, masterpiece, ultra sharp, hyper-realistic', 'generate an 8k ultra-realistic image of a beautiful unicorn in heaven, high quality with rich vibrant vivid colors', 'design a character in the style of Amy Judd blending with Andre Kohn style:1.1), ((neo-figurative fantasy:1.2)), a young woman made of smoke and fog and delicate misty wisps sitting with her side.', 'knight fighting a giant fantasy dragon, a burned village in the background, highly detailed, dark fantasy, (morning dawn epic scene of dense smoke by Kim Keever)', 'generate a (glowing eyes:1. 2) smiling medusa with pale white cracked skin, snakes growing out of her head, dramatic with the best quality', 'generate a realistic (batman:1.3) holding a powerful magical electric thunder ball spellbook with detailed eyes, cinematic', 'create a photo of the artistic stone cup with 3D carvings of a muscular teenage ninja turtle in vibrant colors body, decorated with amber accents in dark mountain', 'generate a feudal ninja fighting bravely against a giant colossus straw puppet boss, hyper-detailed, ultra-detailed', 'create a pixar character of a bull terrier smiling, high resolution, best quality, ((pixar style))', 'a dzungarian hamster in an adventurer\'s hat with slimy tentacles made of blue and white porcelain in wonderland, fantasy art concept, best quality, masterpiece', 'create an ethereal beauty of mystical trees with sparkling blossoms illuminated by a red radiant moon casting its glow upon a tree and large landscape', 'pixar style of transparent king seahorse with a crown (((luminous))) in the ocean covered with bubbles, high detailed, photorealistic, 8k', 'Alice fighting a Oompa Loompa with a large sword, hyper detailed, high quality', 'pixar style of lobster, as a cartoon business man character, tinny cute, ((( luminous))), carring a little suitcase, in the ocean, bubbles, smile, high detailed, photorealistic, 8k , smooth, simple', 'generate a ((leprechaun)) dancing on a big cauldron full of shiny golden coins in front of a dark cave, (evil laugh), ((clover bushes in the foreground)), god rays of rim light from the small cleft, dense dust, dark fantasy art', 'pixar style of a chubby giraffe with a big tummy like a ball doing yoga poses in yoga pants, smiling, highly detailed, photorealistic' ];
๐Ÿ“„ index.ts
export const SITE_TITLE = 'ModernPhotoTools.com'; export const SITE_DESCRIPTION = 'Free online photo editing tools powered by AI. Edit, enhance, and transform your images with professional-quality results in seconds.'; export const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB export const ACCEPTED_IMAGE_TYPES = ['image/jpeg', 'image/png']; export { faceSwapStyles } from './faceSwapStyles';
๐Ÿ“„ outfitStyles.ts
// src/constants/outfitStyles.ts export interface OutfitStyle { category: string; name: string; prompt: string; } export const presetOutfitStyles: OutfitStyle[] = [ // Category: Wedding { category: 'Wedding', name: '2-Piece', prompt: 'A model wearing a modern and elegant 2-piece wedding outfit, professional studio photoshoot.' }, { category: 'Wedding', name: 'Wedding Jacket', prompt: 'A model in a sophisticated wedding jacket, suitable for a chic and formal ceremony.' }, { category: 'Wedding', name: 'A-Line', prompt: 'A model wearing a classic A-Line wedding gown, timeless and graceful, full-length view.' }, { category: 'Wedding', name: '3 Piece Suit', prompt: 'A model looking dapper in a perfectly tailored 3-piece wedding suit, formal and sharp.' }, { category: 'Wedding', name: 'Gown', prompt: 'A model in a breathtaking, floor-length wedding gown, romantic and elegant.' }, { category: 'Wedding', name: 'Classic Suit', prompt: 'A model wearing a timeless classic suit for a wedding, sophisticated and elegant.' }, // Category: Smart Casual { category: 'Smart Casual', name: 'Blazer', prompt: 'A model wearing a stylish jacket, embodying a perfect smart casual look for an urban setting.' }, { category: 'Smart Casual', name: 'Casual Jacket', prompt: 'A model in a fashionable smart casual jacket, effortlessly chic for a day out.' }, { category: 'Smart Casual', name: 'Knit Cardigan', prompt: 'A model looking cozy and stylish in a layered smart casual cardigan.' }, { category: 'Smart Casual', name: 'Open Cardigan', prompt: 'A model in a comfortable knit cardigan, the essence of smart casual fashion.' }, { category: 'Smart Casual', name: 'Blouse shirt', prompt: 'A model in an elegant blouse shirt, perfect for a smart casual office look or evening.' }, { category: 'Smart Casual', name: 'Button-up', prompt: 'A model wearing a crisp button-up shirt, a versatile staple of smart casual style.' }, // Category: Athleisure { category: 'Athleisure', name: 'Sports Bra', prompt: 'A model in a trendy and supportive sports bra, athleisure style, in a fitness studio.' }, { category: 'Athleisure', name: 'Basketball', prompt: 'A model wearing basketball-inspired athleisure wear on an urban court, sporty and cool.' }, { category: 'Athleisure', name: 'Pullover Hoodie', prompt: 'A model in a comfortable athleisure hoodie, perfect for a casual, sporty look.' }, { category: 'Athleisure', name: 'Zip-up Hoodie', prompt: 'A model showcasing a different style of athleisure hoodie, street style fashion.' }, { category: 'Athleisure', name: 'Tank Top', prompt: 'A model in a breathable athleisure tank top, looking ready for a workout.' }, { category: 'Athleisure', name: 'Polo', prompt: 'A model in a classic polo shirt, styled for a sophisticated athleisure look.' }, // Category: Jackets (Inferred) { category: 'Jackets', name: 'Classic Denim Jacket', prompt: 'A model in a timeless denim jacket, casual street style photoshoot.' }, { category: 'Jackets', name: 'Vintage Denim Jacket', prompt: 'A model showcasing a fashionable denim jacket against an urban background.' }, // Category: Sweaters (Inferred) { category: 'Sweaters', name: 'Sweater', prompt: 'A model wearing a cozy knit sweater, perfect for a warm and stylish autumn look.' }, { category: 'Sweaters', name: 'Turtleneck', prompt: 'A model in a chic turtleneck sweater, exuding sophistication and warmth.' }, // Category: Traditional (Inferred) { category: 'Traditional', name: 'Kebaya', prompt: 'A model wearing a beautiful, intricate traditional Kebaya blouse, celebrating cultural heritage.' }, { category: 'Traditional', name: 'Highland', prompt: 'A model dressed in Scottish Highland attire, featuring traditional tartan patterns.' }, // Category: Bohemian (Inferred) { category: 'Bohemian', name: 'Bohemian', prompt: 'A model with a free-spirited bohemian look, featuring flowing fabrics and earthy tones.' }, { category: 'Bohemian', name: 'Funky', prompt: 'A model in a funky, eclectic outfit with bold colors and unique patterns, expressing individuality.' }, ]; export const suggestedOutfitPrompts: string[] = [ "Vibrant balloons", "Urban brick wall", "Lush garden scene", "Serene ocean view", "Abstract painting", "Graffiti-covered wall", "Rustic barn", "City skyline", "Enchanting forest landscape", "Majestic mountain range" ];
๐Ÿ“„ portraitStyles.ts
// src/constants/portraitStyles.ts export interface PortraitStyle { name: string; imageUrl: string; gender: 'male' | 'female' | 'any'; prompt: string; } export const portraitStyles: PortraitStyle[] = [ // --- Male Styles --- { gender: 'male', name: 'Wizard', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721888196773.jpg', prompt: 'A selfie of a male as a powerful Wizard, wearing magical robes, in a fantasy library setting.' }, { gender: 'male', name: 'Trench Coat', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586882.jpg', prompt: 'A cinematic selfie of a male wearing a stylish Trench Coat on a rainy city street at night.' }, { gender: 'male', name: 'Sweater', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890586740.jpg', prompt: 'A cozy selfie of a male in a warm, knitted sweater, autumn vibes, soft lighting.' }, { gender: 'male', name: 'Grinch', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a7b8a481-8776-4589-b1bb-9c021da759f5.jpg', prompt: 'A selfie of a male transformed into the Grinch, with green fur and a mischievous smile, festive theme.' }, { gender: 'male', name: 'Superhero', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721817393935.jpg', prompt: 'A dynamic selfie of a male as a powerful Superhero, wearing a modern costume, with a city skyline in the background.' }, { gender: 'male', name: 'Post Imp', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891374496.jpg', prompt: 'A selfie of a male in a Post-Impressionist art style, with bold colors and expressive brushstrokes.' }, { gender: 'male', name: 'Abstract', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721891373055.jpg', prompt: 'A selfie of a male in a vibrant abstract art style, using geometric shapes and non-realistic colors.' }, { gender: 'male', name: 'Wooden', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777377.jpg', prompt: 'A selfie of a male reimagined as a detailed Wooden sculpture, showing wood grain and texture.' }, { gender: 'male', name: 'Stone', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721820777195.jpg', prompt: 'A selfie of a male reimagined as a classical Stone sculpture, with a marble or granite texture.' }, { gender: 'male', name: 'Thriller', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925211.jpg', prompt: 'A selfie of a male in a classic thriller movie style, dramatic shadows, intense expression.' }, { gender: 'male', name: 'Suave', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721821925057.jpg', prompt: 'A selfie of a suave male in a tailored suit, looking confident and charming, like a secret agent.' }, { gender: 'male', name: 'Officer', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890916035.jpg', prompt: 'A professional selfie of a male as a respectable military Officer in a formal uniform.' }, { gender: 'male', name: 'Cop', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721890915894.jpg', prompt: 'A selfie of a male as a police Cop, wearing a uniform, looking serious and dedicated.' }, { gender: 'male', name: 'Cyber Warrior', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823784962.jpg', prompt: 'A selfie of a male as a futuristic Cyber Warrior, with high-tech armor and a glowing energy sword.' }, { gender: 'male', name: 'Viking', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721823787503.jpg', prompt: 'A selfie of a male as a fierce Viking warrior, with braided hair, beard, and traditional armor.' }, { gender: 'male', name: 'Legacy', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197112042.jpg', prompt: 'A selfie of a male with Day of the Dead face paint, celebrating a vibrant legacy with flowers and patterns.' }, { gender: 'male', name: 'Ancestor', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1730197109686.jpg', prompt: 'A selfie of a male in the style of a revered Ancestor, with traditional Day of the Dead sugar skull makeup.' }, { gender: 'male', name: 'Mohawk', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397418.jpg', prompt: 'A selfie of a male with a cool Mohawk hairstyle, punk rock aesthetic.' }, { gender: 'male', name: 'Gray', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721886397288.jpg', prompt: 'A selfie of a male with distinguished gray hair, looking handsome and sophisticated.' }, { gender: 'male', name: 'Sultan', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654277.jpg', prompt: 'A royal selfie of a male as a powerful Sultan, wearing ornate robes and a majestic turban.' }, { gender: 'male', name: 'Ottoman', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887654139.jpg', prompt: 'A royal selfie of a male in traditional Ottoman empire attire, rich fabrics and intricate details.' }, { gender: 'male', name: 'Mughal', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653999.jpg', prompt: 'A royal selfie of a male as a Mughal emperor, adorned with jewels and fine silks.' }, { gender: 'male', name: 'Mayan', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653860.jpg', prompt: 'A royal selfie of a male as a Mayan king, with traditional headdress and intricate carvings.' }, { gender: 'male', name: 'Heian', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653726.jpg', prompt: 'A royal selfie of a male in the style of the Japanese Heian period, elegant and artistic.' }, { gender: 'male', name: 'European', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653548.jpg', prompt: 'A selfie of a male as classic European royalty, wearing a crown and regal attire.' }, { gender: 'male', name: 'Chinese', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653334.jpg', prompt: 'A selfie of a male as a historical Chinese emperor, in traditional silk robes.' }, { gender: 'male', name: 'Byzantine', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887653170.jpg', prompt: 'A selfie of a male in the opulent style of a Byzantine noble, with rich mosaics and gold.' }, { gender: 'male', name: 'African', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721887652980.jpg', prompt: 'A selfie of a male as a proud African king, wearing vibrant traditional attire and beads.' }, { gender: 'male', name: 'Woody', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889422029.jpg', prompt: 'A selfie of a male transformed into the cartoon character Woody from Toy Story, 3D animated style.' }, { gender: 'male', name: 'Tarzaan', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_male/thumb/1721889421881.jpg', prompt: 'A selfie of a male as the cartoon character Tarzan, in a lush jungle, animated style.' }, { gender: 'male', name: 'Waist-coat', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890156866.jpg', prompt: 'A selfie of a male celebrating Diwali, wearing a traditional Kurta with a stylish waist-coat.' }, { gender: 'male', name: 'Contemporary', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1721890157076.jpg', prompt: 'A selfie of a male in a contemporary outfit for Diwali, modern and festive.' }, { gender: 'male', name: 'Adorable', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443497129.jpg', prompt: 'An adorable selfie of a male for Valentine\'s Day, with a sweet smile and a background of hearts.' }, { gender: 'male', name: 'Charming', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1737443499416.jpg', prompt: 'A charming selfie of a male on Valentine\'s Day, holding a rose, looking romantic.' }, { gender: 'male', name: 'Vibrant', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581601035.jpg', prompt: 'A selfie of a male celebrating Holi, face covered in vibrant colored powders.' }, { gender: 'male', name: 'Phoolrang', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1738581602870.jpg', prompt: 'A selfie of a male celebrating Holi with Phoolrang, surrounded by flower petals and colors.' }, { gender: 'male', name: 'Santa', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851564.jpg', prompt: 'A festive selfie of a male dressed as Santa Claus, with a white beard and red hat.' }, { gender: 'male', name: 'Snow', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_male/1732277851805.jpg', prompt: 'A selfie of a male in a winter wonderland, with snow falling gently around him, Christmas theme.' }, { gender: 'male', name: 'Vibrant', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/28ad386a-6665-46f5-8e87-9e6d9fd2a036.jpg', prompt: 'A selfie of a male at a vibrant New Year\'s party, with confetti and bright lights.' }, { gender: 'male', name: 'Stylish', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/7cd237c1-9274-46e1-bddb-c1953d00f075.jpg', prompt: 'A stylish selfie of a male dressed up for a New Year\'s celebration, looking sharp in a suit.' }, // --- Female Styles --- { gender: 'female', name: 'Woolen Coat', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571754.jpg', prompt: 'A chic selfie of a female in an elegant Woolen Coat, winter fashion in the city.' }, { gender: 'female', name: 'Tropical', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571591.jpg', prompt: 'A selfie of a female in a vibrant Tropical dress, on a sunny beach with palm trees.' }, { gender: 'female', name: 'Trench Coat', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571422.jpg', prompt: 'A selfie of a female wearing a classic Trench Coat, sophisticated and timeless look, autumn setting.' }, { gender: 'female', name: 'Sweater', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571273.jpg', prompt: 'A cozy selfie of a female wearing a soft, warm sweater, holding a cup of coffee.' }, { gender: 'female', name: 'Stylish', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892571131.jpg', prompt: 'A selfie of a very stylish female in a high-fashion outfit, looking ready for a magazine cover.' }, { gender: 'female', name: 'Street Style', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570976.jpg', prompt: 'A selfie of a female with an edgy Street Style look, in a cool urban environment.' }, { gender: 'female', name: 'Poncho', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570828.jpg', prompt: 'A selfie of a female wearing a fashionable, patterned Poncho, bohemian and chic.' }, { gender: 'female', name: 'Nightdress', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570665.jpg', prompt: 'A selfie of a female in an elegant silk Nightdress, soft and dreamy bedroom setting.' }, { gender: 'female', name: 'Jacket', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570497.jpg', prompt: 'A selfie of a female in a cool leather Jacket, exuding confidence and style.' }, { gender: 'female', name: 'Cocktail', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570350.jpg', prompt: 'A selfie of a female in a stunning Cocktail dress, ready for an evening event.' }, { gender: 'female', name: 'Classic Black', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570192.jpg', prompt: 'A selfie of a female in a timeless, classic black dress, sophisticated and elegant.' }, { gender: 'female', name: 'Boho', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892570025.jpg', prompt: 'A selfie of a female with a Boho-chic style, flowy dress, and earthy accessories.' }, { gender: 'female', name: 'Bodysuit', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569859.jpg', prompt: 'A selfie of a female in a sleek and stylish Bodysuit, modern and fashionable.' }, { gender: 'female', name: 'Blazer', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569709.jpg', prompt: 'A selfie of a female looking sharp and professional in a well-fitted Blazer.' }, { gender: 'female', name: 'Athleisure', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721892569494.jpg', prompt: 'A selfie of a female in trendy Athleisure wear, sporty, comfortable, and stylish.' }, { gender: 'female', name: 'Aesthetic', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893290344.jpg', prompt: 'A selfie of a female with a soft, dreamy aesthetic, pastel colors, and artistic flair.' }, { gender: 'female', name: 'Goddess', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/hd/ai_selfie_female/1721893291279.jpg', prompt: 'A selfie of a female transformed into a divine Goddess, with ethereal light and a powerful aura.' }, { gender: 'female', name: 'Romanticism', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822384442.jpg', prompt: 'A selfie of a female in the style of a Romanticism painting, dramatic, emotional, and beautiful.' }, { gender: 'female', name: 'Abstract', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721822382528.jpg', prompt: 'A selfie of a female rendered in a colorful abstract painting style, bold shapes and lines.' }, { gender: 'female', name: 'Goddess', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721893611671.jpg', prompt: 'A fantasy selfie of a female as a celestial Goddess, surrounded by stars and cosmic energy.' }, { gender: 'female', name: 'Viking', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733226.jpg', prompt: 'A selfie of a female as a strong Viking warrior, with intricate braids and leather armor.' }, { gender: 'female', name: 'Tribal', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721891733082.jpg', prompt: 'A selfie of a female with beautiful tribal face paint and traditional accessories, proud and powerful.' }, { gender: 'female', name: 'Soulful', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197129378.jpg', prompt: 'A soulful selfie of a female with artistic Day of the Dead makeup, celebrating life and memory.' }, { gender: 'female', name: 'Sacred', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1730197131255.jpg', prompt: 'A selfie of a female with sacred Day of the Dead sugar skull art, adorned with marigolds.' }, { gender: 'female', name: 'Black Stone', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721880887150.jpg', prompt: 'A selfie of a female reimagined as an elegant Black Stone sculpture, polished and dramatic.' }, { gender: 'female', name: 'Stone', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721825362271.jpg', prompt: 'A selfie of a female as a graceful Greco-Roman stone sculpture, timeless beauty.' }, { gender: 'female', name: 'Wavy', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770675.jpg', prompt: 'A selfie of a female with beautiful, long wavy hair, looking natural and effortless.' }, { gender: 'female', name: 'Victoria Roll', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721881770509.jpg', prompt: 'A selfie of a female with an elegant Victoria Roll hairstyle, classic and sophisticated.' }, { gender: 'female', name: 'Clothes', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882293628.jpg', prompt: 'A selfie of a female in futuristic clothes with glowing neon accents, cyberpunk fashion.' }, { gender: 'female', name: 'Space Explorer', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721882294348.jpg', prompt: 'A selfie of a female as a neon Space Explorer, with a futuristic suit and helmet.' }, { gender: 'female', name: 'Spain', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885286031.jpg', prompt: 'A selfie of a female as Spanish royalty, wearing a traditional, elegant gown.' }, { gender: 'female', name: 'Queen', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_selfie_female/thumb/1721885285866.jpg', prompt: 'A royal selfie of a female as a powerful Queen, wearing a crown and regal jewelry.' }, ]; export const suggestedPortraitPrompts = [ 'Professional headshot with soft lighting', 'Artistic portrait with dramatic shadows', 'Vintage style with warm tones', 'Modern minimalist portrait', 'Fantasy character transformation', 'Cinematic movie poster style', 'Oil painting classical portrait', 'Digital art cyberpunk style' ];
๐Ÿ“„ productStyles.ts
export interface ProductStyle { name: string; imageUrl: string; prompt: string; } export const productStyles: ProductStyle[] = [ { name: 'Cherry Blossoms', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020929.jpg', prompt: 'A product placed amidst delicate cherry blossoms, soft pink background, professional product photography, cinematic lighting.' }, { name: 'Lavenders', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842020705.jpg', prompt: 'A product displayed in a field of lavenders, rustic and natural setting, calm and soothing atmosphere, product photoshoot.' }, { name: 'Winter', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089570.jpg', prompt: 'Professional apparel photoshoot, winter theme, snowy background, warm clothing, fashion shot.' }, { name: 'Wedding', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604089011.jpg', prompt: 'Elegant wedding apparel photoshoot, soft lighting, romantic setting, bridal theme, high fashion.' }, { name: 'Urban', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604088380.jpg', prompt: 'Urban streetwear apparel photoshoot, city background with a graffiti wall, edgy and modern style.' }, { name: 'Summer', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087821.jpg', prompt: 'Summer fashion apparel photoshoot on a bright sunny day, beach or poolside setting, vibrant colors.' }, { name: 'Red Carpet', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604087214.jpg', prompt: 'Red carpet apparel photoshoot, glamorous evening gown, flashing lights, celebrity style.' }, { name: 'Party', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086601.jpg', prompt: 'Festive party apparel photoshoot with confetti and balloons, celebratory mood, dynamic and fun.' }, { name: 'Business', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604086039.jpg', prompt: 'Professional business apparel photoshoot in a modern office setting, clean and sharp look, corporate attire.' }, { name: 'Athleisure', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604085478.jpg', prompt: 'Athleisure apparel photoshoot with a sporty and comfortable look, in an urban park or gym setting.' }, { name: 'Adventure', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720604084689.jpg', prompt: 'Adventure and outdoor apparel photoshoot, mountain or forest background, rugged and durable clothing.' }, { name: 'Rosebed', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/a0ca0330-f483-4c55-8a2f-18ce0db0c39e.jpg', prompt: 'A cherished product, like jewelry or perfume, displayed on a bed of fresh red roses, romantic and luxurious.' }, { name: 'Ribbons', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/product_thumb/bd2b6d55-4709-4a1a-90de-0f48e73f68d7.jpg', prompt: 'A product artfully arranged with flowing silk ribbons, elegant and delicate presentation, studio shot.' }, { name: 'River', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119732.jpg', prompt: 'Product photoshoot set by a clear mountain river, on natural stones, in a serene and pristine environment.' }, { name: 'Waterfall', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842119524.jpg', prompt: 'Product photoshoot with a majestic waterfall in the background, misty and powerful nature scene.' }, { name: 'Tree Stump', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244508.jpg', prompt: 'A rustic product displayed on an old tree stump in a forest, natural and earthy mood.' }, { name: 'Mountain', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841244245.jpg', prompt: 'Product photoshoot on a mountain peak, dramatic sky, expansive and adventurous mood.' }, { name: 'Kitchen', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842034380.jpg', prompt: 'Product placement in a modern, clean kitchen setting, lifestyle photoshoot, natural light.' }, { name: 'Bathroom', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842033958.jpg', prompt: 'Cosmetic product displayed in a luxurious, spa-like bathroom, clean and fresh aesthetic.' }, { name: 'Sneakers', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509574349.jpg', prompt: 'Dynamic photoshoot of sneakers, urban street setting, motion blur, product in action.' }, { name: 'Sandals', imageUrl: 'https://d2k373fi2nomq1.cloudfront.net/d531c933d42142669d274a55c946108c/206c0e5fc3f54894a3add602580c195a', prompt: 'Lifestyle photoshoot of sandals on a sunny beach, sand and waves in the background, relaxed summer vibe.' }, { name: 'Rose Pink', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982317.jpg', prompt: 'Product placed on a solid rose pink surface, minimalist and clean, top-down studio shot.' }, { name: 'Light Coral', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841982080.jpg', prompt: 'Product displayed on a light coral colored background, soft and warm aesthetic, studio product shot.' }, { name: 'Storage', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509555427.jpg', prompt: 'A piece of storage furniture in a well-decorated room, lifestyle shot showing its use and style.' }, { name: 'Sofa', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720509554980.jpg', prompt: 'A stylish sofa featured in a modern living room, highlighting its texture and comfort.' }, { name: 'Pilea', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995995.jpg', prompt: 'Product photoshoot with a Pilea plant, creating a green and fresh atmosphere in a minimalist interior.' }, { name: 'Hoya', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696841995739.jpg', prompt: 'Product displayed next to a beautiful Hoya plant, biophilic design, natural and calming.' }, { name: 'Ring', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988340.jpg', prompt: 'Macro shot of a ring on a luxurious surface, focused on details and sparkle, elegant lighting.' }, { name: 'Pendant', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1720432988007.jpg', prompt: 'An elegant pendant necklace display, soft focus background, highlighting the craftsmanship.' }, { name: 'Marble Table', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062430.jpg', prompt: 'Product photoshoot on a white marble table, luxurious and clean aesthetic, top-down view.' }, { name: 'Liquid Surface', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842062164.jpg', prompt: 'Product placed on a surface with realistic liquid ripples, creative and dynamic studio shot.' }, { name: 'Graffiti', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006896.jpg', prompt: 'Product photoshoot against a vibrant graffiti wall, urban and edgy style.' }, { name: 'Fireworks', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842006566.jpg', prompt: 'Product displayed with a background of colorful fireworks, celebratory and exciting mood.' }, { name: 'Berries', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696919338904.jpg', prompt: 'A cosmetic or food product surrounded by fresh berries, vibrant and natural.' }, { name: 'Coffee Beans', imageUrl: 'https://d2v5dzhdg4zhx3.cloudfront.net/ai_photoshoot/thumb/1696842044157.jpg', prompt: 'A product surrounded by aromatic roasted coffee beans, warm and rich atmosphere.' } ]; export const suggestedPrompts = [ 'an object on a marble counter', 'an object on water-rippling water', 'an object surrounded by rose petals', 'an object on a mountain', 'an object on a kitchen counter', 'an object on a rock', 'waterfall in background', 'an object on top of a lotus flower', 'an object on snowy mountain', 'an object with golden light', 'an object in the sky', 'cloudy sky' ];
๐Ÿ“ content
๐Ÿ“ blog
๐Ÿ“ data
๐Ÿ“„ blogArticles.ts
export interface BlogArticle { id: string; title: string; excerpt: string; content: string; publishDate: string; readTime: string; category: 'general' | 'tools'; featuredImage: string; relatedTool?: string; keywords?: string[]; } // Blog article metadata index - content is now loaded from individual Markdown files export const blogArticleIndex = [ { id: 'free-watermark-remover-easy-ai-tool-for-perfect-results', title: 'Free Watermark Remover: Easy AI Tool for Perfect Results', excerpt: 'Remove watermarks from photos and TikTok videos with our free watermark remover. Our AI-powered tool preserves image quality while eliminating logos, text, and watermarks in seconds.', publishDate: '2025-11-15', readTime: '12 min read', category: 'tools' as const, featuredImage: '/images/tools images/AI Watermark Remover Tool.jpg', relatedTool: 'watermark-remover', keywords: ['watermark remover', 'remove watermark', 'TikTok watermark'] }, { id: 'how-to-create-professional-product-photos-with-ai', title: 'How to Create Professional Product Photos with AI | Modern Photo Tools', excerpt: 'Learn how to create professional product photos with AI using simple techniques. Transform ordinary product shots into stunning visuals without expensive equipment or photography skills.', publishDate: '2025-10-27', readTime: '14 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/c8438f59-0398-4234-b96f-76e122f42266.jpg', keywords: ['AI product photography', 'product photos', 'e-commerce images'] }, { id: 'remove-people-from-photos-without-photoshop', title: 'How to Remove People from Photos Without Photoshop | Modern Tools', excerpt: 'Learn how to remove people from photos without Photoshop using AI-powered tools. Our step-by-step guide shows you how to clean up images and replace unwanted elements easily.', publishDate: '2025-10-14', readTime: '12 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/cc414ba0-93ff-4984-8f71-08d0ce36a003.jpg', relatedTool: 'ai-cleanup' }, { id: 'best-photo-background-editors-2025', title: '10 Best Photo Background Editors for Perfect Images in 2025', excerpt: 'Discover the top 10 best photo background editors in 2025. Compare features, pricing, and capabilities of leading tools for perfect image editing results.', publishDate: '2025-10-01', readTime: '18 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/9be73868-a1c3-46ec-b22a-7b6cf3d3f29b.jpg', relatedTool: 'remove-background' }, { id: 'ai-image-enhancement-guide', title: 'AI Image Enhancement: Transform Your Photos with AI Technology', excerpt: 'Discover how AI image enhancement can transform your photos. Learn about the technology, benefits, and how to use Modern Photo Tools\' AI Image Upscaler for professional-quality results.', publishDate: '2025-03-14', readTime: '16 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/84aac6bc-2694-4a31-a785-8436eb830c27.jpg', relatedTool: 'ai-image-enhancer' }, { id: 'studio-ghibli-ai-art-guide', title: 'How to Make Studio Ghibli AI Art: Step-by-Step Guide', excerpt: 'Learn how to make Studio Ghibli AI art with our comprehensive guide. Transform your photos into magical Ghibli-style artwork using our free AI Filter tool - no artistic skills required!', publishDate: '2025-04-27', readTime: '8 min read', category: 'general' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/fb439d36-088b-4543-81bb-8d5a44941b85/d65ee843-871b-4f21-ab80-0a71ec0fd36e.jpg', relatedTool: 'ai-filter' }, { id: 'ai-background-generators-2025', title: 'Best AI Background Generators in 2025: Top Tools Compared', excerpt: 'Discover the best AI background generators in 2025 for stunning visuals. Compare features, pricing, and capabilities of top tools to elevate your creative projects instantly.', publishDate: '2025-02-19', readTime: '12 min read', category: 'tools' as const, featuredImage: '\images\tools images\AI Background Generator Tool.jpg', relatedTool: 'ai-background-generator' }, { id: 'easter-card-messages-2025', title: '100+ Easter Card Message Ideas in 2025 | Modern PhotoTools', excerpt: 'Discover 100+ Easter card message ideas for 2025! From religious blessings to funny greetings, find the perfect words to pair with your Easter photos and designs.', publishDate: '2025-05-30', readTime: '18 min read', category: 'general' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0cd66b1e-46e8-4f6e-a6dd-3d571e79013d/43b3a8d0-02da-49a5-91b1-4a27d9f12e48.jpg' }, { id: 'holi-photoshoot-ideas-2025', title: '15 Unique Holi Photoshoot Ideas for Perfect Festive Clicks', excerpt: 'Discover creative Holi photoshoot ideas to capture the festival\'s vibrant spirit! From color powder portraits to action shots, learn how to enhance your festive photos with AI tools.', publishDate: '2025-08-07', readTime: '14 min read', category: 'general' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/fc521256-ebea-4c1d-8deb-13bbc5800a8d.jpg' }, { id: 'master-ai-photo-editing-prompts', title: 'Master AI Photo Editing Prompts: Create Stunning Images', excerpt: 'Learn how to craft perfect AI prompts for photo editing. Discover advanced techniques, tool-specific prompts, and practical examples to transform your images with AI.', publishDate: '2025-10-04', readTime: '15 min read', category: 'general' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/eb9f05ad-ab2d-4927-b3f9-b3bc116a084d.jpg', relatedTool: 'ai-image-generator' }, { id: 'nano-banana-ai-image-generator-with-modern-phototools', title: 'Nano Banana - AI Image Generator with Modern Phototools', excerpt: 'Unleash your creativity with Nano Banana - my AI image generator tool on ModernPhotoTools.com. Easily create stunning visuals with just a few clicks.', publishDate: '2025-10-09', readTime: '8 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/c8ed49ab-fa6e-4f28-9ab8-ea4721bdeeef/0afb09e1-7aeb-4877-8bc0-c9af8da8bfc8.jpg', relatedTool: 'ai-image-generator' }, { id: 'how-to-restore-old-family-photos', title: 'How to Restore Old Family Photos: A Step-by-Step AI Guide', excerpt: 'Learn how to restore old family photos using AI technology. Step-by-step guide to bring damaged photos back to life with Modern Photo Tools.', publishDate: '2025-10-18', readTime: '12 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/0b16f7b9-eb19-45a7-b6af-e1473db97d56/6ff08068-9649-4f10-9595-ddd7a339576e.jpg', relatedTool: 'ai-image-upscaler', keywords: ['AI photo restoration', 'family photos', 'photo repair', 'digital preservation', 'old photos'] } , { id: 'how-to-test-a-new-hairstyle-with-an-ai-hairstyle-generator', title: 'How to Test a New Hairstyle with an AI Hairstyle Generator', excerpt: 'Discover how to visualize your perfect look before committing with our AI Hairstyle Generator. Upload a photo and instantly see yourself with different hairstyles risk-free!', publishDate: 'nov 5, 2025', readTime: '12 min read', category: 'tools' as const, featuredImage: 'https://storage.googleapis.com/48877118-7272-4a4d-b302-0465d8aa4548/6f8e9098-7fc6-4082-b198-c95a4b6ca49a/0f201e61-34a9-42e2-868f-5e1fa65fdac4.webp', relatedTool: 'ai-hairstyle', keywords: ['ai hairstyle generator', 'virtual hairstyle try-on', 'test a new hairstyle', 'try hairstyles online', 'hair color preview'] } ]; // For backward compatibility, export as blogArticles // Content will be loaded dynamically from Markdown files export const blogArticles = blogArticleIndex; // Helper function to get articles by category export const getArticlesByCategory = (category: 'general' | 'tools') => { return blogArticleIndex.filter(article => article.category === category); }; // Helper function to get recent articles export const getRecentArticles = (count: number = 5) => { return blogArticleIndex .sort((a, b) => new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()) .slice(0, count); }; // Helper function to get article by ID export const getArticleById = (id: string) => { return blogArticleIndex.find(article => article.id === id); }; // Helper function to get previous and next articles for navigation export const getAdjacentArticles = (currentId: string) => { // Sort articles by publish date (newest first) const sortedArticles = blogArticleIndex .sort((a, b) => new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()); const currentIndex = sortedArticles.findIndex(article => article.id === currentId); if (currentIndex === -1) { return { previousArticle: null, nextArticle: null }; } const previousArticle = currentIndex > 0 ? sortedArticles[currentIndex - 1] : null; const nextArticle = currentIndex < sortedArticles.length - 1 ? sortedArticles[currentIndex + 1] : null; return { previousArticle: previousArticle ? { id: previousArticle.id, title: previousArticle.title } : null, nextArticle: nextArticle ? { id: nextArticle.id, title: nextArticle.title } : null }; };
๐Ÿ“„ tools.ts
import type { Tool } from '../types'; export const tools: Tool[] = [ { id: 'prompt-generator', name: 'AI Prompt Generator', description: 'Turn a simple idea into a professional AI prompt', icon: 'bot', path: '/tools/prompt-generator', apiEndpoint: '/api/optimize-prompt' }, { id: 'remove-background', name: 'Remove Background', description: 'Remove the background from any image with AI precision', icon: 'scissors', path: '/tools/remove-background', apiEndpoint: '/api/external/api/v2/remove-background' }, { id: 'ai-cleanup', name: 'AI Cleanup', description: 'Clean up imperfections and enhance your photos', icon: 'sparkles', path: '/tools/ai-cleanup', apiEndpoint: '/api/external/api/v2/cleanup-picture' }, { id: 'ai-expand', name: 'AI Expand', description: 'Expand your images beyond their original boundaries', icon: 'maximize', path: '/tools/ai-expand', apiEndpoint: '/api/external/api/v2/ai-expand' }, { id: 'ai-replace', name: 'AI Replace', description: 'Replace objects or areas in your images with AI', icon: 'replace-all', path: '/tools/ai-replace', apiEndpoint: '/api/external/api/v2/ai-replace' }, { id: 'ai-cartoon', name: 'AI Cartoon', description: 'Transform photos into cartoon-style artwork', icon: 'palette', path: '/tools/ai-cartoon', apiEndpoint: '/api/external/api/v2/ai-cartoon-generator' }, { id: 'ai-caricature', name: 'AI Caricature', description: 'Create fun caricatures from portrait photos', icon: 'smile', path: '/tools/ai-caricature', apiEndpoint: '/api/external/api/v2/ai-caricature-generator' }, { id: 'ai-avatar', name: 'AI Avatar', description: 'Generate personalized avatars from your photos', icon: 'user', path: '/tools/ai-avatar', apiEndpoint: '/api/external/api/v2/ai-avatar' }, { id: 'ai-product-photoshoot', name: 'AI Product Photoshoot', description: 'Create professional product photos with AI', icon: 'shopping-bag', path: '/tools/ai-product-photoshoot', apiEndpoint: '/api/external/api/v2/ai-product-photoshoot' }, { id: 'ai-background-generator', name: 'AI Background Generator', description: 'Generate custom backgrounds for your images', icon: 'image', path: '/tools/ai-background-generator', apiEndpoint: '/api/external/api/v2/ai-background-generator' }, { id: 'ai-image-generator', name: 'AI Image Generator', description: 'Generate unique images from text descriptions', icon: 'bot', path: '/tools/ai-image-generator', apiEndpoint: '/api/external/api/v2/ai-image-generator' }, { id: 'ai-portrait', name: 'AI Portrait', description: 'Create professional portrait photos with AI enhancement', icon: 'user-check', path: '/tools/ai-portrait', apiEndpoint: '/api/external/api/v2/ai-portrait' }, { id: 'ai-face-swap', name: 'AI Face Swap', description: 'Swap faces between images with AI precision', icon: 'refresh-cw', path: '/tools/ai-face-swap', apiEndpoint: '/api/external/api/v2/ai-face-swap' }, { id: 'ai-outfit', name: 'AI Outfit', description: 'Change outfits in photos with AI technology', icon: 'shirt', path: '/tools/ai-outfit', apiEndpoint: '/api/external/api/v2/ai-outfit' }, { id: 'ai-image-to-image', name: 'AI Image to Image', description: 'Transform images with AI style transfer', icon: 'image-plus', path: '/tools/ai-image-to-image', apiEndpoint: '/api/external/api/v2/ai-image-to-image' }, { id: 'ai-sketch-to-image', name: 'AI Sketch to Image', description: 'Convert sketches into detailed images', icon: 'pencil', path: '/tools/ai-sketch-to-image', apiEndpoint: '/api/external/api/v2/ai-sketch-to-image' }, { id: 'ai-hairstyle', name: 'AI Hairstyle', description: 'Try different hairstyles with AI visualization', icon: 'scissors', path: '/tools/ai-hairstyle', apiEndpoint: '/api/external/api/v2/ai-hairstyle' }, { id: 'ai-image-upscaler', name: 'AI Image Upscaler', description: 'Enhance image resolution without losing quality', icon: 'zoom-in', path: '/tools/ai-image-upscaler', apiEndpoint: '/api/external/api/v2/ai-image-upscaler' }, { id: 'ai-filter', name: 'AI Filter', description: 'Apply AI-powered filters to enhance your photos', icon: 'sliders', path: '/tools/ai-filter', apiEndpoint: '/api/external/api/v2/ai-filter' }, { id: 'watermark-remover', name: 'Watermark Remover', description: 'Automatically detect and remove watermarks, logos, and text overlays', icon: 'erase', path: '/tools/watermark-remover', apiEndpoint: '/api/external/api/v2/watermark-remover' }, ];
๐Ÿ“„ entry-server.tsx
import ReactDOMServer from 'react-dom/server' import { StaticRouter } from 'react-router-dom/server' import { HelmetProvider } from 'react-helmet-async' import App from './App' export function render(url: string, context?: any) { const helmetContext = {} return ReactDOMServer.renderToString( <HelmetProvider context={helmetContext}> <StaticRouter location={url}> <App /> </StaticRouter> </HelmetProvider> ) }
๐Ÿ“ hooks
๐Ÿ“„ index.css
@tailwind base; @tailwind components; @tailwind utilities; /* Custom styles for article content */ .article-content { max-width: none; } /* Styled container for articles */ .article-content .styled-container { max-width: 1200px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6; color: #333; } .article-content .article-header { text-align: center; margin-bottom: 40px; padding: 40px 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 12px; } .article-content .article-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); } .article-content .article-intro { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; } .article-content .table-of-contents { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin: 30px 0; } .article-content .table-of-contents h2 { color: #495057; font-size: 1.5rem; margin-bottom: 20px; border-bottom: 2px solid #3498db; padding-bottom: 10px; } .article-content .toc-list { list-style: none; padding: 0; margin: 0; } .article-content .toc-list li { margin-bottom: 8px; padding-left: 20px; position: relative; } .article-content .toc-list li:before { content: "โ†’"; position: absolute; left: 0; color: #3498db; font-weight: bold; } .article-content .toc-list a { color: #495057; text-decoration: none; font-weight: 500; transition: color 0.3s ease; } .article-content .toc-list a:hover { color: #3498db; text-decoration: underline; } .article-content .two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px 0; } @media (max-width: 768px) { .article-content .two-columns { grid-template-columns: 1fr; gap: 20px; } } .article-content .custom-list { list-style: none; padding: 0; } .article-content .custom-list li { position: relative; padding-left: 25px; margin-bottom: 10px; } .article-content .custom-list li:before { content: "โœ“"; position: absolute; left: 0; color: #28a745; font-weight: bold; } .article-content .cta-block { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 30px; border-radius: 12px; text-align: center; margin: 40px 0; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); } .article-content .cta-block-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; } .article-content .cta-block-text { font-size: 1.1rem; margin-bottom: 25px; opacity: 0.95; } .article-content .cta-btn { display: inline-block; background: white; color: #28a745; padding: 15px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .article-content .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); color: #1e7e34; } .article-content .table-container { overflow-x: auto; margin: 30px 0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .article-content .responsive-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; } .article-content .responsive-table thead tr { background-color: #3498db; color: #fff; text-align: left; } .article-content .responsive-table th, .article-content .responsive-table td { padding: 12px 15px; border-bottom: 1px solid #dddddd; overflow-wrap: break-word; text-align: left; vertical-align: top; } .article-content .responsive-table tbody tr { border-bottom: 1px solid #dddddd; background-color: #fff; transition: background-color .3s ease; } .article-content .responsive-table tbody tr:nth-of-type(2n) { background-color: #f8f9fa; } .article-content .responsive-table tbody tr:hover { background-color: #e3f2fd; } .article-content .img-container { margin: 30px 0; text-align: center; } .article-content .responsive-image { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } .article-content .rating-container { display: flex; align-items: center; gap: 15px; margin: 20px 0; } .article-content .rating-stars { position: relative; display: inline-block; font-size: 20px; color: #ddd; } .article-content .rating-stars:before { content: "โ˜…โ˜…โ˜…โ˜…โ˜…"; position: absolute; top: 0; left: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: #ffc107; } .article-content .rating-stars:after { content: "โ˜…โ˜…โ˜…โ˜…โ˜…"; } .article-content .rating-text { font-weight: 600; color: #495057; } .article-content .pros-cons h3 { font-size: 1.2rem; margin-bottom: 15px; } .article-content .pros, .article-content .cons { list-style: none; padding: 0; } .article-content .pros li, .article-content .cons li { position: relative; padding-left: 25px; margin-bottom: 8px; line-height: 1.5; } .article-content .pros li:before { content: "โœ“"; position: absolute; left: 0; color: #28a745; font-weight: bold; } .article-content .cons li:before { content: "โœ—"; position: absolute; left: 0; color: #dc3545; font-weight: bold; } .article-content .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 30px 0; } .article-content .feature-card { background: white; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; } .article-content .feature-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); } .article-content .feature-card h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: #495057; } .article-content .pricing-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin: 20px 0; } .article-content .pricing-card h4 { font-size: 1.2rem; font-weight: 600; margin-bottom: 15px; color: #495057; } .article-content .pricing-card ul { list-style: none; padding: 0; margin: 0; } .article-content .pricing-card li { padding: 5px 0; border-bottom: 1px solid #dee2e6; } .article-content .pricing-card li:last-child { border-bottom: none; } .article-content .faq-container { margin: 30px 0; } .article-content .faq-item { background: white; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 15px; overflow: hidden; } .article-content .faq-question { background: #f8f9fa; padding: 20px; margin: 0; font-size: 1.1rem; font-weight: 600; color: #495057; border-bottom: 1px solid #e9ecef; } .article-content .faq-answer { padding: 20px; } .article-content .faq-answer p { margin: 0; line-height: 1.6; color: #6c757d; } /* Section styling */ .article-content section { margin: 40px 0; } .article-content section h2 { font-size: 2rem; font-weight: 700; color: #2c3e50; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 3px solid #3498db; } .article-content section h3 { font-size: 1.5rem; font-weight: 600; color: #34495e; margin: 25px 0 15px 0; } .article-content section p { margin-bottom: 15px; line-height: 1.7; color: #555; } /* Rating stars with data attribute */ .article-content .rating-stars[data-rating="4.9"] { --rating: 4.9; } .article-content .rating-stars[data-rating="4.8"] { --rating: 4.8; } .article-content .rating-stars[data-rating="4.7"] { --rating: 4.7; } .article-content .rating-stars[data-rating="4.6"] { --rating: 4.6; } /* Responsive table mobile styles */ @media (max-width: 768px) { .article-content .responsive-table, .article-content .responsive-table thead, .article-content .responsive-table tbody, .article-content .responsive-table th, .article-content .responsive-table td, .article-content .responsive-table tr { display: block; } .article-content .responsive-table thead tr { position: absolute; top: -9999px; left: -9999px; } .article-content .responsive-table tr { border: 1px solid #ccc; margin-bottom: 10px; padding: 10px; border-radius: 8px; background: white; } .article-content .responsive-table td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50% !important; padding-top: 10px; padding-bottom: 10px; } .article-content .responsive-table td:before { content: attr(data-label) ": "; position: absolute; left: 6px; width: 45%; padding-right: 10px; white-space: nowrap; font-weight: bold; color: #3498db; } } .article-content .rating-stars[data-rating="4.5"] { --rating: 4.5; } /* Ensure table visibility and proper styling */ .article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; } .article-content table th, .article-content table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; } .article-content table th { background-color: #3498db; color: white; font-weight: 600; } .article-content table tbody tr:nth-child(even) { background-color: #f8f9fa; } .article-content table tbody tr:hover { background-color: #e3f2fd; } /* * BREADCRUMBS * Styles the breadcrumbs to match the example */ .yoast-breadcrumb { padding: 10px 0; font-size: 14px; color: #555; width: 100%; max-width: 1200px; padding-left: 2rem; padding-right: 1rem; } p#breadcrumbs { margin: 0; padding: 0; } p#breadcrumbs span { display: inline-block; } p#breadcrumbs a { color: #007bff; /* Or your site's link color */ text-decoration: none; } p#breadcrumbs a:hover { text-decoration: underline; } /* This is the key: style the <b> tag as a separator */ p#breadcrumbs b { margin: 0 8px; color: #777; font-weight: normal; } p#breadcrumbs b::after { content: '>'; /* You can change this to '/' or 'ยป' */ } .breadcrumb_last { color: #333; font-weight: 600; }
๐Ÿ“ lib
๐Ÿ“ prompt-frameworks
๐Ÿ“„ main.tsx
import React from 'react' import ReactDOM from 'react-dom/client' import { BrowserRouter } from 'react-router-dom' import { HelmetProvider } from 'react-helmet-async' import App from './App.tsx' import ScrollToTop from './components/layout/ScrollToTop.tsx' import './index.css' const rootElement = document.getElementById('root')! // Check if the root element has actual SSG content (not just the placeholder comment) const hasSSGContent = rootElement.innerHTML.trim() && !rootElement.innerHTML.includes('<!--app-html-->') && rootElement.innerHTML !== '<!--app-html-->' if (hasSSGContent) { // Hydrate the pre-rendered content ReactDOM.hydrateRoot( rootElement, <React.StrictMode> <HelmetProvider> <BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} > <ScrollToTop /> <App /> </BrowserRouter> </HelmetProvider> </React.StrictMode> ) } else { // Render normally for SPA mode (development or no SSG content) ReactDOM.createRoot(rootElement).render( <React.StrictMode> <HelmetProvider> <BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} > <ScrollToTop /> <App /> </BrowserRouter> </HelmetProvider> </React.StrictMode> ) }
๐Ÿ“ pages
๐Ÿ“„ AboutPage.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import SEO from '../components/ui/SEO'; import Button from '../components/ui/Button'; const AboutPage: React.FC = () => { return ( <> <SEO title="About Us" description="Learn about ModernPhotoTools.com, our mission, and how we're making professional photo editing accessible to everyone with AI-powered tools." /> {/* Hero Section */} <section className="bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> About <span className="text-blue-600">ModernPhotoTools</span> </h1> <p className="text-xl text-gray-700 mb-8"> Making professional photo editing accessible to everyone through the power of AI </p> </div> </div> </section> {/* Main Content */} <section className="py-16 bg-white"> <div className="container mx-auto px-4"> <div className="max-w-4xl mx-auto"> <div className="prose prose-lg max-w-none text-gray-700"> <h2>Our Mission</h2> <p> At ModernPhotoTools.com, we believe that everyone should have access to professional-quality photo editing tools, regardless of their technical skills or budget. Our mission is to democratize photo editing by leveraging the power of artificial intelligence to make complex editing tasks simple and accessible. </p> <h2>What We Offer</h2> <p> We provide a comprehensive suite of AI-powered photo editing tools that can help you transform your images in seconds. From removing backgrounds to generating completely new images with AI, our tools are designed to save you time and effort while delivering professional results. </p> <p> All our tools are: </p> <ul> <li><strong>Free to use</strong> - No hidden fees or subscriptions</li> <li><strong>Easy to use</strong> - No technical skills required</li> <li><strong>Fast</strong> - Get results in seconds</li> <li><strong>High quality</strong> - Professional-grade output</li> <li><strong>Private</strong> - We respect your privacy</li> </ul> <h2>Why Choose ModernPhotoTools</h2> <p> In a world where visual content is increasingly important, having access to powerful editing tools can make a significant difference. Whether you're a professional photographer, a social media manager, a small business owner, or just someone who wants to enhance their personal photos, our tools can help you achieve your goals without the steep learning curve or high cost of traditional photo editing software. </p> <h2>Our Technology</h2> <p> We use cutting-edge AI technology powered to deliver fast and accurate results. Our tools are constantly being improved to ensure that you always have access to the latest advancements in AI-powered photo editing. </p> <h2>Get Started Today</h2> <p> Ready to transform your photos? Explore our tools and see what you can create! </p> </div> </div> </div> </section> {/* CTA Section */} <section className="py-16 bg-blue-600"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h2 className="text-3xl font-bold text-white mb-6"> Ready to Transform Your Photos? </h2> <p className="text-blue-100 mb-8"> Join thousands of users who enhance their photos with our AI-powered tools every day. </p> <Link to="/tools"> <Button size="lg" variant="secondary"> Explore Our Tools </Button> </Link> </div> </div> </section> </> ); }; export default AboutPage;
๐Ÿ“„ BlogArticlePage.tsx
import React, { useState, useEffect } from 'react'; import { useParams, Link, Navigate } from 'react-router-dom'; import SEO from '../components/ui/SEO'; import { getBlogArticleById, BlogArticleWithContent } from '../utils/blogLoader'; import { getAdjacentArticles } from '../data/blogArticles'; import ArticleNavigation from '../components/ArticleNavigation'; const BlogArticlePage: React.FC = () => { const { articleId } = useParams<{ articleId: string }>(); const [article, setArticle] = useState<BlogArticleWithContent | null>(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [redirectTo, setRedirectTo] = useState<string | null>(null); useEffect(() => { const loadArticle = async () => { if (!articleId) { setNotFound(true); setLoading(false); return; } // Handle redirect for removed article if (articleId === 'remove-background-free-guide') { setRedirectTo('/blog/best-photo-background-editors-2025'); return; } try { const loadedArticle = await getBlogArticleById(articleId); if (loadedArticle) { setArticle(loadedArticle); } else { setNotFound(true); } } catch (error) { console.error('Failed to load blog article:', error); setNotFound(true); } finally { setLoading(false); } }; loadArticle(); }, [articleId]); if (redirectTo) { return <Navigate to={redirectTo} replace />; } if (!articleId || notFound) { return <Navigate to="/blog" replace />; } if (loading) { return ( <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex items-center justify-center"> <div className="text-center"> <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p className="text-gray-600">Loading article...</p> </div> </div> ); } if (!article) { return <Navigate to="/blog" replace />; } // Render HTML content with proper styling const renderContent = (content: string) => { // Check if content contains HTML tags const hasHtmlTags = /<[^>]+>/.test(content); if (hasHtmlTags) { // Content contains HTML, render it directly with dangerouslySetInnerHTML // but add custom CSS classes for styling return ( <div className="article-content" dangerouslySetInnerHTML={{ __html: content }} /> ); } // Fallback to markdown-like parsing for plain text content const lines = content.split('\n'); const processedLines = new Set<number>(); return lines.map((line, index) => { if (processedLines.has(index)) return null; const trimmedLine = line.trim(); // Handle headings if (trimmedLine.startsWith('# ')) return <h1 key={index} className="text-3xl md:text-4xl font-bold text-gray-900 mb-6 mt-10">{trimmedLine.substring(2)}</h1>; if (trimmedLine.startsWith('## ')) return <h2 key={index} className="text-2xl font-bold text-gray-900 mb-4 mt-8">{trimmedLine.substring(3)}</h2>; if (trimmedLine.startsWith('### ')) return <h3 key={index} className="text-xl font-semibold text-gray-900 mb-3 mt-6">{trimmedLine.substring(4)}</h3>; // Handle unordered list items if (trimmedLine.startsWith('- ')) { const listItems = []; for (let j = index; j < lines.length && lines[j].trim().startsWith('- '); j++) { listItems.push(<li key={j}>{trimmedLine.substring(2)}</li>); processedLines.add(j); } return <ul key={index} className="list-disc list-inside space-y-2 mb-4 text-gray-700">{listItems}</ul>; } // Handle paragraphs if (trimmedLine.length > 0) { return <p key={index} className="text-gray-700 mb-4 leading-relaxed">{trimmedLine}</p>; } return null; }).filter(Boolean); }; return ( <> <SEO title={article.title} description={article.excerpt} canonicalUrl={`https://modernphototools.com/blog/${articleId}`} ogImage={article.featuredImage} /> <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50"> <div className="container mx-auto px-4 py-12"> {/* Breadcrumb */} <nav className="mb-8" aria-label="Breadcrumb"> <Link to="/blog" className="text-blue-600 hover:text-blue-700 font-medium transition-colors duration-300" aria-label="Go back to blog page" > โ† Back to Blog </Link> </nav> {/* Article Header */} <article className="max-w-4xl mx-auto"> {/* Featured Image */} <div className="h-64 md:h-80 bg-gray-200 rounded-xl mb-8 relative overflow-hidden"> <img src={article.featuredImage} alt={`Featured image for ${article.title}`} className="w-full h-full object-cover" /> <div className="absolute inset-0 bg-black bg-opacity-20"></div> <div className="absolute bottom-6 left-6 right-6"> <span className="inline-block px-4 py-2 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full mb-4"> {article.category === 'general' ? 'General' : 'Tools'} </span> <h1 className="text-2xl md:text-3xl font-bold text-white"> {article.title} </h1> </div> </div> {/* Article Meta */} <div className="bg-white rounded-xl shadow-lg p-8"> <div className="flex items-center justify-between mb-8 pb-6 border-b border-gray-200"> <div className="flex items-center text-sm text-gray-500"> <span>{new Date(article.publishDate).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}</span> <span className="mx-2">โ€ข</span> <span>{article.readTime}</span> </div> <div className="flex items-center space-x-4"> <button className="text-gray-400 hover:text-blue-600 transition-colors duration-300"> <svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> <path d="M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z" /> </svg> </button> </div> </div> {/* Article Content */} <div className="prose prose-lg max-w-none"> {renderContent(article.content)} </div> {/* Call to Action */} <div className="mt-12 pt-8 border-t border-gray-200"> <div className="bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl p-6"> <h3 className="text-xl font-bold text-gray-900 mb-3"> Ready to Try Our AI Tools? </h3> <p className="text-gray-600 mb-4"> Transform your photos with our powerful AI-powered editing tools. </p> <Link to="/tools" className="inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105" > Explore Tools <svg className="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" /> </svg> </Link> </div> </div> {/* Article Navigation */} <ArticleNavigation currentArticleId={articleId!} /> </div> </article> </div> </div> </> ); }; export default BlogArticlePage;
๐Ÿ“„ BlogPage.tsx
import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import SEO from '../components/ui/SEO'; import { loadBlogArticles, BlogArticleWithContent } from '../utils/blogLoader'; const BlogPage: React.FC = () => { const [articles, setArticles] = useState<BlogArticleWithContent[]>([]); const [loading, setLoading] = useState(true); useEffect(() => { const loadArticles = async () => { try { const loadedArticles = await loadBlogArticles(); setArticles(loadedArticles); } catch (error) { console.error('Failed to load blog articles:', error); } finally { setLoading(false); } }; loadArticles(); }, []); if (loading) { return ( <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex items-center justify-center"> <div className="text-center"> <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p className="text-gray-600">Loading articles...</p> </div> </div> ); } return ( <> <SEO title="Blog" description="Stay updated with the latest tips, tutorials, and news about AI photo editing and digital image processing." /> <div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50"> <div className="container mx-auto px-4 py-12"> {/* Hero Section */} <div className="text-center mb-12"> <h1 className="text-4xl md:text-5xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4"> Blog </h1> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> Discover tips, tutorials, and insights about AI photo editing and digital creativity </p> </div> {/* Blog Articles Grid */} <div className="max-w-6xl mx-auto"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> {articles.map((article) => ( <Link to={`/blog/${article.id}`} key={article.id} className="block group" aria-label={`Read article: ${article.title}`} > <article className="bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden h-full"> {/* Featured Image */} <div className="h-48 bg-gray-200 relative overflow-hidden"> <img src={article.featuredImage} alt={`Featured image for ${article.title}`} className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" /> <div className="absolute inset-0 bg-black bg-opacity-20 group-hover:bg-opacity-10 transition-all duration-300"></div> <div className="absolute bottom-4 left-4 right-4"> <span className="inline-block px-3 py-1 bg-white bg-opacity-90 text-blue-600 text-sm font-medium rounded-full"> {article.category === 'general' ? 'General' : 'Tools'} </span> </div> </div> {/* Article Content */} <div className="p-6 flex flex-col"> <div className="flex items-center text-sm text-gray-500 mb-3"> <span>{new Date(article.publishDate).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}</span> <span className="mx-2">โ€ข</span> <span>{article.readTime}</span> </div> <h2 className="text-xl font-bold text-gray-900 mb-3 group-hover:text-blue-600 transition-colors duration-300"> {article.title} </h2> <p className="text-gray-600 mb-4 line-clamp-3"> {article.excerpt} </p> {/* Article Tags */} {article.keywords && article.keywords.length > 0 && ( <div className="mb-4"> <div className="flex flex-wrap gap-2"> {article.keywords.slice(0, 3).map((keyword, index) => ( <span key={index} className="px-2 py-1 bg-blue-50 text-blue-600 text-xs font-medium rounded-md" > {keyword} </span> ))} </div> </div> )} <div className="mt-auto pt-4"> <div className="inline-flex items-center text-blue-600 group-hover:text-blue-700 font-medium transition-colors duration-300"> Read More <svg className="w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true" > <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" /> </svg> </div> </div> </div> </article> </Link> ))} </div> </div> {/* Call to Action */} <div className="text-center mt-16"> <div className="bg-white rounded-2xl shadow-lg p-8 max-w-2xl mx-auto"> <h3 className="text-2xl font-bold text-gray-900 mb-4"> Ready to Transform Your Photos? </h3> <p className="text-gray-600 mb-6"> Explore our powerful AI-powered photo editing tools and bring your creative vision to life. </p> <Link to="/tools" className="inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-300 transform hover:scale-105" > Explore Our Tools <svg className="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" /> </svg> </Link> </div> </div> </div> </div> </> ); }; export default BlogPage;
๐Ÿ“„ ContactPage.tsx
import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { Mail, Send } from 'lucide-react'; import SEO from '../components/ui/SEO'; import Button from '../components/ui/Button'; const ContactPage: React.FC = () => { const [formData, setFormData] = useState({ name: '', email: '', message: '' }); const [formStatus, setFormStatus] = useState<{ success: boolean; message: string; submitted: boolean; }>({ success: false, message: '', submitted: false }); const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Validate form if (!formData.name || !formData.email || !formData.message) { setFormStatus({ success: false, message: 'Please fill out all fields.', submitted: true }); return; } // Email validation const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { setFormStatus({ success: false, message: 'Please enter a valid email address.', submitted: true }); return; } // In a real implementation, you would send the form data to your backend // For now, we'll just simulate a successful submission // Simulate API call setTimeout(() => { setFormStatus({ success: true, message: 'Your message has been sent. We\'ll get back to you soon!', submitted: true }); // Reset form setFormData({ name: '', email: '', message: '' }); }, 1000); }; return ( <> <SEO title="Contact Us" description="Have questions or feedback? Contact the ModernPhotoTools.com team. We're here to help with any inquiries about our AI photo editing tools." /> <div className="container mx-auto px-4 py-12"> <div className="max-w-3xl mx-auto"> <div className="text-center mb-12"> <h1 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4"> Contact Us </h1> <p className="text-xl text-gray-600"> Have questions or feedback? We'd love to hear from you. </p> </div> <div className="grid grid-cols-1 md:grid-cols-2 gap-12"> <div> <h2 className="text-2xl font-semibold text-gray-900 mb-4">Get in Touch</h2> <p className="text-gray-700 mb-6"> We're here to help with any questions or feedback you might have about our tools or services. </p> <div className="bg-blue-50 rounded-lg p-6"> <div className="flex items-start mb-4"> <Mail className="w-5 h-5 text-blue-600 mr-3 mt-1" /> <div> <h3 className="text-lg font-medium text-gray-900">Email Us</h3> <p className="text-gray-700"> support@modernphototools.com </p> </div> </div> <p className="text-sm text-gray-600"> We typically respond within 24-48 hours during business days. </p> </div> </div> <div> <h2 className="text-2xl font-semibold text-gray-900 mb-4">Send a Message</h2> {formStatus.submitted && ( <div className={`mb-6 p-4 rounded-lg ${formStatus.success ? 'bg-green-50 text-green-800' : 'bg-red-50 text-red-800'}`}> {formStatus.message} </div> )} <form onSubmit={handleSubmit}> <div className="mb-4"> <label htmlFor="name" className="block text-gray-700 font-medium mb-1"> Your Name </label> <input type="text" id="name" name="name" value={formData.name} onChange={handleChange} className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="John Doe" /> </div> <div className="mb-4"> <label htmlFor="email" className="block text-gray-700 font-medium mb-1"> Your Email </label> <input type="email" id="email" name="email" value={formData.email} onChange={handleChange} className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="john.doe@example.com" /> </div> <div className="mb-6"> <label htmlFor="message" className="block text-gray-700 font-medium mb-1"> Your Message </label> <textarea id="message" name="message" value={formData.message} onChange={handleChange} rows={5} className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="How can we help you?" /> </div> <Button type="submit" fullWidth leftIcon={<Send size={18} />} > Send Message </Button> </form> </div> </div> <div className="mt-12 p-6 bg-gray-50 rounded-lg"> <h2 className="text-xl font-semibold text-gray-900 mb-4">Privacy Notice</h2> <p className="text-gray-700 text-sm"> By submitting this form, you agree to our <Link to="/privacy-policy" className="text-blue-600 hover:underline">Privacy Policy</Link>. We collect and process your personal data only for the purpose of responding to your inquiry. Your information will not be shared with third parties without your consent. </p> </div> </div> </div> </> ); }; export default ContactPage;
๐Ÿ“„ CookiesPolicyPage.tsx
import React from 'react'; import SEO from '../components/ui/SEO'; const CookiesPolicyPage: React.FC = () => { return ( <> <SEO title="Cookies Policy" description="Learn about how ModernPhotoTools.com uses cookies to enhance your browsing experience and improve our services." /> <section className="bg-white text-gray-800 py-16 px-4 md:px-6 lg:px-8"> <div className="max-w-4xl mx-auto"> <h1 className="text-3xl md:text-4xl font-extrabold text-gray-900 mb-8"> Cookies Policy </h1> <div className="prose prose-lg prose-gray max-w-none"> <p> This Cookies Policy explains how ModernPhotoTools.com ("we", "us", or "our") uses cookies and similar technologies when you visit our website. It explains what these technologies are and why we use them, as well as your rights to control our use of them. </p> <hr className="my-10 border-gray-200" /> <h2>What Are Cookies?</h2> <p> Cookies are small data files that are placed on your computer or mobile device when you visit a website. Cookies are widely used by website owners to make their websites work, or to work more efficiently, as well as to provide reporting information. </p> <h2>Why Do We Use Cookies?</h2> <p> We use cookies for several reasons. Some cookies are required for technical reasons in order for our website to operate, and we refer to these as "essential" or "strictly necessary" cookies. Other cookies enable us to track and target the interests of our users to enhance the experience on our website. </p> <h2>Types of Cookies We Use</h2> <h3>Essential Cookies</h3> <p> These cookies are strictly necessary to provide you with services available through our website and to use some of its features, such as access to secure areas. Because these cookies are strictly necessary to deliver the website, you cannot refuse them without impacting how our site functions. </p> <h3>Performance and Analytics Cookies</h3> <p> These cookies collect information about how visitors use our website, for instance which pages visitors go to most often, and if they get error messages from web pages. These cookies don't collect information that identifies a visitor. All information these cookies collect is aggregated and therefore anonymous. </p> <h3>Functionality Cookies</h3> <p> These cookies allow our website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features. These cookies can also be used to remember changes you have made to text size, fonts, and other parts of web pages that you can customize. </p> <h3>Targeting and Advertising Cookies</h3> <p> These cookies are used to deliver adverts more relevant to you and your interests. They are also used to limit the number of times you see an advertisement as well as help measure the effectiveness of the advertising campaign. </p> <h2>Third-Party Cookies</h2> <p> In addition to our own cookies, we may also use various third-party cookies to report usage statistics of the service, deliver advertisements on and through the service, and so on. These third-party cookies are governed by the respective privacy policies of the third parties providing them. </p> <h2>How Can You Control Cookies?</h2> <p> You have the right to decide whether to accept or reject cookies. You can exercise your cookie preferences by clicking on the appropriate opt-out links provided in the cookie banner when you first visit our website. </p> <p> You can also set or amend your web browser controls to accept or refuse cookies. If you choose to reject cookies, you may still use our website though your access to some functionality and areas of our website may be restricted. </p> <h3>Browser Controls</h3> <p> Most web browsers allow you to control cookies through their settings preferences. However, if you limit the ability of websites to set cookies, you may worsen your overall user experience, since it will no longer be personalized to you. </p> <h2>Cookie Retention</h2> <p>Cookies set by us will be retained for different periods depending on their purpose:</p> <ul> <li><strong>Session cookies:</strong> Temporary and deleted when you close your browser.</li> <li><strong>Persistent cookies:</strong> Remain on your device for a set period or until you delete them.</li> </ul> <h2>Updates to This Policy</h2> <p> We may update this Cookies Policy from time to time in order to reflect changes to the cookies we use or for other operational, legal, or regulatory reasons. Please revisit this policy regularly to stay informed about our use of cookies. </p> <h2>Contact Us</h2> <p> If you have any questions about our use of cookies or other technologies, please contact us through our <a href="/contact">contact page</a>. </p> <p className="text-sm text-gray-500 mt-10"> <strong>Last updated:</strong> {new Date().toLocaleDateString()} </p> </div> </div> </section> </> ); }; export default CookiesPolicyPage;
๐Ÿ“„ DMCAPage.tsx
import React from 'react'; import SEO from '../components/ui/SEO'; const DMCAPage: React.FC = () => { return ( <> <SEO title="DMCA Notice" description="Digital Millennium Copyright Act (DMCA) notice and takedown policy for ModernPhotoTools.com." /> {/* Hero Section */} <section className="bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> <span className="text-blue-600">DMCA</span> Notice </h1> <p className="text-xl text-gray-700 mb-8"> Our copyright policy and takedown procedures in accordance with the Digital Millennium Copyright Act (DMCA). </p> </div> </div> </section> {/* Main Content */} <section className="py-16 bg-white"> <div className="container mx-auto px-4"> <div className="max-w-4xl mx-auto"> <div className="prose prose-lg max-w-none text-gray-700"> <h2>DMCA Policy Overview</h2> <p> At <strong>ModernPhotoTools.com</strong>, we respect the intellectual property rights of others and expect our users to do the same. This DMCA Policy outlines how we respond to copyright infringement notifications in compliance with the <em>Digital Millennium Copyright Act</em> (DMCA). </p> <h2>Submitting a DMCA Takedown Notice</h2> <p> If you believe that material on our website infringes your copyright, please submit a written notification including: </p> <ol> <li><strong>Identification</strong> of the copyrighted work.</li> <li><strong>Identification</strong> of the allegedly infringing material with enough detail for us to locate it.</li> <li><strong>Your contact information</strong>: name, address, phone number, and email.</li> <li><strong>Statement</strong> that you have a good faith belief the use is unauthorized.</li> <li><strong>Statement</strong> that the notice is accurate and you are authorized to act on behalf of the copyright owner.</li> <li><strong>Your physical or electronic signature</strong> (typing your full name suffices).</li> </ol> <p> Send your takedown notice via our <a href="/contact" className="text-blue-600 underline">Contact Page</a> and include "DMCA Takedown Notice" in the subject line. </p> <h2>Submitting a Counter-Notification</h2> <p> If you believe your content was removed by mistake or misidentification, you may submit a counter-notice containing: </p> <ol> <li>Your physical or electronic signature.</li> <li>Identification of the removed material and its location prior to removal.</li> <li>A good faith statement under penalty of perjury that the removal was in error.</li> <li>Your name, address, phone number, and consent to the jurisdiction of the relevant U.S. Federal District Court.</li> </ol> <p> Counter-notices should also be submitted via our <a href="/contact" className="text-blue-600 underline">Contact Page</a> with "DMCA Counter Notice" in the subject. </p> <h2>Repeat Infringers</h2> <p> We may terminate accounts or restrict access for users who repeatedly violate copyright policies. </p> <h2>False Claims Warning</h2> <p> Under Section 512(f) of the DMCA, anyone who knowingly submits false claims may be liable for damages, including costs and attorneyโ€™s fees. </p> <h2>No Legal Advice</h2> <p> This DMCA page is provided for informational purposes only and does not constitute legal advice. Please consult a qualified attorney for legal guidance. </p> <h2>Contact Information</h2> <p> For DMCA-related issues, please reach out via our <a href="/contact" className="text-blue-600 underline">Contact Page</a> with "DMCA" in the subject line. </p> </div> </div> </div> </section> </> ); }; export default DMCAPage;
๐Ÿ“„ HomePage.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { ArrowRight, Edit3, Brain, ClipboardCopy } from 'lucide-react'; import Button from '../components/ui/Button'; import VideoToolCard from '../components/ui/VideoToolCard'; import SEO from '../components/ui/SEO'; import PromptsGuide from '../components/ui/PromptsGuide'; import { tools } from '../data/tools'; import { getVideoUrl } from '../utils/videoMapping'; import '../styles/video-tool-card.css'; const HomePage: React.FC = () => { // Define the 6 specific popular tools as requested const popularToolNames = [ 'Remove Background', 'AI Cleanup', 'Watermark Remover', 'AI Replace', 'AI Portrait', 'AI Image Upscaler' ]; // Filter tools to get only the specified popular tools const featuredTools = tools.filter(tool => popularToolNames.includes(tool.name) ).slice(0, 6); return ( <> <SEO /> {/* Hero Section */} <section className="bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> Professional Photo Editing Tools, <span className="text-blue-600">Powered by AI</span> </h1> <p className="text-xl text-gray-700 mb-8"> Transform your photos with our free, powerful AI-powered editing tools. No design skills required. </p> <div className="flex flex-col sm:flex-row justify-center gap-4"> <Link to="/tools"> <Button size="lg" rightIcon={<ArrowRight size={20} />}> Explore All Tools </Button> </Link> <Link to="/tools/ai-image-generator"> <Button size="lg" variant="outline"> AI Image Generator </Button> </Link> </div> </div> </div> </section> {/* Featured Tools Section */} <section className="py-16 bg-white px-[10%]"> <div className="w-full mx-auto"> <div className="max-w-3xl mx-auto text-center mb-12"> <h2 className="text-3xl font-bold text-gray-900 mb-4"> Our Popular Photo Editing Tools </h2> <p className="text-gray-600"> Discover our most popular AI-powered tools to enhance your photos in seconds. </p> </div> <div className="row row-cols-1 row-cols-sm-2 row-cols-md-3"> {featuredTools.map((tool) => ( <div key={tool.id} className="col mt-10 px-3 apiSectionBox"> <VideoToolCard tool={tool} videoUrl={getVideoUrl(tool.name)} /> </div> ))} </div> <div className="text-center mt-12"> <Link to="/tools"> <Button variant="outline" rightIcon={<ArrowRight size={18} />}> View All Tools </Button> </Link> </div> </div> </section> {/* How It Works Section */} <section className="py-16 bg-gray-50"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center mb-12"> <h2 className="text-3xl font-bold text-gray-900 mb-4"> How It Works </h2> <p className="text-gray-600"> Edit your photos in three simple steps </p> </div> <div className="grid grid-cols-1 md:grid-cols-3 gap-8"> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">1</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Upload Your Image</h3> <p className="text-gray-600"> Select or drag and drop the image you want to edit. We support JPEG, PNG, and WebP formats. </p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">2</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Apply AI Magic</h3> <p className="text-gray-600"> Our AI automatically processes your image with the selected tool. No manual editing required. </p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <span className="text-blue-600 font-bold">3</span> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Download Result</h3> <p className="text-gray-600"> Download your professionally edited image and use it anywhere you want. </p> </div> </div> </div> </section> {/* Prompts Guide Section */} <PromptsGuide /> {/* Create Perfect AI Prompts Section */} <section className="py-16 bg-white"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center mb-12"> <h2 className="text-3xl font-bold text-gray-900 mb-4">Create Perfect AI Prompts in Seconds</h2> <p className="text-gray-600">Follow these simple steps to create optimized Prompts for AI models in seconds.</p> </div> <div className="grid grid-cols-1 md:grid-cols-3 gap-8"> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> <Edit3 className="w-6 h-6 text-blue-600" /> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Enter Your Idea</h3> <p className="text-gray-600">Simply input your task, goal, or a simple prompt. Our tool works with any type of input to create custom AI instructions.</p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4"> <Brain className="w-6 h-6 text-purple-600" /> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">AI-Powered Enhancements</h3> <p className="text-gray-600">Our AI analyzes your input and generates a comprehensive, optimized prompt tailored for various AI models.</p> </div> <div className="bg-white p-6 rounded-lg shadow-md text-center"> <div className="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4"> <ClipboardCopy className="w-6 h-6 text-green-600" /> </div> <h3 className="text-xl font-semibold text-gray-900 mb-2">Usage and Refinement</h3> <p className="text-gray-600">You can instantly view the generated prompt. Copy and paste it directly into ChatGPT, Claude, Gemini, or any other AI model.</p> </div> </div> <div className="text-center mt-12"> <Link to="/tools/prompt-generator"> <Button size="lg" rightIcon={<ArrowRight size={18} />}>Try Prompt Generator</Button> </Link> </div> </div> </section> {/* CTA Section */} <section className="py-16 bg-blue-600"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h2 className="text-3xl font-bold text-white mb-6"> Start Editing Your Photos Today </h2> <p className="text-blue-100 mb-8"> Join thousands of users who transform their photos with our AI-powered tools every day. </p> <Link to="/tools"> <Button size="lg" variant="secondary"> Get Started Now </Button> </Link> </div> </div> </section> </> ); }; export default HomePage;
๐Ÿ“„ NotFoundPage.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { Home, Search } from 'lucide-react'; import SEO from '../components/ui/SEO'; import Button from '../components/ui/Button'; const NotFoundPage: React.FC = () => { return ( <> <SEO title="Page Not Found" description="Sorry, the page you are looking for could not be found." /> <div className="min-h-[60vh] flex items-center"> <div className="container mx-auto px-4 py-12 text-center"> <h1 className="text-6xl font-bold text-gray-900 mb-4">404</h1> <h2 className="text-2xl font-semibold text-gray-800 mb-6">Page Not Found</h2> <p className="text-gray-600 max-w-md mx-auto mb-8"> Sorry, the page you are looking for doesn't exist or has been moved. </p> <div className="flex flex-col sm:flex-row justify-center gap-4"> <Link to="/"> <Button leftIcon={<Home size={18} />}> Back to Home </Button> </Link> <Link to="/tools"> <Button variant="outline" leftIcon={<Search size={18} />}> Explore Tools </Button> </Link> </div> </div> </div> </> ); }; export default NotFoundPage;
๐Ÿ“„ PrivacyPolicyPage.tsx
import React from 'react'; import SEO from '../components/ui/SEO'; const PrivacyPolicyPage: React.FC = () => { return ( <> <SEO title="Privacy Policy" description="Learn how ModernPhotoTools.com protects your privacy and handles your data when you use our AI photo editing tools." /> {/* Hero Section */} <section className="bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> Privacy <span className="text-blue-600">Policy</span> </h1> <p className="text-xl text-gray-700 mb-8"> Learn how we protect your privacy and handle your data when you use our AI photo editing tools </p> </div> </div> </section> {/* Main Content */} <section className="py-16 bg-white"> <div className="container mx-auto px-4"> <div className="max-w-4xl mx-auto"> <div className="prose prose-lg max-w-none text-gray-700"> <p className="text-sm text-gray-500 mb-8"> Last updated: {new Date().toLocaleDateString()} </p> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Introduction</h2> <p> At <strong>ModernPhotoTools.com</strong>, your privacy is important to us. This Privacy Policy outlines how we collect, use, and protect your information when using our website and AI-powered photo editing tools. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Information We Collect</h2> <h3 className="text-xl font-medium mt-4 mb-1">๐Ÿ“ท Images & Files</h3> <p> When you use our tools (e.g., background remover, blurring, resizing), your uploaded images are processed securely on our servers. We do <strong>not store</strong> your images permanently โ€” they are <strong>deleted automatically</strong> after processing. </p> <h3 className="text-xl font-medium mt-4 mb-1">๐Ÿ“Š Usage Data</h3> <p>We may collect anonymous usage data such as:</p> <ul className="list-disc list-inside ml-4"> <li>Pages visited and time spent</li> <li>Tools used and frequency</li> <li>Browser type and device details</li> <li>IP address and general location</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">How We Use Your Information</h2> <p>The data we collect helps us to:</p> <ul className="list-disc list-inside ml-4"> <li>Deliver fast and accurate photo editing via AI</li> <li>Improve tool performance and user experience</li> <li>Analyze anonymous usage patterns</li> <li>Maintain website security and stability</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">๐Ÿ” Data Security</h2> <p>We prioritize the safety of your data through:</p> <ul className="list-disc list-inside ml-4"> <li>Encrypted connections (SSL/TLS)</li> <li>Immediate deletion of uploaded images</li> <li>No permanent image storage</li> <li>Restricted, monitored server access</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">๐Ÿช Cookies</h2> <p> We may use cookies to enhance your browsing experience. You can manage your cookie preferences in your browser settings. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">๐Ÿ›ก๏ธ Your Rights</h2> <p>You have the right to:</p> <ul className="list-disc list-inside ml-4"> <li>Know what data we collect</li> <li>Request deletion of your data</li> <li>Opt-out of certain data collection</li> <li>Contact us regarding privacy concerns</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">๐Ÿ“ฌ Contact Us</h2> <p> For any privacy-related inquiries, please reach out to us through the <a href="/contact" className="text-blue-600 hover:underline">contact page</a>. </p> </section> <section> <h2 className="text-2xl font-semibold mb-2">๐Ÿ”„ Updates to This Policy</h2> <p> This policy may be updated occasionally. Changes will be reflected on this page along with the latest revision date. </p> </section> </div> </div> </div> </section> </> ); }; export default PrivacyPolicyPage;
๐Ÿ“„ PromptGeneratorPage.tsx
import React, { useMemo, useState, useEffect } from 'react'; import { Helmet } from 'react-helmet-async'; import { HelpCircle, ClipboardCopy } from 'lucide-react'; import Button from '../components/ui/Button'; import { FRAMEWORKS, analyzePromptIntent } from '../utils/promptAnalysis'; import { fetchOptimizedPrompt } from '../utils/api'; import blogRaw from '../../blog.txt?raw'; import PromptGuideSection from '../components/PromptGuideSection'; import ToolFeatureImage from '../components/ui/ToolFeatureImage'; import { findToolImage, generateAltText } from '../utils/imageMapper'; import SEO from '../components/ui/SEO'; import { generateCanonicalUrl, generateOgImageUrl } from '../utils/siteConfig'; function getDefinition(field: string): string { const pattern = new RegExp(`${field}\\s*:\\s*([^\\n]+)`, 'i'); const match = blogRaw.match(pattern); if (match && match[1]) return match[1].trim(); const fallback: Record<string, string> = { Instruction: 'The specific task to perform.', Context: 'Background, purpose, or audience.', Data: 'Information or inputs to use.', Format: 'Desired structure of the output.', Role: 'Assigned job or expert persona.', Request: 'The exact task to complete.', Examples: 'Samples that illustrate quality.', Output: 'Final deliverable shape.', Constraints: 'Rules and limits to follow.', Message: 'Core takeaway or thesis.', Intention: 'Goal such as inform or persuade.', Rhythm: 'Tone and style.', Offer: 'Promotion or product being presented.', Target: 'Intended audience.', Action: 'What the reader should do.', Result: 'Business objective.' }; return fallback[field] || ''; } export default function PromptGeneratorPage() { const [input, setInput] = useState(''); const [isLoading, setIsLoading] = useState(false); const [framework, setFramework] = useState<string>('MICRO'); const [fields, setFields] = useState<string[]>(FRAMEWORKS.MICRO.fields); const [suggestions, setSuggestions] = useState<Record<string, string>>({}); const [formValues, setFormValues] = useState<Record<string, string>>({}); const [copied, setCopied] = useState(false); const finalOutput = useMemo(() => { return fields.map((f) => `${f}: ${formValues[f] || suggestions[f] || ''}`.trim()).join('\n'); }, [fields, formValues, suggestions]); const handleGenerate = async () => { if (!input.trim()) return; setIsLoading(true); const detected = analyzePromptIntent(input); setFramework(detected); const res = await fetchOptimizedPrompt(input, detected); const data = res && res.data ? res.data : {}; const keys = Object.keys(data); const frameworkObj = FRAMEWORKS[detected as keyof typeof FRAMEWORKS]; const ordered = frameworkObj ? frameworkObj.fields : keys; setFields(ordered); setSuggestions(data as Record<string, string>); setFormValues(Object.fromEntries(ordered.map((k) => [k, (data as Record<string, string>)[k] || '']))); setIsLoading(false); }; const handleChange = (key: string, value: string) => { setFormValues((prev) => ({ ...prev, [key]: value })); }; const handleCopy = async () => { await navigator.clipboard.writeText(finalOutput); setCopied(true); setTimeout(() => setCopied(false), 1200); }; const webAppSchema = { "@context": "https://schema.org", "@type": "WebApplication", name: "AI Prompt Generator", url: "https://modernphototools.com/tools/prompt-generator", description: "Most Advanced Free AI Prompt Generator tool | Best Free ChatGPT Prompts Generator | Ultimate Free Prompt Engineering Tool. A professional AI Prompt Generator tool that helps you write perfect prompts using frameworks like COSTAR, MICRO, and ICDF.", applicationCategory: "UtilitiesApplication", operatingSystem: "Web", offers: { "@type": "Offer", price: "0", priceCurrency: "USD", }, featureList: [ "AI-powered prompt optimization", "Support for COSTAR and MICRO frameworks", "Instant prompt generation", "Completely free", "No registration required", ], } as const; const faqSchema = { "@context": "https://schema.org", "@type": "FAQPage", mainEntity: [ { "@type": "Question", name: "What is the AI Prompt Generator?", acceptedAnswer: { "@type": "Answer", text: "A free web tool that turns a simple idea into a professional prompt using frameworks like COSTAR, MICRO, ICDF, and RCREOC. It analyzes intent, suggests structured fields, and assembles a polished prompt ready for ChatGPT, Claude, or Gemini.", }, }, { "@type": "Question", name: "How does the AI Prompt Generator work?", acceptedAnswer: { "@type": "Answer", text: "You enter a short idea; the analyzer detects the best framework; the backend uses Bytez with GPT-4o to generate structured suggestions; the UI lets you refine each field and outputs a final prompt you can copy.", }, }, { "@type": "Question", name: "Can I use the tool for free?", acceptedAnswer: { "@type": "Answer", text: "Yes. It is completely free and requires no registration.", }, }, { "@type": "Question", name: "What use cases does the tool support?", acceptedAnswer: { "@type": "Answer", text: "Marketing emails and ads (COSTAR), content scripts and posts (MICRO), data analysis and reporting (ICDF), expert reviews and critiques (RCREOC), plus general prompt polishing for chat models.", }, }, { "@type": "Question", name: "How can I ensure high-quality Prompts?", acceptedAnswer: { "@type": "Answer", text: "Provide clear context and goals, include relevant data or constraints, select the right framework, and refine the suggested fields for accuracy before copying the final prompt.", }, }, { "@type": "Question", name: "Do the generated Prompts support all AI models?", acceptedAnswer: { "@type": "Answer", text: "The tool supports popular AI models like ChatGPT, Claude, and Gemini, and is adaptable to most other models. You may need slight adjustments to fit specific model requirements.", }, }, ], } as const; const [featureImagePath, setFeatureImagePath] = useState<string | null>(null); const [featureAltText, setFeatureAltText] = useState<string>(''); useEffect(() => { let mounted = true; (async () => { const filename = await findToolImage('prompt-generator', 'AI Prompt Generator'); const resolvedPath = filename ? `/images/tools images/${filename}` : null; if (mounted) { setFeatureImagePath(resolvedPath); setFeatureAltText(generateAltText('AI Prompt Generator')); } })(); return () => { mounted = false; }; }, []); return ( <div className="container mx-auto px-4 py-12"> <SEO title={'AI Prompt Generator'} description={'Turn a simple idea into a professional AI prompt'} ogImage={featureImagePath ? generateOgImageUrl(featureImagePath) : undefined} canonicalUrl={generateCanonicalUrl('/tools/prompt-generator')} /> <Helmet> <script type="application/ld+json">{JSON.stringify(webAppSchema)}</script> <script type="application/ld+json">{JSON.stringify(faqSchema)}</script> </Helmet> <div className="max-w-3xl mx-auto"> <h1 className="text-3xl md:text-4xl font-bold text-gray-900 mb-6 text-center">AI Prompt Generator</h1> <ToolFeatureImage toolId={'prompt-generator'} toolName={'AI Prompt Generator'} imagePath={featureImagePath ?? ''} altText={featureAltText} /> <div className="bg-white rounded-lg shadow p-6 mb-8"> <label className="block text-sm font-medium text-gray-700 mb-2">Your idea</label> <textarea value={input} onChange={(e) => setInput(e.target.value)} className="w-full border border-gray-300 rounded-md p-3 h-32 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Write a LinkedIn post about AI" /> <div className="mt-4 flex items-center gap-3"> <Button size="lg" onClick={handleGenerate} isLoading={isLoading}>Generate</Button> <span className="text-sm text-gray-600">Framework: {framework}</span> </div> </div> {fields.length > 0 && suggestions && Object.keys(suggestions).length > 0 && ( <div className="bg-white rounded-lg shadow p-6 mb-8"> <h2 className="text-2xl font-semibold text-gray-900 mb-4">Edit Fields</h2> <div className="grid grid-cols-1 gap-6"> {fields.map((key) => ( <div key={key} className="relative"> <div className="flex items-center gap-2 mb-2"> <span className="text-sm font-medium text-gray-700">{key}</span> <div className="group relative inline-block align-middle"> <HelpCircle className="w-4 h-4 text-gray-500" /> <div className="absolute left-6 top-0 z-10 hidden group-hover:block bg-gray-900 text-white text-xs rounded px-2 py-1 max-w-xs"> {getDefinition(key)} </div> </div> </div> <textarea value={formValues[key] || ''} onChange={(e) => handleChange(key, e.target.value)} className="w-full border border-gray-300 rounded-md p-3 h-24 focus:outline-none focus:ring-2 focus:ring-blue-500" /> </div> ))} </div> </div> )} {fields.length > 0 && ( <div className="bg-white rounded-lg shadow p-6"> <h2 className="text-2xl font-semibold text-gray-900 mb-4">Final Output</h2> <pre className="bg-gray-50 border border-gray-200 rounded-md p-4 overflow-auto text-sm whitespace-pre-wrap">{finalOutput}</pre> <div className="mt-4"> <Button variant="secondary" onClick={handleCopy} leftIcon={<ClipboardCopy className="w-4 h-4" />}>{copied ? 'Copied' : 'Copy to Clipboard'}</Button> </div> </div> )} </div> <PromptGuideSection /> </div> ); }
๐Ÿ“„ TermsOfUsePage.tsx
import React from 'react'; import SEO from '../components/ui/SEO'; const TermsOfUsePage: React.FC = () => { return ( <> <SEO title="Terms of Use" description="Read the terms and conditions for using ModernPhotoTools.com and our AI-powered photo editing services." /> {/* Hero Section */} <section className="bg-gradient-to-r from-blue-50 to-indigo-50 py-16 md:py-24"> <div className="container mx-auto px-4"> <div className="max-w-3xl mx-auto text-center"> <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> Terms of <span className="text-blue-600">Use</span> </h1> <p className="text-xl text-gray-700 mb-8"> Read the terms and conditions for using our AI-powered photo editing services. </p> </div> </div> </section> {/* Main Content */} <section className="py-16 bg-white"> <div className="container mx-auto px-4"> <div className="max-w-4xl mx-auto"> <div className="prose prose-lg max-w-none text-gray-700"> <p className="text-sm text-gray-500 mb-8"> Last updated: {new Date().toLocaleDateString()} </p> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Acceptance of Terms</h2> <p> By accessing and using <strong>ModernPhotoTools.com</strong>, you accept and agree to be bound by the terms and conditions outlined below. If you do not agree, please do not use our services. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Use License</h2> <p> You are granted a temporary, non-exclusive license to use ModernPhotoTools.com for personal, non-commercial purposes only. Under this license, you may not: </p> <ul className="list-disc list-inside ml-4"> <li>Modify or copy the materials</li> <li>Use the materials for commercial purposes or public display</li> <li>Attempt to reverse-engineer any software on the site</li> <li>Remove copyright or proprietary notations</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Acceptable Use</h2> <p>You agree to use our platform lawfully. You must not:</p> <ul className="list-disc list-inside ml-4"> <li>Upload copyrighted or infringing materials</li> <li>Submit offensive, illegal, or harmful content</li> <li>Use services for deepfakes or deceptive media</li> <li>Disrupt our servers or services</li> <li>Use bots or automation without permission</li> </ul> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Content Ownership</h2> <p> You retain full ownership of any images you upload. We do not claim rights over your content. By using our tools, you grant us a temporary license to process your content securely and privately. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Service Availability</h2> <p> While we aim for high availability, we do not guarantee uninterrupted access. Downtime may occur due to maintenance or unforeseen technical issues. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Disclaimer</h2> <p> All materials and tools are provided "as is". We disclaim all warrantiesโ€”express or impliedโ€”including but not limited to merchantability, fitness for a particular purpose, or non-infringement. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Limitations</h2> <p> In no event shall ModernPhotoTools.com or its affiliates be liable for any indirect or consequential damages, including data loss or business interruption, even if notified of such possibility. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Privacy Policy</h2> <p> Your use of our services is also governed by our <a href="/privacy-policy" className="text-blue-600 hover:underline">Privacy Policy</a>. Please review it to understand how we handle your data. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Modifications</h2> <p> We may update these Terms of Use at any time without notice. Continued use of our website indicates your acceptance of the most recent version. </p> </section> <section className="mb-8"> <h2 className="text-2xl font-semibold mb-2">Governing Law</h2> <p> These terms shall be governed by and interpreted in accordance with the laws applicable in your jurisdiction. Any legal disputes shall be resolved under these laws. </p> </section> <section> <h2 className="text-2xl font-semibold mb-2">๐Ÿ“ฌ Contact Us</h2> <p> If you have any questions about these Terms of Use, please <a href="/contact" className="text-blue-600 hover:underline">contact us</a>. </p> </section> </div> </div> </div> </section> </> ); }; export default TermsOfUsePage;
๐Ÿ“„ ToolPage.tsx
import React, { useState, useEffect, useRef } from 'react'; import { useParams, Navigate } from 'react-router-dom'; import { Download, Loader, Brush, XCircle, HelpCircle, X } from 'lucide-react'; import SEO from '../components/ui/SEO'; import { Helmet } from 'react-helmet-async'; import Button from '../components/ui/Button'; import ImageDropzone from '../components/ui/ImageDropzone'; import PromptsGuide from '../components/ui/PromptsGuide'; import ToolRecommendations from '../components/ui/ToolRecommendations'; import ToolFeatureImage from '../components/ui/ToolFeatureImage'; import { tools } from '../data/tools'; import { findToolImage, generateAltText } from '../utils/imageMapper'; import { processImage, uploadImageAndGetUrl, startCleanupJob, startWatermarkRemoverJob, startExpandJob, startReplaceJob, startCartoonJob, startCaricatureJob, startAvatarJob, startProductPhotoshootJob, startBackgroundGeneratorJob, startImageGeneratorJob, startPortraitJob, startFaceSwapJob, startOutfitJob, startImageToImageJob, startSketchToImageJob, startHairstyleJob, startUpscaleJob, startAIFilterJob, checkOrderStatus, convertUrlToBlob, pollJobUntilComplete, pollWatermarkJobUntilComplete, pollV1JobUntilComplete } from '../utils/api'; import type { ImageFile, ProcessedImage, Tool, FaceSwapStyle } from '../types'; import { maleCartoonStyles, femaleCartoonStyles } from '../constants/cartoonStyles'; import { caricatureStyles, Style } from '../constants/caricatureStyles'; import { avatarStyles, AvatarStyle } from '../constants/avatarStyles'; import { productStyles, suggestedPrompts, type ProductStyle } from '../constants/productStyles'; import { imageResolutions, suggestedPrompts as imageGeneratorPrompts, type ImageResolution } from '../constants/imageGeneratorOptions'; import { portraitStyles, suggestedPortraitPrompts, type PortraitStyle } from '../constants/portraitStyles'; import { faceSwapStyles } from '../constants/faceSwapStyles'; import { presetOutfitStyles, suggestedOutfitPrompts, type OutfitStyle } from '../constants/outfitStyles'; import { hairstylePresets } from '../constants/hairstylePrompts'; import { aiFilterStyles, filterCategories, type AIFilterStyle } from '../constants/filterStyles'; import { generateCanonicalUrl, generateOgImageUrl } from '../utils/siteConfig'; import { scrollToResultContainer, scrollToGenerateButton, debounce } from '../utils/scrollUtils'; const ToolPage: React.FC = () => { const { toolId } = useParams<{ toolId: string }>(); const [selectedImage, setSelectedImage] = useState<ImageFile>({ file: null, preview: null }); const [processedImage, setProcessedImage] = useState<ProcessedImage>({ url: null, isLoading: false, error: null }); // Tool feature image state const [toolFeatureImage, setToolFeatureImage] = useState<{ imagePath: string | null; altText: string; isLoading: boolean; }>({ imagePath: null, altText: '', isLoading: true }); // AI Cleanup specific state const imageRef = useRef<HTMLImageElement>(null); const visibleCanvasRef = useRef<HTMLCanvasElement>(null); const dataMaskCanvasRef = useRef<HTMLCanvasElement>(null); const [isDrawing, setIsDrawing] = useState(false); const [cleanupBrushSize, setCleanupBrushSize] = useState(20); const [canvasInitialized, setCanvasInitialized] = useState(false); const [isMaskDrawn, setIsMaskDrawn] = useState(false); // AI Expand specific state const [padding, setPadding] = useState({ top: 50, left: 50, bottom: 50, right: 50 }); // AI Replace specific state const replaceImageRef = useRef<HTMLImageElement>(null); const replaceVisibleCanvasRef = useRef<HTMLCanvasElement>(null); const replaceDataMaskCanvasRef = useRef<HTMLCanvasElement>(null); const [isReplaceDrawing, setIsReplaceDrawing] = useState(false); const [replaceBrushSize, setReplaceBrushSize] = useState(20); const [replaceCanvasInitialized, setReplaceCanvasInitialized] = useState(false); const [textPrompt, setTextPrompt] = useState(''); // AI Cartoon specific state const [cartoonTextPrompt, setCartoonTextPrompt] = useState(''); const [cartoonStyleImage, setCartoonStyleImage] = useState<File | null>(null); const [selectedGender, setSelectedGender] = useState<'male' | 'female'>('female'); const [selectedPresetUrl, setSelectedPresetUrl] = useState<string | null>(null); // AI Caricature specific state const [caricatureSelectedStyle, setCaricatureSelectedStyle] = useState<Style | null>(null); const [caricatureCustomStyleImage, setCaricatureCustomStyleImage] = useState<File | null>(null); const [caricatureTextPrompt, setCaricatureTextPrompt] = useState(''); // AI Avatar specific state const [avatarSelectedGender, setAvatarSelectedGender] = useState<'male' | 'female'>('male'); const [avatarSelectedStyle, setAvatarSelectedStyle] = useState<AvatarStyle | null>(null); const [avatarCustomStyleImage, setAvatarCustomStyleImage] = useState<File | null>(null); const [avatarTextPrompt, setAvatarTextPrompt] = useState(''); // AI Product Photoshoot specific state const [selectedProductStyle, setSelectedProductStyle] = useState<ProductStyle | null>(null); const [productCustomStyleImage, setProductCustomStyleImage] = useState<File | null>(null); const [productTextPrompt, setProductTextPrompt] = useState(''); // AI Background Generator specific state const [backgroundTextPrompt, setBackgroundTextPrompt] = useState(''); // AI Image Generator specific state const [imageGeneratorTextPrompt, setImageGeneratorTextPrompt] = useState(''); const [selectedResolution, setSelectedResolution] = useState<ImageResolution>(imageResolutions[0]); // Default to square // AI Portrait specific state const [portraitSelectedGender, setPortraitSelectedGender] = useState<'male' | 'female'>('female'); const [portraitSelectedStyle, setPortraitSelectedStyle] = useState<PortraitStyle | null>(null); const [portraitCustomStyleImage, setPortraitCustomStyleImage] = useState<File | null>(null); const [portraitTextPrompt, setPortraitTextPrompt] = useState(''); // AI Face Swap specific state const [faceSwapTargetImage, setFaceSwapTargetImage] = useState<ImageFile>({ file: null, preview: null }); const [faceSwapSourceImage, setFaceSwapSourceImage] = useState<ImageFile>({ file: null, preview: null }); const [selectedFaceSwapPreset, setSelectedFaceSwapPreset] = useState<FaceSwapStyle | null>(null); // AI Outfit specific state const [outfitTextPrompt, setOutfitTextPrompt] = useState(''); // AI Image to Image specific state const [i2iMainImage, setI2iMainImage] = useState<ImageFile>({ file: null, preview: null }); const [i2iStyleImage, setI2iStyleImage] = useState<ImageFile>({ file: null, preview: null }); const [i2iTextPrompt, setI2iTextPrompt] = useState(''); // AI Hairstyle preset selection state const [selectedHairstylePrompt, setSelectedHairstylePrompt] = useState<string>(''); const [i2iStrength, setI2iStrength] = useState(0.3); // Default value from 0.0 to 1.0 const [i2iStyleStrength, setI2iStyleStrength] = useState(0.9); // Default value from 0.0 to 1.0 // AI Sketch to Image specific state const [s2iInputMode, setS2iInputMode] = useState<'draw' | 'upload'>('upload'); // To switch between drawing and uploading const [s2iSketchImage, setS2iSketchImage] = useState<ImageFile>({ file: null, preview: null }); const [s2iStyleImage, setS2iStyleImage] = useState<ImageFile>({ file: null, preview: null }); const [s2iTextPrompt, setS2iTextPrompt] = useState(''); const [s2iStrength, setS2iStrength] = useState(0.8); // Higher default to respect sketch more const [s2iStyleStrength, setS2iStyleStrength] = useState(0.5); // Lower default const drawingCanvasRef = useRef<HTMLCanvasElement>(null); // For the drawing canvas const [isDrawingSketch, setIsDrawingSketch] = useState(false); const [s2iBrushSize, setS2iBrushSize] = useState(5); const [s2iBrushColor, setS2iBrushColor] = useState('#000000'); // AI Hairstyle state const [hairstyleTextPrompt, setHairstyleTextPrompt] = useState(''); // AI Image Upscaler state const [upscaleFactor, setUpscaleFactor] = useState<2 | 4>(2); const [imageDimensions, setImageDimensions] = useState<{ width: number; height: number } | null>(null); const [availableUpscaleOptions, setAvailableUpscaleOptions] = useState<(2 | 4)[]>([2, 4]); // AI Filter state const [filterSelectedCategory, setFilterSelectedCategory] = useState<string>('Ghibli'); const [filterSelectedStyle, setFilterSelectedStyle] = useState<AIFilterStyle | null>(null); const [filterCustomStyleImage, setFilterCustomStyleImage] = useState<File | null>(null); const [filterTextPrompt, setFilterTextPrompt] = useState(''); const [filterUseCustom, setFilterUseCustom] = useState(false); // Find the tool based on the toolId param const tool = tools.find(t => t.id === toolId); // If tool not found, redirect to tools page if (!tool) { return <Navigate to="/tools" replace />; } // Debounced scroll function for outfit style selection const debouncedScrollToGenerate = debounce(() => { scrollToGenerateButton(); }, 300); const handleImageSelect = (imageFile: ImageFile) => { setSelectedImage(imageFile); // Reset processed image when a new image is selected setProcessedImage({ url: null, isLoading: false, error: null }); setCanvasInitialized(false); setReplaceCanvasInitialized(false); setIsMaskDrawn(false); setImageDimensions(null); // Reset dimensions on new image select if (imageFile.file && imageFile.preview) { const img = new Image(); img.onload = () => { // We have the dimensions! Store them in state. const dimensions = { width: img.naturalWidth, height: img.naturalHeight }; console.log("Image dimensions:", dimensions); setImageDimensions(dimensions); // --- THE VALIDATION LOGIC --- const longestSide = Math.max(dimensions.width, dimensions.height); if (longestSide > 2048) { setAvailableUpscaleOptions([]); // No options available setProcessedImage({ url: null, isLoading: false, error: "Image is too large (max 2048px on longest side) and cannot be upscaled." }); } else if (longestSide > 1024) { setAvailableUpscaleOptions([2]); // Only 2x is available setUpscaleFactor(2); // Automatically select 2x } else { setAvailableUpscaleOptions([2, 4]); // Both 2x and 4x are available setUpscaleFactor(2); // Default to 2x } }; img.src = imageFile.preview; } }; const handleAIFaceSwapGenerate = async () => { // Validate that we have a target image if (!faceSwapTargetImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please upload a target image.' }); return; } // Validate that we have a source face (either preset or uploaded) if (!selectedFaceSwapPreset && !faceSwapSourceImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please select a preset face or upload a source face image.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload target image const targetImageUrl = await uploadImageAndGetUrl(faceSwapTargetImage.file); // 2. Get source face image URL let sourceImageUrl: string; if (selectedFaceSwapPreset) { // Use preset face - convert URL to blob and upload const sourceImageBlob = await convertUrlToBlob(selectedFaceSwapPreset.imageUrl); sourceImageUrl = await uploadImageAndGetUrl(new File([sourceImageBlob], "source-face.jpeg", { type: 'image/jpeg' })); } else { // Use uploaded source image sourceImageUrl = await uploadImageAndGetUrl(faceSwapSourceImage.file!); } // 3. Start face swap job const orderId = await startFaceSwapJob({ imageUrl: targetImageUrl, styleImageUrl: sourceImageUrl, }); // 4. Poll until complete const resultUrl = await pollV1JobUntilComplete(orderId); // 5. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during face swap generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; // Handle image load for AI Cleanup - synchronizes canvas with displayed image const handleCleanupImageLoad = (event: React.SyntheticEvent<HTMLImageElement>) => { const image = event.target as HTMLImageElement; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; // Set canvas dimensions to match the displayed image size const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; // Set both canvases to match displayed image dimensions visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; // Initialize data canvas with black background (unmask area) const dataCtx = dataCanvas.getContext('2d'); if (dataCtx) { dataCtx.fillStyle = '#000000'; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } // Clear visible canvas (transparent background) const visibleCtx = visibleCanvas.getContext('2d'); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setCanvasInitialized(true); }; // Canvas drawing functions for AI Cleanup const startDrawing = (e: React.MouseEvent<HTMLCanvasElement>) => { if (tool?.id !== 'ai-cleanup') return; setIsDrawing(true); draw(e); }; const stopDrawing = () => { setIsDrawing(false); }; const draw = (e: React.MouseEvent<HTMLCanvasElement>) => { if (!isDrawing || tool?.id !== 'ai-cleanup') return; const { x, y } = getCoordinatesFromEvent(e.nativeEvent); drawAtPoint(x, y); }; const clearCanvas = () => { const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext('2d'); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext('2d'); if (dataCtx) { dataCtx.fillStyle = '#000000'; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } setIsMaskDrawn(false); }; // Helper function to get coordinates from mouse or touch events const getCoordinatesFromEvent = (event: MouseEvent | Touch): { x: number; y: number } => { const canvas = visibleCanvasRef.current; if (!canvas) return { x: 0, y: 0 }; const rect = canvas.getBoundingClientRect(); return { x: event.clientX - rect.left, y: event.clientY - rect.top }; }; // Function to draw at a specific point (used by both mouse and touch) const drawAtPoint = (x: number, y: number) => { if (!visibleCanvasRef.current || !dataMaskCanvasRef.current || tool?.id !== 'ai-cleanup') return; const visibleCanvas = visibleCanvasRef.current; const dataCanvas = dataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext('2d'); const dataCtx = dataCanvas.getContext('2d'); if (!visibleCtx || !dataCtx) return; // Set mask drawn flag on first draw if (!isMaskDrawn) { setIsMaskDrawn(true); } // Draw semi-transparent red on visible canvas for user feedback visibleCtx.globalCompositeOperation = 'source-over'; visibleCtx.fillStyle = 'rgba(255, 0, 0, 0.5)'; visibleCtx.beginPath(); visibleCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); // Draw white on data canvas for API mask dataCtx.globalCompositeOperation = 'source-over'; dataCtx.fillStyle = '#FFFFFF'; dataCtx.beginPath(); dataCtx.arc(x, y, cleanupBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; // Touch event handlers for AI Cleanup const handleDrawStart = (event: React.TouchEvent<HTMLCanvasElement>) => { setIsDrawing(true); event.preventDefault(); // Prevent page scrolling const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawMove = (event: React.TouchEvent<HTMLCanvasElement>) => { if (!isDrawing) return; event.preventDefault(); const touch = event.touches[0]; const { x, y } = getCoordinatesFromEvent(touch); drawAtPoint(x, y); }; const handleDrawEnd = () => { setIsDrawing(false); }; // Clear selection handler functions const handleCartoonClearSelection = () => { setSelectedPresetUrl(null); }; const handleCaricatureClearSelection = () => { setCaricatureSelectedStyle(null); }; const handleAvatarClearSelection = () => { setAvatarSelectedStyle(null); }; const handleFilterClearSelection = () => { setFilterSelectedStyle(null); }; const handleProductClearSelection = () => { setSelectedProductStyle(null); }; // Handle image load for AI Replace - synchronizes canvas with displayed image const handleReplaceImageLoad = (event: React.SyntheticEvent<HTMLImageElement>) => { const image = event.target as HTMLImageElement; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (!visibleCanvas || !dataCanvas) return; // Set canvas dimensions to match the displayed image size const displayWidth = image.clientWidth; const displayHeight = image.clientHeight; // Set both canvases to match displayed image dimensions visibleCanvas.width = displayWidth; visibleCanvas.height = displayHeight; dataCanvas.width = displayWidth; dataCanvas.height = displayHeight; // Initialize data canvas with black background (unmask area) const dataCtx = dataCanvas.getContext('2d'); if (dataCtx) { dataCtx.fillStyle = '#000000'; dataCtx.fillRect(0, 0, displayWidth, displayHeight); } // Clear visible canvas (transparent background) const visibleCtx = visibleCanvas.getContext('2d'); if (visibleCtx) { visibleCtx.clearRect(0, 0, displayWidth, displayHeight); } setReplaceCanvasInitialized(true); }; // Canvas drawing functions for AI Replace const startReplaceDrawing = (e: React.MouseEvent<HTMLCanvasElement>) => { if (tool?.id !== 'ai-replace') return; setIsReplaceDrawing(true); drawReplace(e); }; const stopReplaceDrawing = () => { setIsReplaceDrawing(false); }; const drawReplace = (e: React.MouseEvent<HTMLCanvasElement>) => { if (!isReplaceDrawing || !replaceVisibleCanvasRef.current || !replaceDataMaskCanvasRef.current || tool?.id !== 'ai-replace') return; const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; const visibleCtx = visibleCanvas.getContext('2d'); const dataCtx = dataCanvas.getContext('2d'); if (!visibleCtx || !dataCtx) return; const rect = visibleCanvas.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; // Draw semi-transparent red on visible canvas for user feedback visibleCtx.globalCompositeOperation = 'source-over'; visibleCtx.fillStyle = 'rgba(255, 0, 0, 0.5)'; visibleCtx.beginPath(); visibleCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); visibleCtx.fill(); // Draw white on data canvas for API mask dataCtx.globalCompositeOperation = 'source-over'; dataCtx.fillStyle = '#FFFFFF'; dataCtx.beginPath(); dataCtx.arc(x, y, replaceBrushSize, 0, 2 * Math.PI); dataCtx.fill(); }; const clearReplaceCanvas = () => { const visibleCanvas = replaceVisibleCanvasRef.current; const dataCanvas = replaceDataMaskCanvasRef.current; if (visibleCanvas) { const visibleCtx = visibleCanvas.getContext('2d'); if (visibleCtx) { visibleCtx.clearRect(0, 0, visibleCanvas.width, visibleCanvas.height); } } if (dataCanvas) { const dataCtx = dataCanvas.getContext('2d'); if (dataCtx) { dataCtx.fillStyle = '#000000'; dataCtx.fillRect(0, 0, dataCanvas.width, dataCanvas.height); } } }; // Convert canvas to file for AI Replace const replaceCanvasToFile = (): Promise<File> => { return new Promise((resolve, reject) => { if (!replaceDataMaskCanvasRef.current) { reject(new Error('Canvas not found')); return; } replaceDataMaskCanvasRef.current.toBlob((blob) => { if (!blob) { reject(new Error('Failed to create blob from canvas')); return; } const file = new File([blob], 'mask.png', { type: 'image/png' }); resolve(file); }, 'image/png'); }); }; // Convert canvas to File for AI Cleanup const canvasToFile = (): Promise<File> => { return new Promise((resolve, reject) => { if (!dataMaskCanvasRef.current) { reject(new Error('Canvas not available')); return; } dataMaskCanvasRef.current.toBlob((blob) => { if (!blob) { reject(new Error('Failed to convert canvas to blob')); return; } const file = new File([blob], 'mask.png', { type: 'image/png' }); resolve(file); }, 'image/png'); }); }; // AI Cleanup specific generate function const handleAICleanupGenerate = async () => { if (!selectedImage.file) return; // --- VALIDATION: Check if mask is drawn --- if (!isMaskDrawn) { setProcessedImage({ url: null, isLoading: false, error: 'Error: Please paint over the area you want to clean up before generating.' }); return; } // --- END OF VALIDATION --- setProcessedImage({ url: null, isLoading: true, error: null }); try { // Prepare images const originalImageFile = selectedImage.file; const maskFile = await canvasToFile(); // Upload both images const originalFinalUrl = await uploadImageAndGetUrl(originalImageFile); const maskFinalUrl = await uploadImageAndGetUrl(maskFile); // Start the cleanup job const orderId = await startCleanupJob({ originalImageUrl: originalFinalUrl, maskedImageUrl: maskFinalUrl }); if (!orderId) { throw new Error('Failed to start cleanup job'); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('AI Cleanup error:', error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' }); } }; // Watermark Remover specific generate function const handleAIWatermarkRemoverGenerate = async () => { if (!selectedImage.file) return; // v2 Watermark Remover DOC compliance: image file must be <= 5MB const maxSizeBytes = 5 * 1024 * 1024; if (selectedImage.file.size > maxSizeBytes) { setProcessedImage({ url: null, isLoading: false, error: 'Image exceeds 5MB limit. Please upload a smaller image.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { const originalFinalUrl = await uploadImageAndGetUrl(selectedImage.file); const orderId = await startWatermarkRemoverJob({ imageUrl: originalFinalUrl }); if (!orderId) { throw new Error('Failed to start watermark remover job'); } const resultUrl = await pollWatermarkJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('Watermark Remover error:', error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' }); } }; const handleAIExpandGenerate = async () => { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the image and get the URL const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the expand job const orderId = await startExpandJob({ imageUrl, padding }); if (!orderId) { throw new Error('Failed to start expand job'); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('AI Expand error:', error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' }); } }; const handleAIReplaceGenerate = async () => { if (!selectedImage.file || !textPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please provide both an image and a text prompt' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the original image const originalImageUrl = await uploadImageAndGetUrl(selectedImage.file); // Get the mask from canvas and upload it const maskFile = await replaceCanvasToFile(); const maskedImageUrl = await uploadImageAndGetUrl(maskFile); console.log('Submitting to API with this prompt:', textPrompt); // Start the replace job const orderId = await startReplaceJob({ originalImageUrl, maskedImageUrl, prompt: textPrompt }); if (!orderId) { throw new Error('Failed to start replace job'); } const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('AI Replace error:', error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' }); } }; const handleAICartoonGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ ...processedImage, error: 'Please select an image first.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleImageUrl: string | undefined = undefined; let finalPrompt: string = ""; // 3. Handle the two different style sources correctly if (selectedPresetUrl) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = "cartoon style transformation"; // Default for preset console.log(`Processing preset style from URL: ${selectedPresetUrl}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(selectedPresetUrl); finalStyleImageUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpg", { type: 'image/jpeg' })); } else if (cartoonStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = cartoonTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log("Processing CUSTOM uploaded style image."); // CRITICAL: Upload the user's local file directly finalStyleImageUrl = await uploadImageAndGetUrl(cartoonStyleImage); } else { // Path C: User is using TEXT-PROMPT ONLY finalPrompt = cartoonTextPrompt; } // 4. Clean debug logging (FIXED: removed problematic template literal) console.log('Main URL:', mainImageUrl); console.log('Style URL:', finalStyleImageUrl); console.log('Text Prompt:', finalPrompt); // 5. Start the cartoon job with corrected logic const orderId = await startCartoonJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleImageUrl, textPrompt: finalPrompt || "cartoon style transformation" // ALWAYS send the prompt, never undefined }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() => { scrollToResultContainer().catch(console.error); }, 100); // Scroll to result container with device-adaptive behavior setTimeout(() => { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAICaricatureGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!caricatureSelectedStyle && !caricatureCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: 'Please select a style image before generating.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = ""; // 3. Handle the two different style sources correctly if (caricatureSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = caricatureSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${caricatureSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(caricatureSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: 'image/jpeg' })); } else if (caricatureCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = caricatureTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log("Processing CUSTOM uploaded style image."); // CRITICAL: Upload the user's local file directly finalStyleUrl = await uploadImageAndGetUrl(caricatureCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startCaricatureJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "humorous artistic caricature" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during caricature generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAIAvatarGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!avatarSelectedStyle && !avatarCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: 'Please select a style before generating.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = ""; // 3. Handle the two different style sources correctly if (avatarSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = avatarSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${avatarSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(avatarSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: 'image/jpeg' })); } else if (avatarCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE (THIS IS THE FIX) === finalPrompt = avatarTextPrompt; // CRITICAL: Get the prompt from the TEXTAREA state console.log("Processing CUSTOM uploaded style image."); // CRITICAL: Upload the user's local file directly finalStyleUrl = await uploadImageAndGetUrl(avatarCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startAvatarJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "A high-quality avatar" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during avatar generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAIPortraitGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } // A style source (preset or custom) should be guaranteed by the disabled button logic if (!portraitSelectedStyle && !portraitCustomStyleImage) { setProcessedImage({ url: null, isLoading: false, error: 'Please select a style before generating.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main user image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = ""; // 3. Handle the two different style sources correctly if (portraitSelectedStyle) { // === PATH A: USER CHOSE A PRESET STYLE === finalPrompt = portraitSelectedStyle.prompt; // Get the prompt from the preset data console.log(`Processing PRESET style: ${portraitSelectedStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(portraitSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: 'image/jpeg' })); } else if (portraitCustomStyleImage) { // === PATH B: USER UPLOADED A CUSTOM STYLE IMAGE === finalPrompt = portraitTextPrompt; // Get the prompt from the TEXTAREA state console.log("Processing CUSTOM uploaded style image."); // Upload the user's local file directly finalStyleUrl = await uploadImageAndGetUrl(portraitCustomStyleImage); } // 4. Call the job with guaranteed valid data const orderId = await startPortraitJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt || "A high-quality portrait" }); const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during portrait generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAIProductPhotoshootGenerate = async () => { if (!selectedImage.file) { console.error("No user image provided."); return; } // A style source (preset, custom image, or text) is needed if (!selectedProductStyle && !productCustomStyleImage && !productTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: 'Please select a style, upload a style image, or enter a text prompt.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main product image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = ""; // 3. Correctly determine the style source and prepare parameters if (selectedProductStyle) { // Path A: User chose a PRESET style finalPrompt = selectedProductStyle.prompt; console.log(`Processing PRESET style: ${selectedProductStyle.name}`); // Fetch the preset image and re-upload it const styleImageBlob = await convertUrlToBlob(selectedProductStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: 'image/jpeg' })); } else if (productCustomStyleImage) { // Path B: User uploaded a CUSTOM style image finalPrompt = productTextPrompt; // Use the text from the textarea console.log("Processing CUSTOM uploaded style image."); // Upload the user's local file directly finalStyleUrl = await uploadImageAndGetUrl(productCustomStyleImage); } else { // Path C: User is using ONLY a text prompt finalPrompt = productTextPrompt; } // 4. Call the API job function with all parameters const orderId = await startProductPhotoshootJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt, }); // 5. Use our robust, unified poller to get the result const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during product photo generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAIBackgroundGeneratorGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please select an image first.' }); return; } if (!backgroundTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a text prompt describing the background you want.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the main image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the background generator job const orderId = await startBackgroundGeneratorJob({ imageUrl: mainImageUrl, textPrompt: backgroundTextPrompt }); // Poll for completion const resultUrl = await pollJobUntilComplete(orderId); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('An error occurred during background generation:', error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; // Add this function to resize images client-side if needed const resizeImageToResolution = async (imageUrl: string, targetWidth: number, targetHeight: number): Promise<string> => { return new Promise((resolve) => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d')!; const img = new Image(); img.onload = () => { canvas.width = targetWidth; canvas.height = targetHeight; ctx.drawImage(img, 0, 0, targetWidth, targetHeight); resolve(canvas.toDataURL('image/png')); }; img.crossOrigin = 'anonymous'; img.src = imageUrl; }); }; const handleAIImageGeneratorGenerate = async () => { if (!imageGeneratorTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a text prompt describing the image you want to generate.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Start the image generator job const orderId = await startImageGeneratorJob({ textPrompt: imageGeneratorTextPrompt, width: selectedResolution.width, height: selectedResolution.height }); // Poll for completion const resultUrl = await pollJobUntilComplete(orderId); // Optionally resize to match selected resolution const resizedUrl = await resizeImageToResolution( resultUrl, selectedResolution.width, selectedResolution.height ); setProcessedImage({ url: resizedUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() => { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error('An error occurred during image generation:', error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message || 'An unknown error occurred.' }); } }; const handleAIOutfitGenerate = async () => { if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please upload an image.' }); return; } if (!outfitTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a text prompt describing the outfit you want.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the image const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Start the outfit job const orderId = await startOutfitJob({ imageUrl: imageUrl, textPrompt: outfitTextPrompt, }); // 3. Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // 4. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // 5. Scroll to result container with device-adaptive behavior setTimeout(() => { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error("An error occurred during outfit generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIImageToImageGenerate = async () => { if (!i2iMainImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please upload a main image.' }); return; } if (!i2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a text prompt describing the transformation you want.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main image const mainImageUrl = await uploadImageAndGetUrl(i2iMainImage.file); console.log('DEBUG: mainImageUrl after upload:', mainImageUrl); // 2. Upload style image if provided let styleImageUrl: string | undefined; if (i2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(i2iStyleImage.file); console.log('DEBUG: styleImageUrl after upload:', styleImageUrl); } // 3. Start the image-to-image job const jobParams = { imageUrl: mainImageUrl, textPrompt: i2iTextPrompt, styleImageUrl: styleImageUrl, strength: i2iStrength, styleStrength: i2iStyleImage.file ? i2iStyleStrength : undefined, }; console.log('DEBUG: jobParams before API call:', jobParams); const orderId = await startImageToImageJob(jobParams); // 4. Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // 5. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during image-to-image generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAISketchToImageGenerate = async () => { // Validation if (s2iInputMode === 'upload' && !s2iSketchImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please upload a sketch image.' }); return; } if (s2iInputMode === 'draw') { const canvas = drawingCanvasRef.current; if (!canvas) { setProcessedImage({ url: null, isLoading: false, error: 'Drawing canvas not available.' }); return; } // Check if canvas has any drawing (not just white) const ctx = canvas.getContext('2d'); if (!ctx) { setProcessedImage({ url: null, isLoading: false, error: 'Cannot access drawing canvas.' }); return; } const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const data = imageData.data; let hasDrawing = false; // Check if any pixel is not white (255, 255, 255) for (let i = 0; i < data.length; i += 4) { if (data[i] !== 255 || data[i + 1] !== 255 || data[i + 2] !== 255) { hasDrawing = true; break; } } if (!hasDrawing) { setProcessedImage({ url: null, isLoading: false, error: 'Please draw something on the canvas first.' }); return; } } if (!s2iTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a text prompt describing the final image you want.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { let sketchImageUrl: string; if (s2iInputMode === 'upload') { // Upload the sketch file sketchImageUrl = await uploadImageAndGetUrl(s2iSketchImage.file!); } else { // Convert canvas to blob and upload const canvas = drawingCanvasRef.current!; const blob = await new Promise<Blob>((resolve) => { canvas.toBlob((blob) => resolve(blob!), 'image/png'); }); // Convert Blob to File for uploadImageAndGetUrl const file = new File([blob], 'sketch.png', { type: 'image/png' }); sketchImageUrl = await uploadImageAndGetUrl(file); } console.log('DEBUG: sketchImageUrl after upload:', sketchImageUrl); // Upload style image if provided let styleImageUrl: string | undefined; if (s2iStyleImage.file) { styleImageUrl = await uploadImageAndGetUrl(s2iStyleImage.file); console.log('DEBUG: styleImageUrl after upload:', styleImageUrl); } // Start the sketch-to-image job const jobParams = { imageUrl: sketchImageUrl, textPrompt: s2iTextPrompt, strength: s2iStrength, styleImageUrl: styleImageUrl, styleStrength: s2iStyleImage.file ? s2iStyleStrength : undefined, }; console.log('DEBUG: sketch-to-image jobParams before API call:', jobParams); const orderId = await startSketchToImageJob(jobParams); // Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during sketch-to-image generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIHairstyleGenerate = async () => { // Validate that we have an image if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: 'Please upload an image.' }); return; } // Validate that we have a text prompt if (!hairstyleTextPrompt.trim()) { setProcessedImage({ url: null, isLoading: false, error: 'Please enter a hairstyle description.' }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // Upload the image const imageUrl = await uploadImageAndGetUrl(selectedImage.file); // Start the hairstyle job const orderId = await startHairstyleJob({ imageUrl: imageUrl, textPrompt: hairstyleTextPrompt, }); // Poll until complete const resultUrl = await pollJobUntilComplete(orderId); // Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during hairstyle generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIUpscalerGenerate = async () => { if (!selectedImage.file) { return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 1. Upload the main image. const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 2. Call the API job function with the user's selected (and validated) factor. const orderId = await startUpscaleJob({ imageUrl: mainImageUrl, quality: upscaleFactor, }); // 3. Use our unified poller to get the result. const resultUrl = await pollJobUntilComplete(orderId); // 4. Display the upscaled image. setProcessedImage({ url: resultUrl, isLoading: false, error: null }); // Scroll to result container with device-adaptive behavior setTimeout(() => { scrollToResultContainer().catch(console.error); }, 100); } catch (error) { console.error("An error occurred during image upscaling:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; const handleAIFilterGenerate = async () => { // 1. Validate inputs and set loading state if (!selectedImage.file) { setProcessedImage({ url: null, isLoading: false, error: "Please upload an image first." }); return; } if (!filterSelectedStyle && !filterCustomStyleImage && !filterTextPrompt) { setProcessedImage({ url: null, isLoading: false, error: "Please select a preset style, upload a custom style, or enter a text prompt." }); return; } setProcessedImage({ url: null, isLoading: true, error: null }); try { // 2. Upload the main image const mainImageUrl = await uploadImageAndGetUrl(selectedImage.file); // 3. Initialize final parameters let finalStyleUrl: string | undefined = undefined; let finalPrompt: string = ""; // 4. Correctly determine the style source if (filterSelectedStyle) { finalPrompt = filterSelectedStyle.prompt; const styleImageBlob = await convertUrlToBlob(filterSelectedStyle.imageUrl); finalStyleUrl = await uploadImageAndGetUrl(new File([styleImageBlob], "style.jpeg", { type: 'image/jpeg' })); } else if (filterCustomStyleImage) { finalPrompt = filterTextPrompt; finalStyleUrl = await uploadImageAndGetUrl(filterCustomStyleImage); } else { finalPrompt = filterTextPrompt; } // 5. Call the API job function with all parameters const orderId = await startAIFilterJob({ imageUrl: mainImageUrl, styleImageUrl: finalStyleUrl, textPrompt: finalPrompt, }); // 6. Use our robust, unified poller const resultUrl = await pollJobUntilComplete(orderId); // 7. Display the result setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error("An error occurred during AI filter generation:", error); setProcessedImage({ url: null, isLoading: false, error: (error as Error).message }); } }; // Canvas initialization is now handled by onLoad events on the image elements const handleProcessImage = async () => { if (!selectedImage.file) return; setProcessedImage({ url: null, isLoading: true, error: null }); try { const resultUrl = await processImage(tool.apiEndpoint, selectedImage.file); setProcessedImage({ url: resultUrl, isLoading: false, error: null }); } catch (error) { console.error('Processing error:', error); setProcessedImage({ url: null, isLoading: false, error: error instanceof Error ? error.message : 'An unexpected error occurred while processing the image' }); } }; const handleDownload = () => { if (!processedImage.url) return; const link = document.createElement('a'); link.href = processedImage.url; link.download = `${tool.id}-result.png`; document.body.appendChild(link); link.click(); document.body.removeChild(link); }; // Clean up object URLs when component unmounts or when a new image is processed useEffect(() => { return () => { if (processedImage.url) { URL.revokeObjectURL(processedImage.url); } }; }, [processedImage.url]); // Load tool feature image when tool changes useEffect(() => { const loadToolImage = async () => { if (!tool) return; setToolFeatureImage(prev => ({ ...prev, isLoading: true })); try { const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { setToolFeatureImage({ imagePath: `/images/tools images/${imageFilename}`, altText: generateAltText(tool.name), isLoading: false }); console.log(`โœ… Loaded feature image for ${tool.name}: ${imageFilename}`); } else { setToolFeatureImage({ imagePath: null, altText: '', isLoading: false }); console.log(`โŒ No feature image found for ${tool.name}`); } } catch (error) { console.error(`๐Ÿ’ฅ Error loading feature image for ${tool.name}:`, error); setToolFeatureImage({ imagePath: null, altText: '', isLoading: false }); } }; loadToolImage(); }, [tool]); // Initialize canvas with white background when drawing mode is selected useEffect(() => { if (tool.id === 'ai-sketch-to-image' && s2iInputMode === 'draw' && drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const ctx = canvas.getContext('2d'); if (ctx) { // Set canvas size canvas.width = 512; canvas.height = 512; // Fill with white background ctx.fillStyle = 'white'; ctx.fillRect(0, 0, canvas.width, canvas.height); // Set drawing properties ctx.lineCap = 'round'; ctx.lineJoin = 'round'; } } }, [tool.id, s2iInputMode]); // Add touch event listeners with passive: false to prevent console errors useEffect(() => { if (tool.id === 'ai-sketch-to-image' && s2iInputMode === 'draw' && drawingCanvasRef.current) { const canvas = drawingCanvasRef.current; const handleTouchStart = (e: TouchEvent) => { e.preventDefault(); // Prevent page scrolling setIsDrawingSketch(true); if (canvas && e.touches[0]) { const touch = e.touches[0]; const rect = canvas.getBoundingClientRect(); const x = (touch.clientX - rect.left) * (canvas.width / rect.width); const y = (touch.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext('2d'); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }; const handleTouchMove = (e: TouchEvent) => { if (!isDrawingSketch) return; e.preventDefault(); // Prevent page scrolling if (canvas && e.touches[0]) { const touch = e.touches[0]; const rect = canvas.getBoundingClientRect(); const x = (touch.clientX - rect.left) * (canvas.width / rect.width); const y = (touch.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext('2d'); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = 'round'; ctx.stroke(); } } }; const handleTouchEnd = (e: TouchEvent) => { e.preventDefault(); // Prevent page scrolling setIsDrawingSketch(false); }; // Add event listeners with passive: false canvas.addEventListener('touchstart', handleTouchStart, { passive: false }); canvas.addEventListener('touchmove', handleTouchMove, { passive: false }); canvas.addEventListener('touchend', handleTouchEnd, { passive: false }); // Cleanup function return () => { canvas.removeEventListener('touchstart', handleTouchStart); canvas.removeEventListener('touchmove', handleTouchMove); canvas.removeEventListener('touchend', handleTouchEnd); }; } }, [tool.id, s2iInputMode, isDrawingSketch, s2iBrushColor, s2iBrushSize]); return ( <> <SEO title={tool.name} description={`${tool.description}. Free online tool with instant results.`} ogImage={toolFeatureImage.imagePath ? generateOgImageUrl(toolFeatureImage.imagePath) : undefined} canonicalUrl={generateCanonicalUrl(`/tools/${tool.id}`)} /> <Helmet> <script type="application/ld+json"> {JSON.stringify({ "@context": "https://schema.org", "@type": "WebApplication", name: tool.name, url: `https://modernphototools.com${tool.path}`, description: `Free online ${tool.name.toLowerCase()} tool. ${tool.description || 'Transform your photos instantly with AI.'}`, applicationCategory: "MultimediaApplication", operatingSystem: "Web", offers: { "@type": "Offer", price: "0", priceCurrency: "USD" }, featureList: [ "AI-powered Processing", "Instant Results", "No Installation Required", "No Registration", "Completely Free" ] })} </script> </Helmet> <div className="container mx-auto px-4 py-12"> <div className="max-w-4xl mx-auto"> <div className="text-center mb-8"> <h1 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4"> {tool.name} </h1> {/* Tool Feature Image */} <ToolFeatureImage toolId={tool.id} toolName={tool.name} imagePath={toolFeatureImage.imagePath ?? ''} altText={toolFeatureImage.altText} /> <p className="text-xl text-gray-600 max-w-2xl mx-auto"> {tool.description} </p> </div> <div className="bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6"> <h2 className="text-xl font-semibold mb-4">How to use {tool.name}</h2> <ol className="list-decimal list-inside space-y-2 text-gray-700"> {tool.id === 'ai-cleanup' ? ( <> <li>Upload your image using the tool below</li> <li>Use the brush tool to paint over areas you want to remove</li> <li>Adjust brush size as needed for precision</li> <li>Click "Generate" to let AI intelligently fill the painted areas</li> <li>Download your enhanced image when processing is complete</li> </> ) : tool.id === 'watermark-remover' ? ( <> <li>Upload your image using the tool below (max 5MB)</li> <li>Click "Generate" โ€” the tool automatically detects and removes watermarks</li> <li>No mask painting is required; results depend on watermark visibility and contrast</li> <li>Review the result and re-try with a clearer image if needed</li> <li>Download your clean image when processing is complete</li> </> ) : tool.id === 'ai-expand' ? ( <> <li>Upload your image using the tool below</li> <li>Adjust the padding values to specify how much to expand each side</li> <li>Click "Generate" to let AI expand your image with new content</li> <li>Download your expanded image when processing is complete</li> </> ) : tool.id === 'ai-replace' ? ( <> <li>Upload your image using the tool below</li> <li>Use the brush tool to paint over areas you want to replace</li> <li>Enter a text prompt describing what you want in the painted areas</li> <li>Adjust brush size as needed for precision</li> <li>Click "Generate" to let AI replace the painted areas with your prompt</li> <li>Download your enhanced image when processing is complete</li> </> ) : tool.id === 'ai-cartoon' ? ( <> <li>Upload your photo using the tool below (works best with human faces)</li> <li>Choose your stylization method: describe a style with text OR upload a style image</li> <li>If using text: describe the cartoon style you want (e.g., "anime style", "Disney cartoon")</li> <li>If using a style image: upload a reference image with the desired artistic style</li> <li>Click "Generate" to transform your photo into cartoon artwork</li> <li>Download your cartoonized image when processing is complete</li> </> ) : tool.id === 'ai-avatar' ? ( <> <li>Upload a clear photo of a human face using the tool below</li> <li>Select your gender to see appropriate avatar styles</li> <li>Choose from preset professional avatar styles OR upload your own style image</li> <li>Optionally add a text prompt to customize the avatar further</li> <li>Click "Generate" to create your professional avatar</li> <li>Download your avatar when processing is complete</li> </> ) : tool.id === 'ai-portrait' ? ( <> <li>Upload a clear photo of a person's face using the tool below</li> <li>Select your gender to see appropriate portrait styles</li> <li>Choose from preset realistic portrait styles OR upload your own style image</li> <li>Use suggested prompts or add your own text prompt to customize the portrait</li> <li>Click "Generate" to create your realistic portrait</li> <li>Download your portrait when processing is complete</li> </> ) : tool.id === 'ai-face-swap' ? ( <> <li>Upload a target image (the photo you want to modify) using the first dropzone</li> <li>Either choose a preset face from the gallery OR upload your own source face image</li> <li>Click "Generate" to swap the faces</li> <li>Download your face-swapped image when processing is complete</li> </> ) : tool.id === 'ai-product-photoshoot' ? ( <> <li>Upload a clear photo of your product using the tool below</li> <li>Choose from preset professional photoshoot styles OR upload your own style image</li> <li>Optionally add a text prompt to describe the desired scene or background</li> <li>Click "Generate" to create your professional product photo</li> <li>Download your enhanced product photo when processing is complete</li> </> ) : tool.id === 'ai-background-generator' ? ( <> <li>Upload your image using the tool below</li> <li>Enter a text prompt describing the background you want to generate</li> <li>Be specific about scenes, settings, colors, textures, and style preferences</li> <li>Click "Generate" to let AI create a custom background for your image</li> <li>Download your enhanced image when processing is complete</li> </> ) : tool.id === 'ai-image-generator' ? ( <> <li>Select your desired image resolution from the available options</li> <li>Enter a detailed text prompt describing the image you want to create</li> <li>Use suggested prompts for inspiration or create your own custom description</li> <li>Be specific about style, colors, composition, and artistic elements</li> <li>Click "Generate" to let AI create your unique image</li> <li>Download your generated image when processing is complete</li> </> ) : tool.id === 'ai-outfit' ? ( <> <li>Upload a clear photo of a person using the tool below</li> <li>Choose from preset outfit styles organized by category OR use suggested prompts</li> <li>Enter a detailed text prompt describing the outfit you want to apply</li> <li>Be specific about clothing type, style, colors, and materials</li> <li>Click "Generate" to let AI change the outfit in your photo</li> <li>Download your transformed image when processing is complete</li> </> ) : tool.id === 'ai-image-to-image' ? ( <> <li>Upload your main image that you want to transform</li> <li>Optionally upload a style reference image for visual guidance</li> <li>Adjust the Image Strength slider to control how much the result resembles your main image</li> <li>Adjust the Style Strength slider to control how much the result follows your style image</li> <li>Enter a detailed text prompt describing the transformation you want</li> <li>Click "Generate" to let AI transform your image based on your prompt and settings</li> <li>Download your transformed image when processing is complete</li> </> ) : tool.id === 'ai-sketch-to-image' ? ( <> <li>Choose to either draw your sketch or upload an existing sketch image</li> <li>If drawing: Use the canvas to create your sketch with the drawing tools</li> <li>If uploading: Select your sketch image file</li> <li>Enter a detailed text prompt describing the final image you want to create</li> <li>Optionally upload a style reference image for visual guidance</li> <li>Adjust the Sketch Adherence slider to control how closely AI follows your sketch</li> <li>Adjust the Style Strength slider if using a style image</li> <li>Click "Generate" to transform your sketch into a rendered image</li> <li>Download your transformed image when processing is complete</li> </> ) : tool.id === 'ai-hairstyle' ? ( <> <li>Upload a clear, front-facing photo of yourself or someone else</li> <li>Describe the hairstyle you want to try on in the text box</li> <li>Or click on one of the suggested hairstyle prompts for inspiration</li> <li>Click "Generate" to see the new hairstyle applied to your photo</li> <li>Download your result when processing is complete</li> </> ) : tool.id === 'ai-image-upscaler' ? ( <> <li>Upload your image using the tool below (max 2048px on longest side)</li> <li>Select an upscale factor (2x or 4x) based on your image size</li> <li>Click "Generate" to enhance your image with AI upscaling</li> <li>Download your high-resolution result when processing is complete</li> </> ) : ( <> <li>Upload your image using the tool below</li> <li>Click the "{tool.name}" button to process your image</li> <li>Wait for the AI to work its magic</li> <li>Download your result when processing is complete</li> </> )} </ol> </div> {/* Add PromptsGuide for tools that use text prompts */} {(tool.id === 'ai-replace' || tool.id === 'ai-cartoon' || tool.id === 'ai-caricature' || tool.id === 'ai-avatar' || tool.id === 'ai-product-photoshoot' || tool.id === 'ai-background-generator' || tool.id === 'ai-image-generator' || tool.id === 'ai-portrait' || tool.id === 'ai-outfit' || tool.id === 'ai-image-to-image' || tool.id === 'ai-sketch-to-image' || tool.id === 'ai-hairstyle' || tool.id === 'ai-filter') && ( <div className="mb-8"> <PromptsGuide /> </div> )} <div className="grid grid-cols-1 md:grid-cols-2 gap-8"> <div className="space-y-6"> {/* Show ImageDropzone for all tools except AI Image Generator, AI Face Swap, AI Image to Image, and AI Sketch to Image */} {tool.id !== 'ai-image-generator' && tool.id !== 'ai-face-swap' && tool.id !== 'ai-image-to-image' && tool.id !== 'ai-sketch-to-image' && ( <ImageDropzone onImageSelect={handleImageSelect} selectedImage={selectedImage} /> )} {/* AI Face Swap specific image inputs */} {tool.id === 'ai-face-swap' && ( <div className="space-y-6"> <div> <h3 className="text-lg font-medium mb-2">1. Upload Target Image</h3> <p className="text-sm text-gray-600 mb-3">The photo you want to modify</p> <ImageDropzone onImageSelect={(imageFile) => setFaceSwapTargetImage(imageFile)} selectedImage={faceSwapTargetImage} /> </div> <div> <h3 className="text-lg font-medium mb-2">2. Upload Source Face Image</h3> <p className="text-sm text-gray-600 mb-3">The face you want to use (disabled if preset selected)</p> <ImageDropzone onImageSelect={(imageFile) => setFaceSwapSourceImage(imageFile)} selectedImage={faceSwapSourceImage} disabled={!!selectedFaceSwapPreset} /> </div> <div> <h3 className="text-lg font-medium mb-2">Or Choose a Preset Source Face</h3> <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4"> {faceSwapStyles.map((style) => { const isSelected = selectedFaceSwapPreset?.imageUrl === style.imageUrl; return ( <div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} onClick={() => { setSelectedFaceSwapPreset(style); setFaceSwapSourceImage({ file: null, preview: null }); }} > {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); setSelectedFaceSwapPreset(null); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-auto object-cover" /> <p className="text-center text-xs p-1 bg-gray-100">{style.name}</p> </div> ); })} </div> </div> </div> )} {/* AI Cleanup specific controls */} {tool.id === 'ai-cleanup' && selectedImage.preview && ( <div className="space-y-4"> <div className="flex items-center gap-4"> <label className="flex items-center gap-2"> <Brush className="w-4 h-4" /> <span className="text-sm font-medium">Brush Size:</span> </label> <input type="range" min="5" max="50" value={cleanupBrushSize} onChange={(e) => setCleanupBrushSize(Number(e.target.value))} className="flex-1" /> <span className="text-sm text-gray-600 w-8">{cleanupBrushSize}px</span> </div> <div className="relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden" style={{ display: 'inline-block' }}> <img ref={imageRef} src={selectedImage.preview} alt="Selected" className="w-full h-auto" draggable={false} onLoad={handleCleanupImageLoad} style={{ maxWidth: '100%', display: 'block' }} /> <canvas ref={visibleCanvasRef} className="absolute top-0 left-0 cursor-crosshair" onMouseDown={startDrawing} onMouseMove={draw} onMouseUp={() => setIsDrawing(false)} onMouseLeave={() => setIsDrawing(false)} onTouchStart={handleDrawStart} onTouchMove={handleDrawMove} onTouchEnd={handleDrawEnd} style={{ zIndex: 10 }} /> <canvas ref={dataMaskCanvasRef} style={{ display: 'none' }} /> </div> <Button variant="outline" onClick={clearCanvas} className="w-full" > Clear Mask </Button> </div> )} {/* Watermark Remover specific note (no painting required) */} {tool.id === 'watermark-remover' && selectedImage.preview && ( <div className="space-y-4"> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tip:</h4> <p className="text-xs text-blue-700"> Upload a watermarked image. The tool automatically detects and removes watermarks โ€” no painting needed. </p> <p className="text-xs text-blue-700 mt-1"> Maximum file size: 5MB. </p> </div> </div> )} {/* AI Expand specific controls */} {tool.id === 'ai-expand' && ( <div className="space-y-4"> <h3 className="text-lg font-medium">Padding Settings</h3> <p className="text-sm text-gray-600">Specify how many pixels to add to each side of your image.</p> <div className="grid grid-cols-2 gap-4"> <div> <label className="block text-sm font-medium text-gray-700 mb-1"> Top Padding </label> <input type="number" min="0" max="500" value={padding.top} onChange={(e) => setPadding(prev => ({ ...prev, top: Number(e.target.value) }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-1"> Bottom Padding </label> <input type="number" min="0" max="500" value={padding.bottom} onChange={(e) => setPadding(prev => ({ ...prev, bottom: Number(e.target.value) }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-1"> Left Padding </label> <input type="number" min="0" max="500" value={padding.left} onChange={(e) => setPadding(prev => ({ ...prev, left: Number(e.target.value) }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-1"> Right Padding </label> <input type="number" min="0" max="500" value={padding.right} onChange={(e) => setPadding(prev => ({ ...prev, right: Number(e.target.value) }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" /> </div> </div> </div> )} {/* AI Background Generator specific controls */} {tool.id === 'ai-background-generator' && ( <div className="space-y-4"> <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Background Description </label> <textarea value={backgroundTextPrompt} onChange={(e) => setBackgroundTextPrompt(e.target.value)} placeholder="Describe the background you want to generate (e.g., 'sunset beach with palm trees', 'modern office interior', 'mountain landscape with snow')..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={4} /> </div> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tips for better results:</h4> <ul className="text-xs text-blue-700 space-y-1"> <li>โ€ข Be specific about the scene or setting you want</li> <li>โ€ข Include details about lighting, colors, and mood</li> <li>โ€ข Mention the style (realistic, artistic, vintage, etc.)</li> <li>โ€ข Example: "Professional studio with soft lighting and neutral background"</li> </ul> </div> </div> )} {/* AI Replace specific controls */} {tool.id === 'ai-replace' && selectedImage.preview && ( <div className="space-y-4"> <div className="flex items-center gap-4"> <label className="flex items-center gap-2"> <Brush className="w-4 h-4" /> <span className="text-sm font-medium">Brush Size:</span> </label> <input type="range" min="5" max="50" value={replaceBrushSize} onChange={(e) => setReplaceBrushSize(Number(e.target.value))} className="flex-1" /> <span className="text-sm text-gray-600 w-8">{replaceBrushSize}px</span> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Text Prompt </label> <textarea value={textPrompt} onChange={(e) => setTextPrompt(e.target.value)} placeholder="Describe what you want to replace the painted areas with..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={3} /> <div className="mt-2"> <span className="text-sm text-gray-600 mb-2 block">Try an example:</span> <div className="flex flex-wrap gap-2"> <button type="button" onClick={() => setTextPrompt('A beautiful cherry blossom tree')} className="px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors" > Cherry Blossom Tree </button> <button type="button" onClick={() => setTextPrompt('Sunglasses with a futuristic design, cyberpunk style')} className="px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors" > Futuristic Sunglasses </button> <button type="button" onClick={() => setTextPrompt('A classic red brick wall')} className="px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors" > Red Brick Wall </button> </div> </div> </div> <div className="relative border-2 border-dashed border-gray-300 rounded-lg overflow-hidden" style={{ display: 'inline-block' }}> <img ref={replaceImageRef} src={selectedImage.preview} alt="Selected" className="w-full h-auto" draggable={false} onLoad={handleReplaceImageLoad} style={{ maxWidth: '100%', display: 'block' }} /> <canvas ref={replaceVisibleCanvasRef} className="absolute top-0 left-0 cursor-crosshair" onMouseDown={startReplaceDrawing} onMouseMove={drawReplace} onMouseUp={() => setIsReplaceDrawing(false)} onMouseLeave={() => setIsReplaceDrawing(false)} style={{ zIndex: 10, opacity: 0.5 }} /> <canvas ref={replaceDataMaskCanvasRef} style={{ display: 'none' }} /> </div> <Button variant="outline" onClick={clearReplaceCanvas} className="w-full" > Clear Mask </Button> <div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3"> <p className="text-sm text-yellow-800"> <strong>Important Note:</strong> This tool generates a new image from your text. For best results: </p> <ul className="text-sm text-yellow-800 mt-2 ml-4 list-disc space-y-1"> <li>Describe what you want to see, don't give commands. (e.g., say "a tall sunflower," not "replace this with a sunflower").</li> <li>The AI works best on images containing human faces. Results on objects or landscapes may vary.</li> </ul> </div> </div> )} {/* AI Cartoon specific controls */} {tool.id === 'ai-cartoon' && selectedImage.preview && ( <div className="space-y-6"> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Select Persona</label> <div className="flex gap-4"> <Button variant={selectedGender === 'female' ? 'primary' : 'outline'} onClick={() => setSelectedGender('female')} > Female </Button> <Button variant={selectedGender === 'male' ? 'primary' : 'outline'} onClick={() => setSelectedGender('male')} > Male </Button> </div> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Choose a Preset Style</label> <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4"> {(selectedGender === 'female' ? femaleCartoonStyles : maleCartoonStyles).map((style) => { const isSelected = selectedPresetUrl === style.imageUrl; return ( <div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} onClick={() => setSelectedPresetUrl(style.imageUrl)} > {/* The "Clear Selection" button - shows ONLY on the selected item */} {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); handleCartoonClearSelection(); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-auto object-cover" /> <p className="text-center text-xs p-1 bg-gray-100">{style.name}</p> </div> ); })} </div> </div> <div className="space-y-4"> <p className="text-sm font-medium text-gray-700 text-center">Or Use a Custom Style</p> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Upload a Style Image</label> <input type="file" accept="image/jpeg,image/png" onChange={(e) => setCartoonStyleImage(e.target.files?.[0] || null)} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={!!selectedPresetUrl} /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Describe a Style with Text</label> <textarea value={cartoonTextPrompt} onChange={(e) => setCartoonTextPrompt(e.target.value)} placeholder="e.g., 'anime style', 'Disney cartoon'..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={2} disabled={!!selectedPresetUrl} /> </div> </div> </div> )} {/* AI Caricature specific controls */} {tool.id === 'ai-caricature' && selectedImage.preview && ( <div className="space-y-6"> <div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3"> <p className="text-sm text-yellow-800"> <strong>Note:</strong> This tool works best with clear photos of human faces. Results on other subjects may vary. </p> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Choose a Preset Style</label> <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4"> {caricatureStyles.map((style) => { const isSelected = caricatureSelectedStyle?.imageUrl === style.imageUrl; return ( <div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} onClick={() => setCaricatureSelectedStyle(style)} > {/* The "Clear Selection" button - shows ONLY on the selected item */} {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); handleCaricatureClearSelection(); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-auto object-cover" /> <p className="text-center text-xs p-1 bg-gray-100">{style.name}</p> </div> ); })} </div> </div> <div className="space-y-4"> <p className="text-sm font-medium text-gray-700 text-center">Or Use a Custom Style</p> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Upload a Style Image</label> <input type="file" accept="image/jpeg,image/png" onChange={(e) => setCaricatureCustomStyleImage(e.target.files?.[0] || null)} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={!!caricatureSelectedStyle} /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Describe a Style with Text</label> <textarea value={caricatureTextPrompt} onChange={(e) => setCaricatureTextPrompt(e.target.value)} placeholder="Optional: Add descriptive text to modify your chosen style..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={2} disabled={!!caricatureSelectedStyle} /> </div> </div> </div> )} {/* AI Avatar specific controls */} {tool.id === 'ai-avatar' && selectedImage.preview && ( <div className="space-y-6"> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <p className="text-sm text-blue-800"> <strong>Note:</strong> This tool generates the best avatars from a single, clear photo of a human face. </p> </div> {/* Gender Selection */} <div> <label className="block text-sm font-medium text-gray-700 mb-2">Select Gender</label> <div className="flex space-x-4"> <button type="button" onClick={() => setAvatarSelectedGender('male')} className={`px-4 py-2 rounded-md border ${ avatarSelectedGender === 'male' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Male </button> <button type="button" onClick={() => setAvatarSelectedGender('female')} className={`px-4 py-2 rounded-md border ${ avatarSelectedGender === 'female' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Female </button> </div> </div> {/* Preset Style Gallery */} {avatarSelectedGender && ( <div> <label className="block text-sm font-medium text-gray-700 mb-2">Choose a Preset Style</label> <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4"> {avatarStyles .filter(style => style.gender === avatarSelectedGender) .map((style) => { const isSelected = avatarSelectedStyle?.imageUrl === style.imageUrl; return ( <div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} onClick={() => setAvatarSelectedStyle(style)} > {/* The "Clear Selection" button - shows ONLY on the selected item */} {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); handleAvatarClearSelection(); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-auto object-cover" /> <p className="text-center text-xs p-1 bg-gray-100">{style.name}</p> </div> ); }) } </div> </div> )} {/* Custom Style Section */} <div className="space-y-4"> <p className="text-sm font-medium text-gray-700 text-center">Or Use a Custom Style</p> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Upload a Style Image</label> <input type="file" accept="image/jpeg,image/png" onChange={(e) => setAvatarCustomStyleImage(e.target.files?.[0] || null)} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={!!avatarSelectedStyle} /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Text Prompt (Optional)</label> <textarea value={avatarTextPrompt} onChange={(e) => setAvatarTextPrompt(e.target.value)} placeholder="Optional: Describe the avatar style you want..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={2} /> </div> </div> </div> )} {/* AI Portrait specific controls */} {tool.id === 'ai-portrait' && selectedImage.preview && ( <div className="space-y-6"> <div className="bg-purple-50 border border-purple-200 rounded-lg p-3"> <p className="text-sm text-purple-800"> <strong>Note:</strong> For best results, use a clear photo of a person's face. </p> </div> {/* Gender Selection */} <div> <label className="block text-sm font-medium text-gray-700 mb-2">Select Gender</label> <div className="flex space-x-4"> <button type="button" onClick={() => setPortraitSelectedGender('female')} className={`px-4 py-2 rounded-md border ${ portraitSelectedGender === 'female' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Female </button> <button type="button" onClick={() => setPortraitSelectedGender('male')} className={`px-4 py-2 rounded-md border ${ portraitSelectedGender === 'male' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Male </button> </div> </div> {/* Preset Style Gallery */} {portraitSelectedGender && ( <div> <label className="block text-sm font-medium text-gray-700 mb-2">Choose a Preset Style</label> <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4"> {portraitStyles .filter(style => style.gender === portraitSelectedGender) .map((style) => { const isSelected = portraitSelectedStyle?.imageUrl === style.imageUrl; return ( <div key={style.imageUrl} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} onClick={() => setPortraitSelectedStyle(style)} > {/* The "Clear Selection" button - shows ONLY on the selected item */} {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); setPortraitSelectedStyle(null); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-auto object-cover" /> <p className="text-center text-xs p-1 bg-gray-100">{style.name}</p> </div> ); }) } </div> </div> )} {/* Suggested Prompts */} <div> <label className="block text-sm font-medium text-gray-700 mb-2">Suggested Prompts</label> <div className="flex flex-wrap gap-2 mb-4"> {suggestedPortraitPrompts.map((prompt) => ( <button key={prompt} onClick={() => setPortraitTextPrompt(prompt)} className="px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors" > {prompt} </button> ))} </div> </div> {/* Custom Style Section */} <div className="space-y-4"> <p className="text-sm font-medium text-gray-700 text-center">Or Use a Custom Style</p> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Upload a Style Image</label> <input type="file" accept="image/jpeg,image/png" onChange={(e) => setPortraitCustomStyleImage(e.target.files?.[0] || null)} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" disabled={!!portraitSelectedStyle} /> </div> <div> <label className="block text-sm font-medium text-gray-700 mb-2">Text Prompt</label> <textarea value={portraitTextPrompt} onChange={(e) => setPortraitTextPrompt(e.target.value)} placeholder="Describe the portrait style you want..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={2} disabled={!!portraitSelectedStyle} /> </div> </div> </div> )} {/* AI Product Photoshoot specific controls */} {tool.id === 'ai-product-photoshoot' && selectedImage.preview && ( <div className="space-y-6"> <div className="bg-green-50 border border-green-200 rounded-lg p-3"> <p className="text-sm text-green-800"> <strong>Note:</strong> This tool works best with clear product photos on neutral backgrounds. </p> </div> {/* Preset Style Gallery */} <div> <h3 className="text-lg font-semibold mb-4">Choose a Style</h3> <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 max-h-96 overflow-y-auto"> {productStyles.map((style) => { const isSelected = selectedProductStyle?.name === style.name; return ( <div key={style.name} onClick={() => { setSelectedProductStyle(style); setProductCustomStyleImage(null); // Clear custom image when preset is selected }} className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-lg' : 'border-transparent hover:border-gray-300' }`} > {/* The "Clear Selection" button - shows ONLY on the selected item */} {isSelected && ( <button type="button" onClick={(e) => { e.stopPropagation(); handleProductClearSelection(); }} className="absolute top-1 right-1 z-10 p-1 bg-white bg-opacity-70 rounded-full text-red-600 hover:bg-opacity-100 hover:scale-110 transition-transform" aria-label="Clear selection" > <XCircle size={20} /> </button> )} <img src={style.imageUrl} alt={style.name} className="w-full h-24 object-cover" /> <div className="p-2 bg-gray-50"> <p className="text-sm font-medium text-center">{style.name}</p> </div> </div> ); })} </div> </div> {/* Custom Style Image Upload */} <div> <h3 className="text-lg font-semibold mb-4">Or Upload a Custom Style Image</h3> <input type="file" accept="image/jpeg,image/png" onChange={(e) => { const file = e.target.files?.[0] || null; setProductCustomStyleImage(file); if (file) { setSelectedProductStyle(null); // Clear preset when custom image is uploaded } }} className="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" /> {productCustomStyleImage && ( <p className="mt-2 text-sm text-green-600">Custom style image selected: {productCustomStyleImage.name}</p> )} </div> {/* Suggested Prompts */} <div> <h3 className="text-lg font-semibold mb-4">Don't have a style? Try these prompts</h3> <div className="flex flex-wrap gap-2 mb-4"> {suggestedPrompts.map((prompt) => ( <button key={prompt} onClick={() => setProductTextPrompt(prompt)} className="px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors" > {prompt} </button> ))} </div> </div> {/* Text Prompt Input */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Text Prompt (Optional) </label> <textarea value={productTextPrompt} onChange={(e) => setProductTextPrompt(e.target.value)} placeholder="Describe the style or setting you want for your product photo..." className="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" rows={3} /> </div> </div> )} {/* AI Image Generator specific controls */} {tool.id === 'ai-image-generator' && ( <div className="space-y-6"> {/* Resolution Selector */} <div> <label className="block text-sm font-medium text-gray-700 mb-3"> Image Resolution </label> <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"> {imageResolutions.map((resolution) => ( <div key={`${resolution.width}x${resolution.height}`} className={`cursor-pointer p-3 border-2 rounded-lg transition-colors ${ selectedResolution.width === resolution.width && selectedResolution.height === resolution.height ? 'border-blue-500 bg-blue-50' : 'border-gray-200 hover:border-gray-300' }`} onClick={() => setSelectedResolution(resolution)} > <div className="text-sm font-medium">{resolution.name}</div> <div className="text-xs text-gray-500">{resolution.aspectRatio}</div> <div className="text-xs text-gray-400">{resolution.width}x{resolution.height} px</div> </div> ))} </div> </div> {/* Text Prompt Input */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Image Description </label> <textarea value={imageGeneratorTextPrompt} onChange={(e) => setImageGeneratorTextPrompt(e.target.value)} placeholder="Describe the image you want to generate in detail (e.g., 'a majestic mountain landscape at sunset', 'portrait of a cat wearing sunglasses', 'abstract digital art with vibrant colors')..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={4} /> {/* Updated Tips Section to match AI Background Generator */} <div className="mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tips for better results:</h4> <ul className="text-xs text-blue-700 space-y-1"> <li>โ€ข Be specific about style, colors, composition, and artistic elements</li> <li>โ€ข Include details about lighting, mood, and atmosphere</li> <li>โ€ข Mention art styles (realistic, cartoon, anime, oil painting, etc.)</li> <li>โ€ข Add quality descriptors (high quality, detailed, masterpiece, etc.)</li> </ul> </div> </div> {/* Suggested Prompts */} <div> <label className="block text-sm font-medium text-gray-700 mb-3"> Suggested Prompts </label> <div className="grid grid-cols-1 gap-2 max-h-64 overflow-y-auto"> {imageGeneratorPrompts.map((prompt, index) => ( <button key={index} type="button" onClick={() => setImageGeneratorTextPrompt(prompt)} className="text-left px-3 py-2 text-sm bg-gray-50 hover:bg-gray-100 rounded-md border transition-colors" > {prompt} </button> ))} </div> </div> </div> )} {/* AI Outfit specific controls */} {tool.id === 'ai-outfit' && selectedImage.preview && ( <div className="space-y-6"> <div className="bg-purple-50 border border-purple-200 rounded-lg p-3"> <p className="text-sm text-purple-800"> <strong>Note:</strong> This tool works best with clear photos of people wearing clothing. </p> </div> {/* Preset Outfit Styles */} <div> <h3 className="text-lg font-semibold mb-4">Choose an Outfit Style</h3> {Object.entries( presetOutfitStyles.reduce((acc, style) => { if (!acc[style.category]) acc[style.category] = []; acc[style.category].push(style); return acc; }, {} as Record<string, typeof presetOutfitStyles>) ).map(([category, styles]) => ( <div key={category} className="mb-6"> <h4 className="text-md font-medium text-gray-700 mb-3">{category}</h4> <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3"> {styles.map((style) => ( <button key={style.name} onClick={() => { setOutfitTextPrompt(style.prompt); debouncedScrollToGenerate(); }} className="p-3 text-left bg-gray-50 hover:bg-gray-100 rounded-lg border transition-colors" > <div className="text-sm font-medium">{style.name}</div> </button> ))} </div> </div> ))} </div> {/* Suggested Prompts */} <div> <h3 className="text-lg font-semibold mb-4">Suggested Outfit Ideas</h3> <div className="flex flex-wrap gap-2 mb-4"> {suggestedOutfitPrompts.map((prompt) => ( <button key={prompt} onClick={() => setOutfitTextPrompt(prompt)} className="px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded-full border transition-colors" > {prompt} </button> ))} </div> </div> {/* Text Prompt Input */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Outfit Description </label> <textarea value={outfitTextPrompt} onChange={(e) => setOutfitTextPrompt(e.target.value)} placeholder="Describe the outfit you want to apply (e.g., 'elegant black evening dress', 'casual denim jacket and jeans', 'professional business suit')..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={4} /> <div className="mt-3 bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tips for better results:</h4> <ul className="text-xs text-blue-700 space-y-1"> <li>โ€ข Be specific about clothing type, style, colors, and materials</li> <li>โ€ข Include details about fit and silhouette (loose, fitted, flowing, etc.)</li> <li>โ€ข Mention specific garments (dress, shirt, pants, jacket, etc.)</li> <li>โ€ข Add style descriptors (casual, formal, vintage, modern, etc.)</li> </ul> </div> </div> </div> )} {/* AI Image to Image specific controls */} {tool.id === 'ai-image-to-image' && ( <div className="space-y-6"> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <p className="text-sm text-blue-800"> <strong>Note:</strong> Upload a main image to transform and optionally a style reference image for visual guidance. </p> </div> {/* Main Image Upload */} <div> <h3 className="text-lg font-semibold mb-2">1. Main Image</h3> <p className="text-sm text-gray-600 mb-3">The image you want to transform</p> <ImageDropzone onImageSelect={(imageFile) => setI2iMainImage(imageFile)} selectedImage={i2iMainImage} /> </div> {/* Style Image Upload */} <div> <h3 className="text-lg font-semibold mb-2">2. Style Reference Image (Optional)</h3> <p className="text-sm text-gray-600 mb-3">Upload an image to use as style guidance</p> <ImageDropzone onImageSelect={(imageFile) => setI2iStyleImage(imageFile)} selectedImage={i2iStyleImage} /> </div> {/* Strength Sliders */} <div className="space-y-4"> <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Image Strength: {i2iStrength.toFixed(1)} </label> <input type="range" min="0" max="1" step="0.1" value={i2iStrength} onChange={(e) => setI2iStrength(Number(e.target.value))} className="w-full" /> <p className="text-xs text-gray-500 mt-1"> Higher strength makes the result look more like your main image </p> </div> <div> <div className="flex items-center gap-2 mb-2"> <label className="text-sm font-medium text-gray-700"> Style Strength: {i2iStyleStrength.toFixed(1)} </label> <div className="relative group"> <HelpCircle className="w-4 h-4 text-gray-400 cursor-help" /> <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10"> Slider is disabled if no style image has been uploaded <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800"></div> </div> </div> </div> <input type="range" min="0" max="1" step="0.1" value={i2iStyleStrength} onChange={(e) => setI2iStyleStrength(Number(e.target.value))} disabled={!i2iStyleImage.file} className="w-full disabled:opacity-50 disabled:cursor-not-allowed" /> <p className="text-xs text-gray-500 mt-1"> Higher strength makes the result look more like your style image {!i2iStyleImage.file && " (disabled - upload a style image first)"} </p> </div> </div> {/* Text Prompt Input */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Enter Prompt * </label> <textarea value={i2iTextPrompt} onChange={(e) => setI2iTextPrompt(e.target.value)} placeholder="Describe the final image you want to create (e.g., 'turn this into a watercolor painting', 'make it look like a vintage photograph', 'transform into a cyberpunk scene')..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={4} required /> <div className="mt-3 bg-green-50 border border-green-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-green-800 mb-2">๐Ÿ’ก Tips for better results:</h4> <ul className="text-xs text-green-700 space-y-1"> <li>โ€ข Be specific about the style, mood, or transformation you want</li> <li>โ€ข Mention artistic styles (watercolor, oil painting, digital art, etc.)</li> <li>โ€ข Include lighting and atmosphere details (dramatic, soft, bright, etc.)</li> <li>โ€ข Use the Image Strength slider to control how much of the original to keep</li> <li>โ€ข Use the Style Strength slider to control style reference influence</li> </ul> </div> </div> </div> )} {/* AI Sketch to Image specific controls */} {tool.id === 'ai-sketch-to-image' && ( <div className="space-y-6"> <div className="bg-purple-50 border border-purple-200 rounded-lg p-3"> <p className="text-sm text-purple-800"> <strong>Note:</strong> Create or upload a sketch, then describe the final image you want to generate. </p> </div> {/* Input Mode Switcher */} <div> <h3 className="text-lg font-semibold mb-3">1. Choose Input Method</h3> <div className="flex space-x-4"> <button type="button" onClick={() => setS2iInputMode('upload')} className={`px-4 py-2 rounded-md border ${ s2iInputMode === 'upload' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Upload Sketch </button> <button type="button" onClick={() => setS2iInputMode('draw')} className={`px-4 py-2 rounded-md border ${ s2iInputMode === 'draw' ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > Draw Sketch </button> </div> </div> {/* Conditional Input */} {s2iInputMode === 'upload' ? ( <div> <h3 className="text-lg font-semibold mb-2">2. Upload Your Sketch</h3> <p className="text-sm text-gray-600 mb-3">Upload an existing sketch or drawing</p> <ImageDropzone onImageSelect={(imageFile) => setS2iSketchImage(imageFile)} selectedImage={s2iSketchImage} /> </div> ) : ( <div> <h3 className="text-lg font-semibold mb-2">2. Draw Your Sketch</h3> <p className="text-sm text-gray-600 mb-3">Use the canvas below to draw your sketch</p> {/* Drawing Controls */} <div className="flex items-center gap-4 mb-3"> <label className="flex items-center gap-2"> <span className="text-sm font-medium">Brush Size:</span> </label> <input type="range" min="1" max="20" value={s2iBrushSize} onChange={(e) => setS2iBrushSize(Number(e.target.value))} className="flex-1" /> <span className="text-sm text-gray-600 w-8">{s2iBrushSize}px</span> <label className="flex items-center gap-2"> <span className="text-sm font-medium">Color:</span> <input type="color" value={s2iBrushColor} onChange={(e) => setS2iBrushColor(e.target.value)} className="w-8 h-8 rounded border" /> </label> <button type="button" onClick={() => { const canvas = drawingCanvasRef.current; if (canvas) { const ctx = canvas.getContext('2d'); if (ctx) { ctx.fillStyle = 'white'; ctx.fillRect(0, 0, canvas.width, canvas.height); } } }} className="px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 rounded border" > Clear </button> </div> {/* Drawing Canvas */} <div className="border-2 border-gray-300 rounded-lg overflow-hidden"> <canvas ref={drawingCanvasRef} width={400} height={400} className="w-full h-auto cursor-crosshair bg-white" onMouseDown={(e) => { setIsDrawingSketch(true); const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext('2d'); if (ctx) { ctx.beginPath(); ctx.moveTo(x, y); } } }} onMouseMove={(e) => { if (!isDrawingSketch) return; const canvas = drawingCanvasRef.current; if (canvas) { const rect = canvas.getBoundingClientRect(); const x = (e.clientX - rect.left) * (canvas.width / rect.width); const y = (e.clientY - rect.top) * (canvas.height / rect.height); const ctx = canvas.getContext('2d'); if (ctx) { ctx.lineTo(x, y); ctx.strokeStyle = s2iBrushColor; ctx.lineWidth = s2iBrushSize; ctx.lineCap = 'round'; ctx.stroke(); } } }} onMouseUp={() => setIsDrawingSketch(false)} onMouseLeave={() => setIsDrawingSketch(false)} /> </div> </div> )} {/* Text Prompt Input */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> 3. Describe the Final Image * </label> <textarea value={s2iTextPrompt} onChange={(e) => setS2iTextPrompt(e.target.value)} placeholder="Describe the final image you want to create from your sketch (e.g., 'a realistic portrait of a woman', 'a fantasy castle in a magical forest', 'a modern car design')..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={4} required /> </div> {/* Style Image Upload */} <div> <h3 className="text-lg font-semibold mb-2">4. Style Reference Image </h3> <p className="text-sm text-gray-600 mb-3">Upload an image to use as style guidance</p> <ImageDropzone onImageSelect={(imageFile) => setS2iStyleImage(imageFile)} selectedImage={s2iStyleImage} /> </div> {/* Strength Sliders */} <div className="space-y-4"> <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Sketch Adherence: {s2iStrength.toFixed(1)} </label> <input type="range" min="0" max="1" step="0.1" value={s2iStrength} onChange={(e) => setS2iStrength(Number(e.target.value))} className="w-full" /> <p className="text-xs text-gray-500 mt-1"> Higher values make the result follow your sketch more closely </p> </div> <div> <div className="flex items-center gap-2 mb-2"> <label className="text-sm font-medium text-gray-700"> Style Strength: {s2iStyleStrength.toFixed(1)} </label> <div className="relative group"> <HelpCircle className="w-4 h-4 text-gray-400 cursor-help" /> <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap z-10"> This slider is disabled if no style image is present <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800"></div> </div> </div> </div> <input type="range" min="0" max="1" step="0.1" value={s2iStyleStrength} onChange={(e) => setS2iStyleStrength(Number(e.target.value))} disabled={!s2iStyleImage.file} className="w-full disabled:opacity-50 disabled:cursor-not-allowed" /> <p className="text-xs text-gray-500 mt-1"> Higher values make the result look more like your style image {!s2iStyleImage.file && " (disabled - upload a style image first)"} </p> </div> </div> <div className="bg-green-50 border border-green-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-green-800 mb-2">๐Ÿ’ก Tips for better results:</h4> <ul className="text-xs text-green-700 space-y-1"> <li>โ€ข Use clear, simple sketches with defined shapes and lines</li> <li>โ€ข Be specific in your text prompt about style, colors, and details</li> <li>โ€ข Higher sketch adherence preserves your drawing structure</li> <li>โ€ข Style images help guide the artistic direction</li> <li>โ€ข Try different combinations of sketch and style strength</li> </ul> </div> </div> )} {/* AI Hairstyle specific controls */} {tool.id === 'ai-hairstyle' && selectedImage.preview && ( <div className="space-y-4"> <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Describe the hairstyle you want to try on </label> <textarea value={hairstyleTextPrompt} onChange={(e) => setHairstyleTextPrompt(e.target.value)} placeholder="Describe the hairstyle you want to try on..." className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none" rows={3} /> </div> <div> <h3 className="text-sm font-medium text-gray-700 mb-3">Or choose a preset style:</h3> {/* This is the new JSX for the Hairstyle preset gallery */} <div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-4 mt-4"> {hairstylePresets.map((style) => { const isSelected = selectedHairstylePrompt === style.prompt; return ( <div key={style.name} className={`cursor-pointer rounded-lg overflow-hidden border-2 transition-all group ${ isSelected ? 'border-blue-500 shadow-md' : 'border-transparent hover:border-gray-300' }`} // This is the core logic: click sets the prompt in both state variables onClick={() => { setHairstyleTextPrompt(style.prompt); setSelectedHairstylePrompt(style.prompt); }} > <img src={style.imageUrl} alt={style.name} className="w-full h-20 object-cover group-hover:opacity-90" /> <p className="text-center text-xs p-1 bg-gray-100 truncate">{style.name}</p> </div> ); })} </div> </div> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tip:</h4> <p className="text-xs text-blue-700"> For best results, use a clear, front-facing photo with good lighting. </p> </div> </div> )} {/* AI Image Upscaler specific controls */} {tool.id === 'ai-image-upscaler' && selectedImage.preview && ( <div className="space-y-4"> {/* Display Image Dimensions */} {imageDimensions && ( <div className="bg-gray-50 border border-gray-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-gray-800 mb-1">Current Image Size:</h4> <p className="text-sm text-gray-600">{imageDimensions.width} x {imageDimensions.height}px</p> </div> )} {/* Upscale Factor Selection */} <div> <label className="block text-sm font-medium text-gray-700 mb-3"> Select Upscale Factor </label> <div className="flex gap-3"> <button type="button" onClick={() => setUpscaleFactor(2)} disabled={!availableUpscaleOptions.includes(2)} className={`px-4 py-2 rounded-md border transition-colors ${ upscaleFactor === 2 ? 'bg-blue-500 text-white border-blue-500' : availableUpscaleOptions.includes(2) ? 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' : 'bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed' }`} > 2X </button> <button type="button" onClick={() => setUpscaleFactor(4)} disabled={!availableUpscaleOptions.includes(4)} className={`px-4 py-2 rounded-md border transition-colors ${ upscaleFactor === 4 ? 'bg-blue-500 text-white border-blue-500' : availableUpscaleOptions.includes(4) ? 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' : 'bg-gray-100 text-gray-400 border-gray-200 cursor-not-allowed' }`} > 4X </button> </div> {availableUpscaleOptions.length === 0 && ( <p className="text-sm text-red-600 mt-2"> Image is too large for upscaling. Maximum size is 2048px on the longest side. </p> )} {availableUpscaleOptions.length === 1 && availableUpscaleOptions[0] === 2 && ( <p className="text-sm text-amber-600 mt-2"> Only 2X upscaling is available for images larger than 1024px on the longest side. </p> )} </div> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tip:</h4> <p className="text-xs text-blue-700"> AI upscaling works best on photos and detailed images. The larger the upscale factor, the longer the processing time. </p> </div> </div> )} {/* AI Filter specific controls */} {tool.id === 'ai-filter' && ( <div className="space-y-4"> {/* Category Selection */} <div> <label className="block text-sm font-medium text-gray-700 mb-3"> Filter Category </label> <div className="flex flex-wrap gap-2"> {filterCategories.map((category) => ( <button key={category} type="button" onClick={() => { setFilterSelectedCategory(category); setFilterSelectedStyle(null); // Reset selected style when category changes }} className={`px-3 py-2 rounded-md border text-sm transition-colors ${ filterSelectedCategory === category ? 'bg-blue-500 text-white border-blue-500' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50' }`} > {category} </button> ))} </div> </div> {/* Style Selection */} <div> <div className="flex items-center justify-between mb-3"> <label className="block text-sm font-medium text-gray-700"> Choose Style </label> {filterSelectedStyle && ( <button type="button" onClick={handleFilterClearSelection} className="flex items-center space-x-1 text-xs text-gray-500 hover:text-gray-700 transition-colors" > <X className="w-3 h-3" /> <span>Clear Selection</span> </button> )} </div> <div className="grid grid-cols-2 md:grid-cols-3 gap-3"> {aiFilterStyles .filter(style => style.category === filterSelectedCategory) .map((style) => ( <div key={style.id} onClick={() => { setFilterSelectedStyle(style); setFilterUseCustom(false); }} className={`cursor-pointer border-2 rounded-lg overflow-hidden transition-all relative group ${ filterSelectedStyle?.id === style.id ? 'border-blue-500 ring-2 ring-blue-200' : 'border-gray-200 hover:border-gray-300' }`} > <img src={style.imageUrl} alt={style.name} className="w-full h-24 object-cover" onError={(e) => { // Fallback for broken images const target = e.target as HTMLImageElement; target.src = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2Y3ZjdmNyIvPjx0ZXh0IHg9IjUwIiB5PSI1NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmaWxsPSIjOTk5IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5TdHlsZTwvdGV4dD48L3N2Zz4='; }} /> {filterSelectedStyle?.id === style.id && ( <button type="button" onClick={(e) => { e.stopPropagation(); handleFilterClearSelection(); }} className="absolute top-1 right-1 p-1 bg-white rounded-full shadow-md hover:bg-gray-50 transition-colors" title="Clear Selection" > <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-xcircle text-gray-600"> <circle cx="12" cy="12" r="10"></circle> <path d="m15 9-6 6"></path> <path d="m9 9 6 6"></path> </svg> </button> )} <div className="p-2"> <p className="text-xs font-medium text-gray-800 truncate">{style.name}</p> </div> </div> )) } </div> </div> {/* Custom Style Option */} <div className="border-t pt-4"> <div className="flex items-center space-x-2 mb-3"> <input type="checkbox" id="use-custom-filter" checked={filterUseCustom} onChange={(e) => { setFilterUseCustom(e.target.checked); if (e.target.checked) { setFilterSelectedStyle(null); } }} className="rounded border-gray-300 text-blue-600 focus:ring-blue-500" /> <label htmlFor="use-custom-filter" className="text-sm font-medium text-gray-700"> Use Custom Style </label> </div> {filterUseCustom && ( <div className="space-y-3"> {/* Custom Style Image Upload */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Upload Style Image (Optional) </label> <input type="file" accept="image/jpeg,image/png" onChange={(e) => { const file = e.target.files?.[0]; setFilterCustomStyleImage(file || null); }} className="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" /> </div> {/* Text Prompt */} <div> <label className="block text-sm font-medium text-gray-700 mb-2"> Text Prompt </label> <textarea value={filterTextPrompt} onChange={(e) => setFilterTextPrompt(e.target.value)} placeholder="Describe the style you want to apply..." rows={3} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" /> </div> </div> )} </div> <div className="bg-blue-50 border border-blue-200 rounded-lg p-3"> <h4 className="text-sm font-medium text-blue-800 mb-2">๐Ÿ’ก Tip:</h4> <p className="text-xs text-blue-700"> Choose from preset styles for quick results, or use custom style with text prompts for unique artistic effects. </p> </div> </div> )} <Button data-scroll-target="generate-button" onClick={ tool.id === 'ai-cleanup' ? handleAICleanupGenerate : tool.id === 'watermark-remover' ? handleAIWatermarkRemoverGenerate : tool.id === 'ai-expand' ? handleAIExpandGenerate : tool.id === 'ai-replace' ? handleAIReplaceGenerate : tool.id === 'ai-cartoon' ? handleAICartoonGenerate : tool.id === 'ai-caricature' ? handleAICaricatureGenerate : tool.id === 'ai-avatar' ? handleAIAvatarGenerate : tool.id === 'ai-portrait' ? handleAIPortraitGenerate : tool.id === 'ai-face-swap' ? handleAIFaceSwapGenerate : tool.id === 'ai-product-photoshoot' ? handleAIProductPhotoshootGenerate : tool.id === 'ai-background-generator' ? handleAIBackgroundGeneratorGenerate : tool.id === 'ai-image-generator' ? handleAIImageGeneratorGenerate : tool.id === 'ai-outfit' ? handleAIOutfitGenerate : tool.id === 'ai-image-to-image' ? handleAIImageToImageGenerate : tool.id === 'ai-sketch-to-image' ? handleAISketchToImageGenerate : tool.id === 'ai-hairstyle' ? handleAIHairstyleGenerate : tool.id === 'ai-image-upscaler' ? handleAIUpscalerGenerate : tool.id === 'ai-filter' ? handleAIFilterGenerate : handleProcessImage } disabled={ processedImage.isLoading || (tool.id !== 'ai-image-generator' && tool.id !== 'ai-face-swap' && tool.id !== 'ai-image-to-image' && tool.id !== 'ai-sketch-to-image' && !selectedImage.file) || (tool.id === 'ai-replace' && !textPrompt.trim()) || (tool.id === 'ai-background-generator' && !backgroundTextPrompt.trim()) || (tool.id === 'ai-image-generator' && !imageGeneratorTextPrompt.trim()) || (tool.id === 'ai-cartoon' && !(selectedPresetUrl || cartoonStyleImage?.name)) || (tool.id === 'ai-caricature' && !caricatureSelectedStyle && !caricatureCustomStyleImage) || (tool.id === 'ai-avatar' && !avatarSelectedStyle && !avatarCustomStyleImage) || (tool.id === 'ai-portrait' && !portraitSelectedStyle && !portraitCustomStyleImage) || (tool.id === 'ai-face-swap' && (!faceSwapTargetImage.file || (!selectedFaceSwapPreset && !faceSwapSourceImage.file))) || (tool.id === 'ai-product-photoshoot' && !selectedProductStyle && !productCustomStyleImage && !productTextPrompt) || (tool.id === 'ai-outfit' && (!selectedImage.file || !outfitTextPrompt.trim())) || (tool.id === 'ai-image-to-image' && (!i2iMainImage.file || !i2iTextPrompt.trim())) || (tool.id === 'ai-sketch-to-image' && ( (s2iInputMode === 'upload' && !s2iSketchImage.file) || !s2iTextPrompt.trim() )) || (tool.id === 'ai-hairstyle' && (!selectedImage.file || !hairstyleTextPrompt.trim())) || (tool.id === 'ai-image-upscaler' && (!selectedImage.file || availableUpscaleOptions.length === 0)) || (tool.id === 'ai-filter' && (!selectedImage.file || (!filterSelectedStyle && !filterCustomStyleImage && !filterTextPrompt.trim()))) } className="w-full" > {processedImage.isLoading ? ( <> <Loader className="w-4 h-4 mr-2 animate-spin" /> Generating... </> ) : ( `Generate ${tool.name}` )} </Button> </div> <div className="space-y-4" data-scroll-target="result-container"> <h2 className="text-xl font-semibold">Result</h2> {processedImage.isLoading ? ( <div className="border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center"> <Loader className="w-10 h-10 text-blue-500 animate-spin mb-4" /> <p className="text-gray-700">Processing your image...</p> </div> ) : processedImage.url ? ( <div className="space-y-4"> <div className="border rounded-lg overflow-hidden"> <img src={processedImage.url} alt="Processed result" className="w-full h-auto" /> </div> <Button fullWidth onClick={handleDownload} leftIcon={<Download size={18} />} > Download Result </Button> </div> ) : processedImage.error ? ( <div className="border-2 border-dashed border-red-300 bg-red-50 rounded-lg p-8 flex flex-col items-center justify-center"> <p className="text-red-600 mb-2">Error</p> <p className="text-gray-700 text-center">{processedImage.error}</p> </div> ) : ( <div className="border-2 border-dashed border-gray-300 rounded-lg p-8 flex flex-col items-center justify-center"> <p className="text-gray-500">Upload and process an image to see the result here</p> </div> )} </div> </div> {/* Tool Recommendations Section */} <ToolRecommendations currentToolId={tool.id} hasResult={!!processedImage.url} /> <div className="mt-12 bg-gray-50 rounded-lg p-6"> <h2 className="text-xl font-semibold mb-4">About {tool.name}</h2> <p className="text-gray-700 mb-4"> Our {tool.name.toLowerCase()} tool uses advanced AI algorithms to {getToolDescription(tool)}. This tool is perfect for photographers, designers, social media managers, and anyone who wants to enhance their images. </p> <p className="text-gray-700"> Unlike other tools, ModernPhotoTools offers this service completely free with no watermarks. Try it now and see the difference! </p> </div> </div> </div> </> ); }; // Helper function to generate more detailed descriptions for each tool function getToolDescription(tool: Tool): string { switch (tool.id) { case 'remove-background': return 'automatically detect and remove backgrounds from any image, leaving you with a clean subject that can be placed on any new background'; case 'ai-cleanup': return 'automatically detect and fix imperfections, remove unwanted objects, and enhance the overall quality of your photos. Simply paint over the areas you want to remove and let AI intelligently fill in the space'; case 'watermark-remover': return 'automatically detect and remove watermarks, logos, and text overlays from uploaded images โ€” no manual selection needed'; case 'ai-expand': return 'intelligently expand your images beyond their original boundaries, adding realistic content that matches the original image'; case 'ai-replace': return 'replace objects or areas in your images with AI-generated content that seamlessly blends with the rest of the image'; case 'ai-cartoon': return 'transform your photos into cartoon-style artwork with various artistic styles'; case 'ai-portrait': return 'create realistic portrait transformations with professional styling and artistic effects'; case 'ai-face-swap': return 'seamlessly swap faces between two images, allowing you to replace faces in photos with either preset faces or custom source images'; case 'ai-product-photoshoot': return 'create professional product photography with AI-generated backgrounds and lighting that make your products look stunning'; case 'ai-background-generator': return 'generate stunning new backgrounds for your images using AI, perfect for creating professional-looking photos with custom scenes'; case 'ai-outfit': return 'virtually change clothing on people in photos using AI, allowing you to transform outfits with simple text descriptions'; case 'ai-image-to-image': return 'transform any image based on text prompts and optional style references, with adjustable strength controls for precise artistic control'; case 'ai-hairstyle': return 'virtually try on new hairstyles by uploading a photo and describing the desired look, perfect for experimenting with different hair styles and colors'; case 'ai-image-upscaler': return 'enhance image resolution and quality using advanced AI upscaling technology, supporting 2x and 4x enlargement while preserving fine details and sharpness'; default: return 'transform and enhance your images with professional-quality results'; } } export default ToolPage;
๐Ÿ“„ ToolsPage.tsx
import React from 'react'; import SEO from '../components/ui/SEO'; import VideoToolCard from '../components/ui/VideoToolCard'; import { tools } from '../data/tools'; import { getVideoUrl } from '../utils/videoMapping'; import '../styles/video-tool-card.css'; const ToolsPage: React.FC = () => { return ( <> <SEO title="All Photo Editing Tools" description="Explore our complete collection of AI-powered photo editing tools. Transform, enhance, and perfect your images with professional results in seconds." /> <div className="min-h-screen bg-gray-50 py-12 px-[10%]"> <div className="w-full mx-auto"> <div className="max-w-3xl mx-auto text-center mb-12"> <h1 className="text-4xl font-bold text-gray-900 mb-4"> All Photo Editing Tools </h1> <p className="text-gray-600"> Discover our complete collection of AI-powered tools to transform your photos </p> </div> <div className="row row-cols-1 row-cols-sm-2 row-cols-md-3"> {tools.map((tool) => ( <div key={tool.id} className="col mt-10 px-3 apiSectionBox"> <VideoToolCard tool={tool} videoUrl={getVideoUrl(tool.name)} /> </div> ))} </div> </div> </div> </> ); }; export default ToolsPage;
๐Ÿ“ routes
๐Ÿ“ scripts
๐Ÿ“„ runImageMappingTest.ts
#!/usr/bin/env node /** * Standalone script to run image mapping tests * Usage: npm run test:image-mapping */ import { runAllTests } from '../utils/testImageMapping'; async function main() { try { console.log('๐ŸŽฏ Image Mapping Test Suite'); console.log('============================\n'); await runAllTests(); console.log('\n๐ŸŽ‰ Test suite completed successfully!'); process.exit(0); } catch (error) { console.error('\n๐Ÿ’ฅ Test suite failed:', error); process.exit(1); } } // Run the script main(); export default main;
๐Ÿ“ services
๐Ÿ“ styles
๐Ÿ“„ video-tool-card.css
@import url('https://fonts.googleapis.com/css?family=Inter:100,200,300,400,500,600,700,800,900&display=swap'); @font-face { font-family: Inter semibold; src: url(https://static.lightxeditor.com/assets/font/Inter/static/Inter-SemiBold.ttf) format("truetype"); font-display: swap; } /* CSS Variables */ :root { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; --bs-link-hover-color-rgb: 41, 52, 203; --bs-link-color-rgb: var(--bs-link-hover-color-rgb); --bs-bg-opacity: 1; --bs-text-opacity: 1; --bs-white-rgb: 255, 255, 255; --bs-black-rgb: 0, 0, 0; --bs-body-font-family: Inter; --bs-body-font-size: .8125rem; --bs-body-font-weight: 400; --bs-body-line-height: 1.5; --bs-body-color: #272B34; --bs-body-bg: #fff; --bs-heading-color: inherit; --bs-border-radius-xxl: 2rem; --bs-border-radius-2xl: var(--bs-border-radius-xxl); } * { box-sizing: border-box; } *,:before,:after { box-sizing: border-box; } /* Container and responsive breakpoints */ @media all { .container { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; width: 100%; padding-right: calc(var(--bs-gutter-x) * .5); padding-left: calc(var(--bs-gutter-x) * .5); margin-right: auto; margin-left: auto; } } @media (min-width: 576px) { .container { max-width: 540px; } } @media (min-width: 768px) { .container { max-width: 720px; } } @media (min-width: 992px) { .container { max-width: 960px; } } @media (min-width: 1200px) { .container { max-width: 1140px; } } /* Width and margin utilities */ @media all { .w-100 { width: 100%!important; } .mx-auto { margin-right: auto!important; margin-left: auto!important; } } @media (min-width: 576px) { .col-sm-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 768px) { .col-md-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 992px) { .col-lg-12 { flex: 0 0 auto; width: 100%; } } @media (min-width: 1200px) { .col-xl-12 { flex: 0 0 auto; width: 100%; } } /* Row and grid system */ @media all { .row { --bs-gutter-x: 1.5rem; --bs-gutter-y: 0; display: flex; flex-wrap: wrap; margin-top: calc(-1 * var(--bs-gutter-y)); margin-right: calc(-.5 * var(--bs-gutter-x)); margin-left: calc(-.5 * var(--bs-gutter-x)); } .row > * { flex-shrink: 0; width: 100%; max-width: 100%; padding-right: calc(var(--bs-gutter-x) * .5); padding-left: calc(var(--bs-gutter-x) * .5); margin-top: var(--bs-gutter-y); } .col { flex: 1 0 0; } .row-cols-1 > * { flex: 0 0 auto; width: 100%; } } @media (min-width: 576px) { .row-cols-sm-2 > * { flex: 0 0 auto; width: 50%; } } @media (min-width: 768px) { .row-cols-md-3 > * { flex: 0 0 auto; width: 33.33333333%; } } /* Tailwind utility classes for new spacing */ .mt-10 { margin-top: 2.5rem; /* 40px */ } .px-3 { padding-left: 0.75rem; /* 12px */ padding-right: 0.75rem; /* 12px */ } /* API Section Box with hover effect - optimized for compact layout */ @media (min-width: 577px) { .apiSectionBox:hover { transform: translateY(-6px); /* Reduced from -8px for subtler effect */ transition: all .3s ease; } } /* Links */ a { color: rgba(var(--bs-link-color-rgb),var(--bs-link-opacity, 1)); text-decoration: none; } a:hover { --bs-link-color-rgb: var(--bs-link-hover-color-rgb); text-decoration: none; } /* Background and border radius */ .bg-white { --bs-bg-opacity: 1; background-color: rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important; } .rounded-20 { border-radius: 20px!important; } /* Video styling - letterboxed display with 3.5x scale down */ .responsive { width: 100%; height: auto; aspect-ratio: 9/16; object-fit: contain; /* Changed from cover to contain for letterboxing */ max-height: 259.1px; /* Scaled down by 3.5x from 200px */ max-width: 137.1px; /* Scaled down proportionally for 9:16 aspect ratio */ margin: 0 auto; /* Center the video */ background-color: #000; /* Black background for letterboxing effect */ } /* Card body - optimized padding */ .card-body { flex: 1 1 auto; padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x); color: var(--bs-card-color); } .p-3 { padding: 0.75rem!important; /* Reduced from 1rem for more compact layout */ } .card-body { padding: 0; } /* Typography - optimized for compact layout */ h3 { margin-top: 0; margin-bottom: .25rem; /* Reduced from .5rem */ font-weight: 500; line-height: 1.1; /* Reduced from 1.2 for tighter spacing */ color: var(--bs-heading-color); font-size: calc(1.1rem + .15vw); /* Slightly smaller than original */ } @media (min-width: 1200px) { h3 { font-size: 1.25rem; /* Reduced from 1.421875rem */ } } h3 { font-size: 20px; /* Reduced from 24px */ line-height: 24px; /* Reduced from 29.96px */ } .mb-0 { margin-bottom: 0!important; } .pb-2 { padding-bottom: .25rem!important; /* Reduced from .5rem */ } .text-black { --bs-text-opacity: 1; color: rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important; } .text-xxl { font-size: 1.1rem!important; /* Reduced from 1.25rem */ } .text-semi { font-family: Inter semibold!important; } .text-black { color: #000!important; } p { margin-top: 0; margin-bottom: 0.5rem; /* Reduced from 1rem */ } p { font-family: Inter; } p { margin-bottom: 0; } p { font-size: 14px; /* Reduced from 16px */ line-height: 20px; /* Reduced from 25.6px */ font-weight: 400; } .text-lg { font-size: 0.875rem!important; /* Reduced from 1rem */ } /* Flexbox utilities */ .d-flex { display: flex!important; } .justify-content-between { justify-content: space-between!important; } .align-items-center { align-items: center!important; } /* New item badge */ .new_item { position: relative; padding-right: 13px; } .new_item:after,.new_badge:after { content: url(https://static.lightxeditor.com/assets/icons/newbadge.svg); position: relative; top: 3px; padding-left: 4px; }
๐Ÿ“„ supabaseClient.ts
import { createClient } from '@supabase/supabase-js'; const supabaseUrl = 'https://waktyxmmvkzmzkagekcq.supabase.co'; const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Indha3R5eG1tdmt6bXprYWdla2NxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDg3ODI0NTAsImV4cCI6MjA2NDM1ODQ1MH0._FBlnWAP4wZHZhHlL4Fxufx1n3WFDAFv7hxlMH0ZPrs'; export const supabase = createClient(supabaseUrl, supabaseAnonKey);
๐Ÿ“ types
๐Ÿ“„ index.ts
export interface Tool { id: string; name: string; description: string; icon: string; path: string; apiEndpoint: string; } export interface ImageFile { file: File | null; preview: string | null; } export interface ProcessedImage { url: string | null; isLoading: boolean; error: string | null; } export interface FaceSwapStyle { name: string; imageUrl: string; gender: 'male' | 'female' | 'any'; }
๐Ÿ“„ raw.d.ts
declare module '*.txt?raw' { const content: string; export default content; }
๐Ÿ“ utils
๐Ÿ“„ api.ts
// src/utils/api.ts import { getSiteOrigin } from './siteConfig'; // Debug utility to control console output const DEBUG_MODE = import.meta.env.DEV || ( typeof window !== "undefined" && typeof window.localStorage !== "undefined" && window.localStorage.getItem('debug') === 'true' ); const debugLog = (...args: any[]) => { if (DEBUG_MODE) { console.log(...args); } }; // Helper function to safely determine environment and base URL for SSR compatibility function getEnvironmentConfig() { const baseUrl = getSiteOrigin(); const isProduction = typeof window !== 'undefined' ? (window.location.hostname !== 'localhost' && window.location.hostname !== '127.0.0.1') : (import.meta.env.PROD || process.env.NODE_ENV === 'production'); return { isProduction, baseUrl }; } // Add this helper function inside src/utils/api.ts export async function convertUrlToBlob(url: string): Promise<Blob> { const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to fetch image from URL: ${url}`); } const blob = await response.blob(); return blob; } export async function fetchOptimizedPrompt(basePrompt: string, framework: string) { const { baseUrl } = getEnvironmentConfig(); const res = await fetch(`${baseUrl}/api/optimize-prompt`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ basePrompt, framework }) }); return await res.json(); } // AI Cleanup V2 API Functions export async function uploadImageAndGetUrl(file: File): Promise<string> { try { // Use the Netlify function URL in production, fallback to local proxy for development const { baseUrl } = getEnvironmentConfig(); // Step 1: Get upload URL const uploadUrlResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/uploadImageUrl', body: { uploadType: 'imageUrl', // <--- THIS IS THE CORRECTED LINE size: file.size, contentType: file.type, } }), }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; // Step 2: Upload image to the presigned URL const uploadImageResponse = await fetch(uploadImage, { method: 'PUT', headers: { 'Content-Type': file.type, }, body: file, }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } // Clean the returned URL by removing any potential backticks, spaces, and other unwanted characters const cleanImageUrl = imageUrl.trim().replace(/[\`\s'"]/g, ''); return cleanImageUrl; } catch (error) { debugLog('Error uploading image:', error); throw error; } } export async function startCleanupJob({ originalImageUrl, maskedImageUrl }: { originalImageUrl: string; maskedImageUrl: string }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/cleanup-picture', // NOTE: Endpoint is v2 for job submission as per some docs, changed from v2 body: { imageUrl: originalImageUrl, maskedImageUrl: maskedImageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cleanup job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cleanup job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting cleanup job:', error); throw error; } } // Watermark Remover job โ€“ implemented via the same cleanup endpoint // This keeps the API surface explicit while leveraging existing backend behavior. export async function startWatermarkRemoverJob({ imageUrl }: { imageUrl: string }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/watermark-remover', body: { imageUrl: imageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start watermark remover job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid watermark remover job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting watermark remover job:', error); throw error; } } // Dedicated status poller for Watermark Remover (API v2) per tool documentation export async function pollWatermarkJobUntilComplete(orderId: string): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); let resultUrl = ''; let retries = 0; const maxRetries = 5; // per DOC: maxRetriesAllowed = 5 const pollIntervalMs = 3000; // per DOC: poll every 3 seconds while (!resultUrl && retries < maxRetries) { if (retries > 0) { await new Promise((resolve) => setTimeout(resolve, pollIntervalMs)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/order-status', body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === 'FAIL') { const errorMessage = orderStatus.message || 'Unknown error'; const errorDescription = orderStatus.description || ''; const statusCode = orderStatus.statusCode; console.error('LightX API Error:', { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === 'active' && orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === 'failed') { const errorMessage = orderStatus.body.message || 'Unknown error'; const errorDescription = orderStatus.body.description || ''; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } else { // status could be 'init' per DOC; continue polling } retries++; } if (!resultUrl) { throw new Error('Processing timeout: The image is taking longer than expected to process. Please try again later.'); } debugLog('Watermark removal completed successfully:', resultUrl); return resultUrl; } catch (error) { console.error('Error polling watermark job status:', error); throw error; } } export async function checkOrderStatus(orderId: string): Promise<any> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/order-status', // NOTE: Using v2 for status check, consistent with remove-bg body: { orderId: orderId, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to check order status: ${response.status} - ${errorText}`); } const data = await response.json(); return data; } catch (error) { console.error('Error checking order status:', error); throw error; } } export async function pollJobUntilComplete(orderId: string): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); let resultUrl = ''; let retries = 0; const maxRetries = 20; const basePollInterval = 3000; while (!resultUrl && retries < maxRetries) { if (retries > 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15000); debugLog(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) => setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/order-status', body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === 'FAIL') { const errorMessage = orderStatus.message || 'Unknown error'; const errorDescription = orderStatus.description || ''; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = 'The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.'; } console.error('LightX API Error:', { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === 'active' && orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === 'failed') { const errorMessage = orderStatus.body.message || 'Unknown error'; const errorDescription = orderStatus.body.description || ''; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } retries++; } if (!resultUrl) { throw new Error('Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.'); } debugLog('Image processing completed successfully:', resultUrl); return resultUrl; } catch (error) { console.error('Error polling job status:', error); throw error; } } export async function pollV1JobUntilComplete(orderId: string): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); let resultUrl = ''; let retries = 0; const maxRetries = 5; const pollIntervalMs = 3000; while (!resultUrl && retries < maxRetries) { if (retries > 0) { await new Promise((resolve) => setTimeout(resolve, pollIntervalMs)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v1/order-status', body: { orderId }, }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === 'active' && orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === 'failed') { const errorMessage = orderStatus.body.message || 'Unknown error'; const errorDescription = orderStatus.body.description || ''; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } retries++; } if (!resultUrl) { throw new Error('Processing timeout: The image is taking longer than expected to process. Please try again later.'); } return resultUrl; } catch (error) { console.error('Error polling v1 job status:', error); throw error; } } // NOTE: Keeping the processImage function for other tools as-is export async function processImage(toolApiEndpoint: string, imageFile: File): Promise<string> { try { // Validate image before processing const maxFileSize = 10 * 1024 * 1024; // 10MB const supportedTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/webp']; if (imageFile.size > maxFileSize) { throw new Error('Image file is too large. Please use an image smaller than 10MB.'); } if (!supportedTypes.includes(imageFile.type.toLowerCase())) { throw new Error('Unsupported image format. Please use JPG, PNG, or WebP.'); } debugLog('Image validation passed:', { size: `${(imageFile.size / 1024 / 1024).toFixed(2)}MB`, type: imageFile.type, name: imageFile.name }); // Use the Netlify function URL in production, fallback to local proxy for development const { isProduction, baseUrl } = getEnvironmentConfig(); debugLog('Environment detection:', { isProduction, baseUrl }); debugLog('Starting image processing...'); // Step 1: Get upload URL from LightXEditor via proxy const uploadUrlResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/uploadImageUrl', body: { uploadType: 'imageUrl', size: imageFile.size, contentType: imageFile.type, } }), }); if (!uploadUrlResponse.ok) { const errorText = await uploadUrlResponse.text(); throw new Error(`Failed to get upload URL: ${uploadUrlResponse.status} - ${errorText}`); } const uploadData = await uploadUrlResponse.json(); if (!uploadData.body || !uploadData.body.uploadImage || !uploadData.body.imageUrl) { throw new Error(`Invalid upload URL response: ${JSON.stringify(uploadData)}`); } const { uploadImage, imageUrl } = uploadData.body; debugLog('Upload successful, imageUrl: ', imageUrl); // Step 2: Upload image directly to S3 using the pre-signed URL const uploadImageResponse = await fetch(uploadImage, { method: 'PUT', headers: { 'Content-Type': imageFile.type, 'Content-Length': imageFile.size.toString(), }, body: imageFile, }); if (!uploadImageResponse.ok) { const errorText = await uploadImageResponse.text(); throw new Error(`Failed to upload image: ${uploadImageResponse.status} - ${errorText}`); } debugLog('S3 upload successful, waiting for image to be available...'); await new Promise(resolve => setTimeout(resolve, 2000)); // Wait 2 seconds // Step 3: Call remove-background API with retry logic let removeBackgroundResponse; let backgroundRemovalData; let bgRetries = 0; const maxBgRetries = 3; while (bgRetries < maxBgRetries) { try { removeBackgroundResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/remove-background', body: { imageUrl: imageUrl, } }), }); if (!removeBackgroundResponse.ok) { const errorText = await removeBackgroundResponse.text(); throw new Error(`Failed to remove background: ${removeBackgroundResponse.status} - ${errorText}`); } backgroundRemovalData = await removeBackgroundResponse.json(); break; } catch (error) { bgRetries++; if (bgRetries >= maxBgRetries) { throw error; } debugLog(`Remove background attempt ${bgRetries} failed, retrying in 2 seconds...`); await new Promise(resolve => setTimeout(resolve, 2000)); } } if (!backgroundRemovalData || !backgroundRemovalData.body || !backgroundRemovalData.body.orderId) { throw new Error(`Invalid remove background response: ${JSON.stringify(backgroundRemovalData)}`); } const { orderId } = backgroundRemovalData.body; // Step 4: Poll for order status using V2 endpoint with exponential backoff let resultUrl = ''; let retries = 0; const maxRetries = 20; const basePollInterval = 3000; while (!resultUrl && retries < maxRetries) { if (retries > 0) { const waitTime = Math.min(basePollInterval * Math.pow(1.5, retries - 1), 15000); debugLog(`Waiting ${waitTime}ms before retry ${retries}...`); await new Promise((resolve) => setTimeout(resolve, waitTime)); } const orderStatusResponse = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/order-status', body: { orderId: orderId, } }), }); if (!orderStatusResponse.ok) { const errorText = await orderStatusResponse.text(); throw new Error(`Failed to get order status: ${orderStatusResponse.status} - ${errorText}`); } const orderStatus = await orderStatusResponse.json(); if (orderStatus.status === 'FAIL') { const errorMessage = orderStatus.message || 'Unknown error'; const errorDescription = orderStatus.description || ''; const statusCode = orderStatus.statusCode; let userFriendlyMessage = errorMessage; if (statusCode === 55044) { userFriendlyMessage = 'The image could not be processed. This may be due to complex background, image quality, or temporary service issues. Please try with a different image or try again later.'; } console.error('LightX API Error:', { statusCode, errorMessage, errorDescription }); throw new Error(`Image processing failed: ${userFriendlyMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } if (!orderStatus.body) { throw new Error(`Invalid order status response: ${JSON.stringify(orderStatus)}`); } if (orderStatus.body.status === 'active' && orderStatus.body.output) { resultUrl = orderStatus.body.output; break; } else if (orderStatus.body.status === 'failed') { const errorMessage = orderStatus.body.message || 'Unknown error'; const errorDescription = orderStatus.body.description || ''; throw new Error(`Image processing failed: ${errorMessage}${errorDescription ? ` - ${errorDescription}` : ''}`); } retries++; } if (!resultUrl) { throw new Error('Processing timeout: The image is taking longer than expected to process. This may be due to high server load or image complexity. Please try again later.'); } debugLog('Image processing completed successfully:', resultUrl); return resultUrl; } catch (error) { console.error('Error processing image:', error); throw error; } } // AI Expand Photo function export async function startExpandJob({ imageUrl, padding }: { imageUrl: string; padding: { top: number; left: number; bottom: number; right: number; } }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/expand-photo', // The correct endpoint for this tool body: { imageUrl: imageUrl, topPadding: padding.top, leftPadding: padding.left, bottomPadding: padding.bottom, rightPadding: padding.right, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start expand job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid expand job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting expand job:', error); throw error; } } // AI Replace function export async function startReplaceJob({ originalImageUrl, maskedImageUrl, prompt }: { originalImageUrl: string; maskedImageUrl: string; prompt: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); // DEFINE THE REQUEST BODY SEPARATELY const requestPayload = { endpoint: 'v2/replace', body: { imageUrl: originalImageUrl, maskedImageUrl: maskedImageUrl, textPrompt: prompt, } }; const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, // USE THE VARIABLE HERE body: JSON.stringify(requestPayload) }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start replace job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid replace job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting replace job:', error); throw error; } } export async function startProductPhotoshootJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/product-photoshoot', // The correct endpoint for this tool body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start product photoshoot job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid product photoshoot job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting product photoshoot job:', error); throw error; } } export async function startCartoonJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/cartoon', body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start cartoon job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid cartoon job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting cartoon job:', error); throw error; } } export async function startCaricatureJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/caricature', body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start caricature job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid caricature job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting caricature job:', error); throw error; } } export async function startAvatarJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/avatar', body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start avatar job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid avatar job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting avatar job:', error); throw error; } } export async function startBackgroundGeneratorJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/background-generator', body: { imageUrl: imageUrl, textPrompt: textPrompt } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start background generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid background generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting background generator job:', error); throw error; } } export async function startImageGeneratorJob({ textPrompt, width, height }: { textPrompt: string; width?: number; height?: number; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/text2image', body: { textPrompt: textPrompt, width: width, height: height } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image generator job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image generator job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting image generator job:', error); throw error; } } export async function startPortraitJob({ imageUrl, styleImageUrl, textPrompt }: { imageUrl: string; styleImageUrl?: string; textPrompt?: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/portrait', body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl || "", textPrompt: textPrompt || "" } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start portrait job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid portrait job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting portrait job:', error); throw error; } } export async function startFaceSwapJob({ imageUrl, styleImageUrl }: { imageUrl: string; styleImageUrl: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/face-swap', body: { imageUrl: imageUrl, styleImageUrl: styleImageUrl, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start face swap job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid face swap job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting face swap job:', error); throw error; } } export async function startOutfitJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ endpoint: 'v2/outfit', body: { imageUrl: imageUrl, textPrompt: textPrompt, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start outfit job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid outfit job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting outfit job:', error); throw error; } } interface ImageToImageParams { imageUrl: string; textPrompt: string; styleImageUrl?: string; strength?: number; styleStrength?: number; } export async function startImageToImageJob(params: ImageToImageParams): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v1/image2image', body: { imageUrl: params.imageUrl, strength: params.strength ?? 0.5, textPrompt: params.textPrompt, ...(params.styleImageUrl && { styleImageUrl: params.styleImageUrl }), ...(params.styleStrength !== undefined && { styleStrength: params.styleStrength }), } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start image-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid image-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting image-to-image job:', error); throw error; } } interface SketchToImageParams { imageUrl: string; // The user's sketch, either drawn or uploaded textPrompt: string; strength?: number; styleImageUrl?: string; styleStrength?: number; } export async function startSketchToImageJob(params: SketchToImageParams): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v2/sketch2image', // The correct endpoint for this tool body: params }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start sketch-to-image job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid sketch-to-image job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting sketch-to-image job:', error); throw error; } } export async function startHairstyleJob({ imageUrl, textPrompt }: { imageUrl: string; textPrompt: string; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v2/hairstyle', // The correct endpoint for this tool body: { imageUrl: imageUrl, textPrompt: textPrompt, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start hairstyle job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid hairstyle job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting hairstyle job:', error); throw error; } } export async function startUpscaleJob({ imageUrl, quality }: { imageUrl: string; quality: 2 | 4; }): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v2/upscale', // IMPORTANT: This is a v2 endpoint body: { imageUrl: imageUrl, quality: quality, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start upscale job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid upscale job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting upscale job:', error); throw error; } } interface AIFilterParams { imageUrl: string; styleImageUrl?: string; textPrompt: string; } export async function startAIFilterJob(params: AIFilterParams): Promise<string> { try { const { baseUrl } = getEnvironmentConfig(); const response = await fetch(`${baseUrl}/api/lightx-proxy`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ endpoint: 'v2/aifilter', // The correct endpoint for AI Filter body: { imageUrl: params.imageUrl, filterReferenceUrl: params.styleImageUrl || "", textPrompt: params.textPrompt, } }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to start AI filter job: ${response.status} - ${errorText}`); } const data = await response.json(); if (!data.body || !data.body.orderId) { throw new Error(`Invalid AI filter job response: ${JSON.stringify(data)}`); } return data.body.orderId; } catch (error) { console.error('Error starting AI filter job:', error); throw error; } }
๐Ÿ“„ blogLoader.ts
import { BlogArticle } from '../data/blogArticles'; // Use Vite's glob import to get all markdown files const blogModules = import.meta.glob('/content/blog/*.md', { as: 'raw', eager: true }); export interface BlogArticleWithContent extends BlogArticle { rawContent: string; } // Cache for parsed articles let articlesCache: BlogArticleWithContent[] | null = null; /** * Browser-compatible frontmatter parser */ function parseFrontmatter(content: string): { data: any; content: string } { const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/; const match = content.match(frontmatterRegex); if (!match) { return { data: {}, content }; } const [, yamlContent, markdownContent] = match; const data: any = {}; // Simple YAML parser for frontmatter const lines = yamlContent.split('\n'); let currentKey = ''; let inArray = false; let arrayItems: string[] = []; for (const line of lines) { const trimmed = line.trim(); if (trimmed && !trimmed.startsWith('#')) { // Handle array items if (trimmed.startsWith('- ')) { if (inArray) { arrayItems.push(trimmed.substring(2).trim().replace(/^["']|["']$/g, '')); } continue; } // If we were in an array, save it if (inArray && currentKey) { data[currentKey] = arrayItems; inArray = false; arrayItems = []; currentKey = ''; } const colonIndex = trimmed.indexOf(':'); if (colonIndex > 0) { const key = trimmed.substring(0, colonIndex).trim(); let value = trimmed.substring(colonIndex + 1).trim(); // Check if this is the start of an array if (value === '' || value === '[') { currentKey = key; inArray = true; arrayItems = []; continue; } // Handle inline arrays if (value.startsWith('[') && value.endsWith(']')) { const arrayContent = value.slice(1, -1); data[key] = arrayContent.split(',').map(item => item.trim().replace(/^["']|["']$/g, '')); continue; } // Remove quotes if present if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) { value = value.slice(1, -1); } data[key] = value; } } } // Handle final array if we ended in one if (inArray && currentKey) { data[currentKey] = arrayItems; } return { data, content: markdownContent }; } /** * Load and parse all blog articles from markdown files */ export async function loadBlogArticles(): Promise<BlogArticleWithContent[]> { if (articlesCache) { return articlesCache; } const articles: BlogArticleWithContent[] = []; for (const [path, content] of Object.entries(blogModules)) { try { // Parse frontmatter and content const { data, content: markdownContent } = parseFrontmatter(content as string); // Extract filename without extension for ID validation const filename = path.split('/').pop()?.replace('.md', '') || ''; // Create article object const article: BlogArticleWithContent = { id: data.id || filename, title: data.title || 'Untitled', excerpt: data.excerpt || '', content: markdownContent, rawContent: content as string, publishDate: data.publishDate || new Date().toISOString().split('T')[0], readTime: data.readTime || '5 min read', category: data.category || 'general', featuredImage: data.featuredImage || '/images/blog/default.svg', relatedTool: data.relatedTool, keywords: data.keywords ? (Array.isArray(data.keywords) ? data.keywords : [data.keywords]) : [] }; articles.push(article); } catch (error) { console.error(`Error parsing blog article at ${path}:`, error); } } // Sort articles by publish date (newest first) articles.sort((a, b) => new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()); articlesCache = articles; return articles; } /** * Get a single article by ID */ export async function getBlogArticleById(id: string): Promise<BlogArticleWithContent | undefined> { const articles = await loadBlogArticles(); return articles.find(article => article.id === id); } /** * Get articles by category */ export async function getBlogArticlesByCategory(category: 'general' | 'tools'): Promise<BlogArticleWithContent[]> { const articles = await loadBlogArticles(); return articles.filter(article => article.category === category); } /** * Get recent articles */ export async function getRecentBlogArticles(limit: number = 3): Promise<BlogArticleWithContent[]> { const articles = await loadBlogArticles(); return articles.slice(0, limit); } /** * Clear the articles cache (useful for development) */ export function clearBlogCache(): void { articlesCache = null; } /** * Get all article IDs for routing */ export async function getAllBlogArticleIds(): Promise<string[]> { const articles = await loadBlogArticles(); return articles.map(article => article.id); }
๐Ÿ“„ fileUtils.ts
// Convert file to base64 data URL export function fileToDataURL(file: File): Promise<string> { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => resolve(reader.result as string); reader.onerror = reject; reader.readAsDataURL(file); }); }
๐Ÿ“„ imageMapper.ts
import { tools } from '../data/tools'; export interface ImageMapping { toolId: string; toolName: string; imagePath: string; imageExists: boolean; altText: string; } export interface MappingResult { successful: ImageMapping[]; failed: { toolId: string; toolName: string; reason: string; }[]; summary: { totalTools: number; successfulMappings: number; failedMappings: number; }; } /** * Normalizes tool names to match potential image filenames * Handles various naming conventions and formats */ export function normalizeToolName(toolName: string): string[] { const normalized = toolName.toLowerCase() .replace(/[^a-z0-9\s-]/g, '') // Remove special characters except spaces and hyphens .replace(/\s+/g, '-') // Replace spaces with hyphens .replace(/-+/g, '-') // Replace multiple hyphens with single hyphen .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens // Generate multiple possible variations const variations = [ normalized, normalized.replace(/-/g, ''), // Remove all hyphens normalized.replace(/-/g, '_'), // Replace hyphens with underscores toolName.toLowerCase().replace(/\s+/g, ''), // Remove all spaces, keep original case pattern toolName.toLowerCase().replace(/\s+/g, '_'), // Replace spaces with underscores ]; // Remove duplicates return [...new Set(variations)]; } /** * Special mapping for tools where the filename doesn't match the tool name exactly */ const SPECIAL_FILENAME_MAPPINGS: Record<string, string> = { 'AI Caricature': 'AI Caricature Generator Tool.jpg', 'AI Expand': 'Ai Expand tool.jpg', 'AI Replace': 'AI Replace tool.jpg', 'Remove Background': 'Remove Background tool.jpg' }; /** * Generates possible image filenames based on tool ID and name */ export function generateImageFilenames(toolId: string, toolName: string): string[] { // Check for special mappings first if (SPECIAL_FILENAME_MAPPINGS[toolName]) { return [SPECIAL_FILENAME_MAPPINGS[toolName]]; } const filenames: string[] = []; // Use the tool name as-is for most cases const cleanName = toolName.replace(/^AI\s+/, ''); // Remove "AI " prefix if present // Most common pattern: "AI [Tool Name] Tool.jpg" (capital T) filenames.push(`AI ${cleanName} Tool.jpg`); // Alternative pattern: "AI [Tool Name] tool.jpg" (lowercase t) filenames.push(`AI ${cleanName} tool.jpg`); // Pattern with lowercase "Ai": "Ai [Tool Name] tool.jpg" filenames.push(`Ai ${cleanName} tool.jpg`); // Special case for Remove Background: "[Tool Name] tool.jpg" (no AI prefix) filenames.push(`${cleanName} tool.jpg`); // Fallback patterns filenames.push(`AI ${cleanName}.jpg`); filenames.push(`${cleanName}.jpg`); // Also try with the full tool name filenames.push(`${toolName} Tool.jpg`); filenames.push(`${toolName} tool.jpg`); filenames.push(`${toolName}.jpg`); return [...new Set(filenames)]; // Remove duplicates } /** * Checks if an image file exists in the tools images directory */ export async function checkImageExists(filename: string): Promise<boolean> { // In Node.js environment (for testing) if (typeof window === 'undefined') { const fs = await import('fs'); const path = await import('path'); try { const imagePath = path.join(process.cwd(), 'public', 'images', 'tools images', filename); return fs.existsSync(imagePath); } catch { return false; } } // In browser environment try { const response = await fetch(`/images/tools images/${filename}`, { method: 'HEAD' }); return response.ok; } catch { return false; } } /** * Finds the correct image file for a tool */ export async function findToolImage(toolId: string, toolName: string): Promise<string | null> { const possibleFilenames = generateImageFilenames(toolId, toolName); for (const filename of possibleFilenames) { if (await checkImageExists(filename)) { return filename; } } return null; } /** * Generates appropriate alt text for tool images */ export function generateAltText(toolName: string): string { return `${toolName} - AI-powered photo editing tool interface and features`; } /** * Creates a comprehensive mapping of all tools to their images */ export async function createToolImageMapping(): Promise<MappingResult> { const successful: ImageMapping[] = []; const failed: { toolId: string; toolName: string; reason: string; }[] = []; console.log('๐Ÿ” Starting tool image mapping process...'); console.log(`๐Ÿ“Š Total tools to process: ${tools.length}`); for (const tool of tools) { try { console.log(`๐Ÿ”„ Processing tool: ${tool.name} (ID: ${tool.id})`); const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { const mapping: ImageMapping = { toolId: tool.id, toolName: tool.name, imagePath: `/images/tools images/${imageFilename}`, imageExists: true, altText: generateAltText(tool.name) }; successful.push(mapping); console.log(`โœ… Successfully mapped: ${tool.name} โ†’ ${imageFilename}`); } else { failed.push({ toolId: tool.id, toolName: tool.name, reason: 'No matching image file found' }); console.log(`โŒ Failed to find image for: ${tool.name}`); } } catch (error) { failed.push({ toolId: tool.id, toolName: tool.name, reason: `Error during processing: ${error instanceof Error ? error.message : 'Unknown error'}` }); console.log(`๐Ÿ’ฅ Error processing ${tool.name}: ${error}`); } } const result: MappingResult = { successful, failed, summary: { totalTools: tools.length, successfulMappings: successful.length, failedMappings: failed.length } }; console.log('\n๐Ÿ“ˆ Mapping Summary:'); console.log(`โœ… Successful mappings: ${result.summary.successfulMappings}`); console.log(`โŒ Failed mappings: ${result.summary.failedMappings}`); console.log(`๐Ÿ“Š Success rate: ${((result.summary.successfulMappings / result.summary.totalTools) * 100).toFixed(1)}%`); if (failed.length > 0) { console.log('\nโŒ Failed mappings details:'); failed.forEach(failure => { console.log(` โ€ข ${failure.toolName} (${failure.toolId}): ${failure.reason}`); }); } return result; } /** * Validates image file format */ export function isValidImageFormat(filename: string): boolean { const validExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.svg']; const extension = filename.toLowerCase().substring(filename.lastIndexOf('.')); return validExtensions.includes(extension); } /** * Generates responsive image HTML with proper styling */ export function generateImageHTML(mapping: ImageMapping): string { return ` <div className="tool-feature-image mb-8 mt-6"> <img src="${mapping.imagePath}" alt="${mapping.altText}" className="w-full max-w-2xl mx-auto rounded-lg shadow-lg object-cover" style={{ maxHeight: '400px', objectFit: 'cover' }} loading="lazy" onError={(e) => { console.error('Failed to load tool image:', '${mapping.imagePath}'); e.currentTarget.style.display = 'none'; }} /> </div> `; }
๐Ÿ“„ promptAnalysis.ts
export const FRAMEWORKS = { MICRO: { name: 'MICRO', fields: ['Message', 'Intention', 'Context', 'Rhythm', 'Output'] }, COSTAR: { name: 'COSTAR', fields: ['Context', 'Offer', 'Style', 'Target', 'Action', 'Result'] }, ICDF: { name: 'ICDF', fields: ['Instruction', 'Context', 'Data', 'Format'] }, RCREOC: { name: 'RCREOC', fields: ['Role', 'Context', 'Request', 'Examples', 'Output', 'Constraints'] } }; export function analyzePromptIntent(input: string): string { const text = input.toLowerCase(); if (/(sell|buy|marketing|email|ad|promotion|campaign|offer)/.test(text)) return 'COSTAR'; if (/(analyze|review|data|metrics|report)/.test(text)) return 'ICDF'; if (/(expert|advice|consult|critique)/.test(text)) return 'RCREOC'; return 'MICRO'; }
๐Ÿ“„ scrollUtils.ts
/** * Scroll utility functions for enhanced user experience * Provides device-adaptive scrolling with smooth animations */ /** * Device detection utility */ export const getDeviceType = (): 'mobile' | 'tablet' | 'desktop' => { const width = window.innerWidth; if (width < 768) { return 'mobile'; } else if (width < 1024) { return 'tablet'; } else { return 'desktop'; } }; /** * Check if device supports smooth scrolling */ export const supportsSmoothScrolling = (): boolean => { return 'scrollBehavior' in document.documentElement.style; }; /** * Scroll to element with device-adaptive behavior */ export interface ScrollToElementOptions { element: HTMLElement | null; behavior?: 'smooth' | 'auto'; block?: 'start' | 'center' | 'end' | 'nearest'; inline?: 'start' | 'center' | 'end' | 'nearest'; offset?: number; duration?: number; } export const scrollToElement = (options: ScrollToElementOptions): Promise<void> => { return new Promise((resolve) => { const { element, behavior = 'smooth', block = 'start', inline = 'nearest', offset = 0, duration = 400 } = options; if (!element) { resolve(); return; } const deviceType = getDeviceType(); const supportsSmooth = supportsSmoothScrolling(); // Calculate target position const elementRect = element.getBoundingClientRect(); const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; let targetScrollTop = currentScrollTop + elementRect.top + offset; // Device-specific adjustments if (deviceType === 'mobile') { // On mobile, add some padding to account for virtual keyboards and mobile UI targetScrollTop -= 20; } else if (deviceType === 'desktop') { // On desktop, center the element better in viewport targetScrollTop -= window.innerHeight * 0.1; } // Ensure we don't scroll past the document bounds const maxScroll = document.documentElement.scrollHeight - window.innerHeight; targetScrollTop = Math.max(0, Math.min(targetScrollTop, maxScroll)); if (supportsSmooth && behavior === 'smooth') { // Use native smooth scrolling if supported element.scrollIntoView({ behavior: 'smooth', block, inline }); // Estimate completion time for native smooth scrolling setTimeout(() => resolve(), duration); } else { // Fallback: manual smooth scrolling animation const startTime = performance.now(); const startScrollTop = currentScrollTop; const distance = targetScrollTop - startScrollTop; const animateScroll = (currentTime: number) => { const elapsed = currentTime - startTime; const progress = Math.min(elapsed / duration, 1); // Easing function (ease-out) const easeOut = 1 - Math.pow(1 - progress, 3); const currentScrollTop = startScrollTop + (distance * easeOut); window.scrollTo(0, currentScrollTop); if (progress < 1) { requestAnimationFrame(animateScroll); } else { resolve(); } }; requestAnimationFrame(animateScroll); } }); }; /** * Scroll to result container with device-adaptive behavior */ export const scrollToResultContainer = async (): Promise<void> => { const resultContainer = document.querySelector('[data-scroll-target="result-container"]') as HTMLElement; if (!resultContainer) { // Fallback: look for result section by class or text content const fallbackContainer = document.querySelector('.space-y-4 h2')?.parentElement as HTMLElement; if (fallbackContainer) { await scrollToElement({ element: fallbackContainer, behavior: 'smooth', block: 'start', offset: -20, duration: 400 }); } return; } const deviceType = getDeviceType(); await scrollToElement({ element: resultContainer, behavior: 'smooth', block: deviceType === 'mobile' ? 'start' : 'center', offset: deviceType === 'mobile' ? -10 : -50, duration: 400 }); }; /** * Scroll to Generate button with consistent behavior */ export const scrollToGenerateButton = async (): Promise<void> => { const generateButton = document.querySelector('[data-scroll-target="generate-button"]') as HTMLElement; if (!generateButton) { // Fallback: look for button with "Generate" text const buttons = Array.from(document.querySelectorAll('button')); const fallbackButton = buttons.find(btn => btn.textContent?.includes('Generate') || btn.textContent?.includes('Generating') ) as HTMLElement; if (fallbackButton) { await scrollToElement({ element: fallbackButton, behavior: 'smooth', block: 'center', offset: -30, duration: 300 }); } return; } await scrollToElement({ element: generateButton, behavior: 'smooth', block: 'center', offset: -30, duration: 300 }); }; /** * Debounce function to prevent excessive scroll calls */ export const debounce = <T extends (...args: any[]) => any>( func: T, wait: number ): ((...args: Parameters<T>) => void) => { let timeout: NodeJS.Timeout; return (...args: Parameters<T>) => { clearTimeout(timeout); timeout = setTimeout(() => func(...args), wait); }; }; /** * Check if element is in viewport */ export const isElementInViewport = (element: HTMLElement): boolean => { const rect = element.getBoundingClientRect(); return ( rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth) ); }; /** * Get optimal scroll position for element visibility */ export const getOptimalScrollPosition = (element: HTMLElement): number => { const elementRect = element.getBoundingClientRect(); const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; const viewportHeight = window.innerHeight; const deviceType = getDeviceType(); // Calculate position to center element in viewport with device-specific adjustments let targetPosition = currentScrollTop + elementRect.top - (viewportHeight / 2) + (elementRect.height / 2); if (deviceType === 'mobile') { // On mobile, position slightly higher to account for virtual keyboard targetPosition -= viewportHeight * 0.1; } // Ensure we don't scroll past document bounds const maxScroll = document.documentElement.scrollHeight - viewportHeight; return Math.max(0, Math.min(targetPosition, maxScroll)); };
๐Ÿ“„ siteConfig.ts
/** * Site configuration utilities for SSR-safe URL generation */ // Get the site origin in an SSR-safe way export const getSiteOrigin = (): string => { // During SSR or build time, use the production URL if (typeof window === 'undefined') { return process.env.SITE_URL || 'https://modernphototools.com'; } // In the browser, use the current origin return window.location.origin; }; // Generate canonical URLs for different page types export const generateCanonicalUrl = (path: string): string => { const origin = getSiteOrigin(); return `${origin}${path.startsWith('/') ? path : `/${path}`}`; }; // Generate OG image URLs export const generateOgImageUrl = (imagePath: string): string => { if (!imagePath) return ''; const origin = getSiteOrigin(); return imagePath.startsWith('http') ? imagePath : `${origin}${imagePath}`; };
๐Ÿ“„ testImageMapping.ts
/** * Test script to verify the image mapping system * This script validates image-to-tool mappings and reports any issues */ import { tools } from '../data/tools'; import { findToolImage, generateAltText, createToolImageMapping } from './imageMapper'; interface TestResult { toolId: string; toolName: string; imageFound: boolean; imagePath?: string; altText?: string; error?: string; } interface TestSummary { totalTools: number; successfulMappings: number; failedMappings: number; results: TestResult[]; errors: string[]; } /** * Test the image mapping system for all tools */ export async function testImageMapping(): Promise<TestSummary> { console.log('๐Ÿงช Starting image mapping test...'); const results: TestResult[] = []; const errors: string[] = []; let successfulMappings = 0; let failedMappings = 0; for (const tool of tools) { try { console.log(`\n๐Ÿ” Testing tool: ${tool.name} (ID: ${tool.id})`); const imageFilename = await findToolImage(tool.id, tool.name); if (imageFilename) { const altText = generateAltText(tool.name); results.push({ toolId: tool.id, toolName: tool.name, imageFound: true, imagePath: `/images/tools images/${imageFilename}`, altText }); successfulMappings++; console.log(` โœ… Found image: ${imageFilename}`); console.log(` ๐Ÿ“ Alt text: ${altText}`); } else { results.push({ toolId: tool.id, toolName: tool.name, imageFound: false }); failedMappings++; console.log(` โŒ No image found`); } } catch (error) { const errorMessage = `Error testing ${tool.name}: ${error instanceof Error ? error.message : String(error)}`; errors.push(errorMessage); results.push({ toolId: tool.id, toolName: tool.name, imageFound: false, error: errorMessage }); failedMappings++; console.error(` ๐Ÿ’ฅ ${errorMessage}`); } } const summary: TestSummary = { totalTools: tools.length, successfulMappings, failedMappings, results, errors }; console.log('\n๐Ÿ“Š Test Summary:'); console.log(` Total tools: ${summary.totalTools}`); console.log(` Successful mappings: ${summary.successfulMappings}`); console.log(` Failed mappings: ${summary.failedMappings}`); console.log(` Success rate: ${((summary.successfulMappings / summary.totalTools) * 100).toFixed(1)}%`); if (summary.errors.length > 0) { console.log('\nโŒ Errors encountered:'); summary.errors.forEach(error => console.log(` - ${error}`)); } return summary; } /** * Test image accessibility and format validation */ export async function testImageAccessibility(): Promise<void> { console.log('\n๐Ÿ” Testing image accessibility...'); const mappingResult = await createToolImageMapping(); for (const mapping of mappingResult.successful) { const imagePath = `/images/tools images/${mapping.imagePath}`; // Test if image can be loaded (in a real browser environment) try { // This would be more comprehensive in a browser environment console.log(` โœ… Image accessible: ${imagePath}`); console.log(` Alt text: ${mapping.altText}`); console.log(` Format: ${mapping.imagePath.split('.').pop()?.toUpperCase()}`); } catch (error) { console.error(` โŒ Image not accessible: ${imagePath}`); } } } /** * Generate a detailed report of the mapping results */ export function generateMappingReport(summary: TestSummary): string { let report = '# Image Mapping Test Report\n\n'; report += `## Summary\n`; report += `- **Total Tools**: ${summary.totalTools}\n`; report += `- **Successful Mappings**: ${summary.successfulMappings}\n`; report += `- **Failed Mappings**: ${summary.failedMappings}\n`; report += `- **Success Rate**: ${((summary.successfulMappings / summary.totalTools) * 100).toFixed(1)}%\n\n`; report += `## Successful Mappings\n\n`; const successfulResults = summary.results.filter(r => r.imageFound); successfulResults.forEach(result => { report += `### ${result.toolName}\n`; report += `- **Tool ID**: ${result.toolId}\n`; report += `- **Image Path**: ${result.imagePath}\n`; report += `- **Alt Text**: ${result.altText}\n\n`; }); report += `## Failed Mappings\n\n`; const failedResults = summary.results.filter(r => !r.imageFound); failedResults.forEach(result => { report += `### ${result.toolName}\n`; report += `- **Tool ID**: ${result.toolId}\n`; report += `- **Status**: No matching image found\n`; if (result.error) { report += `- **Error**: ${result.error}\n`; } report += '\n'; }); if (summary.errors.length > 0) { report += `## Errors\n\n`; summary.errors.forEach(error => { report += `- ${error}\n`; }); } return report; } /** * Run all tests and log results */ export async function runAllTests(): Promise<void> { console.log('๐Ÿš€ Running comprehensive image mapping tests...\n'); try { // Test basic mapping const summary = await testImageMapping(); // Test accessibility await testImageAccessibility(); // Generate report const report = generateMappingReport(summary); console.log('\n๐Ÿ“„ Generated mapping report'); console.log('\nโœ… All tests completed successfully!'); return summary; } catch (error) { console.error('๐Ÿ’ฅ Test execution failed:', error); throw error; } }
๐Ÿ“„ videoMapping.ts
// Video URL mapping for tools export const videoUrlMapping: Record<string, string> = { 'AI Prompt Generator': '/tools videos/AI Prompt Generator.mp4', 'Remove Background': '/tools videos/Remove Background.mp4', 'AI Cleanup': '/tools videos/AI Cleanup.mp4', 'AI Expand': '/tools videos/AI Expand.mp4', 'AI Replace': '/tools videos/AI Replace.mp4', 'AI Cartoon': '/tools videos/AI Cartoon.mp4', 'AI Caricature': '/tools videos/AI Caricature.mp4', 'AI Avatar': '/tools videos/AI Avatar.mp4', 'AI Product Photoshoot': '/tools videos/AI Product Photoshoot.mp4', 'AI Background Generator': '/tools videos/AI Background Generator.mp4', 'AI Image Generator': '/tools videos/AI Image Generator_text-to-image.mp4', 'AI Portrait': '/tools videos/AI Portrait.mp4', 'AI Face Swap': '/tools videos/AI Face Swap.mp4', 'AI Outfit': '/tools videos/AI Outfit.mp4', 'AI Image to Image': '/tools videos/AI Image to Image.mp4', 'AI Sketch to Image': '/tools videos/AI Sketch to Image.mp4', 'AI Hairstyle': '/tools videos/AI Hairstyle.mp4', 'AI Image Upscaler': '/tools videos/AI Image Upscaler.mp4', 'AI Filter': '/tools videos/AI Filter.mp4', 'Watermark Remover': '/tools videos/Watermark Remover.mp4' }; // Function to get video URL for a tool export const getVideoUrl = (toolName: string): string | undefined => { return videoUrlMapping[toolName]; };
๐Ÿ“„ vite-env.d.ts
/// <reference types="vite/client" />
๐Ÿ“„ tailwind.config.js
/** @type {import('tailwindcss').Config} */ export default { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], theme: { extend: {}, }, plugins: [], };
๐Ÿ“„ tsconfig.app.json
{ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, "include": ["src"] }
๐Ÿ“„ tsconfig.json
{ "files": [], "references": [ { "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" } ] }
๐Ÿ“„ tsconfig.node.json
{ "compilerOptions": { "target": "ES2022", "lib": ["ES2023"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, "include": ["vite.config.ts"] }
๐Ÿ“„ update-multimedia-sitemap.mjs
๐Ÿ“„ vite.config.ts
import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], // This build object is new. build: { // Keep client-side build in 'dist' outDir: 'dist', // This generates a manifest file needed for SSG manifest: true, }, ssr: { // Handle CommonJS modules in SSR noExternal: ['react-helmet-async'] }, server: { proxy: { '/api/external': { target: 'https://api.lightxeditor.com', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/external/, '/external') }, '/api/lightx-proxy': { target: 'http://localhost:3001', changeOrigin: true }, '/api/optimize-prompt': { target: 'http://localhost:3001', changeOrigin: true } }, open: true, } })